From 3a9ca8e6e1a49f03e403d1183f11beae9baf6449 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 8 Aug 2021 11:02:41 +1000 Subject: [PATCH] Fixes for refunding archived invoices --- app/Services/Payment/RefundPayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index 4329ed5daa18..61ecfe7dd953 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -232,7 +232,7 @@ class RefundPayment if (isset($this->refund_data['invoices']) && count($this->refund_data['invoices']) > 0) { foreach ($this->refund_data['invoices'] as $refunded_invoice) { - $invoice = Invoice::find($refunded_invoice['invoice_id']); + $invoice = Invoice::withTrashed()->find($refunded_invoice['invoice_id']); $invoice->service()->updateBalance($refunded_invoice['amount'])->save(); $invoice->ledger()->updateInvoiceBalance($refunded_invoice['amount'], "Refund of payment # {$this->payment->number}")->save();