Refactor invoice retrieval in SendInvoiceDataReport to use unique document numbers and maintain order
This commit is contained in:
@@ -119,8 +119,9 @@ class SendInvoiceDataReport extends Command
|
||||
->whereBetween('document_date', [$startDate, $endDate])
|
||||
->orderBy('document_date', 'asc')
|
||||
->select('customer_code', 'document_number', 'document_date', 'customer_trade_name', 'customer_location')
|
||||
->distinct('document_number')
|
||||
->get();
|
||||
->get()
|
||||
->unique('document_number')
|
||||
->values();
|
||||
|
||||
if ($invoices->isEmpty()) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user