diff --git a/app/Console/Commands/SendInvoiceDataReport.php b/app/Console/Commands/SendInvoiceDataReport.php index 2f98f2e..0fb9795 100644 --- a/app/Console/Commands/SendInvoiceDataReport.php +++ b/app/Console/Commands/SendInvoiceDataReport.php @@ -90,7 +90,10 @@ class SendInvoiceDataReport extends Command if ($firstRecord && $lastRecord) { $startDate = \Carbon\Carbon::parse($firstRecord->document_date)->startOfDay(); - $endDate = \Carbon\Carbon::parse($lastRecord->document_date)->endOfDay(); + //$endDate = \Carbon\Carbon::parse($lastRecord->document_date)->endOfDay(); + $endDate = \Carbon\Carbon::parse($lastRecord->document_date) + ->addDay() + ->setTime(10, 0, 0); } else { @@ -127,6 +130,11 @@ class SendInvoiceDataReport extends Command continue; } + // $lastInvoiceDate = $invoices->max('document_date'); + // $extendedEndDate = \Carbon\Carbon::parse($lastInvoiceDate) + // ->addDay() // +1 day + // ->setTime(10, 0, 0); // 10:00 AM + // Filter invoices directly — exclude ones with '-' in document_number $invoices = $invoices->filter(function ($inv) {