Skip to content

[Master]-Dispute Status – Inconsistent On Hold and Document Synchronization on Vendor Ledger Entries. - #13228

Open
Fixes4BC (neeleshsinghal) wants to merge 6 commits into
mainfrom
bugs/Bug-656633-Dispute-Status-Inconsistent-On-Hold-on-Vendor-Ledger-Entries
Open

Fixes4BC (neeleshsinghal) wants to merge 6 commits into
mainfrom
bugs/Bug-656633-Dispute-Status-Inconsistent-On-Hold-on-Vendor-Ledger-Entries

Conversation

@neeleshsinghal

@neeleshsinghal Fixes4BC (neeleshsinghal) commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes AB#656633

@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Oct 25, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Oct 25, 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.

🔵 Needs a closer look

The interaction between vendor dispute validation and manually maintained holds during ledger edits needs functional confirmation before approval.

No open issues 🎉

What changed in this PR

This PR aligns dispute-status handling for vendor and customer ledger entries in Business Central, with regression coverage for hold changes and posted-invoice synchronization.

Changes:

  • Adds vendor validation to set or clear dispute-controlled holds.
  • Clears customer holds marked X when replacing or removing a status configured to overwrite holds.
  • Propagates changes across country layers and adds tests for vendor status assignment and vendor/customer status removal.
File Description
src/​Layers/​W1/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds hold and invoice-synchronization regression tests.
src/​Layers/​W1/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Clears holds when changing qualifying dispute statuses.
src/​Layers/​W1/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Adds dispute-driven hold validation.
src/​Layers/​RU/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds localized regression tests.
src/​Layers/​RU/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​RU/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​NO/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​NL/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds localized regression tests.
src/​Layers/​NL/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​NL/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​NA/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​NA/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​IT/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds regression tests and a sales-invoice helper.
src/​Layers/​IT/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​IT/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​IS/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​GB/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds localized regression tests.
src/​Layers/​GB/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​FR/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​FR/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​FI/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​FI/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​ES/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds regression tests and a sales-invoice helper.
src/​Layers/​ES/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​ES/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​CH/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​CH/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.
src/​Layers/​BE/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds localized regression tests.
src/​Layers/​APAC/​Tests/​ERM/​EditPostedDocuments.Codeunit.al Adds localized regression tests.
src/​Layers/​APAC/​BaseApp/​Sales/​Receivables/​CustLedgerEntry.Table.al Propagates customer hold clearing.
src/​Layers/​APAC/​BaseApp/​Purchases/​Payables/​VendorLedgerEntry.Table.al Propagates vendor hold validation.

Review effort: Balanced

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept with Suggestions

What this PR does

Adds dispute-status validation to vendor ledger entries and clears dispute-controlled holds when an overwrite status is removed or replaced on vendor and customer entries. The equivalent changes are applied across the affected regional files.

The conditions preserve manual hold codes other than X when clearing a dispute-controlled hold. Existing entry-edit codeunits persist the validated entry and synchronize its dispute status to the posted invoice. The new tests exercise vendor hold assignment and vendor/customer hold removal, with assertions on both the ledger entry and posted invoice.

Problem-solution fit

Fit: Strong

The changed validation directly addresses inconsistent hold assignment and removal. It also uses the existing posted-invoice synchronization paths rather than adding another document-update mechanism.

Suggestions

S1 (🟠 Moderate): Keep the warning for existing payment journals
Preserve the existing On Hold confirmation when the final vendor hold value changes. The direct assignments in VendorLedgerEntry.Table.al:742–747 skip its warning about an applied payment journal line. An invoice can therefore be marked disputed without warning that a payment is already prepared.

S2 (🟠 Moderate): Cover status switches and manual hold preservation
Add cases in EditPostedDocuments that switch between overwrite and non-overwrite statuses and preserve a manual hold code other than X when removing a dispute. The new tests only cover setting and clearing an overwrite status, leaving these new branches untested.

Risk assessment and necessity

Risk: Automatic hold changes affect payment selection and collection workflows. The main integration concern is the existing payment-journal confirmation noted above; public signatures and event contracts remain unchanged. Test bodies were reviewed, but no build or runtime tests were run.

Necessity: Without this change, an overwrite dispute status does not automatically hold a vendor entry, while removing one from a customer entry can leave the automatic hold behind. Users must maintain these holds manually, so the targeted correction is justified.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=13228 round=1 by=alexei-dobriansky at=2026-10-26T14:34:19.790Z lastSha=7fc80003b61d11ae30d5caf60245a55ff5ac2d08 reviewKey=56b7c14c97c6e703e02b7eb9802854c636b01c6cdca67e37c9baf75ba0b35cac suggestions=S1@871bc999,S2@c31058d3

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

…Bug-656633-Dispute-Status-Inconsistent-On-Hold-on-Vendor-Ledger-Entries
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 2

Recommendation: Accept with Suggestions

What this PR does

Updates dispute-controlled holds on vendor and customer ledger entries and uses the existing entry-edit codeunits to keep posted invoices synchronized.

