diff --git a/app/Console/Commands/SendInvoiceDataReport.php b/app/Console/Commands/SendInvoiceDataReport.php index f82b58f..5087478 100644 --- a/app/Console/Commands/SendInvoiceDataReport.php +++ b/app/Console/Commands/SendInvoiceDataReport.php @@ -297,11 +297,22 @@ class SendInvoiceDataReport extends Command // $documentDate = \Carbon\Carbon::parse($inv->document_date); // $now = \Carbon\Carbon::now(); - $endDate = now()->copy()->subDay()->setTime(10, 0, 0); + //$endDate = now()->copy()->subDay()->setTime(10, 0, 0); //$hoursDiff = $documentDate->diffInHours($now); - $statusColor = $endDate <= $inv->document_date ? 'status-pending-yellow' : 'status-pending-red'; + //$statusColor = $endDate <= $inv->document_date ? 'status-pending-yellow' : 'status-pending-red'; + + $yesterday = now()->subDay()->toDateString(); + $today = now()->toDateString(); + + $documentDate = \Carbon\Carbon::parse($inv->document_date); + + if (in_array($documentDate->toDateString(), [$today, $yesterday])) { + $statusColor = 'status-pending-yellow'; + } else { + $statusColor = 'status-pending-red'; + } $tableData[] = [ 'no' => $no++,