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. +
+ +