Skip to main content

Notifications

Announcements

No record found.

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

Is there existing method to calculate sales tax amount?

(0) ShareShare
ReportReport
Posted on by 592
Hello guys,
 
I'm creating retail transaction which kinda similar of Sales Order using X++, I'm wondering whether there is existing method I can use to calculate sales tax amount that I can re-use ? This retail transaction (can say it is per item line similar like Sales Line records) will be used to create Sales Order later on, but I need to calculate the tax amount first to display it before it is getting converted to Sales Order.
The challenge here is I supposed to not hard-code the tax rate, but to look at SalesTaxGroup and ItemSalesTaxGroup, also I need to consider if the Price is include sales tax.
 
So basically, if I only have this kind of information:
1. Sales Qty
2. Sales Price
3. TaxGroup
4. ItemSalesTaxGroup
5. flag to identify IsPriceIncludeTax
 
How to easily calculate the tax amount ?
It is very good also if the method can also considering line discount but this is not a priority at the moment.
 
Thanks
 
 
 
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    Is there existing method to calculate sales tax amount?
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,187 Super User 2025 Season 1 on at
    Is there existing method to calculate sales tax amount?
    Hi Voltes,
     
    You can check if you can call the TaxCalculation class which has the logic.

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…

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans