Author Topic: Problem with calculation rules - two VAT rules applied  (Read 2614 times)

stawebnice

  • Jr. Member
  • **
  • Posts: 234
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Problem with calculation rules - two VAT rules applied
« on: June 05, 2015, 00:47:53 am »

Please help, I have eshop with:

VIRTUEMART 3.0.9
JOOMLA 3.4.1

Calculation rules:
when tax 21% is assigned to all categories in calculation rule settings and on product I select:

1. apply default rules - applies two vat rules at once 21+15=36%. Price is crossed even without discount.
example: http://nova.pippy.cz/eshop/pono%C5%BEky-1/rox-tony-bavln%C4%9Bn%C3%A9-pono%C5%BEky-rotex-detail
the same is applied for price differences on customfields... is there a way to have 15% VAT enabled, but not automatically applied? there are only very few  products that have this VAT,  but are in the same category as other products as those with 21% that are selected

2. when I assign 21% VAT on product - price is correct with correct VAT, but old price is crossed for products without discount, so there are two identical prices, but one of them is crossed
3. do not apply rules - no tax is applied, but it helps the issue that "old" price is crossed for products without discount

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Problem with calculation rules - two VAT rules applied
« Reply #1 on: June 05, 2015, 03:01:27 am »
1 The easiest way for us was to apply Vat per categories and group products with same tax in same categories.

If there are only few products with 15% Vat group them in same category.

stawebnice

  • Jr. Member
  • **
  • Posts: 234
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: Problem with calculation rules - two VAT rules applied
« Reply #2 on: June 05, 2015, 16:04:26 pm »
I did this and it helps but still there is this problem on category when I used "apply default settings":
http://imtp.me/9mr102lj3
VAT is correct now
BUT
there is no discount but the same price shows crossed...on product detail it is fine:
http://www.pippy.cz/damske-puncochy/mistery-fiore-20-den-detail

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Problem with calculation rules - two VAT rules applied
« Reply #3 on: June 05, 2015, 16:14:01 pm »
Suggestion to solve those VAT issues:
Create two VAT categories as if you create normal categories. You just need to give both a name, for example VAT1 and VAT2. You need to set both to unpublished! You seem to have already created both VAT calculation rules. So now assign inside the calculation rule the VAT rate 1 to the category VAT1 and the VAT rate  2 to the category VAT2 for example. So finally you just need to add the products with VAT rate 1 to that category VAT 1 in addition to the display category  and those products with the second Vat rate to  to the additional category VAT 2. So all products have now a display category (what you see on the shop page in shop front) and a second (unpublished category) for the VAT. Virtuemart will do the rest for you. With that method you can even use that extension Bundle Moss Tax Synchronizer + VM Localise to show the correct VAT rate for international users.

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Problem with calculation rules - two VAT rules applied
« Reply #4 on: June 05, 2015, 16:19:57 pm »
@lindapowers
I think that would work for you too and you can set the products to whatever category with correct calculation rules for tax. The only thing to take care about is that those VAT categories are set to unpublished.
It works with Virtuemart 3.0.9 without any problem.

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Problem with calculation rules - two VAT rules applied
« Reply #5 on: June 06, 2015, 12:36:34 pm »
Thanks, however I see 2 additional issues to this method. The tax for shipping and payments when you have different peoducts of different VAT will require an average calculated by vm with apply generic rules. Removing this and doing your method will apply just one VAT.

Also for the EU VAT could conflict and the countries where VAT is not applied directly.

stawebnice

  • Jr. Member
  • **
  • Posts: 234
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: Problem with calculation rules - two VAT rules applied
« Reply #6 on: June 06, 2015, 14:12:25 pm »
franzpeter: that is exactly what Milbo suggested and I did - so now VAT is displayed correctly, but the prices on categories are crossed even if there is no discount:
http://www.pippy.cz/damske-puncochy

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Problem with calculation rules - two VAT rules applied
« Reply #7 on: June 07, 2015, 10:34:05 am »
If that occurs, there must be a defined rule, valid for all to give discount. You need to do it in the same way to create a hidden discount category for example and add that unpublished discount category to the discount calculation rule. Or more simple do not create an additional unpublished category for that, just define your discount rule. So for those products you would like to give a discount, just add the hidden discount category to that product, so it is linked to 1. the display category, 2. the unpublished tax category and 3. the unpublished discount category. Or:if no hidden category for that purpose: use Final price on the product tab where you enter your prices and set the dropdown near the Final price to the discount rule. Done!
Virtuemart, as default rule, does the calculations in the following way. If you define a general calculation rule with no limits to category, shoppergroup a.s.o. Virtuemart will take that as default for all. It makes sense for example if you have a shop with only one tax calculation and everything else like discount or so is entered per product to overwrite the mentioned default rule.
So if you assign something on the product level, it will overwrite anything else. In general:
Defining something per product: Virtuemart takes that first! it will overwrite anything else. If you define nothing on product level, VM will calculate with the other calculation rules defined.

