From 0da5e93b1bf525db37918884657dac83e0e4d81a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 25 Sep 2023 10:46:12 +1300 Subject: [PATCH] Align financial information in participant offline receipt with online receipt This brings across all the financial code around displaying line item amounts etc from the online receipt to the offline one. It also adds the same styles. --- .../event_offline_receipt_html.tpl | 545 +++++++++--------- 1 file changed, 265 insertions(+), 280 deletions(-) diff --git a/xml/templates/message_templates/event_offline_receipt_html.tpl b/xml/templates/message_templates/event_offline_receipt_html.tpl index d1f58cc5be..f4505c1dde 100644 --- a/xml/templates/message_templates/event_offline_receipt_html.tpl +++ b/xml/templates/message_templates/event_offline_receipt_html.tpl @@ -1,16 +1,19 @@ - - + + {capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture} {capture assign=labelStyle}style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture} {capture assign=valueStyle}style="padding: 4px; border-bottom: 1px solid #999;"{/capture} +{capture assign=tdfirstStyle}style="width: 180px; padding-bottom: 15px;"{/capture} +{capture assign=tdStyle}style="width: 100px;"{/capture} +{capture assign=participantTotalStyle}style="margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;"{/capture} - +
@@ -32,8 +35,8 @@ {elseif !empty($isRequireApproval)}

{ts}Your registration has been submitted.{/ts}

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

- {elseif $is_pay_later} -

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *} + {elseif {contribution.is_pay_later|boolean} && {contribution.balance_amount|boolean}} +

{event.pay_later_receipt}

