feat(buchhaltung): add transfers, bank statements, Haushaltsplan, and PDF export

This commit is contained in:
Matthias Hochmeister
2026-03-30 17:05:18 +02:00
parent 2eb59e9ff1
commit 5acfd7cc4f
14 changed files with 1911 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
-- Migration 082: Add 'transfer' transaction type + target bank account column
-- 1. Drop and recreate the typ CHECK constraint to include 'transfer'
ALTER TABLE buchhaltung_transaktionen
DROP CONSTRAINT IF EXISTS buchhaltung_transaktionen_typ_check;
ALTER TABLE buchhaltung_transaktionen
ADD CONSTRAINT buchhaltung_transaktionen_typ_check
CHECK (typ IN ('einnahme', 'ausgabe', 'transfer'));
-- 2. Add target bank account column for transfers
ALTER TABLE buchhaltung_transaktionen
ADD COLUMN IF NOT EXISTS transfer_ziel_bankkonto_id INT
REFERENCES buchhaltung_bankkonten(id) ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS idx_buch_trans_transfer_ziel
ON buchhaltung_transaktionen(transfer_ziel_bankkonto_id)
WHERE transfer_ziel_bankkonto_id IS NOT NULL;