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

Merge pull request #4489 from turbo124/v5-develop

Fix for doubling client balance erroneously on emailing"
This commit is contained in:
David Bomba 2020-12-13 11:05:16 +11:00 committed by GitHub
commit 5a66069833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -132,8 +132,6 @@ class EmailController extends BaseController
}
});
$entity_obj = $entity_obj->service()->markSent()->save();
$entity_obj->last_sent_date = now();
$entity_obj->save();

View File

@ -37,6 +37,9 @@ class MarkSent extends AbstractService
return $this->invoice;
}
info("in mark sent");
info($this->invoice->balance);
$this->invoice->markInvitationsSent();
$this->invoice->setReminder();
@ -49,8 +52,12 @@ class MarkSent extends AbstractService
->updateBalance($this->invoice->amount)
->save();
info($this->invoice->balance);
$this->client->service()->updateBalance($this->invoice->balance)->save();
info($this->client->balance);
$this->invoice->ledger()->updateInvoiceBalance($this->invoice->balance);
event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars()));