Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-10-2017 06:37:14

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

VAT Rounding Error

We have an occasional VAT rounding error in the pricing that was not a problem in CCP8. Where do we go to adjust this?


Simon

Offline

 

#2 03-10-2017 11:32:36

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: VAT Rounding Error

If you can give some very specific examples that we can replicate, we can look at it and get a solution together.  All of the pricing and tax calculation logic in K9 is based on what was in V8, but substantial parts of it are new.  K9 has been tested and verified to work properly in production with VAT enabled, using different types of discount scenarios, etc. that were known to cause issues in V8.  Please advise on this and we can figure it out.  Thank you.


Nick Hendler

Offline

 

#3 03-20-2017 04:58:21

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: VAT Rounding Error

Here is an example. It is very simple order with no discounts. I have simplfied the item codes to make it easier to read. The discrepancy is that VAT in our accounts program is £16.18 and K9 is £16.19. K9 is rounding up £16.184 (20% of 80.92) to £16.19.

Order Totals
Item Subtotal +VAT    £80.92
Delivery +VAT    £0.00
VAT    £16.19
Total    £97.11
Payment    -£97.11
Balance Due    £0.00

SKU        EU VAT Summary    Qty    Total+VAT    VAT    Rate
Item1    Item1 Description    1    £4.25    £0.85    20.00%
Item2    Item2 Description    1    £6.63    £1.33    20.00%
Item3    Item3 Description    1    £9.85    £1.97    20.00%
Item4    Item4 Description    1    £9.74    £1.95    20.00%
Item5    Item5 Description    1    £18.65    £3.73    20.00%
Item6    Item6 Description    4    £31.80    £6.36    20.00%

Last edited by sdn (03-20-2017 05:01:52)


Simon

Offline

 

#4 03-20-2017 08:01:08

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: VAT Rounding Error

It is taking the item subtotal down by .01 as well?  What are you comparing the differences to?  V8 or an accounting program?


Nick Hendler

Offline

 

#5 03-22-2017 06:50:07

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: VAT Rounding Error

Not sure what figure you mean that is not already provided in the example above. Here is another example:

Item Subtotal +VAT    £51.11
Delivery +VAT    £6.50
VAT    £11.51

Subtotal is correct but 20% of 57.61 (51.11 + 6.50) is 11.522 not 11.51 calculated by the cart.


Simon

Offline

 

#6 03-22-2017 09:48:48

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: VAT Rounding Error

This may be due to individual items rounding up.  It's not as simple as (shiptotal+subtotal)*.20.  It's really (itemsubtotal*.20)+(itemsubtotal*.20)+(itemsubtotal*.20)+(shiptotal*.20).  If you can demonstrate this with one item, I can look to see where we may not be holding enough decimal places.  Is there a single item price that triggers this?


Nick Hendler

Offline

 

#7 03-29-2017 02:11:07

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: VAT Rounding Error

I am yet to find an example of just 1 item rounding up but why do I need to find one when you already know how the calculations are performed? It was not an issue in CCP8 so I assume you have changed the way VAT is calculated in K9.

All of our prices are to 2 decimal places (Pounds and Pence) and we do not use fractional quantities.

Why not just add one or more decimal places to resolve as you say?

Here is an example with only 2 line items:

Item Subtotal +VAT    £66.63
Delivery +VAT    £0.00
VAT    £13.32
Total    £79.95
Payment    -£79.95
Balance Due    £0.00
Number    European Union VAT Summary    Qty    Total +VAT    VAT    Rate
Item1    1    £2.26    £0.45    20.00%
Item2    1    £64.37    £12.87    20.00%

My VAT Calculations

Item Subtotal £66.63 @ 20% = £13.326 rounding to £13.33 (as per our accounting software)

K9 line item calculations
£2.26 @ 20% = £0.452
£64.37 @ 20% = £12.874

So I guess K9 can only be using 2 decimal places to arrive at £13.32 VAT.

Last edited by sdn (03-30-2017 05:25:34)


Simon

Offline

 

#8 03-31-2017 06:58:12

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: VAT Rounding Error

A lot has changed in K9.  Not the actual VAT calculations, but just about everything else as far as pricing formulation and storage.  K9 uses a completely different 'pricemap' concept for pricing storage.  Somewhere in there we're keeping too many decimal places.  With a V8 to K9 comparison with the same pricing I can pinpoint where that may be.  I am looking into this.


Nick Hendler

Offline

 

#9 04-20-2017 10:18:15

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: VAT Rounding Error

NIck, have you found an error?
I can add a single £18.30 item to cart, change qty to 2 and total correctly change to £36.30, but if I change quantity to 3 the total changes to £54.91(extra 1p). This happens on lots of products.
Don't want to waste time searching for problem if you have already resolved it.


Rob

Offline

 

#10 04-21-2017 07:02:08

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: VAT Rounding Error

This is still being looked at.  The rounding logic in the ECOM_Cart module needs to be checked and ensured it goes out to 6 decimal places in all cases.


Nick Hendler

Offline

 

Board footer