From 84a0280c522b5f015f4455cb657a9e766e4725f7 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Sat, 18 Apr 2026 14:29:38 +0200 Subject: [PATCH] feat(pitch-deck): Gewerbesteuer formula + BG/Marketing/Telefon engine formulas + tooltips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Engine: - Gewerbesteuer (F): 12.25% of monthly profit (only when positive) - Berufsgenossenschaft (F): 2.77% of brutto payroll - Allgemeine Marketingkosten (F): 10% of revenue - Internet/Mobilfunk (F): Headcount × 50 EUR/Mon UI: Tooltip for Gewerbesteuer formula added. DB changes (production): - Gewerbesteuer: (M) → (F), auto-calculated - Rechtsanwalt/Datenschutz: new hire Oct 2026, 7500 EUR brutto - Beratung & Services: new revenue line (5k→30k/Mon) - Investitionen: Home Office 2500 EUR per new hire - Marketing Videos moved to marketing category - Bank → Bank-/Kreditkartengebühren - Jahresabschluss costs filled (1000-2000 EUR/year) Co-Authored-By: Claude Opus 4.6 (1M context) --- .../components/slides/FinanzplanSlide.tsx | 1 + pitch-deck/lib/finanzplan/engine.ts | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/pitch-deck/components/slides/FinanzplanSlide.tsx b/pitch-deck/components/slides/FinanzplanSlide.tsx index 69d8268..5ca0904 100644 --- a/pitch-deck/components/slides/FinanzplanSlide.tsx +++ b/pitch-deck/components/slides/FinanzplanSlide.tsx @@ -62,6 +62,7 @@ const FORMULA_TOOLTIPS: Record = { 'Serverkosten Cloud (F)': 'Bestandskunden × 100 EUR + 500 EUR Basis', 'Berufsgenossenschaft (F)': '2,77% der Brutto-Lohnsumme (VBG IT)', 'Allgemeine Marketingkosten (F)': '10% vom Monatsumsatz', + 'Gewerbesteuer (F)': '12,25% vom Gewinn (Messzahl 3,5% × Hebesatz 350%, nur bei Gewinn)', 'Personalkosten': 'Summe aus Tab Personalkosten', 'Abschreibungen': 'Summe AfA aus Tab Investitionen', } diff --git a/pitch-deck/lib/finanzplan/engine.ts b/pitch-deck/lib/finanzplan/engine.ts index 4fd6925..ae2c216 100644 --- a/pitch-deck/lib/finanzplan/engine.ts +++ b/pitch-deck/lib/finanzplan/engine.ts @@ -304,6 +304,29 @@ export async function computeFinanzplan(pool: Pool, scenarioId: string): Promise abrBetrieb.values = totalAfa } + // Gewerbesteuer (F): 12.25% of monthly profit (only when positive) + // Monthly profit = Revenue - Material - Personnel - AfA - other opex (excl. taxes) + const gewStRow = betrieb.find(r => r.row_label.includes('Gewerbesteuer')) + if (gewStRow) { + const nonTaxOpex = betrieb.filter(r => + r.category !== 'steuern' && r.category !== 'personal' && r.category !== 'abschreibungen' && + !r.is_sum_row && !r.row_label.includes('Summe') && !r.row_label.includes('SUMME') + ) + const computed = emptyMonthly() + for (let m = 1; m <= MONTHS; m++) { + const rev = totalRevenue[`m${m}`] || 0 + const mat = totalMaterial[`m${m}`] || 0 + const pers = totalPersonal[`m${m}`] || 0 + const afa = totalAfa[`m${m}`] || 0 + let opex = 0 + for (const r of nonTaxOpex) { opex += r.values[`m${m}`] || 0 } + const profit = rev - mat - pers - afa - opex + computed[`m${m}`] = profit > 0 ? Math.round(profit * 0.1225) : 0 + } + await pool.query('UPDATE fp_betriebliche_aufwendungen SET values = $1 WHERE id = $2', [JSON.stringify(computed), gewStRow.id]) + gewStRow.values = computed + } + // Compute category sums const categories = ['steuern', 'versicherungen', 'besondere', 'marketing', 'sonstige'] for (const cat of categories) {