---
id: object/codeunit/7000006-es
type: object
title: Codeunit 7000006 "Document-Post" (ES)
summary: Codeunit 7000006 "Document-Post" (ES) in the ES country layer (Microsoft.Finance.ReceivablesPayables). 25 public procedures, 21 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - es 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: 7613974a1450f222c0b44c1f237a3cb71a438fe6e8fd0ab3a0d8e7f6b4f4d55b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/Finance/ReceivablesPayables/DocumentPost.Codeunit.al
    title: src/Layers/ES/BaseApp/Local/Finance/ReceivablesPayables/DocumentPost.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/es
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 7000006
name: Document-Post
namespace: Microsoft.Finance.ReceivablesPayables
app: Base Application
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: ES
counts:
  fields: 0
  procedures: 52
  events: 21
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 7000006 "Document-Post" (ES)

> Codeunit 7000006 "Document-Post" (ES) in the ES country layer (Microsoft.Finance.ReceivablesPayables). 25 public procedures, 21 events. Introduced in BC29, still in BC30.

ES country layer · Microsoft.Finance.ReceivablesPayables · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/Finance/ReceivablesPayables/DocumentPost.Codeunit.al) · facts from BC29

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

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "Cust. Ledger Entry" = imd, TableData "Vendor Ledger Entry" = imd, TableData "Detailed Cust. Ledg. Entry" = imd, TableData "Detailed Vendor Ledg. Entry" = imd, TableData "Cartera Doc." = imd, TableData "Posted Cartera Doc." = imd, TableData "Closed Cartera Doc." = imd, TableData "Posted Bi... |

## Events published

- `OnAfterCheckGenJnlLine(var GenJournalLine: Record "Gen. Journal Line")` (integration)
- `OnAfterCreateReceivableDoc(var CarteraDoc: Record "Cartera Doc."; GenJournalLine: Record "Gen. Journal Line"; var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")` (integration)
- `OnAfterCreatePayableDoc(var CarteraDoc: Record "Cartera Doc."; GenJournalLine: Record "Gen. Journal Line"; var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")` (integration)
- `OnBeforeCreateReceivableDoc(var CarteraDoc: Record "Cartera Doc."; GenJournalLine: Record "Gen. Journal Line"; var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")` (integration)
- `OnBeforeCreatePayableDoc(var CarteraDoc: Record "Cartera Doc."; GenJournalLine: Record "Gen. Journal Line"; var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")` (integration)
- `OnBeforeShowPostResultMessage(var GenJournalLine: Record "Gen. Journal Line"; var PostOk: Boolean; TempJnlBatchName: Code[10]; var IsHandled: Boolean)` (integration)
- `OnCloseBillGroupIfEmptyOnAfterPostedCarteraDocSetFilter(var PostedCarteraDoc: Record "Posted Cartera Doc.")` (integration)
- `OnCodeOnBeforeGenJnlPostBatchRun(var GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)` (integration)
- `OnUpdateUnAppliedReceivableDocOnAfterCarteraDocModify(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedReceivableDocOnBeforeCarteraDocModify(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedReceivableDocOnAfterCarteraDocInsert(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedReceivableDocOnBeforeCarteraDocInsert(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedPayableDocOnAfterCarteraDocModify(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedPayableDocOnBeforeCarteraDocModify(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedPayableDocOnAfterCarteraDocInsert(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdateUnAppliedPayableDocOnBeforeCarteraDocInsert(var CarteraDoc: Record "Cartera Doc.")` (integration)
- `OnUpdatePayableDocBeforeCarteraDocModify(var CarteraDoc: Record "Cartera Doc."; VendLedgEntry: Record "Vendor Ledger Entry")` (integration)
- `OnBeforeUpdateReceivableDoc(var CustLedgEntry: Record "Cust. Ledger Entry")` (integration)
- `OnUpdatePayableDocBeforeClosedCarteraDocInsert(var ClosedCarteraDoc: Record "Closed Cartera Doc."; GenJnlLine: Record "Gen. Journal Line")` (integration)
- `OnGJLInfoToDocOnBeforeExit(var CarteraDoc: Record "Cartera Doc."; var GenJournalLine: Record "Gen. Journal Line")` (integration)
- `OnAfterGJLInfoToDoc(var CarteraDoc: Record "Cartera Doc."; GenJournalLine: Record "Gen. Journal Line")` (integration)

## Procedures

- `CheckGenJnlLine(var GenJnlLine: Record "Gen. Journal Line")`
- `CreateReceivableDoc(GenJnlLine: Record "Gen. Journal Line"; var CVLedgEntryBuf: Record "CV Ledger Entry Buffer"; IsFromJournal: Boolean)`
- `CreatePayableDoc(GenJnlLine: Record "Gen. Journal Line"; var CVLedgEntryBuf: Record "CV Ledger Entry Buffer"; IsFromJournal: Boolean)`
- `GJLInfoToDoc(var GenJnlLine: Record "Gen. Journal Line"; var CarteraDoc: Record "Cartera Doc.")`
- `UpdateReceivableDoc(var CustLedgEntry: Record "Cust. Ledger Entry"; var GenJnlLine: Record "Gen. Journal Line"; AppliedAmountLCY: Decimal; var DocAmountLCY: Decimal; var RejDocAmountLCY: Decimal; var DiscDocAmountLCY: Decimal; var CollDocAmountLCY: Decimal; var DiscRiskFactAmountLCY: Decimal; var DiscUnriskFactAmountLCY: Decimal; var CollFactAmountLCY: Decimal)`
- `UpdatePayableDoc(var VendLedgEntry: Record "Vendor Ledger Entry"; var GenJnlLine: Record "Gen. Journal Line"; var DocAmountLCY: Decimal; AppliedAmountLCY: Decimal; var DocLock: Boolean; var CollDocAmountLCY: Decimal)`
- `CheckAppliedReceivableDoc(var OldCustLedgEntry: Record "Cust. Ledger Entry"; SystemCreatedEntry: Boolean)`
- `CheckAppliedPayableDoc(var OldVendLedgEntry: Record "Vendor Ledger Entry"; SystemCreatedEntry: Boolean)`
- `CheckPostingDate(CheckDate: Date)`
- `CloseBillGroupIfEmpty(PostedBillGroup: Record "Posted Bill Group"; PostingDate: Date)`
- `ClosePmtOrdIfEmpty(PostedPmtOrd: Record "Posted Payment Order"; PostingDate: Date)`
- `CheckDocInfo(var GenJnlLine: Record "Gen. Journal Line"; var ErrorCounter: Integer; var ErrorText: array[50] of Text[250])`
- `FindDisctdAmt(DocAmount: Decimal; CustomerNo: Code[20]; BankAccCode: Code[20]): Decimal`
- `PostLines(var GenJnlLine2: Record "Gen. Journal Line"; var PostOk: Boolean; Print: Boolean)`
- `PostSettlement(var GenJournalLine: Record "Gen. Journal Line")`
- `PostSettlementForPostedPmtOrder(var GenJournalLine: Record "Gen. Journal Line"; PostingDate: Date)`
- `PostSettlementForPostedBillGroup(var GenJournalLine: Record "Gen. Journal Line"; PostingDate: Date)`
- `InsertDtldCustLedgEntry(CustLedgEntry2: Record "Cust. Ledger Entry"; Amount2: Decimal; Amount2LCY: Decimal; EntryType: Option " ","Initial Entry",Application,"Unrealized Loss","Unrealized Gain","Realized Loss","Realized Gain","Payment Discount","Payment Discount (VAT Excl.)","Payment Discount (VAT Adjustment)","Appln. Rounding","Correction of Remaining Amount",,,,,,,,,Settlement,Rejection,Redrawal,Expenses; PostingDate: Date)`
- `InsertDtldVendLedgEntry(VendLedgEntry2: Record "Vendor Ledger Entry"; Amount2: Decimal; Amount2LCY: Decimal; EntryType: Option " ","Initial Entry",Application,"Unrealized Loss","Unrealized Gain","Realized Loss","Realized Gain","Payment Discount","Payment Discount (VAT Excl.)","Payment Discount (VAT Adjustment)","Appln. Rounding","Correction of Remaining Amount",,,,,,,,,Settlement,Rejection,Redrawal,Expenses; PostingDate: Date)`
- `GetFCYAppliedAmt(AppliedAmountLCY: Decimal; CurrCode: Code[20]; PostingDate: Date): Decimal`
- `UpdateReceivableCurrFact(PostedCarteraDoc: Record "Posted Cartera Doc."; AppliedAmountLCY: Decimal; var DocAmountLCY: Decimal; var RejDocAmountLCY: Decimal; var DiscDocAmountLCY: Decimal; var CollDocAmountLCY: Decimal; var DiscRiskFactAmountLCY: Decimal; var DiscUnriskFactAmountLCY: Decimal; var CollFactAmountLCY: Decimal)`
- `UpdatePayableCurrFact(PostedCarteraDoc: Record "Posted Cartera Doc."; AppliedAmountLCY: Decimal; var DocAmountLCY: Decimal; var CollDocAmountLCY: Decimal)`
- `GetCorrectAmounts(var Amount: Decimal; AppliedAmountLCY: Decimal; CurrFact: Decimal; InvoiceCurrFact: Decimal; PostedCarteraDoc: Record "Posted Cartera Doc."): Decimal`
- `UpdateUnAppliedReceivableDoc(var CustLedgEntry: Record "Cust. Ledger Entry"; var GenJnlLine: Record "Gen. Journal Line")`
- `UpdateUnAppliedPayableDoc(var VendLedgEntry: Record "Vendor Ledger Entry"; var GenJnlLine: Record "Gen. Journal Line"; var DocLock: Boolean)`

Plus 6 local procedures.

## Triggers

OnRun

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

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