Project:Ubercart 2 VAT support
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

Hey

i've noticed a big problem, but im not sure that it's due to Ubercart (6.x-2.x-dev) or UC VAT support (6.x-1.2).
The problem is as follows:

while in checkout, when viewing cart contents, we get a list of items.
Ubercart outputs the totals for each product and then the subtotal, with taxes included.
given the right options in UC VAT support, it will also show the subtotal without VAT, and the amount of VAT.

so far, so good, as given with this example - cart contents:

2× teste1 14,76€
1× teste2 11,07€
Subtotal excluding VAT: 21,00€
IVA / VAT 23%: 4,83€
Subtotal: 25,83€

VAT is 23% (price x 1,23)
teste1 is 6€ without VAT, so 6x2= 12x1.23 = 14,76€
teste2 is 9€ without VAT, and 9x1.23 = 11,07€
14,76 + 11,07 = 25,83€ (as shown in the Subtotal (with VAT))
and 25,83 - 21,00 = 4,83€ (as shown in IVA / VAT 23%)

so as said before, all okay here.

the problem occurs later, at payment method - WITH or WITHOUT calculating shipping.

without calculating shipping:

Subtotal: 25,83€
Subtotal excluding VAT: 21,00€
IVA / VAT 23%: 5,94€
Order total: 25,83€

25,83 - 21,00 = 4,83€
4,83€ <> 5,94€...

after calculating shipping:

Subtotal: 25,83€
Iberia <2Kg: 7,00€
Subtotal excluding VAT: 28,00€
IVA / VAT 23%: 5,94€
Order total: 32,83€

32,83 - 28,00 = 4,83€
4,83€ <> 5,94€...

after calculating shipping with tax applied to shipping too:

Subtotal: 25,83€
Iberia <2Kg: 8,61€
Subtotal excluding VAT: 28,00€
IVA / VAT 23%: 7,55€
Order total: 34,44€

7,00 (shipping) x 1,23 = 8,61 - 7,00 = 1,61€
1,61 + 4,83 = 6,44€
34,44 - 28,00 = 6,44€
6,44€ <> 7,55€...

questions:
1) where the heck does this 5,94€ and 7,55€ in the VAT come from?
2) is it a bug in Ubercart or UC VAT support?

answers:
1) basicaly, the Tax/VAT shown in payment method is equal to the amount calculated before in the cart contents x the tax percentage again. this means, for example, 4,83€ x 1,23 = 5,94€
2) i don't know. maybe you guys know?

this needs a serious fix.
to get around this temporarily i'm hiding the VAT in payment method through CSS (display: none;)...

Comments

#1

I think this might be due to a recent(ish) change in Ubercart 6.x-2.x-dev

Can you try with 6.x-2.4 instead, or revert the patch from #898776-9: Tax calculation doesn't use altered prices and see if that helps?

#2

will try asap

#3

Hi Longwave,
I can confirm that in Ubercart 6.x-2.4 the calculation works but with the latest 6.x-2.x-dev (2011-Jun-23) it does not.
However, if I check to display VAT in the carts table, the VAT calculation is fine in there. Just the line items are not correct.

#4

Subscribe

Problem exist also in 6.x-2.6 now as patch #898776-9: Tax calculation doesn't use altered prices is part of the released version.

#5

Did look into this more thoroughly and it seems that root cause for this is as follows:
- as patch #898776-9: Tax calculation doesn't use altered prices was applied to Ubercart 6.x-2.6 each product line item price is calculated using uc_price() - instead of $item->price x $item->qty
- uc_vat module has uc_price() alter to calculate prices inclusive of VAT
- as a summary of this, while tax/vat amount is being calculated, taxable amount is inclusive of tax/vat (on previous versions it was exclusive of VAT) and thus, tax line item is incorrectly calculated (causing both subtotal excluding VAT and tax amount shown incorrectly at checkout)

@longwave already predicted this while patch was applied (see reply #13 in #898776-9: Tax calculation doesn't use altered prices)

Please find patches both for uc_taxes.module and uc_vat.module to fix tax line item calculations

AttachmentSize
uc_vat.module.patch 442 bytes
uc_taxes.module.patch 746 bytes

#6

Thanks for the patches.

When applying should we reverse previous patch?
>Reversed (or previously applied) patch detected! Assume -R? [n]
>Apply anyway? [n]

#7

Oops ... I must have mess up something while doing patches. Re-applied below.

AttachmentSize
uc_vat.module.patch 515 bytes
uc_taxes.module.patch 827 bytes

#8

Aargh! Still not correct - not my day. Patches re-applied once again. Sorry about all trouble here.

AttachmentSize
uc_vat.module.patch 515 bytes
uc_taxes.module.patch 705 bytes

#9

Thanks again.
It works great for me.
It is indeed big problem for ubercart users with vat support.

IMHO the new release of uc_vat and ubercart should be released as soon as posible.

#10

Priority:major» critical

I don't think the above patches are enough. It's treating a symptom of the problem, and not the root of the problem. The root of the problem seems to be that tax rules are being applied by the uc_vat alterer on cart_item and product types. This doesn't look like it ever worked. The other inherit danger is in assuming the store's default country can be used when no order information is given. The combined creates a scenario where default options apply tax laws to items that shouldn't be taxed, in this case the tax line itself.

The below patch should temporarily fix the issue, but we'd probably need a post from longwave to know if any of this is correct.

I concur w/ dP that this is potentially a critical bug. In our case it caused products to not be shipped.

-G

AttachmentSize
uc_vat.module-p2.patch 1.51 KB

#11

I have tested the patch ggalante supplied.
(Thanks for your work)
My review order site displays correct vat.

But I don't see vat line on /cart site
having following options checked.
Cart and checkout options
x Show VAT amounts in the cart and at checkout.
x Show VAT amounts in separate columns at checkout.

PS. I have applied this patch on clean ubercart 2.6 and clean uc_vat 6.x-1.2.

#12

I am not sure if the second patch should be applied after mitrpaka patches or they should be reverted.

#13

I reverted mitrpaka's patches before applying my own.

Currently we are using my patch on our site, with no adverse side effects. But we don't have very much complexity in our cart, so I can't be certain of the effectiveness of my patch without more thorough testing.

I'm swamped for the next 3 weeks, so if anyone else could do a deeper test, by all means. I would be extremely grateful. Normally I'm more thorough, but sometimes life hands you way too many lemons. :)

#14

I applied mitrpakas patches and it works better now, but still not correct.

Now the problem changed from too much to too less ...

I guess now the problem has to do with the shipping cost. As in the our shop we got three different kinds of VAT (0%, 7% and 19%) The tax on the shipping cost depends on the highest rate used in the order. As the total shipping cost should be always the same (in my case 5,50 €), I got to make three kinds of shipping costs and define some rules, when which kind has to be applied. So if there are only items with 0% VAT, there should be also no VAT on the shipping costs: 5,50 €, If the highest tax rate is 7 %, Shipping should be 5,14 € + 7 % = 5,50 €, if the highest rate is 19 % then this should be applied on the shipping costs: 4,62 € + 19 % = 5,50 €

Now the VAT should be calculated with the amount of all items belonging to one group of VAT and the highest should also include 5,50€ for shipping. But the case is, that only 5,14 € respectively 4,62 € are taking into account. So the VAT shown is too less.

Can somebody give me a hint, where I could try to make same changes to fix this?

Thank you!

#15

Hi ggalante,

Your patch also removes tax on line items while they're still in the cart. In our case we show inclusive pricing in the cart and they are incorrect after your patch.

Willem

#16

Is this maybe the problem I also have @ http://drupal.org/node/1278878 ?

And I can't apply patches as far as I know at my webhost, can someone give me access to the adjusted files? Thanks.

#17

@wjroes: As I said, my solution while closer to the problem, isn't a full solution. I apologize, but this problem seems to require a very deep understanding of both uc_vat and ubercart. I don't have time to catch myself up. What we really need is either a.) longwave to finally come back from wherever he is hiding, or b.) someone take his place, catch up on what needs doing, and apply a change in an official capacity.

@Taart: Why can't you simply apply the patch files to your local copy, and then push up the changed files to your host? It's no different from making changes to any other files on your site.

-G

#18

+1

#19

@ggalante

I don't know much about patching, but I'm on Windows, no Git installed. I manually altered the files, but then my incl. VAT prices show up without VAT in the shopping cart, doesn't look right to me.

#20

Subscribing.

#21

Status:active» needs review

Inspired by ggalante's patch in #10, I also made an attempt to fix this. As mitrpaka said in #5, the problem that occurs is that the tax calculation is based on the tax inclusive price. Taxes should always be based on the tax exclusive price of course.

1. The problem starts in uc_vat_apply_tax() where uc_vat asks the uc_taxes module for the taxable amount for each product: uc_vat calls uc_taxes_apply_item_tax().
2. The uc_taxes module calls the function uc_price() to get the taxable amount, but says it want's the taxable amount to be based on the altered price.
3. The function uc_price() thinks: so it wants the amount based on the altered price? No problem, then I will just ask all price alters to give me that.
4. Then the uc_vat module receives a request to return the altered price, function uc_vat_price_handler_alter() gets called. For product prices it returns the tax inclusive price.
Result: the taxable mount is the product price inclusive taxes.

So, I assumed all we need to do is notify the uc_vat-module it should not do any price alters under certain circumstances. The patch of ggalante generaly says "do not do the uc_vat price alter when the context is 'cart_item' or 'product'". But that will result in tax inclusive prices to disappear in the cart and on product pages, which is not a desired behaviour, at least not for me.

I noticed price alter functions receive an array of options as a parameter. What if we could set an option there that tells the uc_vat-module to not do any price alters? When calling uc_taxes_apply_item_tax(), we are not able to add an option, thus if we would set an option then calling uc_taxes_apply_item_tax() will be a no-go.

So, in my attempt to fix this issue I copied over uc_taxes_apply_item_tax() to the uc_vat module and called it uc_vat_uc_taxes_apply_item_tax(). Then I was able to set an option before the price request is sent to uc_price(). And so I did. I defined an option called 'uc_vat' and set this to FALSE to indicate price alters done by uc_vat should be bypassed. In the price alter function of uc_vat (uc_vat_price_handler_alter()), I added a check for this option, and if it was set to FALSE, then the price alter function will cancel it's price alterations.

This was my setup when creating and testing the patch:
- Ubercart v6.x-2.6
- Ubercart 2 VAT support v6.x-1.2
- Ubercart Discount Coupons v6.x-1.7
- Two active tax rates
- No shipping rates

I didn't test the patch under other circumstances then those above, so I can't guarantee it will work perfectly under all kinds of conditions.

AttachmentSize
tax_amount_fix_attempt-1170992-21.patch 2.81 KB

#22

@MegaChriZ, i tried this with and without a shipping rate and it doesn't work. I attached 2 screenshots. I use the same setup. In the shopping cart the VAT is ok, at the CMS it isn't.

Edit: Just to be sure, I also added a test order at /admin/store/orders/create, and it also has a VAT mismatch.

AttachmentSize
uc_vat-admin.PNG 14.65 KB
uc-vat-cart.PNG 11.35 KB

#23

@Taart
Do you have the "Allow per line-item tax adjustments" setting enabled? This setting can be found on the settings page for uc_vat. See attachment for my settings.

AttachmentSize
uc_vat-settings.jpg 249.58 KB

#24

None of these solved this problem for me. I ended up reverting to ubercart 2.4 and uc_vat 1.2. Now it works again.

#25

Status:needs review» needs work

I can confirm that when reverting back to ubercart 2.4 the double VAT issue disappears.

#26

Is there a possibility to go back to ubercart 2.4 and uc_vat 1.2, without losing all changes in my shop since the update was installed?

