---
title: "Codeunit 815 Sales Post Invoice, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/points/
object: https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 815 Sales Post Invoice, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/points/

24 procedures and triggers with a step in src/Layers/W1/BaseApp/Sales/Posting/SalesPostInvoice.Codeunit.al, in source order, read from the text, not from a run.

## ClearBuffers

[Line 114](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L114).

- [116](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L116) writes [Table 1701 Deferral Header](https://jonas-paprotka.de/ref/table/1701-deferral-header/) DeleteAll
- [117](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L117) writes [Table 1702 Deferral Line](https://jonas-paprotka.de/ref/table/1702-deferral-line/) DeleteAll
- [118](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L118) writes [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) DeleteAll

## PrepareLine

[Line 127](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L127).

- [157](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L157) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforePrepareLine`
- [166](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L166) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforePrepareSales`
- [167](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L167) calls `PrepareInvoicePostingBuffer`
- [169](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L169) calls `InitTotalAmounts`
- [173](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L173) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterAssignAmounts`
- [176](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L176) calls `GetAmountsForDeferral`
- [180](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L180) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterSetInvoiceDiscountPosting`
- [183](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L183) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeCalcInvoiceDiscountPosting`
- [187](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L187) calls `CalcInvoiceDiscountPosting`
- [191](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L191) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeSetInvoiceDiscAccount`
- [193](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L193) calls [Table 252 General Posting Setup](https://jonas-paprotka.de/ref/table/252-general-posting-setup/) `GetSalesInvDiscAccount`
- [194](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L194) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `SetAccount`
- [195](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L195) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `UpdateVATBase`
- [196](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L196) calls `UpdateInvoicePostingBuffer`
- [197](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L197) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterSetInvoiceDiscAccount`
- [204](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L204) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterSetLineDiscountPosting`
- [207](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L207) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeCalcLineDiscountPosting`
- [211](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L211) calls `CalcLineDiscountPosting`
- [215](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L215) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeSetLineDiscAccount`
- [217](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L217) calls [Table 252 General Posting Setup](https://jonas-paprotka.de/ref/table/252-general-posting-setup/) `GetSalesLineDiscAccount`
- [219](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L219) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeInvoicePostingBufferSetAccount`
- [221](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L221) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `SetAccount`
- [222](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L222) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `UpdateVATBase`
- [223](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L223) calls `UpdateInvoicePostingBuffer`
- [224](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L224) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterSetLineDiscAccount`
- [229](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L229) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeAdjustTotalAmounts`
- [229](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L229) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [230](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L230) calls [Codeunit 1720 Deferral Utilities](https://jonas-paprotka.de/ref/codeunit/1720-deferral-utilities/) `AdjustTotalAmountForDeferralsNoBase`
- [234](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L234) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeSetAmounts`
- [238](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L238) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `SetAmounts`
- [242](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L242) calls `SetSalesTax`
- [244](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L244) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterSetAmounts`
- [246](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L246) calls `GetSalesAccount`
- [248](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L248) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforeSetAccount`
- [249](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L249) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `SetAccount`
- [250](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L250) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `UpdateVATBase`
- [252](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L252) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterFillInvoicePostingBuffer`
- [254](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L254) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeUpdateInvoicePostingBuffer`
- [256](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L256) calls `UpdateInvoicePostingBuffer`
- [258](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L258) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterUpdateInvoicePostingBuffer`
- [262](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L262) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnBeforePrepareDeferralLine`
- [263](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L263) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [264](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L264) calls `PrepareDeferralLine`
- [267](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L267) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareLineOnAfterPrepareDeferralLine`
- [268](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L268) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [274](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L274) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `PreparePrepmtAdjBuffer`
- [276](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L276) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `PreparePrepmtAdjBuffer`
- [277](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L277) calls [Codeunit 442 Sales-Post Prepayments](https://jonas-paprotka.de/ref/codeunit/442-sales-post-prepayments/) `GetCorrBalAccNo`
- [281](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L281) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `PreparePrepmtAdjBuffer`
- [282](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L282) calls [Codeunit 442 Sales-Post Prepayments](https://jonas-paprotka.de/ref/codeunit/442-sales-post-prepayments/) `GetInvRoundingAccNo`

## GetSalesAccount

[Line 295](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L295), local.

- [300](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L300) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeGetSalesAccount`
- [305](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L305) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `IsCreditDocType`
- [306](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L306) calls [Table 252 General Posting Setup](https://jonas-paprotka.de/ref/table/252-general-posting-setup/) `GetSalesCrMemoAccount`
- [308](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L308) calls [Table 252 General Posting Setup](https://jonas-paprotka.de/ref/table/252-general-posting-setup/) `GetSalesAccount`
- [310](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L310) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterGetSalesAccount`

## CalcInvoiceDiscountPosting

[Line 313](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L313), local.

- [318](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L318) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeCalcInvoiceDiscountPosting`
- [323](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L323) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `CalcDiscountNoVAT`
- [326](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L326) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `CalcDiscount`
- [329](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L329) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterCalcInvoiceDiscountPosting`

## CalcLineDiscountPosting

[Line 332](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L332), local.

- [337](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L337) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeCalcLineDiscountPosting`
- [342](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L342) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `CalcDiscountNoVAT`
- [345](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L345) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `CalcDiscount`
- [348](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L348) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterCalcLineDiscountPosting`

## InitTotalAmounts

[Line 351](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L351), local.

- [360](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L360) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterInitTotalAmounts`

## PrepareInvoicePostingBuffer

[Line 368](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L368).

- [370](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L370) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforePrepareInvoicePostingBuffer`
- [384](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L384) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetVATPct`
- [394](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L394) calls `UpdateEntryDescriptionFromSalesLine`
- [397](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L397) calls `SetSalesTax`
- [399](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L399) calls [Codeunit 408 DimensionManagement](https://jonas-paprotka.de/ref/codeunit/408-dimensionmanagement/) `UpdateGlobalDimFromDimSetID`
- [407](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L407) calls [Codeunit 6200 Non-Deductible VAT](https://jonas-paprotka.de/ref/codeunit/6200-non-deductible-vat/) `ClearNonDeductibleVAT`
- [410](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L410) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetJnlTemplateName`
- [411](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L411) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterPrepareInvoicePostingBuffer`

## UpdateEntryDescriptionFromSalesLine

[Line 414](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L414), local.

- [417](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L417) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `UpdateEntryDescription`
- [421](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L421) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetSalesHeader`

## UpdateInvoicePostingBuffer

[Line 424](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L424), local.

- [437](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L437) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `Update`

## PostLines

[Line 450](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L450).

- [460](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L460) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforePostLines`
- [469](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L469) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `ApplyRoundingForFinalPosting`
- [470](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L470) calls `PrepareGenJnlLine`
- [472](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L472) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostLinesOnBeforeGenJnlLinePost`
- [474](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L474) calls `RunGenJnlPostLine`
- [475](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L475) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostLinesOnAfterGenJnlLinePost`
- [481](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L481) calls `SetJobLineFilters`
- [482](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L482) calls [Codeunit 1001 Job Post-Line](https://jonas-paprotka.de/ref/codeunit/1001-job-post-line/) `PostJobSalesLines`
- [483](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L483) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostLinesOnAfterPostJobSalesLines`
- [491](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L491) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll`
- [493](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L493) writes [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) DeleteAll

## PrepareGenJnlLine

[Line 496](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L496), local.

- [498](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L498) calls `InitGenJnlLine`
- [500](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L500) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyDocumentFields`
- [504](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L504) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyFromSalesHeader`
- [506](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L506) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `CopyToGenJnlLine`
- [511](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L511) calls [Table 330 Currency Exchange Rate](https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/) `ExchangeAmtFCYToLCY`
- [512](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L512) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [513](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L513) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareGenJnlLineOnAfterCopyToGenJnlLine`
- [519](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L519) calls [Table 55 Invoice Posting Buffer](https://jonas-paprotka.de/ref/table/55-invoice-posting-buffer/) `CopyToGenJnlLineFA`
- [522](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L522) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterPrepareGenJnlLine`

## InitGenJnlLine

[Line 525](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L525), local.

- [530](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L530) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeInitGenJnlLine`
- [534](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L534) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `InitNewLine`

## PrepareJobLine

[Line 546](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L546).

- [556](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L556) calls [Codeunit 1001 Job Post-Line](https://jonas-paprotka.de/ref/codeunit/1001-job-post-line/) `PostInvoiceContractLine`

## SetJobLineFilters

[Line 559](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L559), local.

- [576](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L576) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterSetJobLineFilters`

## PostLedgerEntry

[Line 593](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L593).

- [602](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L602) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforePostLedgerEntry`
- [607](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L607) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `InitNewLine`
- [612](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L612) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyDocumentFields`
- [618](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L618) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyFromSalesHeader`
- [619](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L619) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `SetCurrencyFactor`
- [623](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L623) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyFromSalesHeaderApplyTo`
- [624](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L624) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyFromSalesHeaderPayment`
- [626](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L626) calls `InitGenJnlLineAmountFieldsFromTotalSalesLine`
- [628](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L628) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostLedgerEntryOnBeforeGenJnlPostLine`
- [630](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L630) calls [Codeunit 12 Gen. Jnl.-Post Line](https://jonas-paprotka.de/ref/codeunit/12-gen-jnl-post-line/) `RunWithCheck`
- [631](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L631) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostLedgerEntryOnAfterGenJnlPostLine`

## InitGenJnlLineAmountFieldsFromTotalSalesLine

[Line 635](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L635), local.

- [640](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L640) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeInitGenJnlLineAmountFieldsFromTotalLines`
- [653](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L653) calls [Table 330 Currency Exchange Rate](https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/) `ExchangeAmtFCYToLCY`
- [654](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L654) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`

## PostBalancingEntry

[Line 662](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L662).

- [674](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L674) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostBalancingEntryOnBeforeFindCustLedgEntry`
- [680](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L680) calls `FindCustLedgEntry`
- [682](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L682) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostBalancingEntryOnAfterFindCustLedgEntry`
- [684](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L684) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `InitNewLine`
- [689](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L689) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostBalancingEntryOnAfterInitNewLine`
- [691](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L691) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyDocumentFields`
- [697](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L697) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `CopyFromSalesHeader`
- [698](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L698) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `SetCurrencyFactor`
- [700](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L700) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `IsCreditDocType`
- [705](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L705) calls `SetApplyToDocNo`
- [707](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L707) calls `SetAmountsForBalancingEntry`
- [709](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L709) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostBalancingEntryOnBeforeGenJnlPostLine`
- [711](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L711) calls [Codeunit 12 Gen. Jnl.-Post Line](https://jonas-paprotka.de/ref/codeunit/12-gen-jnl-post-line/) `RunWithCheck`
- [712](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L712) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPostBalancingEntryOnAfterGenJnlPostLine`

## SetAmountsForBalancingEntry

[Line 716](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L716), local.

- [721](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L721) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeSetAmountsForBalancingEntry`
- [738](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L738) calls [Table 330 Currency Exchange Rate](https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/) `ExchangeAmtFCYToLCY`
- [739](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L739) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`

## SetApplyToDocNo

[Line 742](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L742), local.

- [750](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L750) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterSetApplyToDocNo`

## RunGenJnlPostLine

[Line 760](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L760), local.

- [762](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L762) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeRunGenJnlPostLine`
- [763](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L763) calls [Codeunit 12 Gen. Jnl.-Post Line](https://jonas-paprotka.de/ref/codeunit/12-gen-jnl-post-line/) `RunWithCheck`

## GetAmountsForDeferral

[Line 766](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L766), local.

- [772](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L772) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeGetAmountsForDeferral`
- [787](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L787) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `IsCreditDocType`

## PrepareDeferralLine

[Line 793](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L793), local.

- [805](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L805) calls [Codeunit 1720 Deferral Utilities](https://jonas-paprotka.de/ref/codeunit/1720-deferral-utilities/) `FilterDeferralLines`
- [809](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L809) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `PrepareSales`
- [814](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L814) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareDeferralLineOnBeforePrepareInitialAmounts`
- [817](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L817) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `PrepareInitialAmounts`
- [819](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L819) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `Update`
- [821](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L821) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `PrepareRemainderSales`
- [823](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L823) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `Update`
- [830](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L830) calls `CheckDeferralAmount`
- [834](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L834) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `PrepareSales`
- [835](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L835) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `InitFromDeferralLine`
- [836](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L836) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `IsCreditDocType`
- [837](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L837) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `ReverseAmounts`
- [842](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L842) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnPrepareDeferralLineOnBeforeDeferralPostingBufferUpdate`
- [843](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L843) calls [Table 1706 Deferral Posting Buffer](https://jonas-paprotka.de/ref/table/1706-deferral-posting-buffer/) `Update`
- [855](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L855) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterPrepareDeferralLine`

## CalcDeferralAmounts

[Line 884](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L884).

- [901](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L901) calls [Table 4 Currency](https://jonas-paprotka.de/ref/table/4-currency/) `Initialize`
- [906](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L906) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetDeferralAmount`
- [909](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L909) calls [Table 330 Currency Exchange Rate](https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/) `ExchangeAmtFCYToLCY`
- [910](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L910) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [912](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L912) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnCalcDeferralAmountsOnBeforeTempDeferralHeaderInsert`
- [913](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L913) writes [Table 1701 Deferral Header](https://jonas-paprotka.de/ref/table/1701-deferral-header/) Insert
- [915](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L915) calls [Codeunit 1720 Deferral Utilities](https://jonas-paprotka.de/ref/codeunit/1720-deferral-utilities/) `FilterDeferralLines`
- [934](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L934) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetDeferralAmount`
- [937](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L937) calls [Table 330 Currency Exchange Rate](https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/) `ExchangeAmtFCYToLCY`
- [938](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L938) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `GetUseDate`
- [943](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L943) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeTempDeferralLineInsert`
- [945](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L945) writes [Table 1702 Deferral Line](https://jonas-paprotka.de/ref/table/1702-deferral-line/) Insert

## CreatePostedDeferralSchedule

[Line 959](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L959).

- [973](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L973) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnBeforeCreatePostedDeferralSchedule`
- [983](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L983) calls [Table 1704 Posted Deferral Header](https://jonas-paprotka.de/ref/table/1704-posted-deferral-header/) `InitFromDeferralHeader`
- [985](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L985) calls [Codeunit 1720 Deferral Utilities](https://jonas-paprotka.de/ref/codeunit/1720-deferral-utilities/) `FilterDeferralLines`
- [990](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L990) calls [Table 1705 Posted Deferral Line](https://jonas-paprotka.de/ref/table/1705-posted-deferral-line/) `InitFromDeferralLine`
- [995](https://jonas-paprotka.de/ref/codeunit/815-sales-post-invoice/source/#L995) calls [Codeunit 825 Sales Post Invoice Events](https://jonas-paprotka.de/ref/codeunit/825-sales-post-invoice-events/) `RunOnAfterCreatePostedDeferralSchedule`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
