Skip to content
Snippets Groups Projects
Commit 340cf724 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Version 2.4.6: Try to fix ShippingWithTax - The shippingValue was not...

Version 2.4.6: Try to fix ShippingWithTax - The shippingValue was not correctly reset to exclude taxes.
parent 60e82875
No related branches found
No related tags found
No related merge requests found
BASE=rules_shipping BASE=rules_shipping
BASE_ADV=rules_shipping_advanced BASE_ADV=rules_shipping_advanced
PLUGINTYPE=vmshipment PLUGINTYPE=vmshipment
VERSION=2.4.5 VERSION=2.4.6
PLUGINFILES=$(BASE).php $(BASE)_base.php $(BASE).script.php $(BASE).xml index.html PLUGINFILES=$(BASE).php $(BASE)_base.php $(BASE).script.php $(BASE).xml index.html
PLUGINFILES_ADV=$(BASE_ADV).php $(BASE)_base.php $(BASE_ADV).script.php $(BASE_ADV).xml index.html PLUGINFILES_ADV=$(BASE_ADV).php $(BASE)_base.php $(BASE_ADV).script.php $(BASE_ADV).xml index.html
......
File added
File added
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<authorUrl>http://www.open-tools.net</authorUrl> <authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright> <copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
<license>GPL v3+</license> <license>GPL v3+</license>
<version>2.4.5</version> <version>2.4.6</version>
<description>VMSHIPMENT_RULES_DESC</description> <description>VMSHIPMENT_RULES_DESC</description>
<files> <files>
<filename plugin="rules_shipping">rules_shipping.php</filename> <filename plugin="rules_shipping">rules_shipping.php</filename>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<authorUrl>http://www.open-tools.net</authorUrl> <authorUrl>http://www.open-tools.net</authorUrl>
<copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright> <copyright>Copyright (C) 2013, Reinhold Kainhofer</copyright>
<license>GPL v3+</license> <license>GPL v3+</license>
<version>2.4.5</version> <version>2.4.6</version>
<description>VMSHIPMENT_RULES_ADV_DESC</description> <description>VMSHIPMENT_RULES_ADV_DESC</description>
<files> <files>
<filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename> <filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename>
......
...@@ -291,7 +291,8 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin { ...@@ -291,7 +291,8 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
$cart_prices['salesPrice' . $_psType] = $calculator->roundInternal ($cart_prices[$this->_psType . 'Value'], 'salesPrice'); $cart_prices['salesPrice' . $_psType] = $calculator->roundInternal ($cart_prices[$this->_psType . 'Value'], 'salesPrice');
// Calculate the tax from the final sales price: // Calculate the tax from the final sales price:
$calculator->setRevert (true); $calculator->setRevert (true);
$cart_prices[$this->_psType . 'Tax'] = $cart_prices['salesPrice' . $_psType] - $calculator->roundInternal ($calculator->executeCalculation($taxrules, $cart_prices[$this->_psType . 'Value'], true)); $cart_prices[$this->_psType . 'Value'] = $calculator->roundInternal ($calculator->executeCalculation($taxrules, $cart_prices[$this->_psType . 'Value'], true));
$cart_prices[$this->_psType . 'Tax'] = $cart_prices['salesPrice' . $_psType] - $cart_prices[$this->_psType . 'Value'];
$calculator->setRevert (false); $calculator->setRevert (false);
} else { } else {
$cart_prices['salesPrice' . $_psType] = $calculator->roundInternal ($calculator->executeCalculation ($taxrules, $cart_prices[$this->_psType . 'Value']), 'salesPrice'); $cart_prices['salesPrice' . $_psType] = $calculator->roundInternal ($calculator->executeCalculation ($taxrules, $cart_prices[$this->_psType . 'Value']), 'salesPrice');
...@@ -299,7 +300,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin { ...@@ -299,7 +300,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
} }
reset($taxrules); reset($taxrules);
$taxrule = current($taxrules); $taxrule = current($taxrules);
$cart_prices[$this->_psType . '_calc_id'] = $taxrules[0]['virtuemart_calc_id']; $cart_prices[$this->_psType . '_calc_id'] = $taxrule['virtuemart_calc_id'];
} else { } else {
$cart_prices['salesPrice' . $_psType] = $value; $cart_prices['salesPrice' . $_psType] = $value;
$cart_prices[$this->_psType . 'Tax'] = 0; $cart_prices[$this->_psType . 'Tax'] = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment