Codeunit 815 "Sales Post Invoice"
Base Application · Microsoft.Sales.Posting
Across versions
- BC23present
- BC241 procedures added, 1 procedures removed
- BC253 procedures added
- BC261 procedures changed, 1 procedures added
- BC27-30unchanged
Neighbourhood 7 connected objects and pages
Base Application · Microsoft.Sales.Posting · BC23-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| Permissions | TableData “Invoice Posting Buffer” = rimd |
Procedures
Check(TableID: Integer): Validates that the correct table is being used for invoice posting.SetPreviewMode(NewPreviewMode: Boolean): Sets whether the invoice posting is running in preview mode.SetSuppressCommit(NewSuppressCommit: Boolean): Sets whether database commits should be suppressed during invoice posting.SetHideProgressWindow(NewHideProgressWindow: Boolean): Sets whether the progress window should be hidden during invoice posting.SetParameters(NewInvoicePostingParameters: Record "Invoice Posting Parameters"): Sets the invoice posting parameters to be used during posting.SetTotalLines(TotalDocumentLine: Variant; TotalDocumentLineLCY: Variant): Sets the total lines used for posting the customer ledger entry.ClearBuffers(): Clears all temporary buffers used for deferral and invoice posting.PrepareLine(DocumentHeaderVar: Variant; DocumentLineVar: Variant; DocumentLineACYVar: Variant): Prepares a sales line for invoice posting by calculating amounts and creating invoice posting buffer entries.SetSalesTax(var SalesLine: Record "Sales Line"; var InvoicePostingBuffer: Record "Invoice Posting Buffer")+ BC25 (internal)PrepareInvoicePostingBuffer(var SalesLine: Record "Sales Line"; var InvoicePostingBuffer: Record "Invoice Posting Buffer")+ BC25 Δ BC26: Initializes the invoice posting buffer with values from the sales line.PostLines(DocumentHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var Window: Dialog; var TotalAmount: Decimal): Posts all invoice posting buffer lines to the general ledger.PrepareJobLine(SalesHeaderVar: Variant; SalesLineVar: Variant; SalesLineACYVar: Variant): Prepares and posts job-related entries for the sales line.CheckCreditLine(SalesHeaderVar: Variant; SalesLineVar: Variant): Validates the sales line for credit memo posting. Currently not implemented.PostLedgerEntry(SalesHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"): Posts the customer ledger entry for the sales invoice or credit memo.PostBalancingEntry(SalesHeaderVariant: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"): Posts the balancing entry to apply payment to the customer ledger entry when a balancing account is specified.CalcDeferralAmounts(SalesHeaderVar: Variant; SalesLineVar: Variant; OriginalDeferralAmount: Decimal): Calculates the deferral amounts for the sales line based on the quantity being invoiced.CreatePostedDeferralSchedule(SalesLineVar: Variant; NewDocumentType: Integer; NewDocumentNo: Code[20]; NewLineNo: Integer; PostingDate: Date): Creates the posted deferral schedule from the sales line deferral information.
Plus 17 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 825 “Sales Post Invoice Events” (59 calls:
CalcDeferralAmounts → RunOnBeforeTempDeferralLineInsert,CalcDeferralAmounts → RunOnCalcDeferralAmountsOnBeforeTempDeferralHeaderInsert,CalcInvoiceDiscountPosting → RunOnAfterCalcInvoiceDiscountPosting, …) - Codeunit 1720 “Deferral Utilities” (4 calls:
CalcDeferralAmounts → FilterDeferralLines,CreatePostedDeferralSchedule → FilterDeferralLines,PrepareDeferralLine → FilterDeferralLines, …) - Codeunit 12 “Gen. Jnl.-Post Line” (3 calls:
PostBalancingEntry → RunWithCheck,PostLedgerEntry → RunWithCheck,RunGenJnlPostLine → RunWithCheck) - Codeunit 1001 “Job Post-Line” (2 calls:
PostLines → PostJobSalesLines,PrepareJobLine → PostInvoiceContractLine) - Codeunit 442 “Sales-Post Prepayments” (2 calls:
PrepareLine → GetCorrBalAccNo,PrepareLine → GetInvRoundingAccNo) - Codeunit 408 “DimensionManagement” (1 call:
PrepareInvoicePostingBuffer → UpdateGlobalDimFromDimSetID) - Codeunit 6200 “Non-Deductible VAT” (1 call:
PrepareInvoicePostingBuffer → ClearNonDeductibleVAT)
Implements
Recent changes
- 2026-09-21 #11434 [main] Incorrect Additional Currency Base and Additional Currency Amount calculation in VAT/GST Entries when Line Discount is applied on Sales Invoice in the Australian version. (main, BC30, fix)
- 2026-09-18 #10513 [Extensibility Request] issue 30270: expose JobPostLine before calculating totals (main, BC30, feature)
- 2026-09-09 #11160 Ruleset hardening: promote three mechanical rules to Error (main, BC30, refactor)
- 2026-09-07 #10877 [MAIN]-Bug 648518 Source Currency VAT Amount is zero on G/L Entry when posting sales invoice with Line Discount Deferral Code and Discount Posting is No Discounts (main, BC30, fix)
Countries that replace it
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: "Sales Post Invoice"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.