diff --git a/Abrechnung/form.json b/Abrechnung/form.json index 92235cb..ae3ef07 100644 --- a/Abrechnung/form.json +++ b/Abrechnung/form.json @@ -19,6 +19,23 @@ "name": "FooterText", "caption": "Fusszeile" }, + { + "type": "Label", + "caption": "⚖️ Mehrwertsteuer (MWST)" + }, + { + "type": "CheckBox", + "name": "EnableVAT", + "caption": "Mehrwertsteuer berechnen und ausweisen" + }, + { + "type": "NumberSpinner", + "name": "VATPercentage", + "caption": "MWST-Satz in %", + "digits": 2, + "minimum": 0, + "maximum": 100 + }, { "type": "Label", "caption": "🏦 QR-Einzahlungsschein Daten" diff --git a/Abrechnung/module.php b/Abrechnung/module.php index 80c527e..6266c25 100644 --- a/Abrechnung/module.php +++ b/Abrechnung/module.php @@ -47,6 +47,10 @@ class Abrechnung extends IPSModule $this->RegisterPropertyInteger('LogoMediaID', 0); $this->RegisterPropertyString('PropertyText', 'Liegenschaft'); $this->RegisterPropertyString('FooterText', 'Belevo AG • 6122 Menznau • www.belevo.ch'); + + // NEU: MWST Variablen registrieren (Standard 8.1%) + $this->RegisterPropertyBoolean('EnableVAT', false); + $this->RegisterPropertyFloat('VATPercentage', 8.1); // Neue Felder für den QR-Schein $this->RegisterPropertyString('CreditorName', 'Belevo AG'); @@ -229,13 +233,45 @@ public function GenerateInvoices() $html .= $additionalResult['html']; $totalAdditional = $additionalResult['sum']; - // ========================= Gesamttotal ========================= - $grandTotal = $totalPower + $totalAdditional; - $html .= " -
| Zwischentotal (exkl. MWST): | +CHF " . number_format($subTotal, 2, '.', "'") . " | +
| zuzüglich " . number_format($vatPercent, 1, '.', "'") . " % MWST: | +CHF " . number_format($vatAmount, 2, '.', "'") . " | +
Gesamttotal (inkl. MWST): |
+ CHF " . number_format($grandTotal, 2, '.', "'") . " |
+