diff --git a/app/Console/Commands/BillReminder.php b/app/Console/Commands/BillReminder.php index 5559ebe3a..1e460d0d6 100644 --- a/app/Console/Commands/BillReminder.php +++ b/app/Console/Commands/BillReminder.php @@ -73,7 +73,7 @@ class BillReminder extends Command $date = Date::today()->addDays($day)->toDateString(); // Get upcoming bills - $bills = Bill::with('vendor')->due($date)->get(); + $bills = Bill::with('vendor')->accrued()->due($date)->get(); foreach ($bills as $bill) { // Notify all users assigned to this company diff --git a/app/Console/Commands/InvoiceReminder.php b/app/Console/Commands/InvoiceReminder.php index f29bfb21d..73a8e025f 100644 --- a/app/Console/Commands/InvoiceReminder.php +++ b/app/Console/Commands/InvoiceReminder.php @@ -73,7 +73,7 @@ class InvoiceReminder extends Command $date = Date::today()->subDays($day)->toDateString(); // Get upcoming bills - $invoices = Invoice::with('customer')->due($date)->get(); + $invoices = Invoice::with('customer')->accrued()->due($date)->get(); foreach ($invoices as $invoice) { // Notify the customer diff --git a/app/Models/Expense/Bill.php b/app/Models/Expense/Bill.php index 769d98ecc..e6b7d1657 100644 --- a/app/Models/Expense/Bill.php +++ b/app/Models/Expense/Bill.php @@ -100,7 +100,7 @@ class Bill extends Model public function scopeAccrued($query) { - return $query->where('bill_status_code', '!=', 'new'); + return $query->where('bill_status_code', '<>', 'draft'); } public function onCloning($src, $child = null) diff --git a/app/Models/Income/Invoice.php b/app/Models/Income/Invoice.php index 73638bbec..859bc050e 100644 --- a/app/Models/Income/Invoice.php +++ b/app/Models/Income/Invoice.php @@ -108,7 +108,7 @@ class Invoice extends Model public function scopeAccrued($query) { - return $query->where('invoice_status_code', '!=', 'draft'); + return $query->where('invoice_status_code', '<>', 'draft'); } public function onCloning($src, $child = null)