- fix invoice status not updating issue

- date range selection issues on report for non-english languages
- fix invoice all tab issue (always showing draft even in all tab)
This commit is contained in:
Harsh Jagad
2022-02-24 05:22:32 +00:00
committed by Mohit Panjwani
parent 7202fdcbf2
commit 1322ed15dc
15 changed files with 268 additions and 61 deletions

View File

@ -40,7 +40,9 @@ class CheckInvoiceStatus extends Command
public function handle()
{
$date = Carbon::now();
$invoices = Invoice::where('status', '<>', Invoice::STATUS_COMPLETED)->whereDate('due_date', '<', $date)->get();
$invoices = Invoice::whereNotIn('status', [Invoice::STATUS_COMPLETED, Invoice::STATUS_DRAFT])
->whereDate('due_date', '<', $date)
->get();
foreach ($invoices as $invoice) {
$invoice->status = Invoice::STATUS_OVERDUE;