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:
@@ -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>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user