Skip to content

[Master]-Payment Reference from Purchase Order Prepayment Invoice is not Transferred to Vendor Ledger Entries. - #10061

Draft
neeleshsinghal wants to merge 2 commits into
mainfrom
bugs/Bug-646227-Payment-Reference-from-Purchase-Prepayment-Invoice-not-flow-VLE
Draft

[Master]-Payment Reference from Purchase Order Prepayment Invoice is not Transferred to Vendor Ledger Entries.#10061
neeleshsinghal wants to merge 2 commits into
mainfrom
bugs/Bug-646227-Payment-Reference-from-Purchase-Prepayment-Invoice-not-flow-VLE

Conversation

@neeleshsinghal

@neeleshsinghal neeleshsinghal commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#646227

@neeleshsinghal
neeleshsinghal requested a lite review from Copilot August 8, 2026 07:27
@github-actions github-actions Bot added the Finance GitHub request for Finance area label Aug 8, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures Payment Reference set on a Purchase Order is carried through prepayment invoice posting into the resulting Vendor Ledger Entry, aligning prepayment posting behavior with existing purchase posting behavior.

Changes:

  • Updated Gen. Journal Line.CopyFromPurchHeaderPrepmtPost() to populate "Payment Reference" from "Purchase Header" (with fallback to "Vendor Invoice No." when Purchases & Payables Setup."Copy Inv. No. To Pmt. Ref." is enabled).
  • Added new test PaymentReferenceTransferredToVLEOnPurchasePrepaymentInvoice() (W1 + APAC) to validate the end-to-end transfer into "Vendor Ledger Entry".

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Layers/W1/Tests/Prepayment/ERMPurchasePrepayments.Codeunit.al Adds a regression test verifying Payment Reference transfer on prepayment invoice posting.
src/Layers/APAC/Tests/Prepayment/ERMPurchasePrepayments.Codeunit.al Mirrors the new regression test for APAC layer.
src/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Copies Payment Reference during purchase prepayment posting journal line creation.
src/Layers/SE/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for SE layer.
src/Layers/RU/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for RU layer.
src/Layers/NO/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for NO layer.
src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for NL layer.
src/Layers/NA/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for NA layer.
src/Layers/IT/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for IT layer.
src/Layers/GB/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for GB layer.
src/Layers/FR/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for FR layer.
src/Layers/FI/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for FI layer.
src/Layers/ES/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Adds Payment Reference copy logic for ES layer (but currently drops Recipient Bank Account assignment; see comment).
src/Layers/DACH/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for DACH layer.
src/Layers/CH/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for CH layer.
src/Layers/BE/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for BE layer.
src/Layers/APAC/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al Same Payment Reference copy logic for APAC layer.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 7454 to +7458
"Payment Method Code" := PurchHeader."Payment Method Code";
"Recipient Bank Account" := PurchHeader."Vendor Bank Acc. Code";
if PurchHeader."Payment Reference" <> '' then
"Payment Reference" := PurchHeader."Payment Reference"
else begin
PurchasesPayablesSetup.Get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants