Skip to content

[29.x]-[WHT] Inconsistency with the Payments - #10869

Open
ViditGupta1277 wants to merge 1 commit into
releases/29.xfrom
bugs/Bug-648516-WHT-Inconsistency-with-the-Payments
Open

[29.x]-[WHT] Inconsistency with the Payments#10869
ViditGupta1277 wants to merge 1 commit into
releases/29.xfrom
bugs/Bug-648516-WHT-Inconsistency-with-the-Payments

Conversation

@ViditGupta1277

@ViditGupta1277 ViditGupta1277 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#648516

@ViditGupta1277
ViditGupta1277 requested a review from a team September 1, 2026 05:39
@ViditGupta1277
ViditGupta1277 requested a review from a team as a code owner September 1, 2026 05:39
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Sep 1, 2026
@ViditGupta1277 ViditGupta1277 added this to the Version 29.1 milestone Sep 1, 2026
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 1, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

The change adds an explicit error when WHT payment posting cannot find a general journal template of type Purchases. The changed branch is the same branch where the WHT posting buffer is skipped today, so the payment still cannot complete and the missing WHT G/L posting is not created.

Problem-solution fit

Fit: Partial

The reported scenario is a partial vendor payment with gross-base WHT where posting should create the WHT entries and keep G/L in balance. The change prevents the silent buffer skip, but it does so by failing the posting instead of completing the expected payment and validating the WHT amounts.

Suggestions

S1 (🔴 High): Setup error replaces the payment fix
The reported payment should post and create the WHT G/L entry. This branch now raises a setup error when no Purchases template is found, so it still stops the payment instead of creating the missing posting buffer. Handle this case in the WHT posting-buffer path, or prove with a regression test that the setup is invalid.

S2 (🔴 High): Missing regression test for WHT payment posting
This is WHT payment posting, so the exact changed path needs a test. Add a partial vendor payment test with gross-base WHT that reaches this branch, and assert the payment posts, the WHT G/L entry exists, and the remaining/unrealized WHT amounts have the expected signs.

Risk assessment and necessity

Risk: The touched code is in WithholdingTaxMgmt.Codeunit.al inside vendor payment realization. A wrong change here can leave WHT entries and G/L posting out of sync, especially for partial payments and journal-template setups that do not match the assumed purchase template.

Necessity: A fix is required because the scenario affects payment posting and G/L balance. The scope should stay narrow, but it must complete the posting path rather than only replacing the balance error with a setup error.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=10869 round=1 by=alexei-dobriansky at=2026-09-01T07:16:24.7740354Z lastSha=ffd52e3ac4ba4cf2158f5e5def82de40941aa7c1 reviewKey=a8249558ebe81d2e63a662de491e763d8c653b619c20bfdf9eb3c899cca5848c suggestions=S1@2bf11594,S2@76a223a7

@github-actions

github-actions Bot commented Sep 5, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants