Jump to content
  • 0

Rounding errors on invoice vs service


Ann Smith

Question

I'm working on getting the money side of things setup and I have set taxes to inclusive and a GST Tax here in AU of 10%, my package needs to end up cosing $9.95

My test package has a ex GST cost of $9.0450.

With that figure when applying the service the invoice then correctly shows me $9.95 as the charge, however once in pending state the client invoice shows $9.96 all of a sudden in  the open invoices area and also when I now click the invoice

1130464413_ScreenShot2020-02-16at1_53_30pm.thumb.png.9205e012c8f7359afe2be743fc272e8a.png

 

Same Client invoice now choosing "view invoice"

 

2098943765_ScreenShot2020-02-16at1_54_23pm.png.865a7f91df390c418b934bb6a3dcf174.png

Taking that down to 9.0440 then only charges $9.94 but again shows $9.95 when adding service.

 

1848400059_ScreenShot2020-02-16at2_16_29pm.thumb.png.7145411fe9f045ede2140e17158e9374.png

So this is what happens:

With 9.0450 as the ex gst price the client ends up with an invoice for $9.96  

With 9.0440 as the ex gst price the client end up with an invoice for $9.94 

 

1158740060_ScreenShot2020-02-16at2_07_08pm.thumb.png.bb7f7fbe01edef1a3221daa93052d2b0.png

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Ah ok I went through the math in your example, I think the problem is opposite to what I said before, so it looks like the numbers are being rounded too early. You may in fact need to change the precision value from 2 to 3 or 4. What I think is happening is with the add new service function it's back calculating the tax from the 9.95 and ending up with 0.9045 which rounds off to 0.90 and all is well. With the invoice now it starts with 9.05 and forward calculates the 10% which is now 0.905 and this rounds to 0.91 instead of 0.90 and therein lies the problem. So try changing precision to 3 or 4 instead of 2. If that doesn't work then it's a problem with inconsistency in the coded math functions which Blesta will need to address.

Link to comment
Share on other sites

  • 0

Thankss, that actually worked as far as the cost calucation is concerned, using the correct 9.0450 price on the package does show as $9.95 including GST.  

However!!!  I have a different issue all together now and which is that the invoice now shows as $9.950 rather than $9.95.  This is argueably cosmetic but I can't really invoice people with this number of digits displayed.  Not a single invoice in Australia would be presented with 3 digits past the dot and I can see it leading to confusion, worse lead to wrong amounts being paid and all the financial messing around that would come with it.  But maybe this is fixable via a template edit?

1221386164_ScreenShot2020-02-17at1_07_28pm.thumb.png.56a2448000863595474896fbfc6e0d35.png

 

Really appreciate your help here btw!

Cheers

Ann

 

 

Link to comment
Share on other sites

  • 0

It seems to be a mathematical rounding struggle with $9.95 specifically and it's not a Blesta specific problem.

Interestingly enough this calculator even has the same issue:

https://www.gsttaxcalculator.com.au/

$9.95 and selecting - GST comes back with

Total Price
$9.05
GST Price
$0.90

But if you then go $9.05 and select +GST

Total Price
$9.96
GST Price
$0.91

Same problem there, total price is $9.96 when rounded.  My solution here will be charging $9.90 rather than $9.95.

I guess the only proper solution would be for the currency precision to allow for 3 digits as that way it rounds correctly but the invoice itself only showing 2 digits.

But in any case this can be considered resolved, thanks for your time though.

Ann

Link to comment
Share on other sites

  • 0

You should keep the currency's precision to whatever precision (i.e. digits after the decimal) the currency operates under. Like USD, AUD has a two-digit precision and should be left at 2.

There will be cosmetic rounding errors since rounding has to occur for each item when displayed, however, the total should be accurate as it sums up the total amounts before rounding.

Blesta doesn't currently support "inclusive" prices, if that is what you expect (i.e. that tax is derived from the total price you enter). Instead, tax is added to the price provided. So, a 10% tax of 9.05 is 0.905 (which rounds to 0.91) would give the total 9.05 + 0.905 = 9.955 (rounded to 9.96).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...