Skip to content

[Event Request] codeunit 367 "CheckManagement": add OnFinancialVoidCh…#9421

Open
Explorer986 wants to merge 3 commits into
mainfrom
private/kumarjatin/640242
Open

[Event Request] codeunit 367 "CheckManagement": add OnFinancialVoidCh…#9421
Explorer986 wants to merge 3 commits into
mainfrom
private/kumarjatin/640242

Conversation

@Explorer986

@Explorer986 Explorer986 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What & why

Adds OnFinancialVoidCheckOnBeforePostBalanceAccount (an IsHandled event) to codeunit 367 "CheckManagement" so partners can replace the balance-account posting in FinancialVoidCheck — the exact extension point the requester needed but could not get from the too-early existing events. The large case CheckLedgEntry."Bal. Account Type" block was extracted verbatim into a new FinancialVoidPostBalanceAccount local procedure so the guard reads cleanly.

Linked work

Fixes AB#640242

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: the case body is moved unchanged into FinancialVoidPostBalanceAccount (with ConfirmFinancialVoid.GetVoidType()/GetVoidDate() passed in as VoidType/VoidDate params); default path (IsHandled := false) calls it, preserving behavior. AL language server reports no errors.

Risk & compatibility

Low-medium. Behavior is preserved when unsubscribed, but this is core financial-void posting, so it deserves the regression check above. The new IsHandled event lets a subscriber skip the standard bal.-account posting - document if the event is treated as public. No schema/data impact.

…eckOnBeforePostBalanceAccount IsHandled event; extract balance-account posting into FinancialVoidPostBalanceAccount (AB#640242, ALAppExtensions #30260)
@Explorer986 Explorer986 requested a review from a team July 14, 2026 11:02
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 14, 2026
Comment thread src/Layers/W1/BaseApp/Bank/Check/CheckManagement.Codeunit.al Outdated
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 3 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@809af9708e265f110ced6752fd8f2e40f1efc820

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
Other 1 1 0 0 0

Totals: 1 knowledge-backed · 0 agent findings.

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

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

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

…eAccount so handled posting flows back for the rounding calc (CI financial-correctness fix)
@Explorer986 Explorer986 added the Finance GitHub request for Finance area label Jul 14, 2026
Comment thread src/Layers/W1/BaseApp/Bank/Check/CheckManagement.Codeunit.al
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This PR adds OnFinancialVoidCheckOnBeforePostBalanceAccount in codeunit 367 so an extension can replace the standard balance-account posting during FinancialVoidCheck. It also moves the existing balance-account case block into FinancialVoidPostBalanceAccount, and the default path still calls that block when IsHandled stays false.

The event is in the right part of the flow: after the void bank line is posted and before the balance-account entries are posted. The standard path keeps updating BalanceAmountLCY, closing the bank ledger entry, posting rounding, marking the check entries void, and committing as before. The blocker is the handled path: a subscriber can skip the standard posting, but the event does not pass all context needed to safely do an equivalent replacement.

Suggestions

S1 - Pass posting context to handled subscribers
Add the current GenJnlPostLine instance and the selected void type/date to OnFinancialVoidCheckOnBeforePostBalanceAccount. A subscriber that sets IsHandled := true must be able to post replacement lines through the same posting instance and match the same unapply decision. Without that context, the later rounding, mark-void, and commit steps can run after an incomplete replacement.

Risk assessment and necessity

Risk: This is core financial void posting in W1, NA, APAC, and RU. The unsubscribed path looks behavior-preserving, including BalanceAmountLCY feeding the rounding calculation. The risk is for subscribers of the new IsHandled event: the standard balance-account posting and unapply block can be skipped, while the procedure still closes ledger state, posts rounding if needed, marks check entries void, commits, and updates analysis views.

Necessity: The event request is valid because the existing early event forces extensions to replace too much of FinancialVoidCheck. The scope is close to the right extension point, and missing tests are not by itself a blocker for this event request. The event still needs the missing posting context before it is safe as a replacement seam in this posting-adjacent flow.


[AI-PR-REVIEW] version=1 system=github pr=9421 round=1 by=alexei-dobriansky at=2026-07-14T17:02:29Z lastSha=acf90107064ab1e2e47b0e25a8060adcc9fe0641 suggestions=S1

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