From 44a36610e233c10bbb474734f7ad162144361379 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 2 Aug 2022 05:30:53 +1000 Subject: [PATCH] Whitespace cleanup --- .../CRM/Contribute/Form/Task/InvoiceTest.php | 4 +- .../contribution_invoice_receipt_html.tpl | 670 +++++++++--------- 2 files changed, 327 insertions(+), 347 deletions(-) diff --git a/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php b/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php index 832f877284..76475604cc 100644 --- a/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php @@ -96,7 +96,7 @@ class CRM_Contribute_Form_Task_InvoiceTest extends CiviUnitTestCase { $this->assertStringContainsString('PAYMENT ADVICE', $invoiceHTML[$contribution['id']]); $this->assertStringContainsString('AMOUNT DUE: - $92.00', $invoiceHTML[$contribution3['id']]); + $92.00', $invoiceHTML[$contribution3['id']]); } /** @@ -178,7 +178,7 @@ class CRM_Contribute_Form_Task_InvoiceTest extends CiviUnitTestCase { $totalAmount = $this->formatMoneyInput($order['values'][$order['id']]['total_amount']); $this->assertStringContainsString("TOTAL USD - $" . $totalAmount . '', $invoiceHTML); + $" . $totalAmount . '', $invoiceHTML); } diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index 6a8df20087..5e6ddd2920 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -13,321 +13,301 @@ {/if} - - - - - - - - - - - - - - - - - - - - - +
{ts}INVOICE{/ts}{ts}Invoice Date:{/ts}{domain.name}
{contact.display_name}{if '{contact.current_employer}'} ({contact.current_employer}){/if}{$invoice_date} - - {domain.street_address} - {domain.supplemental_address_1} - -
{$street_address} {$supplemental_address_1}{ts}Invoice Number:{/ts} - - {domain.supplemental_address_2} - {domain.state_province_id:label} - -
{$supplemental_address_2} {$stateProvinceAbbreviation}{contribution.invoice_number} - - {domain.city} - {domain.postal_code} - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ts}INVOICE{/ts}{ts}Invoice Date:{/ts}{domain.name}
{contact.display_name}{if '{contact.current_employer}'} ({contact.current_employer}){/if}{$invoice_date} + {domain.street_address} + {domain.supplemental_address_1} +
{$street_address} {$supplemental_address_1}{ts}Invoice Number:{/ts} + {domain.supplemental_address_2} + {domain.state_province_id:label} +
{$supplemental_address_2} {$stateProvinceAbbreviation}{contribution.invoice_number} + {domain.city} + {domain.postal_code} +
{$city} {$postal_code}{ts}Reference:{/ts}{domain.country_id:label}
{$country}{contribution.source}{domain.email}
{domain.phone}
+ + + + + + + + + + {foreach from=$lineItem item=value key=priceset name=taxpricevalue} - - - + + + + {if $value.tax_amount != ''} + + {else} + + {/if} + + {/foreach} + + + + + + {if !empty($dataArray)} + {foreach from=$dataArray item=value key=priceset} + + + {if $priceset} + + + {elseif $priceset == 0} + + + {/if} + + {/foreach} + {/if} + + + + + + + + + + + + + + + + + + + + + + + {if '{contribution.contribution_status_id:name}' == 'Pending' && '{contribution.is_pay_later}' == 1} - - - + + + {/if} +
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{domain.tax_term}{ts 1=$currency}Amount %1{/ts}
{$city} {$postal_code}{ts}Reference:{/ts}{domain.country_id:label} + {if $value.html_type eq 'Text'} + {$value.label} + {else} + {$value.field_title} - {$value.label} + {/if} + {if $value.description} +
{$value.description|truncate:30:"..."}
+ {/if} +
{$value.qty}{$value.unit_price|crmMoney:$currency}{if $value.tax_rate}{$value.tax_rate}%{/if}{if $taxTerm}{ts 1=$taxTerm}-{/ts}{/if}{$value.subTotal|crmMoney:$currency}
{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}
{if $taxTerm}{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{/if}{$value|crmMoney:$currency} {if $taxTerm}{ts 1=$taxTerm}TOTAL %1{/ts}{/if}{$value|crmMoney:$currency}
{ts 1=$currency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
+ {if '{contribution.contribution_status_id:name}' == 'Refunded'} + {ts}Amount Credited{/ts} + {else} + {ts}Amount Paid{/ts} + {/if} + {$amountPaid|crmMoney:$currency}

{ts}AMOUNT DUE:{/ts}{$amountDue|crmMoney:$currency}
{$country}{contribution.source}{domain.email} {ts 1=$dueDate}DUE DATE: %1{/ts}
+ + {if '{contribution.contribution_status_id:name}' == 'Pending' && '{contribution.is_pay_later}' == 1} + - - - +
{domain.phone}
- +
+ + + + +
{ts}PAYMENT ADVICE{/ts}

+ {ts}To:{/ts}
+ {domain.name}
+ {domain.street_address} {domain.supplemental_address_1}
+ {domain.supplemental_address_2} {domain.state_province_id:label}
+ {domain.city} {domain.postal_code}
+ {domain.country_id:label}
+ {domain.email}
+ {domain.phone}
+
+

{$notes} +
+ - - - - - + + - {foreach from=$lineItem item=value key=priceset name=taxpricevalue} - - - - - {if $value.tax_amount != ''} - - {else} - - {/if} - - - {/foreach} - - - + + - {if !empty($dataArray)} - {foreach from=$dataArray item=value key=priceset} + + {if $is_pay_later == 1} - - {if $priceset} - - - {elseif $priceset == 0} - - - {/if} + + + + {else} + + + - {/foreach} {/if} - - - + + - - - - - - - - - - - - + - - - - {if '{contribution.contribution_status_id:name}' == 'Pending' && '{contribution.is_pay_later}' == 1} - - - - - {/if}
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{domain.tax_term}{ts 1=$currency}Amount %1{/ts}{ts}Customer:{/ts}{contact.display_name}
- {if $value.html_type eq 'Text'} - {$value.label} - {else} - {$value.field_title} - {$value.label} - {/if} - {if $value.description} -
{$value.description|truncate:30:"..."}
- {/if} -
-
{$value.qty}{$value.unit_price|crmMoney:$currency}{if $value.tax_rate}{$value.tax_rate}%{/if}{if $taxTerm}{ts 1=$taxTerm}-{/ts}{/if}{$value.subTotal|crmMoney:$currency}
{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}{ts}Invoice Number:{/ts}{contribution.invoice_number}

{if $taxTerm}{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{/if}{$value|crmMoney:$currency} {if $taxTerm}{ts 1=$taxTerm}TOTAL %1{/ts}{/if}{$value|crmMoney:$currency} {ts}Amount Due:{/ts}{$amount|crmMoney:$currency}
{ts}Amount Due:{/ts}{$amountDue|crmMoney:$currency}
{ts 1=$currency}TOTAL %1{/ts}{$amount|crmMoney:$currency}{ts}Due Date:{/ts}{$dueDate}
- {if '{contribution.contribution_status_id:name}' == 'Refunded'} - {ts}Amount Credited{/ts} - {else} - {ts}Amount Paid{/ts} - {/if} - - {$amountPaid|crmMoney:$currency}

{ts}AMOUNT DUE:{/ts}{$amountDue|crmMoney:$currency}
{ts 1=$dueDate}DUE DATE: %1{/ts}
- - {if '{contribution.contribution_status_id:name}' == 'Pending' && '{contribution.is_pay_later}' == 1} - - - - -
- - - - - - -
{ts}PAYMENT ADVICE{/ts}

{ts}To:{/ts}
- {domain.name}
- {domain.street_address} {domain.supplemental_address_1}
- {domain.supplemental_address_2} {domain.state_province_id:label}
- {domain.city} {domain.postal_code}
- {domain.country_id:label}
- {domain.email}
- {domain.phone}
-


{$notes} -
- - - - - - - - - - - {if $is_pay_later == 1} - - - - - {else} - - - - - {/if} - - - - - - - -
{ts}Customer:{/ts}{contact.display_name}
{ts}Invoice Number:{/ts}{contribution.invoice_number}

{ts}Amount Due:{/ts}{$amount|crmMoney:$currency}
{ts}Amount Due:{/ts}{$amountDue|crmMoney:$currency}
{ts}Due Date:{/ts}{$dueDate}

-
- {/if} - - {if '{contribution.contribution_status_id:name}' === 'Refunded' || '{contribution.contribution_status_id:name}' === 'Cancelled'} - {if $config->empoweredBy} - - - - -
- {/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
{ts}CREDIT NOTE{/ts}{ts}Date:{/ts}{domain.name}
{contact.display_name}{if '{contact.current_employer}'} ({contact.current_employer}){/if}{$invoice_date} - - {domain.street_address} - {domain.supplemental_address_1} - -
{$street_address} {$supplemental_address_1}{ts}Credit Note Number:{/ts} - - {domain.supplemental_address_2} - {domain.state_province_id:label} - -
{$supplemental_address_2} {$stateProvinceAbbreviation}{contribution.creditnote_id} - - {domain.city} - {domain.postal_code} - -
{$city} {$postal_code}{ts}Reference:{/ts} - - {domain.country_id:label} - -
{contribution.source} - - {domain.email} -
+ {/if} + + {if '{contribution.contribution_status_id:name}' === 'Refunded' || '{contribution.contribution_status_id:name}' === 'Cancelled'} + {if $config->empoweredBy} + - - - +
- - {domain.phone} - -
+ {/if} - - - + + + + + + +
- +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ts}CREDIT NOTE{/ts}{ts}Date:{/ts}{domain.name}
{contact.display_name}{if '{contact.current_employer}'} ({contact.current_employer}){/if}{$invoice_date} + {domain.street_address} + {domain.supplemental_address_1} +
{$street_address} {$supplemental_address_1}{ts}Credit Note Number:{/ts} + {domain.supplemental_address_2} + {domain.state_province_id:label} +
{$supplemental_address_2} {$stateProvinceAbbreviation}{contribution.creditnote_id} + {domain.city} + {domain.postal_code} +
{$city} {$postal_code}{ts}Reference:{/ts} + {domain.country_id:label} +
{contribution.source} + {domain.email} +
+ {domain.phone} +
+ + + + - -
+ + + + + + + + + {foreach from=$lineItem item=value key=priceset name=pricevalue} + {if $smarty.foreach.pricevalue.index eq 0} + + {else} + + {/if} - - - - - - - {foreach from=$lineItem item=value key=priceset name=pricevalue} - {if $smarty.foreach.pricevalue.index eq 0} - - {else} - - {/if} - - - - - {if $value.tax_amount != ''} - + + {$value.field_title} - {$value.label} {/if} - - - {/foreach} - - - - - + {if $value.description} +
{$value.description|truncate:30:"..."}
+ {/if} + + + + {if $value.tax_amount != ''} + + {else} + + {/if} + - {if !empty($dataArray)} + {/foreach} + + + + + + + {if !empty($dataArray)} {foreach from=$dataArray item=value key=priceset} @@ -340,78 +320,78 @@ {/if} {/foreach} - {/if} - - - - + {/if} + + + + + + + + + + {if '{contribution.is_pay_later}' == 0} - + - {if '{contribution.is_pay_later}' == 0} - - - - - - - - - - - - - - - - {/if} -


+ - + + + -
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{domain.tax_term}{ts 1=$currency}Amount %1{/ts}


{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{domain.tax_term}{ts 1=$currency}Amount %1{/ts}


- - {if $value.html_type eq 'Text'} - {$value.label} - {else} - {$value.field_title} - {$value.label} - {/if} - {if $value.description} -
{$value.description|truncate:30:"..."}
- {/if} -
-
{$value.qty}{$value.unit_price|crmMoney:$currency}{if $value.tax_rate}{$value.tax_rate}%{/if} + {if $value.html_type eq 'Text'} + {$value.label} {else} - {if $taxTerm}{ts 1=$taxTerm}No %1{/ts}{/if}{$value.subTotal|crmMoney:$currency}

{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}{$value.qty}{$value.unit_price|crmMoney:$currency}{if $value.tax_rate}{$value.tax_rate}%{/if}{if $taxTerm}{ts 1=$taxTerm}No %1{/ts}{/if}{$value.subTotal|crmMoney:$currency}

{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}


{ts 1=$currency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
{ts 1=$currency}TOTAL %1{/ts}{ts}LESS Credit to invoice(s){/ts} {$amount|crmMoney:$currency}
{ts}LESS Credit to invoice(s){/ts}{$amount|crmMoney:$currency}

{ts}REMAINING CREDIT{/ts}{$amountDue|crmMoney:$currency}

{ts}REMAINING CREDIT{/ts}{$amountDue|crmMoney:$currency}
-
+ {/if} +


+
+
- - - - -
+ + + + +
- - - - - -
{ts}CREDIT ADVICE{/ts}

{ts}Please do not pay on this advice. Deduct the amount of this Credit Note from your next payment to us{/ts}

- - - - - - - - - - - - - - - - - -
{ts}Customer:{/ts}{contact.display_name}
{ts}Credit Note#:{/ts}{contribution.creditnote_id}

{ts}Credit Amount:{/ts}{$amount|crmMoney:$currency}
-
- {/if} + + + + + +
{ts}CREDIT ADVICE{/ts}

{ts}Please do not pay on this advice. Deduct the amount of this Credit Note from your next payment to us{/ts}

+ + + + + + + + + + + + + + + + + +
{ts}Customer:{/ts}{contact.display_name}
{ts}Credit Note#:{/ts}{contribution.creditnote_id}

{ts}Credit Amount:{/ts}{$amount|crmMoney:$currency}
+
+ {/if} -- 2.25.1