Fix: Stornorechnung-Referenzzeile vereinheitlicht (Vorschau = PDF)

This commit is contained in:
fds2610-bot 2026-05-05 10:11:37 +02:00
parent 3b235db4f7
commit 3fcc4e6e26
3 changed files with 5 additions and 4 deletions

View file

@ -114,7 +114,7 @@ class InvoiceController
$originalrechnung = null;
if (!empty($invoice['storno_of_id'])) {
$originalrechnung = \Steuerkram\Database::fetchOne(
'SELECT id, rechnungs_nr FROM invoices WHERE id = ?',
'SELECT id, rechnungs_nr, rechnungs_datum FROM invoices WHERE id = ?',
[(int)$invoice['storno_of_id']]
);
}

View file

@ -110,7 +110,7 @@ class PdfInvoiceService
$stornoRefHtml = '';
if ($isStorno && !empty($inv['original_rechnungs_nr'])) {
$stornoRefHtml = '<div style="font-size:7pt;margin-top:2mm">'
. 'Stornierung der Rechnung Nr. <strong>' . $h($inv['original_rechnungs_nr']) . '</strong>'
. 'zu Rechnung Nr. <strong>' . $h($inv['original_rechnungs_nr']) . '</strong><br>'
. 'vom ' . $fmtDate($inv['original_rechnungs_datum'] ?? '')
. '</div>';
}

View file

@ -106,7 +106,8 @@ $badgeClass = match($invoice['status']) {
<?= !empty($invoice['storno_of_id']) ? 'STORNORECHNUNG' : 'Rechnung' ?>
<?php if (!empty($invoice['storno_of_id']) && !empty($originalrechnung)): ?>
<div style="font-size:.65rem;margin-top:.3rem;font-weight:normal">
Stornierung der Rechnung Nr. <strong><?= $h($originalrechnung['rechnungs_nr']) ?></strong>
zu Rechnung Nr. <strong><?= $h($originalrechnung['rechnungs_nr']) ?></strong><br>
vom <?= $h(View::formatDate($originalrechnung['rechnungs_datum'] ?? '')) ?>
</div>
<?php endif; ?>
</div>