mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
7e3f1f19ec
commit
b3f753cbf3
@ -47,12 +47,6 @@ class MarkSent extends AbstractService
|
|||||||
->updateBalance($adjustment, true)
|
->updateBalance($adjustment, true)
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
/*Adjust client balance*/
|
|
||||||
$this->client
|
|
||||||
->service()
|
|
||||||
->updateBalance($adjustment)
|
|
||||||
->save();
|
|
||||||
|
|
||||||
/*Update ledger*/
|
/*Update ledger*/
|
||||||
$this->invoice
|
$this->invoice
|
||||||
->ledger()
|
->ledger()
|
||||||
@ -68,6 +62,12 @@ class MarkSent extends AbstractService
|
|||||||
->setReminder()
|
->setReminder()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
|
/*Adjust client balance*/
|
||||||
|
$this->client->fresh();
|
||||||
|
$this->client->balance += $adjustment;
|
||||||
|
$this->client->save();
|
||||||
|
|
||||||
|
|
||||||
$this->invoice->markInvitationsSent();
|
$this->invoice->markInvitationsSent();
|
||||||
|
|
||||||
event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
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
|
//client->balance should = 10
|
||||||
$invoice->service()->markSent()->save();
|
$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();
|
$invoice_ledger = $invoice->company_ledger->sortByDesc('id')->first();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user