Match Bank Payments: pass Payment Reference to DocumentMatching#8926
Open
JesperSchulz wants to merge 1 commit into
Open
Match Bank Payments: pass Payment Reference to DocumentMatching#8926JesperSchulz wants to merge 1 commit into
JesperSchulz wants to merge 1 commit into
Conversation
DocumentMatching in codeunit 1255 "Match Bank Payments" already accepts a PaymentReference parameter, but the W1 call site hardcoded '' so the bank rec line's Payment Reference No. was never matched against an open ledger entry's payment reference (typical SEPA flow). Pass TempLedgerEntryMatchingBuffer."Payment Reference" instead. Behavior is unchanged for empty references since DocumentMatching early-exits when PaymentReference = ''. Ported from internal NAV PR 249652 (originally microsoft/BusinessCentralApps#1912). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Copilot PR ReviewIteration 1 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
DocumentMatchingin codeunit 1255 "Match Bank Payments" already accepts aPaymentReferenceparameter and contains the logic to match the bank rec line'sPayment Reference No.against an open ledger entry's payment reference. The single W1 call site, however, hardcoded''for that argument, so the match never fired (typical SEPA flow).The buffer record
Ledger Entry Matching Bufferalready exposes the field and is populated for customer, vendor, and employee ledger entries (seeInitializeCustomerLedgerEntriesMatchingBuffer,InitializeVendorLedgerEntriesMatchingBuffer,InitializeEmployeeLedgerEntriesMatchingBuffer).The fix is one line: pass
TempLedgerEntryMatchingBuffer."Payment Reference"instead of''. Behavior is unchanged for buffers where the field is empty, sinceDocumentMatchingearly-exits whenPaymentReference = ''.A new test
TestCustPaymentReferenceMatchis added to the W1/CH/DK/ITBankPmtApplAlgorithmtest codeunits covering the SEPA scenario (no document number in the transaction text, so the payment reference is the only possible match).Linked work
Fixes AB#640039
Ported from the internal NAV PR 249652 (originally microsoft/BusinessCentralApps#1912), as the internal NAV repo is closed for PRs.
How I validated this
What I tested and the outcome
New test
TestCustPaymentReferenceMatchadded to the bank payment application test codeunits (W1, CH, DK, IT) verifying that an open customer ledger entry is matched onPayment Referencewhen the document number is absent from the transaction text.Risk & compatibility
Low. The only behavioral change is that a previously-suppressed match path (payment reference) now fires when the bank rec line carries a
Payment Reference No.. Buffers with an empty payment reference are unaffected becauseDocumentMatchingearly-exits on an empty reference.