[main] bug 640523 - Bonus depreciation functionality in CZ#9568
[main] bug 640523 - Bonus depreciation functionality in CZ#9568DavidHolusa wants to merge 2 commits into
Conversation
Copilot PR ReviewIteration 2 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 1 agent findings. Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives. |
…preciationCZF.Report.al Fill in the VAT Reporting Date Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
InsertBonusDepreciationFAJnlLine and InsertBonusDepreciationGenJnlLine gate the new bonus-depreciation feature on FASetup.BonusDepreciationCorrectlySetupCZF(), but FASetup is only populated by FASetup.Get() inside the request page's OnOpenPage trigger, and only when DeprBookCode is still blank at that point ('if DeprBookCode = ''' then FASetup.Get()).OnPreReport - which always runs, unlike OnOpenPage - never calls FASetup.Get() here, unlike the equivalent W1 base report (CalculateDepreciation.Report.al), whose OnPreReport explicitly calls FASetup.Get(). Any programmatic invocation that pre-sets DeprBookCode before the request page runs (for example InitializeRequest followed by UseRequestPage(false), the exact pattern LibraryFixedAssetCZF.RunCalculateDepreciation uses) skips the OnOpenPage branch entirely, leaving FASetup as a blank/uninitialized record. BonusDepreciationCorrectlySetupCZF() then reads blank fields, returns false, and the whole new bonus-depreciation feature silently never activates - no error, no log, in what is likely the report's most common non-interactive invocation path. If confirmed, this is severity-blocking for the feature's correctness; treat the minor severity here as an artifact of this being an agent (non-knowledge-backed) finding, not as a signal that the underlying defect is low-impact. Recommendation:
Suggested fix (apply manually — could not be anchored as a one-click suggestion): FASetup.Get();
DepreciationBook.Get(DeprBookCode);Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
InsertBonusDepreciationFAJnlLine/InsertBonusDepreciationGenJnlLine add a new bonus-depreciation posting path to the CZF localization, but no test in src/Apps/CZ/FixedAssetLocalization/test exercises it (no file or test method mentions 'Bonus' or 'CalculateDepreciationCZF' beyond the existing non-bonus scenarios).The equivalent W1 base-app feature has an extensive dedicated test suite (ERMFABonusDepreciation.Codeunit.al) covering eligibility, amount calculation, and duplicate-application guards. Recommendation:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
What & why
Bug fix to implement missing bonus depreciation functionality in the CZ (Czech Republic) fixed asset localization.
Linked work
Fixes AB#640523
How I validated this