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

stensbo

  • Jr. Member
  • **
  • Posts: 76
VAT is calculated incorrectly after upgrade
« on: January 24, 2019, 11:46:39 am »
Hello,
Using Joomla 3.9.2, Virtuemart 3.4.3 10005, PHP Version 7.1.26, vm overrides.
template Storefront version 3.23.3

I discovered that VAT is calculated wrong (on cart) if a discount is given. (i think after update to 3.4.2)

Attached image of calculation on cart - Moms(VAT) correctly should have been DKK 52,92 and Total Amount correctly should have been DKK 264,60.

We use
Vat rule: TaxBill - Vat pr. invoice (B2B)
Discount  rule: DBTaxBill - Price -% modification before Tax per bill.

I don't know if this is a bug ... debug comes with some notice


Notice: Undefined index: subTotal in /var/www/..../administrator/components/com_virtuemart/helpers/calculationh.php on line 834

Notice: Undefined index: percentage in /var/www/..../administrator/components/com_virtuemart/helpers/calculationh.php on line 917



stensbo

  • Jr. Member
  • **
  • Posts: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #1 on: February 13, 2019, 13:22:29 pm »
Hello,
Just tested with VirtueMart 3.4.3 10014.

It is still the same - VAT for calculation rule -% 'Price modifier before tax per bill' is not calculated and gives an incorrect VAT Amount ond a incorrect Total amount

Please see this topic https://forum.virtuemart.net/index.php?topic=141909.msg500418#msg500418

stensbo

  • Jr. Member
  • **
  • Posts: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #2 on: February 28, 2019, 16:01:39 pm »
Made a test on the virtuemart official demo site 3.4.10014. Added a product to cart from a category that uses the calculation rule DBTaxBill - Price -% modification after Tax per bill.
Please see the screenshot re. the VAT amount and tell me if I'm wrong and if you are working on this. In Denmark we calculate outgoing and incoming VAT of total amount - maybe is it different in other countries..

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3430
  • using Matomo instead of Google Analytics
Re: VAT is calculated incorrectly after upgrade
« Reply #3 on: February 28, 2019, 19:41:27 pm »
What is the result if you use 'Price modifier before tax per bill'?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9805
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VAT is calculated incorrectly after upgrade
« Reply #4 on: February 28, 2019, 19:46:00 pm »
I tested with the last one and it works for me (Result Total:    64,23 € -268,14 € 402,22 €), please try
http://dev.virtuemart.net/attachments/download/1154/com_virtuemart.3.4.3.10020_package_or_extract.zip
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: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #5 on: March 01, 2019, 12:55:53 pm »
@jjk
the same -  gives VAT an incorrect total amount

@milbo
Have just tested with version 3.4.3.10020 - also tested with Protostar and vmbeez template - still get an incorrect Vat amount - please see screnshot.

stensbo

  • Jr. Member
  • **
  • Posts: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #6 on: March 18, 2019, 13:35:33 pm »
Just tested with 3.4.3.10031

My settings for
Calculation rule VAT : +% 25 TAX PER BILL
Calculation rule discount: -% 2 Price modifier before tax per bill

Still get an incorrect Vat amount - testet with Protostar template - please see screnshot.

stensbo

  • Jr. Member
  • **
  • Posts: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #7 on: March 19, 2019, 14:35:19 pm »
Test with 3.4.3.10031

Tried to change my VAT setting from Calculation rule VAT : +% 25 TAX PER BILL ( which is "the normal one" for B2B - price display without VAT) and worked
back in version 3.2.15.9866 together with the other calc rules - to

Calculation rule VAT : +% 25 VAT tax per product
Calculation rule discount: -% 2 Price modifier before tax per bill
Calculation rule discount: -% 2 Price modifier after tax per bill

Please see screenshot for result - VAT amount is incorrect - vat is not calculated for calculation rule discount: -% 2 Price modifier after tax per bill.
Is it planned to get the calc. rule TAX PER BILL to work again so it can be used for VAT per bill ?

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3430
  • using Matomo instead of Google Analytics
Re: VAT is calculated incorrectly after upgrade
« Reply #8 on: March 19, 2019, 21:15:44 pm »
I think your mistake is that you are mixing a VAT calculation rule (B2C) with a Tax per bill calculation rule (B2B).
If you want to use Tax per bill, your product prices and your discount should all be net (without tax). In your latest screenshot the 'Total' should be DKK 24.00 instead of DKK 30.00.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9805
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VAT is calculated incorrectly after upgrade
« Reply #9 on: March 20, 2019, 00:13:49 am »
Notice: Undefined index: subTotal in /var/www/..../administrator/components/com_virtuemart/helpers/calculationh.php on line 834

Notice: Undefined index: percentage in /var/www/..../administrator/components/com_virtuemart/helpers/calculationh.php on line 917

There is the problem, I rewrote it using the old var names (subtotal instead of subTotal) was accidently renamed. Just use the new core on dev.virtuemart.net
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: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #10 on: March 20, 2019, 10:53:37 am »
@milbo

Quote
Just use the new core on dev.virtuemart.net

What do you mean - latest com_virtuemart.3.4.3.10031_package_or_extract.zip  ?  It is the version I'm testing and still get this notice

Notice: Undefined index: percentage in /var/www/danrider.dk/test/administrator/components/com_virtuemart/helpers/calculationh.php on line 917

stensbo

  • Jr. Member
  • **
  • Posts: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #11 on: March 20, 2019, 11:40:23 am »
@jjk

Thanks but i'm not mixing VAT rules.

We want to use TAX PER BILL (B2B) which we have used for many years together with some discount rules and vat/discount/total amounts
and pricedisplay (without vat) has been calculated and displayed correct .

After upgrade to 3.4.x, vat for discount rules (if you use TAX PER BILL as vat rule) is not deducted in vat total amount.

My post you are refer to was a test to see if vat was calculated and deducted vat amount for discount rules if you use VAT TAX PER PRODUCT (B2C) as a vat rule. And screenshot tells that it does not for all discount rules.

stensbo

  • Jr. Member
  • **
  • Posts: 76
Re: VAT is calculated incorrectly after upgrade
« Reply #12 on: March 20, 2019, 16:52:15 pm »
Downloaded and installed a brand new VirtueMart3.4.2_Joomla_3.8.12-Stable-Full_Package.zip - updated them to Joomla 3.9.4/Virtuemart 3.4.3.10031.

Disabled existing Taxes & Calculation Rules and added 3 new ones - available for all

1 VAT Rule     : +25% TAX PER BILL
1 discount rule:  -10% price modifier before tax per bill
1 discount rule:  -10% price modifier after tax per bill

Please test http://joom.danrider.dk/index.php/wear/lady/skirt-knock-rock-detail and add 1 to cart - then you can see calulations...no need for check out:)