---
id: object/codeunit/20341
type: object
title: Codeunit 20341 "Tax Document GL Posting"
summary: Codeunit 20341 "Tax Document GL Posting" in INTaxEngine (Microsoft.Finance.TaxEngine.PostingHandler). 3 public procedures, 10 events, 4 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - intaxengine
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: 88859e416214eb6db5811230d9965bcd47ad7ae28612504640143cf235ae4fda
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxDocumentGLPosting.Codeunit.al
    title: src/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxDocumentGLPosting.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 20341
name: Tax Document GL Posting
namespace: Microsoft.Finance.TaxEngine.PostingHandler
app: INTaxEngine
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: 28
  events: 10
  subscribers: 4
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 2
  calls: 4
  called_by: 8
  implements: 0
---

# Codeunit 20341 "Tax Document GL Posting"

> Codeunit 20341 "Tax Document GL Posting" in INTaxEngine (Microsoft.Finance.TaxEngine.PostingHandler). 3 public procedures, 10 events, 4 event subscribers. Introduced in BC29, still in BC30.

INTaxEngine · Microsoft.Finance.TaxEngine.PostingHandler · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxDocumentGLPosting.Codeunit.al) · facts from BC29

## Events published

- `OnAfterPrepareTaxTransaction(var TaxPostingBuffer: Record "Transaction Posting Buffer"; var TempSymbols: Record "Script Symbol Value" temporary; var TempTransactionValue: Record "Tax Transaction Value" temporary)` (integration)
  - subscribers: [Codeunit 20347 "Tax Subledger Posting Handler"](../codeunit/20347.md) OnAfterPrepareTaxTransaction
- `OnAfterPostTaxGLEntry(var TempTaxPostingBuffer: Record "Transaction Posting Buffer" temporary; var TempTransactionValue: Record "Tax Transaction Value" temporary; var Record: Variant)` (integration)
  - subscribers: [Codeunit 20342 "Tax Document Subledger Posting"](../codeunit/20342.md) OnAfterPostTaxGLEntry
- `OnAfterGenJnlLineAdjustEntry(var GenJnlLine: Record "Gen. Journal Line"; var AdjustEntry: Boolean)` (integration)
- `OnBeforeGenJnlLineAdjustEntry(var GenJnlLine: Record "Gen. Journal Line"; var AdjustEntry: Boolean; var IsHandled: Boolean)` (integration)
- `OnPrepareTransValueToPost(var TempTransValue: Record "Tax Transaction Value" temporary; var IsModified: Boolean)` (integration)
- `OnBeforePostTaxJournal(var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)` (integration)
- `OnFindTransationPostingBuffer(var TransactionPostingBuffer: Record "Transaction Posting Buffer" temporary; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line")` (integration)
- `OnAfterCopyTaxGenJnlLineForReverseCharge(var TaxGenJnlLine: Record "Gen. Journal Line"; var GenJournalLine: Record "Gen. Journal Line"; TransactionPostingBuffer: Record "Transaction Posting Buffer" temporary; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var TempTransactionValue: Record "Tax Transaction Value" temporary)` (integration)
- `OnAfterCopyTaxGenJnlLine(var TaxGenJnlLine: Record "Gen. Journal Line"; var GenJournalLine: Record "Gen. Journal Line"; TransactionPostingBuffer: Record "Transaction Posting Buffer" temporary; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")` (integration)
- `OnBeforeAdjustTaxAmountOnGenJnlLine(var GenJnlLine: Record "Gen. Journal Line"; var IsHandled: Boolean)` (integration)

## Event subscriptions

- OnAfterRunWithoutCheck subscribes to Codeunit "Gen. Jnl.-Post Line" OnAfterRunWithoutCheck
- OnAfterRunWithCheck subscribes to Codeunit "Gen. Jnl.-Post Line" OnAfterRunWithCheck
- OnBeforePostGenJnlLine subscribes to Codeunit "Gen. Jnl.-Post Line" OnBeforePostGenJnlLine
- OnAfterPostGenJnlLine subscribes to Codeunit "Gen. Jnl.-Post Line" OnAfterPostGenJnlLine

## Procedures

