fix modal

This commit is contained in:
aungthetkhaing
2025-06-03 14:00:18 +06:30
parent ef0629bf31
commit 5b374dc48f
3 changed files with 1904 additions and 1465 deletions

View File

@@ -219,13 +219,12 @@
<button type="button" class="btn btn-primary action-btn create col-md-12 m-t-5" id="create_pay_order" disabled="disabled" data-toggle="modal" data-target="#read_modal" style=" height: 50px; width: 100%;">Update Order & Pay</button>
<% else %>
<% if @sale_id.nil?%>
<button type="button" class="btn btn-primary action-btn create col-md-6 d-inline" id="create_pay_order" disabled="disabled" data-toggle="modal" data-target="#read_modal" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
<button type="button" class="btn btn-primary action-btn create col-md-5 d-inline" id="create_pay_order" disabled="disabled" data-toggle="modal" data-target="#payment_modal" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
<% else %>
<button type="button" class="btn btn-primary action-btn create col-md-6 d-inline" id="add_to_existing_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
<button type="button" class="btn btn-primary action-btn create col-md-5 d-inline" id="add_to_existing_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
<% end %>
<button type="button" class="btn btn-warning action-btn create col-md-6 d-inline" id="mmqr" disabled="disabled" style="padding-top:15px !important;padding-bottom:15px !important;">MMQR</button>
<button type="button" class="btn btn-primary w-full action-btn create col-md-7 d-inline" id="create_order" disabled="disabled" style="padding-top:15px !important;padding-bottom:15px !important;">Add Order</button>
</div>
<button type="button" class="btn btn-primary w-full action-btn create col-12 d-inline" id="create_order" disabled="disabled" style="padding-top:15px !important;padding-bottom:15px !important;">Add Order</button>
<% end %>
</div>
</div>
@@ -878,47 +877,4 @@ function create_order(data,paymentMethod = "") {
},
});
}
$('#mmqr').click(function() {
// alert("MMQR");
const paymentMethod = 'MMQR';
const $serverMode = $('#server_mode');
const $createOrderBtn = $('#create_order');
const $createPayOrderBtn = $('#create_pay_order');
const params = {
order_source: "food_court",
order_type: "dine_in",
customer_id: $("#customer_id").text(),
guest_info: "",
table_id: $("#table_id").text(),
order_items: JSON.stringify(get_order_item_rows()),
create_type: "create_pay",
};
$.ajax({
url: '/foodcourt/addorders/create',
method: 'POST',
contentType: 'application/json',
headers: {
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
},
data: JSON.stringify(params),
success: function(result) {
const booking_id = result.booking_id;
window.location.href = `/foodcourt/${result.sale_id}/qrpay/init`;
if ($serverMode.val() !== "cloud" && $("#display_type").val() === "2") {
// customer_display_view(null, "reload");
}
},
error: function(xhr) {
$('#oqs_loading_wrapper').hide();
$createOrderBtn.prop('disabled', false);
$createPayOrderBtn.prop('disabled', false);
const errorMsg = xhr.status ? `Status: ${xhr.status} - ${xhr.statusText}` : "Network error";
// swal("Error", errorMsg, "error");
}
});
})
</script>