Incomplete Finished Production Order

BokkBokk Member Posts: 138
One of our users was working with a Production Order with Released status and was able to change the status to Finished when the Consumption was complete, but the Output was not completely invoiced. Now it is Finished, she can't make any changes to it.

I am wondering if it is possible to change the status and have her complete it, or is there processing, posting, etc type entries made that will be affected or create problems. Or, is there a way to affect this from the user perspective. (I was a little surprized she was able to change it to Finished before is was complete.)

Thanks!
SGM

Comments

  • tragtrag Member Posts: 23
    Hi Bokk,

    one of our customers had the same problem. Here is the code (Codeunit 5407), to solve the problem:
    OnRun(VAR Rec : Record "Production Order")
    ChangeStatusForm.Set(Rec);
    IF ChangeStatusForm.RUNMODAL() = ACTION::Yes THEN BEGIN
      ChangeStatusForm.ReturnPostingInfo(NewStatus,NewPostingDate,NewUpdateUnitCost);
      //START
      IF NewStatus = NewStatus::Finished THEN BEGIN
        "Purchase Line".RESET;
        "Purchase Line".SETCURRENTKEY("Prod. Order No.");
        "Purchase Line".SETRANGE("Prod. Order No.","No.");
        "Purchase Line".SETRANGE("Document Type","Purchase Line"."Document Type"::Quote);
        IF "Purchase Line".FIND('-') THEN REPEAT
          IF "Purchase Line".Quantity <> "Purchase Line"."Quantity Received" THEN
            ERROR(Text001,"Purchase Line"."Document No.");
          IF "Purchase Line".Quantity <> "Purchase Line"."Quantity Invoiced" THEN
            ERROR(Text002,"Purchase Line"."Document No.");
        UNTIL "Purchase Line".NEXT = 0;
      END;
      //END
      ChangeStatusOnProdOrder(Rec,NewStatus,NewPostingDate,NewUpdateUnitCost);
      COMMIT;
      MESSAGE(Text000,Status,TABLECAPTION,"No.",ToProdOrder.Status,ToProdOrder.TABLECAPTION,ToProdOrder."No.")
    END;
    

    "Purchase Line" is a record of Type "Purchase Line"
    Text001 is an error message to indicate, that nothing was delivered
    Text002 shows a not fully invoiced order

    If I remember correctly, you need to create a Key for "Prod. Order No." in the table "Purchase Line". Maybe there are some issues in this code, since this isn't the most recent version, but I think, this will help you!

    Regards,
    trag
  • RongritRongrit Member Posts: 14
    Hi Bokk,
    I think your customer created a Subcontract Purchase Order from that Released Production Order and received item partially from subcontractor. I mean there are some outstanding quantity in this Purchase Order. So there is one way to solve without programming(I'm not programmer :) ) is you have to change Quantity in Purchase Line equal to Quantity Received.
    And then you can change the status to Finished.

    I hope this solution can help u

    Regards,
  • BokkBokk Member Posts: 138
    trag:

    Thanks for the code. It appears that this does validation to ensure Qty Received and Invoiced is the same as Qty before changing the status to Finished. This will be perfect for the future. However, I still have an incomplete Finished Production Order that needs to be completed. With Finished status, I cannot. Do you know if I should delete the related entries, change the status to released and redo the process or is this dangerous?

    I am still looking into the suggestion made by Rongrit, but don't know if it applies to my situation. There may be more conflicts than just the status being such that the PO cannot be changed.

    Thanks!
    SGM
Sign In or Register to comment.