diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 50ec11688f70..26a360722a98 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -301,7 +301,7 @@ class CheckData extends Command $invoice_balance = $client->invoices->where('is_deleted', false)->where('status_id', '>', 1)->sum('balance'); $credit_balance = $client->credits->where('is_deleted', false)->sum('balance'); - $invoice_balance += $credit_balance; + $invoice_balance -= $credit_balance; $ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first(); @@ -390,7 +390,7 @@ class CheckData extends Command $invoice_balance = Invoice::where('client_id', $client->id)->where('is_deleted', false)->where('status_id', '>', 1)->withTrashed()->sum('balance'); $client_balance = Credit::where('client_id', $client->id)->where('is_deleted', false)->withTrashed()->sum('balance'); - $invoice_balance += $client_balance; + $invoice_balance -= $client_balance; $ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();