fix: add qr flow in add order
This commit is contained in:
@@ -743,7 +743,7 @@ $(document).on('click', '#clear_all', function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
function customer_display_view(data,status) {
|
function customer_display_view(data,status) {
|
||||||
url = '../../../../foodcourt/customer_view';
|
url = '../../../../origami/customer_view';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
@@ -479,7 +479,7 @@
|
|||||||
<% if current_user.role != "waiter" && @status == "sale"%>
|
<% if current_user.role != "waiter" && @status == "sale"%>
|
||||||
<hr>
|
<hr>
|
||||||
<button type="button" id="void" class="btn btn-block bg-red waves-effect" >VOID</button>
|
<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%>
|
<%end%>
|
||||||
|
|
||||||
<% if @status != "sale"%>
|
<% if @status != "sale"%>
|
||||||
@@ -606,15 +606,24 @@
|
|||||||
|
|
||||||
if(dynamicQR) {
|
if(dynamicQR) {
|
||||||
document.querySelector('.payment-card#dynamic_qr').addEventListener('click', function() {
|
document.querySelector('.payment-card#dynamic_qr').addEventListener('click', function() {
|
||||||
document.getElementById('fullpage-loading').style.display = 'flex';
|
|
||||||
|
|
||||||
setTimeout(function() {
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
document.getElementById('fullpage-loading').style.display = 'none';
|
const pending_id = urlParams.get('pending_id');
|
||||||
}, 5000);
|
|
||||||
|
if (pending_id && pending_id.startsWith('SAL')) {
|
||||||
|
window.location.href = `/foodcourt/${pending_id}/qrpay/precreate`;
|
||||||
|
} else {
|
||||||
initDynamicQrPay();
|
initDynamicQrPay();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function precreateDynamicQrPay() {
|
||||||
|
// var sale_id = $("#sale_id").text() || 0;
|
||||||
|
// window.location.href = `/foodcourt/${sale_id}/qrpay/precreate`;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
function initDynamicQrPay() {
|
function initDynamicQrPay() {
|
||||||
const paymentMethod = 'MMQR';
|
const paymentMethod = 'MMQR';
|
||||||
@@ -632,7 +641,7 @@
|
|||||||
return;
|
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") {
|
if ($serverMode.val() !== "cloud" && $("#display_type").val() === "2") {
|
||||||
// customer_display_view(null, "reload");
|
// customer_display_view(null, "reload");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user