---
id: object/codeunit/6790
type: object
title: Codeunit 6790 "WHT Employee Calculation"
summary: Codeunit 6790 "WHT Employee Calculation" in WithholdingTax (Microsoft.WithholdingTax.Employee). 15 public procedures, 9 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - withholdingtax
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: c2d91de37c063ce39d5de235e623eb89f9452b0dcb5a41096d568c685b117fc8
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/WithholdingTax/app/src/Employee/Transaction/WHTEmployeeCalculation.Codeunit.al
    title: src/Apps/W1/WithholdingTax/app/src/Employee/Transaction/WHTEmployeeCalculation.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9973
    - change/bcapps/9311
object_type: codeunit
object_id: 6790
name: WHT Employee Calculation
namespace: Microsoft.WithholdingTax.Employee
app: WithholdingTax
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 30
  events: 9
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 6
  calls: 1
  called_by: 2
  implements: 0
---

# Codeunit 6790 "WHT Employee Calculation"

> Codeunit 6790 "WHT Employee Calculation" in WithholdingTax (Microsoft.WithholdingTax.Employee). 15 public procedures, 9 events. Introduced in BC29, still in BC30.

WithholdingTax · Microsoft.WithholdingTax.Employee · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/WithholdingTax/app/src/Employee/Transaction/WHTEmployeeCalculation.Codeunit.al) · facts from BC29

## Events published

- `OnAfterIsEmployeeWHTApplicable(GenJnlLine: Record "Gen. Journal Line"; Employee: Record Employee; var IsApplicable: Boolean)` (integration)
  - subscribers: [Codeunit 7056 "WHT Expense Category Mgt."](../codeunit/7056.md) OnAfterIsEmployeeWHTApplicable
- `OnBeforeCalcEmployeeWHT(var GenJnlLine: Record "Gen. Journal Line"; var WHTAmount: Decimal; var WHTBaseAmount: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeCheckCalcEmployeeWHT(var GenJnlLine: Record "Gen. Journal Line"; Employee: Record Employee; var WHTAmount: Decimal; var WHTBaseAmount: Decimal)` (integration)
  - subscribers: [Codeunit 7056 "WHT Expense Category Mgt."](../codeunit/7056.md) OnBeforeCheckCalcEmployeeWHT
- `OnBeforeInsertThresholdAccumulator(var ThresholdAccumulator: Record "WHT Threshold Accumulator"; GenJnlLine: Record "Gen. Journal Line"; PostingSetup: Record "Withholding Tax Posting Setup"; BaseAmount: Decimal)` (integration)
  - subscribers: [Codeunit 7056 "WHT Expense Category Mgt."](../codeunit/7056.md) OnBeforeInsertThresholdAccumulator
- `OnBeforeUpdateThresholdAccumulator(var ThresholdAccumulator: Record "WHT Threshold Accumulator"; WithholdingTaxEntry: Record "Withholding Tax Entry"; PostingSetup: Record "Withholding Tax Posting Setup")` (integration)
  - subscribers: [Codeunit 7056 "WHT Expense Category Mgt."](../codeunit/7056.md) OnBeforeUpdateThresholdAccumulator
- `OnBeforeReverseThresholdAccumulator(var ThresholdAccumulator: Record "WHT Threshold Accumulator"; WithholdingTaxEntry: Record "Withholding Tax Entry"; PostingSetup: Record "Withholding Tax Posting Setup")` (integration)
  - subscribers: [Codeunit 7056 "WHT Expense Category Mgt."](../codeunit/7056.md) OnBeforeReverseThresholdAccumulator
- `OnBeforeResolveWHTGroupComponents(GenJnlLine: Record "Gen. Journal Line"; var WHTGroupCode: Code[20]; var Result: Boolean)` (integration)
  - subscribers: [Codeunit 7056 "WHT Expense Category Mgt."](../codeunit/7056.md) OnBeforeResolveWHTGroupComponents
