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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Calculate sales totals for partial quantity in X++

(0) ShareShare
ReportReport
Posted on by 2,114

Hi Techies,

We have a requirement where we need to get sales invoice totals from 'Totals' form of Sales orders. But here we need to modify the quantity and take the amount only for modified quantity in logic.

salesTotals = SalesTotals::construct(salesTable, SalesUpdate::All);
salesTotals.calc();

For instance - Suppose There is sales order having 2 sales lines with total sales qty 20 and each line is having 10 sales qty.  Standard will show invoice amount on Sales totals form based on total qty of Sales order i.e., 20. But in our case , Out of 10 qty of first sales line , if we are doing work creation of partial 4 qty then invoice amount should be calculated based on 4 qty of first sales line and that amount to be shown up on new customize report before doing actual invoicing.

pastedimage1661922454956v1.png

Can anyone guide on this please.

Thanks in advance.

Sangram

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    Hi Sangram,

    What have you done so far and have you encountered any challenges?

  • Sangram Shinde Profile Picture
    2,114 on at

    Thank you for reply Judy.

    I guess we have found the solution.

    We've populated SalesParmTable and SalesParmLine tables with Sales order details and updated SalesParmLine.DeliverNow quantity as load line quantity, which we are looking for.

    Now constructed SalesTotals with salesParmTable with document status as confirmation.

    salesTotals = SalesTotals::construct(salesParmTable, SalesUpdate::All, AccountOrder::None, salesParmTable.ParmId, salesParmTable.SalesId, DocumentStatus::Confirmation);
    salesTotals.calc();

    This code worked with modified quantity (load line quantity) and given the expected result.

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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans