Business Central 2021 wave 2 (BC19) new features: Extend general ledger posting aggregations (Invoice Post. Buffer refactoring)

Dynamics 365 Business Central

Hi, Readers.
The preview environment for Dynamics 365 Business Central 2021 release wave 2 (BC19) is available now. Learn more: https://yzhums.com/17638/

Update: Generally available: Dynamics 365 Business Central 2021 release wave 2 (BC19)

I will continue to test and share some new features that I hope will be helpful.

Extend general ledger posting aggregations (Invoice Post. Buffer refactoring):

Business value:

Regulations in different countries and industries, and customer business practices can cause a need to change the way in which general ledger entries are aggregated during posting.

Feature details:

The Invoice Post. Buffer table has been at the center of localizations and partner customizations when changes to G/L posting are needed, or when G/L entries need to be aggregated in a different way when they’re posted to the general ledger. The previous design is not extensible because the primary key in that table cannot be changed without introducing breaking change across partner solutions and localizations. There are significant differences in this table across localizations, in particular for APAC, BE, ES, IT, NA, and RU, and this has made it difficult to extract localizations to extensions.

This refactoring makes the posting process for sales, purchase, and service transactions extensible, and enables partners to change the way the posting algorithm aggregates G/L entries—for example, by specific document lines, posting groups, or the tax setup required by local legislation. Partners can replace customizations by using the interface for G/L invoice posting, resolve legacy issues for the Invoice Post. Buffer table, and use their own implementation of G/L invoice posting.

We have removed the dependencies from the Invoice Posting Buffer table in the Base Application and built an Invoice Posting component with an interface and an extensible enum for the implementation setup.

Let’s see some details.
In BC19 Preview, you can find a new setting (Invoice Posting Setup) in Sales & Receivables Setup, Purchases & Payables Setup, and Service Management Setup. The new Invoice Posting Process seems to be currently controlled by this setting.

For example, in Sales & Receivables Setup, you need to use Personalization to add this field.

The default value is Invoice Posting (Default). (I don’t know how long will this option still available)

Invoice Posting Setup
Specifies invoice posting implementation codeunit which is used for posting of sales invoices.

Purchases & Payables Setup:

Service Management Setup:

Source Code Example:

So, how it is work?
As described by Microsoft, if it is Invoice Posting (Default), the system will use the Invoice Posting Buffer table, if it is Invoice Posting (v.19), use the new interface “Invoice Posting”.

PS:
interface “Invoice Posting” (BC19 Preview)

Source Code:

interface "Invoice Posting"
{
    /// <summary>
    /// Check if implementation codeunit designed for source document type posting
    /// </summary>
    procedure Check(TableID: Integer)

    /// <summary>
    /// Clear temporary posting buffers in invoice posting codeunit
    /// </summary>
    procedure ClearBuffers()

    /// <summary>
    /// Check credit limit for document customer
    /// </summary>
    procedure CheckCreditLine(DocumentHeaderVar: Variant; DocumentLineVar: Variant)

    /// <summary>
    /// Set HideProgressWindow variable inside the invoice posting codeunit
    /// </summary>
    procedure SetHideProgressWindow(NewHideProgressWindow: Boolean)

    /// <summary>
    /// Set posting related parameters using temporary table
    /// </summary>
    procedure SetParameters(InvoicePostingParameters: Record "Invoice Posting Parameters")

    /// <summary>
    /// Set PreviewMode variable inside the invoice posting codeunit
    /// </summary>
    procedure SetPreviewMode(NewPreviewMode: Boolean)

    /// <summary>
    /// Set SupressCommit variable inside the invoice posting codeunit
    /// </summary>
    procedure SetSuppressCommit(NewSuppressCommit: Boolean)

    /// <summary>
    /// Set SupressCommit variable inside the invoice posting codeunit
    /// </summary>
    procedure SetTotalLines(TotalDocumentLine: Variant; TotalDocumentLineLCY: Variant)

    /// <summary>
    /// Prepare invoice posting buffer line from source document line
    /// </summary>
    procedure PrepareLine(DocumentHeaderVar: Variant; DocumentLineVar: Variant; DocumentLineACYVar: Variant)

    /// <summary>
    /// Prepare invoice posting buffer line from source document job line
    /// </summary>
    procedure PrepareJobLine(DocumentHeaderVar: Variant; DocumentLineVar: Variant; DocumentLineACYVar: Variant)

    /// <summary>
    /// Process customer or vendor ledger entry.
    /// </summary>
    procedure PostLedgerEntry(DocumentHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")

    /// <summary>
    /// Process customer or vendor ledger entry.
    /// </summary>
    procedure PostBalancingEntry(DocumentHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")

    /// <summary>
    /// Process invoice posting buffer and post ledger entries for each record.
    /// </summary>
    procedure PostLines(DocumentHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var Window: Dialog; var TotalAmount: Decimal)

    /// <summary>
    /// Calculate deferral amounts for invoice posting buffer
    /// </summary>
    procedure CalcDeferralAmounts(DocumentHeaderVar: Variant; DocumentLineVar: Variant; OriginalDeferralAmount: Decimal)

    /// <summary>
    /// Create deferral schedule for posted documents
    /// </summary>
    procedure CreatePostedDeferralSchedule(DocumentLineVar: Variant; NewDocumentType: Integer; NewDocumentNo: Code[20]; NewLineNo: Integer; PostingDate: Date)
}

Note: If you used Table “Invoice Post. Buffer” in your extension, you will now see the following warning.

Table ‘Invoice Post. Buffer’ is marked for removal. Reason: This table will be marked as temporary. Please ensure you do not store any data in the table.. Tag: 18.0.

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL