Skip to content

[ALAppExtensions #30229][Event Request] table 12113 "Tmp Withholding Contribution"#9418

Open
Explorer986 wants to merge 2 commits into
mainfrom
private/kumarjatin/641342
Open

[ALAppExtensions #30229][Event Request] table 12113 "Tmp Withholding Contribution"#9418
Explorer986 wants to merge 2 commits into
mainfrom
private/kumarjatin/641342

Conversation

@Explorer986

@Explorer986 Explorer986 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What & why

Adds OnCalculateWithholdingTaxOnBeforeAssignWithholdingTaxValues (an IsHandled event) to table 12113 "Tmp Withholding Contribution" and extracts the standard field assignments in CalculateWithholdingTax() into a new AssignWithholdingTaxValues local procedure (the reviewer-requested pattern, instead of wrapping an inline block). The negative-taxable-base check stays outside the handled block so it always runs, regardless of who computes the values.

Linked work

Fixes AB#641342

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Diff review: assignment logic moved verbatim into AssignWithholdingTaxValues; the IsHandled event precedes it; Error(NegativeTaxableBaseErr) remains after the guarded block. Default path is behavior-preserving.
  • No tests added: extract-method plus opt-in override; standard result and the negative-base validation are unchanged.

Risk & compatibility

Low. IsHandled guards the calculation only; the negative-base validation is intentionally kept outside it so it cannot be bypassed. No existing event signatures changed, no schema/data impact.

…culateWithholdingTaxOnBeforeAssignWithholdingTaxValues event (AB#641342, ALAppExtensions #30229)
@Explorer986 Explorer986 requested a review from a team July 14, 2026 10:30
@Explorer986 Explorer986 added the Finance GitHub request for Finance area label Jul 14, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 2 · Outcome: no-knowledge

All sub-skills returned no-knowledge or not-applicable; the self-review pass found no cross-cutting defect clearing the agent-finding precision bar.

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

No findings were posted for this iteration.

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

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

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept

What this PR does

This PR adds an IsHandled integration event in table 12113 "Tmp Withholding Contribution" before the withholding tax values are assigned in CalculateWithholdingTax(). It also moves the existing standard assignments into AssignWithholdingTaxValues().

The default path is behavior-preserving: WithholdCode and WithholdCodeLine are still loaded first, the same fields are assigned when IsHandled is false, the existing OnCalculateWithholdingTaxOnAfterAssignWithholdingTaxAmount event still runs after the assignment point, and the negative taxable-base validation still always runs. The new publisher uses [IntegrationEvent(false, false)], has a standard OnCalculateWithholdingTaxOnBefore... name, and passes both WithholdCodeLine and �ar Rec so subscribers can replace the calculation when needed.

Suggestions

No suggestions.

Risk assessment and necessity

Risk: The regression surface is small because the standard calculation path is the same unless an extension subscribes and sets IsHandled := true. The new event signature becomes public extension API, so it must be right before merge, but the parameters and timing match the requested customization point. No table schema, persisted data, posting flow, or existing event signature changes.

Necessity: The request is valid for an extensibility slice. The existing after-event only exposes the temporary withholding contribution record, so subscribers cannot use WithholdCodeLine at the point where the standard values are calculated. A test is not needed for this pure publisher addition and extract-method refactor because the default product behavior is unchanged.


[AI-PR-REVIEW] version=1 system=github pr=9418 round=1 by=alexei-dobriansky at=2026-07-14T11:06:24Z lastSha=39bf7278211a9a9fcc347f1b5c825e4ea8dd26db suggestions=none

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.

3 participants