Since round 1, vendor hold changes use On Hold validation only when the final value changes. This restores the warning for prepared payment journals without warning for a temporary clear-and-reset. New vendor tests cover both status-switch directions and preservation of a manual hold code. The hold calculations remain consistent, but the Spanish customer path adds a closed-entry restriction noted below.

Status of previous suggestions
ID Title Status Author response
S1 Keep the warning for existing payment journals Addressed Fixed in 5cfeead: final vendor hold changes call Validate("On Hold", NewOnHold), which reaches the existing payment-journal confirmation.
S2 Cover status switches and manual hold preservation Addressed Added in 5cfeead: both vendor status-switch directions and removal with a manual MAN hold are covered across the changed regional test codeunits.
New observations (commits since round 1)

S3 (🟠 Moderate): Preserve dispute edits on closed Spanish customer entries
Preserve dispute edits on closed Spanish customer entries. When the automatic hold changes, this call reaches TestField(Open, true) and rejects edits that previously worked. Handle closed entries explicitly and add a regression test.

Risk assessment and necessity

Risk: Automatic holds affect payment selection and customer collection. The final-value check preserves the existing journal warning and avoids unnecessary validation, but closed Spanish customer entries need the handling described above. Public signatures and event contracts are unchanged. Test bodies and callers were reviewed; no build or runtime tests were run.

Necessity: Without the fix, an overwrite dispute status can leave a vendor entry available for payment, and removing a customer dispute can leave an automatic hold behind. Users must adjust these holds manually, so the focused correction is justified.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=13228 round=2 by=alexei-dobriansky at=2026-10-30T14:14:26.874Z lastSha=5cfeead1607d9c034c2913aaed38e94a1d1dbbe3 reviewKey=71507cd2c661a27ff7702903347483bc10d855ac7f019368309df8c39a530162 suggestions=S1@871bc999:addressed,S2@c31058d3:addressed,S3@d747dbb5:new parentRound=1

…Bug-656633-Dispute-Status-Inconsistent-On-Hold-on-Vendor-Ledger-Entries
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 3

Recommendation: Accept

What this PR does

Manages dispute-controlled holds on vendor and customer ledger entries while retaining the existing posted-invoice synchronization paths. The hold calculation clears X only when leaving an overwrite status and preserves other manual hold codes. The new Spanish customer change assigns the final hold value on closed entries without calling the validation that requires Open, while open entries still reach the existing journal confirmation. Its regression test sets and removes an overwrite dispute through Cust. Entry-Edit on a closed entry. All three previous suggestions have positive fix evidence; no new finding is supported by the author-only new commit and net diff.

Status of previous suggestions
ID Title Status Author response
S1 Keep the warning for existing payment journals Addressed Every changed vendor table retains the final-value check followed by Validate("On Hold", NewOnHold). The pinned On Hold trigger compares against xRec, searches applied vendor journal lines, and requires confirmation, so the earlier fix remains present.
S2 Cover status switches and manual hold preservation Addressed All eight changed regional EditPostedDocuments codeunits retain both vendor status-switch tests and removal with a manual MAN hold. The tests call Vend. Entry-Edit, reread the entry, and assert the exact final hold and dispute values.
S3 Preserve dispute edits on closed Spanish customer entries Addressed Commit 2687de3 changes src/Layers/ES/BaseApp/Sales/Receivables/CustLedgerEntry.Table.al:1081-1085 to assign NewOnHold and call Validate("On Hold") only when Open. Its new SetDisputeStatusWithOverwriteOnHoldOnClosedCustLedgerEntry test at src/Layers/ES/Tests/ERM/EditPostedDocuments.Codeunit.al:950-983 sets and removes a dispute through Cust. Entry-Edit and asserts X followed by an empty hold; both changes are present in the net diff and the author-only new commit.
New observations (commits since round 2)

None - changes only addressed prior suggestions.

Risk assessment and necessity

Risk: Automatic holds affect payment selection and customer collection. Final vendor hold changes retain the payment-journal warning, and the Spanish customer path now preserves closed-entry dispute edits while retaining validation for open entries. All 31 frozen changed-file hunks were verified against the pinned head, and regional validation and test bodies were compared. Public signatures, event contracts, amounts, and posting calculations are unchanged.

Necessity: Without this correction, assigning an overwrite dispute can leave a vendor entry available for payment, and removing a dispute can leave an automatic hold behind. Users must adjust holds manually. The focused validation changes and regression coverage are justified.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=13228 round=3 by=alexei-dobriansky at=2026-10-31T08:18:23.9493809Z lastSha=2687de382f7c2ab534c4da9c595db02817627727 reviewKey=8a9f409d869857cfcc36b7fee88179ca92f52f8866af4d9e34c6e281beaa4327 suggestions=S1@871bc999:addressed,S2@c31058d3:addressed,S3@d747dbb5:addressed parentRound=2

This branch was previously deployed

1 inactive (outdated) deployment
triage — 7fc80003 Deployed Oct 29, 2026 by neeleshsinghal via Classify team ownership #9394
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants