Skip to content

[Main] - Bug 640772: Expense Agent: If the accountant wants to change some simple things like dimensions or accounts to post to, the entire approval flow has to be redone - #14128

Open
v-rohangarg20 wants to merge 6 commits into
mainfrom
bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions
Open

v-rohangarg20 wants to merge 6 commits into
mainfrom
bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions

Conversation

@v-rohangarg20

@v-rohangarg20 v-rohangarg20 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

@v-rohangarg20
v-rohangarg20 requested a review from a team as a code owner November 16, 2026 11:40
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area labels Nov 16, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟠\ High\ Severity\ —\ Testing}$

FieldsCannotBeChangedWhenExpenseReportIsReleased contains three independent WHEN actions and assertions in one test. Split the field-change checks into focused tests so a failure identifies the specific behavior that broke.

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7

@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from 0a25cf6 to 2733a00 Compare November 16, 2026 12:30
@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch 2 times, most recently from d864f70 to b19e174 Compare November 16, 2026 13:25
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This change allows accounting corrections on submitted and approved expense reports without repeating approval. It adds change history, exposes that history on pages and APIs, and transfers it to the posted report.

Removing the Open-status checks addresses most of the reported workflow, and the new tests cover tracking, history lifecycle, and posting checks. However, the new codeunit conflicts with an existing country-app object, VAT corrections can leave posting inconsistent with the saved line, and posting can reject corrected reports using stale rule violations.

Problem-solution fit

Fit: Partial

Most requested accounting fields become editable and audited without changing report status. Payment Method Code remains locked and unaudited, and the newly enabled VAT correction paths need additional safeguards.

Suggestions

S1 (🔴 High): Choose a codeunit ID unused by country apps
The Austrian country app still declares this codeunit ID in default builds and depends on this app. Choose an unused ID, because pending obsoletion does not remove the conflicting declaration from default builds.

S2 (🔴 High): VAT liability corrections leave specification posting unchanged
Clearing VAT Liable on an approved report leaves its approved VAT specifications unchanged. Posting still uses those specifications and posts VAT despite the correction. Reconcile the specifications or prevent this inconsistent change.

S3 (🟠 Moderate): Payment method corrections still require report reopening
Allow and audit Payment Method Code edits after submission. The field and its reimbursement-type validation still require Open, so this requested correction still needs reopening and approval.

S4 (🟠 Moderate): Posting checks stale violations instead of current rules
Revalidate the line before checking its saved rule violations. Correcting merchant names on two lines can resolve a duplicate but leave an old violation on the other line. Posting then rejects a valid report.

Risk assessment and necessity

Risk: This changes approved financial data and the posting checks that protect it. The Austrian default build retains codeunit 6914, conflicting with the new change-log codeunit. VAT-specification posting can ignore a corrected VAT Liable flag; the same newly enabled validation path also commits a line and its history before vendor selection succeeds, so a failed correction can leave approved data changed. The new history lifecycle follows the existing activity-log pattern, and no new BaseApp event dependency was found. This was a pinned-source review; no build or BC tests were run.

Necessity: Routine accounting corrections should not require reopening reports and repeating approval. Without this change, that remains the workaround; allowing these edits and keeping durable history is justified, but financial consistency and country-app compatibility must be preserved.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14128 round=1 by=alexei-dobriansky at=2026-11-16T14:34:02Z lastSha=b19e174bbe857007df53f341614290d33a041603 reviewKey=4eb1991be1ac60f079f301e53bca843fdd5330c380efbe281e24a96a7dd17549 suggestions=S1@7458325d,S2@96b8c468,S3@f4a6955f,S4@469a383e

@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from b19e174 to 300d5ca Compare November 17, 2026 04:07
@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from 300d5ca to 8c54124 Compare November 17, 2026 04:35
@v-rohangarg20

Copy link
Copy Markdown
Contributor Author

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does
This change allows accounting corrections on submitted and approved expense reports without repeating approval. It adds change history, exposes that history on pages and APIs, and transfers it to the posted report.

Removing the Open-status checks addresses most of the reported workflow, and the new tests cover tracking, history lifecycle, and posting checks. However, the new codeunit conflicts with an existing country-app object, VAT corrections can leave posting inconsistent with the saved line, and posting can reject corrected reports using stale rule violations.

Problem-solution fit
Fit: Partial

Most requested accounting fields become editable and audited without changing report status. Payment Method Code remains locked and unaudited, and the newly enabled VAT correction paths need additional safeguards.

Suggestions
S1 (🔴 High): Choose a codeunit ID unused by country apps The Austrian country app still declares this codeunit ID in default builds and depends on this app. Choose an unused ID, because pending obsoletion does not remove the conflicting declaration from default builds.

S2 (🔴 High): VAT liability corrections leave specification posting unchanged Clearing VAT Liable on an approved report leaves its approved VAT specifications unchanged. Posting still uses those specifications and posts VAT despite the correction. Reconcile the specifications or prevent this inconsistent change.

S3 (🟠 Moderate): Payment method corrections still require report reopening Allow and audit Payment Method Code edits after submission. The field and its reimbursement-type validation still require Open, so this requested correction still needs reopening and approval.

S4 (🟠 Moderate): Posting checks stale violations instead of current rules Revalidate the line before checking its saved rule violations. Correcting merchant names on two lines can resolve a duplicate but leave an old violation on the other line. Posting then rejects a valid report.

Risk assessment and necessity
Risk: This changes approved financial data and the posting checks that protect it. The Austrian default build retains codeunit 6914, conflicting with the new change-log codeunit. VAT-specification posting can ignore a corrected VAT Liable flag; the same newly enabled validation path also commits a line and its history before vendor selection succeeds, so a failed correction can leave approved data changed. The new history lifecycle follows the existing activity-log pattern, and no new BaseApp event dependency was found. This was a pinned-source review; no build or BC tests were run.

Necessity: Routine accounting corrections should not require reopening reports and repeating approval. Without this change, that remains the workaround; allowing these edits and keeping durable history is justified, but financial consistency and country-app compatibility must be preserved.

