---
id: object/page/402
type: object
title: Page 402 "Sales Order Statistics"
summary: Page 402 "Sales Order Statistics" in Base Application (Microsoft.Sales.Document). 5 public procedures, 12 events. Present since at least BC23, still in BC30, changed in BC24-26.
tier: official
language: en
tags:
  - page
  - base application
versions:
  introduced: null
  last_changed: "26"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 2d68836c9856ddbd72efc4b02d1588f15d3a436df220f4c57e78448ccf185819
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Document/SalesOrderStatistics.Page.al
    title: src/Layers/W1/BaseApp/Sales/Document/SalesOrderStatistics.Page.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: page
object_id: 402
name: Sales Order Statistics
namespace: Microsoft.Sales.Document
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 25
  events: 12
  subscribers: 0
  controls: 67
  actions: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 2
  event_subscribers: 0
  calls: 5
  called_by: 1
  implements: 0
---

# Page 402 "Sales Order Statistics"

> Page 402 "Sales Order Statistics" in Base Application (Microsoft.Sales.Document). 5 public procedures, 12 events. Present since at least BC23, still in BC30, changed in BC24-26.

Base Application · Microsoft.Sales.Document · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Document/SalesOrderStatistics.Page.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Caption | Sales Order Statistics |
| SourceTable | Sales Header |
| PageType | Card |

## Fields on this page

Layout controls in source order, grouped by the container they sit in. Shows: the table field a control is bound to (or its expression as written); ToolTip: the control's own, else the bound field's (marked).

