Saturday, September 17, 2022

Dynamics 365 Procure to Pay Process

 Below steps show the Procure to pay process :

    1. Create a new Vendor

    2. Create a Purchase order for the Vendor 

    3. Generate and Post the Product receipt for the Purchase order

    4. Generate and Post the Invoice for the Purchase order

    5. Create the Invoice Journal

    6. Generate and Post the Vendor payments 


1. Create a new vendor :

Create a vendor from the Accounts payable module. The user will create the vendor and enter the following

Vendor code

Name

Organization type

Organization Group

Contact information

Currency

Delivery terms

Mode of delivery

Sales tax group.

These values will be automatically populated in the purchase order and vendor invoice journal





2. Create a purchase order :

Select the vendor account, site, warehouse, and accounting date for the purchase order

Select the project for the purchase order(if any). Now create a line in PO, and fill in the item, quantity, and the unit price
Now confirm the PO


3. Generate and post the product receipt for the purchase order :

Generate the product Receipt

Enter the product receipt number, date, and document date. Press ok to post the product receipt.
Once the product receipt is posted, the status of the purchase order updates to "Received".




4. Generate and post the Invoices for the Purchase order :

Generate the purchase order invoice. Before posting the vendor invoice enter the invoice number and date for the invoice. Once the purchase order invoice is posted, the PO status will become invoiced.





5. Create the Invoice journal :

Now create an Invoice journal from 

Accounts payable > Invoices > Invoice journals

Create a new journal in the invoice journal form and enter the description for the invoice journal.

In the invoice journal, the business user will select vendor code, invoice date, invoice number, credit amount and offset account for the transaction. The offset account will be debited by the system.

Now validate and post the invoice journal.



6. Generate and post vendor payment :

Once the Invoice journal is posted, the transaction is available in the "Open vendor transactions" form. The payment journal will be used to perform the settlement for the vendor invoices. 

Account payable > payments > Vendor payment journal

Now create a new payment journal and enter the description of the journal.

Now in the vendor payment journal lines, select the vendor and click the "settlement" button to select the vendor invoice for settlement.

In the settle transaction form, mark the transaction for settlement and press ok.

Enter offset account type and account, once all details are entered validate and post the vendor payment journal.

After posting the payment journal, this transaction is now available in "closed transactions form". We can view all the closed transactions from the vendor master.




Crux: 

 1. The Procurement team will create the purchase order, after approval the purchase order needs to be confirmed by the buyer or the procurement manager. 

 2. The warehouse team needs to receive the purchase order, once all the items in the purchase order are received, the PO status will be "Received".

 3. The finance team needs to post the invoice for the purchase order. 

 4. Vendor settlement will be performed against the purchase order invoice.

Friday, September 9, 2022

SysOperation Framework example in Dynamics 365 FO

Controller class:

class MCOCancelSalesOrderController extends SysOperationServiceController

{

    protected void new()

    {

        super();

        this.parmClassName(classStr(MCOCancelSalesOrderService));

        this.parmMethodName(methodStr(MCOCancelSalesOrderService, processOperation));

        this.parmDialogCaption("Batch operation dialog title");

    }

    public ClassDescription caption()

    {

        return "Batch operation task description";

    }

    public static void main(Args args)

    {

        MCOCancelSalesOrderController controller;

        controller = new MCOCancelSalesOrderController();

        controller.startOperation();

    }

}



Contract class:

[

DataContractAttribute

]

public class MCOCancelSalesOrderContract implements SysOperationValidatable

{

    TransDate startShipDate, cancelShipDate;

    [

        DataMemberAttribute(identifierStr(StatrShipDate)),

        AifCollectionTypeAttribute('startShipDate', Types::Date),

        SysOperationLabelAttribute(literalStr("@MCO:MCOStartshipdate")),

        SysOperationDisplayOrderAttribute('1')

    ]

    public transdate parmstartshipdate (TransDate _startShipDate = startShipDate)

    {

        startShipDate = _startShipDate;

        return startShipDate;

    }

    [

        DataMemberAttribute(identifierStr(CancelShipDate)),

        AifCollectionTypeAttribute('cancelShipDate', Types::Date),

        SysOperationLabelAttribute(literalStr("@MCO:MCOCancelshipdate")),

        SysOperationDisplayOrderAttribute('2')

    ]

    public transdate parmcancelshipdate (TransDate _cancelShipDate = cancelShipDate)

    {

        cancelShipDate = _cancelShipDate;

        return cancelShipDate;

    }

    public boolean validate()

    {

        boolean isValid = true;

        if (!startShipDate)

        {

            isValid = checkFailed(strFmt("@SYS84753", "@MCO:MCOStartshipdate"));

        }

        if (!cancelShipDate)

        {

            isValid = checkFailed(strFmt("@SYS84753", "@MCO:MCOCancelshipdate"));

        }  

        return isValid;

    }

}



Service class:

class MCOCancelSalesOrderService extends SysOperationServiceBase

{

    TransDate       StartShipDate, CancelShipDate;

    public void processOperation(MCOCancelSalesOrderContract _contract)

    {

        StartShipDate  = _contract.parmstartshipdate();

        CancelShipDate = _contract.parmcancelshipdate();

        if(StartShipDate && CancelShipDate)

        {

            Info("Both dates entered.");

        }

    }

}

Link

Link