From 7cf82823299b63968e689c49718f7b88745592f6 Mon Sep 17 00:00:00 2001
From: Parag Bhilkar {ts}Item{/ts}
{ts}Qty{/ts}
{ts}Each{/ts}
- {if $totalTaxAmount}
+ {if $getTaxDetails}
{ts}Subtotal{/ts}
{ts}Tax Rate{/ts}
{ts}Tax Amount{/ts}
@@ -76,19 +76,24 @@
{$line.unit_price|crmMoney:$currency}
- {if $totalTaxAmount}
+ {if $getTaxDetails}
{$line.unit_price*$line.qty|crmMoney:$currency}
-
- {$line.tax_rate|crmMoney:$currency}
-
-
- {$line.tax_amount|crmMoney:$currency}
-
+ {if $line.tax_rate != "" || $line.tax_amount != ""}
+
+ {$line.tax_rate}%
+
+
+ {$line.tax_amount|crmMoney:$currency}
+
+ {else}
+
+
+ {/if}
{/if}
- {$line.line_total|crmMoney:$currency}
+ {$line.line_total+$line.tax_amount|crmMoney:$currency}
{/foreach}
@@ -97,7 +102,7 @@
{/foreach}
{/if}
- {if $dataArray && $totalTaxAmount}
+ {if $getTaxDetails && $dataArray}
{ts} Amount before Tax : {/ts}
@@ -109,10 +114,10 @@
{foreach from=$dataArray item=value key=priceset}
- {if $priceset}
- {$taxTerm} {$priceset|string_format:"%.2f"}%
+ {if $priceset || $priceset == 0 || $value != ''}
+ {$taxTerm} {$priceset}%
{$value|crmMoney:$currency}
- {elseif $priceset == 0}
+ {else}
{ts}No{/ts} {$taxTerm}
{$value|crmMoney:$currency}
{/if}
@@ -120,7 +125,7 @@
{/foreach}
{/if}
- {if $totalTaxAmount}
+ {if $getTaxDetails && $totalTaxAmount}
{/foreach}
@@ -106,16 +111,18 @@
{foreach from=$dataArray item=value key=priceset}
{ts}Total Tax Amount{/ts}
diff --git a/xml/templates/message_templates/contribution_offline_receipt_text.tpl b/xml/templates/message_templates/contribution_offline_receipt_text.tpl
index 5a12f873f9..d0b54802db 100644
--- a/xml/templates/message_templates/contribution_offline_receipt_text.tpl
+++ b/xml/templates/message_templates/contribution_offline_receipt_text.tpl
@@ -16,36 +16,36 @@
{capture assign=ts_item}{ts}Item{/ts}{/capture}
{capture assign=ts_qty}{ts}Qty{/ts}{/capture}
{capture assign=ts_each}{ts}Each{/ts}{/capture}
-{if $totalTaxAmount}
+{if $getTaxDetails}
{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}
{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}
{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}
{/if}
{capture assign=ts_total}{ts}Total{/ts}{/capture}
-{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $totalTaxAmount} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"}
+{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $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 $totalTaxAmount}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {$line.tax_rate|crmMoney:$currency|string_format:"%10s"} {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/if}{$line.line_total|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 $getTaxDetails}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate} % {$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}
-{if $dataArray && $totalTaxAmount}
-{ts}Amount before Tax{/ts}: {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}
+{if $getTaxDetails && $dataArray}
+{ts}Amount before Tax{/ts} : {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}
{foreach from=$dataArray item=value key=priceset}
-{if $priceset}
-{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency}
-{elseif $priceset == 0}
-{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}
+{if $priceset || $priceset == 0 || $value != ''}
+{$taxTerm} {$priceset}% : {$value|crmMoney:$currency}
+{else}
+{ts}No{/ts} {$taxTerm} : {$value|crmMoney:$currency}
{/if}
{/foreach}
{/if}
-{if $totalTaxAmount}
-{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}
+{if $getTaxDetails && $totalTaxAmount}
+{ts}Total Tax Amount{/ts} : {$totalTaxAmount|crmMoney:$currency}
{/if}
-{ts}Total Amount{/ts}: {$formValues.total_amount|crmMoney:$currency}
+{ts}Total Amount{/ts} : {$formValues.total_amount|crmMoney:$currency}
{if $receive_date}
{ts}Received Date{/ts}: {$receive_date|truncate:10:''|crmDate}
{/if}
diff --git a/xml/templates/message_templates/contribution_online_receipt_html.tpl b/xml/templates/message_templates/contribution_online_receipt_html.tpl
index 6357f3b1b4..8d629700ee 100644
--- a/xml/templates/message_templates/contribution_online_receipt_html.tpl
+++ b/xml/templates/message_templates/contribution_online_receipt_html.tpl
@@ -74,19 +74,24 @@
{$line.unit_price|crmMoney:$currency}
- {if $dataArray}
+ {if $getTaxDetails}
{$line.unit_price*$line.qty|crmMoney:$currency}
-
- {$line.tax_rate|crmMoney:$currency}
-
-
- {$line.tax_amount|crmMoney:$currency}
-
+ {if $line.tax_rate != "" || $line.tax_amount != ""}
+
+ {$line.tax_rate|string_format:"%.2f"}%
+
+
+ {$line.tax_amount|crmMoney:$currency}
+
+ {else}
+
+
+ {/if}
{/if}
- {$line.line_total|crmMoney:$currency}
+ {$line.line_total+$line.tax_amount|crmMoney:$currency}
- {if $priceset}
-
{/foreach}
+ {/if}
+ {if $totalTaxAmount}
{$taxTerm} {$priceset|string_format:"%.2f"}%
+ {if $priceset || $priceset == 0}
+ {$taxTerm} {$priceset}%
{$value|crmMoney:$currency}
- {elseif $priceset == 0}
+ {else}
{ts}No{/ts} {$taxTerm}
{$value|crmMoney:$currency}
{/if}
{/if}
{/foreach}
- {if $dataArray && $totalTaxAmount}
+ {if $dataArray}
{ts}Total Tax{/ts}
diff --git a/xml/templates/message_templates/contribution_online_receipt_text.tpl b/xml/templates/message_templates/contribution_online_receipt_text.tpl
index 2b1b419784..6b60eadcd0 100644
--- a/xml/templates/message_templates/contribution_online_receipt_text.tpl
+++ b/xml/templates/message_templates/contribution_online_receipt_text.tpl
@@ -22,26 +22,26 @@
{capture assign=ts_item}{ts}Item{/ts}{/capture}
{capture assign=ts_qty}{ts}Qty{/ts}{/capture}
{capture assign=ts_each}{ts}Each{/ts}{/capture}
-{if $totalTaxAmount}
+{if $dataArray}
{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}
{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}
{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}
{/if}
{capture assign=ts_total}{ts}Total{/ts}{/capture}
-{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $totalTaxAmount} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"}
+{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $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 $totalTaxAmount}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {$line.tax_rate|crmMoney:$currency|string_format:"%10s"} {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/if}{$line.line_total|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 $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"}
{/foreach}
{/foreach}
-{if $dataArray && $totalTaxAmount}
+{if $dataArray}
{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}
{foreach from=$dataArray item=value key=priceset}
-{if $priceset}
-{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency}
-{elseif $priceset == 0}
+{if $priceset || $priceset == 0}
+{$taxTerm} {$priceset}%: {$value|crmMoney:$currency}
+{else}
{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}
{/if}
{/foreach}
@@ -206,4 +206,4 @@
{$customName}: {$customValue}
{/if}
{/foreach}
-{/if}
+{/if}
\ No newline at end of file
diff --git a/xml/templates/message_templates/event_offline_receipt_html.tpl b/xml/templates/message_templates/event_offline_receipt_html.tpl
index 39142ce3ba..81a73f98b1 100644
--- a/xml/templates/message_templates/event_offline_receipt_html.tpl
+++ b/xml/templates/message_templates/event_offline_receipt_html.tpl
@@ -181,7 +181,7 @@ registration process.{/ts}
{ts}Item{/ts}
{ts}Qty{/ts}
{ts}Each{/ts}
- {if $totalTaxAmount}
+ {if $dataArray}
{ts}SubTotal{/ts}
{ts}Tax Rate{/ts}
{ts}Tax Amount{/ts}
@@ -200,19 +200,24 @@ registration process.{/ts}
{$line.unit_price|crmMoney}
- {if $totalTaxAmount}
+ {if $dataArray}
{$line.unit_price*$line.qty|crmMoney}
-
- {$line.tax_rate|crmMoney}
-
-
- {$line.tax_amount|crmMoney}
-
+ {if $line.tax_rate != "" || $line.tax_amount != ""}
+
+ {$line.tax_rate|string_format:"%.2f"}%
+
+
+ {$line.tax_amount|crmMoney}
+
+ {else}
+
+
+ {/if}
{/if}
- {$line.line_total|crmMoney}
+ {$line.line_total+$line.tax_amount|crmMoney}
{if $pricesetFieldsCount }
@@ -226,7 +231,7 @@ registration process.{/ts}
{foreach from=$dataArray item=value key=priceset}
{ts} Amount Before Tax : {/ts}
@@ -237,12 +242,12 @@ registration process.{/ts}
- {if $priceset}
-
{/foreach}
diff --git a/xml/templates/message_templates/event_offline_receipt_text.tpl b/xml/templates/message_templates/event_offline_receipt_text.tpl
index 8b745c844f..f359f7e72e 100644
--- a/xml/templates/message_templates/event_offline_receipt_text.tpl
+++ b/xml/templates/message_templates/event_offline_receipt_text.tpl
@@ -118,30 +118,30 @@ registration process.{/ts}
{capture assign=ts_item}{ts}Item{/ts}{/capture}
{capture assign=ts_qty}{ts}Qty{/ts}{/capture}
{capture assign=ts_each}{ts}Each{/ts}{/capture}
-{if $totalTaxAmount}
+{if $dataArray}
{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}
{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}
{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}
{/if}
{capture assign=ts_total}{ts}Total{/ts}{/capture}
{capture assign=ts_participant_total}{if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if}{/capture}
-{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $totalTaxAmount} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"}
+{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"}
----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}
{foreach from=$value item=line}
{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}
-{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|string_format:"%10s"} {if $totalTaxAmount} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {$line.tax_rate|crmMoney:$currency|string_format:"%10s"} {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/if} {$line.line_total|crmMoney|string_format:"%10s"} {$ts_participant_count|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|string_format:"%10s"} {if $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|string_format:"%10s"} {$ts_participant_count|string_format:"%10s"}
{/foreach}
{/if}
{/foreach}
-{if $dataArray && $totalTaxAmount}
+{if $dataArray}
{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}
{foreach from=$dataArray item=value key=priceset}
-{if $priceset}
+{if $priceset || $priceset == 0}
{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency}
-{elseif $priceset == 0}
+{else}
{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}
{/if}
{/foreach}
diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl
index 62f977e14b..11030468f3 100644
--- a/xml/templates/message_templates/event_online_receipt_html.tpl
+++ b/xml/templates/message_templates/event_online_receipt_html.tpl
@@ -238,15 +238,20 @@ registration process.{/ts} {$taxTerm} {$priceset|string_format:"%.2f"}%
- {$value|crmMoney:$currency}
- {elseif $priceset == 0}
- {ts}No{/ts} {$taxTerm}
- {$value|crmMoney:$currency}
+ {if $priceset || $priceset == 0}
+ {$taxTerm} {$priceset|string_format:"%.2f"}%
+ {$value|crmMoney:$currency}
+ {else}
+ {ts}No{/ts} {$taxTerm}
+ {$value|crmMoney:$currency}
{/if}