Thursday, 19 November 2020

PURCHASE LINE DISCOUNT price of trade agreement D365 code X++ get linediscount

 GET TRADE AGREEMENT PURCHASE line discount x++ CODE D365

WITH THE BELOW CODE YOU CAN GET THE CURRENT TRADE AGREEMENT line discount OF A GIVEN PURCHASE ORDER LINE IN D365.

 public static price findPurchLineDisc(Purchline _purchline, VendAccount _vendAccount, InventDimId _inventDimId)

    {

        InventTable inventTable = InventTable::find(_purchline.ItemId);

        VendTable vendTable = VendTable::find(_vendAccount);

        InventDim inventDimItem = InventDim::find(_inventDimId);

        UnitOfMeasureSymbol     unitId          = inventTable.inventTableModuleInvent().UnitId;

        PriceDisc_LineDisc      priceDisc_LineDisc;


        priceDisc_LineDisc = PriceDisc_LineDisc::construct();

        priceDisc_LineDisc.parmModuleType(ModuleInventPurchSales::Purch);

        priceDisc_LineDisc.parmItemId(inventTable.ItemId);

        priceDisc_LineDisc.parmInventDim(inventDimItem);

        priceDisc_LineDisc.parmUnitID(unitId);

        priceDisc_LineDisc.parmDiscDate(DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()));

        priceDisc_LineDisc.parmQty(1);

        priceDisc_LineDisc.parmAccountNum(vendTable.AccountNum);

        priceDisc_LineDisc.parmItemLineDiscCode(_purchline.itemLineDisc());

        priceDisc_LineDisc.parmCurrencyCode(Ledger::accountingCurrency(CompanyInfo::current()));

        return priceDisc_LineDisc.discPct();

    }

Thanks,
Vikas Mehta

No comments:

Post a Comment

AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...