Jump to content

Shipping tax value is shown in two sperate amounts


ptityop

Recommended Posts

This is very strange, the shipping tax value is coming out splitted into 2 values ... the total amount is correct but I have 2 values showing up instead of one as before . I am putting the code from invoice.tax-tab.tpl 

Below is the piece of code that is there, this was done by a previous dev but apparently it is buggy ... anyone can spot the error by any chance ?

<td>{l s='TVA Livraison:' pdf='true'}{assign var=has_line value=false}<br />{foreach $tax_breakdowns as $label => $bd}{assign var=label_printed value=false}
                     {foreach $bd as $line}
                     {if $line.rate == 0}
                     {continue}
                     {/if}
                     {assign var=has_line value=true}
                     {if isset($is_order_slip) && $is_order_slip}- {/if}
                     {if $label == 'shipping_tax'}
                     {displayPrice currency=$order->id_currency price=$line.total_amount}
                     {/if}
                     {/foreach}
                     {/foreach}
                  </td>

We realized that this is random with no apparent logic, on some invoices the tax comes out fine on others not .... but it makes no sense ... I can't see the mistake in the code if anyone could help that would be great. Thanks

 

 

So, I have set up a test shop on another domain to try troublshoot this, I left all the original pdf to see if the issue could have come from the custom code, but no ... even with the default templates I have the same issue ... I have no idea why this is happening, am i the only one ?

What you will see highlighted is the shipping costs, it comes broken down in 2 lines for no reason ... the total is correct but why is it splitted ... and that is using the orginnal pdf files... and template .. I have no idea how to troubleshoot this, any guidance would be welcome. Thanks in advance

 

 

shipping.jpg

shipping.Original.jpg

Link to comment
Share on other sites

  • 1 month later...

anyone has any idea as why this is happening, i am stuck .... Is there anything wrong in the below code ?

 

<td>{l s='TVA Livraison:' pdf='true'}{assign var=has_line value=false}<br />{foreach $tax_breakdowns as $label => $bd}{assign var=label_printed value=false}
                     {foreach $bd as $line}
                     {if $line.rate == 0}
                     {continue}
                     {/if}
                     {assign var=has_line value=true}
                     {if isset($is_order_slip) && $is_order_slip}- {/if}
                     {if $label == 'shipping_tax'}
                     {displayPrice currency=$order->id_currency price=$line.total_amount}
                     {/if}
                     {/foreach}
                     {/foreach}
                  </td>

 

Edited by ptityop (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...