From a3a406b12263e12b7f1e2db1795202b4e51ee245 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Jun 2021 08:41:15 +1000 Subject: [PATCH] Set Exchange Rates on invoice when marked as paid --- app/Services/Invoice/MarkPaid.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index df3cc60f8a7c..ff1e0a4b5c93 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -66,7 +66,7 @@ class MarkPaid extends AbstractService $payment->save(); $this->setExchangeRate($payment); - + $payment->invoices()->attach($this->invoice->id, [ 'amount' => $payment->amount, ]); @@ -74,6 +74,7 @@ class MarkPaid extends AbstractService $this->invoice->next_send_date = null; $this->invoice->service() + ->setExchangeRate() ->updateBalance($payment->amount * -1) ->updatePaidToDate($payment->amount) ->setStatus(Invoice::STATUS_PAID)