{* FIXME: this might be text rather than HTML *} {/if} @@ -73,41 +76,40 @@ {/if} {if {event.loc_block_id.phone_id.phone|boolean} || {event.loc_block_id.email_id.email|boolean}} - - - + + + {if {event.loc_block_id.phone_id.phone|boolean}} - - + + {/if} - {if {event.loc_block_id.phone_2_id.phone|boolean}} - - - - - {/if} - + {if {event.loc_block_id.phone_2_id.phone|boolean}} + + + + + {/if} {if {event.loc_block_id.email_id.email|boolean}} @@ -115,7 +117,7 @@ {ts}Email{/ts} {/if} @@ -123,14 +125,13 @@ {if {event.loc_block_id.email_2_id.email|boolean}} {/if} - {/if} {if {event.is_public|boolean}} @@ -165,267 +166,251 @@ {if {event.is_monetary|boolean}} - + - - {if !empty($lineItem)} - {foreach from=$lineItem item=value key=priceset} - {if $value neq 'skip'} - {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} - - + + + {/if} + + + + {/if} + {/foreach} + {/if} + {if !$isShowLineItems} + {foreach from=$participants key=index item=currentParticipant} + {if $isPrimary || {participant.id} === $currentParticipant.id} + {foreach from=$currentParticipant.line_items key=index item=currentLineItem} + + + + + {/foreach} + {/if} + {/foreach} + {/if} + {if $isShowTax && {contribution.tax_amount|boolean}} + + - + + + {if !$isPrimary} + {* Use the participant specific tax rate breakdown *} + {assign var=taxRateBreakdown value=$participant.tax_rate_breakdown} {/if} - - - - + {/foreach} {/if} - {/foreach} - {if !empty($dataArray)} - {if $totalAmount and $totalTaxAmount} - - - - - {/if} - {foreach from=$dataArray item=value key=priceset} + {if $isShowTax && {contribution.tax_amount|boolean}} - {if $priceset || $priceset == 0} - - - {/if} - - {/foreach} - {/if} - {/if} - - {if !empty($amount) && !$lineItem} - {foreach from=$amount item=amnt key=level} - - - - {/foreach} - {/if} - {if {contribution.tax_amount|boolean}} - - - - - {/if} - {if {event.is_monetary|boolean}} - {if {contribution.balance_amount|boolean}} - - - + + + {/if} + {if $isPrimary} - - - - {else} - - - - - {/if} - {if !empty($pricesetFieldsCount)} - - - - - {/if} - {if {contribution.is_pay_later|boolean} && {contribution.balance_amount|boolean}} - - - - {/if} - - {if {participant.register_date|boolean}} - - - - - {/if} - - {if {contribution.receive_date|boolean}} - - - - - {/if} + + + + {if !empty($pricesetFieldsCount)} + + + + + {/if} + {if {contribution.is_pay_later|boolean} && {contribution.balance_amount|boolean}} + + + + {/if} - {if {contribution.financial_type_id|boolean}} - - - - - {/if} + {if {participant.register_date|boolean}} + + + + + {/if} - {if {contribution.financial_trxn_id|boolean}} - - - - - {/if} + {if {contribution.receive_date|boolean}} + + + + + {/if} - {if {contribution.payment_instrument_id|boolean}} - - - - - {/if} + {if {contribution.financial_type_id|boolean}} + + + + + {/if} - {if {contribution.check_number|boolean}} - - - - - {/if} + {if {contribution.trxn_id|boolean}} + + + + + {/if} - {if !empty($billingName)} - - - - - - - {/if} + {if {contribution.payment_instrument_id|boolean} && {contribution.paid_amount|boolean}} + + + + + {/if} - {if !empty($credit_card_type)} - - - - - - - {/if} + {if {contribution.check_number|boolean}} + + + + + {/if} - {/if} + {if !empty($billingName)} + + + + + + + {/if} + {if !empty($credit_card_type)} + + + + + + + {/if} + {/if} {/if} {* End of conditional section for Paid events *} {if !empty($customGroup)} -- 2.25.1
- {ts}Event Contacts:{/ts} -
+ {ts}Event Contacts:{/ts} +
- {if {event.loc_block_id.phone_id.phone_type_id|boolean}} - {event.loc_block_id.phone_id.phone_type_id:label} - {else} - {ts}Phone{/ts} - {/if} -
+ {if {event.loc_block_id.phone_id.phone_type_id|boolean}} + {event.loc_block_id.phone_id.phone_type_id:label} + {else} + {ts}Phone{/ts} + {/if} + {event.loc_block_id.phone_id.phone} {if {event.loc_block_id.phone_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_id.phone_ext}{/if}
- {if {event.loc_block_id.phone_2_id.phone_type_id|boolean}} - {event.loc_block_id.phone_2_id.phone_type_id:label} - {else} - {ts}Phone{/ts} - {/if} - - {event.loc_block_id.phone_2_id.phone} {if {event.loc_block_id.phone_2_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_2_id.phone_ext}{/if} -
+ {if {event.loc_block_id.phone_2_id.phone_type_id|boolean}} + {event.loc_block_id.phone_2_id.phone_type_id:label} + {else} + {ts}Phone{/ts} + {/if} + + {event.loc_block_id.phone_2_id.phone} {if {event.loc_block_id.phone_2_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_2_id.phone_ext}{/if} +
- {event.loc_block_id.email_id.email} + {event.loc_block_id.email_id.email}
- {ts}Email{/ts} + {ts}Email{/ts} {event.loc_block_id.email_2_id.email}
- {event.fee_label} - + {event.fee_label} +
- {ts 1=$priceset+1}Participant %1{/ts} + {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. *} +
+ {ts 1=$currentParticipant.index}Participant %1{/ts} {$currentParticipant.contact.display_name} +
+ + + + + + {if $isShowTax && {contribution.tax_amount|boolean}} + + + + {/if} + + {if !empty($pricesetFieldsCount)} + + {/if} + + {foreach from=$currentParticipant.line_items item=line} + + + + + {if $line.tax_rate || $line.tax_amount != ""} + + + + {else} + + + {/if} + + {if !empty($pricesetFieldsCount)} + + {/if} + + {/foreach} + {if $isShowTax} + + + + + + + {/if} +
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
{$line.title}{$line.qty}{$line.unit_price|crmMoney:$currency}{$line.line_total|crmMoney:$currency}{$line.tax_rate|string_format:"%.2f"}%{$line.tax_amount|crmMoney:$currency} + {$line.line_total+$line.tax_amount|crmMoney:$currency} + {$line.participant_count}
{ts}Participant Total{/ts}{$currentParticipant.totals.total_amount_exclusive|crmMoney}{$currentParticipant.totals.tax_amount|crmMoney}{$currentParticipant.totals.total_amount_inclusive|crmMoney}
+
+ {$currentLineItem.label} {if $isPrimary} - {$currentParticipant.contact.display_name}{/if} + + {$currentLineItem.line_total|crmMoney:$currency} +
+ {ts}Amount Before Tax:{/ts}
+ {if $isPrimary}{contribution.tax_exclusive_amount}{else}{$participant.totals.total_amount_exclusive|crmMoney}{/if} +
- + {foreach from=$taxRateBreakdown item=taxDetail key=taxRate} - - - - {if $isShowTax && {contribution.tax_amount|boolean}} - - - - {/if} - - {if !empty($pricesetFieldsCount)}{/if} + + - {foreach from=$value item=line} - - - - - {if !empty($dataArray)} - - {if $line.tax_rate || $line.tax_amount != ""} - - - {else} - - - {/if} - {/if} - - {if !empty($pricesetFieldsCount)} - - {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}{if $taxRate == 0}{ts}No{/ts} {$taxTerm}{else}{$taxTerm} {$taxDetail.percentage}%{/if}{$taxDetail.amount|crmMoney:'{contribution.currency}'}
- {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:"..."}
{/if} -
- {$line.qty} - - {$line.unit_price|crmMoney} - - {$line.unit_price*$line.qty|crmMoney} - - {$line.tax_rate|string_format:"%.2f"}% - - {$line.tax_amount|crmMoney} - - {$line.line_total+$line.tax_amount|crmMoney} - - {$line.participant_count} -
-
- {ts}Amount Before Tax:{/ts} - - {$totalAmount-$totalTaxAmount|crmMoney} -
 {$taxTerm} {$priceset|string_format:"%.2f"}% {$value|crmMoney:$currency}
- {$amnt.amount|crmMoney} {$amnt.label} -
- {ts}Total Tax Amount{/ts} - - {contribution.tax_amount} -
{ts}Total Paid{/ts} - {contribution.paid_amount} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} - + {ts}Total Tax Amount{/ts} + + {if $isPrimary}{contribution.tax_amount}{else}{$participant.totals.tax_amount|crmMoney}{/if} +
{ts}Balance{/ts}{contribution.balance_amount}
{ts}Total Amount{/ts} - {contribution.total_amount} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} -
- {ts}Total Participants{/ts} - {assign var="count" value= 0} - {foreach from=$lineItem item=pcount} - {assign var="lineItemCount" value=0} - {if $pcount neq 'skip'} - {foreach from=$pcount item=p_count} - {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} - {/foreach} - {if $lineItemCount < 1} - assign var="lineItemCount" value=1} - {/if} - {assign var="count" value=$count+$lineItemCount} - {/if} - {/foreach} - {$count} -
- {$pay_later_receipt} -
- {ts}Registration Date{/ts} - - {participant.register_date} -
- {ts}Transaction Date{/ts} - - {contribution.receive_date} -
+ {ts}Total Amount{/ts} + + {contribution.total_amount} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} +
+ {ts}Total Participants{/ts} + {assign var="count" value= 0} + {foreach from=$lineItem item=pcount} + {assign var="lineItemCount" value=0} + {if $pcount neq 'skip'} + {foreach from=$pcount item=p_count} + {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} + {/foreach} + {if $lineItemCount < 1}{assign var="lineItemCount" value=1} + {/if} + {assign var="count" value=$count+$lineItemCount} + {/if} + {/foreach} + {$count} +
+ {$pay_later_receipt} +
- {ts}Financial Type{/ts} - - {contribution.financial_type_id:label} -
+ {ts}Registration Date{/ts} + + {participant.register_date} +
- {ts}Transaction #{/ts} - - {contribution.financial_trxn_id} -
+ {ts}Transaction Date{/ts} + + {contribution.receive_date} +
- {ts}Paid By{/ts} - - {contribution.payment_instrument_id:label} -
+ {ts}Financial Type{/ts} + + {contribution.financial_type_id:label} +
- {ts}Check Number{/ts} - - {contribution.check_number} -
+ {ts}Transaction #{/ts} + + {contribution.trxn_id} +
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address|nl2br} -
+ {ts}Paid By{/ts} + + {contribution.payment_instrument_id:label} +
- {ts}Credit Card Information{/ts} -
- {$credit_card_type}
- {$credit_card_number}
- {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -
+ {ts}Check Number{/ts} + + {contribution.check_number} +
+ {ts}Billing Name and Address{/ts} +
+ {$billingName}
+ {$address|nl2br} +
+ {ts}Credit Card Information{/ts} +
+ {$credit_card_type}
+ {$credit_card_number}
+ {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} +