Merge Invoice and Bill into Document

This commit is contained in:
Burak Çakırel
2020-12-24 01:28:38 +03:00
parent 830cc05957
commit 0c1424db47
436 changed files with 31655 additions and 37350 deletions

View File

@@ -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());