From 780fff6fb7f03993ff332176228c02bea60e7a55 Mon Sep 17 00:00:00 2001 From: samuelsov Date: Tue, 18 Aug 2015 11:28:03 -0400 Subject: [PATCH 1/2] CRM-16561 - translatable tax invoice template --- .../contribution_invoice_receipt_html.tpl | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index e51ffe6bcb90..e88f1bd39baf 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -13,9 +13,9 @@
- + - + @@ -35,7 +35,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -79,11 +79,11 @@
INVOICE{ts}INVOICE{/ts} Invoice Date:{ts}Invoice Date:{/ts} {$domain_organization}
{$street_address} {$supplemental_address_1} Invoice Number:{ts}Invoice Number:{/ts} {if $domain_supplemental_address_2 }{$domain_supplemental_address_2}{/if} {if $domain_state }{$domain_state}{/if}
{$city} {$postal_code} Reference:{ts}Reference:{/ts} {if $domain_country} {$domain_country} {/if} {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - + + + - + {foreach from=$lineItem item=value key=priceset name=taxpricevalue} {if $smarty.foreach.taxpricevalue.index eq 0} @@ -100,7 +100,7 @@ {if $value.tax_amount != ''} {else} - + {/if} @@ -108,17 +108,17 @@ - + {foreach from = $dataArray item = value key = priceset} {if $priceset} - + {elseif $priceset == 0} - + {/if} @@ -130,7 +130,7 @@ - + @@ -139,9 +139,9 @@ @@ -152,7 +152,7 @@ - + {/if} @@ -161,7 +161,7 @@ - +
DescriptionQuantityUnit Price{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts} {$taxTerm} Amount {$defaultCurrency}{ts 1=$defaultCurrency}Amount %1{/ts}
{$value.tax_rate}%No {$taxTerm}{ts 1=$taxTerm}No %1{/ts}{$value.subTotal|crmMoney:$currency}

Sub Total{ts}Sub Total{/ts} {$subTotal|crmMoney:$currency}
TOTAL {$taxTerm} {$priceset}% {ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts} {$value|crmMoney:$currency} TOTAL NO {$taxTerm}{ts 1=$taxTerm}TOTAL NO %1{/ts} {$value|crmMoney:$currency}
TOTAL {$defaultCurrency}{ts 1=$defaultCurrency}TOTAL %1{/ts} {$amount|crmMoney:$currency}
{if $contribution_status_id == $refundedStatusId} - LESS Amount Credited + {ts}LESS Amount Credited{/ts} {else} - LESS Amount Paid + {ts}LESS Amount Paid{/ts} {/if} {$amount|crmMoney:$currency}
AMOUNT DUE: {ts}AMOUNT DUE:{/ts} {$amountDue|crmMoney:$currency}
DUE DATE: {$dueDate}{ts 1=$dueDate}DUE DATE: %1{/ts}
@@ -175,7 +175,7 @@
-
PAYMENT ADVICE

To:
+
{ts}PAYMENT ADVICE{/ts}

{ts}To: {/ts}
{$domain_organization}
{$domain_street_address} {$domain_supplemental_address_1}
{$domain_supplemental_address_2} {$domain_state}
@@ -189,31 +189,31 @@ - + - + {if $is_pay_later == 1} - + {else} - + {/if} - + @@ -235,9 +235,9 @@
Customer: {ts}Customer: {/ts} {$display_name}
Invoice Number: {ts}Invoice Number: {/ts} {$invoice_id}

Amount Due:{ts}Amount Due:{/ts} {$amount|crmMoney:$currency}
Amount Due: {ts}Amount Due: {/ts} {$amountDue|crmMoney:$currency}
Due Date: {ts}Due Date: {/ts} {$dueDate}
- + - + @@ -259,7 +259,7 @@ - + - + @@ -311,11 +311,11 @@
CREDIT NOTE{ts}CREDIT NOTE{/ts} Date:{ts}Date:{/ts} {$domain_organization}
{$street_address} {$supplemental_address_1} Credit Note Number:{ts}Credit Note Number:{/ts} {if $domain_supplemental_address_2 } {$domain_supplemental_address_2} {/if} @@ -283,7 +283,7 @@
{$city} {$postal_code} Reference:{ts}Reference:{/ts} {if $domain_country} {$domain_country} {/if} {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - + + + - + {foreach from=$lineItem item=value key=priceset name=pricevalue} {if $smarty.foreach.pricevalue.index eq 0} @@ -332,7 +332,7 @@ {if $value.tax_amount != ''} {else} - + {/if} @@ -340,17 +340,17 @@ - + {foreach from = $dataArray item = value key = priceset} {if $priceset} - + {elseif $priceset == 0} - + {/if} @@ -362,14 +362,14 @@ - + {if $is_pay_later == 0} - + @@ -378,7 +378,7 @@ - + @@ -404,24 +404,23 @@
DescriptionQuantityUnit Price{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts} {$taxTerm} Amount {$defaultCurrency}{ts 1=$defaultCurrency}Amount %1{/ts}
{$value.tax_rate}%No {$taxTerm}{ts 1=$taxTerm}No %1{/ts}{$value.subTotal|crmMoney:$currency}

Sub Total{ts}Sub Total{/ts} {$subTotal|crmMoney:$currency}
TOTAL {$taxTerm} {$priceset}% {ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts} {$value|crmMoney:$currency} TOTAL NO {$taxTerm}{ts 1=$taxTerm}TOTAL NO %1{/ts} {$value|crmMoney:$currency}
TOTAL {$defaultCurrency}{ts 1=$defaultCurrency}TOTAL %1{/ts} {$amount|crmMoney:$currency}
LESS Credit to invoice(s){ts}LESS Credit to invoice(s){/ts} {$amount|crmMoney:$currency}
REMAINING CREDIT{ts}REMAINING CREDIT{/ts} {$amountDue|crmMoney:$currency}
- +
CREDIT ADVICE

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

{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}

- + - + - +
Customer: {ts}Customer:{/ts} {$display_name}
Credit Note#: {ts}Credit Note#:{/ts} {$creditnote_id}

Credit Amount:{ts}Credit Amount:{/ts} {$amount|crmMoney:$currency}
From 6397c5318cc5d45f29a2aaf1d32fa8acc6a62cc1 Mon Sep 17 00:00:00 2001 From: samuelsov Date: Tue, 18 Aug 2015 11:34:40 -0400 Subject: [PATCH 2/2] CRM-16561 - adding the invoice in the upgrade --- .../contribution_invoice_receipt_html.tpl | 433 ++++++++++++++++++ .../Incremental/sql/4.7.alpha1.mysql.tpl | 1 + 2 files changed, 434 insertions(+) create mode 100644 CRM/Upgrade/4.7.alpha1.msg_template/message_templates/contribution_invoice_receipt_html.tpl diff --git a/CRM/Upgrade/4.7.alpha1.msg_template/message_templates/contribution_invoice_receipt_html.tpl b/CRM/Upgrade/4.7.alpha1.msg_template/message_templates/contribution_invoice_receipt_html.tpl new file mode 100644 index 000000000000..e88f1bd39baf --- /dev/null +++ b/CRM/Upgrade/4.7.alpha1.msg_template/message_templates/contribution_invoice_receipt_html.tpl @@ -0,0 +1,433 @@ + + + + + + + + + + + +
+
+ + + + + + + + + {if $organization_name} + + {else} + + {/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ts}INVOICE{/ts}{ts}Invoice Date:{/ts}{$domain_organization}
{$display_name} ({$organization_name}){$display_name}{$invoice_date} + {if $domain_street_address } + {$domain_street_address} + {/if} + {if $domain_supplemental_address_1 }{$domain_supplemental_address_1}{/if}
{$street_address} {$supplemental_address_1}{ts}Invoice Number:{/ts}{if $domain_supplemental_address_2 }{$domain_supplemental_address_2}{/if} + {if $domain_state }{$domain_state}{/if}
{$supplemental_address_2} {$stateProvinceAbbreviation}{$invoice_id}{if $domain_city} + {$domain_city} + {/if} + {if $domain_postal_code } + {$domain_postal_code} + {/if} +
{$city} {$postal_code}{ts}Reference:{/ts} {if $domain_country} + {$domain_country} + {/if}
{$source} {if $domain_phone}{$domain_phone}{/if}
{if $domain_email} + {$domain_email} + {/if}
+ + + + +
+ {* FIXME: style this table so that it looks like the text version (justification, etc.) *} + + + + + + + + {foreach from=$lineItem item=value key=priceset name=taxpricevalue} + {if $smarty.foreach.taxpricevalue.index eq 0} + + {else} + + {/if} + + + + + {if $value.tax_amount != ''} + + {else} + + {/if} + + + {/foreach} + + + + + + + {foreach from = $dataArray item = value key = priceset} + + + {if $priceset} + + + {elseif $priceset == 0} + + + + {/if} + {/foreach} + + + + + + + + + + + + {if $is_pay_later == 0} + + + + + + + + + + + + + + + {/if} +


+ + + + + + + +
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{$taxTerm} {ts 1=$defaultCurrency}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} {$value.tax_rate}%{ts 1=$taxTerm}No %1{/ts}{$value.subTotal|crmMoney:$currency}

{ts}Sub Total{/ts} {$subTotal|crmMoney:$currency}
{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{$value|crmMoney:$currency} {ts 1=$taxTerm}TOTAL NO %1{/ts}{$value|crmMoney:$currency}

{ts 1=$defaultCurrency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
+ {if $contribution_status_id == $refundedStatusId} + {ts}LESS Amount Credited{/ts} + {else} + {ts}LESS Amount Paid{/ts} + {/if} + {$amount|crmMoney:$currency}

{ts}AMOUNT DUE:{/ts} {$amountDue|crmMoney:$currency}
{ts 1=$dueDate}DUE DATE: %1{/ts}
+
+ + + + +
+ + + + + +
{ts}PAYMENT ADVICE{/ts}

{ts}To: {/ts}
+ {$domain_organization}
+ {$domain_street_address} {$domain_supplemental_address_1}
+ {$domain_supplemental_address_2} {$domain_state}
+ {$domain_city} {$domain_postal_code}
+ {$domain_country}
+ {$domain_phone}
+ {$domain_email}
+


{$notes} +
+ + + + + + + + + + + + + {if $is_pay_later == 1} + + + + + + {else} + + + + + + {/if} + + + + + + + + +
{ts}Customer: {/ts}{$display_name}
{ts}Invoice Number: {/ts}{$invoice_id}

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

+
+ + + {if $contribution_status_id == $refundedStatusId} + + + + +
+
+ + + + + + + + + + {if $organization_name} + + {else} + + {/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ts}CREDIT NOTE{/ts}{ts}Date:{/ts}{$domain_organization}
{$display_name} ({$organization_name}){$display_name}{$invoice_date} + {if $domain_street_address } + {$domain_street_address} + {/if} + {if $domain_supplemental_address_1 } + {$domain_supplemental_address_1} + {/if}
{$street_address} {$supplemental_address_1}{ts}Credit Note Number:{/ts}{if $domain_supplemental_address_2 } + {$domain_supplemental_address_2} + {/if} + {if $domain_state } + {$domain_state} + {/if} +
{$supplemental_address_2} {$stateProvinceAbbreviation}{$creditnote_id}{if $domain_city} + {$domain_city} + {/if} + {if $domain_postal_code } + {$domain_postal_code} + {/if} +
{$city} {$postal_code}{ts}Reference:{/ts} {if $domain_country} + {$domain_country} + {/if}
{$source} {if $domain_phone} + {$domain_phone} + {/if}
{if $domain_email} + {$domain_email} + {/if}
+ + + + + +
+ {* FIXME: style this table so that it looks like the text version (justification, etc.) *} + + + + + + + + {foreach from=$lineItem item=value key=priceset name=pricevalue} + {if $smarty.foreach.pricevalue.index eq 0} + + {else} + + {/if} + + + + + {if $value.tax_amount != ''} + + {else} + + {/if} + + + {/foreach} + + + + + + + {foreach from = $dataArray item = value key = priceset} + + + {if $priceset} + + + {elseif $priceset == 0} + + + + {/if} + {/foreach} + + + + + + + + + + + + {if $is_pay_later == 0} + + + + + + + + + + + + + + + + {/if} +


+ + + + + + + +
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{$taxTerm} {ts 1=$defaultCurrency}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} {$value.tax_rate}%{ts 1=$taxTerm}No %1{/ts}{$value.subTotal|crmMoney:$currency}

{ts}Sub Total{/ts} {$subTotal|crmMoney:$currency}
{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{$value|crmMoney:$currency} {ts 1=$taxTerm}TOTAL NO %1{/ts}{$value|crmMoney:$currency}

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

{ts}REMAINING CREDIT{/ts}{$amountDue|crmMoney:$currency}
+
+ + + + + +
+ + + + + + +
{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} {$display_name}
{ts}Credit Note#:{/ts} {$creditnote_id}

{ts}Credit Amount:{/ts}{$amount|crmMoney:$currency}
+
+ {/if} +
+ + diff --git a/CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl index d5561bb9b9b3..1fb8b9c2f0cd 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl @@ -21,6 +21,7 @@ UPDATE civicrm_option_value SET {localize field="label"}label = 'Activity Summar WHERE value = 'activitySummary' AND option_group_id = @option_group_id_report; --CRM-16853 PCP Owner Notification +--CRM-16853 Contribution Invoice Receipt Translation {include file='../CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl'}