Editing Order Confirmation to display different tax rules

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
peashootermedia
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Wed Sep 23, 2009 11:08 am

Editing Order Confirmation to display different tax rules

Post by peashootermedia » Tue Sep 29, 2009 10:19 am

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Editing Order Confirmation to display different tax rules

Post by mazhar » Wed Sep 30, 2009 5:23 am

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

peashootermedia
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Wed Sep 23, 2009 11:08 am

Re: Editing Order Confirmation to display different tax rules

Post by peashootermedia » Wed Sep 30, 2009 1:29 pm

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?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Editing Order Confirmation to display different tax rules

Post by mazhar » Thu Oct 01, 2009 4:19 am

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.

peashootermedia
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Wed Sep 23, 2009 11:08 am

Re: Editing Order Confirmation to display different tax rules

Post by peashootermedia » Thu Oct 01, 2009 9:37 am

I have this block of code that I modified based on your suggestion. This is the solution that I found...

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>


peashootermedia
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Wed Sep 23, 2009 11:08 am

Re: Editing Order Confirmation to display different tax rules

Post by peashootermedia » Thu Oct 01, 2009 2:04 pm

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:

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
This code outputs like so:

Code: Select all

GST: $1.10  
GST: $1.10  
PST: $1.75  
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.


peashootermedia
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Wed Sep 23, 2009 11:08 am

Re: Editing Order Confirmation to display different tax rules

Post by peashootermedia » Mon Oct 05, 2009 10:04 am

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...

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

Post Reply