Display sales tax rate

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
WylieE
Captain (CAPT)
Captain (CAPT)
Posts: 281
Joined: Tue Mar 25, 2008 8:26 am
Location: Puyallup, WA
Contact:

Display sales tax rate

Post by WylieE » Fri Feb 06, 2009 1:54 pm

We need to display the sales tax rate on our order emails (part of the WA state sales tax fun) to help our accounting group check orders.

Adding it to the order items list would be just fine. To do this, I'm presuming we would need to look at the item type. I'm still trying to wrap my brain around the nVelocity code to do that.

Does anyone have code prebuilt to display the sales tax rate in some way on their emails? Code fragments?
Eric Wylie
Warmoth Guitar Products, Inc.
http://www.warmoth.com

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Display sales tax rate

Post by nickc » Sat Feb 07, 2009 12:29 am

$store.TaxRules.get_Item(x).TaxRate

x is the Collection index of the rule, but what we have is the Id of the rule written in OrderItem.Sku for tax lines (if you are using Able tax calculation).

Seems like TaxRules.IndexOf(Id) should work, but it doesn't - nVelocity borks and writes out the code.

Sorry. If you are using Able tax, writing the rate in TaxRule.Name might be your best solution; maybe Mazhar's nVelocity foo is stronger than mine...

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

Re: Display sales tax rate

Post by mazhar » Sat Feb 07, 2009 5:50 am

try following code where you want to out put the tax rate

Code: Select all

#set( $foo = $orderItem.Sku + 0)
TAX RATE = $store.TaxRules.get_item($store.TaxRules.IndexOf($foo)).TaxRate %
#end

User avatar
WylieE
Captain (CAPT)
Captain (CAPT)
Posts: 281
Joined: Tue Mar 25, 2008 8:26 am
Location: Puyallup, WA
Contact:

Re: Display sales tax rate

Post by WylieE » Mon Feb 09, 2009 10:06 am

Thanks guys. I took a third route and had the tax line item appear with the order line items.

Code: Select all

($orderItem.OrderItemType == "Tax")
That got the information on the email for now. I'll look at the code you've provided for a more elegant solution moving forward.


Thanks!
Eric Wylie
Warmoth Guitar Products, Inc.
http://www.warmoth.com

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Display sales tax rate

Post by Logan Rhodehamel » Mon Feb 09, 2009 3:03 pm

WylieE wrote:That got the information on the email for now. I'll look at the code you've provided for a more elegant solution moving forward.
I suspect with 7.0.1 release and higher, there are better tax features to assist with this. OrderItem has new fields TaxRate and TaxAmount that can assist with invoicing and regulatory issues such as this. For the 7.0 release, it looks like the suggestions above are valid enough.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

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

Re: Display sales tax rate

Post by mazhar » Tue Feb 10, 2009 5:04 am

You should also give a try to code posted by me above. It was working for me.

Post Reply