---
id: object/codeunit/18547-in
type: object
title: Codeunit 18547 "Calculate Statistics" (IN)
summary: Codeunit 18547 "Calculate Statistics" (IN) in the IN country layer (Microsoft.Finance.TaxBase). 10 public procedures, 21 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - in layer
versions:
  introduced: "29"
  last_changed: null
  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: 5203760a810bd7bdd4caa7e6f18546931b7dd8c92535d69b792468cd13b3951b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/IN/INTaxBase/app/src/codeunit/CalculateStatistics.Codeunit.al
    title: src/Apps/IN/INTaxBase/app/src/codeunit/CalculateStatistics.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/in
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 18547
name: Calculate Statistics
namespace: Microsoft.Finance.TaxBase
app: INTaxBase
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
country: IN
counts:
  fields: 0
  procedures: 32
  events: 21
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 18547 "Calculate Statistics" (IN)

> Codeunit 18547 "Calculate Statistics" (IN) in the IN country layer (Microsoft.Finance.TaxBase). 10 public procedures, 21 events. Introduced in BC29, still in BC30.

IN country layer · Microsoft.Finance.TaxBase · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/IN/INTaxBase/app/src/codeunit/CalculateStatistics.Codeunit.al) · facts from BC29

An object of the [IN localization](../../localizations/in.md), not part of W1.

## Events published

- `OnGetPurchaseHeaderCessAmount(PurchaseHeader: Record "Purchase Header"; var CessAmount: Decimal)` (integration)
- `OnGetPurchaseHeaderGSTAmount(PurchaseHeader: Record "Purchase Header"; var GSTAmount: Decimal)` (integration)
- `OnGetPurchaseHeaderTDSAmount(PurchaseHeader: Record "Purchase Header"; var TDSAmount: Decimal)` (integration)
- `OnGetPartialPurchaseHeaderGSTAmount(PurchaseHeader: Record "Purchase Header"; var PartialGSTAmount: Decimal)` (integration)
- `OnGetPartialPurchaseHeaderTDSAmount(PurchaseHeader: Record "Purchase Header"; var PartialTDSAmount: Decimal)` (integration)
- `OnGetPartialPurchaseRcptGSTAmount(PurchaseHeader: Record "Purchase Header"; var PartialGSTAmount: Decimal)` (integration)
- `OnGetPartialPurchaseRcptTDSAmount(PurchaseHeader: Record "Purchase Header"; var PartialTDSAmount: Decimal)` (integration)
- `OnGetPurchInvHeaderGSTAmount(PurchInvHeader: Record "Purch. Inv. Header"; var GSTAmount: Decimal)` (integration)
- `OnGetPurchInvHeaderTDSAmount(PurchInvHeader: Record "Purch. Inv. Header"; var TDSAmount: Decimal)` (integration)
- `OnGetPurchCrMemoHeaderGSTAmount(PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var GSTAmount: Decimal)` (integration)
- `OnGetPurchCrMemoHeaderTDSAmount(PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var TDSAmount: Decimal)` (integration)
- `OnGetSalesHeaderGSTAmount(SalesHeader: Record "Sales Header"; var GSTAmount: Decimal)` (integration)
- `OnGetSalesHeaderTCSAmount(SalesHeader: Record "Sales Header"; var TCSAmount: Decimal)` (integration)
- `OnGetPartialSalesHeaderGSTAmount(SalesHeader: Record "Sales Header"; var PartialGSTAmount: Decimal)` (integration)
- `OnGetPartialSalesHeaderTCSAmount(SalesHeader: Record "Sales Header"; var PartialTCSAmount: Decimal)` (integration)
- `OnGetPartialSalesShptGSTAmount(SalesHeader: Record "Sales Header"; var PartialGSTAmount: Decimal)` (integration)
- `OnGetPartialSalesShptTCSAmount(SalesHeader: Record "Sales Header"; var PartialTCSAmount: Decimal)` (integration)
- `OnGetSalesInvHeaderGSTAmount(SalesInvHeader: Record "Sales Invoice Header"; var GSTAmount: Decimal)` (integration)
- `OnGetSalesInvHeaderTCSAmount(SalesInvHeader: Record "Sales Invoice Header"; var TCSAmount: Decimal)` (integration)
- `OnGetSalesCrMemoHeaderGSTAmount(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var GSTAmount: Decimal)` (integration)
- `OnGetSalesCrMemoHeaderTCSAmount(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var TCSAmount: Decimal)` (integration)

## Procedures

- `GetPurchaseStatisticsAmount(PurchaseHeader: Record "Purchase Header"; var TotalInclTaxAmount: Decimal)`
- `GetPartialPurchaseInvStatisticsAmount(PurchaseHeader: Record "Purchase Header"; var PartialInclInvTaxAmount: Decimal)`
- `GetPartialPurchaseRcptStatisticsAmount(PurchaseHeader: Record "Purchase Header"; var PartialInclRcptTaxAmount: Decimal)`
- `GetPostedPurchInvStatisticsAmount(PurchInvHeader: Record "Purch. Inv. Header"; var TotalInclTaxAmount: Decimal)`
- `GetPostedPurchCrMemoStatisticsAmount(PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var TotalInclTaxAmount: Decimal)`
- `GetSalesStatisticsAmount(SalesHeader: Record "Sales Header"; var TotalInclTaxAmount: Decimal)`
- `GetPartialSalesInvStatisticsAmount(SalesHeader: Record "Sales Header"; var PartialInclInvTaxAmount: Decimal)`
- `GetPartialSalesShptStatisticsAmount(SalesHeader: Record "Sales Header"; var PartialInclShptTaxAmount: Decimal)`
- `GetPostedSalesInvStatisticsAmount(SalesInvHeader: Record "Sales Invoice Header"; var TotalInclTaxAmount: Decimal)`
- `GetPostedSalesCrMemoStatisticsAmount(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var TotalInclTaxAmount: Decimal)`

Plus 1 local procedures.

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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). 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: "codeunit", object_name: "Calculate Statistics")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.

A IN country object, not part of W1: the default corpus does not have it; `bcatlas_list_countries` shows which countries the atlas has.