Now my online shop works with the patch: http://drupal.org/files/issues/tax_amount_fix_attempt-1170992-21.patch
Thank you to MegaChriz.
I think this solved my problem.

This was my setup when testing the patch:
- Ubercart v6.x-2.6
- Ubercart 2 VAT support v6.x-1.2
- many other modules
- two tax rates (7%; 19%)
- several shipping rates
- prices per role (incl. VAT, reseller: excl. VAT)

See the shop at: http://www.gourmetarium.com

#27

@MegaChriz, no, but now I did and it seems to work. Thanks!

#28

I have I similar problem. Everything seems to be ok at cart/checkout page
but at cart/checkout/review the VAT calculation is wrong.
It seems that VAT calculation here is based on tax inclusive prices.

So I install the #21 patch (many thanks @MegaChriz). Nothing changed. The Vat calculation remains wrong.
Through a debug process I noticed that the uc_vat_apply_tax function never called,
and the uc_taxes_apply_tax function called instead. So I hacked the code of uc_taxes.module to call
the MegaChriz's function from there...

function uc_taxes_apply_tax($order, $tax) {
  $amount = 0;
  $taxable_amount = 0;
  if (is_array($order->products)) {
    if (module_exists('uc_vat')) {  
       foreach ($order->products as $item) {
     $taxable_amount += uc_vat_uc_taxes_apply_item_tax($item, $tax);
   }
    }
    else {     
      foreach ($order->products as $item) {
    $taxable_amount += uc_taxes_apply_item_tax($item, $tax);
  }
    }
  }
  $taxed_line_items = $tax->taxed_line_items;

  ...
}

Now everything seems to work fine.
I'm waiting for a more efficient solution.

my setup when testing the patch:
- Ubercart v6.x-2.6
- Ubercart 2 VAT support v6.x-1.2
- uc_checkout_tweaks v6.x-1.1
- one tax rates (23%)
- prices per role (retail:incl. VAT, reseller: excl. VAT)

#29

In addition to my post above:
I noticed a further problem. On the payment, by Paypal the tax is still wrong and the total sum is one cent to high.

Why is there shown so much information on the paypal page? I think it should be enough to show the total sum, which the customer wants to pay. Is this possible?

AttachmentSize
checkorder.jpg 38.31 KB
paypal.jpg 18.19 KB

#30

Subscribe

#31

@WebsiteJo

I had the same problem and I believe this is because of differences in de precicion of prices excluding VAT calculated in 'Ubercart 2 VAT support' and the prices sent to paypal.

Let's say you want your price including vat to be 10€ with a VAT rate of 21% then you would enter (10/121)*100 = 8.26446
8.26446 * 0.21= 1.7355366 VAT + 8.26446 = 9.9999966 => Rounded to a precision of 2 after the comma this will be 10€
But paypal only gets 8.27 which is the amount excluding VAT rounded to 2 after the comma.
8.27 * 0.21 = 1.74 VAT + 8.27 = 10.01€

What I do is I enter my prices excluding VAT with less precision so I have the same result in ubercart as in paypal.
You could also change the payment method setting in /admin/store/settings/payment/edit/methods and select "Submit the whole order as a single line item." for the "PayPal cart submission method"

www.AffordIT.be

#32

@ jan_ver

Take a look at the attached files above. I think, the main problem is not the difference of 1cent.
The two amounts (32,08 and 8,36) are totally wrong.
I used the setting "Submit the whole order as a single line item." and got these wrong values on the paypal site.

#33

#34

@mkalkbrenner

I tryed your patch at #1081130. It works fine for customers with roles, which show prices including vat.
On reseller roles (prices shown without vat) this patch doesn´t work at all. The total sum is to low.

I think in my case it is better to use the patch "http://drupal.org/files/issues/tax_amount_fix_attempt-1170992-21.patch" from MegaChriz.
See the attached file reseller.jpg. It works and on paypal page there are correct values.

