From 7cf82823299b63968e689c49718f7b88745592f6 Mon Sep 17 00:00:00 2001 From: Parag Bhilkar Date: Mon, 28 Jul 2014 14:57:54 +0530 Subject: [PATCH] Changed conditions for dispaly Tax Rate, Tax Amount for 0% tax rates and no tax rates and for Changed in line Total. --- .../contribution_offline_receipt_html.tpl | 33 ++++++++++------- .../contribution_offline_receipt_text.tpl | 24 ++++++------ .../contribution_online_receipt_html.tpl | 29 +++++++++------ .../contribution_online_receipt_text.tpl | 16 ++++---- .../event_offline_receipt_html.tpl | 37 +++++++++++-------- .../event_offline_receipt_text.tpl | 12 +++--- .../event_online_receipt_html.tpl | 33 ++++++++++------- .../event_online_receipt_text.tpl | 12 +++--- .../membership_offline_receipt_html.tpl | 27 ++++++++------ .../membership_offline_receipt_text.tpl | 10 ++--- .../membership_online_receipt_html.tpl | 23 +++++++----- .../membership_online_receipt_text.tpl | 12 +++--- 12 files changed, 150 insertions(+), 118 deletions(-) diff --git a/xml/templates/message_templates/contribution_offline_receipt_html.tpl b/xml/templates/message_templates/contribution_offline_receipt_html.tpl index 41d7939dfe..56ae50f6c9 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_html.tpl @@ -58,7 +58,7 @@ {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} {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} {/foreach} @@ -106,16 +111,18 @@ {foreach from=$dataArray item=value key=priceset} - {if $priceset} -  {$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} {/foreach} + {/if} + {if $totalTaxAmount} {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}

{/if} {/foreach} - {if $dataArray && $totalTaxAmount} + {if $dataArray} {ts} Amount Before Tax : {/ts} @@ -237,12 +242,12 @@ registration process.{/ts}

{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} +  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {$value|crmMoney:$currency} + {else} +  {ts}No{/ts} {$taxTerm} +  {$value|crmMoney:$currency} {/if} {/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}

{$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:$currency} + {$line.line_total+$line.tax_amount|crmMoney:$currency} {if $pricesetFieldsCount }{$line.participant_count} {/if} @@ -267,14 +272,14 @@ registration process.{/ts}

{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} +  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {$value|crmMoney:$currency} + {else} +  {ts}No{/ts} {$taxTerm} +  {$value|crmMoney:$currency} {/if} - + {/foreach} {/if} {/if} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index ddf290d309..70dfd9604f 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -134,30 +134,30 @@ You were registered by: {$payer.name} {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} {if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if} -{$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:$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"}{$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:$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"}{$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/membership_offline_receipt_html.tpl b/xml/templates/message_templates/membership_offline_receipt_html.tpl index 4e90c32bda..625f047073 100644 --- a/xml/templates/message_templates/membership_offline_receipt_html.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_html.tpl @@ -116,14 +116,19 @@ {$line.unit_price*$line.qty|crmMoney} + {if $line.tax_rate != "" || $line.tax_amount != ""} + + {$line.tax_rate|string_format:"%.2f"}% + + + {$line.tax_amount|crmMoney} + + {else} + + + {/if} - {$line.tax_rate|crmMoney} - - - {$line.tax_amount|crmMoney} - - - {$line.line_total|crmMoney} + {$line.line_total+$line.tax_amount|crmMoney} {/if} @@ -150,11 +155,11 @@ {foreach from=$dataArray item=value key=priceset} {if $priceset} -  {$taxTerm} {$priceset|string_format:"%.2f"}% -  {$value|crmMoney:$currency} +  {$taxTerm} {$priceset|string_format:"%.2f"}% +  {$value|crmMoney:$currency} {elseif $priceset == 0} -  {ts}No{/ts} {$taxTerm} -  {$value|crmMoney:$currency} +  {ts}No{/ts} {$taxTerm} +  {$value|crmMoney:$currency} {/if} {/foreach} diff --git a/xml/templates/message_templates/membership_offline_receipt_text.tpl b/xml/templates/message_templates/membership_offline_receipt_text.tpl index e2c81cd3ab..2033b71530 100644 --- a/xml/templates/message_templates/membership_offline_receipt_text.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_text.tpl @@ -33,7 +33,7 @@ {foreach from=$lineItem item=value key=priceset} {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_total}{ts}Fee{/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} @@ -41,20 +41,20 @@ {/if} {capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} {capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if $totalTaxAmount} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} +{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} -------------------------------------------------------------------------------------------------- {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.line_total|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"} {$line.line_total|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} +{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.line_total|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} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} {/foreach} {/foreach} -{if $dataArray && $totalTaxAmount} +{if $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} +{$taxTerm} {$priceset|string_format:"%.2f"} %: {$value|crmMoney:$currency} {elseif $priceset == 0} {ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} {/if} diff --git a/xml/templates/message_templates/membership_online_receipt_html.tpl b/xml/templates/message_templates/membership_online_receipt_html.tpl index 03e14a3157..6fc789a6b4 100644 --- a/xml/templates/message_templates/membership_online_receipt_html.tpl +++ b/xml/templates/message_templates/membership_online_receipt_html.tpl @@ -192,14 +192,19 @@ {$line.unit_price*$line.qty|crmMoney} + {if $line.tax_rate != "" || $line.tax_amount != ""} + + {$line.tax_rate|string_format:"%.2f"}% + + + {$line.tax_amount|crmMoney} + + {else} + + + {/if} - {$line.tax_rate|crmMoney} - - - {$line.tax_amount|crmMoney} - - - {$line.line_total|crmMoney} + {$line.line_total+$line.tax_amount|crmMoney} {/if} @@ -225,10 +230,10 @@ {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} diff --git a/xml/templates/message_templates/membership_online_receipt_text.tpl b/xml/templates/message_templates/membership_online_receipt_text.tpl index 8baf7a8765..7fba59ab12 100644 --- a/xml/templates/message_templates/membership_online_receipt_text.tpl +++ b/xml/templates/message_templates/membership_online_receipt_text.tpl @@ -59,7 +59,7 @@ {foreach from=$lineItem item=value key=priceset} {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_total}{ts}Fee{/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} @@ -67,21 +67,21 @@ {/if} {capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} {capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if $totalTaxAmount} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} +{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} -------------------------------------------------------------------------------------------------- {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.line_total|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"} {$line.line_total|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} +{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.line_total|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} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} {/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} +{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} -- 2.25.1