Codeunit "Payment Registration Mgt."

ID 980
Namespace: Microsoft.Bank.Payment

Codeunit 980 "Payment Registration Mgt." manages payment registration functionality including posting, document search, balance calculations, and preview operations. Handles the business logic for the payment registration workspace and integrates with general journal posting.

Remarks

Supports both individual and lump payment posting modes. Provides document search capabilities with tolerance checking and balance validation. Includes extensibility through integration events for custom posting logic and document filtering.

Properties

Name Value
EventSubscriberInstance Manual
TableNo Table Microsoft.Bank.Payment."Payment Registration Buffer"

Methods

RunSetup

Runs the payment registration setup wizard to configure payment registration defaults. This procedure checks if setup is complete and guides users through configuration if needed.

procedure RunSetup()

ConfirmClose

Confirms whether to close the payment registration page when there are unsaved payments. This procedure checks for pending payments and prompts the user for confirmation before closing.

procedure ConfirmClose(var PaymentRegistrationBuffer: Record "Payment Registration Buffer"): Boolean

Parameters

Name Type Description
PaymentRegistrationBuffer Table Microsoft.Bank.Payment."Payment Registration Buffer"

The payment registration buffer to check for pending payments.

Returns

Type Description
Boolean

True if the user confirms closing or there are no pending payments, false otherwise.

ConfirmPost

Confirms and posts payment registrations after validation. This procedure validates payment entries and posts them after user confirmation.

procedure ConfirmPost(var PaymentRegistrationBuffer: Record "Payment Registration Buffer")

Parameters

Name Type Description
PaymentRegistrationBuffer Table Microsoft.Bank.Payment."Payment Registration Buffer"

The payment registration buffer containing payments to post.

FindRecords

Finds document records that match the specified search criteria. This procedure searches for sales documents, reminders, and finance charge memos based on document number and amount filters.

procedure FindRecords(var TempDocumentSearchResult: Record "Document Search Result" temporary, DocNoFilter: Code[20], AmountFilter: Decimal, AmountTolerancePerc: Decimal)

Parameters

Name Type Description
TempDocumentSearchResult Table Microsoft.Bank.Payment."Document Search Result"

Temporary table to store the search results.

DocNoFilter Code[20]

Document number filter for the search.

AmountFilter Decimal

Amount filter for the search.

AmountTolerancePerc Decimal

Percentage tolerance for amount matching.

ShowRecords

Shows the detailed records for a selected document search result. This procedure opens the appropriate page to display the full document details based on the search result type.

procedure ShowRecords(var TempDocumentSearchResult: Record "Document Search Result" temporary)

Parameters

Name Type Description
TempDocumentSearchResult Table Microsoft.Bank.Payment."Document Search Result"

The temporary document search result record to show details for.

ConfirmPostLumpPayment

procedure ConfirmPostLumpPayment(var SourcePaymentRegistrationBuffer: Record "Payment Registration Buffer")

Parameters

Name Type Description
SourcePaymentRegistrationBuffer Table Microsoft.Bank.Payment."Payment Registration Buffer"

InsertDocSearchResult

Inserts a document search result record into the temporary search result table. This procedure creates a new search result entry for documents found during payment registration searches.

procedure InsertDocSearchResult(var TempDocumentSearchResult: Record "Document Search Result" temporary, DocNo: Code[20], DocType: Integer, TableID: Integer, DocTypeDescription: Text[50], Amount: Decimal)

Parameters

Name Type Description
TempDocumentSearchResult Table Microsoft.Bank.Payment."Document Search Result"

The temporary table to insert the search result into.

DocNo Code[20]

The document number of the found document.

DocType Integer

The document type identifier.

TableID Integer

The table ID of the source document.

DocTypeDescription Text[50]

A descriptive text for the document type.

Amount Decimal

The amount associated with the found document.

SetToleranceLimits

Sets tolerance limits for amount matching and returns formatted tolerance information. This procedure calculates and displays tolerance ranges for payment amount matching.

procedure SetToleranceLimits(Amount: Decimal, AmountTolerance: Decimal, ToleranceTxt: Text): Text

Parameters

Name Type Description
Amount Decimal

The base amount for tolerance calculation.

AmountTolerance Decimal

The tolerance percentage to apply.

ToleranceTxt Text

The tolerance text template to format.

Returns

Type Description
Text

Formatted text showing the tolerance limits for the specified amount.

IsWithinTolerance

Determines whether an amount is within the specified tolerance range of a filter amount. This procedure is used for amount matching during document searches and payment registration.

