164 lines
11 KiB
PHP
164 lines
11 KiB
PHP
<?php
|
|
$payment_method = 'payment_method_'.$invoice_data['header']['payment_method'];
|
|
|
|
$message = '
|
|
<!DOCTYPE html>
|
|
<html lang="' . strtolower($language) . '">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>' . htmlspecialchars($lbl_invoice) . ' - Total Safety Solutions</title>
|
|
</head>
|
|
<body style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 14px; line-height: 1.6; margin: 0; padding: 0; background-color: #f4f4f4;">
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background-color: #f4f4f4;">
|
|
<tr>
|
|
<td align="center" style="padding: 20px 0;">
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="600" style="background-color: #ffffff; max-width: 600px;">
|
|
|
|
<!-- Content -->
|
|
<tr>
|
|
<td style="padding: 30px 40px;">
|
|
|
|
<!-- Invoice Title -->
|
|
<h1 style="font-size: 24px; font-weight: bold; color: #2c5f5d; margin: 0 0 25px 0;">' . htmlspecialchars($lbl_invoice) . '</h1>
|
|
|
|
<!-- Company Header -->
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-bottom: 25px;">
|
|
<tr>
|
|
<td width="50%" style="vertical-align: top; font-size: 13px; line-height: 1.5;">
|
|
<strong style="color: #2c5f5d; font-size: 14px;">Total Safety Solutions B.V.</strong><br>
|
|
Laarakkerweg 8<br>
|
|
5061 JR OISTERWIJK<br>
|
|
Nederland
|
|
</td>
|
|
<td width="50%" style="vertical-align: top; text-align: left;">
|
|
<strong style="color: #2c5f5d; font-size: 14px;">contact-details</strong><br>
|
|
Ralf Adams<br>
|
|
+31 13 8221480<br>
|
|
ralfadams@totalsafetysolutions.nl
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- Customer -->
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-bottom: 25px;">
|
|
<tr>
|
|
<td width="50%" style="vertical-align: top; font-size: 13px; line-height: 1.5;">
|
|
<strong style="color: #2c5f5d; font-size: 14px;">Customer</strong><br>
|
|
'.$invoice_data['customer']['name'].'<br>
|
|
'.$invoice_data['customer']['street'].'<br>
|
|
'.$invoice_data['customer']['zip'].', '.$invoice_data['customer']['city'].'<br>
|
|
'.$invoice_data['customer']['country'].'
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- Invoice Details -->
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-bottom: 25px; font-size: 13px;">
|
|
<tr>
|
|
<td width="50%" style="vertical-align: top; padding-right: 10px;">
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
|
<tr>
|
|
<td style="padding: 3px 0;"><strong>Invoice Date:</strong></td>
|
|
<td style="padding: 3px 0;">' . htmlspecialchars(date('d-m-Y', strtotime($invoice_date))) . '</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 3px 0;"><strong>Invoice Number:</strong></td>
|
|
<td style="padding: 3px 0;">' . htmlspecialchars($order_id) . '</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 3px 0;"><strong>Your Vat Number:</strong></td>
|
|
<td style="padding: 3px 0;">' . htmlspecialchars($invoice_data['customer']['vat_number'] ?? '') . '</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td width="50%" style="vertical-align: top; padding-left: 10px;">
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
|
<tr>
|
|
<td style="padding: 3px 0;"><strong>Reference:</strong></td>
|
|
<td style="padding: 3px 0;">Online order</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 3px 0;"><strong>Order number:</strong></td>
|
|
<td style="padding: 3px 0;">' . htmlspecialchars($order_id) . '</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 3px 0;"><strong>Payment Methodr:</strong></td>
|
|
<td style="padding: 3px 0;">' . (${$payment_method} ?? $invoice_data['header']['payment_method'] ). '</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- Items Table -->
|
|
<table role="presentation" cellspacing="0" cellpadding="8" border="0" width="100%" style="margin-bottom: 20px; border-bottom: 2px solid #999999;">
|
|
<thead>
|
|
<tr style="background-color: #f8f8f8;">
|
|
<th style="text-align: left; font-weight: bold; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid #999999;">Item code</th>
|
|
<th style="text-align: left; font-weight: bold; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid #999999;">Description</th>
|
|
<th style="text-align: center; font-weight: bold; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid #999999;">Quantity</th>
|
|
<th style="text-align: right; font-weight: bold; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid #999999;">Price</th>
|
|
<th style="text-align: right; font-weight: bold; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid #999999;">Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>';
|
|
|
|
foreach ($items as $item) {
|
|
$line_total = $item['price'] * $item['quantity'];
|
|
$message .= '<tr>
|
|
<td style="padding: 10px 8px; border-bottom: 1px solid #dddddd; font-size: 13px;">SOFTWARE</td>
|
|
<td style="padding: 10px 8px; border-bottom: 1px solid #dddddd; font-size: 13px;">' . htmlspecialchars($item['name']);
|
|
|
|
if ($item['serial_number'] !== 'N/A') {
|
|
$message .= '<br><span style="font-size: 12px; color: #666666;">Serial: ' . htmlspecialchars($item['serial_number']) . '</span>';
|
|
}
|
|
if ($item['license_key'] !== 'Pending') {
|
|
$message .= '<br><span style="font-size: 12px; color: #666666;">License: ' . htmlspecialchars($item['license_key']) . '</span>';
|
|
}
|
|
|
|
$message .= '</td>
|
|
<td style="text-align: center; padding: 10px 8px; border-bottom: 1px solid #dddddd; font-size: 13px;">' . htmlspecialchars($item['quantity']) . '</td>
|
|
<td style="text-align: right; padding: 10px 8px; border-bottom: 1px solid #dddddd; font-size: 13px;">€ ' . number_format($item['price'], 2) . '</td>
|
|
<td style="text-align: right; padding: 10px 8px; border-bottom: 1px solid #dddddd; font-size: 13px;">€ ' . number_format($line_total, 2) . '</td>
|
|
</tr>';
|
|
}
|
|
|
|
$message .= '</tbody>
|
|
</table>
|
|
|
|
<!-- Totals -->
|
|
<table role="presentation" cellspacing="0" cellpadding="5" border="0" width="250" align="right" style="margin-top: 10px; font-size: 13px;">
|
|
<tr>
|
|
<td style="text-align: left; padding: 5px 0;">' . htmlspecialchars($lbl_subtotal) . '</td>
|
|
<td style="text-align: right; padding: 5px 0;">€ ' . number_format($subtotal, 2) . '</td>
|
|
</tr>';
|
|
|
|
if ($tax_amount > 0) {
|
|
$message .= '<tr>
|
|
<td style="text-align: left; padding: 5px 0;">' . htmlspecialchars($lbl_tax) . '</td>
|
|
<td style="text-align: right; padding: 5px 0;">€ ' . number_format($tax_amount, 2) . '</td>
|
|
</tr>';
|
|
} else {
|
|
$message .= '<tr>
|
|
<td style="text-align: left; padding: 5px 0;">VAT</td>
|
|
<td style="text-align: right; padding: 5px 0;">included</td>
|
|
</tr>';
|
|
}
|
|
|
|
$message .= '<tr style="border-top: 2px solid #000000;">
|
|
<td style="text-align: left; padding: 8px 0 5px 0;"><strong>' . htmlspecialchars($lbl_total) . '</strong></td>
|
|
<td style="text-align: right; padding: 8px 0 5px 0;"><strong>€ ' . number_format($payment_amount, 2) . '</strong></td>
|
|
</tr>
|
|
</table>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>'; |