check order reservation update and payment route fixed

This commit is contained in:
phyusin
2018-06-08 16:50:06 +06:30
parent 630e82a306
commit c8642548e5
9 changed files with 111 additions and 101 deletions

View File

@@ -573,7 +573,7 @@
var menus = JSON.parse(localStorage.getItem("menus"));
if (menus != null) {
var id = menus[0]["categories"][0]["id"];
console.log(id);
// console.log(id);
}else{
var id = 1;
}
@@ -583,7 +583,6 @@
$(document).ready(function () {
var menus = JSON.parse(localStorage.getItem("menus"));
if (menus != null) {
console.log("menu");
menu_cache_append(menus);
}else{
$("#menu_data").removeClass("hidden");

View File

@@ -211,23 +211,8 @@
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
<script>
$(function() {
$( "#loading_wrapper").show();
$.ajax({
type: "GET",
url: 'get_all_menu',
data: {},
success:function(result){
localStorage.setItem("menus", JSON.stringify(result));
var menu = localStorage.getItem("menus");
if (menu != null ) {
$( "#loading_wrapper").hide();
}
}
});
$("#loading_wrapper").show();
getAllMenu();
$(".cashier_view").on('click', function() {
window.location.href = '/origami';

View File

@@ -1,4 +1,7 @@
<div class="container-fluid">
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<div class="row">
<!-- Column One -->
<div class="<%= @webview==true ? 'col-lg-12 col-md-12 col-sm-12' : 'col-lg-10 col-md-10 col-sm-10' %>">
@@ -144,6 +147,11 @@ $(document).ready(function(){
var webview = <%= @webview %>;
showHideNavbar(webview,"index");
if(webview){
$("#loading_wrapper").show();
getAllMenu();
}
$(".tables").on('click', function(){
var dining_id = $(this).attr("data-id");
window.location.href = '/origami/table/' + dining_id;

View File

@@ -218,7 +218,7 @@ $('#jcb_pay').on('click',function(){
//end member discount
if(bank_integration == '1'){
$("#reference_no").val("");
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no);
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no,cashier_type);
}else{
$.ajax({type: "POST",
url: "<%= origami_payment_jcb_path %>",

View File

@@ -1064,52 +1064,50 @@ var pdf_view = '<%=@pdf_view%>';
var printer_name = $("#printer_name").val();
var receipt_no = $("#sale_receipt_no").val();
var params = { 'filename':filename, 'receipt_no':receipt_no, 'printer_name':printer_name };
$.ajax({
type: "POST",
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
data: params,
success:function(result){
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
if (pdf_view ==1) {
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
customer_display_view(null,"reload");
}
}else{
var title = "Payment Successful!";
if($('#balance').text() < 0){
var text = 'Changed amount ' + $('#balance').text() * (-1);
}else{
$('#pay').text("Pay");
var text = 'Thank You !';
}
swal({
title: "Payment Successful!",
text: text,
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
customer_display_view(null,"reload");
}
});
}
$.ajax({
type: "POST",
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
data: params,
success:function(result){
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
});
if (pdf_view ==1) {
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
customer_display_view(null,"reload");
}
}else{
var title = "Payment Successful!";
if($('#balance').text() < 0){
var text = 'Changed amount ' + $('#balance').text() * (-1);
}else{
$('#pay').text("Pay");
var text = 'Thank You !';
}
swal({
title: "Payment Successful!",
text: text,
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
customer_display_view(null,"reload");
}
});
}
}
});
}