1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Minor fixes for company ledger

This commit is contained in:
David Bomba 2022-10-13 20:28:50 +11:00
parent 0892b6035f
commit f0b9bb3673
2 changed files with 3 additions and 2 deletions

View File

@ -712,6 +712,7 @@ class CheckData extends Command
->pluck('p')
->first();
$over_payment = $over_payment*-1;
$this->logMessage("# {$client->id} # {$client->name} {$client->balance} is invalid should be {$over_payment}");
@ -719,7 +720,7 @@ class CheckData extends Command
$this->logMessage("# {$client->id} " . $client->present()->name().' - '.$client->number." Fixing {$client->balance} to 0");
$client->balance = $over_payment * -1;
$client->balance = $over_payment;
$client->save();
}

View File

@ -51,7 +51,7 @@ class ClientLedgerBalanceUpdate implements ShouldQueue
MultiDB::setDb($this->company->db);
CompanyLedger::where('balance', 0)->where('client_id', $this->client->id)->cursor()->each(function ($company_ledger) {
CompanyLedger::where('balance', 0)->where('client_id', $this->client->id)->orderBy('updated_at', 'ASC')->cursor()->each(function ($company_ledger) {
if ($company_ledger->balance > 0) {
return;
}