VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: binary on May 02, 2012, 19:15:11 PM

Title: Where are Price Calculations made?
Post by: binary on May 02, 2012, 19:15:11 PM
Where are the price calculations made in Virtuemart 2.0.6 ?  Where is the .php file?  I am trying to stomp out a tax bug and need to figure out where I can see the tax being applied.

Thank you so much!

Title: Re: Where are Price Calculations made?
Post by: binary on May 02, 2012, 20:04:42 PM
Okay I found that in /administator/components/com_virtuemart/helpers/calculationh.php  that the per product tax/discounts are applied, but where are the country/province tax applied to the entire cart?  Where are those calculated??

Help please :)
Title: Re: Where are Price Calculations made?
Post by: t1O180uS on May 02, 2012, 21:25:23 PM
I need similar information to apply US zip-code based tax rates.
Title: Re: Where are Price Calculations made?
Post by: PRO on May 03, 2012, 00:14:02 AM
binary,
whats the bug you are having?
Title: Re: Where are Price Calculations made?
Post by: Milbo on May 03, 2012, 01:57:41 AM
We are working atm at avalara tax. I suggest also to use the latest beta, which has some updates for US and retail prices. http://forum.virtuemart.net/index.php?topic=102143.0
Title: Re: Where are Price Calculations made?
Post by: binary on May 03, 2012, 02:06:05 AM
Well the problem is that if you select a Country like Korea, no provinces appear in the province drop down so you can't select any.  If you don't select a province then it automatically assigns all TAXES to the cart even if you have set country limits on those taxes.

I installed 2.0.7 beta, it has not been corrected in this version either.

Can you please let me know where the cart taxes are calculated so I can fix this issue myself?

Thank you
Title: Re: Where are Price Calculations made?
Post by: Milbo on May 03, 2012, 02:20:05 AM
Hmm, I think the problem is that the provinces of korea do not appear. Are they added? states are not soo, exact.
Title: Re: Where are Price Calculations made?
Post by: binary on May 03, 2012, 02:30:39 AM
No there are no provinces for Korea.. are they supposed to be selectable?

Also, if no province/state is selected, it is currently failing and adding all TAXES even if those taxes are country limited.  Shouldn't the opposite happen.. like no taxes being applied instead?

Where can i check to see if the provinces of Korea are added?  Is there a certain file?
Title: Re: Where are Price Calculations made?
Post by: Milbo on May 03, 2012, 02:32:57 AM
Be countries view.

I dont know how you created your tax rules. Please describe what you want and at best send some examples how you created the rules as example.
Title: Re: Where are Price Calculations made?
Post by: binary on May 03, 2012, 03:14:21 AM
Thank you for your prompt reply.  Are there supposed to be states/provinces in the Country of Korea in the default installation of Virtuemart?  I do not have any in North or South but I'm not sure if that's due to my migration from 1.1 or the default installation of 2.0.6 doesn't contain the states?

Title: Re: Where are Price Calculations made?
Post by: Milbo on May 03, 2012, 12:08:56 PM
Imho we do not have the states. I added myself the german states 3 months ago, even virtuemart was mainly a german component. I just wanna show with this, that this is something you must add yourself. Of course, community means that you spent your work. So take the latest install_required.sql add them and post it here.
Title: Re: Where are Price Calculations made?
Post by: binary on May 03, 2012, 15:22:55 PM
Thank you for your reply.  If I get around to adding provinces/states to some countries I will post them here.

But in the meantime, it should not add every tax to a country if a state/province is not selected.  Do you know which php file that these taxes are being calculated/added from?  I'd like to change the default behavior.

Thank you
Title: Re: Where are Price Calculations made?
Post by: t1O180uS on May 03, 2012, 17:30:55 PM
Quote from: Milbo on May 03, 2012, 01:57:41 AM
We are working atm at avalara tax. I suggest also to use the latest beta, which has some updates for US and retail prices. http://forum.virtuemart.net/index.php?topic=102143.0

Unfortunately, that release doesn't do what I need. I need to be able to drill further down than Country -> State. I at least need to be able to drill down to Country -> State -> Zip-Code.

For instance if a region with a Zip-Code that is 90210 has a 6% tax rate, I want to be able to charge the 6% tax rate to a customer who has the 90210 Zip-Code in their address.

Some insight on how/where the tax calculation is being done would be really helpful.
Title: Re: Where are Price Calculations made?
Post by: binary on May 04, 2012, 01:21:53 AM
Yes, I second that.  Can someone please shed some insight on where the final invoice tax rules are applied in the code?  I've been searching for days..

Thanks
Title: Re: Where are Price Calculations made?
Post by: binary on May 17, 2012, 21:55:05 PM
Can anyone let me know where I can find these tax rules that are calculated on the cart?  I need to fix a tax issue that if someone doesn't select a province, it applies all taxes.