| Group | Control | Shows | ToolTip |
|---|---|---|---|
| General | LineAmountGeneral | `TotalSalesLine[1]."Line Amount"` | — |
|  | Inv. Discount Amount | `TotalSalesLine[1]."Inv. Discount Amount"` | Specifies the invoice discount amount for the sales document. |
|  | TotalAmount1[1] | `TotalAmount1[1]` | — |
|  | VAT Amount | `VATAmount[1]` | Specifies the total VAT amount that has been calculated for all the lines in the sales document. |
|  | TotalAmount2[1] | `TotalAmount2[1]` | — |
|  | Sales (LCY) | `TotalSalesLineLCY[1].Amount` | Specifies your total sales turnover in the fiscal year. It is calculated from amounts excluding VAT on all completed and open sales invoices and credit memos. |
|  | Original Profit (LCY) | `ProfitLCY[1]` | Specifies the original profit that was associated with the sales when they were originally posted. |
|  | Adjusted Profit (LCY) | `AdjProfitLCY[1]` | Specifies the profit, taking into consideration changes in the purchase prices of the goods. |
|  | Original Profit % | `ProfitPct[1]` | Specifies the original percentage of profit that was associated with the sales when they were originally posted. |
|  | Adjusted Profit % | `AdjProfitPct[1]` | Specifies the percentage of profit for all sales, taking into account changes that occurred in the purchase prices of the goods. |
|  | Quantity | `TotalSalesLine[1].Quantity` | Specifies the total quantity of G/L account entries, items, and/or resources in the sales document. If the amount is rounded, because the Invoice Rounding check box is selected in the Sales & Receivables Setup window, this field will contain the quantity of items in the sales document plus one. |
|  | Parcels | `TotalSalesLine[1]."Units per Parcel"` | Specifies the total number of parcels in the sales document. |
|  | Net Weight | `TotalSalesLine[1]."Net Weight"` | Specifies the total net weight of the items in the sales document. |
|  | Gross Weight | `TotalSalesLine[1]."Gross Weight"` | Specifies the total gross weight of the items in the sales document. |
|  | Volume | `TotalSalesLine[1]."Unit Volume"` | Specifies the total volume of the items in the sales document. |
|  | Original Cost (LCY) | `TotalSalesLineLCY[1]."Unit Cost (LCY)"` | Specifies the total cost, in LCY, of the G/L account entries, items, and/or resources in the sales document. The cost is calculated as unit cost x quantity of the items or resources. |
|  | Adjusted Cost (LCY) | `TotalAdjCostLCY[1]` | Specifies the total cost, in LCY, of the items in the sales document, adjusted for any changes in the original costs of these items. If this field contains zero, it means that there were no entries to calculate, possibly because of date compression or because the adjustment batch job has not yet bee... |
|  | Cost Adjmt. Amount (LCY) | `TotalAdjCostLCY[1] - TotalSalesLineLCY[1]."Unit Cost (LCY)"` | Specifies the difference between the original cost and the total adjusted cost of the items in the sales document. |
|  | No. of Tax Lines | `TempVATAmountLine1.Count` | Specifies the number of lines on the sales order that have VAT amounts. |
|  | Reserved from stock | `Rec.GetQtyReservedFromStockState()` | Specifies what part of the sales order is reserved from inventory. |
| Invoicing | AmountInclVAT_Invoicing | `TotalSalesLine[2]."Line Amount"` | — |
|  | Inv. Discount Amount | `TotalSalesLine[2]."Inv. Discount Amount"` | Specifies the invoice discount amount for the sales document. |
|  | TotalInclVAT_Invoicing | `TotalAmount1[2]` | — |
|  | VATAmount_Invoicing | `VATAmount[2]` | — |
|  | TotalExclVAT_Invoicing | `TotalAmount2[2]` | — |
|  | Sales (LCY) | `TotalSalesLineLCY[2].Amount` | Specifies your total sales turnover in the fiscal year. It is calculated from amounts excluding VAT on all completed and open sales invoices and credit memos. |
|  | Original Profit (LCY) | `ProfitLCY[2]` | Specifies the original profit that was associated with the sales when they were originally posted. |
|  | Adjusted Profit (LCY) | `AdjProfitLCY[2]` | Specifies the profit, taking into consideration changes in the purchase prices of the goods. |
|  | Original Profit % | `ProfitPct[2]` | Specifies the original percentage of profit that was associated with the sales when they were originally posted. |
|  | Adjusted Profit % | `AdjProfitPct[2]` | Specifies the percentage of profit for all sales, taking into account changes that occurred in the purchase prices of the goods. |
|  | Quantity | `TotalSalesLine[2].Quantity` | Specifies the total quantity of G/L account entries, items, and/or resources in the sales document. If the amount is rounded, because the Invoice Rounding check box is selected in the Sales & Receivables Setup window, this field will contain the quantity of items in the sales document plus one. |
|  | Parcels | `TotalSalesLine[2]."Units per Parcel"` | Specifies the total number of parcels in the sales document. |
|  | Net Weight | `TotalSalesLine[2]."Net Weight"` | Specifies the total net weight of the items in the sales document. |
|  | Gross Weight | `TotalSalesLine[2]."Gross Weight"` | Specifies the total gross weight of the items in the sales document. |
|  | Volume | `TotalSalesLine[2]."Unit Volume"` | Specifies the total volume of the items in the sales document. |
|  | Original Cost (LCY) | `TotalSalesLineLCY[2]."Unit Cost (LCY)"` | Specifies the total cost, in LCY, of the G/L account entries, items, and/or resources in the sales document. The cost is calculated as unit cost x quantity of the items or resources. |
|  | Adjusted Cost (LCY) | `TotalAdjCostLCY[2]` | Specifies the total cost, in LCY, of the items in the sales document, adjusted for any changes in the original costs of these items. If this field contains zero, it means that there were no entries to calculate, possibly because of date compression or because the adjustment batch job has not yet bee... |
|  | Cost Adjmt. Amount (LCY) | `TotalAdjCostLCY[2] - TotalSalesLineLCY[2]."Unit Cost (LCY)"` | Specifies the difference between the original cost and the total adjusted cost of the items in the sales document. |
|  | No. of Tax Lines | `TempVATAmountLine2.Count` | Specifies the number of lines on the sales order that have VAT amounts. |
|  | Amount Excl. Prepayment | `TotalSalesLine[2]."Line Amount" - PrepmtTotalAmount` | Specifies the difference between Amount Excl. VAT and Prepayment Amount Excl. VAT. |
| Shipping | TotalSalesLine[3].""Line Amount"" | `TotalSalesLine[3]."Line Amount"` | — |
|  | Inv. Discount Amount | `TotalSalesLine[3]."Inv. Discount Amount"` | Specifies the invoice discount amount for the sales document. |
|  | TotalAmount1[3] | `TotalAmount1[3]` | — |
|  | VATAmount[3] | `VATAmount[3]` | — |
|  | TotalAmount2[3] | `TotalAmount2[3]` | — |
|  | Sales (LCY) | `TotalSalesLineLCY[3].Amount` | Specifies your total sales turnover in the fiscal year. It is calculated from amounts excluding VAT on all completed and open sales invoices and credit memos. |
|  | Cost (LCY) | `TotalSalesLineLCY[3]."Unit Cost (LCY)"` | Specifies the total cost of the sales order. |
|  | Profit (LCY) | `ProfitLCY[3]` | Specifies the total profit of the sales order. |
|  | Profit % | `ProfitPct[3]` | Specifies the total profit of the sales order expressed as a percentage of the total amount. |
|  | Quantity | `TotalSalesLine[3].Quantity` | Specifies the total quantity of G/L account entries, items, and/or resources in the sales document. If the amount is rounded, because the Invoice Rounding check box is selected in the Sales & Receivables Setup window, this field will contain the quantity of items in the sales document plus one. |
|  | Parcels | `TotalSalesLine[3]."Units per Parcel"` | Specifies the total number of parcels in the sales document. |
|  | Net Weight | `TotalSalesLine[3]."Net Weight"` | Specifies the total net weight of the items in the sales document. |
|  | Gross Weight | `TotalSalesLine[3]."Gross Weight"` | Specifies the total gross weight of the items in the sales document. |
|  | Volume | `TotalSalesLine[3]."Unit Volume"` | Specifies the total volume of the items in the sales document. |
|  | No. of Tax Lines | `TempVATAmountLine3.Count` | Specifies the number of lines on the sales order that have VAT amounts. |
| Prepayment | PrepmtTotalAmount | `PrepmtTotalAmount` | — |
|  | Prepayment Amount Invoiced | `PrepmtVATAmount` | Specifies how much has been invoiced as prepayment. |
|  | PrepmtTotalAmount2 | `PrepmtTotalAmount2` | — |
|  | TotalSalesLine[1].""Prepmt. Amt. Inv."" | `TotalSalesLine[1]."Prepmt. Amt. Inv."` | — |
|  | Invoiced % of Prepayment Amt. | `PrepmtInvPct` | Specifies Invoiced Percentage of Prepayment Amt. |
|  | TotalSalesLine[1].""Prepmt Amt Deducted"" | `TotalSalesLine[1]."Prepmt Amt Deducted"` | — |
|  | Deducted % of Prepayment Amt. to Deduct | `PrepmtDeductedPct` | Specifies the deducted percentage of the prepayment amount to deduct. |
|  | TotalSalesLine[1].""Prepmt Amt to Deduct"" | `TotalSalesLine[1]."Prepmt Amt to Deduct"` | — |
|  | No. of Tax Lines | `TempVATAmountLine4.Count` | Specifies the number of lines on the sales order that have VAT amounts. |
| Customer | Balance (LCY) | `Cust."Balance (LCY)"` | Specifies the balance on the customer's account. |
|  | Credit Limit (LCY) | `Cust."Credit Limit (LCY)"` | Specifies the credit limit of the customer on the sales document. The value 0 represents unlimited credit. |
|  | Expended % of Credit Limit (LCY) | `CreditLimitLCYExpendedPct` | Specifies the expended percentage of the credit limit in (LCY). |

