Update end date calculation in SendInvoiceDataReport to add one day and set time to 10:00 AM
This commit is contained in:
@@ -90,7 +90,10 @@ class SendInvoiceDataReport extends Command
|
|||||||
|
|
||||||
if ($firstRecord && $lastRecord) {
|
if ($firstRecord && $lastRecord) {
|
||||||
$startDate = \Carbon\Carbon::parse($firstRecord->document_date)->startOfDay();
|
$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
|
else
|
||||||
{
|
{
|
||||||
@@ -127,6 +130,11 @@ class SendInvoiceDataReport extends Command
|
|||||||
continue;
|
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
|
// Filter invoices directly — exclude ones with '-' in document_number
|
||||||
$invoices = $invoices->filter(function ($inv) {
|
$invoices = $invoices->filter(function ($inv) {
|
||||||
|
|||||||
Reference in New Issue
Block a user