Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Nav Post Purchase order

Posted on by 305

hi friends,

i want to show my purchase order in open purchase list after  invoice also

1.)

0882.9.png

if  i give quantity value is greater than of qty to receive after posting also i can see my order in  purchase order with quantity invoiced amount    like below snap shot

After Posting  - Purchase order Page 

7343.10.png

if i give quantity equal value to qty to receive  i can not see my order in purchase order list and quantity invoice also i can see directly 

1057.11.png

its moved to posted purchase invoice like below snap shot

2.)

5672.12.png

 after posting also i want to see my order in purchase order list with quantity invoiced second scenario i am facing issue here, can any one help to solve this issue 

thanks on advance.

*This post is locked for comments

  • Prabakaran.R Profile Picture
    Prabakaran.R 305 on at
    RE: Nav Post Purchase order

    Hi  Mohana

    i am working in 2016 i dont know how to solve this issue please help me on this one

    Thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Nav Post Purchase order

    I found function in codeunit 90 in NAV2017 and NAV2018

  • Prabakaran.R Profile Picture
    Prabakaran.R 305 on at
    RE: Nav Post Purchase order

    Hi Mohana

    thank you for reply i can not find this function(PostUpdateOrderLine), please tell me where i need to check

    Thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Nav Post Purchase order

    Please check PostUpdateOrderLine function where Quantity Invoiced field is updating.

  • Prabakaran.R Profile Picture
    Prabakaran.R 305 on at
    RE: Nav Post Purchase order

    hi mohana

    thank you for reply

    i did that i can see my order in purchase order list  but quantity incoiced in not coming after i posted also

    0552.80.png

    this my code

    "Document Type"::"Credit Memo":
    BEGIN
    PurchLine.SETFILTER("Return Shipment No.",'<>%1','');
    IF PurchLine.FINDSET THEN
    REPEAT
    IF PurchLine.Type <> PurchLine.Type::" " THEN BEGIN
    ReturnShptLine.GET(PurchLine."Return Shipment No.",PurchLine."Return Shipment Line No.");
    TempPurchLine.GET(
    TempPurchLine."Document Type"::"Return Order",
    ReturnShptLine."Return Order No.",ReturnShptLine."Return Order Line No.");
    IF PurchLine.Type = PurchLine.Type::"Charge (Item)" THEN
    UpdatePurchOrderChargeAssgnt(PurchLine,TempPurchLine);
    TempPurchLine."Quantity Invoiced" :=
    TempPurchLine."Quantity Invoiced" + PurchLine."Qty. to Invoice";
    TempPurchLine."Qty. Invoiced (Base)" :=
    TempPurchLine."Qty. Invoiced (Base)" + PurchLine."Qty. to Invoice (Base)";
    IF ABS(TempPurchLine."Quantity Invoiced") > ABS(TempPurchLine."Return Qty. Shipped") THEN
    ERROR(
    Text041,
    TempPurchLine."Document No.");
    TempPurchLine.InitQtyToInvoice;
    TempPurchLine.InitOutstanding;
    TempPurchLine.MODIFY;
    END;
    UNTIL PurchLine.NEXT = 0;
    InsertTrackingSpecification;

    PurchLine.SETRANGE("Return Shipment No.");
    END;
    ELSE
    IF PurchLine.FINDSET THEN
    REPEAT
    IF PurchLine."Prepayment %" <> 0 THEN
    DecrementPrepmtAmtInvLCY(
    PurchLine,PurchLine."Prepmt. Amount Inv. (LCY)",PurchLine."Prepmt. VAT Amount Inv. (LCY)");
    UNTIL PurchLine.NEXT = 0;
    END;

    PurchLine.SETFILTER("Blanket Order Line No.",'<>0');
    IF PurchLine.FINDSET THEN
    REPEAT
    UpdateBlanketOrderLine(PurchLine,Receive,Ship,Invoice);
    UNTIL PurchLine.NEXT = 0;
    PurchLine.SETRANGE("Blanket Order Line No.");

    IF WhseReceive THEN BEGIN
    WhsePostRcpt.PostUpdateWhseDocuments(WhseRcptHeader);
    //TempWhseRcptHeader.DELETE;
    END;
    IF WhseShip THEN BEGIN
    WhsePostShpt.PostUpdateWhseDocuments(WhseShptHeader);
    // TempWhseShptHeader.DELETE;
    END;
    IF ("Document Type" IN ["Document Type"::Order,"Document Type"::"Return Order"]) AND Subcontracting THEN BEGIN
    MODIFY;
    InsertTrackingSpecification;
    SubConOrderLine.SETRANGE("Document Type","Document Type");
    SubConOrderLine.SETRANGE("Document No.","No.");
    SubConOrderLine.FIND('-');
    REPEAT
    IF SubConOrderLine.Quantity <> 0 THEN BEGIN
    IF Receive THEN BEGIN
    SubConOrderLine."Quantity Received" := SubConOrderLine."Quantity Received" + SubConOrderLine."Qty. to Receive";
    SubConOrderLine."Qty. Received (Base)" := SubConOrderLine."Qty. Received (Base)" +
    SubConOrderLine."Qty. to Receive (Base)";
    END;
    IF Ship THEN BEGIN
    SubConOrderLine."Return Qty. Shipped" := SubConOrderLine."Return Qty. Shipped" +
    SubConOrderLine."Return Qty. to Ship";
    SubConOrderLine."Return Qty. Shipped (Base)" :=
    SubConOrderLine."Return Qty. Shipped (Base)" + SubConOrderLine."Return Qty. to Ship (Base)";
    END;
    IF Invoice THEN BEGIN
    IF "Document Type" = "Document Type"::Order THEN BEGIN
    IF ABS(SubConOrderLine."Quantity Invoiced" + SubConOrderLine."Qty. to Invoice") >
    ABS(SubConOrderLine."Quantity Received")
    THEN BEGIN
    SubConOrderLine.VALIDATE("Qty. to Invoice",
    SubConOrderLine."Quantity Received" - SubConOrderLine."Quantity Invoiced");
    SubConOrderLine."Qty. to Invoice (Base)" :=
    SubConOrderLine."Qty. Received (Base)" - SubConOrderLine."Qty. Invoiced (Base)";
    END;
    END ELSE
    IF ABS(SubConOrderLine."Quantity Invoiced" + SubConOrderLine."Qty. to Invoice") >
    ABS(SubConOrderLine."Return Qty. Shipped")
    THEN BEGIN
    SubConOrderLine.VALIDATE("Qty. to Invoice",
    SubConOrderLine."Return Qty. Shipped" - SubConOrderLine."Quantity Invoiced");
    SubConOrderLine."Qty. to Invoice (Base)" :=
    SubConOrderLine."Return Qty. Shipped (Base)" - SubConOrderLine."Qty. Invoiced (Base)";
    END;
    SubConOrderLine."Quantity Invoiced" := SubConOrderLine."Quantity Invoiced" + SubConOrderLine."Qty. to Invoice";
    SubConOrderLine."Qty. Invoiced (Base)" := SubConOrderLine."Qty. Invoiced (Base)" +
    SubConOrderLine."Qty. to Invoice (Base)";
    END;
    SubConOrderLine.InitOutstanding;
    IF WhseHandlingRequired THEN BEGIN
    IF "Document Type" = "Document Type"::"Return Order" THEN BEGIN
    SubConOrderLine."Return Qty. to Ship" := 0;
    SubConOrderLine."Return Qty. to Ship (Base)" := 0;
    END ELSE BEGIN
    SubConOrderLine."Qty. to Receive" := 0;
    SubConOrderLine."Qty. to Receive (Base)" := 0;
    END;
    SubConOrderLine.InitQtyToInvoice;
    END ELSE BEGIN
    IF "Document Type" = "Document Type"::"Return Order" THEN
    SubConOrderLine.InitQtyToShip
    ELSE
    SubConOrderLine.InitQtyToReceive;
    END;
    SubConOrderLine.MODIFY;
    END;
    UNTIL SubConOrderLine.NEXT = 0;
    END;
    IF NOT Subcontracting THEN BEGIN
    ApprovalsMgmt.DeleteApprovalEntries(RECORDID);

    ArchiveManagement.AutoArchivePurchDocument(PurchHeader);

    IF HASLINKS THEN
    //DELETELINKS;
    // DELETE;

    ReservePurchLine.DeleteInvoiceSpecFromHeader(PurchHeader);
    IF PurchLine.FINDFIRST THEN
    REPEAT
    IF PurchLine."Deferral Code" <> '' THEN
    DeferralUtilities.RemoveOrSetDeferralSchedule(
    '',DeferralUtilities.GetPurchDeferralDocType,'','',
    PurchLine."Document Type",
    PurchLine."Document No.",
    PurchLine."Line No.",0,0D,
    PurchLine.Description,
    '',
    TRUE);
    IF PurchLine.HASLINKS THEN
    PurchLine.DELETELINKS;
    UNTIL PurchLine.NEXT = 0;
    //PurchLine.DELETEALL;
    DeleteItemChargeAssgnt;

    PurchCommentLine.SETRANGE("Document Type","Document Type");
    PurchCommentLine.SETRANGE("No.","No.");
    IF NOT PurchCommentLine.ISEMPTY THEN
    // PurchCommentLine.DELETEALL;

    StrOrderDetails.SETCURRENTKEY("Document Type","Document No.",Type);
    StrOrderDetails.SETRANGE("Document Type","Document Type");
    StrOrderDetails.SETRANGE("Document No.","No.");
    StrOrderDetails.SETRANGE(Type,StrOrderDetails.Type::Purchase);
    StrOrderDetails.SETRANGE("Structure Code",Structure);
    IF StrOrderDetails.FIND('-') THEN
    //StrOrderDetails.DELETEALL;

    StrOrdLineDetails.SETCURRENTKEY("Document Type","Document No.",Type);
    StrOrdLineDetails.SETRANGE("Document Type","Document Type");
    StrOrdLineDetails.SETRANGE("Document No.","No.");
    StrOrdLineDetails.SETRANGE(Type,StrOrdLineDetails.Type::Purchase);
    StrOrdLineDetails.SETRANGE("Structure Code",Structure);
    IF StrOrdLineDetails.FIND('-') THEN
    // StrOrdLineDetails.DELETEALL;

    DefermentBuffer.RESET;
    DefermentBuffer.SETRANGE("Document Type","Document Type");
    DefermentBuffer.SETRANGE("Document No.","No.");
    // DefermentBuffer.DELETEALL;

    DetailTaxEntryBuffer.RESET;
    DetailTaxEntryBuffer.SETRANGE("Document Type","Document Type");
    DetailTaxEntryBuffer.SETRANGE("Document No.","No.");
    DetailTaxEntryBuffer.SETRANGE("Transaction Type",DetailTaxEntryBuffer."Transaction Type"::Purchase);
    // DetailTaxEntryBuffer.DELETEALL;
    GSTManagement.DeleteGSTBuffer(
    DetailedGSTEntryBuffer."Transaction Type"::Purchase,"Document Type","No.",0);
    DeleteWhseRqst(PurchHeader);
    END;
    END;
    InsertValueEntryRelation;
    DeleteReservationEntryRelateJobNo(PurchLine."Document Type","No.",PurchLine."Line No.",PurchLine."Job No.");
    IF NOT InvtPickPutaway THEN
    COMMIT;
    ClearPostBuffers;
    IF GUIALLOWED THEN
    Window.CLOSE;
    END;
    Rec := PurchHeader;
    IF NOT InvtPickPutaway THEN BEGIN
    COMMIT;
    UpdateAnalysisView.UpdateAll(0,TRUE);
    UpdateItemAnalysisView.UpdateAll(0,TRUE);
    END;
    OnAfterPostPurchaseDoc(Rec,GenJnlPostLine,PurchRcptHeader."No.",ReturnShptHeader."No.",PurchInvHeader."No.",
    PurchCrMemoHeader."No.");

    please give any solution 

    Thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Nav Post Purchase order

    you can search for DELETE and DELETEALL in codeunit 90 and comment them but why do you want to do it.

    make sure that it will create performance issues if we have lot of entries in Purchase Header and Purchase Line.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans