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

How to get project Settelment Amount for Each ProjectInvoiced

(0) ShareShare
ReportReport
Posted on by 1,883

Dears,

I'm trying to get the settlement amount for projects invoices. I'm getting only one settled amount but not all invoices settled amount. I create a static method to find settlement amount with SalesId as input parameter in ProjInvoiceItem table so I can use it from anywhere. Please find below code.

//ProjInvoiceItem table
public display AmountCur amountSettled()
{
    CustTrans   custTrans;
    ProjInvoiceItem projInvoiceItem;
    ProjInvoiceJour projInvoiceJour;
    AmountCur amntCur;
    SalesTable salesTable;

 while select  sum(SettleAmountCur) from custTrans  where custTrans.Invoice == this.ProjInvoiceId

    {
        amntCur = custTrans.SettleAmountCur;
           }

    return amntCur;
    }  
 /* while select firstOnly projInvoiceItem join projInvoiceJour where projInvoiceItem.ProjInvoiceId == projInvoiceJour.ProjInvoiceId
        && projInvoiceJour.InvoiceDate == this.InvoiceDate
    {

     amntCur = projInvoiceJour.amountSettled();
    }

    return amntCur; 
}*/
//ProjInvoiceItem table
public static ProjInvoiceItem findFromSalesId(SalesId _salesID)
{
    ProjInvoiceItem    projInvoiceItem;
    

    if(_salesID)
    {
   select firstOnly projInvoiceItem index hint InvoiceIdx
        where projInvoiceItem.SalesId == _salesID;
    }
    return projInvoiceItem;
}

//test job
static void stlledAmount(Args _args)
{

    info(strFmt("Amount %1", ProjInvoiceItem::findFromSalesId("SO008350").amountSettled()));
}//I need to see all invoices settled amount which belongs the specific SO. 


I have the same question (0)

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 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans