no message
This commit is contained in:
@@ -19,6 +19,23 @@
|
|||||||
"name": "FooterText",
|
"name": "FooterText",
|
||||||
"caption": "Fusszeile"
|
"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",
|
"type": "Label",
|
||||||
"caption": "🏦 QR-Einzahlungsschein Daten"
|
"caption": "🏦 QR-Einzahlungsschein Daten"
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ class Abrechnung extends IPSModule
|
|||||||
$this->RegisterPropertyInteger('LogoMediaID', 0);
|
$this->RegisterPropertyInteger('LogoMediaID', 0);
|
||||||
$this->RegisterPropertyString('PropertyText', 'Liegenschaft');
|
$this->RegisterPropertyString('PropertyText', 'Liegenschaft');
|
||||||
$this->RegisterPropertyString('FooterText', 'Belevo AG • 6122 Menznau • www.belevo.ch');
|
$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
|
// Neue Felder für den QR-Schein
|
||||||
$this->RegisterPropertyString('CreditorName', 'Belevo AG');
|
$this->RegisterPropertyString('CreditorName', 'Belevo AG');
|
||||||
@@ -229,13 +233,45 @@ public function GenerateInvoices()
|
|||||||
$html .= $additionalResult['html'];
|
$html .= $additionalResult['html'];
|
||||||
$totalAdditional = $additionalResult['sum'];
|
$totalAdditional = $additionalResult['sum'];
|
||||||
|
|
||||||
// ========================= Gesamttotal =========================
|
// ========================= Gesamttotal & MWST =========================
|
||||||
$grandTotal = $totalPower + $totalAdditional;
|
$subTotal = $totalPower + $totalAdditional;
|
||||||
$html .= "
|
$enableVAT = $this->ReadPropertyBoolean('EnableVAT');
|
||||||
<h2 style='margin:0 0 0 0; font-size:11px;'>
|
|
||||||
Gesamttotal: <strong>CHF " . number_format($grandTotal, 2) . ".-</strong>
|
$html .= "<table width='100%' style='font-size:10px;' cellpadding='2'>";
|
||||||
</h2>
|
|
||||||
";
|
if ($enableVAT) {
|
||||||
|
$vatPercent = $this->ReadPropertyFloat('VATPercentage');
|
||||||
|
$vatAmount = $subTotal * ($vatPercent / 100);
|
||||||
|
$grandTotal = $subTotal + $vatAmount;
|
||||||
|
|
||||||
|
$html .= "
|
||||||
|
<tr>
|
||||||
|
<td width='75%' align='right'>Zwischentotal (exkl. MWST):</td>
|
||||||
|
<td width='25%' align='right'>CHF " . number_format($subTotal, 2, '.', "'") . "</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width='75%' align='right'>zuzüglich " . number_format($vatPercent, 1, '.', "'") . " % MWST:</td>
|
||||||
|
<td width='25%' align='right'>CHF " . number_format($vatAmount, 2, '.', "'") . "</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width='75%' align='right' style='font-size:12px;'><br><strong>Gesamttotal (inkl. MWST):</strong></td>
|
||||||
|
<td width='25%' align='right' style='font-size:12px;'><br><strong>CHF " . number_format($grandTotal, 2, '.', "'") . "</strong></td>
|
||||||
|
</tr>
|
||||||
|
</table>";
|
||||||
|
} else {
|
||||||
|
$grandTotal = $subTotal;
|
||||||
|
$html .= "
|
||||||
|
<tr>
|
||||||
|
<td width='75%' align='right' style='font-size:12px;'><strong>Gesamttotal:</strong></td>
|
||||||
|
<td width='25%' align='right' style='font-size:12px;'><strong>CHF " . number_format($grandTotal, 2, '.', "'") . "</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2' align='right' style='font-size:8px; color:#555;'><br>Nicht mehrwertsteuerpflichtig.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
$pdf->writeHTML($html, true, false, true, false, '');
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
// WICHTIG: Total zurückgeben für den Einzahlungsschein
|
// WICHTIG: Total zurückgeben für den Einzahlungsschein
|
||||||
|
|||||||
Reference in New Issue
Block a user