Sales tax calculation

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
awhc
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Tue Sep 23, 2008 12:31 pm

Sales tax calculation

Post by awhc » Tue Sep 23, 2008 1:34 pm

I need to customize the sales tax calculation but don't know where to add my code. Basically, I have a custom table set up to retrieve tax rates based on zip codes (worldwide). I'm using this information to automatically populate the order form fields of BillToCity and BillToProvince. That part works fine. However, I can't find where/when the actual tax calculation takes place. I have my taxrates available from the database but don't know where to plug them in. Can someone point me in the right direction as to what page(s) this should be added to and what functions/classes/etc should be involved? Thanks.

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

Re: Sales tax calculation

Post by mazhar » Tue Sep 23, 2008 9:32 pm

TaxCalculator class is used to calculate the tax. Basket class makes use of this TaxCalculator class on checkout to calculate the tax.

awhc
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Tue Sep 23, 2008 12:31 pm

Re: Sales tax calculation

Post by awhc » Wed Sep 24, 2008 8:26 am

Thanks mazhar. Now that I know what class to use, I need to know where to put the code. I've looked over the code on a few pages such as "placeorder2" and "vieworder" but I don't see any type of calculation. I even did a search for "TaxCalculator" through the whole solution but found no reference. Can you tell me what page(s) is used for the calculation and where I should add the code?

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

Re: Sales tax calculation

Post by mazhar » Wed Sep 24, 2008 9:27 pm

This call to TaxCalculator actually lies inside the Basket class's Checkout method mean that this code is inside the CommerceBuilder API. For your customization i think you may need to write custom tax provider. Please have a look at the following link
http://wiki.ablecommerce.com/index.php/ ... x_Provider

awhc
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Tue Sep 23, 2008 12:31 pm

Re: Sales tax calculation

Post by awhc » Thu Sep 25, 2008 12:20 pm

Thanks again mazhar. I will write my own tax provider class. Next question is, on what page (and when) do I add the call to my new tax provider class? One spot I was thinking about trying is on the PlaceOrder2.aspx.cs page in the "PlaceOrderButton_Click" event handler, right before the call to _Basket.Recalculate(). Is that a good place or should I look elsewhere?

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

Re: Sales tax calculation

Post by mazhar » Thu Sep 25, 2008 11:29 pm

AbleCommerce will automatically use your customer TaxProvider. You don't need to write code for tax calculation. All you need to do is write your custom TaxProvider and configure it on the store.
Read the following post, some community members are discussing Avalara Tax Provider Integration. It may help you
viewtopic.php?f=42&t=5935&st=0&sk=t&sd= ... axProvider

awhc
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Tue Sep 23, 2008 12:31 pm

Re: Sales tax calculation

Post by awhc » Mon Sep 29, 2008 12:37 pm

I will do that. Thanks again.

awhc
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Tue Sep 23, 2008 12:31 pm

Re: Sales tax calculation

Post by awhc » Wed Oct 01, 2008 1:38 pm

Sorry to keep asking questions about this, but, I still don't get it. This keeps getting deeper and more frustrating for me and as my deadline approaches I get more stressed out. I have tried writing my own provider but obviously I'm doing some things wrong.
All I want to do with my in-house custom solution is look up my values in a table based on a zipcode, return the taxrate, make a tax calculation, and add the amount to the order. If I was writing my own app this would be no big deal. However, I'm having a hard time grasping how this API thing works. I'm a fairly new developer and I've always developed my own code until now. I need a little bit of hand holding on this, if that is possible.

- How do I create/add the custom provider?
- How do I connect to my database and pass a zipcode parameter to a stored procedure?
- How do I return this value to my custom provider?
- How do I connect the custom provider to the application?
- How do I do whatever else needs to be done?

I'm willing to send you some sample code or whatever it takes to fully explain what I'm trying to do.

Again, thanks for any help you can provide.

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

Re: Sales tax calculation

Post by mazhar » Mon Oct 06, 2008 12:50 pm

Please read the following post. It will be a great help for you, good folks have already discussed many uses full stuff here.
viewtopic.php?f=42&t=5935

awhc
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Tue Sep 23, 2008 12:31 pm

Re: Sales tax calculation

Post by awhc » Mon Oct 06, 2008 2:36 pm

I did read that post but it didn't provide as much detail as I needed, since I'm so new to this. I did however find the solution to what I needed to do, through trial and error and a lot of debugging my own code. Thanks for your help.

User avatar
ImmortalLogic
Lieutenant (LT)
Lieutenant (LT)
Posts: 61
Joined: Tue May 11, 2010 9:29 am

Re: Sales tax calculation

Post by ImmortalLogic » Fri May 27, 2011 1:10 pm

If TaxCalculator.cs is designed to calculate the tax and I remove TaxCalculator.cs, I should not be able to view any tax calculated in my CheckOut. However, when I do remove the TaxCalculator.cs file, I still receive the calculated tax. Are there other files that perform the tax calculation?

Post Reply