How Multi-Branch and Franchise Settings Work
Source: autosoft-workshop/app/controllers/application_controller.rb, branch_matching_controller.rb, multibranch_dashboard_controller.rb
- Dealer multibranch store detection requires three specific flags to all be set — missing any one means the system won't treat it as a multibranch dealer
- Branch sharing is blocked entirely for companies using Sage accounting integration
- Branch matching (linking customers/vendors across branches) requires an accounting integration to be connected
- Customer and vendor matching across branches uses email, phone, and name with ILIKE (case-insensitive substring matching) — partial matches can produce false positives
- Only branches where shares_account is set to true participate in cross-branch matching — branches with this flag off are isolated
- Enforcing Azure SSO at any branch cascades the setting to ALL branches in the franchise
- Branch stores that share accounts require a store prefix to be configured — without it, shared records can collide
- Multibranch dashboard access is restricted to the branch owner only and the financial year is independently configurable per branch
- Dashboard metrics are calculated by aggregating data across all franchise branches — not just the branch being viewed
Support scenarios
- "Multi-branch features aren't showing" → one of the three required flags is not set on the store
- "Can't share customers between branches" → Sage accounting is connected (sharing blocked), or shares_account is false on one branch
- "Wrong customer linked across branches" → ILIKE name/phone matching produced a false positive on a partial match
- "SSO got turned on at all our branches" → enforcing SSO at one branch cascades to all branches
- "Dashboard numbers seem too high" → metrics aggregate across all franchise branches, not just the selected one
- "Branch matching isn't working" → no accounting integration connected, which is required for matching