web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Sales Invoice line / Order line rounding Problem

(0) ShareShare
ReportReport
Posted on by 330

Hi All,

Does anybody know how sales line amount rounding works or how to set it to nearest, up or down.

Eg:

22.176 ===> 22.18 This automatically up the amount (I need it to be 22.17)

8.155 ===> 8.15 This keeps it to nearest

6.949 ===> 6.95

26.136 ===> 26.14

26.84669 ===> 26.84

37.829 ===> 37.82

55.7175 ===> 55.72

Seems all random ups and downs

Anybody have a idea to get this solid

Thanks

Charith

*This post is locked for comments

I have the same question (0)
  • Rafael B. Profile Picture
    715 on at

    Hi @Charith Silva,

    Have you already looked into  UpdateAmounts function of t.37?

  • Suggested answer
    Mohana Yadav Profile Picture
    61,017 Super User 2025 Season 2 on at

    Please check this

    msdn.microsoft.com/.../hh169051(v=nav.90).aspx

  • CharithSilva Profile Picture
    330 on at

    Hi Rafael,

    I cannot see the CAL code anymore because its dev licence expired, so im working blind here. If you can tell me what it does that will be helpful

  • CharithSilva Profile Picture
    330 on at

    Hi Mohana,

    That is for the Whole invoice rounding and im already using it. This problem is on invoice/order lines, the calculation or rounding doesnt behave consistantly

  • Rafael B. Profile Picture
    715 on at

    @Charith Silva,

    Part of function's code which one can be helpful:

    IF "Line Amount" <> ROUND(Quantity * "Unit Price",Currency."Amount Rounding Precision") - "Line Discount Amount" THEN BEGIN

     "Line Amount" := ROUND(Quantity * "Unit Price",Currency."Amount Rounding Precision") - "Line Discount Amount";

     "VAT Difference" := 0;

     LineAmountChanged := TRUE;

    END;

    Also you always can put the time on your PC back to the past when you licence was not expired, and after development, return actual time, if it's possible.

  • CharithSilva Profile Picture
    330 on at

    Hi Rafael,

    I need the code formula which makes the "Line Amount", just above the code snip you given me

    thanks

  • CharithSilva Profile Picture
    330 on at

    My problem is this Navision round method is not consistant as the examples i have provided. It just doesnt follow the basic mathematical Rounding techniques.

    I need to to write a fuction on vb.net to replicate sales line calculation.

  • Verified answer
    CharithSilva Profile Picture
    330 on at

    ok Folks. I have figured it out.

    Its the line discount causing the problem. Line discount was calculated before and rounded before deducting from the line total.

    All sorted...!!! I have a fully working POS system written in VB.net using web services. Hopefully i wont be posting anything more until i discover another error (:)

  • CharithSilva Profile Picture
    330 on at

    Thanks Rafael and Mohana for the help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans