News:

Looking for documentation? Take a look on our wiki

Main Menu

Tax Bug When State / Province / Region * is not selected

Started by chancehoggan, December 19, 2011, 21:41:33 PM

Previous topic - Next topic

chancehoggan

Looks like a bug in tax calucations for countries that have no State / Province / Region *

If no State / Province / Region *  is selected it seems to create a magical number!

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

chancehoggan

When the user enters the shipping or billing address the system automatically updates the the tax amount displayed in the cart. If the user only selects a country and doesn't specify a state VM seems to take all the tax rules... adds them together... and gives you a tax amount that is double the price of the item.

I am thinking that somewhere in the code it looks at the province when determining tax amount but some countries do not have provinces.

ocsalb

I discovered the same bug. When the user no selects the state, taxes are applied to all countries.

Example:
-18% IVA tax for Spain -> Santa Cruz de Tenerife / Las Palmas / Ceuta / Melilla

Is applied to
Germany with no state
Irrael with no state
France with no state
...
All with no state


Any solution???


Please excuse my bad English


Milbo

Germany has no states entered. Usually we dont need it here.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/


ocsalb

Not a problem templates, I have continued testing and the problem is salesPrice.

echo $this->currency->createPriceDiv('salesPrice','COM_VIRTUEMART_PRODUCT_SALESPRICE',$product->prices);


It does not show the correct price when the user selects the state for any country. And there is a fee to the state. Example -18% Spain (country) Las Palmas (State)

thank!

binary

Has this been looked at yet?  This is a continuing issue in 2.0.6 and 2.0.7 beta.  When no province/state is selected, all taxes that are listed in taxes and calculations are applied to the order!!

Example:

I select Germany with no province.. I get..


CANADA ONTARIO TAX  13%
CANADA QUEBEC TAX 13%
UNITED STATES TAX 5%

etc..

But if I select Canada, Ontario, it only applies the 13% tax..

whats up with this?

where is the calculation made so I can fix it?


Milbo

Lets switch to german for this issue, I do not really get it:

Also wenn ihr eine Regel erstellt. Nur für einen staat und ihr wählt als user ein Land ohne Staat, dann wird die Regel wirksam?

Wie soll es denn sein? Meine Logik ist:

Wenn ein Land selektiert ist, gilt die Regel nur für dieses Land

Wenn ein Staat selektiert ist, gilt die Regel nur diesen Staat.

Wenn beides selektiert ist, gilt es nur wenn Land und Staat passen (da macht es eventuell Sinn, das Land garnicht zu erfassen, also nicht spanien + Staaten, sondern einfach nur die spanischen Staaten.

Allerdings kann es sein,... das "Kein Staat" des shoppers dazu führt, dass die Regel nicht darauf getested wird => aktiv bleibt. Hmmmm. Ich guck mir das mal an. Bitte meine Vorstellung des Hergangs berichtigen, falls ich das jetzt falsch verstanden habe.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

I think I found it, please check

[attachment cleanup by admin]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Yiannistaos

Hello everyone,

The attachment file works for me:

Remove the suffix ".txt" and upload the file: "calculationh.php.txt" in the folder: /YOUR_JOOMLA_ROOT/administrator/components/com_virtuemart/helpers/

I have edited the line: 831

From:

$q = 'SELECT `virtuemart_state_id` FROM #__virtuemart_calc_states WHERE `virtuemart_calc_id`="' . $rule["virtuemart_calc_id"] . '"';
$this->_db->setQuery($q);
$states = $this->_db->loadResultArray();


To:

if ($this->_deliveryState != '') { //yiannistaos
$q = 'SELECT `virtuemart_state_id` FROM #__virtuemart_calc_states WHERE `virtuemart_calc_id`="' . $rule["virtuemart_calc_id"] . '"';
$this->_db->setQuery($q);
$states = $this->_db->loadResultArray();
} //yiannistaos


Enjoy it!  ;)

Thank you

[attachment cleanup by admin]