So in your case I am shure that you have defined somewhere a unlimited rule to give discount per product.

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Problem with calculation rules - two VAT rules applied
« Reply #8 on: June 07, 2015, 11:17:40 am »
I will add an example. You create a product called my product. It belongs to a display category my category. So say you want to have a 20% VAT rate and you want to have a discount of say 5%. So: first create the display category, where the customers will find the product. So you create a category named my category. Set it to published. Then you create a second one say 20% VATRATE. Set it to unpublished. Now create a calculation rule for the VAT rate and while doing so set, where you can enter the category, 20% VATRATE as category for that calculation rule. Now define another rule for your discount.
Now create the product in our example my product, add your product information and assign that product to the display category (my category) and to the 20% VATRATE category. Now in the price definition tab enter the cost price of that product. Where it shows Base price the dropdown nearby should show: Apply default rules. Where it shows Final price select from that dropdown select your discount rule. Done!
For the products without discount the Final price is set by default to Apply generic rules (so leave it unchanged, it is the default setting).

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Problem with calculation rules - two VAT rules applied
« Reply #9 on: June 07, 2015, 11:27:41 am »
@lindapowers
for shipping and payment you can set the VAT rule per plugin. It should work with the MOSS tax plugin, but I do not know exactly. Since year 2015 for example the shipping costs are called additional service (in case of taxes) so the main thing is the product you sell and the shipping costs as additional service follow the main tax rule for the product. So it should be sufficient, if using the Moss Tax plugin, to set inside the shipping plugin: Apply default rule.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2239
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Problem with calculation rules - two VAT rules applied
« Reply #10 on: June 08, 2015, 08:29:40 am »
@franzpeter

I don´t think stawebnice has any discount rule. I have tested with her VAT and price on a VM 3.08 install and get the same result as she does. Depending on the price You may get a discount or You don´t. This seems to be a VM bug. Please test with her numbers and You will see the same :)

Please have a look at this thread :
http://forum.virtuemart.net/index.php?topic=130162.msg448418#msg448418

regards

Jörgen @ Kreativ Fotografi



Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Problem with calculation rules - two VAT rules applied
« Reply #11 on: June 08, 2015, 12:14:18 pm »
@Jörgen,

If I understand that correctly it would mean that virtuemart will change by itself a discount to Yes or No, depending on the price? Does that only happen if the prices of the two different products are very close (means differ only by the last decimal or so)?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Problem with calculation rules - two VAT rules applied
« Reply #12 on: June 08, 2015, 12:51:06 pm »
franzpeter: that is exactly what Milbo suggested and I did - so now VAT is displayed correctly, but the prices on categories are crossed even if there is no discount:
http://www.pippy.cz/damske-puncochy

It was
Code: [Select]
if (round($product->prices['basePriceWithTax'],$currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {

I tried
Code: [Select]
if (round($product->prices['basePriceWithTax'],$currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$currency->_priceConfig['salesPrice'][1])) {

No difference. Maybe it is a layout override.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2239
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Problem with calculation rules - two VAT rules applied
« Reply #13 on: June 08, 2015, 13:10:46 pm »
Hello Milbo

Thanks for Your response :)

I don´t think this is a layout override causing this. I get this without any overrides, using numbers from stawebnice. Just need the right mix of price and VAT, when a lot of decimals are inwolved it gives a discounted price. I used the 21 % tax from stawebnice and some prices with more than 2 decimals in either cost price or final price. Calculating cost price with 21 % VAT from final price seems to give this result.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Problem with calculation rules - two VAT rules applied
« Reply #14 on: June 09, 2015, 13:02:47 pm »
Actually it is a missing round. check the svn, is committed
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/