fix: add qr flow in add order

This commit is contained in:
Pyae Bhone Zaw
2025-06-30 11:40:11 +06:30
committed by DevTeam
parent e322cf6c7e
commit aaf6d6a4e5
2 changed files with 43 additions and 34 deletions

View File

@@ -743,7 +743,7 @@ $(document).on('click', '#clear_all', function(event){
});
function customer_display_view(data,status) {
url = '../../../../foodcourt/customer_view';
url = '../../../../origami/customer_view';
$.ajax({
type: "POST",
url: url,

View File

@@ -479,7 +479,7 @@
<% if current_user.role != "waiter" && @status == "sale"%>
<hr>
<button type="button" id="void" class="btn btn-block bg-red waves-effect" >VOID</button>
<button type="button" id="pay" class="btn bg-blue btn-block" data-toggle="modal" data-target="#read_modal">Pay</button>
<button type="button" id="pay" class="btn bg-blue btn-block" data-toggle="modal" data-target="#payment_modal">Pay</button>
<%end%>
<% if @status != "sale"%>
@@ -606,15 +606,24 @@
if(dynamicQR) {
document.querySelector('.payment-card#dynamic_qr').addEventListener('click', function() {
document.getElementById('fullpage-loading').style.display = 'flex';
setTimeout(function() {
document.getElementById('fullpage-loading').style.display = 'none';
}, 5000);
const urlParams = new URLSearchParams(window.location.search);
const pending_id = urlParams.get('pending_id');
if (pending_id && pending_id.startsWith('SAL')) {
window.location.href = `/foodcourt/${pending_id}/qrpay/precreate`;
} else {
initDynamicQrPay();
}
});
}
// function precreateDynamicQrPay() {
// var sale_id = $("#sale_id").text() || 0;
// window.location.href = `/foodcourt/${sale_id}/qrpay/precreate`;
// }
function initDynamicQrPay() {
const paymentMethod = 'MMQR';
@@ -632,7 +641,7 @@
return;
}
window.location.href = `/foodcourt/${result.sale_id}/qrpay/init`;
window.location.href = `/foodcourt/${result.sale_id}/qrpay/precreate`;
if ($serverMode.val() !== "cloud" && $("#display_type").val() === "2") {
// customer_display_view(null, "reload");
}