Page 5755 Transfer Statistics

App
Base Application
Namespace
Microsoft.Inventory.Transfer
Versions
17-28
Source table
5740

Events, 3

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/Inventory/Transfer/TransferStatistics.Page.al128 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.Inventory.Transfer;

page 5755 "Transfer Statistics"
{
    Caption = 'Transfer Statistics';
    Editable = false;
    LinksAllowed = false;
    PageType = Card;
    SourceTable = "Transfer Header";

    layout
    {
        area(content)
        {
            group(General)
            {
                Caption = 'General';
                field(LineQty; LineQty)
                {
                    AutoFormatType = 0;
                    ApplicationArea = Location;
                    Caption = 'Quantity';
                    DecimalPlaces = 0 : 5;
                    ToolTip = 'Specifies the quantity of items for this transfer order.';
                }
                field(TotalParcels; TotalParcels)
                {
                    AutoFormatType = 0;
                    ApplicationArea = Location;
                    Caption = 'Parcels';
                    DecimalPlaces = 0 : 5;
                    ToolTip = 'Specifies the quantity of items in parcels for this transfer order.';
                }
                field(TotalNetWeight; TotalNetWeight)
                {
                    AutoFormatType = 0;
                    ApplicationArea = Location;
                    Caption = 'Net Weight';
                    DecimalPlaces = 0 : 5;
                    ToolTip = 'Specifies the net weight of items for this transfer order.';
                }
                field(TotalGrossWeight; TotalGrossWeight)
                {
                    AutoFormatType = 0;
                    ApplicationArea = Location;
                    Caption = 'Gross Weight';
                    DecimalPlaces = 0 : 5;
                    ToolTip = 'Specifies the gross weight of items for this transfer order.';
                }
                field(TotalVolume; TotalVolume)
                {
                    AutoFormatType = 0;
                    ApplicationArea = Location;
                    Caption = 'Volume';
                    DecimalPlaces = 0 : 5;
                    ToolTip = 'Specifies the volume of items for this transfer order.';
                }
                field("Reserved from Stock"; Rec.GetQtyReservedFromStockState())
                {
                    ApplicationArea = Reservation;
                    Editable = false;
                    Caption = 'Reserved from stock';
                    ToolTip = 'Specifies what part of the quantity is reserved from stock.';
                }
            }
        }
    }

    actions
    {
    }

    trigger OnAfterGetRecord()
    begin
        ClearAll();

        CalculateTotals();
    end;

    var
        LineQty: Decimal;
        TotalNetWeight: Decimal;
        TotalGrossWeight: Decimal;
        TotalVolume: Decimal;
        TotalParcels: Decimal;

    local procedure CalculateTotals()
    var
        TransLine: Record "Transfer Line";
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeCalculateTotals(Rec, LineQty, TotalNetWeight, TotalGrossWeight, TotalVolume, TotalParcels, IsHandled);
        if IsHandled then
            exit;

        TransLine.SetRange("Document No.", Rec."No.");
        TransLine.SetRange("Derived From Line No.", 0);
        if TransLine.Find('-') then
            repeat
                LineQty += TransLine.Quantity;
                TotalNetWeight += TransLine.Quantity * TransLine."Net Weight";
                TotalGrossWeight += TransLine.Quantity * TransLine."Gross Weight";
                TotalVolume += TransLine.Quantity * TransLine."Unit Volume";
                if TransLine."Units per Parcel" > 0 then
                    TotalParcels += Round(TransLine.Quantity / TransLine."Units per Parcel", 1, '>');

                OnCalculateTotalsOnAfterAddLineTotals(
                    TransLine, LineQty, TotalNetWeight, TotalGrossWeight, TotalVolume, TotalParcels, Rec)
            until TransLine.Next() = 0;
    end;

    [IntegrationEvent(false, false)]
    local procedure OnBeforeCalculateTotals(TransferHeader: Record "Transfer Header"; var LineQty: Decimal; var TotalNetWeight: Decimal; var TotalGrossWeight: Decimal; var TotalVolume: Decimal; var TotalParcels: Decimal; var IsHandled: Boolean)
    begin
    end;

    [IntegrationEvent(false, false)]
    local procedure OnCalculateTotalsOnAfterAddLineTotals(var TransferLine: Record "Transfer Line"; var LineQty: Decimal; var TotalNetWeight: Decimal; var TotalGrossWeight: Decimal; var TotalVolume: Decimal; var TotalParcels: Decimal; TransferHeader: Record "Transfer Header")
    begin
    end;
}