From 18b3a127711f8d272e967ea466ec3771e37ed9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Chans=C3=A9aume?= Date: Mon, 4 Aug 2014 16:31:18 +0200 Subject: [PATCH] removed tax when there is no tax --- templates/pdf/default/delivery.html | 6 +++-- templates/pdf/default/invoice.html | 37 ++++++++++++++++++----------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/templates/pdf/default/delivery.html b/templates/pdf/default/delivery.html index 51133ff63..a7b060edf 100644 --- a/templates/pdf/default/delivery.html +++ b/templates/pdf/default/delivery.html @@ -135,8 +135,10 @@ {config key="store_name"} - - {config key="store_address1"} {config key="store_address2"} {config key="store_address3"} - - {config key="store_zipcode"} {config key="store_city"} + {$addresses="{config key='store_address1'} {config key='store_address2'} {config key='store_address3'}"} + {$city="{config key='store_zipcode'} {config key='store_city'}"} + {if $addresses != " "}- {$addresses}{/if} + {if $city != " " }- {$city}{/if} {if {config key="store_country"} } {loop type="country" name="address.country.title" id={config key="store_country"}} - {$TITLE}{/loop} {/if} diff --git a/templates/pdf/default/invoice.html b/templates/pdf/default/invoice.html index 68d518639..841e908cf 100644 --- a/templates/pdf/default/invoice.html +++ b/templates/pdf/default/invoice.html @@ -136,8 +136,10 @@ {config key="store_name"} - - {config key="store_address1"} {config key="store_address2"} {config key="store_address3"} - - {config key="store_zipcode"} {config key="store_city"} + {$addresses="{config key="store_address1"} {config key="store_address2"} {config key="store_address3"}"} + {$city="{config key="store_zipcode"} {config key="store_city"}"} + {if $addresses != " "}- {$addresses}{/if} + {if $city != " " }- {$city}{/if} {if {config key="store_country"} } {loop type="country" name="address.country.title" id={config key="store_country"}} - {$TITLE}{/loop} {/if} @@ -291,22 +293,29 @@

{intl l="Total without tax"}

{format_money number={$TOTAL_AMOUNT - $POSTAGE} symbol=$orderCurrency}

+ {strip} + {capture name="Tax"} + {foreach $taxes as $name=>$prices} + {assign var="_price_taxe_" value="0"} + {foreach $prices as $price} + {$_price_taxe_= $_price_taxe_ + $price} + {/foreach} + {if $_price_taxe_ != 0} + +

{$name}

+

{format_money number=$_price_taxe_ symbol=$orderCurrency}

+ + {/if} + {/foreach} + {/capture} + {/strip} + {if $smarty.capture.tax ne ""}

{intl l="Tax"}

{format_money number=$TOTAL_TAX symbol=$orderCurrency}

- {foreach $taxes as $name=>$prices} - {assign var="_price_taxe_" value="0"} - {foreach $prices as $price} - {$_price_taxe_= $_price_taxe_ + $price} - {/foreach} - {if $_price_taxe_ != 0} - -

{$name}

-

{format_money number=$_price_taxe_ symbol=$orderCurrency}

- - {/if} - {/foreach} + {$smarty.capture.tax} + {/if}

{intl l="Total with tax"}

{format_money number={$TOTAL_TAXED_AMOUNT - $POSTAGE} symbol=$orderCurrency}