Slice 641293: [Expense Agent] Expense Locations and Per-diem rules in configurationAdded more locations - #10155
Conversation
…res/641293-locations
|
BuildRuleSeeds and BuildRuleConditionSeeds now delegate straight to the new seed-builder codeunits, so the shipped local integration events OnBeforeAddRuleSeed, OnBeforeInsertRuleSeed, and OnBeforeAddRuleConditionSeed are no longer raised on this code path. Dependent extensions can still subscribe to local publishers, so this refactor breaks the existing subscriber contract unless the new implementation preserves those event raises. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
|
The shipped [IntegrationEvent] OnBeforeAddCategorySeed changes its existing PaymentMethod parameter from Code[20] to Code[10]. Even though the publisher is local, subscribers still bind to the parameter's type, so this is a breaking event-contract change. Keep the event signature unchanged and handle the narrower storage requirement inside the publisher logic instead. Suggested fix (apply manually — could not be anchored as a one-click suggestion): local procedure OnBeforeAddCategorySeed(Code: Code[20]; Description: Text[250]; PostingDescription: Text[100]; ExpenseGroupCode: Code[20]; PostingGroupCode: Code[20]; PaymentMethod: Code[20]; IsRefundable: Boolean; IsPrepayment: Boolean; AttachmentEnforcement: Enum "Expense Attachment Enforcement"; DetailRequired: Enum "Expense Detail Needed"; var IsHandled: Boolean)Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
|
This PR adds new setup codeunits — "Create Expense Location" (7104), "Create Expense Rule Condition" (7105), "Create Expense Rule Header" (7107) — which are invoked from "Create Expense Categories"'s setup/defaults flow, but the "Expense Agent - Objects" permission set (which the assignable Expense Agent role includes) grants execute permission for none of them (it only lists "Create Expense Report" among "Create *" codeunits). If any part of the setup/defaults flow runs under the agent user's permission set rather than SUPER, this produces a missing-permission failure. Verify whether these codeunits execute only under an installing/SUPER context; if the agent user can reach this flow, add execute permissions for the three new codeunits. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.33.4 |
|
Copilot resolve the merge conflicts in this pull request |
…ions Co-authored-by: BardurKnudsen <8470791+BardurKnudsen@users.noreply.github.com>
10889b3
Good Sense Reviewer - Round 9Recommendation: Request ChangesWhat this PR doesThis expands the default expense-location catalog and seeds default management rules for per-diem locations. Since round 8, the branch merge brings the PR up to the current base and resolves conflicts in permissions, wizard, and test helper files. Those merge changes look safe, but they do not change the default location and rule seeders. The current net diff still seeds blank per-diem currency with a fixed daily rate, can create rules for skipped locations, can add generic per-diem rules in AT setup, and can insert default conditions without matching headers. Status of previous suggestions
New observations (commits since round 8)None - the latest merge integrates current base changes and conflict resolutions. I did not find a new review finding in those hunks. Risk assessment and necessityRisk: The remaining issues can still seed wrong or incomplete management-rule data. This can make default expense setup validate per-diem expenses against wrong rates, create rules for locations that do not exist, leave localized per-diem setup mixed with generic rules, or create conditions without matching rule headers. Necessity: The wider location catalog and default per-diem setup are useful feature work. The scope is still right, but the seeded locations, headers, conditions, currencies, rates, and country-specific defaults must stay consistent before merge.
|
Alexey (@alexey) Dobriansky: Can you please close this comment? |
Pull request was closed
|
The shipped "Contoso Expense Agent".InsertExpense contract was changed in place by narrowing ExpenseLocationCode from Code[30] to Code[20]. This internal procedure is called across app boundaries (e.g. the AT demo-data app's CreateExpenseAT/CreatePostedExpReportAT codeunits), so any dependent that holds a Code[30] value for this parameter loses the published contract. Keep the existing signature and introduce a new/overloaded entry point if the narrower type is required. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
Dear agent: |
Good Sense Reviewer - ReplyThanks for the clarification. I am closing the round-9 points.
The round-9 suggestions are closed.
|
Adds more locations (basically all country/regions) and corresponding expense rule headers and expense rule conditions.
Fixes AB#641293