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:
@@ -91,6 +91,10 @@ function applyDependencyRules(flags: FeatureFlags): FeatureFlags {
|
||||
out.galleries = true; // foundation — always on
|
||||
if (out.quotes === false) out.bills = false; // bills depend on quotes
|
||||
if (out.calendar === false) out.calendarBooking = false; // booking depends on calendar
|
||||
// Invoices (Bills) force-enable the Accounting master — invoice VAT config +
|
||||
// hourly rate live under Settings → Accounting. Before the accounting→children
|
||||
// rule so sub-features keep their own state.
|
||||
if (out.bills === true) out.accounting = true;
|
||||
// Accounting sub-features require the Accounting master. Tax export is
|
||||
// independent of Bills now — it relocated permanently into Accounting.
|
||||
if (out.accounting === false) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1646,7 +1646,8 @@
|
||||
"accounting": {
|
||||
"title": "Buchhaltung",
|
||||
"description": "Ein eigener Buchhaltungsbereich, getrennt vom CRM. Hier aktivieren und dann die Unterfunktionen unten einschalten (Steuerexport, Eingangsrechnungen). MwSt-/Steuerbehandlung dient nur als Orientierung — vor dem Verlassen darauf mit Ihrem Treuhänder prüfen.",
|
||||
"sidebar": "Buchhaltung"
|
||||
"sidebar": "Buchhaltung",
|
||||
"requiredByBills": "Automatisch an, weil Rechnungen aktiviert ist — die MwSt-Einstellungen der Rechnungen liegen im Buchhaltungsbereich."
|
||||
},
|
||||
"incomingInvoices": {
|
||||
"title": "Eingangsrechnungen",
|
||||
@@ -1731,7 +1732,16 @@
|
||||
"reclaimCountriesHint": "Üblicherweise Ihr Inland (CH / LI). Kosten aus anderen Ländern gelten als nicht abziehbare ausländische MwSt. Cmd/Ctrl-Klick für Mehrfachauswahl."
|
||||
},
|
||||
"disclaimer": "Sätze und MwSt-/Steuerbehandlung dienen nur als Orientierung — mit Ihrem Treuhänder prüfen.",
|
||||
"savedToast": "Buchhaltungseinstellungen gespeichert."
|
||||
"savedToast": "Buchhaltungseinstellungen gespeichert.",
|
||||
"profileFields": {
|
||||
"title": "MwSt-Bezeichnung & Stundensatz",
|
||||
"vatLabel": "MwSt-Bezeichnung (z. B. MwSt., VAT)",
|
||||
"vatLabelHint": "Wird als Bezeichnung der MwSt-Zeile auf Rechnungs-/Angebots-PDFs gedruckt. Leer lassen, um die Standardbezeichnung der Dokumentsprache zu verwenden.",
|
||||
"hourlyRate": "Standard-Stundensatz",
|
||||
"hourlyRatePlaceholder": "z. B. 120.00",
|
||||
"hourlyRateHint": "Fallback, wenn ein Kunde keinen eigenen Satz hat. In {{currency}}, in Hauptwährungseinheiten. Leer lassen, um einen Satz pro Kunde oder pro Eintrag zu verlangen.",
|
||||
"savedToast": "Gespeichert."
|
||||
}
|
||||
}
|
||||
},
|
||||
"branding": {
|
||||
@@ -3937,7 +3947,8 @@
|
||||
"vat": {
|
||||
"addTitle": "MWST-Code hinzufügen", "editTitle": "MWST-Code bearbeiten",
|
||||
"code": "Code", "name": "Name", "rate": "Satz %", "direction": "Richtung",
|
||||
"account": "MWST-Konto", "noAccount": "— keines —", "confirmDelete": "Diesen MWST-Code löschen?"
|
||||
"account": "MWST-Konto", "noAccount": "— keines —", "confirmDelete": "Diesen MWST-Code löschen?",
|
||||
"legacyRate": "{{rate}}% (nicht konfiguriert)"
|
||||
},
|
||||
"export": {
|
||||
"title": "Treuhänder-Export",
|
||||
@@ -4309,6 +4320,7 @@
|
||||
},
|
||||
"businessProfile": {
|
||||
"savedToast": "Geschäftsprofil gespeichert.",
|
||||
"movedToAccounting": "MwSt-Satz, MwSt-Bezeichnung und Standard-Stundensatz befinden sich jetzt unter Einstellungen → Buchhaltung.",
|
||||
"title": "Geschäftsprofil",
|
||||
"subtitle": "Briefkopf, Kontaktdaten und Standardwerte für Angebote und Rechnungen.",
|
||||
"businessHours": {
|
||||
|
||||
@@ -1204,7 +1204,8 @@
|
||||
"accounting": {
|
||||
"title": "Accounting",
|
||||
"description": "A dedicated Accounting area, separate from CRM. Turn this on, then enable the sub-features below (Tax export, Incoming invoices). VAT / tax treatment is guidance only — verify with your Treuhänder before relying on it.",
|
||||
"sidebar": "Accounting"
|
||||
"sidebar": "Accounting",
|
||||
"requiredByBills": "On automatically because Invoices is enabled — invoice VAT settings live in the Accounting section."
|
||||
},
|
||||
"incomingInvoices": {
|
||||
"title": "Incoming invoices",
|
||||
@@ -1289,7 +1290,16 @@
|
||||
"reclaimCountriesHint": "Typically your domestic country (CH / LI). Costs from other countries are treated as non-reclaimable foreign VAT. Cmd/Ctrl-click to multi-select."
|
||||
},
|
||||
"disclaimer": "Rates and VAT/tax treatment are guidance only — verify with your Treuhänder.",
|
||||
"savedToast": "Accounting settings saved."
|
||||
"savedToast": "Accounting settings saved.",
|
||||
"profileFields": {
|
||||
"title": "VAT label & hourly rate",
|
||||
"vatLabel": "VAT label (e.g. MwSt., VAT)",
|
||||
"vatLabelHint": "Printed as the VAT-line label on invoice / quote PDFs. Leave blank to use the document language default.",
|
||||
"hourlyRate": "Default hourly rate",
|
||||
"hourlyRatePlaceholder": "e.g. 120.00",
|
||||
"hourlyRateHint": "Fallback used when a customer has no own rate. In {{currency}}, major units. Leave blank to require a per-customer or per-entry rate.",
|
||||
"savedToast": "Saved."
|
||||
}
|
||||
}
|
||||
},
|
||||
"analytics": {
|
||||
@@ -3937,7 +3947,8 @@
|
||||
"vat": {
|
||||
"addTitle": "Add VAT code", "editTitle": "Edit VAT code",
|
||||
"code": "Code", "name": "Name", "rate": "Rate %", "direction": "Direction",
|
||||
"account": "VAT account", "noAccount": "— none —", "confirmDelete": "Delete this VAT code?"
|
||||
"account": "VAT account", "noAccount": "— none —", "confirmDelete": "Delete this VAT code?",
|
||||
"legacyRate": "{{rate}}% (not configured)"
|
||||
},
|
||||
"export": {
|
||||
"title": "Treuhänder export",
|
||||
@@ -4307,6 +4318,7 @@
|
||||
},
|
||||
"businessProfile": {
|
||||
"savedToast": "Business profile saved.",
|
||||
"movedToAccounting": "The VAT rate, VAT label and default hourly rate now live under Settings → Accounting.",
|
||||
"title": "Business profile",
|
||||
"subtitle": "Issuer block shown on every quote and invoice PDF.",
|
||||
"businessHours": {
|
||||
|
||||
Reference in New Issue
Block a user