From dd4dbf566b7a519aae0ed1c7d085b781d146cc98 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 27 Aug 2021 14:32:49 +1000 Subject: [PATCH] save payment earlier --- app/Services/Invoice/MarkPaid.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index 8b8d700c6b1d..a23e42a378fb 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -53,6 +53,7 @@ class MarkPaid extends AbstractService $payment->amount = $this->invoice->balance; $payment->applied = $this->invoice->balance; $payment->number = $this->getNextPaymentNumber($this->invoice->client); + $payment->save(); $payment->status_id = Payment::STATUS_COMPLETED; $payment->client_id = $this->invoice->client_id; $payment->transaction_reference = ctrans('texts.manual_entry');