diff --git a/app/Http/Controllers/EmailController.php b/app/Http/Controllers/EmailController.php index 8bd6648a7ad4..e639340df6dd 100644 --- a/app/Http/Controllers/EmailController.php +++ b/app/Http/Controllers/EmailController.php @@ -132,8 +132,6 @@ class EmailController extends BaseController } }); - $entity_obj = $entity_obj->service()->markSent()->save(); - $entity_obj->last_sent_date = now(); $entity_obj->save(); diff --git a/app/Services/Invoice/MarkSent.php b/app/Services/Invoice/MarkSent.php index ed8c8daaa7f1..839f484f0dc6 100644 --- a/app/Services/Invoice/MarkSent.php +++ b/app/Services/Invoice/MarkSent.php @@ -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()));