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:
“VeLiTi”
2026-02-06 16:02:56 +01:00
parent 4b83f596f1
commit 3131c2c5b2
12 changed files with 542 additions and 163 deletions

View File

@@ -271,7 +271,7 @@ $pdf = '<!DOCTYPE html>
foreach ($items as $item) {
$line_total = $item['price'] * $item['quantity'];
$pdf .= '<tr>
<td>SOFTWARE</td>
<td>110.600.000</td>
<td>' . htmlspecialchars($item['name']);
if ($item['serial_number'] !== 'N/A') {
@@ -308,7 +308,7 @@ $pdf .= '</tbody>
<div class="total-amount">€ ' . number_format($tax_amount, 2) . '</div>
</div>';
} else {
$vat_label = 'VAT';
$vat_label = htmlspecialchars($lbl_tax) . ' (0%)';
if (!empty($vat_note)) {
$vat_label .= ' <small style="font-size: 9px; color: #666;">(' . htmlspecialchars($vat_note) . ')</small>';
}