Tax

Hi

Was wandering if any one can help me with this issue I'm having.

I'm trying to do an export but im having problem extracting the tax information from the orders. This is what I have:

{foreach from=$orders item='order' name='orders'}
{foreach from=$order.products item='item' name='products'}{*
ContactName*}"OG Games Ltd",{*
InvoiceNumber*}"0{$order.order_id}",{*
InvoiceDate*}"{$order.order_date}",{*
DueDate*}"{$order.order_date}",{*
Total*}"{$item.total}",{*
Description*}"{$item.prod_opts_description}",{*
Quantity*}"{$item.amount}",{*
UnitAmount*}"{$item.price}",{*
AccountCode*}"200",{*
TaxType*}"$item.tax.description",{*
TaxAmount*}"",{*
Currency*}"GBP",{*
Type*}"Sales invoice",{*
Status*}"Awaiting Approval",
{/foreach}
{/foreach}

The problem is that its not grabbing the $item.tax.description, I've tried using {foreach from=$order.taxes item='tax'} with $tax.description but any product that doesn't have Tax will not show up on the extract.

Could anyone help me with this?

I figured a lot of things out, just having a problem with grabbing the tax_id for a specific product in the order?


Like if the order has 4 items, 3 of them is tax_id 2 and 1 of them is tax_id 4, how could I grab that information from the order?

You can use the fn_get_tax_name function. E.g.

{$tax_id|fn_get_tax_name}

Thank you, that helped a lot ☺️

You are welcome!