1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Fixes for tests

This commit is contained in:
David Bomba 2022-03-29 19:57:14 +11:00
parent 7e3f1f19ec
commit b3f753cbf3
2 changed files with 8 additions and 7 deletions

View File

@ -47,12 +47,6 @@ class MarkSent extends AbstractService
->updateBalance($adjustment, true)
->save();
/*Adjust client balance*/
$this->client
->service()
->updateBalance($adjustment)
->save();
/*Update ledger*/
$this->invoice
->ledger()
@ -68,6 +62,12 @@ class MarkSent extends AbstractService
->setReminder()
->save();
/*Adjust client balance*/
$this->client->fresh();
$this->client->balance += $adjustment;
$this->client->save();
$this->invoice->markInvitationsSent();
event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));

View File

@ -182,7 +182,8 @@ class CompanyLedgerTest extends TestCase
//client->balance should = 10
$invoice->service()->markSent()->save();
$this->assertEquals($invoice->client->balance, 10);
$this->client = Client::find($this->client->id);
$this->assertEquals($this->client->balance, 10);
$invoice_ledger = $invoice->company_ledger->sortByDesc('id')->first();