diff --git a/.DS_Store b/.DS_Store
index 9d4c452..0b0a16d 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/account_manage.php b/account_manage.php
index a2c3161..eb225fa 100644
--- a/account_manage.php
+++ b/account_manage.php
@@ -272,7 +272,7 @@ $view .= '
//Dropdown
$partner_data = json_decode($_SESSION['authorization']['partnerhierarchy']);
-$soldto_dropdown = listPartner('soldto',$accounthierarchy->soldto,'',$_SESSION['authorization']['permission']);
+$soldto_dropdown = listPartner('soldto',$_SESSION['authorization']['permission'],$accounthierarchy->soldto,'');
$view .= '
'.$tab3.'
diff --git a/api/v2/get/catalog.php b/api/v2/get/catalog.php
index 56d1126..97a1b6d 100644
--- a/api/v2/get/catalog.php
+++ b/api/v2/get/catalog.php
@@ -1,6 +1,10 @@
$item['version'],
'config_setting' => $item['config'],
- 'main_option_for_display' => $item['measurement'],
+ 'main_option_for_display' => $item['measurement'] ?? '',
'configurations' => []
];
}
@@ -170,6 +174,64 @@ removeKeysRecursive($catalog,$keys_to_remove);
//------------------------------------------
$messages = processProductCollection($catalog);
+//------------------------------------------
+//check for METAfeed request
+//------------------------------------------
+if (isset($criterias['meta'])){
+ //------------------------------------------
+ // Meta Feed Configuration
+ //------------------------------------------
+ $meta_config = [
+ 'base_url' => 'https://www.morvalwatches.com', // Product page URL
+ 'image_base_url' => 'https://cloud.soveliti.nl',
+ 'brand' => 'Morval Watches',
+ 'currency' => 'EUR',
+ 'condition' => 'new',
+ 'availability' => 'in stock',
+ 'google_product_category' => 'Apparel & Accessories > Jewelry > Watches',
+ 'output_format' => 'json' // Options: 'csv', 'xml', 'json'
+ ];
+
+ //------------------------------------------
+ // Product Code Based Descriptions
+ // Keys can be: exact code (MWTH2NB) or pattern (MWTH1*, MWTH2*)
+ //------------------------------------------
+ $meta_descriptions = [
+ // Pattern based (will match any product starting with this)
+ 'MWTH1' => 'The Thomas-I exudes elegance and sophistication. Classic dimensions combined with subtle details in the dial make it an special automatic watch that can be worn on all occasions.',
+ 'MWTH2' => 'The Thomas-II provides a view of the beating heart of the Swiss timepiece. It marks the precision and perfection with which the time is displayed.',
+ 'MWABR' => 'Handmade Italian calf leather bracelet',
+ ];
+
+ //------------------------------------------
+ //Include meta functions
+ //------------------------------------------
+ include_once './assets/functions_meta.php';
+
+ $meta_feed = catalogToMetaFeed($messages, $meta_config);
+ //------------------------------------------
+ // Output based on format parameter
+ //------------------------------------------
+ if ($criterias['meta'] === true) {
+ $format = $meta_config['output_format'];
+ } else {
+ $format = $criterias['meta'];
+ }
+
+ switch ($format) {
+ case 'xml':
+ $messages = outputMetaFeedXML($meta_feed);
+ break;
+ case 'csv':
+ $messages = outputMetaFeedCSV($meta_feed);
+ break;
+ case 'json':
+ default:
+ $messages = outputMetaFeedJSON($meta_feed);
+ break;
+ }
+ exit();
+}
//------------------------------------------
//JSON_ENCODE
//------------------------------------------
diff --git a/api/v2/get/history.php b/api/v2/get/history.php
index aa81a11..c2ff77a 100644
--- a/api/v2/get/history.php
+++ b/api/v2/get/history.php
@@ -102,7 +102,7 @@ if(isset($get_content) && $get_content!=''){
//Filter out only relevant servicereports
$filter_key_1 = '"%serialnumber%"';
$filter_key_2 = '"ServiceReport"';
- $clause .= ' AND h.type = '.$filter_key_2.' AND NOT e.productrowid = "31" AND h.description like '.$filter_key_1;
+ $clause .= ' AND h.type = '.$filter_key_2.' AND e.productrowid = "31" AND h.description like '.$filter_key_1;
//remove from criterias to prevent double binding
unset($criterias[$v[0]]);
}
diff --git a/api/v2/get/products_software_licenses.php b/api/v2/get/products_software_licenses.php
index f47175d..6b9a1d0 100644
--- a/api/v2/get/products_software_licenses.php
+++ b/api/v2/get/products_software_licenses.php
@@ -51,7 +51,7 @@ if(isset($get_content) && $get_content!=''){
//Define Query
if(isset($criterias['totals']) && $criterias['totals'] ==''){
//Request for total rows
- $sql = 'SELECT count(*) as count FROM products_software_licenses '.$whereclause.'';
+ $sql = 'SELECT count(*) as count FROM products_software_licenses l '.$whereclause.'';
}
elseif (isset($criterias['list']) && $criterias['list'] =='') {
//SQL for list
diff --git a/assets/mail/pdf_template_invoice.php b/assets/mail/pdf_template_invoice.php
index 29aea68..33a8a1b 100644
--- a/assets/mail/pdf_template_invoice.php
+++ b/assets/mail/pdf_template_invoice.php
@@ -308,8 +308,9 @@ $pdf .= '
';
if ($tax_amount > 0) {
+ $tax_percentage = ($subtotal > 0) ? round(($tax_amount / $subtotal) * 100, 2) : 0;
$pdf .= '
-
' . htmlspecialchars($lbl_tax) . '
+
' . htmlspecialchars($lbl_tax) . ' (' . $tax_percentage . '%)
€ ' . number_format($tax_amount, 2) . '
';
} else {
diff --git a/assets/softwaretool.js b/assets/softwaretool.js
index a8855c8..4e5e8f4 100644
--- a/assets/softwaretool.js
+++ b/assets/softwaretool.js
@@ -230,6 +230,10 @@ async function connectDeviceForSoftware() {
deviceVersion = "";
deviceHwVersion = "";
+ // Clear the flag so popup shows for each new device connection
+ // This allows users to connect multiple devices in the same session
+ sessionStorage.removeItem('customerDataShownThisSession');
+
//set progress bar
progressBar("1", "", "");
@@ -612,14 +616,23 @@ async function fetchSoftwareOptions() {
document.getElementById("softwareOptionsContainer").style.display = "block";
progressBar("100", "Software options loaded", "#04AA6D");
- // Check if customer data already exists in sessionStorage
- const savedCustomerData = sessionStorage.getItem('customerData');
+ // Check if we're returning from a payment
+ const urlParams = new URLSearchParams(window.location.search);
+ const isReturningFromPayment = urlParams.has('payment_return') || urlParams.has('order_id');
- // Show user info modal only if no saved data and not in debug mode
- if ((typeof DEBUG === 'undefined' || !DEBUG || typeof DEBUG_ID === 'undefined' || !DEBUG_ID) && !savedCustomerData) {
+ // Check if customer data was already shown in THIS session (not from previous session)
+ const customerDataShownThisSession = sessionStorage.getItem('customerDataShownThisSession');
+
+ // Show user info modal unless:
+ // 1. We're in debug mode
+ // 2. We're returning from payment
+ // 3. We already showed the modal in this session
+ if ((typeof DEBUG === 'undefined' || !DEBUG || typeof DEBUG_ID === 'undefined' || !DEBUG_ID)
+ && !isReturningFromPayment
+ && !customerDataShownThisSession) {
showUserInfoModal();
} else {
- // Customer data already exists or debug mode - reveal software options immediately
+ // Debug mode, returning from payment, or already shown this session - reveal software options immediately
const softwareOptions = document.getElementById("softwareOptions");
if (softwareOptions) {
softwareOptions.style.filter = "none";
@@ -992,6 +1005,9 @@ function showUserInfoModal() {
// Save customer data to sessionStorage
sessionStorage.setItem('customerData', JSON.stringify(customerData));
+ // Mark that we've shown the customer data modal in this session
+ sessionStorage.setItem('customerDataShownThisSession', 'true');
+
// Send to API
await sendUserInfoToAPI(customerData);
diff --git a/contract_manage.php b/contract_manage.php
index 9d7b602..7c46e33 100644
--- a/contract_manage.php
+++ b/contract_manage.php
@@ -248,10 +248,10 @@ $view .='
$partner_data = json_decode($contract['accounthierarchy']);
//BUID UP DROPDOWNS
-$salesid_dropdown = listPartner('salesid',$partner_data->salesid,'',$_SESSION['authorization']['permission']);
-$soldto_dropdown = listPartner('soldto',$partner_data->soldto,'',$_SESSION['authorization']['permission']);
-$shipto_dropdown = listPartner('shipto',$partner_data->shipto,'',$_SESSION['authorization']['permission']);
-$location_dropdown = listPartner('location',$partner_data->location,'',$_SESSION['authorization']['permission']);
+$salesid_dropdown = listPartner('salesid',$_SESSION['authorization']['permission'],$partner_data->salesid,'');
+$soldto_dropdown = listPartner('soldto',$_SESSION['authorization']['permission'],$partner_data->soldto,'');
+$shipto_dropdown = listPartner('shipto',$_SESSION['authorization']['permission'],$partner_data->shipto,'');
+$location_dropdown = listPartner('location',$_SESSION['authorization']['permission'],$partner_data->location,'');
//DISPLAY
$view .= '
diff --git a/equipment_manage.php b/equipment_manage.php
index e72fa6e..8e8f031 100644
--- a/equipment_manage.php
+++ b/equipment_manage.php
@@ -216,10 +216,10 @@ $view .= '
//GET PARTNERDATA
$partner_data = json_decode($equipment['accounthierarchy']);
//BUID UP DROPDOWNS
-$salesid_dropdown = listPartner('salesid',$partner_data->salesid,'',$_SESSION['authorization']['permission']);
-$soldto_dropdown = listPartner('soldto',$partner_data->soldto,'',$_SESSION['authorization']['permission']);
-$shipto_dropdown = listPartner('shipto',$partner_data->shipto,'',$_SESSION['authorization']['permission']);
-$location_dropdown = listPartner('location',$partner_data->location,'',$_SESSION['authorization']['permission']);
+$salesid_dropdown = listPartner('salesid',$_SESSION['authorization']['permission'],$partner_data->salesid,'');
+$soldto_dropdown = listPartner('soldto',$_SESSION['authorization']['permission'],$partner_data->soldto,'');
+$shipto_dropdown = listPartner('shipto',$_SESSION['authorization']['permission'],$partner_data->shipto,'');
+$location_dropdown = listPartner('location',$_SESSION['authorization']['permission'],$partner_data->location,'');
if (isset($partner_data->section)){$section = getPartnerName($partner_data->section) ?? 'Not specified';} else {$section = 'Not specified';}
diff --git a/equipments_mass_update.php b/equipments_mass_update.php
index b0e44f1..565043e 100644
--- a/equipments_mass_update.php
+++ b/equipments_mass_update.php
@@ -200,10 +200,10 @@ $view .= '