feat(accounting): move Chart of accounts into Settings → Accounting

Consolidate all accounting configuration in one place. The Chart of
accounts (accounts table + category/default-account mappings) becomes a
self-contained ChartOfAccountsManager rendered in Settings → Accounting,
next to the VAT codes that already moved there. The /admin/accounting
section is now purely operational (Incoming invoices · Expenses · Tax).

The old /admin/accounting/ledger route redirects to the settings tab so
bookmarks keep working; the Tax page "Configure" link points there too.
ChartOfAccountsManager saves only the account keys (partial-merge safe,
same as VatCodesManager), so the two never revert each other's edits.
This commit is contained in:
Luca
2026-06-16 01:11:12 +02:00
parent 4ff5b84cb6
commit 97795f6d1e
5 changed files with 34 additions and 25 deletions
@@ -13,6 +13,7 @@ import { DecimalInput } from '../../../components/common/DecimalInput';
import { accountingService } from '../../../services/accounting.service';
import { sortedCountryOptions } from '../../../constants/countries';
import { VatCodesManager } from '../../../components/admin/VatCodesManager';
import { ChartOfAccountsManager } from '../../../components/admin/ChartOfAccountsManager';
const labelCls = 'block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-1';
const inputCls = 'w-full max-w-xs rounded-md border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 px-3 py-2 text-sm';
@@ -121,6 +122,16 @@ export const AccountingTab: React.FC = () => {
{/* VAT codes + rate→code / treatment→code maps — relocated here from the
Chart-of-accounts page so all VAT config lives in one place. */}
<VatCodesManager />
{/* Chart of accounts (accounts + category/default-account mappings) —
moved off the /admin/accounting section so all accounting config is
here; the section keeps only the operational pages. */}
<div className="pt-2">
<h3 className="text-sm font-semibold uppercase tracking-wider text-neutral-500 dark:text-neutral-400 mb-3">
{t('ledger.accounts.title', 'Chart of accounts')}
</h3>
<ChartOfAccountsManager />
</div>
</div>
);
};