Refactor invoice PDF generation and VAT validation
- Updated PDF template to display a fixed software code instead of "SOFTWARE". - Changed VAT label to include tax label dynamically and set to 0% for certain conditions. - Enhanced JavaScript for VAT number validation with asynchronous checks against the VIES database. - Implemented debounce for VAT number input to optimize validation calls. - Updated country settings to include country codes for VAT validation. - Modified email sending functions in webhook handlers to use dynamic attachment names for invoices.
This commit is contained in:
@@ -70,7 +70,7 @@ $message = '
|
||||
<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;"><strong>Payment Method:</strong></td>
|
||||
<td style="padding: 3px 0;">' . (${$payment_method} ?? $invoice_data['header']['payment_method'] ). '</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -94,7 +94,7 @@ $message = '
|
||||
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;">110.600.000</td>
|
||||
<td style="padding: 10px 8px; border-bottom: 1px solid #dddddd; font-size: 13px;">' . htmlspecialchars($item['name']);
|
||||
|
||||
if ($item['serial_number'] !== 'N/A') {
|
||||
@@ -132,7 +132,7 @@ if ($tax_amount > 0) {
|
||||
<td style="text-align: right; padding: 5px 0;">€ ' . number_format($tax_amount, 2) . '</td>
|
||||
</tr>';
|
||||
} else {
|
||||
$vat_label = 'VAT';
|
||||
$vat_label = htmlspecialchars($lbl_tax) . ' (0%)';
|
||||
if (!empty($vat_note)) {
|
||||
$vat_label .= ' <small style="font-size: 11px; color: #888;">(' . htmlspecialchars($vat_note) . ')</small>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user