minor fix for qrpay init
This commit is contained in:
@@ -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;
|
||||
|
||||
1308
app/views/foodcourt/qrpay/init.html.erb
Normal file
1308
app/views/foodcourt/qrpay/init.html.erb
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user