VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: chancehoggan on December 19, 2011, 21:41:33 PM

Title: Tax Bug When State / Province / Region * is not selected
Post by: chancehoggan on December 19, 2011, 21:41:33 PM
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!
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: Milbo on December 20, 2011, 19:51:54 PM
?
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: chancehoggan on December 21, 2011, 19:51:13 PM
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.
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: ocsalb on January 25, 2012, 17:19:42 PM
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
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: PRO on January 25, 2012, 18:03:37 PM
in the cart view?

http://forum.virtuemart.net/index.php?topic=92144.msg318217#msg318217

Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: Milbo on January 25, 2012, 20:15:40 PM
Germany has no states entered. Usually we dont need it here.
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: ocsalb on January 26, 2012, 16:10:05 PM
thanks!
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: ocsalb on January 27, 2012, 12:27:28 PM
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!
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: binary on May 17, 2012, 22:02:22 PM
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?

Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: Milbo on May 18, 2012, 17:38:45 PM
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.
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: Milbo on May 18, 2012, 17:53:00 PM
I think I found it, please check

[attachment cleanup by admin]
Title: Re: Tax Bug When State / Province / Region * is not selected
Post by: Yiannistaos on May 29, 2012, 21:34:59 PM
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]