Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

difference in calculations of the tax for the salesline

(0) ShareShare
ReportReport
Posted on by 787
Hi,
 
I'm trying to calculate tax for the sales line via code in order to get exactly the same value from the financials menu /salestax/ button on salestable form
 
 
//
 
 
I need to get the for this line 18.41. Under the hood class TAX os working to calculate this value and the value in the calculations is 18.406666666 which is rounded to 18.41 by the system.
 
I have found 2 ways to calculate tax for the line via code. they are described here
 
 
using both of them I get 18.4034 value which is rounded to 18.4 and I need 18.41 exactly as it is on the form after clicking sales tax button.  
 
Before diving into the very heavy code of the TAX class maybe there is something important I miss out?
 
Thanks.
  • Suggested answer
    Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    difference in calculations of the tax for the salesline
    Hi,
    Before you delve into complex code, you can refer to this official document: Tax calculation rounding rules - Finance | Dynamics 365 | Microsoft Learn. It mentioned that the Rounding precision and Rounding method fields determine how calculated amounts in the payload from the tax calculation service are rounded. It also provides an example that shows how the amount 987.345 is rounded for different combinations of rounding precisions and rounding methods.
    Best regards,
    Kevin

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

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans