diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index a267d1f41b74..3fb5e91428ed 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -82,10 +82,15 @@ class UpdateInvoicePayment ->updateBalance($paid_amount * -1) ->updatePaidToDate($paid_amount) ->updateStatus() - ->deletePdf() - ->workFlow() ->save(); + $invoice->refresh(); + + $invoice->service() + ->deletePdf() + ->workFlow() + ->save(); + event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); });