- `OnBeforeInsertEmployeeWHTEntry(var WithholdingTaxEntry: Record "Withholding Tax Entry"; GenJnlLine: Record "Gen. Journal Line")` (integration)
- `OnAfterInsertEmployeeWHTEntry(var WithholdingTaxEntry: Record "Withholding Tax Entry"; GenJnlLine: Record "Gen. Journal Line")` (integration)

## Procedures

- `IsEmployeeWHTApplicable(GenJnlLine: Record "Gen. Journal Line"): Boolean`
- `CalcEmployeeWHT(var GenJnlLine: Record "Gen. Journal Line"; var WHTAmount: Decimal; var WHTBaseAmount: Decimal)`
- `InsertEmployeeWithholdingTaxEntry(GenJnlLine: Record "Gen. Journal Line"; WHTAmount: Decimal; WHTBaseAmount: Decimal; TransactionNo: Integer; var NextEntryNo: Integer): Integer`
- `InsertEmployeeWHTComponentEntry(GenJnlLine: Record "Gen. Journal Line"; WHTGroupLine: Record "Withholding Tax Group Line"; ComponentWHT: Decimal; WHTBaseAmount: Decimal; TransactionNo: Integer; var NextEntryNo: Integer): Integer`
- `IsNetCalculationBase(GenJnlLine: Record "Gen. Journal Line"): Boolean`
- `AccumulateBaseForPeriodThreshold(GenJnlLine: Record "Gen. Journal Line"; BaseAmount: Decimal)`
- `ResolveWHTGroupComponents(GenJnlLine: Record "Gen. Journal Line"; var WHTGroupCode: Code[20]): Boolean`
- `CalcComponentWHT(WHTGroupLine: Record "Withholding Tax Group Line"; BaseAmount: Decimal; GenJnlLine: Record "Gen. Journal Line"): Decimal`
- `EvaluateThreshold(PostingSetup: Record "Withholding Tax Posting Setup"; EmployeeNo: Code[20]; PostingDate: Date; BaseAmount: Decimal): Boolean`
- `UpdateThresholdAccumulator(WithholdingTaxEntry: Record "Withholding Tax Entry")`
- `ReverseThresholdAccumulator(WithholdingTaxEntry: Record "Withholding Tax Entry")`
- `GetPeriodBounds(ThresholdPeriod: Enum "WHT Threshold Period Type"; PostingDate: Date; var PeriodStartDate: Date; var PeriodEndDate: Date)`
- `GetEmployeeNoFromJnlLine(GenJnlLine: Record "Gen. Journal Line"): Code[20]`
- `IsWithholdingTaxEnabled(): Boolean`
- `IsThresholdIncludeded(ThresholdCalculated: Boolean)`

Plus 6 local procedures.

## 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.

- [Page 456 "No. Series"](../page/456.md) (2 calls: `InsertEmployeeWHTComponentEntry → (object)`, `InsertEmployeeWithholdingTaxEntry → (object)`)

## Called by

- [Codeunit 6791 "Wthldg Tax Empl. Subscribers"](../codeunit/6791.md) (13 calls: `OnAfterPostEmployee → AccumulateBaseForPeriodThreshold`, `OnAfterPostEmployee → IsEmployeeWHTApplicable`, `OnBeforeInitGLEntryForGLAcc → CalcEmployeeWHT`, …)
- [Codeunit 7057 "WHT Exp. Report Post Handler"](../codeunit/7057.md) (7 calls: `AccumulateLineWHT → CalcEmployeeWHT`, `AccumulateLineWHT → IsEmployeeWHTApplicable`, `PostBufferedWHT → ResolveWHTGroupComponents`, …)

## Recent changes

- 2026-08-17 [#9973 [WHT]-Withholding Tax is not deducted from Expense Report lines based on the Expense Category during posting](../../changes/bcapps/9973.md) (main, BC30, fix)
- 2026-07-29 [#9311 Withholding Tax for Employee](../../changes/bcapps/9311.md) (main, BC30, feature, added)

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