feat(accounting): invoices force-enable the Accounting master

Invoice VAT config (codes + label) and the hourly rate now live under
Settings → Accounting, so an install with Invoices must have Accounting
available.

- applyDependencyRules (backend adminFeatureFlags.js + frontend
  FeatureFlagsContext.tsx): bills on → accounting on, before the
  accounting→children rule so the sub-features keep their own state.
- Migration 133 corrects existing installs: set the STORED accounting=true
  where bills is on. requireFeatureFlag('accounting') reads the raw row, so
  without this an upgraded install (invoices on, accounting off) would show
  the tab but 403 its endpoints. Idempotent; only flips on; no down.
- Features tab: the Accounting card shows locked-on (disabled + hint) while
  Invoices is enabled.

Also includes the i18n keys (en/de) for the VAT/financial settings move.
This commit is contained in:
Luca
2026-06-18 15:11:11 +02:00
parent dc7b87bb87
commit 51837c3a88
6 changed files with 80 additions and 6 deletions
@@ -324,6 +324,13 @@ export const FeaturesTab: React.FC = () => {
sidebarLabel={t('settings.features.accounting.sidebar', 'Accounting')}
enabled={staged.accounting}
onToggle={(next) => setFlag('accounting', next)}
// Invoices force-enable Accounting (invoice VAT settings live here),
// so the master can't be turned off while Bills is on.
disabled={staged.bills}
lockedReason={staged.bills ? t(
'settings.features.accounting.requiredByBills',
'On automatically because Invoices is enabled — invoice VAT settings live in the Accounting section.',
) : undefined}
/>
<FeatureCard