Roles with shown prices including vat get wrong values on paypal page (see attached file: schowvat.jpg).
Has anyone a idea to solve this problem?
Why is the paypal page themed diffrent in the two cases (reseller values are shown on the top of the page and the other ones on the left side) ?

AttachmentSize
reseller.jpg 58.05 KB
showvat.jpg 48.12 KB

#35

i use ubercart verson 2.7 and vat 2.1
with ubercart 2.4 vat/tax works fine!

for ubercart 2.7:
patch http://drupal.org/node/1170992#comment-5062982 doesnt work because there is no function uc_vat_uc_taxes_apply_item_tax!!!!
but the patch at http://drupal.org/files/issues/uc_taxes.module_4.patch seems to work!!

#36

@ caw67

You use the patch at http://drupal.org/files/issues/uc_taxes.module_4.patch,
but which patch do you use for vat module?
Do you have a store on-line in which I can see this functionality?

I only patched vat module (http://drupal.org/node/1170992#comment-5123658) with this patch: http://drupal.org/files/issues/tax_amount_fix_attempt-1170992-21.patch
You can try out my german store at http://www.gourmetarium.com, it works, only the vat, shown on PayPal page is wrong.
Please don´t submit the order finally.

#37

I use no uc_vat patch.
example: http://www.muenzboxen-muenzkapseln.de/

but there is another problem with the shipping cost. ubercart or the vat module add the shipping cost (without tax) to price with tax an then calcualte the total tax. thats wrong!

#38

@ caw67

I tried to take a look at the shop (http://www.muenzboxen-muenzkapseln.de/), but I couldn´t go to the order review page.
Following message was received:
"Sie müssen die akzeptieren um mit der Bestellung fortfahren zu können!"

There was nothing to accept.

#39

@WebsiteJo
now it works

#40

Status:needs work» active

Is there an accepted solution to this yet? Lots of people above saying 'works for me' - 'not me'....

This is basically crippling the module for UK/EU users. It's of ZERO use.

Chris

#41

This is what has worked for us.

We applied the patch #20. This resolved the issue that manifests itself on the checkout/review page. It doesn't resolve the issue associated with invoices and in our particular case, PayPal.

To resolve the incorrect amount of VAT being passed to PayPal we have applied part of the patch at #19 at http://drupal.org/node/1081130. We only applied the first element of the patch as the second is covered by the patch at #20.

These patches have been applied to uc_vat 6.12

We're using Ubercart 6.26

Hope this helps.

#42

This is my setup:
- Ubercart v6.x-2.7
- Ubercart 2 VAT support v6.x-1.2see my attached version
- many other modules
- two tax rates (7%; 19%)
- several shipping rates
- prices per role (incl. VAT, reseller: excl. VAT)

See the shop at: http://www.gourmetarium.com

Great! I think it works!

@ wd4t

To resolve the incorrect amount of VAT being passed to PayPal we have applied part of the patch at #19 at http://drupal.org/node/1081130. We only applied the first element of the patch...

This was also the solution for me.

@ caw67 #37
I can´t find your described problem.

AttachmentSize
uc_vat.module.txt 47.07 KB

#43

@WebsiteJo I've tried your uc_vat.module but it has a strange behaviour which I'll explain with an example.

(Price is VAT 21% inclusive)
Qty Item Price Total
20× ITEM_A €0,10 €2,00
ITEM_B €0,15 €1,20
11× ITEM_C €0,25 €2,75
ITEM_D €0,26 €0,52

Cart is resuming correctly:

(IVA stands for Italian 21%VAT)
Subtotal excluding IVA: €5,35
IVA 21%: €1,12
Subtotal: €6,47

During cart/checkout, I add the shipping quote and all values are fine:

(€4,75 is the VAT inclusive shipping cost)
Subtotal: €6,47
Shipping: €4,75
Subtotal excluding IVA: €9,28
IVA 21%: €1,95
Order total: €11,22
The strange things start on checkout/review:
Subtotal: €6,47
Shipping €4,75
Subtotal excluding IVA: €9,28
IVA 21%: -€0,24
IVA 21%: €2,18
Total: €11,22

Those two splitted VAT lines are also present on order summary and invoice.
The algebraic sum is correct (2.18-0.24=1.94 out of one rounding cent), but the splitting is not.

#44

@ mandreato

Please, see the attached file. There is only one line with Vat (19%MwSt).
All my values (price/shipping cost) are stored without vat in the database.

I think we use different configurations. How can I help you to figure this out?
Which modules do you use? What are your settings?

AttachmentSize
cart-checkout-review.jpg 152.32 KB

#45

This is my configuration (developement environment):

  • Ubercart 6.x-2.x-dev (2011-Nov-19)
  • Ubercart 2 VAT support 6.x-1.2 your uc_vat.module
  • Ubercart Discount Coupons 6.x-1.7
  • admin/store/settings/taxes
    • Name: IVA 21%
    • Rate: 0.21
    • Taxed products: Apply tax to any product regardless of its shipability
    • Taxed product types:
      • Product
      • "Blank line" product
    • Taxed line items:
      • Coupon discount
      • Shipping
      • Empty line
  • admin/store/settings/taxes/vat
    • Price display options
      • Tax name: IVA
      • Add "including IVA" to tax inclusive product prices: no
      • Add "price excluding IVA" to tax inclusive product prices: no
      • Add "no IVA applicable" to zero-rated product prices: no
      • Add "excluding shipping costs" to shippable product prices and cart displays: no
      • Show prices excluding IVA to the superuser: no
    • Price editing options
      • List price: no
      • Cost: no
      • Sell price: no
    • Cart and checkout options
      • Show IVA amounts in the cart and at checkout: yes
      • Show IVA amounts in separate columns at checkout: no
      • Hide the "Subtotal" line item at checkout: no
      • Hide IVA exclusive prices and "Subtotal excluding IVA" line item: no
    • Advanced options
      • Keep IVA inclusive prices the same after a rate change: no
      • Allow per line-item tax adjustments: no

#46

@ mandreato
This is different to your configuration:

Ubercart 6.x-2.7
I don´t use Ubercart Discount Coupons 6.x-1.7
admin/store/settings/taxes
Name1: 19% MwSt.
Rate1: 19%
Name2: 7% MwSt.
Rate2: 7%
Taxed product types:
Product ....
"Blank line" product
Taxed line items:
Shipping
admin/store/settings/taxes/vat
Price display options
Tax name: MwSt.
Add "including IVA" to tax inclusive product prices: yes
Add "price excluding IVA" to tax inclusive product prices: no
Add "no IVA applicable" to zero-rated product prices: no
Add "excluding shipping costs" to shippable product prices and cart displays: yes
Show prices excluding IVA to the superuser: no
Price editing options
List price: no
Cost: no
Sell price: no
Default attribute prices: no
Cart and checkout options
Show IVA amounts in the cart and at checkout: yes
Show IVA amounts in separate columns at checkout: yes
Hide the "Subtotal" line item at checkout: no
Hide IVA exclusive prices and "Subtotal excluding IVA" line item: no
Advanced options
Keep IVA inclusive prices the same after a rate change: no

Allow per line-item tax adjustments(requires patch to uc_taxes.module): yes
I think you should check this first!

MwSt. on shipping:
Use shipping line item settings from the tax rate configuration pages: yes
Apply MwSt. at the highest rate used on items in the order: no
Apply MwSt. proportional to rates used on items in the order no

#47

Status:active» reviewed & tested by the community

Allow per line-item tax adjustments(requires patch to uc_taxes.module): yes

That did the trick ! Now the behaviour of vat is correct in every step.
Thank you very much WebsiteJo.

I think that patch #42 should be commited, so changed the state of the issue in the hope of maintainer's help.

#48

patch #42 also works for me, my case includes discount coupons and shipping rates.
Everything fully functional now.

#49

#42 also worked for me!
Will it be included in uc_vat 6.x-1.3 ?

#50

#42 = the bees knees! Thanks to all of the above for helping to sort this out.

#51

Mmm … maybe I spoke too soon. On the order review page I’m getting a line with the VAT that would be applied to the already VAT inclusive price, preceded (or followed) by a line with an adjustment (a negative number) to the VAT bringing it to the correct amount. For example, for a purchase of 800 HUF with a VAT rate of 25% and 0 for shipping it looks like this:

Subtotal 1,000 HUF
Shipping 0
Subtotal excluding VAT 800 HUF
VAT - 50 HUF
VAT 250 HUF
Total 1,000 HUF

I’m configured with the following

Ubercart 6.x-2.7
Ubercart 2 VAT support 6.x-1.2 with mod from #42 above
Ubercart Discount Coupons 6.x-1.7
Ubercart Addresses 6.x-1.0
Ubercart Views 6.x-3.1
Ubercart Webform Checkout Pane 6.x-3.5

I’m attaching my VAT (ÁFA) settings.

The weird thing is sometimes the negative VAT line shows up first, other times the overinflated one. I don’t have the cart showing VAT, and the payment page is fine thanks to #42. Can anyone please help?

AttachmentSize
VAT-settings.jpg 50.33 KB

#52

@Grabby
See my post in #23: enable the "Allow per line-item tax adjustments" setting. The patch which is referred in the description of this setting has already been applied to Ubercart. See also #990744: uc_taxes does not respect hook_line_item_data_alter().

#53

Thanks @MegaChriz! So, about those bee knees …

#54

Thanks @MegaChriz! Your solution #42 works for me.

#55

It works, but now I have two lines
One line with the old VAT and one negative VAT.

Can we change this?

#56

Settings of #42 and #46 did the trick for me. Thanks

#57

Had troubles with incorrect taxes as well.

ubercart - 6.x-2.7
uc_vat - 6.x-1.2

Prices are entered without tax so on page admin/store/settings/taxes/vat the only things checked are 'Allow per line-item tax adjustments' and 'Use shipping line item settings from the tax rate config'

Example 1

  • Show VAT amounts in separate columns at checkout unckeched
  • Allow per line-item tax adjustments (requires patch to uc_taxes.module)

Added 1 item to basket (at sell price 19.90 ex VAT), shipping flat rate is 6.75 ex VAT...

cart/checkout:

Subtotal:                 23.68  (correct)
Shipping:                   8.03 (correct)
Sub ex 19% VAT:      26.65 (19.90 + 6.75 = correct)
VAT 19%:                   5.78 (INCORRECT: should be 26.65 * 19% = 5,06)
Order total:              31.71 (correct)

Example2

  • Show VAT amounts in separate columns at checkout CHECKED
  • Allow per line-item tax adjustments (requires patch to uc_taxes.module)

Added 1 item to basket (at sell price 19.90 ex VAT), shipping flat rate is 6.75 ex VAT...

cart/checkout:

                               EX VAT             VAT                       TOTAL
Subtotal:                 19.90               3.78 (correct)         23.68 (correct)
Shipping:                   6.75               1.28 (correct)          8.03 (correct)
Order total:              26.65               5.06 (correct)        31.71 (correct)

So the calculations in example 2 are correct when using the unpatched modules but using setting 'Show VAT amounts in separate columns'.

My client didn't want this setting. So I've used the patched file from #42 and everything is all good even without 'Show VAT amounts in separate columns '

So please commit #42 ASAP! And make this a critical update as this can cause big problems with the tax man!!!!

Cheers

#58

O my god, this is terrible!! I didn't notice this when upgrading. The "patch" in #42 seems to solve the problem for new orders, but not for existing invoices...
Seems that now my invoices and tax reports are a HUGE mess. Stupid me, not enough testing. I guess we have to manually correct all orders, resend invoices and write sorry-emails to ALL customers. This means days of work.
PLEASE put a large warning on the project page as long as this is not in the stable release.

#59

In our case patch #19 at #1081130: VAT in invoice calculated on Total not subtotal (ubercart > 2.4) solved the issue for new and existing orders. But it's known not to work with all payment methods.

nobody click here