minor fix for qrpay init

This commit is contained in:
Dev Team
2025-05-21 16:42:36 +06:30
parent 4e5e74849d
commit 82736aa038
4 changed files with 1561 additions and 5 deletions

View File

@@ -795,10 +795,44 @@ showHideNavbar(webview);
<% end %>
});
/* MMQR INTEGRATION **/
$(document).on('click','#mmqr_btn', function(event){
const paymentMethod = 'MMQR';
create_order($(this),paymentMethod);
let table_id = $("#table_id").text();
let booking_id = $("#booking_id").text();
let customer_id = $("#customer_id").text();
let params = {
order_source: "food_court",
order_type: "dine_in",
customer_id: customer_id,
guest_info: "",
table_id: table_id,
order_items: JSON.stringify(get_order_item_rows()),
create_type: "create_pay",
};
$.ajax({
type: "POST",
url: '/foodcourt/addorders/create',
data: params,
dataType: "json",
success: function (result) {
booking_id = result.booking_id;
console.log(result);
window.location.href = `/foodcourt/${result.sale_id}/qrpay/init#`
// `/foodcourt/sale/${result.sale_id}/${cashier_type}/payment`;
if ($("#server_mode").val() != "cloud" && second_display_lookup == 2) {
customer_display_view(null, "reload");
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$("#oqs_loading_wrapper").hide();
$("#create_order").prop("disabled", false);
$("#create_pay_order").prop("disabled", false);
swal("Error", "Status: " + textStatus, "error");
},
});
})
function create_order(data,paymentMethod = "") {
@@ -861,9 +895,6 @@ function create_order(data,paymentMethod = "") {
}else if (type == "food_court" && paymentMethod == "") {
window.location.href =
"/foodcourt/app_orders?pending_id=" + booking_id;
}else if (type == "food_court" && paymentMethod == "MMQR") {
window.location.href =
`/foodcourt/sale/${result.sale_id}/${cashier_type}/payment`;
}else {
if (table_type == "Table") {
window.location.href = "/origami/table/" + table_id;

File diff suppressed because it is too large Load Diff