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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Vendor settlement for open transaction

(0) ShareShare
ReportReport
Posted on by

Hi Excepts..

my requirement is need to  settle open transaction against vendor  . below code i used but it was settle all transaction for that vendor  .. but i want to mark the invoice and payment then for that vendor then need to settle if payment is  2000 rs means i want to settle the first invoice amount upto match the 2000 rs .. here how to write code for this . can u any give me sample code for this ,, 

static void VendSettlement(Args _args)
{
      VendTable vendTable;
     VendTrans invCustTrans, payCustTrans;
     SpecTransManager manager;
     CustVendTransData custVendTransData;


while select vendTable where vendTable.AccountNum == '0000000'
{

         while select * from invCustTrans
        order by TransDate asc 
        where invCustTrans.AccountNum == vendTable.AccountNum &&
        invCustTrans.TransType == LedgerTransType::Vend &&
       !invCustTrans.LastSettleDate
   { 

          while select * from payCustTrans
          order by TransDate asc
          where payCustTrans.AccountNum == vendTable.AccountNum &&
          payCustTrans.TransType != LedgerTransType::Vend && 
          !payCustTrans.LastSettleDate
           {
             
             
                ttsbegin;
               custVendTransData = CustVendTransData::construct(invCustTrans);
               custVendTransData.markForSettlement(vendTable);

               custVendTransData = CustVendTransData::construct(payCustTrans);
                custVendTransData.markForSettlement(vendTable);
               ttscommit;

       VendTrans::settleTransact(vendTable, null, true,
       SettleDatePrinc::DaysDate, systemdateget());
       info(strfmt(" Customer Account:- %1 Transactions settled",vendTable.AccountNum));
                    }

           }


    }

 
}

*This post is locked for comments

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Could you provide some information on why you need to develop something for vendor settlements?

    Ludwig

  • Community Member Profile Picture
    on at

    Actually our client has made Invoices and Payments not in a standard way; say for an example our client has made 10 vendor invoices and made respective payments but not settling against the open invoice using functions>Settlement options;hence the invoice and payments lies open at vendor level even though it is settled, here transactions are more than 1000 lines, so wants to settle on FIFO basis

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans