Report extension 99000836 Mfg. Get Outbound Source Docs

App
Base Application
Namespace
Microsoft.Warehouse.Request
Versions
27-28

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/Manufacturing/Warehouse/Request/MfgGetOutboundSourceDocs.ReportExt.al63 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Warehouse.Request;

using Microsoft.Manufacturing.Document;


reportextension 99000836 "Mfg. Get Outbound Source Docs" extends "Get Outbound Source Documents"
{
    dataset
    {
        addafter("Whse. Internal Pick Header")
        {
            dataitem("Production Order"; "Production Order")
            {
                DataItemLink = Status = field("Document Subtype"), "No." = field("Document No.");
                DataItemTableView = sorting(Status, "No.") where(Status = const(Released));
                dataitem("Prod. Order Component"; "Prod. Order Component")
                {
                    DataItemLink = Status = field(Status), "Prod. Order No." = field("No.");
                    DataItemTableView = sorting(Status, "Prod. Order No.", "Prod. Order Line No.", "Line No.") where("Planning Level Code" = const(0));

                    trigger OnAfterGetRecord()
                    var
                        ProdOrderWarehouseMgt: Codeunit "Prod. Order Warehouse Mgt.";
                        ToBinCode: Code[20];
                    begin
                        if ("Flushing Method" = "Flushing Method"::"Pick + Forward") and ("Routing Link Code" = '') then
                            CurrReport.Skip();

                        this.GetLocation("Location Code");
                        ToBinCode := "Bin Code";

                        CalcFields("Pick Qty.");
                        if "Expected Quantity" > "Qty. Picked" + "Pick Qty." then
                            if ProdOrderWarehouseMgt.FromProdOrderCompLine(
                                 PickWkshTemplate, PickWkshName, Location.Code, ToBinCode, "Prod. Order Component")
                            then
                                LineCreated := true;
                    end;

                    trigger OnPreDataItem()
                    begin
                        SetFilter("Flushing Method", '%1|%2|%3',
                            "Flushing Method"::"Pick + Manual",
                            "Flushing Method"::"Pick + Forward",
                            "Flushing Method"::"Pick + Backward");
                        SetRange("Location Code", "Whse. Pick Request"."Location Code");
                    end;
                }

                trigger OnPreDataItem()
                begin
                    if "Whse. Pick Request"."Document Type" <> "Whse. Pick Request"."Document Type"::Production then
                        CurrReport.Break();
                end;
            }
        }
    }
}