Skip to content

[29.0] Bug 649735: [Excise Tax] Improving Excise Duty Calculation - #11302

Open
v-rohangarg20 wants to merge 4 commits into
releases/29.0from
bugs/649735-excise-tax-improving-excise-duty-calculation-29.0
Open

[29.0] Bug 649735: [Excise Tax] Improving Excise Duty Calculation#11302
v-rohangarg20 wants to merge 4 commits into
releases/29.0from
bugs/649735-excise-tax-improving-excise-duty-calculation-29.0

Conversation

@v-rohangarg20

@v-rohangarg20 v-rohangarg20 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#649735

Issue

The 29.0 branch did not support rate-based excise duty calculation for specific-per-unit, ad valorem, and hybrid duties. In item ledger scenarios, the tax amount could also be calculated incorrectly when the final item category changed the applicable calculation type.

Cause

The calculation flow relied on the legacy item and fixed-asset rate model and did not resolve an explicit calculation type before calculating the taxable amount. The new rate model also required migration and servicing-compatible schema changes for the 29.0 branch.

Solution

  • Added the Excise Tax Rate table, list page, and Excise Calculation Type enum.
  • Applied the final rate and calculation type before calculating the taxable amount for item ledger entries.
  • Added migration from the existing item/fixed-asset rate table.
  • Updated permissions, pages, journal lines, transaction logs, and tests.
  • Preserved the servicing-branch schema by excluding main-branch-only deprecation changes.

Validation

  • Cherry-picked the changes from PR #11116 onto releases/29.0.
  • The three source commits applied without conflicts.

The item-ledger path evaluated RequiresTaxableAmount before the OnAfterUpdateExciseJournalLineFromItemLedgerEntry subscriber applied the rate for the ledger entry item category. When the item category and the ledger entry category resolved to different calculation types, an ad valorem or hybrid line could keep a zero taxable amount and calculate the wrong tax. The taxable amount is now set after the event so the final calculation type is used.

Also fixed VerifyFAJournalLinesForAcquisitionCost to create the fixed asset rate with an explicit Excise Calculation Type, so the rate lookup resolves as the test expects.
…29.x

The main-branch change deprecated table 7413 and page 7412 in favour of the new Excise Tax Rate table, gating them behind CLEAN30/CLEANSCHEMA33. Deprecating an object in a servicing branch is not valid: the obsolete tags 30.0 and 33.0 refer to versions newer than 29.x, and those CLEAN symbols are not defined here.

The old table and page are therefore restored byte-identical to the 29.x baseline, and the preprocessor gates are dropped from the permission sets and the upgrade codeunit so the rate migration always runs. Only the additive part of the feature - the Excise Tax Rate table, the Excise Tax Rates page, the calculation type enum and the calculation changes - is backported.
@v-rohangarg20
v-rohangarg20 requested a review from a team September 10, 2026 07:20
@v-rohangarg20
v-rohangarg20 requested a review from a team as a code owner September 10, 2026 07:20
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area labels Sep 10, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Sep 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This change adds ad valorem and hybrid excise calculation types, a rate table with item-category matching, migration from the old rate setup, journal/log fields, and calculation tests. The calculation flow applies the final rate before deciding whether taxable amount is needed, but the changed posted item-ledger path is still not covered by a posting-derived regression test.

Problem-solution fit

Fit: Strong

The described scenario is clear and the diff targets that behavior directly.

Suggestions

S1 (🔴 High): Add posted-entry excise coverage
The changed item ledger entry path now sets the taxable amount from posted value entries, but the tests still exercise a manually created journal line. Please add a test that creates the item ledger entry path, generates the excise journal line, and verifies the taxable amount and tax amount. This is a tax amount path, so the exact posting-derived flow should be covered before merge.

Risk assessment and necessity

Risk: High. This is a tax amount calculation path; a missing posted-entry regression can let a wrong taxable amount or tax amount reach the excise journal and transaction log.

Necessity: The rate-model change is needed, but the posted item-ledger flow must be proven because that is where the production taxable amount is sourced.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11302 round=1 by=alexei-dobriansky at=2026-09-11T11:22:12.762Z lastSha=60c0c619bb54bfd95da437b91169dd9b94113395 reviewKey=31b01d17a79ad6b88c7fc3f0254a3144f18cb1e47438fb857c67dcb8bede45b6 suggestions=S1@9a7c15f4

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.

4 participants