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:
parent
7e3f1f19ec
commit
b3f753cbf3
@ -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)));
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user