## Events published

- `OnOpenPageOnBeforeSetEditable(var AllowInvDisc: Boolean; var AllowVATDifference: Boolean; SalesHeader: Record "Sales Header")` (integration)
- `OnAfterCalculateTotalAmounts(var TempSalesLine: Record "Sales Line" temporary; var TempVATAmountLine1: Record "VAT Amount Line" temporary)` (integration)
- `OnAfterUpdateHeaderInfo(var TotalSalesLineLCY: array[3] of Record "Sales Line"; var IndexNo: Integer)` (integration)
- `OnBeforeValidatePrepmtTotalAmount2(SalesHeader: Record "Sales Header"; var PrepmtTotalAmount: Decimal; var PrepmtTotalAmount2: Decimal)` (integration)
- `OnAfterCheckAllowInvDisc(SalesHeader: Record "Sales Header")` (integration)
- `OnRefreshOnAfterGetRecordOnAfterGetSalesLines(SalesHeader: Record "Sales Header"; var TempSalesLine: Record "Sales Line" temporary)` (integration)
- `OnRefreshOnAfterGetRecordOnBeforeTempSalesLineDeleteAll(SalesHeader: Record "Sales Header"; var TempSalesLine: Record "Sales Line" temporary)` (integration)
- `OnUpdateHeaderInfoOnBeforeSetAmount(IndexNo: Integer)` (integration)
- `OnRefreshOnAfterGetRecordOnAfterSetTotalAmounts(var TotalAmount1: array[3] of Decimal; var TotalAmount2: array[3] of Decimal; var TotalSalesLine: array[3] of Record "sales line")` (integration)
- `OnUpdateHeaderInfoOnAfterSetTotalAmount(IndexNo: Integer; var TotalAmount1: array[3] of Decimal; var TotalSalesLine: array[3] of Record "Sales Line")` (integration)
- `OnUpdateHeaderInfoOnBeforeSetLineAmount(var TotalSalesLine: array[3] of Record "Sales Line"; var TotalAmount1: array[3] of Decimal; IndexNo: Integer; var IsHandled: Boolean)` (integration)
- `OnRefreshOnAfterGetRecordOnBeforeSetCreditLimitLCYExpendedPct(var Customer: Record Customer; var SalesHeader: Record "Sales Header")` (integration)

