| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/seaside2.pacim.de/web/app/views/pdf/ |
Upload File : |
<?php
/**
* Erwartet:
* @var array $invoice (mit booking_no, c_*, event_*, b_*)
* @var array $items
* @var array $payments
* @var array $paymentSummary (paid, total, remaining, status)
*/
?>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Rechnung <?php echo safeText($invoice['invoice_no']); ?></title>
<?php require __DIR__ . '/_styles.php'; ?>
</head>
<body>
<div class="doc">
<?php
$company = isset($settings) && $settings ? $settings->company() : ['name' => 'PaCIM', 'street' => '', 'zip' => '', 'city' => '', 'email' => '', 'logo' => '', 'vat_id' => ''];
?>
<div class="header">
<div>
<?php if (!empty($company['logo'])): ?>
<?php $logoAbs = dirname(__DIR__, 3) . '/public' . $company['logo']; ?>
<?php if (is_file($logoAbs)): ?>
<img src="<?php echo safeText($company['logo']); ?>" alt="Logo" style="max-height: 60px;">
<div style="font-size: 10px; color: #6c757d; margin-top: 4px;"><?php echo safeText($company['name']); ?></div>
<?php else: ?>
<div class="logo"><?php echo safeText($company['name']); ?><small>Cruise Parking SaaS</small></div>
<?php endif; ?>
<?php else: ?>
<div class="logo"><?php echo safeText($company['name']); ?><small>Cruise Parking SaaS</small></div>
<?php endif; ?>
</div>
<div class="doc-meta">
<h1>Rechnung</h1>
<div class="meta-line"><strong><?php echo safeText($invoice['invoice_no']); ?></strong></div>
<div class="meta-line">Datum: <?php echo formatDate($invoice['invoice_date']); ?></div>
<div class="meta-line">Buchung: <?php echo safeText($invoice['booking_no']); ?></div>
</div>
</div>
<div class="addresses">
<div class="addr-block">
<div class="label">Rechnung an</div>
<?php if (!empty($invoice['c_company'])): ?>
<div class="name"><?php echo safeText($invoice['c_company']); ?></div>
<div><?php echo safeText($invoice['c_first_name'] . ' ' . $invoice['c_last_name']); ?></div>
<?php else: ?>
<div class="name"><?php echo safeText($invoice['c_first_name'] . ' ' . $invoice['c_last_name']); ?></div>
<?php endif; ?>
<div><?php echo safeText($invoice['c_street']); ?></div>
<div><?php echo safeText($invoice['c_zip'] . ' ' . $invoice['c_city']); ?></div>
<div style="margin-top: 6px; color: #6c757d;"><?php echo safeText($invoice['c_email']); ?></div>
</div>
<div class="addr-block" style="text-align: right;">
<div class="label">Absender</div>
<div class="name"><?php echo safeText($company['name']); ?></div>
<?php if (!empty($company['street'])): ?><div><?php echo safeText($company['street']); ?></div><?php endif; ?>
<?php if (!empty($company['zip']) || !empty($company['city'])): ?>
<div><?php echo safeText(trim(($company['zip'] ?? '') . ' ' . ($company['city'] ?? ''))); ?></div>
<?php endif; ?>
<?php if (!empty($company['email'])): ?>
<div style="margin-top: 6px; color: #6c757d;"><?php echo safeText($company['email']); ?></div>
<?php endif; ?>
<?php if (!empty($company['vat_id'])): ?>
<div style="color: #6c757d;">USt-ID <?php echo safeText($company['vat_id']); ?></div>
<?php endif; ?>
</div>
</div>
<div class="section-title">Leistungsdetails</div>
<table class="info-grid">
<tr>
<td class="k">Event</td>
<td><?php echo safeText($invoice['event_title']); ?> · <?php echo safeText($invoice['event_ship']); ?> · <?php echo safeText($invoice['event_terminal']); ?></td>
</tr>
<tr>
<td class="k">Zeitraum</td>
<td><?php echo formatDateTime($invoice['event_starts_at']); ?> – <?php echo formatDateTime($invoice['event_ends_at']); ?></td>
</tr>
<?php if (!empty($invoice['arrival_time'])): ?>
<tr><td class="k">Anreise</td><td><?php echo formatDateTime($invoice['arrival_time']); ?></td></tr>
<?php endif; ?>
<?php if (!empty($invoice['license_plate'])): ?>
<tr><td class="k">Kennzeichen</td><td><?php echo safeText(formatLicensePlateDE($invoice['license_plate'])); ?></td></tr>
<?php endif; ?>
</table>
<div class="section-title">Positionen</div>
<table class="items">
<thead>
<tr>
<th>Beschreibung</th>
<th class="num">Menge</th>
<th class="num">Einzel netto</th>
<th class="num">MwSt</th>
<th class="num">Summe brutto</th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $it): ?>
<tr>
<td>
<strong><?php echo safeText($it['title']); ?></strong>
<?php if (!empty($it['description'])): ?>
<div style="color:#6c757d;"><?php echo safeText($it['description']); ?></div>
<?php endif; ?>
</td>
<td class="num"><?php echo (int)$it['quantity']; ?></td>
<td class="num"><?php echo formatCurrency((float)$it['price_net']); ?></td>
<td class="num"><?php echo number_format((float)$it['vat_rate'], 2, ',', '.'); ?> %</td>
<td class="num"><?php echo formatCurrency((float)$it['total_gross']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table class="totals">
<tr>
<td>Zwischensumme netto</td>
<td style="text-align:right;"><?php echo formatCurrency((float)$invoice['total_net']); ?></td>
</tr>
<tr>
<td>MwSt</td>
<td style="text-align:right;"><?php echo formatCurrency((float)$invoice['total_vat']); ?></td>
</tr>
<tr class="grand">
<td>Gesamtbetrag</td>
<td style="text-align:right;"><?php echo formatCurrency((float)$invoice['total_gross']); ?></td>
</tr>
</table>
<?php if (!empty($payments)): ?>
<div class="section-title">Zahlungseingänge</div>
<table class="items">
<thead>
<tr>
<th>Datum</th>
<th>Methode</th>
<th>Notiz</th>
<th class="num">Betrag</th>
</tr>
</thead>
<tbody>
<?php foreach ($payments as $p): ?>
<tr>
<td><?php echo formatDateTime($p['paid_at']); ?></td>
<td><?php echo safeText(Payment::methodLabel($p['payment_method'])); ?></td>
<td><?php echo safeText($p['note'] ?? ''); ?></td>
<td class="num"><?php echo formatCurrency((float)$p['amount']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<table class="totals" style="margin-top: 12px;">
<tr>
<td>Bezahlt</td>
<td style="text-align:right;"><?php echo formatCurrency($paymentSummary['paid']); ?></td>
</tr>
<tr class="grand">
<td>Offener Betrag</td>
<td style="text-align:right;">
<?php if ($paymentSummary['remaining'] <= 0): ?>
<span class="badge badge-success">Vollständig bezahlt</span>
<?php else: ?>
<?php echo formatCurrency($paymentSummary['remaining']); ?>
<?php endif; ?>
</td>
</tr>
</table>
<div class="notes">
<strong>Hinweis:</strong> Diese Rechnung ist nach Erhalt sofort fällig.
Bitte geben Sie bei Überweisungen die Rechnungsnummer <?php echo safeText($invoice['invoice_no']); ?> als Verwendungszweck an.
</div>
<div class="footer">
<?php echo safeText($company['name']); ?>
<?php if (!empty($company['street'])): ?> · <?php echo safeText($company['street']); ?><?php endif; ?>
<?php if (!empty($company['zip']) || !empty($company['city'])): ?> · <?php echo safeText(trim(($company['zip'] ?? '') . ' ' . ($company['city'] ?? ''))); ?><?php endif; ?>
<?php if (!empty($company['vat_id'])): ?> · USt-ID <?php echo safeText($company['vat_id']); ?><?php endif; ?>
</div>
</div>
</body>
</html>