[Event Request] Table 83 OnAfterGetUnitAmount
We need a new event in Table 83 "OnAfterGetUnitAmount"
LOCAL [IntegrationEvent] OnAfterGetUnitAmount(VAR ItemJnlLine : Record "Item Journal Line")
Called from:
LOCAL GetUnitAmount(CalledByFieldNo : Integer) RetrieveCosts; IF ("Value Entry Type" <> "Value Entry Type"::"Direct Cost") OR ("Item Charge No." <> '') THEN EXIT;
UnitCostValue := UnitCost; IF (CalledByFieldNo = FIELDNO(Quantity)) AND (Item."No." <> '') AND (Item."Costing Method" <> Item."Costing Method"::Standard) THEN UnitCostValue := "Unit Cost" / UOMMgt.GetQtyPerUnitOfMeasure(Item,"Unit of Measure Code");
CASE "Entry Type" OF "Entry Type"::Purchase: PurchPriceCalcMgt.FindItemJnlLinePrice(Rec,CalledByFieldNo); "Entry Type"::Sale: SalesPriceCalcMgt.FindItemJnlLinePrice(Rec,CalledByFieldNo); "Entry Type"::"Positive Adjmt.": "Unit Amount" := ROUND( ((UnitCostValue - "Overhead Rate") * "Qty. per Unit of Measure") / (1 + "Indirect Cost %" / 100), GLSetup."Unit-Amount Rounding Precision"); "Entry Type"::"Negative Adjmt.": "Unit Amount" := UnitCostValue * "Qty. per Unit of Measure"; "Entry Type"::Transfer: "Unit Amount" := 0; END;
//init Call -------------------------------------------------- OnAfterGetUnitAmount(Rec); //End Call ----------------------------------------------------