Page 6780 Direct Transfer Statistics

Base Application, Microsoft.Inventory.Transfer

src/Layers/W1/BaseApp/Inventory/Transfer/DirectTransferStatistics.Page.al119 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 6780 "Direct Transfer Statistics"{    Caption = 'Direct Transfer Statistics';    Editable = false;    LinksAllowed = false;    PageType = Card;    SourceTable = "Direct Trans. Header";    layout    {        area(content)        {            group(General)            {                Caption = 'General';                field(LineQty; LineQty)                {                    ApplicationArea = Basic, Suite;                    AutoFormatType = 0;                    Caption = 'Quantity';                    DecimalPlaces = 0 : 5;                    ToolTip = 'Specifies how many pieces of the item are processed.';                }                field(TotalParcels; TotalParcels)                {                    ApplicationArea = Basic, Suite;                    AutoFormatType = 0;                    Caption = 'Parcels';                    DecimalPlaces = 0 : 5;                    ToolTip = 'Specifies the total number of parcels in the document.';                }                field(TotalNetWeight; TotalNetWeight)                {                    ApplicationArea = Basic, Suite;                    AutoFormatType = 0;                    Caption = 'Net Weight';                    DecimalPlaces = 0 : 5;                    ToolTip = 'Specifies the net weight of the item. You may need the net weight to complete customs documents, waybills, and other forms.';                }                field(TotalGrossWeight; TotalGrossWeight)                {                    ApplicationArea = Basic, Suite;                    AutoFormatType = 0;                    Caption = 'Gross Weight';                    DecimalPlaces = 0 : 5;                    ToolTip = 'Specifies the gross weight, including the weight of any packaging, of the catalog item.';                }                field(TotalVolume; TotalVolume)                {                    ApplicationArea = Basic, Suite;                    AutoFormatType = 0;                    Caption = 'Volume';                    DecimalPlaces = 0 : 5;                    ToolTip = 'Specifies the total volume of the items in the document.';                }            }        }    }    actions    {    }    trigger OnAfterGetRecord()    begin        ClearAll();        CalculateTotals();    end;    var        LineQty: Decimal;        TotalNetWeight: Decimal;        TotalGrossWeight: Decimal;        TotalVolume: Decimal;        TotalParcels: Decimal;    local procedure CalculateTotals()    var        DirectTransLine: Record "Direct Trans. Line";        IsHandled: Boolean;    begin        IsHandled := false;        OnBeforeCalculateTotals(Rec, LineQty, TotalNetWeight, TotalGrossWeight, TotalVolume, TotalParcels, IsHandled);        if IsHandled then            exit;        DirectTransLine.SetRange("Document No.", Rec."No.");        if DirectTransLine.Find('-') then            repeat                LineQty += DirectTransLine.Quantity;                TotalNetWeight += DirectTransLine.Quantity * DirectTransLine."Net Weight";                TotalGrossWeight += DirectTransLine.Quantity * DirectTransLine."Gross Weight";                TotalVolume += DirectTransLine.Quantity * DirectTransLine."Unit Volume";                if DirectTransLine."Units per Parcel" > 0 then                    TotalParcels += Round(DirectTransLine.Quantity / DirectTransLine."Units per Parcel", 1, '>');                OnCalculateTotalsOnAfterAddLineTotals(                    DirectTransLine, LineQty, TotalNetWeight, TotalGrossWeight, TotalVolume, TotalParcels)            until DirectTransLine.Next() = 0;    end;    [IntegrationEvent(false, false)]    local procedure OnBeforeCalculateTotals(DirectTransHeader: Record "Direct Trans. 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(DirectTransLine: Record "Direct Trans. Line"; var LineQty: Decimal; var TotalNetWeight: Decimal; var TotalGrossWeight: Decimal; var TotalVolume: Decimal; var TotalParcels: Decimal)    begin    end;}