From 4318423a05814a3931700705bbb54452f4f0343c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 19 Nov 2020 14:53:32 +1100 Subject: [PATCH] fixes for check data --- app/Console/Commands/CheckData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 2e22effc46cb..85203e305986 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -383,7 +383,7 @@ class CheckData extends Command $wrong_paid_to_dates = 0; foreach (Client::cursor() as $client) { - $invoice_balance = $client->invoices->where('is_deleted', false)->sum('balance'); + $invoice_balance = $client->invoices->where('is_deleted', false)->where('status_id', '>', 1)->sum('balance'); $ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();