Consolidate Expense Agent (Wizard + demo data) into single W1 app - #10572
Consolidate Expense Agent (Wizard + demo data) into single W1 app#10572v-rohangarg20 wants to merge 31 commits into
Conversation
…Bug646163-consolidate-country-demo-data-apps-into-one-app
Rename per-country demo data codeunits to Create/Update/Expense naming convention with country-code suffix, organize files into Setup Data/Master Data/Transactions/Historical subfolders, and update object references and variable names accordingly.
…idate-country-demo-data-apps-into-one-app # Conflicts: # build/projects/Apps AT/.AL-Go/settings.json # build/projects/Apps AU/.AL-Go/settings.json # build/projects/Apps CA/.AL-Go/settings.json # build/projects/Apps DE/.AL-Go/settings.json # build/projects/Apps DK/.AL-Go/settings.json # build/projects/Apps ES/.AL-Go/settings.json # build/projects/Apps FR/.AL-Go/settings.json # build/projects/Apps GB/.AL-Go/settings.json # build/projects/Apps NZ/.AL-Go/settings.json # build/projects/Apps US/.AL-Go/settings.json
…Bug646163-consolidate-country-demo-data-apps-into-one-app # Conflicts: # build/projects.json
Per-country demo data (GL accounts, posting/employee groups, categories, subcategories, rules, transactions, historical) for the 7 new countries, and register them in build/projects.json and per-country AL-Go settings. Restrict FindGLAccountByName to Posting accounts to avoid Begin-Total name collisions. Set the CZ Employee Posting Group Payables Account when the localized chart leaves it blank. Ignore the mandatory journal template name check when posting expense reports.
…res/Slice-639548-Demo-data-for-new-countries-(October) # Conflicts: # build/projects/Apps CH/.AL-Go/settings.json
Bound Justification, Payment Method Code, Starting Point and Ending Point assignments with CopyStr to the target Expense field lengths (Text[100], Code[10], Text[50]). These pre-existing overflows surfaced as new warnings when the demo data began building for the newly added countries.
Replace the CopyStr bounding with correctly sized parameters (Justification Text[100], Payment Method Code Code[10], Starting/Ending Point Text[50]) to clear the AA0139 overflow warnings surfaced by building the demo data for the new countries.
Move per-country GL account/category resolution into the W1 Create Expense GL Account codeunit with country-aware name/search/fallback logic; retire per-country Expense Agent apps from build groups/projects/AL-Go settings and app.json internalsVisibleTo. Fix country account mappings surfaced during testing (DK prepayment 26400, DK other 05699, AT bank/card/travel/rounding names, NZ prepayment 2510, FR bank 512100, FR travel 625100, plus new-country fallbacks).
CreateGLAccount ran GLAccountIndent.Indent() for any non-ES company, including uninitialized/test companies with no Country/Region Code (e.g. 'My Company'). In a localized container (ES) the localized G/L Account-Indent rejects the W1 default expense accounts (e.g. 10390) with 'Missing group', failing the PreviewPostingOfExpenseReportWhenDemoDataIsExecuted test. Only re-indent when a country code is set.
Remove the per-country demo-data codeunits (CreateExpGLAccount<CC>, CreateExpPostingGrp<CC>, UpdateEmpPostingGrp<CC>, CreateExpCategories<CC>, CreatePostedExpReport<CC>, ExpenseGLAccountNames<CC>, etc.) and route country demo data through the single W1 Expense Agent module.
|
FindExistingExpenseAccount() only consumes GLAccount."No." and GLAccountCategory."Entry No.", but the new helper still materializes full rows on each FindFirst/FindSet. Add SetLoadFields to both record variables; this path is bounded setup code, so keep the severity minor, but the helper is called repeatedly while building the localized account catalog. Suggested fix (apply manually — could not be anchored as a one-click suggestion): GLAccount.SetRange("Account Category", AccountCategory);
GLAccount.SetRange("Account Type", GLAccount."Account Type"::Posting);
GLAccount.SetLoadFields("No.");
GLAccount.SetFilter(Name, SearchDescription);
if GLAccount.FindFirst() then
exit(GLAccount."No.");
GLAccount.SetRange(Name);
GLAccountCategory.SetRange("Account Category", AccountCategory);
GLAccountCategory.SetLoadFields("Entry No.");
GLAccountCategory.SetFilter(Description, SearchDescription);
if GLAccountCategory.FindSet() then
repeat
GLAccount.SetRange("Account Subcategory Entry No.", GLAccountCategory."Entry No.");
if GLAccount.FindFirst() then
exit(GLAccount."No.");
until GLAccountCategory.Next() = 0;Knowledge:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.35.4 |
|
The PR marks each country-specific Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.35.4 |
Good Sense Reviewer - Round 1Recommendation: Request ChangesWhat this PR doesThis consolidates Expense Agent setup and demo data into the W1 app. The country-specific account and category logic is moved into shared codeunits, and the demo data module now chooses country behavior at runtime. The shared setup logic mostly mirrors the removed country subscribers, and the country build checks are green. One packaging part does not fit the obsoletion path: the country app projects are removed from the build while their objects are only marked pending obsolete. That makes the migration window disappear for environments or extensions that still depend on those app identities. Problem-solution fitFit: Partial The change addresses the requested consolidation and adds the new country demo-data coverage. It also removes the old country apps immediately, which is broader than a safe consolidation step because the pending obsolete markers can no longer be delivered through those apps. SuggestionsS1 (🔴 High): Keep the obsolete app packages shippable S2 (🟠 Moderate): Add coverage for the posting bypass Risk assessment and necessityRisk: The main regression surface is upgrade and packaging for the country-specific Expense Agent apps, plus expense report posting because Expense Report-Post now changes the Gen. Jnl.-Post Line validation mode for every post in this codeunit. No BaseApp publisher dependency was found in this change. Necessity: Consolidating the country setup and demo data is justified because it removes duplicate country apps and supports the new country dataset from one W1 implementation. The scope is right only if the old app identities have a safe transition path and the posting bypass is covered.
|
Work item: AB#639548
What
Full consolidation of the Expense Agent into the single W1
Expense Agent (Preview)app, covering both the setup logic and the demo data.Changes
Create Expense GL Account/Create Expense Categoriescodeunits with country-aware name/search/fallback logic; per-countryExpenseAgent_<CC>apps removed from build registrations andapp.jsoninternalsVisibleTo; per-country event subscribers emptied.CreateExpGLAccount<CC>,CreateExpPostingGrp<CC>,UpdateEmpPostingGrp<CC>,CreateExpCategories<CC>,CreatePostedExpReport<CC>,ExpenseGLAccountNames<CC>, etc.) and route country demo data through the single W1 module.26400/ other05699; AT bank/card/travel/rounding names; NZ prepayment2510; FR bank512100/ travel625100; new-country fallbacks (NL, BE, IT, CH, FI, CZ); and skip the G/L chart re-indent for blank-country (uninitialized/test) companies so localizedG/L Account-Indentdoes not reject the W1 default accounts.Testing
Verified per country by running each localized web client and checking the Employee/Expense Posting Groups.
Create Expense GL Accountcompiles clean.