From 5fd1aab05278a4c1ff7713758ff600f76f89cf96 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 2 Aug 2022 20:21:59 +1200 Subject: [PATCH] Use taxBreakDown instead of dataArray --- .../contribution_invoice_receipt_html.tpl | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index f7a39b986ae2..3051de1ba1f7 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -91,20 +91,15 @@ {ts}Sub Total{/ts} {$subTotal|crmMoney:$currency} - {if !empty($dataArray)} - {foreach from=$dataArray item=value key=priceset} + {foreach from=$taxRateBreakdown item=taxDetail key=taxRate} + {if $taxRate != 0} - {if $priceset} - {if '{domain.tax_term}'}{ts 1='{domain.tax_term}' 2=$priceset}TOTAL %1 %2%{/ts}{/if} - {$value|crmMoney:$currency} - {elseif $priceset == 0} - {if '{domain.tax_term}'}{ts 1='{domain.tax_term}'}TOTAL %1{/ts}{/if} - {$value|crmMoney:$currency} - {/if} + {if '{domain.tax_term}'}{ts 1='{domain.tax_term}' 2=$taxRate|crmNumberFormat}TOTAL %1 %2%{/ts}{/if} + {$taxDetail.amount|crmMoney:'{contribution.currency}'} - {/foreach} - {/if} + {/if} + {/foreach} {ts 1=$currency}TOTAL %1{/ts} @@ -292,20 +287,15 @@ {ts}Sub Total{/ts} {$subTotal|crmMoney:$currency} - {if !empty($dataArray)} - {foreach from=$dataArray item=value key=priceset} - - - {if $priceset} - {if '{domain.tax_term}'}{ts 1='{domain.tax_term}' 2=$priceset}TOTAL %1 %2%{/ts}{/if} - {$value|crmMoney:$currency} - {elseif $priceset == 0} - {if '{domain.tax_term}'}{ts 1='{domain.tax_term}'}TOTAL NO %1{/ts}{/if} - {$value|crmMoney:$currency} - {/if} - + {foreach from=$taxRateBreakdown item=taxDetail key=taxRate} + {if $taxRate != 0} + + + {if '{domain.tax_term}'}{ts 1='{domain.tax_term}' 2=$taxRate|crmNumberFormat}TOTAL %1 %2%{/ts}{/if} + {$taxDetail.amount|crmMoney:'{contribution.currency}'} + + {/if} {/foreach} - {/if}