[BUG] TAX calculated according to delivery address instead billing address

Started by guidocx842, December 17, 2013, 15:37:50 PM

Previous topic - Next topic

guidocx842

Hello everybody,
today I think we discovered an important bug. Sorry if someone just wrote about it but I wasn't able to find another post like this.
At registration time users have to define a billing address and, only if they want, different delivery addresses.
The issue is that, if my user defines a billing address for which I didn't set any tax rule but he defines a different delivery address for which I set tax rules, his total amount is calculated according to the delivery address instead to billing address!
So, if my user is Swiss but he want to receive his product in Italy, he'll pay 22% VAT instead of no VAT.
I think that to calculate the final price, Virtuemart must considers only the billing address and not the delivery one!
I attach some screenshots that will better show you the issue.
May you give me some information about that?
Thank you very much! Kind regards.

[attachment cleanup by admin]

guidocx842

I forgot to say you that my Joomla version is 2.5.16 and VM version 2.0.24c.
Please, can you try to replicate the issue? Thanks!

Milbo

ehrm sorry, but ....

did you asked your tax consultant? theoretically you are right, but practically the tax guys will assume that the company is just registered in swiss but doing work in italy and therefore has to be taxed in italy.

But if you wanna do that right, buy the euvatid checker which has also an option for that http://extensions.virtuemart.net/vm-orders/eu-vat-id-checker-detail .

[Update]
I just checked the code and found this


$stBased = VmConfig::get('taxSTbased',TRUE);
if ($stBased and !empty($this->_cart->ST['virtuemart_country_id'])) {
$this->_deliveryCountry = (int)$this->_cart->ST['virtuemart_country_id'];
} else if (!empty($this->_cart->BT['virtuemart_country_id'])) {
$this->_deliveryCountry = (int)$this->_cart->BT['virtuemart_country_id'];
}

if ($stBased and !empty($this->_cart->ST['virtuemart_state_id'])) {
$this->_deliveryState = (int)$this->_cart->ST['virtuemart_state_id'];
} else if (!empty($cart->BT['virtuemart_state_id'])) {
$this->_deliveryState = (int)$this->_cart->BT['virtuemart_state_id'];
}

So it should work that way. I even added already a config option for it. So I actually wonder why it does not work that way.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

guidocx842

Hi Milbo!
I spoke with my tax consultant that said me that you're right because if product don't leave Italy the user have to be taxed like an Italian buyer.
I see from your update that you find something useful to correct Virtuemart release. Should be a flag to configure this thing from backoffice?
Thanks a lot!  ;)