## Procedures

- `UpdateHeaderInfo(IndexNo: Integer; var VATAmountLine: Record "VAT Amount Line")`: Updates the header information for the statistics page based on VAT amount lines.
- `UpdateTotalAmount(IndexNo: Integer)` (protected)
- `UpdateInvDiscAmount(ModifiedIndexNo: Integer)` (protected)
- `GetCaptionClass(FieldCaption: Text[100]; ReverseCaption: Boolean): Text[80]` (protected)
- `VATLinesDrillDown(var VATLinesToDrillDown: Record "VAT Amount Line"; ThisTabAllowsVATEditing: Boolean)` (protected)

Plus 8 local procedures.

## Triggers

OnAfterGetCurrRecord, OnAfterGetRecord, OnOpenPage, OnClosePage, OnQueryClosePage

## Relations

- source table [Table 36 "Sales Header"](../table/36.md)

## Extended by

- [Page extension 20289 "Sales Order Statistics Ext"](../pageextension/20289.md)
- [Page extension 6239 "Sust. Sales Order Stats."](../pageextension/6239.md)

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 442 "Sales-Post Prepayments"](../codeunit/442.md) (5 calls: `RefreshOnAfterGetRecord → GetSalesLines`, `RefreshOnAfterGetRecord → SumPrepmt`, `UpdatePrepmtAmount → GetSalesLines`, …)
- [Codeunit 80 "Sales-Post"](../codeunit/80.md) (2 calls: `RefreshOnAfterGetRecord → GetSalesLines`, `RefreshOnAfterGetRecord → SumSalesLinesTemp`)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `UpdateInvDiscAmount → GetResponseOrDefault`)
- [Codeunit 414 "Release Sales Document"](../codeunit/414.md) (1 call: `OnQueryClosePage → CalcAndUpdateVATOnLines`)
- [Codeunit 56 "Sales - Calc Discount By Type"](../codeunit/56.md) (1 call: `OnClosePage → ResetRecalculateInvoiceDisc`)

## Called by

- [Codeunit 99000839 "Sales Get Demand To Reserve"](../codeunit/99000839.md) (1 call: `OnShowStatistics → (object)`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-26

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "page", object_name: "Sales Order Statistics")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
