Selectively Post Purchase Lines

souravbsouravb Member Posts: 135
Hi,
I have a purchase order with 2 lines. In the first line Quantity is 2 and Quantity To Receive is 2. In the second line Quantity is 3 and Quantity to receive is 0. Now i want when the Purchase order is posted as 'Receive and Invoice', only the line having 'Quantity to Receive' field non zero will go to the posted documents and not the other line. How to do that. Plz suggest.

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    You could post with Receive only.
    Then create an new invoice for the vendor and use the function "Get receipt lines" (button Functions).
    Then you will only have the lines you received in your invoice. Next post the invoice.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • rajpatelbcarajpatelbca Member Posts: 178
    according to your problem,tinoruijs is partially correct. but when u make receipt from order then all lines will be then in posted receipt.

    you have to make changes in codeunit where these posted prch. receipt line and posted prch. inv. line are created.
    Experience Makes Man Perfect....
    Rajesh Patel
  • tinoruijstinoruijs Member Posts: 1,226
    according to your problem,tinoruijs is partially correct. but when u make receipt from order then all lines will be then in posted receipt.

    you have to make changes in codeunit where these posted prch. receipt line and posted prch. inv. line are created.

    All lines will be in receipt, but that isn't a problem I think.
    When you use "get receipt lines", only the lines with quantity <> 0 are being transfered to the invoice.
    I think code-changes in codeunits isn't necessary.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • SavatageSavatage Member Posts: 7,142
    how about changing the Qty to Invoice to zero for the items you don't want invoiced.
  • tinoruijstinoruijs Member Posts: 1,226
    Savatage wrote:
    how about changing the Qty to Invoice to zero for the items you don't want invoiced.

    That won't work.
    In the second line Quantity is 3 and Quantity to receive is 0.
    If you put Qty. to receive to 0, qty. to invoice becomes 0 too.
    But still that line will be on the posted invoice with quantity empty.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • ayhan06ayhan06 Member Posts: 210
    eventhugh ı don't understand why you really need this modification, i will tell some hint:
          IF Invoice THEN BEGIN
            // Insert invoice line or credit memo line
            IF "Document Type" IN ["Document Type"::Order,"Document Type"::Invoice] THEN BEGIN
              PurchInvLine.INIT;
              PurchInvLine.TRANSFERFIELDS(TempPurchLine);
              PurchInvLine."Document No." := PurchInvHeader."No.";
              PurchInvLine.Quantity := TempPurchLine."Qty. to Invoice";
              PurchInvLine."Quantity (Base)" := TempPurchLine."Qty. to Invoice (Base)";
              PurchInvLine.INSERT;
              DimMgt.MoveOneDocDimToPostedDocDim(
                DocDim,DATABASE::"Purchase Line","Document Type","No.",PurchInvLine."Line No.",
                DATABASE::"Purch. Inv. Line",PurchInvHeader."No.");
              ItemJnlPostLine.CollectValueEntryRelation(TempValueEntryRelation,PurchInvLine.RowID1);
    

    in OnRun function of codeunit 90, replace above code as this
          IF Invoice THEN BEGIN
            // Insert invoice line or credit memo line
            IF "Document Type" IN ["Document Type"::Order,"Document Type"::Invoice] THEN BEGIN
              PurchInvLine.INIT;
              PurchInvLine.TRANSFERFIELDS(TempPurchLine);
              PurchInvLine."Document No." := PurchInvHeader."No.";
              PurchInvLine.Quantity := TempPurchLine."Qty. to Invoice";
              PurchInvLine."Quantity (Base)" := TempPurchLine."Qty. to Invoice (Base)";
    IF PurchInvLine.Quantity <> 0 THEN BEGIN
              PurchInvLine.INSERT;
              DimMgt.MoveOneDocDimToPostedDocDim(
                DocDim,DATABASE::"Purchase Line","Document Type","No.",PurchInvLine."Line No.",
                DATABASE::"Purch. Inv. Line",PurchInvHeader."No.");
              ItemJnlPostLine.CollectValueEntryRelation(TempValueEntryRelation,PurchInvLine.RowID1);
    END;
    
  • idiotidiot Member Posts: 651
    This is a very common request:
    1. number of transactions is reduced & database size won't grow so fast.
    2. environmentally friendly due to less paper usage.
    3. easier on the eyes due to less lines.
    4. data mining/selection/auditing becomes easier.
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
Sign In or Register to comment.