Add VAT number handling in order processing and invoice templates

This commit is contained in:
“VeLiTi”
2026-01-27 18:36:21 +01:00
parent f7a91737bc
commit f7733b4113
14 changed files with 81 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
<?php
$payment_method = 'payment_method_'.$invoice_data['header']['payment_method'];
$message = '
<!DOCTYPE html>
@@ -30,11 +31,28 @@ $message = '
5061 JR OISTERWIJK<br>
Nederland
</td>
<td width="50%" style="vertical-align: top; text-align: right;">
<!-- Contact details if needed -->
<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;">
@@ -49,6 +67,10 @@ $message = '
<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;">
@@ -61,6 +83,10 @@ $message = '
<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>

View File

@@ -1,4 +1,5 @@
<?php
$payment_method = 'payment_method_'.$invoice_data['header']['payment_method'];
$pdf = '<!DOCTYPE html>
<html lang="' . strtolower($language) . '">
@@ -217,6 +218,20 @@ $pdf = '<!DOCTYPE html>
<p>Nederland</p>
</div>
<div class="contact-details">
<h3>contact-details</h3>
<p>Ralf Adams</p>
<p>+31 13 8221480</p>
<p>ralfadams@totalsafetysolutions.nl</p>
</div>
</div>
<div class="company-header">
<div class="company-info">
<h3>Customer</h3>
<p>'.$invoice_data['customer']['name'].'</p>
<p>'.$invoice_data['customer']['street'].'</p>
<p>'.$invoice_data['customer']['zip'].', '.$invoice_data['customer']['city'].'</p>
<p>'.$invoice_data['customer']['country'].'</p>
</div>
</div>
@@ -230,6 +245,10 @@ $pdf = '<!DOCTYPE html>
<div class="detail-label">Invoice Number</div>
<div class="detail-value">: ' . htmlspecialchars($order_id) . '</div>
</div>
<div class="detail-row">
<div class="detail-label">Your Vat Number</div>
<div class="detail-value">: ' . htmlspecialchars($invoice_data['customer']['vat_number'] ?? '') . '</div>
</div>
</div>
<div class="invoice-right">
<div class="detail-row">
@@ -240,6 +259,10 @@ $pdf = '<!DOCTYPE html>
<div class="detail-label">Order number</div>
<div class="detail-value">: ' . htmlspecialchars($order_id) . '</div>
</div>
<div class="detail-row">
<div class="detail-label">Payment Method</div>
<div class="detail-value">: ' . (${$payment_method} ?? $invoice_data['header']['payment_method'] ). '</div>
</div>
</div>
</div>