procedure IsWithinTolerance(Amount: Decimal, FilterAmount: Decimal, TolerancePct: Decimal): Boolean

Parameters

Name Type Description
Amount Decimal

The amount to check against the tolerance range.

FilterAmount Decimal

The base amount for tolerance calculation.

TolerancePct Decimal

The tolerance percentage (0-100) to apply.

Returns

Type Description
Boolean

True if the amount is within tolerance, false otherwise.

CalculateBalance

procedure CalculateBalance(var PostedBalance: Decimal, var UnpostedBalance: Decimal)

Parameters

Name Type Description
PostedBalance Decimal
UnpostedBalance Decimal

OpenGenJnl

procedure OpenGenJnl()

Preview

procedure Preview(var PaymentRegistrationBuffer: Record "Payment Registration Buffer", AsLump: Boolean)

Parameters

Name Type Description
PaymentRegistrationBuffer Table Microsoft.Bank.Payment."Payment Registration Buffer"
AsLump Boolean

SetPreviewContext

procedure SetPreviewContext(AsLump: Boolean)

Parameters

Name Type Description
AsLump Boolean

Events

OnAfterFindRecords

[IntegrationEvent(True,False)]
local procedure OnAfterFindRecords(var TempDocumentSearchResult: Record "Document Search Result" temporary, DocNoFilter: Code[20], AmountFilter: Decimal, AmountTolerancePerc: Decimal)

Parameters

Name Type Description
TempDocumentSearchResult Table Microsoft.Bank.Payment."Document Search Result"
DocNoFilter Code[20]
AmountFilter Decimal
AmountTolerancePerc Decimal

OnBeforeGenJnlLineInsert

[IntegrationEvent(False,False)]
local procedure OnBeforeGenJnlLineInsert(var GenJournalLine: Record "Gen. Journal Line", TempPaymentRegistrationBuffer: Record "Payment Registration Buffer" temporary)

Parameters

Name Type Description
GenJournalLine Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line"
TempPaymentRegistrationBuffer Table Microsoft.Bank.Payment."Payment Registration Buffer"

OnCalculateBalanceOnAfterSetPostedBalance

[IntegrationEvent(False,False)]
local procedure OnCalculateBalanceOnAfterSetPostedBalance(var PostedBalance: Decimal, GLAccount: Record "G/L Account", BankAccount: Record "Bank Account")

Parameters

Name Type Description
PostedBalance Decimal
GLAccount Table Microsoft.Finance.GeneralLedger.Account."G/L Account"
BankAccount Table Microsoft.Bank.BankAccount."Bank Account"

OnBeforePost

Integration event raised before posting payment registration entries. This event allows external extensions to validate or modify payment data before posting.

[IntegrationEvent(False,False)]
procedure OnBeforePost(var TempPaymentRegistrationBuffer: Record "Payment Registration Buffer" temporary)

Parameters

Name Type Description
TempPaymentRegistrationBuffer Table Microsoft.Bank.Payment."Payment Registration Buffer"

The temporary payment registration buffer containing the payment data to be posted.

OnFindSalesHeaderRecordsOnBeforeToleranceCheck

[IntegrationEvent(False,False)]
procedure OnFindSalesHeaderRecordsOnBeforeToleranceCheck(var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"

OnShowSalesHeaderRecordsOnBeforeOpenPage

[IntegrationEvent(False,False)]
local procedure OnShowSalesHeaderRecordsOnBeforeOpenPage(var TempDocumentSearchResult: Record "Document Search Result" temporary, var SalesHeader: Record "Sales Header", var IsHandled: Boolean)

Parameters

Name Type Description
TempDocumentSearchResult Table Microsoft.Bank.Payment."Document Search Result"
SalesHeader Table Microsoft.Sales.Document."Sales Header"
IsHandled Boolean

OnShowRecords

[IntegrationEvent(False,False)]
local procedure OnShowRecords(var TempDocumentSearchResult: Record "Document Search Result" temporary)

Parameters

Name Type Description
TempDocumentSearchResult Table Microsoft.Bank.Payment."Document Search Result"

OnUpdateApplicationFieldsOnCustLedgerEntryOnAfterCalcRemainingAmount

[IntegrationEvent(False,False)]
local procedure OnUpdateApplicationFieldsOnCustLedgerEntryOnAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")

Parameters

Name Type Description
CustLedgerEntry Table Microsoft.Sales.Receivables."Cust. Ledger Entry"

See also