From b0800b2c44505b29dbbe798b5cab6517430f7a97 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 6 Jun 2021 07:54:13 +0000 Subject: [PATCH] [php8-compat][REF] Fix api_v3_contributionpagetest on php8 --- .../contribution_invoice_receipt_html.tpl | 20 +++++++++---------- .../contribution_offline_receipt_html.tpl | 4 ++-- .../contribution_offline_receipt_text.tpl | 6 +++--- .../contribution_online_receipt_html.tpl | 4 ++-- .../contribution_online_receipt_text.tpl | 6 +++--- .../event_offline_receipt_html.tpl | 6 +++--- .../event_offline_receipt_text.tpl | 4 ++-- .../event_online_receipt_html.tpl | 4 ++-- .../event_online_receipt_text.tpl | 4 ++-- .../membership_offline_receipt_html.tpl | 6 +++--- .../membership_offline_receipt_text.tpl | 4 ++-- .../membership_online_receipt_html.tpl | 4 ++-- .../membership_online_receipt_text.tpl | 4 ++-- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index 91ab088c22..0ee9691750 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -75,7 +75,7 @@ {ts}Description{/ts} {ts}Quantity{/ts} {ts}Unit Price{/ts} - {$taxTerm} + {if isset($taxTerm)}{$taxTerm}{/if} {ts 1=$currency}Amount %1{/ts} {foreach from=$lineItem item=value key=priceset name=taxpricevalue} @@ -97,9 +97,9 @@ {$value.qty} {$value.unit_price|crmMoney:$currency} {if $value.tax_amount != ''} - {$value.tax_rate}% + {if isset($value.tax_rate)}{$value.tax_rate}%{/if} {else} - {ts 1=$taxTerm}-{/ts} + {if isset($taxTerm)}{ts 1=$taxTerm}-{/ts}{/if} {/if} {$value.subTotal|crmMoney:$currency} @@ -114,10 +114,10 @@ {if $priceset} - {ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts} + {if isset($taxTerm)}{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{/if} {$value|crmMoney:$currency} {elseif $priceset == 0} - {ts 1=$taxTerm}TOTAL %1{/ts} + {if isset($taxTerm)}{ts 1=$taxTerm}TOTAL %1{/ts}{/if} {$value|crmMoney:$currency} {/if} @@ -303,7 +303,7 @@ {ts}Description{/ts} {ts}Quantity{/ts} {ts}Unit Price{/ts} - {$taxTerm} + {if isset($taxTerm)}{$taxTerm}{/if} {ts 1=$currency}Amount %1{/ts} {foreach from=$lineItem item=value key=priceset name=pricevalue} @@ -328,9 +328,9 @@ {$value.qty} {$value.unit_price|crmMoney:$currency} {if $value.tax_amount != ''} - {$value.tax_rate}% + {if isset($value.tax_rate)}{$value.tax_rate}%{/if} {else} - {ts 1=$taxTerm}No %1{/ts} + {if isset($taxTerm)}{ts 1=$taxTerm}No %1{/ts}{/if} {/if} {$value.subTotal|crmMoney:$currency} @@ -346,10 +346,10 @@ {if $priceset} - {ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts} + {if isset($taxTerm)}{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{/if} {$value|crmMoney:$currency} {elseif $priceset == 0} - {ts 1=$taxTerm}TOTAL NO %1{/ts} + {if isset($taxTerm)}{ts 1=$taxTerm}TOTAL NO %1{/ts}{/if} {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/contribution_offline_receipt_html.tpl b/xml/templates/message_templates/contribution_offline_receipt_html.tpl index 1ce25413a0..03a0fbb5b9 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_html.tpl @@ -122,10 +122,10 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0 || $value != ''} -  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else} -  {ts}No{/ts} {$taxTerm} +  {ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}  {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/contribution_offline_receipt_text.tpl b/xml/templates/message_templates/contribution_offline_receipt_text.tpl index c21cc9797a..8776aa8772 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_text.tpl @@ -27,7 +27,7 @@ {$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if !empty($getTaxDetails)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} ---------------------------------------------------------- {foreach from=$value item=line} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($getTaxDetails)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($getTaxDetails)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/foreach} {/foreach} {/if} @@ -37,9 +37,9 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0 || $value != ''} -{$taxTerm} {$priceset|string_format:"%.2f"}% : {$value|crmMoney:$currency} +{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}% : {$value|crmMoney:$currency} {else} -{ts}No{/ts} {$taxTerm} : {$value|crmMoney:$currency} +{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if} : {$value|crmMoney:$currency} {/if} {/foreach} {/if} diff --git a/xml/templates/message_templates/contribution_online_receipt_html.tpl b/xml/templates/message_templates/contribution_online_receipt_html.tpl index 280e236f53..51ae892849 100644 --- a/xml/templates/message_templates/contribution_online_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_html.tpl @@ -110,10 +110,10 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else} -  {ts}No{/ts} {$taxTerm} +  {ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}  {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/contribution_online_receipt_text.tpl b/xml/templates/message_templates/contribution_online_receipt_text.tpl index 8a0068d5f2..87d01e7120 100644 --- a/xml/templates/message_templates/contribution_online_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_text.tpl @@ -29,7 +29,7 @@ {$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if !empty($dataArray)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} ---------------------------------------------------------- {foreach from=$value item=line} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/foreach} {/foreach} @@ -38,9 +38,9 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} +{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} {else} -{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} +{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}: {$value|crmMoney:$currency} {/if} {/foreach} {/if} diff --git a/xml/templates/message_templates/event_offline_receipt_html.tpl b/xml/templates/message_templates/event_offline_receipt_html.tpl index daa4c2e5af..5d7e661646 100644 --- a/xml/templates/message_templates/event_offline_receipt_html.tpl +++ b/xml/templates/message_templates/event_offline_receipt_html.tpl @@ -186,7 +186,7 @@ {$line.unit_price*$line.qty|crmMoney} - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"}% @@ -225,10 +225,10 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else} -  {ts}No{/ts} {$taxTerm} +  {ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}  {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/event_offline_receipt_text.tpl b/xml/templates/message_templates/event_offline_receipt_text.tpl index d13ea7ddb5..c250fc316d 100644 --- a/xml/templates/message_templates/event_offline_receipt_text.tpl +++ b/xml/templates/message_templates/event_offline_receipt_text.tpl @@ -123,9 +123,9 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} +{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} {else} -{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} +{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}: {$value|crmMoney:$currency} {/if} {/foreach} {/if} diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 30b1e258bd..2d37975d05 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -268,10 +268,10 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else} -  {ts}No{/ts} {$taxTerm} +  {ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}  {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index c17bf558a3..fba539841a 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -143,9 +143,9 @@ You were registered by: {$payer.name} {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} +{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} {else} -{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} +{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}: {$value|crmMoney:$currency} {/if} {/foreach} {/if} diff --git a/xml/templates/message_templates/membership_offline_receipt_html.tpl b/xml/templates/message_templates/membership_offline_receipt_html.tpl index 9de7e49895..7a47a7717a 100644 --- a/xml/templates/message_templates/membership_offline_receipt_html.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_html.tpl @@ -117,7 +117,7 @@ {$line.unit_price*$line.qty|crmMoney} - {if $line.tax_rate and ($line.tax_rate != "" || $line.tax_amount != "")} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"}% @@ -156,10 +156,10 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset} -  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {elseif $priceset == 0} -  {ts}No{/ts} {$taxTerm} +  {ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}  {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/membership_offline_receipt_text.tpl b/xml/templates/message_templates/membership_offline_receipt_text.tpl index 715aff3654..0817ad6bb4 100644 --- a/xml/templates/message_templates/membership_offline_receipt_text.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_text.tpl @@ -52,9 +52,9 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset} -{$taxTerm} {$priceset|string_format:"%.2f"} %: {$value|crmMoney:$currency} +{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"} %: {$value|crmMoney:$currency} {elseif $priceset == 0} -{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} +{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}: {$value|crmMoney:$currency} {/if} {/foreach} {/if} diff --git a/xml/templates/message_templates/membership_online_receipt_html.tpl b/xml/templates/message_templates/membership_online_receipt_html.tpl index a2b1b46133..acb379db19 100644 --- a/xml/templates/message_templates/membership_online_receipt_html.tpl +++ b/xml/templates/message_templates/membership_online_receipt_html.tpl @@ -218,10 +218,10 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%  {$value|crmMoney:$currency} {else} -  {ts}NO{/ts} {$taxTerm} +  {ts}NO{/ts} {if isset($taxTerm)}{$taxTerm}{/if}  {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/membership_online_receipt_text.tpl b/xml/templates/message_templates/membership_online_receipt_text.tpl index d1647bdbe2..e85feaeec6 100644 --- a/xml/templates/message_templates/membership_online_receipt_text.tpl +++ b/xml/templates/message_templates/membership_online_receipt_text.tpl @@ -74,9 +74,9 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset || $priceset == 0} -{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} +{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} {else} -{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} +{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}: {$value|crmMoney:$currency} {/if} {/foreach} {/if} -- 2.25.1