Editing Order Confirmation to display different tax rules
-
- Ensign (ENS)
- Posts: 11
- Joined: Wed Sep 23, 2009 11:08 am
Editing Order Confirmation to display different tax rules
Hi everyone,
For accounting purposes we want to split our Order Confirmation to show sets of Tax Rules(GST, PST - all seperate), rather than just TAX all lumped into one section. We need to be able to seperate it. Any idea's?
Thanks.
For accounting purposes we want to split our Order Confirmation to show sets of Tax Rules(GST, PST - all seperate), rather than just TAX all lumped into one section. We need to be able to seperate it. Any idea's?
Thanks.
Re: Editing Order Confirmation to display different tax rules
For this you need to itterate over order items, check order item types and for each order item of type tax out put amount etc as you desired like
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType="Tax")
$orderItem.Price
#end
#end
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType="Tax")
$orderItem.Price
#end
#end
-
- Ensign (ENS)
- Posts: 11
- Joined: Wed Sep 23, 2009 11:08 am
Re: Editing Order Confirmation to display different tax rules
Thanks Mazhar! Appreciate your help.
Again, sorry I am new to ASP.Net - so if I understand correctly I can use the block of code above and replace "Tax" with such as "GST"
and **IF** the GST exists, it will output the price?
Again, sorry I am new to ASP.Net - so if I understand correctly I can use the block of code above and replace "Tax" with such as "GST"
and **IF** the GST exists, it will output the price?
Re: Editing Order Confirmation to display different tax rules
No "Tax" represents the type of order item and it would be same for both normal and GST. In order to filter GST only you can put if on $orderItem.Name and check against the name by which you created GST in admin.
-
- Ensign (ENS)
- Posts: 11
- Joined: Wed Sep 23, 2009 11:08 am
Re: Editing Order Confirmation to display different tax rules
I have this block of code that I modified based on your suggestion. This is the solution that I found...
Thanks Mazhar!
Thanks Mazhar!
Code: Select all
#each
#if (($orderItem.OrderItemType == "Product") || ($orderItem.OrderItemType == "Discount") || ($orderItem.OrderItemType == "GiftWrap") || ($orderItem.OrderItemType == "Coupon") || ($orderItem.OrderItemType == "Tax"))
<tr class="email">
<td class="email" style="text-align: center;">
#if (($orderItem.OrderItemType == "Product"))
$orderItem.Sku
#elseif (($orderItem.OrderItemType == "Discount"))
DISCOUNT
#elseif (($orderItem.OrderItemType == "GiftWrap"))
GIFTWRAP
#elseif (($orderItem.OrderItemType == "Tax"))
TAX
#end </td>
-
- Ensign (ENS)
- Posts: 11
- Joined: Wed Sep 23, 2009 11:08 am
Re: Editing Order Confirmation to display different tax rules
Hello again.
Just reviewing the change to our invoice, and we found one more issue. This way works, however when you have multiple shipments in the same order, the tax displays by the shipment not the order.
I figured a could solve this problem by taking the shipments GST and adding each together and display it at the bottom.
I have this code:
This code outputs like so:
because on each shipment there are a set of GST - and 2 shipments total(in this order anyways) - and I know it is doing this because of the #foreach.
However, my question now, is how to I add "$orderItem.ExtendedPrice" together to output one number - and then convert it to a string.
Just reviewing the change to our invoice, and we found one more issue. This way works, however when you have multiple shipments in the same order, the tax displays by the shipment not the order.
I figured a could solve this problem by taking the shipments GST and adding each together and display it at the bottom.
I have this code:
Code: Select all
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType=="Tax")
<tr>
<td style="background:#cccccc; color:#00000; text-align: right;"><strong>$orderItem.Name:</strong></td>
<td class="email" style="text-align: right;">
$orderItem.ExtendedPrice.ToString("C")
</td>
</tr>
#end
#end
Code: Select all
GST: $1.10
GST: $1.10
PST: $1.75
However, my question now, is how to I add "$orderItem.ExtendedPrice" together to output one number - and then convert it to a string.
Re: Editing Order Confirmation to display different tax rules
Read following thread
viewtopic.php?f=42&t=8717
viewtopic.php?f=42&t=8717
-
- Ensign (ENS)
- Posts: 11
- Joined: Wed Sep 23, 2009 11:08 am
Re: Editing Order Confirmation to display different tax rules
Hey Mazhar,
Thanks for pointing me to the other forum...
Took a look and tried it out, but it doesn't help me in my case.. I need to take a sum of a stated variable.
Actually, what I almost need, is some way to say "If $orderItem.Name Exists more than twice than take a sum - else just output the same code I have below...
Any more idea's would be appreciated...
Thanks for pointing me to the other forum...
Took a look and tried it out, but it doesn't help me in my case.. I need to take a sum of a stated variable.
Actually, what I almost need, is some way to say "If $orderItem.Name Exists more than twice than take a sum - else just output the same code I have below...
Any more idea's would be appreciated...
Code: Select all
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType=="Tax")
<tr>
<td style="background:#cccccc; color:#00000; text-align: right;"><strong>$orderItem.Name:</strong></td>
<td class="email" style="text-align: right;">
$balance = $orderItem.ExtendedPrice
</td>
</tr>
#end
#end