From 288ec04376b1ddf36f7fc58ae34c6bd4bc9ebe32 Mon Sep 17 00:00:00 2001 From: Parag Bhilkar Date: Fri, 22 Aug 2014 19:56:15 +0530 Subject: [PATCH] Remove notice and add string format for priceset in online contribution message templates. --- CRM/Contribute/Form/Contribution.php | 2 +- CRM/Event/Form/Participant.php | 6 +++--- .../message_templates/contribution_online_receipt_html.tpl | 2 +- .../message_templates/contribution_online_receipt_text.tpl | 2 +- .../message_templates/contribution_online_receipt_html.tpl | 2 +- .../message_templates/contribution_online_receipt_text.tpl | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 93c5de0145..4096c0ba1d 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1361,7 +1361,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP } foreach ($line as $key => $value) { foreach ($value as $v) { - if (isset($taxRate[(string) $v['tax_rate']])) { + if (isset($taxRate[(string) CRM_Utils_Array::value('tax_rate', $v)])) { $taxRate[(string) $v['tax_rate']] = $taxRate[(string) $v['tax_rate']] + CRM_Utils_Array::value('tax_amount', $v); } else { diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 2e5c7801e4..dd18b804a6 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1702,11 +1702,11 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task { foreach ($line as $key => $value) { if (isset($value['tax_amount'])) { $totalTaxAmount += $value['tax_amount']; - if (isset($dataArray[$value['tax_rate']])) { - $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value); + if (isset($dataArray[(string) $value['tax_rate']])) { + $dataArray[(string) $value['tax_rate']] = $dataArray[(string) $value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value); } else { - $dataArray[$value['tax_rate']] = CRM_Utils_Array::value('tax_amount', $value); + $dataArray[(string) $value['tax_rate']] = CRM_Utils_Array::value('tax_amount', $value); } } } diff --git a/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_html.tpl b/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_html.tpl index f920d3eff5..9e583abde0 100644 --- a/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_html.tpl +++ b/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_html.tpl @@ -112,7 +112,7 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -  {$taxTerm} {$priceset}% +  {$taxTerm} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else}  {ts}No{/ts} {$taxTerm} diff --git a/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_text.tpl b/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_text.tpl index 6b36b189a4..c6328bc46e 100644 --- a/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_text.tpl +++ b/CRM/Upgrade/4.5.beta5.msg_template/message_templates/contribution_online_receipt_text.tpl @@ -40,7 +40,7 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -{$taxTerm} {$priceset}%: {$value|crmMoney:$currency} +{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} {else} {ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/contribution_online_receipt_html.tpl b/xml/templates/message_templates/contribution_online_receipt_html.tpl index f920d3eff5..9e583abde0 100644 --- a/xml/templates/message_templates/contribution_online_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_html.tpl @@ -112,7 +112,7 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -  {$taxTerm} {$priceset}% +  {$taxTerm} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else}  {ts}No{/ts} {$taxTerm} diff --git a/xml/templates/message_templates/contribution_online_receipt_text.tpl b/xml/templates/message_templates/contribution_online_receipt_text.tpl index 6b36b189a4..c6328bc46e 100644 --- a/xml/templates/message_templates/contribution_online_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_text.tpl @@ -40,7 +40,7 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -{$taxTerm} {$priceset}%: {$value|crmMoney:$currency} +{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} {else} {ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} {/if} -- 2.25.1