From 172e5be31eaa2c3dba7a7bd1b1f7b7358c674701 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 15:22:19 +1100 Subject: [PATCH] Fixes for refunded payment --- app/Jobs/Payment/EmailRefundPayment.php | 2 +- app/Mail/Engine/PaymentEmailEngine.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Payment/EmailRefundPayment.php b/app/Jobs/Payment/EmailRefundPayment.php index 8539cceb55..6059fecb29 100644 --- a/app/Jobs/Payment/EmailRefundPayment.php +++ b/app/Jobs/Payment/EmailRefundPayment.php @@ -83,7 +83,7 @@ class EmailRefundPayment implements ShouldQueue App::setLocale($this->contact->preferredLocale()); $t->replace(Ninja::transformTranslations($this->settings)); - $template_data['body'] = ctrans('texts.refunded_payment') . ' $amount

$invoices'; + $template_data['body'] = ctrans('texts.refunded_payment') . ' $payment.refunded

$invoices'; $template_data['subject'] = ctrans('texts.refunded_payment'); $email_builder = (new PaymentEmailEngine($this->payment, $this->contact, $template_data))->build(); diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index 28f3220660..76ed96493f 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -143,6 +143,7 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$payment.number'] = &$data['$number']; $data['$entity'] = ['value' => '', 'label' => ctrans('texts.payment')]; $data['$payment.amount'] = ['value' => Number::formatMoney($this->payment->amount, $this->client) ?: ' ', 'label' => ctrans('texts.amount')]; + $data['$payment.refunded'] = ['value' => Number::formatMoney($this->payment->refunded, $this->client) ?: ' ', 'label' => ctrans('texts.refund')]; $data['$amount'] = &$data['$payment.amount']; $data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')]; $data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')];