Author Topic: VAT is calculated incorrectly after upgrade  (Read 1637 times)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9835
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VAT is calculated incorrectly after upgrade
« Reply #30 on: May 22, 2019, 20:21:48 pm »
I just tested the case and "Price modifier after tax per product" + "Price modifier before tax per bill" and it works correctly.

(I thought at begin you use "Price modifier before tax per bill" and "Price modifier after tax per bill".

But I see now, for the case "Price modifier BEFORE tax per product" it works wrong. Crazy. Thanks for the report.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

stensbo

  • Jr. Member
  • **
  • Posts: 86
Re: VAT is calculated incorrectly after upgrade
« Reply #31 on: May 23, 2019, 14:50:28 pm »
Quote
I just tested the case and "Price modifier after tax per product" + "Price modifier before tax per bill" and it works correctly.
Agrees

Quote
(I thought at begin you use "Price modifier before tax per bill" and "Price modifier after tax per bill".
Sorry if I have made confusion - we use

Calculations rule for VAT: 'Tax per bill'
Calculations rule for discount: -% 'Price modifier before tax' (is per product)
Calculations rule for discount: -% 'Price modifier before tax per bill'

Quote
But I see now, for the case "Price modifier BEFORE tax per product" it works wrong.
Agrees - you get incorrect Total amount for discount - discount amount is considered as positiv (I think :-\) for this rule - and only in calculation of Total discount amount - all other amounts/total amounts is correct

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9835
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VAT is calculated incorrectly after upgrade
« Reply #32 on: May 23, 2019, 21:50:27 pm »
In your setting, it would make no difference to use the other rule, because you add the VAT at the end. Just so, but it should be fixed, please test.

http://dev.virtuemart.net/attachments/1165/com_virtuemart.3.4.5.10063_package_or_extract.zip

I dont know how it behaves in order edit and the shipment radical vat setting. Maybe it works only correct with the radical tax. Did not test it yet. Please do that, it was hard enough to get it working.

Time to rewrite the calculator. The new calculator will gather first all rules per product, even when they are per bill, because our rules per bill work also per category and so on (which makes it so hard to write). Finally we collect the result and display it. It is almost that way already.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

stensbo

  • Jr. Member
  • **
  • Posts: 86
Re: VAT is calculated incorrectly after upgrade
« Reply #33 on: Yesterday at 17:52:39 »
YES :) Thanks Milbo - I appreciate your help a lot.

I have tested 3.4.5.10063 on our test site (also with a mix of categories and shoppergroups) and I can confirm that all amounts/total amounts are now
correct calculated if you use

Calculations rule for VAT: 'Tax per bill'
Calculations rule for discount: -% 'Price modifier before tax' (is per product)
Calculations rule for discount: -% 'Price modifier before tax per bill'.

But you are right you can't edit an order without screw it up - in our case it is not a problem  - we don't edit orders in Virtuemart.
If you wants some screenshot and explanations how it act - please let me know.

...the shipment radical vat setting - I managed to make a test in demo shop with differentiated VAT rules and the 'Simplified VAT for shipping' enabled,
I can tell that if you use

Calculations rule for VAT: +7% 'Tax per bill'
Calculations rule for VAT: +10% 'Tax per bill'
Calculations rule for discount: -% 'Price modifier before tax' (is per product)
Calculations rule for discount: -% 'Price modifier before tax per bill'

it does not work properly. In Denmark we do not have differentiated VAT - we only have the 25% rate so in our case it is not a problem,
we do not use the radical vat setting. I know that "it does not work properly" is a very short comment for a test. If you wants some screenshot and explanations how it act - please let me know.

Quote
Time to rewrite the calculator
I can imagine that it is hard to write with all these opportunities available. Please have in mind that it is important, in cart and order confirmation, to tell/display for
customer/shopper what discount they get - especially the per bill rules.