Options

Vendor Validate

erugalathaerugalatha Member Posts: 120
Hello,

On a requisition line for a Purchase Order when you set the Vendor No. it resets the Direct Unit Cost to 0.00.

How would I change this to keep the price that comes in from the Sales Order?

Comments

  • ara3nara3n Member Posts: 9,258
    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


    blog: https://dynamicsuser.net/nav/b/ara3n
  • erugalathaerugalatha Member Posts: 120
    ara3n wrote:
    Is this a drop shipment?

    Yes.
    ara3n wrote:
    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. :(
  • ara3nara3n Member Posts: 9,258
    Here is the code
    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


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.