diff --git a/Abrechnung/module.php b/Abrechnung/module.php index d6fffa0..f453ba8 100644 --- a/Abrechnung/module.php +++ b/Abrechnung/module.php @@ -1390,10 +1390,16 @@ public function GenerateInvoices() $periodText = date('d.m.Y', $from) . ' - ' . date('d.m.Y', $to); $meterText = empty($meterNames) ? '-' : implode("\n", $meterNames); $addressText = trim(($user['name'] ?? '') . "\n" . ($user['address'] ?? '') . "\n" . ($user['city'] ?? '')); + $meterLineCount = max(1, count(preg_split('/\r\n|\r|\n/', $meterText))); + $addressLineCount = max(1, count(preg_split('/\r\n|\r|\n/', $addressText))); + $meterBlockHeight = 22 + ($meterLineCount * 4.6); + $addressBlockHeight = 10 + ($addressLineCount * 4.6); $infoBoxHeight = max( 32, - 18 + $pdf->getStringHeight(82, $meterText), - 8 + $pdf->getStringHeight(82, $addressText) + $meterBlockHeight, + $addressBlockHeight, + 22 + $pdf->getStringHeight(82, $meterText), + 10 + $pdf->getStringHeight(82, $addressText) ); $y = $pdf->GetY();