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

VAT is calculated incorrectly after upgrade

Started by stensbo, January 24, 2019, 11:46:39 AM

Previous topic - Next topic

stensbo

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

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

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

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

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

stensbo

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

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

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

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

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

stensbo

@milbo

QuoteJust 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

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

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:)

stensbo

Just updated and tested with com_virtuemart.3.4.5.10054_package_or_extract.zip.

VAT amount is incorrect - vat is not calculated for discount calculation rules.

Please test http://joom.danrider.dk/index.php/wear/lady/skirt-knock-rock-detail and add 1 to cart - then you can see calculations....

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

jjk

Quote from: stensbo on March 20, 2019, 16:52:15 PM
1 discount rule:  -10% price modifier before tax per bill
1 discount rule:  -10% price modifier after tax per bill

I don't know what you are trying to achieve with adding two different discount rules.
Is the 'normal' calculation shown in the attached screenshot what you want? It uses a single 'Price modifier after tax' rule set to -10%.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations