-
Notifications
You must be signed in to change notification settings - Fork 447
[Master] - Slice 626127: [Excise Tax][VENDOR] Multiple Excise Taxes per Item #9725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
v-rohangarg20
merged 7 commits into
main
from
features/Slice-626127-Multiple-Excise-Taxes-per-Item
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
39dac22
Fix and Automated Tests
v-rohangarg20 d0751f3
BB Fix
v-rohangarg20 034e0db
Merge branch 'main' of https://github.com/microsoft/BCApps into featu…
v-rohangarg20 b11f538
Code Review Feedback
v-rohangarg20 0548263
Code Review Feedback
v-rohangarg20 2e06e61
Code Review Feedback
v-rohangarg20 22fb847
Code Review Feedback
v-rohangarg20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
74 changes: 74 additions & 0 deletions
74
src/Apps/W1/ExciseTaxes/app/src/codeunit/ExciseTaxUpgrade.Codeunit.al
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
| namespace Microsoft.ExciseTaxes; | ||
|
|
||
| using Microsoft.Inventory.Item; | ||
| using System.Upgrade; | ||
|
|
||
| codeunit 7414 "Excise Tax Upgrade" | ||
| { | ||
| Subtype = Upgrade; | ||
| InherentEntitlements = X; | ||
| InherentPermissions = X; | ||
|
|
||
| trigger OnUpgradePerCompany() | ||
| var | ||
| UpgradeTag: Codeunit "Upgrade Tag"; | ||
| begin | ||
| if UpgradeTag.HasUpgradeTag(GetMultipleExciseTaxesPerItemUpgradeTag()) then | ||
| exit; | ||
|
|
||
| MigrateItemExciseTaxSetup(); | ||
|
|
||
| UpgradeTag.SetUpgradeTag(GetMultipleExciseTaxesPerItemUpgradeTag()); | ||
| end; | ||
|
|
||
| local procedure MigrateItemExciseTaxSetup() | ||
| var | ||
| Item: Record Item; | ||
| ItemExciseTax: Record "Item Excise Tax"; | ||
| begin | ||
| #pragma warning disable AL0432 | ||
|
v-rohangarg20 marked this conversation as resolved.
|
||
| Item.SetLoadFields("Excise Tax Type", "Quantity for Excise Tax", "Excise Unit of Measure Code"); | ||
| Item.SetFilter("Excise Tax Type", '<>%1', ''); | ||
| if Item.FindSet() then | ||
| repeat | ||
| if not ItemExciseTax.Get(Item."No.", Item."Excise Tax Type") then | ||
| CreateItemExciseTaxFromItem(Item); | ||
| until Item.Next() = 0; | ||
| #pragma warning restore AL0432 | ||
| end; | ||
|
|
||
| local procedure CreateItemExciseTaxFromItem(Item: Record Item) | ||
| var | ||
| ItemExciseTax: Record "Item Excise Tax"; | ||
| ExciseTaxType: Record "Excise Tax Type"; | ||
| begin | ||
| #pragma warning disable AL0432 | ||
| ItemExciseTax.Init(); | ||
| ItemExciseTax."Item No." := Item."No."; | ||
| ItemExciseTax."Excise Tax Type Code" := Item."Excise Tax Type"; | ||
|
|
||
| ExciseTaxType.SetLoadFields(Description); | ||
| if ExciseTaxType.Get(Item."Excise Tax Type") then | ||
| ItemExciseTax."Excise Tax Type Description" := ExciseTaxType.Description; | ||
|
|
||
| ItemExciseTax."Quantity for Excise Tax" := Item."Quantity for Excise Tax"; | ||
| ItemExciseTax."Excise Unit of Measure Code" := Item."Excise Unit of Measure Code"; | ||
| ItemExciseTax.Insert(); | ||
| #pragma warning restore AL0432 | ||
| end; | ||
|
|
||
| [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", OnGetPerCompanyUpgradeTags, '', false, false)] | ||
|
v-rohangarg20 marked this conversation as resolved.
|
||
| local procedure RegisterPerCompanyUpgradeTags(var PerCompanyUpgradeTags: List of [Code[250]]) | ||
| begin | ||
| PerCompanyUpgradeTags.Add(GetMultipleExciseTaxesPerItemUpgradeTag()); | ||
| end; | ||
|
|
||
| local procedure GetMultipleExciseTaxesPerItemUpgradeTag(): Code[250] | ||
| begin | ||
| exit('MS-626127-MultipleExciseTaxesPerItem-20260727'); | ||
| end; | ||
| } | ||
56 changes: 56 additions & 0 deletions
56
src/Apps/W1/ExciseTaxes/app/src/page/ItemExciseTaxAPI.Page.al
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
| namespace Microsoft.ExciseTaxes; | ||
|
|
||
| page 7417 "Item Excise Tax API" | ||
| { | ||
| PageType = API; | ||
| Caption = 'Item Excise Tax'; | ||
| APIPublisher = 'microsoft'; | ||
| APIGroup = 'exciseTaxes'; | ||
| APIVersion = 'v1.0'; | ||
| EntityName = 'itemExciseTax'; | ||
| EntitySetName = 'itemExciseTaxes'; | ||
| SourceTable = "Item Excise Tax"; | ||
| ODataKeyFields = SystemId; | ||
| DelayedInsert = true; | ||
| DeleteAllowed = false; | ||
|
|
||
| layout | ||
| { | ||
| area(Content) | ||
| { | ||
| repeater(Group) | ||
| { | ||
| field(id; Rec.SystemId) | ||
| { | ||
| Caption = 'Id'; | ||
| Editable = false; | ||
| } | ||
| field(itemNo; Rec."Item No.") | ||
| { | ||
| Caption = 'Item No.'; | ||
| } | ||
| field(exciseTaxType; Rec."Excise Tax Type Code") | ||
| { | ||
| Caption = 'Excise Tax Type'; | ||
| } | ||
| field(quantityExciseTax; Rec."Quantity for Excise Tax") | ||
| { | ||
| Caption = 'Quantity Excise Tax'; | ||
| } | ||
| field(exciseTaxUom; Rec."Excise Unit of Measure Code") | ||
| { | ||
| Caption = 'Excise Tax UOM'; | ||
| } | ||
| field(lastModifiedDateTime; Rec.SystemModifiedAt) | ||
| { | ||
| Caption = 'Last Modified Date Time'; | ||
| Editable = false; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.