Catch missing invoices not returned

This commit is contained in:
David Bomba
2026-01-27 13:34:31 +11:00
parent ef3b49804a
commit 0c2e5f021f

View File

@@ -828,6 +828,11 @@ class TemplateService
foreach ($refund['invoices'] as $refunded_invoice) { foreach ($refund['invoices'] as $refunded_invoice) {
$invoice = Invoice::withTrashed()->find($refunded_invoice['invoice_id']); $invoice = Invoice::withTrashed()->find($refunded_invoice['invoice_id']);
if (!$invoice) {
continue;
}
$amount = Number::formatMoney($refunded_invoice['amount'], $payment->client); $amount = Number::formatMoney($refunded_invoice['amount'], $payment->client);
$notes = ctrans('texts.status_partially_refunded_amount', ['amount' => $amount]); $notes = ctrans('texts.status_partially_refunded_amount', ['amount' => $amount]);