The Direct Unit Cost gets calculated from Purchase Price table. Which in your case is empty.
From I understand you want the price of the Sales Order be the price on the PO? this this case you not making any profit?
Is this a drop shipment?
Anyways If you want to change the cost, you can do it in the following function.
In requisition Line table function GetDirectCost(CalledByFieldNo : Integer)
You can change it to grab it from related sales line
Ahmed Rashed Amini
Independent Consultant/Developer
You can change it to grab it from related sales line
I suppose I really need to get the best price available that's not zero i.e. if there's a price book for the vendor then I should get it from there if not I need to keep the direct cost that is on the requisition line. It's a sensitive place to be making changes and I'm still not exactly sure where in GetDirectCost I should make it.
IF "Replenishment System" = "Replenishment System"::Purchase THEN BEGIN
PurchPriceCalcMgt.FindReqLineDisc(Rec);
PurchPriceCalcMgt.FindReqLinePrice(Rec,CalledByFieldNo);
//Start 001
IF ("Direct Unit Cost" = 0) AND (CalledBYFieldNo = FieldNo("Vendor No.")) and ("Sales order No." <> '') then begin
if SalesLine.get(SalesLine."Document type"::Order,"Sales Order No.","Sales Order Line No.") then begin
"Direct Unit Cost" := SalesLine."Unit Cost (LCY)";
end;
end;
//End 001
END;
Ahmed Rashed Amini
Independent Consultant/Developer
Comments
From I understand you want the price of the Sales Order be the price on the PO? this this case you not making any profit?
Is this a drop shipment?
Anyways If you want to change the cost, you can do it in the following function.
In requisition Line table function GetDirectCost(CalledByFieldNo : Integer)
You can change it to grab it from related sales line
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Yes.
I suppose I really need to get the best price available that's not zero i.e. if there's a price book for the vendor then I should get it from there if not I need to keep the direct cost that is on the requisition line. It's a sensitive place to be making changes and I'm still not exactly sure where in GetDirectCost I should make it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n