mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Minor fixes for company ledger
This commit is contained in:
parent
0892b6035f
commit
f0b9bb3673
@ -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();
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user