MediaFlux Posted February 23, 2017 Share Posted February 23, 2017 Hi,We're using PrestaShop v1.6.1.11 and our accountant noticed an error with the Tax-detail calculation on the invoices. I created a screenshot with the problem and what the result should be. Could this be due to a misconfiguration or is there an issue with PrestaShop's tax calculation?I guess the former since i can't find any related issues, but then i wonder where the problem could be... Link to comment Share on other sites More sharing options...
MediaFlux Posted February 28, 2017 Author Share Posted February 28, 2017 No one who has an idea? Link to comment Share on other sites More sharing options...
MediaFlux Posted February 28, 2017 Author Share Posted February 28, 2017 Since 11u30 i'm trying to trace down the problem in the code and i think i finally found it.In classes/order/Order.php foreach ($this->getCartRules() as $order_cart_rule) { if ($order_cart_rule['free_shipping'] && $free_shipping_tax === 0) { $free_shipping_tax = $this->total_shipping_tax_incl - $this->total_shipping_tax_excl; $order_discount_tax_excl -= $this->total_shipping_tax_excl; $expected_total_base += $this->total_shipping_tax_excl; } $cart_rule = new CartRule($order_cart_rule['id_cart_rule']); if ($cart_rule->reduction_product > 0) { if (empty($product_specific_discounts[$cart_rule->reduction_product])) { $product_specific_discounts[$cart_rule->reduction_product] = 0; } $product_specific_discounts[$cart_rule->reduction_product] += $order_cart_rule['value_tax_excl']; $order_discount_tax_excl -= $order_cart_rule['value_tax_excl']; } } On the 2nd line the condition $order_cart_rule['free_shipping'] always seems to be "0". Even if this cart rule actually is free shipping this is still "0" and that's why the rest of the tax calculation is wrong. If i look in Price Rules > Cart Rules > Edit (ID: 32) > Tab Actions there the Free shipping is set to YES.However in the database in ps_order_cart_rule at id_cart_rule: 32 the `free_shipping` is "0".Seems to be a bug after all. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now