Merge pull request #4489 from turbo124/v5-develop
Fix for doubling client balance erroneously on emailing"
This commit is contained in:
commit
5a66069833
2 changed files with 7 additions and 2 deletions
|
|
@ -132,8 +132,6 @@ class EmailController extends BaseController
|
|||
}
|
||||
});
|
||||
|
||||
$entity_obj = $entity_obj->service()->markSent()->save();
|
||||
|
||||
$entity_obj->last_sent_date = now();
|
||||
$entity_obj->save();
|
||||
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue