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

@@ -1280,6 +1280,11 @@ function showPaymentModal(option) {
</div>
</div>
<div>
<label style="display: block; margin-bottom: 5px; color: #333; font-weight: 500;">VAT Number</label>
<input type="text" name="vat_number" id="paymentVatNumber" placeholder="Optional" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;">
</div>
<div>
<label style="display: block; margin-bottom: 5px; color: #333; font-weight: 500;">Payment Method *</label>
<select name="payment_method" required style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;">
@@ -1354,6 +1359,7 @@ function showPaymentModal(option) {
if (customerData.address) document.getElementById("paymentAddress").value = customerData.address;
if (customerData.city) document.getElementById("paymentCity").value = customerData.city;
if (customerData.postal) document.getElementById("paymentPostal").value = customerData.postal;
if (customerData.vat_number) document.getElementById("paymentVatNumber").value = customerData.vat_number;
if (customerData.country) {
document.getElementById("paymentCountry").value = customerData.country;
updateTaxDisplay(); // Calculate tax based on saved country
@@ -1392,6 +1398,7 @@ function showPaymentModal(option) {
city: formData.get("city"),
postal: formData.get("postal"),
country: formData.get("country"),
vat_number: formData.get("vat_number") || '',
payment_method: paymentMethod,
payment_provider: paymentProvider,
version_id: option.version_id,
@@ -1408,7 +1415,8 @@ function showPaymentModal(option) {
address: paymentData.address,
city: paymentData.city,
postal: paymentData.postal,
country: paymentData.country
country: paymentData.country,
vat_number: paymentData.vat_number
}));
await processPayment(paymentData, option, modal);