Refactor invoice creation in webhooks to include accounthierarchy field. Update SQL statements in both PayPal and Mollie webhooks for consistency.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user