[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14128 round=1 by=alexei-dobriansky at=2026-11-16T14:34:02Z lastSha=b19e174bbe857007df53f341614290d33a041603 reviewKey=4eb1991be1ac60f079f301e53bca843fdd5330c380efbe281e24a96a7dd17549 suggestions=S1@7458325d,S2@96b8c468,S3@f4a6955f,S4@469a383e

“S1 – Fixed”

S2 – Known limitation: VAT Liable
VAT Liable is included in change history; other VAT-related fields are outside scope. This change does not reconcile existing VAT specifications when VAT Liable is changed after submission. The inconsistency identified in this finding remains unaddressed in this PR.

S3 – By Design: Payment Method Code

Payment Method Code is intentionally excluded from change tracking and post-submission corrections because it is subject to reimbursement-type validation rules. These rules must remain enforced to prevent changes that could violate existing business logic.

S4 – By design, with a known limitation: Rule validation
Posting intentionally checks saved rule violations without rerunning rule validation. Revalidation could introduce violations based on conditions that changed after approval. Consequently, stale violations may still block posting after related corrections. Resolving that scenario without reevaluating approved reports is outside this PR’s scope.

@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from 61abd59 to d013357 Compare November 17, 2026 08:35
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 2

Recommendation: Request Changes

What this PR does

This change allows accounting corrections on submitted and approved expense reports without repeating approval. It records field changes, exposes history on pages and APIs, and transfers that history to the posted report.

The follow-up renumbers the change-log codeunit, but the replacement ID also conflicts with a dependent country app. The VAT-specification inconsistency remains, and the newly enabled VAT correction path can commit approved data before validation succeeds. Most requested corrections are supported, but payment-method corrections remain excluded.

Status of previous suggestions
ID Title Status Author response
S1 Choose a codeunit ID unused by country apps Not addressed Renumbered to 6915, but that ID is also used in a dependent country app.
S2 VAT liability corrections leave specification posting unchanged Disputed Accepted as a known limitation; VAT specifications are not reconciled.
S3 Payment method corrections still require report reopening Disputed Intentionally excluded to preserve reimbursement-type rules.
S4 Posting checks stale violations instead of current rules Disputed Saved violations are retained to avoid re-evaluating changed setup.

S1 (🔴 High): Choose a codeunit ID unused by country apps
Codeunit 6915 is already declared in the Australian country app, which depends on this app. Choose an unused ID; pending obsoletion does not remove the conflicting declaration from default builds.

S2 (🔴 High): VAT liability corrections leave specification posting unchanged
Reconcile existing VAT specifications when VAT Liable changes, or prevent an inconsistent change. Clearing it on an approved report currently leaves approved specifications intact, and specification-based posting still creates VAT entries.

S4 (🟠 Moderate): Posting checks stale violations instead of current rules
Refresh saved duplicate violations on all affected lines after merchant corrections. Posting still rejects corrected reports when a violation saved on another line is no longer true.

S3 (🟠 Moderate): Payment method corrections still require report reopening
Support and audit valid Payment Method Code corrections while retaining reimbursement-type safeguards. The current status checks still reject this requested post-submission correction.

New observations (commits since round 1)

S5 (🔴 High): Failed VAT corrections still change approved reports
Validate the selected vendor before saving a VAT liability correction. If the vendor dialog closes without a vendor, the earlier Modify and Commit leave VAT Liable and its history saved even though validation fails.

Risk assessment and necessity

Risk: This changes approved financial data and posting safeguards. Codeunit 6915 conflicts with the Australian dependent app; VAT posting can ignore the corrected flag, and failed vendor selection can leave a correction committed before amount recalculation. History reassignment and deletion follow the existing activity-log pattern, and no new BaseApp publisher dependency was found. The tests cover history and posting guards but do not establish correctness for these VAT paths. This was a pinned-source review; no build, compilation, or BC tests were run.

Necessity: Routine accounting corrections should not require reopening reports and repeating approval. Without this change, that remains the workaround. Allowing these corrections with durable history is justified, but deployment compatibility and financial consistency must be preserved.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14128 round=2 by=alexei-dobriansky at=2026-11-17T14:33:05Z lastSha=d013357f22c7bb399eb1c85aa6c3ca43ebb8eb9d reviewKey=81cba567ab9f09fa126001e09296b5b22dcc75430e56b4a17b691f635f536667 suggestions=S1@7458325d:notaddressed,S2@96b8c468:disputed,S5@fb05994b:new,S4@469a383e:disputed,S3@f4a6955f:disputed parentRound=1

@github-actions

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.

@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from d013357 to 550a1f5 Compare November 23, 2026 04:04
…tory

Accountants can change dimensions and accounting fields (accounts, billing,
purchase invoice, merchant, project, and VAT) on submitted expense reports
without reopening them. Each change is logged with the old value, the new
value, and the user who made it.

- Add the Exp. Report Change Log Entry table, Change History page, and
  Change History actions on the expense report, manager, posted report,
  and line subforms.
- Move change history to the posted expense report on posting and delete
  it with the report or line.
- Re-check mandatory accounting fields and rule violations on posting.
- Expose change history through the expense report and posted expense
  report APIs.
- Classify the new table for privacy and add permissions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from 550a1f5 to e41d051 Compare November 23, 2026 04:31
…tory

Accountants can change dimensions and accounting fields (accounts, billing,
purchase invoice, merchant, project, and VAT) on submitted expense reports
without reopening them. Each change is logged with the old value, the new
value, and the user who made it.

- Add the Exp. Report Change Log Entry table, Change History page, and
  Change History actions on the expense report, manager, posted report,
  and line subforms.
- Move change history to the posted expense report on posting and delete
  it with the report or line.
- Re-check mandatory accounting fields and rule violations on posting.
- Expose change history through the expense report and posted expense
  report APIs.
- Classify the new table for privacy and add permissions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@v-rohangarg20
v-rohangarg20 force-pushed the bugs/Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions branch from e41d051 to bbcfb64 Compare November 23, 2026 04:46
@v-rohangarg20
v-rohangarg20 requested a review from a team as a code owner November 23, 2026 04:46
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 3

Recommendation: Request Changes

What this PR does

Allows most accounting corrections without repeating expense-report approval and adds durable field history, page/API access, and posting checks.

The rewritten change moves the manager to codeunit 6916, but that ID still conflicts with a dependent country app. VAT specifications can ignore a corrected liability flag, and failed vendor selection can leave the correction committed. The other previously disputed gaps remain, and account corrections can overwrite approved descriptions without history.

Problem-solution fit

Fit: Partial

Most accounting corrections retain approval and gain history, but valid payment-method corrections remain excluded and approved VAT corrections remain unsafe.

Status of previous suggestions
ID Title Status Current evidence
S1 Choose a codeunit ID unused by country apps Not addressed The new 6916 ID also belongs to the matching Canadian dependent app; Default builds retain that declaration.
S2 VAT liability corrections leave specification posting unchanged Disputed Unreconciled specifications are acknowledged as a limitation, but they still post VAT after the parent flag is cleared.
S5 Failed VAT corrections still change approved reports Not addressed Modify and Commit still precede vendor selection and validation, leaving the flag/history saved if selection fails.
S4 Posting checks stale violations instead of current rules Disputed Keeping saved violations avoids broad rule reevaluation, but stale cross-line duplicate violations still reject corrected reports.
S3 Payment method corrections still require report reopening Disputed The exclusion preserves reimbursement safeguards, but still blocks and omits history for valid same-type method corrections.

S1 (🔴 High): Choose a codeunit ID unused by country apps
Choose an ID that is unused in dependent country apps. Codeunit 6916 is still declared in the Canadian Expense Agent app, which depends on this app. Pending obsoletion does not remove that declaration from default builds.

S2 (🔴 High): VAT liability corrections leave specification posting unchanged
Reconcile existing VAT specifications when VAT Liable changes, or prevent an inconsistent correction. Clearing it on an approved report still leaves approved specifications that create VAT entries during posting.

S5 (🔴 High): Failed VAT corrections still change approved reports
Validate the selected vendor before saving an approved VAT correction. Closing the billing dialog without a vendor raises an error after the VAT flag and its history have committed, leaving an incomplete correction saved.

S4 (🟠 Moderate): Posting checks stale violations instead of current rules
Refresh saved duplicate violations on all affected lines after merchant corrections. A correction can remove a duplicate while another line keeps its old violation, so posting still rejects a now-valid report.

S3 (🟠 Moderate): Payment method corrections still require report reopening
Allow and audit valid Payment Method Code corrections after submission while retaining reimbursement safeguards. The current Open-status checks still force this requested correction through reopening and approval.

New observations (commits since round 2)

S6 (🟠 Moderate): Preserve approved descriptions during account corrections
Keep approved expense descriptions when correcting an account, or record their old and new values. G/L account validation replaces the description with the account name, but the change history does not retain that replacement.

Risk assessment and necessity

Risk: Codeunit 6916 remains declared in the Canadian dependency in Default builds; pending obsoletion does not remove it. The two VAT paths can produce wrong posting or persist a failed correction. Tests cover history and posting guards but bypass those validation paths. No new BaseApp publisher dependency or production signature change is introduced.

Necessity: Routine corrections should not require another approval. Keeping approval and history is justified, but known limitations do not make incorrect VAT posting or committed failed corrections safe.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14128 round=3 by=alexei-dobriansky at=2026-11-23T08:36:14.8387642Z lastSha=bbcfb640a368a3edd7ae46ebbbfab84b64519725 reviewKey=287d49baf1c6ac66135afc0c63c436106ff5a7e23cb75536ba6fc34a26527faa suggestions=S1@7458325d:notaddressed,S2@96b8c468:disputed,S5@fb05994b:notaddressed,S4@469a383e:disputed,S3@f4a6955f:disputed,S6@874fd151:new parentRound=2

Rodney (rodneyha) pushed a commit to rodneyha/Microsoft-BCApps that referenced this pull request Nov 23, 2026
…ry apps (microsoft#14405)

## What & why

Renumbers three Expense Agent codeunits whose IDs collide with the
deprecated `Expense Agent (<country>)` apps, and documents the reserved
IDs in the Expense Agent README.

| Codeunit | Old | New | Collides with deprecated app |
|---|---|---|---|
| Expense Agent Quota Impl. | 6913 | 6923 | Expense Agent (Preview)
(US), `fa126935-93d3-4e4e-a006-4f7406625d2e` |
| Travel Req. Linked Reports | 6914 | 6924 | Expense Agent (Preview)
(AT), `c60a4c19-38b7-4d2b-96bb-edfcea98cf1f` |
| No Receipt Declaration Mgt. | 6915 | 6925 | Expense Agent (Preview)
(AU), `646b8424-68af-4eb3-b325-97f695cdb19f` |

Each deprecated country app in
`src/Apps/<country>/ExpenseAgent_<country>` declares one codeunit in the
Expense Agent ID range (6913-6921, 6977). Those apps are no longer
built, so the compiler cannot detect a clash, but they are still
installed on many tenants. Reusing their IDs makes installs, upgrades
and app hotfixes fail with:

```
The application object of type 'CodeUnit' with the ID '6913' is defined in multiple apps. The apps are: Expense Agent (Preview) by Microsoft 29.0.54011.58216; Expense Agent (Preview) (US) by Microsoft 29.0.54011.54125.
```

This is happening in production now: the 29.0/29.1 Expense Agent app
hotfix fails for ~8,000 US environments (8,042 of 8,048 from
29.0.54011.57244 to 29.0.54011.58216). The ManagementService removal of
legacy country apps (Bug 658936) only runs on full upgrades, not app
hotfixes.

The README note lists the reserved codeunit IDs for reviewers and coding
agents. Excluding them from `idRanges` is not possible: the range
applies to all object types and 30 existing tables, pages and enums use
these IDs (AL0297).

Backports:
- releases/29.0: microsoft#14406 (6913)
- releases/29.1: microsoft#14407 (6913,
6914)
- releases/29.x: microsoft#14408 (6913,
6914)

## Linked work

Fixes
[AB#660284](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/660284),
[AB#660285](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/660285),
[AB#660279](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/660279)
Related
[AB#660280](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/660280)

## How I validated this

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

**What I tested and the outcome**

- Compiled the Expense Agent app and the Expense Agent test app on this
branch against local W1 symbols: no errors.
- Pre-checks on main, 29.x, 29.1 and 29.0: 6923-6925 are unused (app,
demo data, test); no numeric references to 6913-6915 (`Codeunit::<id>`,
`Codeunit.Run(<id>)`, `Object ID to Run`). All three codeunits are
`Access = Internal` and referenced by name only, so no other code
changes and no upgrade code are needed.
- Local repro on a W1 server (main): with Expense Agent declaring
6913-6915, `Install-NAVApp` of the legacy US, AT and AU apps fails with
the duplicate-object error above. After force-upgrading to an Expense
Agent build with the three codeunits renumbered, all three legacy apps
install side by side with Expense Agent.
- Independent scan of all 20 legacy apps (agent + demo data) against the
W1 Expense Agent apps on 29.0, 29.1, 29.x and main: these three are the
only collisions (by type+ID and type+name).
- No new tests: an object ID change does not change behavior, and
existing tests reference the codeunits by name.

## Risk & compatibility

Low. Codeunits have no data; the upgrade moves them to the new IDs
within the same app. Telemetry or queries filtering on these object IDs
need updating. Open PRs microsoft#13244, microsoft#13875 (codeunit 6914) and microsoft#14128,
microsoft#14190 (codeunit 6915) also use reserved IDs and need new IDs before
merge.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cfee079b-1385-4f90-ad44-940fefe25116
v-rohangarg20 and others added 2 commits November 23, 2026 19:43
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 4

Recommendation: Request Changes

What this PR does

Allows accounting corrections after submission without repeating approval, records field history, and transfers that history to the posted report.

The update resolves a test-codeunit overlap by using ID 148370 and extending the test manifest range. The change-log manager and expense-line production code are unchanged from the previous round. The country-app codeunit collision and both VAT blockers therefore remain; unrelated changes merged from the base branch are not new findings.

Problem-solution fit

Fit: Partial

Most accounting corrections retain approval and gain history. VAT corrections remain inconsistent or non-atomic, and valid payment-method corrections still require reopening.

Status of previous suggestions
ID Title Status Current evidence
S1 Choose a codeunit ID unused by country apps Not addressed The production manager still uses 6916, also declared in the Canadian dependent app in Default builds. The test-ID fix does not resolve this collision.
S2 VAT liability corrections leave specification posting unchanged Disputed Specifications remain unreconciled by design. Clearing the parent flag still leaves approved specifications that post VAT.
S5 Failed VAT corrections still change approved reports Not addressed Modify and Commit still save the flag and history before vendor selection and validation succeed.
S4 Posting checks stale violations instead of current rules Disputed Avoiding full rule reevaluation does not refresh a stale duplicate violation on another affected line.
S3 Payment method corrections still require report reopening Disputed Reimbursement safeguards explain the exclusion, but same-type method corrections remain locked and unaudited.
S6 Preserve approved descriptions during account corrections Not addressed G/L account validation still replaces the description, and history still omits its old and new values.

S1 (🔴 High): Choose an ID unused by country apps
Give this codeunit an ID not used by dependent country apps. Codeunit 6916 is still declared in the Canadian app, so the two objects collide in Default builds.

S2 (🔴 High): Reconcile specifications before allowing VAT liability corrections
Reconcile VAT specifications when VAT Liable changes, or block the correction until they are reconciled. Clearing the flag still leaves approved specifications that post reclaim VAT.

S5 (🔴 High): Failed VAT corrections still change approved reports
Collect and validate the vendor before saving the VAT liability correction and its history. The current Commit saves both on a submitted report even when the vendor dialog is cancelled or the following vendor check fails.

S4 (🟠 Moderate): Refresh affected duplicate checks after merchant corrections
Refresh affected duplicate checks when a merchant is corrected, without rerunning approval. Otherwise a saved violation on another line can still block posting after the duplicate is gone.

S3 (🟠 Moderate): Payment method corrections still require report reopening
Allow and log payment method corrections that keep the reimbursement type unchanged. These safe corrections still require reopening the report, although they are part of the requested accounting corrections.

S6 (🟠 Moderate): Preserve approved descriptions during account corrections
Keep the approved description when correcting the billing account, or log its replacement. G/L account validation overwrites the description with the account name, but the change history does not retain the old description.

New observations (commits since round 3)

None. The test-ID correction introduces no new finding; all six previous suggestions remain open.

Risk assessment and necessity

Risk: The retained country codeunit declaration prevents compatible Default builds. VAT specifications can post VAT despite a cleared liability flag, and vendor-selection failure can leave a submitted correction committed. The history tests cover successful corrections and posting guards, but not those VAT failure paths. Independent pinned-source checks verified the relevant BaseApp VAT posting and privacy publisher; no missing publisher dependency was found. No build or runtime tests were run.

Necessity: Routine accounting corrections should not require reopening and repeating approval. Durable history is justified, but the test-ID correction does not make the remaining production blockers safe.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14128 round=4 by=alexei-dobriansky at=2026-11-23T20:32:19Z lastSha=960894b7c512f82ac1540263ba3f16a36ce25589 reviewKey=716d6fa1a361d4dff49b2f5d74ae7f24447e1583e6cc78aedfb1cdad54dc776f suggestions=S1@7458325d:notaddressed,S2@96b8c468:disputed,S5@fb05994b:notaddressed,S4@469a383e:disputed,S3@f4a6955f:disputed,S6@874fd151:notaddressed parentRound=3

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 5

Recommendation: Request Changes

What this PR does

Allows accounting corrections after submission without repeating approval, records field history, and transfers that history to the posted report.

The new change renumbers the internal change-log manager from 6916 to 6927, removing its conflict with the Canadian dependent app. It does not change VAT correction or posting behavior. Approved specifications can still reclaim VAT after the parent liability flag is cleared, and a failed vendor-selection path still commits the flag and history before the correction succeeds.

Problem-solution fit

Fit: Partial

The country-app collision is fixed and most accounting corrections gain history without losing approval. VAT consistency and atomic validation remain unresolved; the other retained findings concern audit completeness and bounded workflow gaps.

Status of previous suggestions
ID Title Status Current evidence
S1 Choose a codeunit ID unused by country apps Addressed The manager now uses 6927, within its declared range and unused by the other checked dependent expense codeunits; the Canadian app retains 6916.
S2 VAT liability corrections leave specification posting unchanged Disputed Specification authority does not make the correction consistent: parent VAT becomes zero, while an approved base 100/VAT 20 specification still posts VAT 20 on a gross 120 expense.
S5 Failed VAT corrections still change approved reports Not addressed Modify and Commit still save the flag and history before vendor selection succeeds; a following error leaves the correction saved without recalculation.
S4 Posting checks stale violations instead of current rules Disputed Avoiding full rule reevaluation does not refresh another line's saved duplicate violation after the duplicate is removed.
S3 Payment method corrections still require report reopening Disputed Two current master codes cannot share a nonblank type. However, validated master reconfiguration can leave a submitted line needing a new code with its original stored type, and that bounded correction remains blocked and unlogged.
S6 Preserve approved descriptions during account corrections Not addressed G/L account validation still replaces Description, but the history omits that side effect.

S2 (🔴 High): Reconcile specifications before allowing VAT liability corrections
Reconcile VAT specifications when VAT Liable changes, or block the correction until they agree. Clearing the flag still leaves approved specifications that post reclaim VAT.

S5 (🔴 High): Validate the vendor before committing liability changes
Collect and validate the vendor before saving the VAT liability correction and its history. Closing the billing dialog without a vendor leaves the correction committed even though validation then fails.

S3 (🟠 Moderate): Allow and log type-preserving payment method corrections
Allow and log a payment-method correction when the target method preserves the line's stored reimbursement type. After validated master reconfiguration, a submitted line can retain Employee Paid under an old code while a new code becomes the unique Employee Paid method. Correcting that code still requires reopening, even though reimbursement does not change.

S4 (🟠 Moderate): Refresh affected duplicate checks after merchant corrections
Refresh duplicate checks on affected lines when a merchant is corrected, without rerunning approval. Otherwise a saved violation on another line can still block posting after the duplicate is gone.

S6 (🟠 Moderate): Preserve approved descriptions during billing account corrections
Keep the approved description when correcting the billing account, or log its replacement. G/L account validation overwrites it with the account name, but the change history does not retain the old description.

New observations (commits since round 4)

None. The only new production span is the codeunit renumbering, which fixes S1. The other observations are retained findings, not new issues attributed to merged base changes.

Risk assessment and necessity

Risk: The dependent-app object collision is removed. The two remaining High findings concern wrong VAT posting and a correction that survives failed validation. Parent amount recalculation does not reconcile specifications, and history insertion occurs before the vendor-dialog Commit. Existing history tests bypass those validation paths; the Moderate workflow and history findings are not the reason for the blocking recommendation.

Necessity: Routine accounting corrections should not repeat submission and approval. Preserving approval with an audit history is appropriate, provided the financial state and failed-correction transaction remain consistent.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14128 round=5 by=alexei-dobriansky at=2026-11-24T08:34:26.2821885Z lastSha=5ff3891fecbd0f57308c42e73e9dedf088325d62 reviewKey=d1830ffb149fa7dc6bc0f23ed280b6086ba19fdf81e3c55c3ed320d4749685d8 suggestions=S1@7458325d:addressed,S2@96b8c468:disputed,S5@fb05994b:notaddressed,S4@469a383e:disputed,S3@f4a6955f:disputed,S6@874fd151:notaddressed parentRound=4

@github-actions

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.

…Bug-640772-accountant-wants-to-change-some-simple-things-like-dimensions

This branch was successfully deployed

1 active (outdated) deployment
triage — 5ff3891f Deployed Nov 29, 2026 by v-rohangarg20 via Classify team ownership #12332
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