- `UpdateTaxPostingBuffer(var TempTaxTransactionValue: Record "Tax Transaction Value" temporary; RecID: RecordId; TaxTransactionID: Guid; DimensionSetID: Integer; GenBusPostingGroup: Code[20]; GenProdPostingGroup: Code[20]; DocumentQty: Decimal; InvoiceQty: Decimal; CurrencyCode: Code[20]; CurrencyFactor: Decimal; PostedDocNo: Code[20]; PostedDocLineNo: Integer)`
- `TransferTransactionValue(FromRecID: RecordId; ToRecID: RecordId; var FromTaxTransactionValue: Record "Tax Transaction Value" temporary)`
- `PrepareTransactionValueToPost(RecID: RecordId; Quantity: Decimal; QtyToInvoice: Decimal; CurrCode: Code[20]; CurrFactor: Decimal; var TempTaxTransactionValue: Record "Tax Transaction Value" temporary)`

Plus 11 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.

- [Codeunit 20343 "Tax Posting Buffer Mgmt."](../codeunit/20343.md) (13 calls: `AdjustTaxAmountOnGenJnlLine → GetSalesPurchLcy`, `AdjustTaxAmountOnGenJnlLine → GetTaxAmount`, `PostTaxJournal → ClearGroupingBuffers`, …)
- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (2 calls: `PostTaxJournal → GetNextTransactionNo`, `PostTaxJournal → RunWithCheck`)
- [Codeunit 20344 "Tax Posting Execution"](../codeunit/20344.md) (1 call: `UpdateUseCasePostingBuffer → ExecuteGetTaxPostingSetup`)
- [Codeunit 408 "DimensionManagement"](../codeunit/408.md) (1 call: `PostTaxJournal → UpdateGlobalDimFromDimSetID`)

## Called by

- [Codeunit 20335 "Purch.-Post Handler"](../codeunit/20335.md) (6 calls: `OnAfterPurchCrMemoLineInsert → PrepareTransactionValueToPost`, `OnAfterPurchCrMemoLineInsert → TransferTransactionValue`, `OnAfterPurchCrMemoLineInsert → UpdateTaxPostingBuffer`, …)
- [Codeunit 20336 "Sales Posting Subscribers"](../codeunit/20336.md) (6 calls: `OnAfterSalesCrMemoLineInsert → PrepareTransactionValueToPost`, `OnAfterSalesCrMemoLineInsert → TransferTransactionValue`, `OnAfterSalesCrMemoLineInsert → UpdateTaxPostingBuffer`, …)
- [Codeunit 20339 "Service Posting Subscribers"](../codeunit/20339.md) (6 calls: `OnAfterServiceCrMemoLineInsert → PrepareTransactionValueToPost`, `OnAfterServiceCrMemoLineInsert → TransferTransactionValue`, `OnAfterServiceCrMemoLineInsert → UpdateTaxPostingBuffer`, …)
- [Codeunit 20136 "Archive Management Handler"](../codeunit/20136.md) (4 calls: `OnAfterStorePurchLineArchive → PrepareTransactionValueToPost`, `OnAfterStorePurchLineArchive → TransferTransactionValue`, `OnAfterStoreSalesLineArchive → PrepareTransactionValueToPost`, …)
- [Codeunit 20338 "Transfer Shpt Posting Handler"](../codeunit/20338.md) (4 calls: `OnAfterInsertNewShipmentLine → PrepareTransactionValueToPost`, `OnAfterInsertNewShipmentLine → TransferTransactionValue`, `OnAfterInsertTransShptLine → PrepareTransactionValueToPost`, …)
- [Codeunit 20340 "Fin Charge Posting Handler"](../codeunit/20340.md) (3 calls: `OnAfterIsueFinChargeMemo → TransferTransactionValue`, `OnBeforePost → UpdateTaxPostingBuffer`, `PrepareTransactionValue → PrepareTransactionValueToPost`)
- [Codeunit 20334 "Gen. Jnl.-Post Handler"](../codeunit/20334.md) (2 calls: `OnBeforeCode → PrepareTransactionValueToPost`, `OnBeforeCode → UpdateTaxPostingBuffer`)
- [Codeunit 20337 "Transfer Rcpt. Posting Handler"](../codeunit/20337.md) (2 calls: `OnAfterInsertTransRcptLine → PrepareTransactionValueToPost`, `OnAfterInsertTransRcptLine → TransferTransactionValue`)

## 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: "Tax Document GL Posting")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
