[G/L VAT Reconciliation] Make report 11 runnable in background and make commit calls as it backfills G/L Account No.#8927
Open
dcenic wants to merge 3 commits into
Open
[G/L VAT Reconciliation] Make report 11 runnable in background and make commit calls as it backfills G/L Account No.#8927dcenic wants to merge 3 commits into
dcenic wants to merge 3 commits into
Conversation
…ke it commit as it updates VAT Entries AB#640489
Contributor
|
Issue #640489 is not valid. Please make sure you link an issue that exists, is open and is approved. |
| [Test] | ||
| procedure SetGLAccountNoEventPreApprovalSkipsConfirm() | ||
| var | ||
| VATEntry: Record 254; |
Contributor
There was a problem hiding this comment.
The variable declaration 'VATEntry: Record 254' references table 254 by numeric ID instead of by name.
Per the referenced guidance, numeric IDs are fragile across renumbering and unreadable in diffs and stack traces. Use 'VATEntry: Record "VAT Entry"' instead.
Suggested change
| VATEntry: Record 254; | |
| VATEntry: Record "VAT Entry"; |
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Contributor
Copilot PR ReviewIteration 2 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Sub-skills skipped
Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
…ke it commit as it updates VAT Entries
…ke it commit as it updates VAT Entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AB#640489
Report 11 "G/L - VAT Reconciliation" backfills the G/L Acc. No. field on VAT Entries (resolving it from the G/L Entry - VAT Entry Link table) before it can reconcile VAT amounts against the general ledger. This PR fixes two defects in that backfill so the report can run unattended and resume after a timeout.
What & why
Problem
Could not run in the background. The backfill is gated by a confirm ("Do you want to fill the G/L Account No. field…"). The gate keyed off the WithUI flag rather than whether a UI actually exists, so in a background / job-queue session ConfirmManagement.GetResponseOrDefault returned its false default, the fill was skipped, and the report then hard-errored in CheckGLAccountNoFilled because in-scope entries were still blank. The OnBeforeSetGLAccountNo event meant to let callers pre-approve the fill was ineffective, because the confirm overwrote whatever Response a subscriber had set.
Progress was not persisted. The fill updates VAT Entries in batches of ~100 via ModifyAll, but never committed between batches. On large datasets a timed-out run lost all progress and restarted from scratch, never completing.
Fix
All changes are in VATEntry.Table.al, propagated to W1 and the 11 country copies (APAC, BE, CH, DACH, ES, FI, FR, IT, NA, NL, NO, RU) because the method is overridden per localization and the report runs against whichever localized "VAT Entry" table is deployed.
Background-safe confirm — only prompt when a GUI is present; in a background session proceed automatically. Also stop the confirm from clobbering an already-approved Response, so OnBeforeSetGLAccountNo can genuinely pre-approve:
Commit per batch — Commit() after each batch's ModifyAll, so a timed-out run resumes from where it left off. Because each batch re-applies the "G/L Acc. No." = '' filter, a re-run only processes the still-unfilled entries.
The change is safe to apply unconditionally: the fill is additive and idempotent (it only populates a blank G/L Acc. No. on entries that already have a G/L link), so committing partial progress can never produce an inconsistent state. The shared VAT Entries page action (SetGLAccountNo(false)) is unaffected by the confirm change and simply benefits from the same per-batch commit.
Linked work
Fixes AB#640489
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Added SetGLAccountNoEventPreApprovalSkipsConfirm plus a manually-bound subscriber codeunit (GL VAT Recon. Adjust Subs.) that pre-approves via OnBeforeSetGLAccountNo. The test runs with no ConfirmHandler and verifies the entries are filled without a confirm being raised — which only passes because of the and not Response change; the pre-fix code would raise Confirm and fail on the unhandled dialog. Manual binding scopes the subscriber to this one test so the existing confirm-handler tests are unaffected.
Risk & compatibility