no message

This commit is contained in:
2026-03-19 17:16:50 +01:00
parent 99aba58f34
commit 11d72eca10

View File

@@ -406,13 +406,14 @@ private function BuildQRBill($pdf, $user, $amount)
$creditorStr = mb_substr($this->ReadPropertyString('CreditorAddress'), 0, 70); $creditorStr = mb_substr($this->ReadPropertyString('CreditorAddress'), 0, 70);
$creditorCity = mb_substr($this->ReadPropertyString('CreditorCity'), 0, 70); $creditorCity = mb_substr($this->ReadPropertyString('CreditorCity'), 0, 70);
$debtorName = mb_substr($user['name'] ?? '', 0, 70); // Fallback falls ein Mieter keinen Namen oder Ort hinterlegt hat (Banken verlangen das zwingend)
$debtorName = mb_substr(empty($user['name']) ? 'Unbekannt' : $user['name'], 0, 70);
$debtorStr = mb_substr($user['address'] ?? '', 0, 70); $debtorStr = mb_substr($user['address'] ?? '', 0, 70);
$debtorCity = mb_substr($user['city'] ?? '', 0, 70); $debtorCity = mb_substr(empty($user['city']) ? 'Unbekannt' : $user['city'], 0, 70);
$amountStr = number_format($amount, 2, '.', ''); $amountStr = number_format($amount, 2, '.', '');
// EPC / Swiss QR Code String Format // EPC / Swiss QR Code String Format (Exakte Reihenfolge ist kritisch!)
$lines = [ $lines = [
'SPC', '0200', '1', $iban, 'K', 'SPC', '0200', '1', $iban, 'K',
$creditorName, $creditorStr, $creditorCity, '', '', 'CH', $creditorName, $creditorStr, $creditorCity, '', '', 'CH',
@@ -420,12 +421,12 @@ private function BuildQRBill($pdf, $user, $amount)
$amountStr, 'CHF', 'K', $amountStr, 'CHF', 'K',
$debtorName, $debtorStr, $debtorCity, '', '', 'CH', $debtorName, $debtorStr, $debtorCity, '', '', 'CH',
'NON', '', // Reference Type (NON = Ohne Referenz) 'NON', '', // Reference Type (NON = Ohne Referenz)
'EPD', 'Abrechnung Liegenschaft' 'Abrechnung Liegenschaft', // 30. Unstrukturierte Mitteilung
'EPD' // 31. Trailer (Zwingend exakt 'EPD' am Schluss!)
]; ];
return implode("\r\n", $lines); return implode("\r\n", $lines);
} }
// ====================== Stromkosten (15-Minuten, alle User) ====================== // ====================== Stromkosten (15-Minuten, alle User) ======================
private function CalculateAllPowerCosts($powerMeters, $tariffs, $from, $to) private function CalculateAllPowerCosts($powerMeters, $tariffs, $from, $to)