From 3b235db4f736a4e7d379ec8374e63c6105ba40a9 Mon Sep 17 00:00:00 2001 From: fds2610-bot Date: Tue, 5 May 2026 09:16:03 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Stornorechnung=20=E2=80=93=20Syntaxfehle?= =?UTF-8?q?r=20PDF,=20Betreff=20vom=20Original,=20Referenzzeile=20unter=20?= =?UTF-8?q?Titel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Models/Invoice.php | 2 +- src/Services/PdfInvoiceService.php | 16 ++++++++++------ src/Views/invoices/show.php | 9 ++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/Models/Invoice.php b/src/Models/Invoice.php index 5e98207..50c9358 100644 --- a/src/Models/Invoice.php +++ b/src/Models/Invoice.php @@ -205,7 +205,7 @@ class Invoice VALUES (?, ?, ?, ?, ?, \'Finalisiert\', ?, ?, ?)', [ (int)$original['customer_id'], - 'Stornorechnung zu Rechnung ' . $original['rechnungs_nr'], + $original['betreff'], $original['leistungszeitraum'], $today, $today, diff --git a/src/Services/PdfInvoiceService.php b/src/Services/PdfInvoiceService.php index d6b9bcf..d465cb9 100644 --- a/src/Services/PdfInvoiceService.php +++ b/src/Services/PdfInvoiceService.php @@ -106,10 +106,10 @@ class PdfInvoiceService $isStorno = !empty($inv['storno_of_id']); $docTitle = $isStorno ? 'STORNORECHNUNG' : 'Rechnung'; - // Referenzzeile für Stornorechnung + // Referenzzeile direkt unter dem Dokumententitel (rechte Spalte im Adressblock) $stornoRefHtml = ''; if ($isStorno && !empty($inv['original_rechnungs_nr'])) { - $stornoRefHtml = '
' + $stornoRefHtml = '
' . 'Stornierung der Rechnung Nr. ' . $h($inv['original_rechnungs_nr']) . '' . ' vom ' . $fmtDate($inv['original_rechnungs_datum'] ?? '') . '
'; @@ -121,6 +121,10 @@ class PdfInvoiceService $fälligText = ' Fällig am: ' . $fmtDate($inv['faellig_datum']) . ''; } + $zahlungsHinweis = $isStorno ? '' : + '

Bitte überweisen Sie den Rechnungsbetrag innerhalb ' + . $h($payDays) . ' Tagen auf das unten genannte Konto.' . $fälligText . '

'; + // Positionszeilen $posRows = ''; foreach ($lines as $line) { @@ -167,12 +171,12 @@ class PdfInvoiceService
- {$docTitle} + + {$docTitle}{$stornoRefHtml} + - {$stornoRefHtml} -
@@ -225,7 +229,7 @@ class PdfInvoiceService
- {$isStorno ? '' : '

Bitte überweisen Sie den Rechnungsbetrag innerhalb ' . $h($payDays) . ' Tagen auf das unten genannte Konto.' . $fälligText . '

'} + {$zahlungsHinweis} HTML; diff --git a/src/Views/invoices/show.php b/src/Views/invoices/show.php index 4df5dc3..3952a9f 100644 --- a/src/Views/invoices/show.php +++ b/src/Views/invoices/show.php @@ -102,7 +102,14 @@ $badgeClass = match($invoice['status']) {
-
+
+ + +
+ Stornierung der Rechnung Nr. +
+ +