diff --git a/.DS_Store b/.DS_Store
index 8f76464..9d4c452 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/api/v2/get/software_update.php b/api/v2/get/software_update.php
index 98f7cb9..a7191c3 100644
--- a/api/v2/get/software_update.php
+++ b/api/v2/get/software_update.php
@@ -468,6 +468,16 @@ if (isset($criterias['sn']) && $criterias['sn'] != ''){
];
}
+ // Sort output: is_current = true first, then by price low to high
+ usort($output, function($a, $b) {
+ // First priority: is_current (true comes before false)
+ if ($a['is_current'] !== $b['is_current']) {
+ return $b['is_current'] - $a['is_current'];
+ }
+ // Second priority: price (low to high)
+ return floatval($a['price']) - floatval($b['price']);
+ });
+
$messages = $output;
if (debug && !empty($output)) {
diff --git a/api/v2/post/placeorder.php b/api/v2/post/placeorder.php
index b6e7b37..306af85 100644
--- a/api/v2/post/placeorder.php
+++ b/api/v2/post/placeorder.php
@@ -46,7 +46,8 @@ if (isset($post_content['cart']) && isset($post_content['checkout_input']) && is
'address_state' => $post_content['customer_details']['address_state'] ?? '',
'address_zip' => $post_content['customer_details']['address_zip'] ?? '',
'address_country' => $post_content['customer_details']['address_country'] ?? '',
- 'address_phone' => $post_content['customer_details']['address_phone'] ?? ''
+ 'address_phone' => $post_content['customer_details']['address_phone'] ?? '',
+ 'vat_number' => $post_content['customer_details']['vat_number'] ?? ''
];
//Initialize calculator
@@ -75,7 +76,7 @@ if (isset($post_content['cart']) && isset($post_content['checkout_input']) && is
$txn_id = strtoupper(uniqid('SC') . substr(md5(mt_rand()), 0, 5));
// Insert transaction header
- $stmt = $pdo->prepare('INSERT INTO transactions (txn_id, payment_amount, payment_status, payer_email, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_phone, account_id, payment_method, shipping_method, shipping_amount, discount_amount, discount_code, tax_amount,accounthierarchy) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
+ $stmt = $pdo->prepare('INSERT INTO transactions (txn_id, payment_amount, payment_status, payer_email, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_phone, account_id, payment_method, shipping_method, shipping_amount, discount_amount, discount_code, tax_amount,accounthierarchy, vat_number) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
$stmt->execute([
$txn_id,
$total,
@@ -96,7 +97,8 @@ if (isset($post_content['cart']) && isset($post_content['checkout_input']) && is
$discounttotal,
$checkout_input['discount_code'],
$taxtotal,
- $partner_product
+ $partner_product,
+ $customer_details['vat_number']
]);
// Get order ID
$transaction_id = $pdo->lastInsertId();
diff --git a/assets/.DS_Store b/assets/.DS_Store
index 7502f1f..1ba4cf5 100644
Binary files a/assets/.DS_Store and b/assets/.DS_Store differ
diff --git a/assets/functions.php b/assets/functions.php
index 400aa0a..2d8d875 100644
--- a/assets/functions.php
+++ b/assets/functions.php
@@ -4559,6 +4559,7 @@ function transformOrderData(array $orderData): array {
'country' => $firstRow['address_country'],
'phone' => $firstRow['address_phone'],
'language' => $firstRow['user_language'],
+ 'vat_number' => $firstRow['vat_number']
],
'products' => [],
'invoice' => [
diff --git a/assets/mail/email_template_invoice.php b/assets/mail/email_template_invoice.php
index f45d166..429edea 100644
--- a/assets/mail/email_template_invoice.php
+++ b/assets/mail/email_template_invoice.php
@@ -1,4 +1,5 @@
@@ -30,11 +31,28 @@ $message = '
5061 JR OISTERWIJK
Nederland
-
-
+ |
+ contact-details
+ Ralf Adams
+ +31 13 8221480
+ ralfadams@totalsafetysolutions.nl
|
+
+
+
+
+
+ Customer
+ '.$invoice_data['customer']['name'].'
+ '.$invoice_data['customer']['street'].'
+ '.$invoice_data['customer']['zip'].', '.$invoice_data['customer']['city'].'
+ '.$invoice_data['customer']['country'].'
+ |
+
+
+
@@ -49,6 +67,10 @@ $message = '
| Invoice Number: |
' . htmlspecialchars($order_id) . ' |
+
+ | Your Vat Number: |
+ ' . htmlspecialchars($invoice_data['customer']['vat_number'] ?? '') . ' |
+
@@ -61,6 +83,10 @@ $message = '
| Order number: |
' . htmlspecialchars($order_id) . ' |
+
+ | Payment Methodr: |
+ ' . (${$payment_method} ?? $invoice_data['header']['payment_method'] ). ' |
+
diff --git a/assets/mail/pdf_template_invoice.php b/assets/mail/pdf_template_invoice.php
index f30e7e9..29aea68 100644
--- a/assets/mail/pdf_template_invoice.php
+++ b/assets/mail/pdf_template_invoice.php
@@ -1,4 +1,5 @@
@@ -217,6 +218,20 @@ $pdf = '
Nederland
+
+
+
@@ -230,6 +245,10 @@ $pdf = '
Invoice Number
: ' . htmlspecialchars($order_id) . '
+
+
Your Vat Number
+
: ' . htmlspecialchars($invoice_data['customer']['vat_number'] ?? '') . '
+
@@ -240,6 +259,10 @@ $pdf = '
Order number
: ' . htmlspecialchars($order_id) . '
+
+
Payment Method
+
: ' . (${$payment_method} ?? $invoice_data['header']['payment_method'] ). '
+
diff --git a/assets/softwaretool.js b/assets/softwaretool.js
index e730632..93707de 100644
--- a/assets/softwaretool.js
+++ b/assets/softwaretool.js
@@ -1280,6 +1280,11 @@ function showPaymentModal(option) {
+
+
+
+
+