Skip to content

[Master]-]Withholding Tax Entries are not generated at payment because the Withholding Tax. Prod. Posting Group field gets not transferred to the payment line#9479

Open
neeleshsinghal wants to merge 7 commits into
mainfrom
bugs/Bug-639524-WHT-Prod-Posting-Group-not-transferred-to-payment1
Open

[Master]-]Withholding Tax Entries are not generated at payment because the Withholding Tax. Prod. Posting Group field gets not transferred to the payment line#9479
neeleshsinghal wants to merge 7 commits into
mainfrom
bugs/Bug-639524-WHT-Prod-Posting-Group-not-transferred-to-payment1

Conversation

@neeleshsinghal

@neeleshsinghal neeleshsinghal commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@neeleshsinghal neeleshsinghal requested a review from a team July 15, 2026 11:21
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 15, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 15, 2026
@microsoft microsoft deleted a comment from github-actions Bot Jul 15, 2026
[Test]
[Scope('OnPrem')]
[HandlerFunctions('ConfirmHandler')]
procedure WHTProdPostGroupTravelsFromJournalLine()

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.

$\textbf{🟡\ Medium\ Severity\ —\ Testing} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

WHTProdPostGroupTravelsFromJournalLine is titled/commented as verifying that 'Withholding Tax Prod.

Post. Group travels from the applied invoice to the payment line' via the new AssignWHTPostingGroupOnCreatePayment subscriber (which only fires from the Create Payment page's OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment event). The test only creates and posts an Invoice and then asserts that the Withholding Tax Entry generated for that Invoice has the expected posting group -- it never creates a payment, never applies one to the invoice via 'Applies-to ID', and never drives the Create Payment page (or the buffer/event it publishes). The GenJournalLine array is declared as array[2] but only element [1] is ever used, which is consistent with the payment leg being missing. As written, the test would pass even if AssignWHTPostingGroupOnCreatePayment were deleted or broken, so the new production behavior in WithholdingTaxJnlSubscriber.Codeunit.al ships without regression coverage. If this impact would otherwise be judged major (an entirely untested new code path), note it here rather than escalate severity: recommend extending the test to actually apply/post a payment line (or otherwise trigger OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment with a populated TempVendorPaymentBuffer) and assert the resulting Gen. Journal Line's 'Wthldg. Tax Prod. Post. Group'.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 2 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Testing 1 0 1 1 0

Totals: 0 knowledge-backed · 1 agent findings.

Orchestrator pre-filter (2 file(s) excluded)

  • layer-disabled (knowledge) : 2 file(s)

Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives.



[EventSubscriber(ObjectType::Page, Page::"Create Payment", OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment, '', false, false)]
local procedure AssignWHTPostingGroupOnCreatePayment(var GenJournalLine: Record "Gen. Journal Line"; TempVendorPaymentBuffer: Record "Vendor Payment Buffer" temporary)

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.

$\textbf{🟡\ Medium\ Severity\ —\ Testing} \quad \color{gray}{\texttt{\small Iteration\ 2}}$

The new event subscriber AssignWHTPostingGroupOnCreatePayment (WithholdingTaxJnlSubscriber.Codeunit.al) copies 'Wthldg.

Tax Prod. Post. Group' from the Withholding Tax Entry onto the Gen. Journal Line when a payment is created via the 'Create Payment' page. This is new production logic that changes financial posting data. The single test added in this PR (WithholdingTaxProductPostingGroupIsCopiedToWithholdingTaxEntry) only exercises direct invoice posting and asserts that the group is copied onto the Withholding Tax Entry - a pre-existing code path unrelated to the new subscriber. None of the existing 'Create Payment' related tests invoke the page's OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment event (they post payments directly through Gen. Journal Line, bypassing the page). As a result, the new subscriber's behavior - including its guard clauses (Applies-to ID blank, Vendor Ledg. Entry No. = 0, no matching Withholding Tax Entry) and the successful copy path - has no test coverage. Recommend adding a test that drives the 'Create Payment' page (or otherwise raises OnBeforeUpdateGnlJnlLineDimensionsFromVendorPayment) to verify the Gen. Journal Line's WHT Product Posting Group is populated correctly before posting.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant