Wednesday, 23 March 2022

PO Invoice Report in D365 F&O changes

 /// <summary>

/// This class is a COC of PrintMgmtDocType

/// </summary>

class XDDPrintMgtDocTypeHandlersExt 

{

    /// <summary>

    /// This method is an extension of EventHandlerResult

    /// </summary>

    /// <param name = "_docType">PrintMgmtDocumentType</param>

    /// <param name = "_result">EventHandlerResult</param>

    [SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]

    public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)

    {

        switch (_docType)

        {

            case PrintMgmtDocumentType::PurchaseOrderInvoice:

                _result.result(ssrsReportStr(XDDVendInvoiceDocument, Report));

                break;

        }

    }

}


Duplicate the PO invoice Report (XDDVendInvoiceDocument)


/// <summary>

/// This class is a COC of VendInvoiceDocumentDP

/// </summary>

[ExtensionOf(classStr(VendInvoiceDocumentDP))]

final class XDDVendInvoiceDocumentDP_Extension

{


    /// <summary> populate new fields for report Vendor RCTI Invoice </summary>

    /// <param name="_purchInvoiceTransOrTaxTrans"> Initialize _purchInvoiceTransOrTaxTrans </param>

    /// <param name="_vendPaymSched"> Initialize _vendPaymSched </param>

    protected void populateVendInvoiceDocumentTmp(NoYes _purchInvoiceTransOrTaxTrans, NoYes _vendPaymSched)

    {

       

        next populateVendInvoiceDocumentTmp(_purchInvoiceTransOrTaxTrans, _vendPaymSched);


        PurchTable      purchtable  = PurchTable::find(vendInvoiceJour.purchid);

        VendTable       vendtable   = VendTable::find(purchtable.OrderAccount);


        vendInvoiceDocumentTmp.XDDPurchOrderDate        = DateTimeUtil::date(purchtable.CreatedDateTime);

        vendInvoiceDocumentTmp.XDDOrderAccount          = purchtable.OrderAccount + #emptyValue + DirPartyTable::findRec(VendTable.Party).KnownAs;

        vendInvoiceDocumentTmp.XDDPurchName             = purchtable.PurchName;

    }

}

No comments:

Post a Comment

DefaultDimension in d365 FO X++

 Navigate to PurchTable methods you can find with DefaultDimension this.DefaultDimension = this.mergeDimension(this.getDefaultDimension(),th...