Page 399 Purchase Receipt Statistics
src/Layers/W1/BaseApp/Purchases/History/PurchaseReceiptStatistics.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.Purchases.History;page 399 "Purchase Receipt Statistics"{ Caption = 'Purchase Receipt Statistics'; Editable = false; LinksAllowed = false; PageType = Card; SourceTable = "Purch. Rcpt. Header"; layout { area(content) { group(General) { Caption = 'General'; field(LineQty; LineQty) { ApplicationArea = Basic, Suite; AutoFormatType = 0; Caption = 'Quantity'; DecimalPlaces = 0 : 5; ToolTip = 'Specifies the total quantity of items received from the purchase document.'; } field(TotalParcels; TotalParcels) { ApplicationArea = Basic, Suite; AutoFormatType = 0; Caption = 'Parcels'; DecimalPlaces = 0 : 5; ToolTip = 'Specifies the total number of parcels received from the purchase document.'; } field(TotalNetWeight; TotalNetWeight) { ApplicationArea = Basic, Suite; AutoFormatType = 0; Caption = 'Net Weight'; DecimalPlaces = 0 : 5; ToolTip = 'Specifies the total net weight of the items received from the purchase document.'; } field(TotalGrossWeight; TotalGrossWeight) { ApplicationArea = Basic, Suite; AutoFormatType = 0; Caption = 'Gross Weight'; DecimalPlaces = 0 : 5; ToolTip = 'Specifies the total gross weight of the items received from the purchase document.'; } field(TotalVolume; TotalVolume) { ApplicationArea = Basic, Suite; AutoFormatType = 0; Caption = 'Volume'; DecimalPlaces = 0 : 5; ToolTip = 'Specifies the total volume of the items received from the purchase document.'; } } } } actions { } trigger OnAfterGetRecord() begin ClearAll(); CalculateTotals(); end; var LineQty: Decimal; TotalNetWeight: Decimal; TotalGrossWeight: Decimal; TotalVolume: Decimal; TotalParcels: Decimal; local procedure CalculateTotals() var PurchRcptLine: Record "Purch. Rcpt. Line"; IsHandled: Boolean; begin IsHandled := false; OnBeforeCalculateTotals(Rec, LineQty, TotalNetWeight, TotalGrossWeight, TotalVolume, TotalParcels, IsHandled); if IsHandled then exit; PurchRcptLine.SetRange("Document No.", Rec."No."); if PurchRcptLine.Find('-') then repeat LineQty := LineQty + PurchRcptLine.Quantity; TotalNetWeight := TotalNetWeight + (PurchRcptLine.Quantity * PurchRcptLine."Net Weight"); TotalGrossWeight := TotalGrossWeight + (PurchRcptLine.Quantity * PurchRcptLine."Gross Weight"); TotalVolume := TotalVolume + (PurchRcptLine.Quantity * PurchRcptLine."Unit Volume"); if PurchRcptLine."Units per Parcel" > 0 then TotalParcels := TotalParcels + Round(PurchRcptLine.Quantity / PurchRcptLine."Units per Parcel", 1, '>'); OnCalculateTotalsOnAfterAddLineTotals( PurchRcptLine, LineQty, TotalNetWeight, TotalGrossWeight, TotalVolume, TotalParcels, Rec) until PurchRcptLine.Next() = 0; end; [IntegrationEvent(false, false)] local procedure OnBeforeCalculateTotals(PurchRcptHeader: Record "Purch. Rcpt. 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 PurchRcptLine: Record "Purch. Rcpt. Line"; var LineQty: Decimal; var TotalNetWeight: Decimal; var TotalGrossWeight: Decimal; var TotalVolume: Decimal; var TotalParcels: Decimal; PurchRcptHeader: Record "Purch. Rcpt. Header") begin end;}