Rounding issue - Amount including VAT-Amount

poppinspoppins Member Posts: 647
Hi everyone,

I am facing this issue in NAV 2009 R2.
I have a field fieldXXX in the sales invoice where the user enters the amount including VAT.
When posting the invoice, the following check is made:
If fieldXXX <> ("Amount Including VAT" - Amount) THEN ERROR('%1 is not equal to total of VAT on lines %2',fieldXXX ,("Amount Including VAT" - Amount) )
The error message shows : fieldXXX=12.63 and ("Amount Including VAT" - Amount) =12.627621
Has anyone faced this issue before? How to correct it?

Thanks in advance :smile:

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    In standard setup NAV calculates with 5 decimal places and shows 2. So, if you want to compare the two values and your field only contains 2 decimal places then you have to round "Amount Including VAT" - Amount before you compare.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • poppinspoppins Member Posts: 647
    In standard setup NAV calculates with 5 decimal places and shows 2. So, if you want to compare the two values and your field only contains 2 decimal places then you have to round "Amount Including VAT" - Amount before you compare.

    OK but I have also a similar issue with "Amount Including VAT" for another check:
    fieldYYY is another field to check on "Amount Including VAT":
    If fieldYY <> "Amount Including VAT" THEN ERROR('%1 is not equal to total on lines %2',fieldYYY ,"Amount Including VAT")
    The error message shows 60.35 for fieldYYY and 60.34 for "Amount Including VAT".
    Shall I round "Amount Including VAT" before the check too?
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I don't know how your field is filled. Of course, there could be some differnce in rounding as well. For instance, a very famous example in NAV is that the sum of all rounded line values might not be equal to the rounded sum of all lines.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • poppinspoppins Member Posts: 647
    I don't know how your field is filled. Of course, there could be some differnce in rounding as well. For instance, a very famous example in NAV is that the sum of all rounded line values might not be equal to the rounded sum of all lines.

    My field is filled manually...
Sign In or Register to comment.