[Shopify] Add Belgium localization for company tax id mapping (Enterprise No.)#9138
[Shopify] Add Belgium localization for company tax id mapping (Enterprise No.)#9138onbuyuka wants to merge 8 commits into
Conversation
…rise No.) Belgian B2B company/customer sync (Report 30114 "Shpfy Sync Companies") failed because the "Shpfy Comp. Tax Id Mapping" enum only offered "Registration No." and "VAT Registration No.". The Belgian localization forbids writing "VAT Registration No." for Belgian customers, which must use "Enterprise No." (field 11310), so no valid mapping existed for a Belgian shop. Add a Belgium localization app (Shopify Connector BE) that extends the mapping enum with an "Enterprise No." value and an implementation that maps the Shopify tax registration id to the customer's Enterprise No. Includes a test project. Fixes AB#640073 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot PR ReviewIteration 9 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
Regenerated via build/scripts/Update-CountryProjectSettings.ps1 to register the new Shopify Connector BE app and test folders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Base group is installed for the DemoTool during Legacy tests via Install-BaseAppsForDemoTool. Shopify Connector BE depends on the W1 Shopify Connector, which is not in the Base group, so installing the BE app in that phase failed (dependency not yet installed). Match the Intrastat BE group membership (no Base), consistent with the W1 Shopify Connector which is also not in the Base group. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Shopify Connector BE depends on the W1 Shopify Connector, which is an opt-in app (skipInstallOnPrem, not installed on environment update). Setting installOnEnvironmentUpdate on the BE app would try to auto-install it on all BE environments even where the Shopify Connector dependency is not present. Mirror the parent instead: use skipInstallOnPrem and drop installOnEnvironment- Update in projects.json, and remove the redundant OnPrem doNotInstall flags in groups.json so the group membership matches the W1 Shopify Connector exactly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of auto-installing the Shopify Connector BE app on every Belgian environment, keep it opt-in and prompt the user to install it on demand, mirroring the Quality Management demo-data pattern. On opening the Shopify Shops list, if the environment is a Belgian localization (application family "BE") and the Shopify Connector BE extension is not installed, show a notification offering to install it from the marketplace (ExtensionManagement.InstallMarketplaceExtension). The notification integrates with My Notifications so users can dismiss it permanently. No hard dependency on the BE app - only its app id is referenced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fold the on-demand install notification logic into the existing general-purpose "Shpfy Shop Mgt." codeunit (which already owns the connector's My Notifications handling and is the Shop list page's helper) instead of a dedicated BE-specific codeunit. Removes codeunit "Shpfy Belgian Localization". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The label is used as a notification action caption (AddAction), which is a label/caption role, so it should use the Lbl suffix rather than Msg (reserved for Message() text). Renames DontShowThisAgainMsg to DontShowThisAgainLbl across all notification actions in the codeunit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed via review replies: the notification detection must live in the always-installed W1 app (fires when the BE app is absent, mirroring the Quality Management install-on-demand pattern), and the PR description has been corrected to reflect the opt-in (not auto-installed) behavior, so the notification is not dead code. Both review threads resolved.
|
Summary
Belgian B2B company/customer sync (Report 30114 "Shpfy Sync Companies") failed for Belgian customers. The
Shpfy Comp. Tax Id Mappingenum (30166) only offeredRegistration No.andVAT Registration No.. The Belgian localization blocks writingVAT Registration No.for Belgian customers ("You must use Enterprise No. for Belgian customers."), which must instead useEnterprise No.(field 11310). No valid mapping existed for a Belgian shop.Changes
New Belgium localization app Shopify Connector BE (
src/Apps/BE/ShopifyBE):enumextension "Shpfy Comp. Tax Id Mapping BE"adds anEnterprise No.value to the mapping enum.codeunit "Shpfy Enterprise No. BE"implementsShpfy Tax Registration Id Mapping, mapping the Shopify tax registration id to the customer'sEnterprise No.(field 11310).build/projects.json+build/groups.jsonfor BE only. The app is opt-in (skipInstallOnPrem, noinstallOnEnvironmentUpdate) — it is not auto-installed, mirroring the install behavior of its parent (the opt-in Shopify Connector).On-demand discoverability (in the W1 Shopify Connector,
Shpfy Shop Mgt.):GetApplicationFamily() = ''BE'') and the Shopify Connector BE app is not installed, a notification offers to install it from the marketplace (ExtensionManagement.InstallMarketplaceExtension). Integrated withMy Notificationsso it is dismissable. This detection lives in the always-installed W1 app by necessity — it fires precisely when the BE app is absent (same pattern as Quality Management''s demo-data prompt).Once the BE app is installed, a Belgian merchant sets Company Tax Id Mapping = Enterprise No. on the Shop Card. The
Enterprise No.option only exists on BE environments (the app is BE only), so no config-time guard is needed.Test plan
New test project Shopify Connector BE Test (
codeunit "Shpfy Tax Id Mapping BE Test"), mirroring the W1Shpfy Tax Id Mapping Test:GetTaxRegistrationIdreturns the customer''sEnterprise No.SetMappingFiltersForCustomersfilters customers byEnterprise No.UpdateTaxRegistrationIdwrites theEnterprise No.(BE country/MOD97 validation bypassed via theOnBeforeValidateEnterpriseNopublisher to isolate the mapping logic).Fixes AB#640073