From 6c807bfa607fd0e799508637474c12818179ad3a Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Fri, 29 Sep 2023 14:00:53 -0600 Subject: [PATCH] Clean up event message templates line items --- .../event_offline_receipt_html.tpl | 24 ++++++++++--------- .../event_online_receipt_html.tpl | 24 ++++++++++--------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/xml/templates/message_templates/event_offline_receipt_html.tpl b/xml/templates/message_templates/event_offline_receipt_html.tpl index f4505c1dde..2226410129 100644 --- a/xml/templates/message_templates/event_offline_receipt_html.tpl +++ b/xml/templates/message_templates/event_offline_receipt_html.tpl @@ -173,10 +173,10 @@ {if $isShowLineItems} {foreach from=$participants key=index item=currentParticipant} {if $isPrimary || {participant.id} === $currentParticipant.id} - {if $isPrimary && $lineItems|@count GT 1} {* Header for multi participant registration cases. *} + {if $isPrimary && ($participants|@count > 1)} {* Header for multi participant registration cases. *} - {ts 1=$currentParticipant.index}Participant %1{/ts} {$currentParticipant.contact.display_name} + {$currentParticipant.contact.display_name} {/if} @@ -202,13 +202,15 @@ {$line.title} {$line.qty} {$line.unit_price|crmMoney:$currency} - {if $line.tax_rate || $line.tax_amount != ""} + {if $isShowTax && {contribution.tax_amount|boolean}} {$line.line_total|crmMoney:$currency} - {$line.tax_rate|string_format:"%.2f"}% - {$line.tax_amount|crmMoney:$currency} - {else} - - + {if $line.tax_rate || $line.tax_amount != ""} + {$line.tax_rate|string_format:"%.2f"}% + {$line.tax_amount|crmMoney:$currency} + {else} + + + {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency} @@ -218,9 +220,9 @@ {/if} {/foreach} - {if $isShowTax} + {if $isShowTax && $isPrimary && ($participants|@count > 1)} - {ts}Participant Total{/ts} + {ts 1=$currentParticipant.contact.display_name}Total for %1{/ts} {$currentParticipant.totals.total_amount_exclusive|crmMoney} {$currentParticipant.totals.tax_amount|crmMoney} {$currentParticipant.totals.total_amount_inclusive|crmMoney} @@ -238,7 +240,7 @@ {foreach from=$currentParticipant.line_items key=index item=currentLineItem} - {$currentLineItem.label} {if $isPrimary} - {$currentParticipant.contact.display_name}{/if} + {$currentLineItem.label}{if $isPrimary && ($participants|@count > 1)} - {$currentParticipant.contact.display_name}{/if} {$currentLineItem.line_total|crmMoney:$currency} diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 332471b7ed..bfae1db161 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -186,10 +186,10 @@ {if $isShowLineItems} {foreach from=$participants key=index item=currentParticipant} {if $isPrimary || {participant.id} === $currentParticipant.id} - {if $isPrimary && $lineItems|@count GT 1} {* Header for multi participant registration cases. *} + {if $isPrimary && ($participants|@count > 1)} {* Header for multi participant registration cases. *} - {ts 1=$currentParticipant.index}Participant %1{/ts} {$currentParticipant.contact.display_name} + {$currentParticipant.contact.display_name} {/if} @@ -215,13 +215,15 @@ {$line.title} {$line.qty} {$line.unit_price|crmMoney:$currency} - {if $line.tax_rate || $line.tax_amount != ""} + {if $isShowTax && {contribution.tax_amount|boolean}} {$line.line_total|crmMoney:$currency} - {$line.tax_rate|string_format:"%.2f"}% - {$line.tax_amount|crmMoney:$currency} - {else} - - + {if $line.tax_rate || $line.tax_amount != ""} + {$line.tax_rate|string_format:"%.2f"}% + {$line.tax_amount|crmMoney:$currency} + {else} + + + {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency} @@ -231,9 +233,9 @@ {/if} {/foreach} - {if $isShowTax} + {if $isShowTax && $isPrimary && ($participants|@count > 1)} - {ts}Participant Total{/ts} + {ts 1=$currentParticipant.contact.display_name}Total for %1{/ts} {$currentParticipant.totals.total_amount_exclusive|crmMoney} {$currentParticipant.totals.tax_amount|crmMoney} {$currentParticipant.totals.total_amount_inclusive|crmMoney} @@ -251,7 +253,7 @@ {foreach from=$currentParticipant.line_items key=index item=currentLineItem} - {$currentLineItem.label} {if $isPrimary} - {$currentParticipant.contact.display_name}{/if} + {$currentLineItem.label}{if $isPrimary && ($participants|@count > 1)} - {$currentParticipant.contact.display_name}{/if} {$currentLineItem.line_total|crmMoney:$currency} -- 2.25.1