From a00a0afc2318e39efc1d2a85fdcfd1541eb493e2 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Mon, 24 Oct 2022 11:00:18 -0400 Subject: [PATCH] ensure currency is included to avoid translation problems See https://lab.civicrm.org/dev/core/-/issues/411 --- CRM/Financial/BAO/Payment.php | 2 ++ .../payment_or_refund_notification_html.tpl | 10 +++++----- .../payment_or_refund_notification_text.tpl | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php index f3fdfdadc0..2611cba99e 100644 --- a/CRM/Financial/BAO/Payment.php +++ b/CRM/Financial/BAO/Payment.php @@ -397,6 +397,7 @@ class CRM_Financial_BAO_Payment { 'contactDisplayName' => $entities['contact']['display_name'], 'emailGreeting' => $entities['contact']['email_greeting'], 'totalAmount' => $entities['payment']['total'], + 'currency' => $entities['payment']['currency'], 'amountOwed' => $entities['payment']['balance'], 'totalPaid' => $entities['payment']['paid'], 'paymentAmount' => $entities['payment']['total_amount'], @@ -431,6 +432,7 @@ class CRM_Financial_BAO_Payment { $testedTemplateVariables = [ 'contactDisplayName', 'totalAmount', + 'currency', 'amountOwed', 'paymentAmount', 'event', diff --git a/xml/templates/message_templates/payment_or_refund_notification_html.tpl b/xml/templates/message_templates/payment_or_refund_notification_html.tpl index f9706882fe..118435dc6d 100644 --- a/xml/templates/message_templates/payment_or_refund_notification_html.tpl +++ b/xml/templates/message_templates/payment_or_refund_notification_html.tpl @@ -44,7 +44,7 @@ {ts}This Refund Amount{/ts} - {$refundAmount|crmMoney} + {$refundAmount|crmMoney:$currency} {else} @@ -56,7 +56,7 @@ {ts}This Payment Amount{/ts} - {$paymentAmount|crmMoney} + {$paymentAmount|crmMoney:$currency} {/if} @@ -110,7 +110,7 @@ {ts}Total Fee{/ts} - {$totalAmount|crmMoney} + {$totalAmount|crmMoney:$currency} {/if} @@ -120,7 +120,7 @@ {ts}Total Paid{/ts} - {$totalPaid|crmMoney} + {$totalPaid|crmMoney:$currency} {/if} @@ -130,7 +130,7 @@ {ts}Balance Owed{/ts} - {$amountOwed|crmMoney} + {$amountOwed|crmMoney:$currency} {* This will be zero after final payment. *} {/if} diff --git a/xml/templates/message_templates/payment_or_refund_notification_text.tpl b/xml/templates/message_templates/payment_or_refund_notification_text.tpl index 396359eedf..96657fddbb 100644 --- a/xml/templates/message_templates/payment_or_refund_notification_text.tpl +++ b/xml/templates/message_templates/payment_or_refund_notification_text.tpl @@ -16,7 +16,7 @@ {ts}Refund Details{/ts} =============================================================================== -{ts}This Refund Amount{/ts}: {$refundAmount|crmMoney} +{ts}This Refund Amount{/ts}: {$refundAmount|crmMoney:$currency} ------------------------------------------------------------------------------------ {else} @@ -25,7 +25,7 @@ {ts}Payment Details{/ts} =============================================================================== -{ts}This Payment Amount{/ts}: {$paymentAmount|crmMoney} +{ts}This Payment Amount{/ts}: {$paymentAmount|crmMoney:$currency} ------------------------------------------------------------------------------------ {/if} {if $receive_date} @@ -47,13 +47,13 @@ =============================================================================== {if $totalAmount} -{ts}Total Fee{/ts}: {$totalAmount|crmMoney} +{ts}Total Fee{/ts}: {$totalAmount|crmMoney:$currency} {/if} {if $totalPaid} -{ts}Total Paid{/ts}: {$totalPaid|crmMoney} +{ts}Total Paid{/ts}: {$totalPaid|crmMoney:$currency} {/if} {if $amountOwed} -{ts}Balance Owed{/ts}: {$amountOwed|crmMoney} {* This will be zero after final payment. *} +{ts}Balance Owed{/ts}: {$amountOwed|crmMoney:$currency} {* This will be zero after final payment. *} {/if} -- 2.25.1