News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Problem with calculation rules - two VAT rules applied

Started by stawebnice, June 05, 2015, 00:47:53 AM

Previous topic - Next topic

stawebnice


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

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

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

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

@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

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

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

#7
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

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

#9
@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

@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.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

franzpeter

@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

Quote from: stawebnice 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

It was

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


I tried

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

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.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

Actually it is a missing round. check the svn, is committed
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/