VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Gingerweb on January 23, 2024, 17:17:38 PM

Title: Editing an order by admin adds tax to shipping
Post by: Gingerweb on January 23, 2024, 17:17:38 PM
VirtueMart 4.2.4 10922
J4
PHP: 8.1.26

I make a test order in the VM shop for more than 1 item, then when it is confirmed i go to edit the order as admin (as though a customer had bought 2 items and only 1 is available) when i remove or change the number of items a VAT rule is applied to the shipping where there was no vat applied to it in the original order.

In the case shown on this video the shipping is £4.20 (no VAT rule applied) after editing the order the shipping has 84p (20%) shown as applied to the order

This is the process occurring as a screen recording showing this issue occur: https://support.gingerweb.co.uk/L1uygjAw

This is a live store but the owner is happy for me to make test purchases to try and solve why this is happening, if anyone has any suggestions to try and fix this please let me know.
Title: Re: Editing an order by admin adds tax to shipping
Post by: Milbo on February 06, 2024, 18:32:10 PM
Thank you for your report. Indeed interesting problem. It should keep 0.0 and only if you empty the field it should be calculated. I take a look
Title: Re: Editing an order by admin adds tax to shipping
Post by: Milbo on February 08, 2024, 18:23:38 PM
Maybe as workaround, what happens if you enter in the shipment VAT field 0.0001 ?
Title: Re: Editing an order by admin adds tax to shipping
Post by: Gingerweb on February 21, 2024, 16:05:47 PM
No we have tried this, any amount that is entered into the field is replaced and overwritten so in our case it adds 80p to the invoice despite there being no vat on this shipping option.
Title: Re: Editing an order by admin adds tax to shipping
Post by: Milbo on February 28, 2024, 14:04:58 PM
Check the order model in BE /administrator/components/com_virtuemart/models.

search around line 943 for
$calculate_billTaxAmount = vRequest::getInt('calculate_billTaxAmount',true);

and replace it with
$calculate_billTaxAmount = vRequest::getInt('calculate_billTaxAmount',0);

Then edit the order and disable the "calculate" checkbox near the payment tax.

Be aware that you have to calculate the shipment tax, payment tax and total tax on your own. Just enter your values. Usually the total tax is just the subtotal tax of the products in your case. So not to hard to calculate :-)
Title: Re: Editing an order by admin adds tax to shipping
Post by: Gingerweb on June 12, 2024, 16:27:49 PM
Milbo
im really sorry i didnt see this update - Can you tell me if this fix has been applied to the 4.2.8 update?
While everything is working (apart from this issue) i hate updating !!!
thanks