Merge Invoice and Bill into Document
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Events\Purchase\BillReminded;
|
||||
use App\Events\Document\DocumentReminded;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Purchase\Bill;
|
||||
use App\Models\Document\Document;
|
||||
use App\Utilities\Overrider;
|
||||
use Date;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -80,11 +80,11 @@ class BillReminder extends Command
|
||||
$date = Date::today()->addDays($day)->toDateString();
|
||||
|
||||
// Get upcoming bills
|
||||
$bills = Bill::with('contact')->accrued()->notPaid()->due($date)->cursor();
|
||||
$bills = Document::bill()->with('contact')->accrued()->notPaid()->due($date)->cursor();
|
||||
|
||||
foreach ($bills as $bill) {
|
||||
try {
|
||||
event(new BillReminded($bill));
|
||||
event(new DocumentReminded($bill));
|
||||
} catch (\Exception | \Throwable | \Swift_RfcComplianceException | \Illuminate\Database\QueryException $e) {
|
||||
$this->error($e->getMessage());
|
||||
|
||||
|
Reference in New Issue
Block a user