second display
This commit is contained in:
@@ -1,17 +1,16 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
var role = $('#role').val();
|
var role = $('#role').val();
|
||||||
var second_display_lookup = $("#display_type").val();
|
var second_display_lookup = $("#display_type").val();
|
||||||
console.log(second_display_lookup);
|
|
||||||
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
||||||
modify_order = window.location.href.indexOf("modify_order");
|
modify_order = window.location.href.indexOf("modify_order");
|
||||||
|
|
||||||
//click menu sidebar menu category
|
//click menu sidebar menu category
|
||||||
$(".product").on("click", function(){
|
$(".product").on("click", function(){
|
||||||
var url = $(this).attr('data-ref');
|
var url = $(this).attr('data-ref');
|
||||||
show_product_list(url);
|
show_product_list(url);
|
||||||
});
|
});
|
||||||
//show menu item list when click menu category
|
//show menu item list when click menu category
|
||||||
function show_product_list(url_item){
|
function show_product_list(url_item){
|
||||||
|
|
||||||
var menu_list = $('.menu_items_list');
|
var menu_list = $('.menu_items_list');
|
||||||
menu_list.empty();
|
menu_list.empty();
|
||||||
@@ -25,20 +24,19 @@ $(function() {
|
|||||||
if (type ==-1 && modify_order == -1){
|
if (type ==-1 && modify_order == -1){
|
||||||
url_item = url_item
|
url_item = url_item
|
||||||
}
|
}
|
||||||
console.log(url_item)
|
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url_item,
|
url: url_item,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
var menu_items_list = $('.menu_items_list');
|
var menu_items_list = $('.menu_items_list');
|
||||||
menu_items_list.empty();
|
menu_items_list.empty();
|
||||||
product = data;
|
product = data;
|
||||||
|
|
||||||
for(var field in product) {
|
for(var field in product) {
|
||||||
if (product[field].unit_price > 0) {
|
if (product[field].unit_price > 0) {
|
||||||
qty = 1;
|
qty = 1;
|
||||||
options = [];
|
options = [];
|
||||||
@@ -92,13 +90,13 @@ $(function() {
|
|||||||
+'<span>'+ product[field].unit_price +'</span>'
|
+'<span>'+ product[field].unit_price +'</span>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>';
|
+'</div>';
|
||||||
$('.menu_items_list').append(row);
|
$('.menu_items_list').append(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//end Ajax
|
//end Ajax
|
||||||
}
|
}
|
||||||
//end show list function
|
//end show list function
|
||||||
//click menu sidebar menu category
|
//click menu sidebar menu category
|
||||||
@@ -114,7 +112,7 @@ $(function() {
|
|||||||
sub_category = $(this).siblings('.sub_category_list');
|
sub_category = $(this).siblings('.sub_category_list');
|
||||||
show_sub_category_list(sub_url,sub_category,menu_id);
|
show_sub_category_list(sub_url,sub_category,menu_id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//End menu category Click
|
//End menu category Click
|
||||||
|
|
||||||
//click menu sidebar menu category
|
//click menu sidebar menu category
|
||||||
@@ -125,19 +123,19 @@ $(function() {
|
|||||||
var menu_id = $(this).attr("data-id");
|
var menu_id = $(this).attr("data-id");
|
||||||
var url = "get_menu_category/"+menu_id;
|
var url = "get_menu_category/"+menu_id;
|
||||||
show_menu_item_list(url,menu_id);
|
show_menu_item_list(url,menu_id);
|
||||||
});
|
});
|
||||||
//End menu category Click
|
//End menu category Click
|
||||||
|
|
||||||
//show menu item list when click menu category
|
//show menu item list when click menu category
|
||||||
function show_menu_item_list(url_item,menu_id){
|
function show_menu_item_list(url_item,menu_id){
|
||||||
var menu_list = $('.menu_items_list');
|
var menu_list = $('.menu_items_list');
|
||||||
menu_list.empty();
|
menu_list.empty();
|
||||||
|
|
||||||
menus = JSON.parse(localStorage.getItem("menus"));
|
menus = JSON.parse(localStorage.getItem("menus"));
|
||||||
if (menus != null) {
|
if (menus != null) {
|
||||||
for(var i in menus) {
|
for(var i in menus) {
|
||||||
var categories = menus[i]["categories"];
|
var categories = menus[i]["categories"];
|
||||||
for(var ii in categories) {
|
for(var ii in categories) {
|
||||||
if (categories[ii]["id"] == menu_id) {
|
if (categories[ii]["id"] == menu_id) {
|
||||||
var menu_items = categories[ii]["items"];
|
var menu_items = categories[ii]["items"];
|
||||||
show_menu_list(menu_items);
|
show_menu_list(menu_items);
|
||||||
@@ -148,7 +146,7 @@ $(function() {
|
|||||||
|
|
||||||
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
||||||
modify_order = window.location.href.indexOf("modify_order");
|
modify_order = window.location.href.indexOf("modify_order");
|
||||||
|
|
||||||
if (type != -1 && modify_order != -1) {
|
if (type != -1 && modify_order != -1) {
|
||||||
url_item = '../../../addorders/'+url_item;
|
url_item = '../../../addorders/'+url_item;
|
||||||
}if(modify_order == -1 && type != -1){
|
}if(modify_order == -1 && type != -1){
|
||||||
@@ -159,9 +157,9 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url_item,
|
url: url_item,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@@ -171,12 +169,12 @@ $(function() {
|
|||||||
show_menu_list(menu_items);
|
show_menu_list(menu_items);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//end Ajax
|
//end Ajax
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//end show list function
|
//end show list function
|
||||||
//click item row for item set
|
//click item row for item set
|
||||||
$(document).on('click', '.set_item_box', function(event){
|
$(document).on('click', '.set_item_box', function(event){
|
||||||
$(".instance-list").empty();
|
$(".instance-list").empty();
|
||||||
$(".options-list").empty();
|
$(".options-list").empty();
|
||||||
$(".selected-set-list").empty();
|
$(".selected-set-list").empty();
|
||||||
@@ -189,8 +187,8 @@ $(function() {
|
|||||||
instances = $(this).data('instances');
|
instances = $(this).data('instances');
|
||||||
item_options = $(this).data('options');
|
item_options = $(this).data('options');
|
||||||
|
|
||||||
for(var field in item_sets) {
|
for(var field in item_sets) {
|
||||||
|
|
||||||
$('.set_order').attr('data-min-qty',item_sets[field]["min_selectable_qty"]);
|
$('.set_order').attr('data-min-qty',item_sets[field]["min_selectable_qty"]);
|
||||||
|
|
||||||
value = item_sets[field]["instances"];
|
value = item_sets[field]["instances"];
|
||||||
@@ -198,9 +196,9 @@ $(function() {
|
|||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
menus = JSON.parse(localStorage.getItem("menus"));
|
menus = JSON.parse(localStorage.getItem("menus"));
|
||||||
if (menus != null) {
|
if (menus != null) {
|
||||||
for(var j in menus) {
|
for(var j in menus) {
|
||||||
var categories = menus[j]["categories"];
|
var categories = menus[j]["categories"];
|
||||||
for(var ii in categories) {
|
for(var ii in categories) {
|
||||||
var items = categories[ii]["items"];
|
var items = categories[ii]["items"];
|
||||||
for(var iii in items) {
|
for(var iii in items) {
|
||||||
var result = items[iii]["instances"];
|
var result = items[iii]["instances"];
|
||||||
@@ -232,7 +230,7 @@ $(function() {
|
|||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+' </div>'
|
+' </div>'
|
||||||
$(".instance-list").append(row);
|
$(".instance-list").append(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -281,22 +279,22 @@ $(function() {
|
|||||||
+'</div>'
|
+'</div>'
|
||||||
+' </div>'
|
+' </div>'
|
||||||
|
|
||||||
$(".instance-list").append(row);
|
$(".instance-list").append(row);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j in item_options) {
|
for(var j in item_options) {
|
||||||
value = item_options[j]["values"];
|
value = item_options[j]["values"];
|
||||||
type = item_options[j]["type"];
|
type = item_options[j]["type"];
|
||||||
row = "<h4>"+type+"</h4>"
|
row = "<h4>"+type+"</h4>"
|
||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
row +="<button class='btn btn- waves-effect option_btn "+ type +"' data-type='"
|
row +="<button class='btn btn- waves-effect option_btn "+ type +"' data-type='"
|
||||||
+type+"' data-value='"+value[i]+"' data-group='set_menu_default'>"+value[i]+"</button>";
|
+type+"' data-value='"+value[i]+"' data-group='set_menu_default'>"+value[i]+"</button>";
|
||||||
});
|
});
|
||||||
$(".options-list").append(row);
|
$(".options-list").append(row);
|
||||||
}
|
}
|
||||||
$('.set-item').attr('data-code',instances[0]['code']);
|
$('.set-item').attr('data-code',instances[0]['code']);
|
||||||
$('.set-item').attr('data-name',instances[0]['name']);
|
$('.set-item').attr('data-name',instances[0]['name']);
|
||||||
@@ -313,8 +311,8 @@ $(function() {
|
|||||||
$('#set_unit_price').text($(this).attr('data-price'));
|
$('#set_unit_price').text($(this).attr('data-price'));
|
||||||
// $('#set_unit_price').text(0);
|
// $('#set_unit_price').text(0);
|
||||||
});
|
});
|
||||||
// click instance for add item set
|
// click instance for add item set
|
||||||
$(document).on('click', '.instance_box', function(event){
|
$(document).on('click', '.instance_box', function(event){
|
||||||
|
|
||||||
$(".options-list").empty();
|
$(".options-list").empty();
|
||||||
|
|
||||||
@@ -326,18 +324,18 @@ $(function() {
|
|||||||
max_qty = $(this).data('max-qty');
|
max_qty = $(this).data('max-qty');
|
||||||
|
|
||||||
code = $(this).data('code');
|
code = $(this).data('code');
|
||||||
|
|
||||||
if (rowCount.length+1 <= max_qty) {
|
if (rowCount.length+1 <= max_qty) {
|
||||||
for(var field in item_options) {
|
for(var field in item_options) {
|
||||||
value = item_options[field]["values"];
|
value = item_options[field]["values"];
|
||||||
type = item_options[field]["type"];
|
type = item_options[field]["type"];
|
||||||
row = "<p style='font-size:16px;margin-bottom:3px'>"+type+"</p>"
|
row = "<p style='font-size:16px;margin-bottom:3px'>"+type+"</p>"
|
||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
row +="<button class='btn btn-default btn-sm option_btn "+ type +"' data-type='"
|
row +="<button class='btn btn-default btn-sm option_btn "+ type +"' data-type='"
|
||||||
+type+"' data-value='"+value[i]+"' data-code='"+code+"' data-group='set_menu'>"
|
+type+"' data-value='"+value[i]+"' data-code='"+code+"' data-group='set_menu'>"
|
||||||
+value[i]+"</button>";
|
+value[i]+"</button>";
|
||||||
});
|
});
|
||||||
$(".options-list").append(row);
|
$(".options-list").append(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if($(this).hasClass('selected-instance') == true){
|
// if($(this).hasClass('selected-instance') == true){
|
||||||
@@ -364,7 +362,7 @@ $(function() {
|
|||||||
var total_price = +sub_total + +total;
|
var total_price = +sub_total + +total;
|
||||||
$(this).addClass('selected-instance');
|
$(this).addClass('selected-instance');
|
||||||
|
|
||||||
set = "<div class='selected-set card custom-card' style='margin-bottom:10px !important'"
|
set = "<div class='selected-set card custom-card' style='margin-bottom:10px !important'"
|
||||||
+"' data-name='"+$(this).data('name')
|
+"' data-name='"+$(this).data('name')
|
||||||
+"' data-code='"+code
|
+"' data-code='"+code
|
||||||
+"' data-price='"+$(this).data('price')
|
+"' data-price='"+$(this).data('price')
|
||||||
@@ -382,7 +380,7 @@ $(function() {
|
|||||||
+'<span style="color:#fff">'+$(this).data('name')+'</span>'
|
+'<span style="color:#fff">'+$(this).data('name')+'</span>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'<div class="card-block custom-card-block">'
|
+'<div class="card-block custom-card-block">'
|
||||||
|
|
||||||
+' <small style="float:" id="instance_option"></small>'
|
+' <small style="float:" id="instance_option"></small>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
// +'<div class="card-footer custom-card-footer">'
|
// +'<div class="card-footer custom-card-footer">'
|
||||||
@@ -397,11 +395,11 @@ $(function() {
|
|||||||
// }
|
// }
|
||||||
$('#set_unit_price').text(price);
|
$('#set_unit_price').text(price);
|
||||||
$('#set_total_price').text(total_price);
|
$('#set_total_price').text(total_price);
|
||||||
|
|
||||||
}); //End selecct attribute buttom
|
}); //End selecct attribute buttom
|
||||||
|
|
||||||
// click add order
|
// click add order
|
||||||
$(document).on('click', '#remove_set', function(event){
|
$(document).on('click', '#remove_set', function(event){
|
||||||
code = $(this).parent().parent('.selected-set').attr('data-code');
|
code = $(this).parent().parent('.selected-set').attr('data-code');
|
||||||
instance = $(".selected-instance");
|
instance = $(".selected-instance");
|
||||||
$(instance).each(function(i){
|
$(instance).each(function(i){
|
||||||
@@ -412,8 +410,8 @@ $(function() {
|
|||||||
$(this).parent().parent('.selected-set').remove();
|
$(this).parent().parent('.selected-set').remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
// click add order
|
// click add order
|
||||||
$(document).on('click', '.set_order', function(event){
|
$(document).on('click', '.set_order', function(event){
|
||||||
total_price = $('#set_total_price').text();
|
total_price = $('#set_total_price').text();
|
||||||
qty = parseInt($('#set_count').val());
|
qty = parseInt($('#set_count').val());
|
||||||
item_code = $('#set_item_code').text();
|
item_code = $('#set_item_code').text();
|
||||||
@@ -448,9 +446,9 @@ $(function() {
|
|||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + option_name +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + option_name +'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(total).toFixed(2)
|
+ parseFloat(total).toFixed(2)
|
||||||
+'</td>'
|
+'</td>'
|
||||||
+'</tr>';
|
+'</tr>';
|
||||||
$(".summary-items tbody").append(row);
|
$(".summary-items tbody").append(row);
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
@@ -473,9 +471,9 @@ $(function() {
|
|||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + set_option_name +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + set_option_name +'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(total).toFixed(2)
|
+ parseFloat(total).toFixed(2)
|
||||||
+'</td>'
|
+'</td>'
|
||||||
+'</tr>';
|
+'</tr>';
|
||||||
$(".summary-items tbody").append(row);
|
$(".summary-items tbody").append(row);
|
||||||
rowCount = rowCount + 1;
|
rowCount = rowCount + 1;
|
||||||
@@ -494,11 +492,11 @@ $(function() {
|
|||||||
// btnClass: 'btn-danger',
|
// btnClass: 'btn-danger',
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
}); //End add order Click
|
}); //End add order Click
|
||||||
|
|
||||||
//click item row for add order
|
//click item row for add order
|
||||||
$(document).on('click', '.menu_item_box', function(event){
|
$(document).on('click', '.menu_item_box', function(event){
|
||||||
|
|
||||||
$('.attributes-list').empty();
|
$('.attributes-list').empty();
|
||||||
$('.options-list').empty();
|
$('.options-list').empty();
|
||||||
@@ -532,20 +530,20 @@ $(function() {
|
|||||||
}else{
|
}else{
|
||||||
image = "<img id='' width='200px' src='"+data.attr('data-image')+"'>";
|
image = "<img id='' width='200px' src='"+data.attr('data-image')+"'>";
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if (modify_order) {
|
if (modify_order) {
|
||||||
image = "<img id='' width='200px' src='../../image/logo.png'>";
|
image = "<img id='' width='200px' src='../../image/logo.png'>";
|
||||||
}else{
|
}else{
|
||||||
image = "<img id='' width='200px' src='/image/logo.png'>";
|
image = "<img id='' width='200px' src='/image/logo.png'>";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#modal_box_img').append(image);
|
$('#modal_box_img').append(image);
|
||||||
|
|
||||||
instance_attributes = []
|
instance_attributes = []
|
||||||
for(var field in instances) {
|
for(var field in instances) {
|
||||||
value = instances[field].values;
|
value = instances[field].values;
|
||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
options = value[i];
|
options = value[i];
|
||||||
@@ -556,7 +554,7 @@ $(function() {
|
|||||||
// data: {id:value[i]},
|
// data: {id:value[i]},
|
||||||
// success:function(result){
|
// success:function(result){
|
||||||
|
|
||||||
// options = result["name"];
|
// options = result["name"];
|
||||||
// instance_attributes.push(options);
|
// instance_attributes.push(options);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
@@ -570,14 +568,14 @@ $(function() {
|
|||||||
// url: '../../api/restaurant/menu_item_attributes/'+selected_item[i],
|
// url: '../../api/restaurant/menu_item_attributes/'+selected_item[i],
|
||||||
// data: {id:selected_item[i]},
|
// data: {id:selected_item[i]},
|
||||||
// success:function(result){
|
// success:function(result){
|
||||||
// name = result["name"];
|
// name = result["name"];
|
||||||
// selected_arr.push(name);
|
// selected_arr.push(name);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
for(var field in attributes) {
|
for(var field in attributes) {
|
||||||
value = attributes[field]["values"];
|
value = attributes[field]["values"];
|
||||||
type = attributes[field]["type"]
|
type = attributes[field]["type"]
|
||||||
row = "<h5>"+attributes[field]["type"]+"</h5>";
|
row = "<h5>"+attributes[field]["type"]+"</h5>";
|
||||||
@@ -595,20 +593,20 @@ $(function() {
|
|||||||
+type+"' data-value='"+value[i]+"' class='btn btn- waves-effect attribute_btn "
|
+type+"' data-value='"+value[i]+"' class='btn btn- waves-effect attribute_btn "
|
||||||
+ status +" "+ type +" '"+ disabled +" >"
|
+ status +" "+ type +" '"+ disabled +" >"
|
||||||
+value[i]
|
+value[i]
|
||||||
+"</button>";
|
+"</button>";
|
||||||
});
|
});
|
||||||
$(".attributes-list").append(row);
|
$(".attributes-list").append(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var field in item_options) {
|
for(var field in item_options) {
|
||||||
value = item_options[field]["values"];
|
value = item_options[field]["values"];
|
||||||
type = item_options[field]["type"];
|
type = item_options[field]["type"];
|
||||||
row = "<h4>"+type+"</h4>"
|
row = "<h4>"+type+"</h4>"
|
||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
row +="<button class='btn btn- waves-effect option_btn "+ type +"' data-type='"
|
row +="<button class='btn btn- waves-effect option_btn "+ type +"' data-type='"
|
||||||
+type+"' data-value='"+value[i]+"' data-group='simple_menu'>"+value[i]+"</button>";
|
+type+"' data-value='"+value[i]+"' data-group='simple_menu'>"+value[i]+"</button>";
|
||||||
});
|
});
|
||||||
$(".options-list").append(row);
|
$(".options-list").append(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $('#count').val(1);
|
// $('#count').val(1);
|
||||||
@@ -622,14 +620,14 @@ $(function() {
|
|||||||
$('#unit_price').text(data.attr('data-price'));
|
$('#unit_price').text(data.attr('data-price'));
|
||||||
});
|
});
|
||||||
|
|
||||||
// click select option icon for add
|
// click select option icon for add
|
||||||
$(document).on('click', '.attribute_btn', function(event){
|
$(document).on('click', '.attribute_btn', function(event){
|
||||||
|
|
||||||
// $('.change_qty').val(1);
|
// $('.change_qty').val(1);
|
||||||
value = $(this).data('value');
|
value = $(this).data('value');
|
||||||
type = $(this).data('type');
|
type = $(this).data('type');
|
||||||
instances = $(this).data('instances');
|
instances = $(this).data('instances');
|
||||||
|
|
||||||
attributes = $(".attribute_btn");
|
attributes = $(".attribute_btn");
|
||||||
$(attributes).each(function(i){
|
$(attributes).each(function(i){
|
||||||
if ($(attributes[i]).attr('data-type')==type){
|
if ($(attributes[i]).attr('data-type')==type){
|
||||||
@@ -642,29 +640,29 @@ $(function() {
|
|||||||
// $('.'+type).removeClass("selected-attribute");
|
// $('.'+type).removeClass("selected-attribute");
|
||||||
// }
|
// }
|
||||||
// $(this).addClass('selected-attribute');
|
// $(this).addClass('selected-attribute');
|
||||||
|
|
||||||
var selected_attr = get_selected_attributes('selected-attribute');
|
var selected_attr = get_selected_attributes('selected-attribute');
|
||||||
|
|
||||||
qty = $('.change_qty').val();
|
qty = $('.change_qty').val();
|
||||||
|
|
||||||
for(var field in instances) {
|
for(var field in instances) {
|
||||||
item_attr = instances[field].values;
|
item_attr = instances[field].values;
|
||||||
|
|
||||||
if(JSON.stringify(item_attr) == JSON.stringify(selected_attr)){
|
if(JSON.stringify(item_attr) == JSON.stringify(selected_attr)){
|
||||||
unit_price = instances[field].price ;
|
unit_price = instances[field].price ;
|
||||||
total_price = qty * unit_price ;
|
total_price = qty * unit_price ;
|
||||||
$('#instance_name').text(instances[field].name);
|
$('#instance_name').text(instances[field].name);
|
||||||
$('#instance_code').text(instances[field].code);
|
$('#instance_code').text(instances[field].code);
|
||||||
$('#promotion_price').text(instances[field].promotion_price);
|
$('#promotion_price').text(instances[field].promotion_price);
|
||||||
$('#total_price').text(total_price);
|
$('#total_price').text(total_price);
|
||||||
$('#unit_price').text(unit_price);
|
$('#unit_price').text(unit_price);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}); //End selecct attribute buttom
|
}); //End selecct attribute buttom
|
||||||
|
|
||||||
// click select option icon for add
|
// click select option icon for add
|
||||||
$(document).on('click', '.option_btn', function(event){
|
$(document).on('click', '.option_btn', function(event){
|
||||||
active =$(this).hasClass('selected-option');
|
active =$(this).hasClass('selected-option');
|
||||||
value = $(this).data('value');
|
value = $(this).data('value');
|
||||||
type = $(this).data('type');
|
type = $(this).data('type');
|
||||||
@@ -680,7 +678,7 @@ $(function() {
|
|||||||
}else{
|
}else{
|
||||||
$(this).addClass('selected-option');
|
$(this).addClass('selected-option');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(group == "set_menu"){
|
if(group == "set_menu"){
|
||||||
option_arr = get_selected_attributes('selected-option');
|
option_arr = get_selected_attributes('selected-option');
|
||||||
@@ -699,13 +697,13 @@ $(function() {
|
|||||||
if(group == "set_menu_default"){
|
if(group == "set_menu_default"){
|
||||||
option_arr = get_selected_attributes('selected-option');
|
option_arr = get_selected_attributes('selected-option');
|
||||||
$('.set-item').attr('data-options',JSON.stringify(option_arr));
|
$('.set-item').attr('data-options',JSON.stringify(option_arr));
|
||||||
$('.set_default_option').text(option_arr);
|
$('.set_default_option').text(option_arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}); //End selecct attribute buttom
|
}); //End selecct attribute buttom
|
||||||
|
|
||||||
// click add order
|
// click add order
|
||||||
$(document).on('click', '.add_to_order', function(event){
|
$(document).on('click', '.add_to_order', function(event){
|
||||||
total_price = $('#total_price').text();
|
total_price = $('#total_price').text();
|
||||||
qty = parseInt($('#count').val());
|
qty = parseInt($('#count').val());
|
||||||
|
|
||||||
@@ -715,16 +713,16 @@ $(function() {
|
|||||||
option_arr = get_selected_attributes('selected-option');
|
option_arr = get_selected_attributes('selected-option');
|
||||||
if (item_row.length>0) {
|
if (item_row.length>0) {
|
||||||
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
||||||
|
|
||||||
|
|
||||||
for(var field in instances) {
|
|
||||||
|
for(var field in instances) {
|
||||||
|
|
||||||
attrbu = JSON.stringify(attribute_arr);
|
attrbu = JSON.stringify(attribute_arr);
|
||||||
instan = JSON.stringify(instances[field].values);
|
instan = JSON.stringify(instances[field].values);
|
||||||
var newarr = new Set(instan);
|
var newarr = new Set(instan);
|
||||||
|
|
||||||
result = false;
|
result = false;
|
||||||
for(var i in attrbu) {
|
for(var i in attrbu) {
|
||||||
if (newarr.has(attrbu[i])) {
|
if (newarr.has(attrbu[i])) {
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
break;
|
||||||
@@ -758,22 +756,22 @@ $(function() {
|
|||||||
}
|
}
|
||||||
show_item_detail(item_data,"add_to_order");
|
show_item_detail(item_data,"add_to_order");
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
|
|
||||||
}); //End add order Click
|
}); //End add order Click
|
||||||
|
|
||||||
// click plus icon for add
|
// click plus icon for add
|
||||||
$(document).on('click', '.add_icon', function(event){
|
$(document).on('click', '.add_icon', function(event){
|
||||||
var item_data = $(this);
|
var item_data = $(this);
|
||||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
||||||
item = get_item(item_data,"add_icon");
|
item = get_item(item_data,"add_icon");
|
||||||
customer_display_view(item,"add");
|
customer_display_view(item,"add");
|
||||||
}
|
}
|
||||||
show_item_detail(item_data,"add_icon");
|
show_item_detail(item_data,"add_icon");
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
}); //End Add Icon Click
|
}); //End Add Icon Click
|
||||||
|
|
||||||
function show_item_detail(data,click_type){
|
function show_item_detail(data,click_type){
|
||||||
|
testqty = parseInt($('.item_box').children('data_qty').text());
|
||||||
qty = parseInt(data.attr('data-qty'));
|
qty = parseInt(data.attr('data-qty'));
|
||||||
append = 0;
|
append = 0;
|
||||||
price = data.attr('data-price');
|
price = data.attr('data-price');
|
||||||
@@ -786,42 +784,42 @@ $(function() {
|
|||||||
}
|
}
|
||||||
d_option = data.attr('data-opt');
|
d_option = data.attr('data-opt');
|
||||||
if (click_type != "add_icon"){
|
if (click_type != "add_icon"){
|
||||||
option_name = "-"+data.attr('data-options');
|
option_name = "-"+data.attr('data-options');
|
||||||
data_option = data.attr('data-options') ;
|
data_option = data.attr('data-options') ;
|
||||||
}else{
|
}else{
|
||||||
option_name = ' ';
|
option_name = ' ';
|
||||||
data_option = '[]';
|
data_option = '[]';
|
||||||
}
|
}
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
var item_row = $('.summary-items tbody tr');
|
var item_row = $('.summary-items tbody tr');
|
||||||
|
|
||||||
$(item_row).each(function(i){
|
$(item_row).each(function(i){
|
||||||
item_code = $(item_row[i]).attr('data-code');
|
item_code = $(item_row[i]).attr('data-code');
|
||||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||||
r_option = $(item_row[i]).attr('data-opt');
|
r_option = $(item_row[i]).attr('data-opt');
|
||||||
|
|
||||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
||||||
}else{
|
}else{
|
||||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + 1;
|
qty = parseInt($(item_row[i]).children('#item_qty').text()) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(item_row[i]).children('#item_qty').text(qty);
|
$(item_row[i]).children('#item_qty').text(qty);
|
||||||
parseFloat($(item_row[i]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
parseFloat($(item_row[i]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
||||||
append =1;
|
append =1;
|
||||||
}else{
|
}else{
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = qty;
|
qty = qty;
|
||||||
}else{
|
}else{
|
||||||
qty = 1;
|
qty = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (append===0) {
|
if (append===0) {
|
||||||
row ="<tr class='item_box' data-price ='"
|
row ="<tr class='item_box' data-price ='"
|
||||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
+price+ " 'data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||||
+instance+ "' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
+instance+ "' data-qty='"+qty +"' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
||||||
+data.attr('data-instance-code')+"' data-attributes='"
|
+data.attr('data-instance-code')+"' data-attributes='"
|
||||||
+data.attr('data-attributes')+"' data-options ='"
|
+data.attr('data-attributes')+"' data-options ='"
|
||||||
+data_option+"' data-opt ='"
|
+data_option+"' data-opt ='"
|
||||||
@@ -829,9 +827,9 @@ $(function() {
|
|||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +''+option_name+'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +''+option_name+'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(price).toFixed(2)
|
+ parseFloat(price).toFixed(2)
|
||||||
+'</td>'
|
+'</td>'
|
||||||
+'</tr>';
|
+'</tr>';
|
||||||
$(".summary-items tbody").append(row);
|
$(".summary-items tbody").append(row);
|
||||||
}
|
}
|
||||||
@@ -863,15 +861,15 @@ $(function() {
|
|||||||
}
|
}
|
||||||
var order_items = JSON.stringify(get_order_item_rows());
|
var order_items = JSON.stringify(get_order_item_rows());
|
||||||
if (booking_id.length > 0) {
|
if (booking_id.length > 0) {
|
||||||
|
|
||||||
var params = {'order_source': type, 'order_type': "dine_in",
|
var params = {'order_source': type, 'order_type': "dine_in",
|
||||||
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
|
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
|
||||||
'table_id': table_id,
|
'table_id': table_id,
|
||||||
'order_items': order_items,'create_type' : "create_only" };
|
'order_items': order_items,'create_type' : "create_only" };
|
||||||
}else{
|
}else{
|
||||||
var params = {'order_source': type, 'order_type': "dine_in",
|
var params = {'order_source': type, 'order_type': "dine_in",
|
||||||
'customer_id': customer_id, 'guest_info': "",
|
'customer_id': customer_id, 'guest_info': "",
|
||||||
'table_id': table_id,
|
'table_id': table_id,
|
||||||
'order_items': order_items,'create_type' : "create_only" };
|
'order_items': order_items,'create_type' : "create_only" };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -881,7 +879,7 @@ $(function() {
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: params,
|
data: params,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
if (type == "quick_service" || type=="food_court") {
|
if (type == "quick_service" || type=="food_court") {
|
||||||
window.location.href = "/origami/"+type;
|
window.location.href = "/origami/"+type;
|
||||||
}else{
|
}else{
|
||||||
@@ -890,7 +888,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
window.location.href = "/origami/room/" + table_id;
|
window.location.href = "/origami/room/" + table_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
|
||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
@@ -930,18 +928,18 @@ $(function() {
|
|||||||
}
|
}
|
||||||
var order_items = JSON.stringify(get_order_item_rows());
|
var order_items = JSON.stringify(get_order_item_rows());
|
||||||
if (booking_id.length > 0) {
|
if (booking_id.length > 0) {
|
||||||
|
|
||||||
var params = {'order_source': type, 'order_type': "dine_in",
|
var params = {'order_source': type, 'order_type': "dine_in",
|
||||||
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
|
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
|
||||||
'table_id': table_id,
|
'table_id': table_id,
|
||||||
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
|
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
|
||||||
}else{
|
}else{
|
||||||
var params = {'order_source': type, 'order_type': "dine_in",
|
var params = {'order_source': type, 'order_type': "dine_in",
|
||||||
'customer_id': customer_id, 'guest_info': "",
|
'customer_id': customer_id, 'guest_info': "",
|
||||||
'table_id': table_id,
|
'table_id': table_id,
|
||||||
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
|
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
@@ -967,7 +965,7 @@ $(function() {
|
|||||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -985,6 +983,7 @@ $(function() {
|
|||||||
$('.summary-items tr').filter(function(){
|
$('.summary-items tr').filter(function(){
|
||||||
if ($(this).attr('data-active') == 'true'){
|
if ($(this).attr('data-active') == 'true'){
|
||||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
||||||
|
var item_data = $(this);
|
||||||
item = get_item(item_data,"remove_icon");
|
item = get_item(item_data,"remove_icon");
|
||||||
customer_display_view(item,"remove");
|
customer_display_view(item,"remove");
|
||||||
}
|
}
|
||||||
@@ -995,26 +994,27 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//click close
|
//click close
|
||||||
$('#sx_itemModal').on('click','#close', function(){
|
$('#sx_itemModal').on('click','#close', function(){
|
||||||
$(".item_box").removeAttr("data-active");
|
$(".item_box").removeAttr("data-active");
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#sx_item_set_detailModal').on('click','#close', function(){
|
$('#sx_item_set_detailModal').on('click','#close', function(){
|
||||||
$("#sx_item_set_detailModal").css({ 'display': "none" });
|
$("#sx_item_set_detailModal").css({ 'display': "none" });
|
||||||
});
|
});
|
||||||
//click save buttom after change qty
|
//click save buttom after change qty
|
||||||
$('#sx_itemModal').on('click','#save', function(){
|
$('#sx_itemModal').on('click','#save', function(){
|
||||||
if ($('#modal-qty').val()>0) {
|
if ($('#modal-qty').val()>0) {
|
||||||
summary_items_filter();
|
summary_items_filter();
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
swal("Opps", "Please enter number for qty ","warning");
|
swal("Opps", "Please enter number for qty ","warning");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//calculate subtotal
|
//calculate subtotal
|
||||||
function calculate_sub_total(){
|
function calculate_sub_total(){
|
||||||
var total_price = 0;
|
var total_price = 0;
|
||||||
var total_qty = 0;
|
var total_qty = 0;
|
||||||
var taxable_amount = 0;
|
var taxable_amount = 0;
|
||||||
@@ -1023,16 +1023,16 @@ $(function() {
|
|||||||
$(item_row).each(function(i){
|
$(item_row).each(function(i){
|
||||||
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
|
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
|
||||||
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
|
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
|
||||||
total_qty += qty;
|
total_qty += qty;
|
||||||
total_price += qty*unit_price;
|
total_price += qty*unit_price;
|
||||||
});
|
});
|
||||||
var fixed_total_price = parseFloat(total_price).toFixed(2);
|
var fixed_total_price = parseFloat(total_price).toFixed(2);
|
||||||
var fixed_taxable_amount = parseFloat(taxable_amount).toFixed(2);
|
var fixed_taxable_amount = parseFloat(taxable_amount).toFixed(2);
|
||||||
|
|
||||||
$('#sub_total').empty();
|
$('#sub_total').empty();
|
||||||
$('#sub_total').append(fixed_total_price);
|
$('#sub_total').append(fixed_total_price);
|
||||||
|
|
||||||
$('#total_qty').empty();
|
$('#total_qty').empty();
|
||||||
$('#total_qty').append(total_qty);
|
$('#total_qty').append(total_qty);
|
||||||
|
|
||||||
if (item_row.length > 0) {
|
if (item_row.length > 0) {
|
||||||
@@ -1046,16 +1046,17 @@ $(function() {
|
|||||||
$('.summary-items tr').filter(function(){
|
$('.summary-items tr').filter(function(){
|
||||||
if ($(this).attr('data-active') == 'true'){
|
if ($(this).attr('data-active') == 'true'){
|
||||||
qty = $('#modal-qty').val();
|
qty = $('#modal-qty').val();
|
||||||
|
$(this).attr('data-qty',qty);
|
||||||
price = parseFloat($(this).attr('data-price'));
|
price = parseFloat($(this).attr('data-price'));
|
||||||
total_price = parseFloat(price*qty).toFixed(2);
|
total_price = parseFloat(price*qty).toFixed(2);
|
||||||
|
|
||||||
$(this).find('#item_qty').text(qty);
|
$(this).find('#item_qty').text(qty);
|
||||||
$(this).find('.item-cell-price').text(total_price);
|
$(this).find('.item-cell-price').text(total_price);
|
||||||
|
|
||||||
$(this).removeAttr('data-active');
|
$(this).removeAttr('data-active');
|
||||||
|
|
||||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
||||||
var item_data = $(this);
|
var item_data = $(this);
|
||||||
item = get_item(item_data,"update_icon");
|
item = get_item(item_data,"update_icon");
|
||||||
customer_display_view(item,"update_qty");
|
customer_display_view(item,"update_qty");
|
||||||
}
|
}
|
||||||
@@ -1065,17 +1066,17 @@ $(function() {
|
|||||||
|
|
||||||
/* Get Item rows */
|
/* Get Item rows */
|
||||||
function get_order_item_rows(){
|
function get_order_item_rows(){
|
||||||
var order_items = [];
|
var order_items = [];
|
||||||
var item_row = $('.summary-items tbody tr');
|
var item_row = $('.summary-items tbody tr');
|
||||||
$(item_row).each(function(i){
|
$(item_row).each(function(i){
|
||||||
var order_item = {};
|
var order_item = {};
|
||||||
|
|
||||||
order_item.order_item_id = $(item_row[i]).attr('data-row');
|
order_item.order_item_id = $(item_row[i]).attr('data-row');
|
||||||
order_item.item_instance_code = $(item_row[i]).attr('data-instance-code');
|
order_item.item_instance_code = $(item_row[i]).attr('data-instance-code');
|
||||||
order_item.quantity = $(item_row[i]).children('#item_qty').text();
|
order_item.quantity = $(item_row[i]).children('#item_qty').text();
|
||||||
//parent id
|
//parent id
|
||||||
if ($(item_row[i]).attr('data-parent')=="true") {
|
if ($(item_row[i]).attr('data-parent')=="true") {
|
||||||
parent_id = $(item_row[i]).attr('data-row');
|
parent_id = $(item_row[i]).attr('data-row');
|
||||||
}
|
}
|
||||||
if ($(item_row[i]).attr('data-sub-item')=="true") {
|
if ($(item_row[i]).attr('data-sub-item')=="true") {
|
||||||
order_item.parent_order_item_id = parent_id
|
order_item.parent_order_item_id = parent_id
|
||||||
@@ -1083,7 +1084,7 @@ $(function() {
|
|||||||
//end parent id
|
//end parent id
|
||||||
order_item.options = $(item_row[i]).attr('data-options');
|
order_item.options = $(item_row[i]).attr('data-options');
|
||||||
order_items.push(order_item);
|
order_items.push(order_item);
|
||||||
});
|
});
|
||||||
return order_items;
|
return order_items;
|
||||||
}
|
}
|
||||||
// Get Selected Class
|
// Get Selected Class
|
||||||
@@ -1123,14 +1124,14 @@ $(function() {
|
|||||||
window.location.href = "/origami/room/" + table_id;
|
window.location.href = "/origami/room/" + table_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get Selected Class
|
// Get Selected Class
|
||||||
function change_qty_plus_minus(id,plus,minus) {
|
function change_qty_plus_minus(id,plus,minus) {
|
||||||
var count = parseInt($('#'+id).val());
|
var count = parseInt($('#'+id).val());
|
||||||
|
|
||||||
$('#'+plus).on("click", function(){
|
$('#'+plus).on("click", function(){
|
||||||
count++;
|
count++;
|
||||||
$('#'+id).val(count);
|
$('#'+id).val(count);
|
||||||
|
|
||||||
if (id == "count") {
|
if (id == "count") {
|
||||||
@@ -1150,7 +1151,7 @@ $(function() {
|
|||||||
}else{
|
}else{
|
||||||
total_price = count*price;
|
total_price = count*price;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#set_total_price").text(total_price);
|
$("#set_total_price").text(total_price);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1159,7 +1160,7 @@ $(function() {
|
|||||||
|
|
||||||
// var count = parseInt($('#'+id).val());
|
// var count = parseInt($('#'+id).val());
|
||||||
// var countEl = document.getElementById(id);
|
// var countEl = document.getElementById(id);
|
||||||
|
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
count--;
|
count--;
|
||||||
$('#'+id).val(count);
|
$('#'+id).val(count);
|
||||||
@@ -1183,7 +1184,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
$("#set_total_price").text(total_price);
|
$("#set_total_price").text(total_price);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1221,31 +1222,31 @@ $(function() {
|
|||||||
|
|
||||||
//click menu sidebar menu category
|
//click menu sidebar menu category
|
||||||
|
|
||||||
$(document).on('click', '.sub_clickssss', function(event){
|
$(document).on('click', '.sub_clickssss', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var menu_id = $(this).attr("data-id");
|
var menu_id = $(this).attr("data-id");
|
||||||
var url = "get_menu_sub_category/"+menu_id;
|
var url = "get_menu_sub_category/"+menu_id;
|
||||||
sub_category = $(this).find('.sub_category_list');
|
sub_category = $(this).find('.sub_category_list');
|
||||||
show_sub_category_list(url,sub_category,menu_id);
|
show_sub_category_list(url,sub_category,menu_id);
|
||||||
});
|
});
|
||||||
//End menu category Click
|
//End menu category Click
|
||||||
|
|
||||||
//show menu item list when click menu category
|
//show menu item list when click menu category
|
||||||
function show_sub_category_list(url,sub_category,menu_id){
|
function show_sub_category_list(url,sub_category,menu_id){
|
||||||
|
|
||||||
var sub_category_list = $('.sub_category_list');
|
var sub_category_list = $('.sub_category_list');
|
||||||
sub_category_list.empty();
|
sub_category_list.empty();
|
||||||
|
|
||||||
menus = JSON.parse(localStorage.getItem("menus"));
|
menus = JSON.parse(localStorage.getItem("menus"));
|
||||||
if (menus != null) {
|
if (menus != null) {
|
||||||
for(var j in menus) {
|
for(var j in menus) {
|
||||||
var categories = menus[j]["categories"];
|
var categories = menus[j]["categories"];
|
||||||
for(var ii in categories) {
|
for(var ii in categories) {
|
||||||
if (menu_id == categories[ii]["parent_id"]) {
|
if (menu_id == categories[ii]["parent_id"]) {
|
||||||
$(sub_category).removeClass('hidden');
|
$(sub_category).removeClass('hidden');
|
||||||
row = '<li class="menu_sub_category fadeInTop" data-id="'+categories[ii].id+'">'
|
row = '<li class="menu_sub_category fadeInTop" data-id="'+categories[ii].id+'">'
|
||||||
+'<a class="nav-link" data-toggle="tab" href="" role="tab">'+ categories[ii].name+'</a>'
|
+'<a class="nav-link" data-toggle="tab" href="" role="tab">'+ categories[ii].name+'</a>'
|
||||||
+'</li>' ;
|
+'</li>' ;
|
||||||
$(sub_category).append(row);
|
$(sub_category).append(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1260,9 +1261,9 @@ $(function() {
|
|||||||
var url = url;
|
var url = url;
|
||||||
}
|
}
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@@ -1275,27 +1276,27 @@ $(function() {
|
|||||||
// }else{
|
// }else{
|
||||||
// $(sub_category).addClass('hidden');
|
// $(sub_category).addClass('hidden');
|
||||||
// }
|
// }
|
||||||
for(var i in data) {
|
for(var i in data) {
|
||||||
|
|
||||||
row = '<li class="menu_sub_category fadeInTop" data-id="'+data[i].id+'">'
|
row = '<li class="menu_sub_category fadeInTop" data-id="'+data[i].id+'">'
|
||||||
+'<a class="nav-link" data-toggle="tab" href="" role="tab">'+ data[i].name+'</a>'
|
+'<a class="nav-link" data-toggle="tab" href="" role="tab">'+ data[i].name+'</a>'
|
||||||
+'</li>' ;
|
+'</li>' ;
|
||||||
$(sub_category).append(row);
|
$(sub_category).append(row);
|
||||||
//end is_sub_item false
|
//end is_sub_item false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//end Ajax
|
//end Ajax
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get Item rows */
|
/* Get Item rows */
|
||||||
function get_item(data,click_type){
|
function get_item(data,click_type){
|
||||||
var sale_items = [];
|
var sale_items = [];
|
||||||
|
|
||||||
var sale_item = {};
|
var sale_item = {};
|
||||||
sale_item.qty = parseInt(data.attr('data-qty'))
|
sale_item.qty = parseInt(data.attr('data-qty'));
|
||||||
sale_item.name = data.attr('data-name');
|
sale_item.name = data.attr('data-name');
|
||||||
sale_item.price = data.attr('data-price');
|
sale_item.price = data.attr('data-price');
|
||||||
sale_item.item_code = data.attr('data-item-code')
|
sale_item.item_code = data.attr('data-item-code')
|
||||||
@@ -1306,13 +1307,13 @@ $(function() {
|
|||||||
sale_item.click_type = click_type
|
sale_item.click_type = click_type
|
||||||
sale_item.instance = data.attr('data-instance')
|
sale_item.instance = data.attr('data-instance')
|
||||||
sale_items.push(sale_item);
|
sale_items.push(sale_item);
|
||||||
|
|
||||||
return sale_items;
|
return sale_items;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get Item rows */
|
/* Get Item rows */
|
||||||
function get_set_item(items){
|
function get_set_item(items){
|
||||||
var sale_items = [];
|
var sale_items = [];
|
||||||
var item = {};
|
var item = {};
|
||||||
item.code = $('.set-item').attr('data-code');
|
item.code = $('.set-item').attr('data-code');
|
||||||
item.name = $('.set-item').attr('data-name');
|
item.name = $('.set-item').attr('data-name');
|
||||||
@@ -1326,7 +1327,7 @@ $(function() {
|
|||||||
sale_items.push(item);
|
sale_items.push(item);
|
||||||
|
|
||||||
$(items).each(function(i){
|
$(items).each(function(i){
|
||||||
var sale_item = {};
|
var sale_item = {};
|
||||||
sale_item.code = $(items[i]).attr('data-code');
|
sale_item.code = $(items[i]).attr('data-code');
|
||||||
sale_item.name = $(items[i]).attr('data-name');
|
sale_item.name = $(items[i]).attr('data-name');
|
||||||
sale_item.item_name = $('#set_name').text();
|
sale_item.item_name = $('#set_name').text();
|
||||||
@@ -1338,7 +1339,7 @@ $(function() {
|
|||||||
sale_items.push(sale_item);
|
sale_items.push(sale_item);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return sale_items;
|
return sale_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1347,7 +1348,7 @@ $(function() {
|
|||||||
url = '../../../../origami/customer_view';
|
url = '../../../../origami/customer_view';
|
||||||
}
|
}
|
||||||
if(modify_order == -1 && type != -1){
|
if(modify_order == -1 && type != -1){
|
||||||
url = '../../origami/customer_view';
|
url = '../../origami/customer_view';
|
||||||
}
|
}
|
||||||
if (type ==-1 && modify_order == -1){
|
if (type ==-1 && modify_order == -1){
|
||||||
url = '../../origami/customer_view';
|
url = '../../origami/customer_view';
|
||||||
@@ -1357,7 +1358,7 @@ $(function() {
|
|||||||
url: url,
|
url: url,
|
||||||
data: {"data":data,"status":status},
|
data: {"data":data,"status":status},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1368,7 +1369,7 @@ $(function() {
|
|||||||
// qty = $(this).val();
|
// qty = $(this).val();
|
||||||
// price = $("#set_total_price").text();
|
// price = $("#set_total_price").text();
|
||||||
// $("#set_total_price").text(qty*price);
|
// $("#set_total_price").text(qty*price);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// $(".change_qty").change(function(){
|
// $(".change_qty").change(function(){
|
||||||
// qty = $(this).val();
|
// qty = $(this).val();
|
||||||
@@ -1378,7 +1379,7 @@ $(function() {
|
|||||||
function show_menu_list(menu_items) {
|
function show_menu_list(menu_items) {
|
||||||
var menu_list = $('.menu_items_list');
|
var menu_list = $('.menu_items_list');
|
||||||
menu_list.empty();
|
menu_list.empty();
|
||||||
for(var field in menu_items) {
|
for(var field in menu_items) {
|
||||||
if (menu_items[field].is_sub_item == false) {
|
if (menu_items[field].is_sub_item == false) {
|
||||||
instances = menu_items[field].instances ;
|
instances = menu_items[field].instances ;
|
||||||
|
|
||||||
@@ -1439,7 +1440,7 @@ $(function() {
|
|||||||
}else{
|
}else{
|
||||||
image_path = menu_items[field].image;
|
image_path = menu_items[field].image;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if (modify_order) {
|
if (modify_order) {
|
||||||
image_path = "../../image/logo.png";
|
image_path = "../../image/logo.png";
|
||||||
@@ -1484,7 +1485,7 @@ $(function() {
|
|||||||
+'<span>'+ price +'</span>'
|
+'<span>'+ price +'</span>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'</div>'; ;
|
+'</div>'; ;
|
||||||
$('.menu_items_list').append(row);
|
$('.menu_items_list').append(row);
|
||||||
}
|
}
|
||||||
//end instances in menu-items alest 1 instance
|
//end instances in menu-items alest 1 instance
|
||||||
@@ -1492,4 +1493,4 @@ $(function() {
|
|||||||
//end is_sub_item false
|
//end is_sub_item false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
||||||
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
||||||
|
|
||||||
connected: function() {},
|
connected: function() {},
|
||||||
|
|
||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
var hostname = location.hostname.trim();
|
var hostname = location.hostname.trim();
|
||||||
if(data.from == "" || hostname == data.from){
|
if(data.from == "" || hostname == data.from){
|
||||||
var items = data.data;
|
var items = data.data;
|
||||||
var tax = data.tax_profiles;
|
var tax = data.tax_profiles;
|
||||||
var status= data.status
|
var status= data.status
|
||||||
@@ -16,8 +16,8 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
}
|
}
|
||||||
$('#second_display_slider').addClass("hidden")
|
$('#second_display_slider').addClass("hidden")
|
||||||
$('#second_display_items').removeClass("hidden")
|
$('#second_display_items').removeClass("hidden")
|
||||||
|
|
||||||
|
|
||||||
// append items
|
// append items
|
||||||
if (status == "add") {
|
if (status == "add") {
|
||||||
for(var i in items) {
|
for(var i in items) {
|
||||||
@@ -34,15 +34,15 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
|
|
||||||
// d_option = items[i].options;
|
// d_option = items[i].options;
|
||||||
// if (d_option){
|
// if (d_option){
|
||||||
// option_name = "-"+items[i].options;
|
// option_name = "-"+items[i].options;
|
||||||
// }else{
|
// }else{
|
||||||
// option_name = '';
|
// option_name = '';
|
||||||
// }
|
// }
|
||||||
|
|
||||||
d_option = items[i].opt;
|
d_option = items[i].opt;
|
||||||
if (items[i].click_type != "add_icon"){
|
if (items[i].click_type != "add_icon"){
|
||||||
option_name = "-"+items[i].options;
|
option_name = "-"+items[i].options;
|
||||||
data_option = items[i].options ;
|
data_option = items[i].options ;
|
||||||
}else{
|
}else{
|
||||||
option_name = ' ';
|
option_name = ' ';
|
||||||
data_option = '[]';
|
data_option = '[]';
|
||||||
@@ -56,25 +56,25 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
var instance_code = $(item_row[j]).attr('data-instance-code');
|
var instance_code = $(item_row[j]).attr('data-instance-code');
|
||||||
var r_option = $(item_row[j]).attr('data-options');
|
var r_option = $(item_row[j]).attr('data-options');
|
||||||
if (item_code == items[i].item_code && instance_code == items[i].instance_code && r_option==d_option) {
|
if (item_code == items[i].item_code && instance_code == items[i].instance_code && r_option==d_option) {
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = parseInt($(item_row[j]).children('#item_qty').text()) + qty;
|
qty = parseInt($(item_row[j]).children('#item_qty').text()) + qty;
|
||||||
}else{
|
}else{
|
||||||
qty = parseInt($(item_row[j]).children('#item_qty').text()) + 1;
|
qty = parseInt($(item_row[j]).children('#item_qty').text()) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(item_row[j]).children('#item_qty').text(qty);
|
$(item_row[j]).children('#item_qty').text(qty);
|
||||||
parseFloat($(item_row[j]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
parseFloat($(item_row[j]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
||||||
append =1;
|
append =1;
|
||||||
}else{
|
}else{
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = qty;
|
qty = qty;
|
||||||
}else{
|
}else{
|
||||||
qty = 1;
|
qty = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (append===0) {
|
if (append===0) {
|
||||||
row ="<tr class='item_box_"+items[i].item_code+"' data-price ='"
|
row ="<tr class='item_box_"+items[i].instance_code+"' data-price ='"
|
||||||
+price+ "' 'data-instance ='"
|
+price+ "' 'data-instance ='"
|
||||||
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
|
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
|
||||||
+items[i].instance_code+"' data-attributes='"
|
+items[i].instance_code+"' data-attributes='"
|
||||||
@@ -84,12 +84,12 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + items[i].name+ ' ' + instance + ' ' + option_name +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + items[i].name+ ' ' + instance + ' ' + option_name +'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(price).toFixed(2)
|
+ parseFloat(price).toFixed(2)
|
||||||
+'</td>'
|
+'</td>'
|
||||||
+'</tr>';
|
+'</tr>';
|
||||||
$(".second_display_items tbody").append(row);
|
$(".second_display_items tbody").append(row);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,28 +117,29 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name + ''+option+'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name + ''+option+'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(total).toFixed(2)
|
+ parseFloat(total).toFixed(2)
|
||||||
+'</td>'
|
+'</td>'
|
||||||
+'</tr>';
|
+'</tr>';
|
||||||
$(".second_display_items tbody").append(row);
|
$(".second_display_items tbody").append(row);
|
||||||
rowCount = rowCount + 1;
|
rowCount = rowCount + 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//remove item
|
//remove item
|
||||||
if(status == "remove"){
|
if(status == "remove"){
|
||||||
for(var i in items) {
|
for(var i in items) {
|
||||||
var item_code = items[i].item_code;
|
var item_code = items[i].instance_code;
|
||||||
$("#order-items-table tbody > tr.item_box_"+item_code+"").remove();
|
$("#order-items-table tbody > tr.item_box_"+item_code+"").remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//remove item
|
//remove item
|
||||||
//update item qty
|
//update item qty
|
||||||
if(status == "update_qty"){
|
if(status == "update_qty"){
|
||||||
|
|
||||||
for(var i in items) {
|
for(var i in items) {
|
||||||
var item_code = items[i].item_code;
|
var item_code = items[i].instance_code;
|
||||||
var item_qty = parseInt(items[i].qty);
|
var item_qty = parseInt(items[i].qty);
|
||||||
var item_price = parseFloat(items[i].price);
|
var item_price = parseFloat(items[i].price);
|
||||||
var item_total = parseFloat(item_qty * item_price).toFixed(2);
|
var item_total = parseFloat(item_qty * item_price).toFixed(2);
|
||||||
@@ -157,8 +158,8 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
$(item_row).each(function(i){
|
$(item_row).each(function(i){
|
||||||
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
|
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
|
||||||
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
|
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
|
||||||
total_price += qty*unit_price;
|
total_price += qty*unit_price;
|
||||||
});
|
});
|
||||||
//calculate Tax Amount
|
//calculate Tax Amount
|
||||||
for(var i in tax) {
|
for(var i in tax) {
|
||||||
// substract , to give after discount
|
// substract , to give after discount
|
||||||
@@ -177,13 +178,12 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
var fixed_taxable_amount = parseFloat(total_tax_amount).toFixed(2);
|
var fixed_taxable_amount = parseFloat(total_tax_amount).toFixed(2);
|
||||||
var fixed_grand_total = parseFloat(total_price + total_tax_amount).toFixed(2);
|
var fixed_grand_total = parseFloat(total_price + total_tax_amount).toFixed(2);
|
||||||
|
|
||||||
$('#s_sub_total').empty();
|
$('#s_sub_total').empty();
|
||||||
$('#s_sub_total').append(fixed_total_price);
|
$('#s_sub_total').append(fixed_total_price);
|
||||||
$('#s_tatal_tax').empty();
|
$('#s_tatal_tax').empty();
|
||||||
$('#s_tatal_tax').append(fixed_taxable_amount);
|
$('#s_tatal_tax').append(fixed_taxable_amount);
|
||||||
$('#s_grand_total').empty();
|
$('#s_grand_total').empty();
|
||||||
$('#s_grand_total').append(fixed_grand_total);
|
$('#s_grand_total').append(fixed_grand_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Api::PaymentsController < Api::ApiController
|
|||||||
if @status
|
if @status
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
status, @sale, @membership_data = sale_payment.process_payment(sale, current_login_employee, sale.grand_total, "paymal",params[:card_no])
|
status, @sale, @membership_data = sale_payment.process_payment(sale, current_login_employee, sale.grand_total, "paymal",params[:card_no])
|
||||||
|
|
||||||
if status == true && @membership_data["status"] == true
|
if status == true && @membership_data["status"] == true
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
status = sale_payment.process_payment(sale, current_login_employee, 0, "cash")
|
status = sale_payment.process_payment(sale, current_login_employee, 0, "cash")
|
||||||
@@ -95,7 +95,7 @@ class Api::PaymentsController < Api::ApiController
|
|||||||
@message = membership_data["message"]
|
@message = membership_data["message"]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@status = false
|
@status = false
|
||||||
@message = "No gateway url!"
|
@message = "No gateway url!"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
class Origami::AddordersController < BaseOrigamiController
|
class Origami::AddordersController < BaseOrigamiController
|
||||||
# before_action :set_dining, only: [:detail]
|
# before_action :set_dining, only: [:detail]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@webview = false
|
@webview = false
|
||||||
if check_mobile
|
if check_mobile
|
||||||
@webview = true
|
@webview = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@tables = Table.all.active.order('zone_id asc').group("zone_id")
|
@tables = Table.all.active.order('zone_id asc').group("zone_id")
|
||||||
@@ -17,7 +17,7 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
@cashier_type = params[:type]
|
@cashier_type = params[:type]
|
||||||
@webview = false
|
@webview = false
|
||||||
if check_mobile
|
if check_mobile
|
||||||
@webview = true
|
@webview = true
|
||||||
end
|
end
|
||||||
display_type = Lookup.find_by_lookup_type("display_type")
|
display_type = Lookup.find_by_lookup_type("display_type")
|
||||||
if !display_type.nil? && display_type.value.to_i ==2
|
if !display_type.nil? && display_type.value.to_i ==2
|
||||||
@@ -29,7 +29,7 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
@menus = []
|
@menus = []
|
||||||
@menu = []
|
@menu = []
|
||||||
# else
|
# else
|
||||||
# @menus = Menu.all
|
# @menus = Menu.all
|
||||||
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
||||||
# end
|
# end
|
||||||
|
|
||||||
@@ -57,10 +57,10 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
|
|
||||||
def get_menu_category ()
|
def get_menu_category ()
|
||||||
if (params[:id])
|
if (params[:id])
|
||||||
|
|
||||||
#Pull this menu
|
#Pull this menu
|
||||||
@menu = MenuCategory.find_by_id(params[:id])
|
@menu = MenuCategory.find_by_id(params[:id])
|
||||||
|
|
||||||
# puts @menu.menu_items[1].item_attributes.to_json
|
# puts @menu.menu_items[1].item_attributes.to_json
|
||||||
return @menu
|
return @menu
|
||||||
else
|
else
|
||||||
@@ -96,9 +96,9 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
return @sub_menu
|
return @sub_menu
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_all_product()
|
def get_all_product()
|
||||||
@product = Product.all
|
@product = Product.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@@ -108,7 +108,7 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
extra_time = ''
|
extra_time = ''
|
||||||
|
|
||||||
items_arr = []
|
items_arr = []
|
||||||
JSON.parse(params[:order_items]).each { |i|
|
JSON.parse(params[:order_items]).each { |i|
|
||||||
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
||||||
if i["item_instance_code"].include? "ext"
|
if i["item_instance_code"].include? "ext"
|
||||||
is_extra_time = true
|
is_extra_time = true
|
||||||
@@ -192,25 +192,25 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
type = 'order'
|
type = 'order'
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
from = getCloudDomain #get sub domain in cloud mode
|
||||||
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:order_source] != "quick_service" && params[:order_source] != "food_court"
|
if params[:order_source] != "quick_service" && params[:order_source] != "food_court"
|
||||||
process_order_queue(@order.order_id,@order.table_id,@order.source)
|
process_order_queue(@order.order_id,@order.table_id,@order.source)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Order.send_customer_view(@booking)
|
# Order.send_customer_view(@booking)
|
||||||
|
|
||||||
if current_user.role != "waiter" && params[:create_type] == "create_pay"
|
if current_user.role != "waiter" && params[:create_type] == "create_pay"
|
||||||
if @status && @booking && (@order.source == 'quick_service') || (@order.source == 'food_court')
|
if @status && @booking && (@order.source == 'quick_service') || (@order.source == 'food_court')
|
||||||
|
|
||||||
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||||
|
|
||||||
# for second display
|
# for second display
|
||||||
if @order.source == 'quick_service'
|
if @order.source == 'quick_service'
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
from = getCloudDomain #get sub domain in cloud mode
|
||||||
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale",from:from
|
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale",from:from
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
result = {:status=> @status, :data => @sale }
|
result = {:status=> @status, :data => @sale }
|
||||||
@@ -220,7 +220,7 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
result = {:status=> @status, :data => 0 }
|
result = {:status=> @status, :data => 0 }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# render json for http status code
|
# render json for http status code
|
||||||
@@ -266,9 +266,9 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
def process_order_queue(order_id,table_id,order_source)
|
def process_order_queue(order_id,table_id,order_source)
|
||||||
print_status = nil
|
print_status = nil
|
||||||
cup_status = nil
|
cup_status = nil
|
||||||
|
|
||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
order = Order.find(order_id)
|
order = Order.find(order_id)
|
||||||
sidekiq = Lookup.find_by_lookup_type("sidekiq")
|
sidekiq = Lookup.find_by_lookup_type("sidekiq")
|
||||||
if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] != 'cloud'
|
||||||
cup_status = `#{"sudo service cups status"}`
|
cup_status = `#{"sudo service cups status"}`
|
||||||
@@ -307,7 +307,7 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
if ENV["SERVER_MODE"] != 'cloud'
|
if ENV["SERVER_MODE"] != 'cloud'
|
||||||
from = ""
|
from = ""
|
||||||
msg = ' Print Error ! Please contact to service'
|
msg = ' Print Error ! Please contact to service'
|
||||||
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error',from:from
|
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error',from:from
|
||||||
end
|
end
|
||||||
if !sidekiq.nil?
|
if !sidekiq.nil?
|
||||||
@@ -342,7 +342,7 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
|
|
||||||
return from
|
return from
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# def set_dining
|
# def set_dining
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
sale_data = Sale.find_by_sale_id(sale_id)
|
sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
sale_items = SaleItem.get_all_sale_items(sale_id)
|
sale_items = SaleItem.get_all_sale_items(sale_id)
|
||||||
member_info = nil
|
member_info = nil
|
||||||
|
|
||||||
# For Cashier by Zone
|
# For Cashier by Zone
|
||||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||||
# if bookings.count > 1
|
# if bookings.count > 1
|
||||||
# # for Multiple Booking
|
# # for Multiple Booking
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
# else
|
# else
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
# end
|
# end
|
||||||
shift = ShiftSale.current_open_shift(current_user.id)
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
if !shift.nil?
|
if !shift.nil?
|
||||||
@@ -48,7 +48,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
if !receipt_bill_a5_pdf.empty?
|
if !receipt_bill_a5_pdf.empty?
|
||||||
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
||||||
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
||||||
if receipt_bilA5[1] == '1'
|
if receipt_bilA5[1] == '1'
|
||||||
unique_code = "ReceiptBillA5Pdf"
|
unique_code = "ReceiptBillA5Pdf"
|
||||||
else
|
else
|
||||||
@@ -59,7 +59,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
#shop detail
|
#shop detail
|
||||||
## shop_detail = Shop.first
|
## shop_detail = Shop.first
|
||||||
# customer= Customer.where('customer_id=' +.customer_id)
|
# customer= Customer.where('customer_id=' +.customer_id)
|
||||||
customer = Customer.find(sale_data.customer_id)
|
customer = Customer.find(sale_data.customer_id)
|
||||||
# rounding adjustment
|
# rounding adjustment
|
||||||
@@ -71,14 +71,14 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||||
rounding_adj = new_total-sale_data.grand_total
|
rounding_adj = new_total-sale_data.grand_total
|
||||||
sale_data.update_attributes(grand_total: new_total,old_grand_total: sale_data.grand_total,rounding_adjustment:rounding_adj)
|
sale_data.update_attributes(grand_total: new_total,old_grand_total: sale_data.grand_total,rounding_adjustment:rounding_adj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#end rounding adjustment
|
#end rounding adjustment
|
||||||
#record for sale audit
|
#record for sale audit
|
||||||
action_by = current_user.name
|
action_by = current_user.name
|
||||||
type = "FIRST_BILL"
|
type = "FIRST_BILL"
|
||||||
|
|
||||||
remark = "#{action_by} print out first bill for Receipt No #{sale_data.receipt_no}"
|
remark = "#{action_by} print out first bill for Receipt No #{sale_data.receipt_no}"
|
||||||
sale_audit = SaleAudit.record_audit_sale(sale_id,remark,action_by,type )
|
sale_audit = SaleAudit.record_audit_sale(sale_id,remark,action_by,type )
|
||||||
# get member information
|
# get member information
|
||||||
@@ -102,12 +102,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
|
||||||
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount,nil,nil,nil)
|
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount,nil,nil,nil)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
:filepath => filename,
|
:filepath => filename,
|
||||||
:printer_model => print_settings.brand_name,
|
:printer_model => print_settings.brand_name,
|
||||||
:printer_url => print_settings.api_settings
|
:printer_url => print_settings.api_settings
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mobile Print
|
# Mobile Print
|
||||||
@@ -127,7 +127,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
sale_items = SaleItem.get_all_sale_items(sale_id)
|
sale_items = SaleItem.get_all_sale_items(sale_id)
|
||||||
#shop_detail = Shop.first
|
#shop_detail = Shop.first
|
||||||
# rounding adjustment
|
# rounding adjustment
|
||||||
if !path.include? ("credit_payment")
|
if !path.include? ("credit_payment")
|
||||||
if shop_detail.is_rounding_adj
|
if shop_detail.is_rounding_adj
|
||||||
@@ -138,12 +138,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
rounding_adj = new_total-saleObj.grand_total
|
rounding_adj = new_total-saleObj.grand_total
|
||||||
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#end rounding adjustment
|
#end rounding adjustment
|
||||||
|
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
if path.include? ("credit_payment")
|
if path.include? ("credit_payment")
|
||||||
sale_payment.process_payment(saleObj, current_user, cash, "cash", nil, true)
|
sale_payment.process_payment(saleObj, current_user, cash, "cash", nil, true)
|
||||||
@@ -166,7 +166,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
table = DiningFacility.find(bookings.dining_facility_id)
|
table = DiningFacility.find(bookings.dining_facility_id)
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
type = 'payment'
|
type = 'payment'
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
from = getCloudDomain #get sub domain in cloud mode
|
||||||
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||||
@@ -193,11 +193,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
if !receipt_bill_a5_pdf.empty?
|
if !receipt_bill_a5_pdf.empty?
|
||||||
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
||||||
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
||||||
if receipt_bilA5[1] == '1'
|
if receipt_bilA5[1] == '1'
|
||||||
unique_code = "ReceiptBillA5Pdf"
|
unique_code = "ReceiptBillA5Pdf"
|
||||||
# else
|
# else
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -208,16 +208,16 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
# get member information
|
# get member information
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
credit_data = SalePayment.find_by_sale_id_and_payment_method(sale_id,'creditnote')
|
credit_data = SalePayment.find_by_sale_id_and_payment_method(sale_id,'creditnote')
|
||||||
|
|
||||||
if customer.membership_id != nil && rebate && credit_data.nil?
|
if customer.membership_id != nil && rebate && credit_data.nil?
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
|
|
||||||
if member_info["status"] == true
|
if member_info["status"] == true
|
||||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#orders print out
|
#orders print out
|
||||||
if params[:type] == "quick_service"
|
if params[:type] == "quick_service"
|
||||||
booking = Booking.find_by_sale_id(sale_id)
|
booking = Booking.find_by_sale_id(sale_id)
|
||||||
@@ -226,7 +226,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
table_id = 0
|
table_id = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
latest_order = booking.booking_orders.order("order_id DESC").limit(1).first()
|
latest_order = booking.booking_orders.order("order_id DESC").limit(1).first()
|
||||||
if !latest_order.nil?
|
if !latest_order.nil?
|
||||||
latest_order_no = latest_order.order_id
|
latest_order_no = latest_order.order_id
|
||||||
@@ -241,13 +241,13 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
from = getCloudDomain #get sub domain in cloud mode
|
from = getCloudDomain #get sub domain in cloud mode
|
||||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order,from:from
|
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order,from:from
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#for card sale data
|
#for card sale data
|
||||||
card_data = Array.new
|
card_data = Array.new
|
||||||
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
||||||
if !card_sale_trans_ref_no.nil?
|
if !card_sale_trans_ref_no.nil?
|
||||||
card_sale_trans_ref_no.each do |cash_sale_trans|
|
card_sale_trans_ref_no.each do |cash_sale_trans|
|
||||||
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
||||||
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
||||||
@@ -259,7 +259,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
#card_balance amount for Paymal payment
|
#card_balance amount for Paymal payment
|
||||||
card_balance_amount = SaleAudit.getCardBalanceAmount(sale_id)
|
card_balance_amount = SaleAudit.getCardBalanceAmount(sale_id)
|
||||||
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
# Calculate Food and Beverage Total
|
# Calculate Food and Beverage Total
|
||||||
@@ -274,10 +274,16 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
display_type = Lookup.find_by_lookup_type("display_type")
|
||||||
|
if !display_type.nil? && display_type.value.to_i ==2
|
||||||
|
@display_type = display_type.value
|
||||||
|
else
|
||||||
|
@display_type = nil
|
||||||
|
end
|
||||||
path = request.fullpath
|
path = request.fullpath
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
@trans_flag = true
|
@trans_flag = true
|
||||||
@@ -287,11 +293,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
@cashier_type = params[:type]
|
@cashier_type = params[:type]
|
||||||
end
|
end
|
||||||
|
|
||||||
if path.include? ("credit_payment")
|
if path.include? ("credit_payment")
|
||||||
@sale_payment = SalePayment.get_credit_amount_due_left(sale_id)
|
@sale_payment = SalePayment.get_credit_amount_due_left(sale_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@member_discount = MembershipSetting.find_by_discount(1)
|
@member_discount = MembershipSetting.find_by_discount(1)
|
||||||
@membership_rebate_balance=0
|
@membership_rebate_balance=0
|
||||||
|
|
||||||
@@ -326,15 +332,15 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
lookup_changable_tax = Lookup.collection_of('changable_tax')
|
lookup_changable_tax = Lookup.collection_of('changable_tax')
|
||||||
if !lookup_changable_tax.empty?
|
if !lookup_changable_tax.empty?
|
||||||
lookup_changable_tax.each do |changable_tax|
|
lookup_changable_tax.each do |changable_tax|
|
||||||
if changable_tax[0].downcase == "change"
|
if changable_tax[0].downcase == "change"
|
||||||
if changable_tax[1] == '0'
|
if changable_tax[1] == '0'
|
||||||
@changable_tax = false
|
@changable_tax = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@shop = shop_detail #show shop info
|
@shop = shop_detail #show shop info
|
||||||
|
|
||||||
@customer_lists = Customer.where("customer_id = 'CUS-000000000001' or customer_id = 'CUS-000000000002'")
|
@customer_lists = Customer.where("customer_id = 'CUS-000000000001' or customer_id = 'CUS-000000000002'")
|
||||||
|
|
||||||
@@ -373,7 +379,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
@rounding_adj = new_total-saleObj.grand_total
|
@rounding_adj = new_total-saleObj.grand_total
|
||||||
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj)
|
||||||
@sale_data.grand_total = new_total
|
@sale_data.grand_total = new_total
|
||||||
@sale_data.old_grand_total = saleObj.grand_total
|
@sale_data.old_grand_total = saleObj.grand_total
|
||||||
@sale_data.rounding_adjustment = @rounding_adj
|
@sale_data.rounding_adjustment = @rounding_adj
|
||||||
@@ -418,11 +424,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#end customer amount
|
#end customer amount
|
||||||
|
|
||||||
#paymal payment
|
#paymal payment
|
||||||
|
|
||||||
@sale_data.bookings.each do |sbk|
|
@sale_data.bookings.each do |sbk|
|
||||||
if sbk.dining_facility_id.to_i >0
|
if sbk.dining_facility_id.to_i >0
|
||||||
@@ -444,13 +450,13 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@sale_payment_data = SalePayment.get_sale_payments(@sale_data)
|
@sale_payment_data = SalePayment.get_sale_payments(@sale_data)
|
||||||
end
|
end
|
||||||
@sale_payment_data.each do |spay|
|
@sale_payment_data.each do |spay|
|
||||||
if spay.payment_method == "cash"
|
if spay.payment_method == "cash"
|
||||||
@cash += spay.payment_amount
|
@cash += spay.payment_amount
|
||||||
end
|
end
|
||||||
if spay.payment_method !="creditnote"
|
if spay.payment_method !="creditnote"
|
||||||
@other_payment += spay.payment_amount
|
@other_payment += spay.payment_amount
|
||||||
end
|
end
|
||||||
|
|
||||||
if spay.payment_method == "mpu"
|
if spay.payment_method == "mpu"
|
||||||
@other += spay.payment_amount
|
@other += spay.payment_amount
|
||||||
elsif spay.payment_method == "paypar"
|
elsif spay.payment_method == "paypar"
|
||||||
@@ -485,7 +491,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
member_info = nil
|
member_info = nil
|
||||||
latest_order_no = nil
|
latest_order_no = nil
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
|
||||||
# For Cashier by Zone
|
# For Cashier by Zone
|
||||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||||
|
|
||||||
@@ -494,11 +500,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if !latest_order.nil?
|
if !latest_order.nil?
|
||||||
latest_order_no = latest_order.order_id
|
latest_order_no = latest_order.order_id
|
||||||
end
|
end
|
||||||
# if bookings.count > 1
|
# if bookings.count > 1
|
||||||
# # for Multiple Booking
|
# # for Multiple Booking
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
# else
|
# else
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
# end
|
# end
|
||||||
shift = ShiftSale.current_open_shift(current_user.id)
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
if !shift.nil?
|
if !shift.nil?
|
||||||
@@ -512,14 +518,14 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
shift = ShiftSale.find(saleObj.shift_sale_id)
|
shift = ShiftSale.find(saleObj.shift_sale_id)
|
||||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
|
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
if !receipt_bill_a5_pdf.empty?
|
if !receipt_bill_a5_pdf.empty?
|
||||||
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
||||||
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
||||||
if receipt_bilA5[1] == '1'
|
if receipt_bilA5[1] == '1'
|
||||||
unique_code = "ReceiptBillA5Pdf"
|
unique_code = "ReceiptBillA5Pdf"
|
||||||
else
|
else
|
||||||
@@ -531,7 +537,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
#shop detail
|
#shop detail
|
||||||
#shop_detail = Shop.first
|
#shop_detail = Shop.first
|
||||||
# get member information
|
# get member information
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
if customer.membership_id != nil && rebate
|
if customer.membership_id != nil && rebate
|
||||||
@@ -543,7 +549,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
#for card sale data
|
#for card sale data
|
||||||
card_data = Array.new
|
card_data = Array.new
|
||||||
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
||||||
if !card_sale_trans_ref_no.nil?
|
if !card_sale_trans_ref_no.nil?
|
||||||
card_sale_trans_ref_no.each do |cash_sale_trans|
|
card_sale_trans_ref_no.each do |cash_sale_trans|
|
||||||
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
||||||
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
||||||
@@ -566,20 +572,20 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil)
|
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
:status => true,
|
:status => true,
|
||||||
:filepath => filename,
|
:filepath => filename,
|
||||||
:printer_model => print_settings.brand_name,
|
:printer_model => print_settings.brand_name,
|
||||||
:printer_url => print_settings.api_settings
|
:printer_url => print_settings.api_settings
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mobile Print
|
# Mobile Print
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
def foc
|
def foc
|
||||||
cash = params[:cash]
|
cash = params[:cash]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
sub_total = params[:sub_total]
|
sub_total = params[:sub_total]
|
||||||
@@ -598,7 +604,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
saleObj.update_attributes(grand_total: 0, rounding_adjustment: 0, amount_received: 0, amount_changed: 0)
|
saleObj.update_attributes(grand_total: 0, rounding_adjustment: 0, amount_received: 0, amount_changed: 0)
|
||||||
saleObj.compute_by_sale_items(sale_id, saleObj.sale_items,0,order_source)
|
saleObj.compute_by_sale_items(sale_id, saleObj.sale_items,0,order_source)
|
||||||
end
|
end
|
||||||
|
|
||||||
saleObj.update_attributes(grand_total: 0, rounding_adjustment: 0, amount_received: 0, amount_changed: 0)
|
saleObj.update_attributes(grand_total: 0, rounding_adjustment: 0, amount_received: 0, amount_changed: 0)
|
||||||
|
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@@ -612,7 +618,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# For Cashier by Zone
|
# For Cashier by Zone
|
||||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||||
@@ -629,17 +635,17 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
shift = ShiftSale.find(saleObj.shift_sale_id)
|
shift = ShiftSale.find(saleObj.shift_sale_id)
|
||||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Re-call Sale Data
|
# Re-call Sale Data
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
|
||||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
#shop detail
|
#shop detail
|
||||||
#shop_detail = Shop.first
|
#shop_detail = Shop.first
|
||||||
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
@@ -652,11 +658,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
|
||||||
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "FOC",nil,nil,other_amount,nil,nil,nil)
|
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "FOC",nil,nil,other_amount,nil,nil,nil)
|
||||||
result = {
|
result = {
|
||||||
:status => true,
|
:status => true,
|
||||||
:filepath => filename,
|
:filepath => filename,
|
||||||
:printer_model => print_settings.brand_name,
|
:printer_model => print_settings.brand_name,
|
||||||
:printer_url => print_settings.api_settings
|
:printer_url => print_settings.api_settings
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mobile Print
|
# Mobile Print
|
||||||
@@ -669,26 +675,26 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
table_id = 0
|
table_id = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
booking.booking_orders.each do |order|
|
booking.booking_orders.each do |order|
|
||||||
Order.pay_process_order_queue(order.order_id,table_id)
|
Order.pay_process_order_queue(order.order_id,table_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def rounding_adj
|
def rounding_adj
|
||||||
|
|
||||||
saleObj = Sale.find(params[:sale_id])
|
saleObj = Sale.find(params[:sale_id])
|
||||||
@shop = shop_detail
|
@shop = shop_detail
|
||||||
|
|
||||||
if @shop.is_rounding_adj
|
if @shop.is_rounding_adj
|
||||||
a = saleObj.grand_total % 25 # Modulus
|
a = saleObj.grand_total % 25 # Modulus
|
||||||
b = saleObj.grand_total / 25 # Division
|
b = saleObj.grand_total / 25 # Division
|
||||||
#not calculate rounding if modulus is 0 and division is even
|
#not calculate rounding if modulus is 0 and division is even
|
||||||
#calculate rounding if modulus is zero or not zero and division are not even
|
#calculate rounding if modulus is zero or not zero and division are not even
|
||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
rounding_adj = new_total-saleObj.grand_total
|
rounding_adj = new_total-saleObj.grand_total
|
||||||
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
@@ -697,12 +703,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
#print function for receipt
|
#print function for receipt
|
||||||
def print
|
def print
|
||||||
filename = params[:filename]
|
filename = params[:filename]
|
||||||
receipt_no = params[:receipt_no]
|
receipt_no = params[:receipt_no]
|
||||||
printer_name = params[:printer_name]
|
printer_name = params[:printer_name]
|
||||||
cashier_type = params[:type]
|
cashier_type = params[:type]
|
||||||
|
|
||||||
if cashier_type.strip.downcase == "doemal_order"
|
if cashier_type.strip.downcase == "doemal_order"
|
||||||
unique_code = "ReceiptBillOrderPdf"
|
unique_code = "ReceiptBillOrderPdf"
|
||||||
else
|
else
|
||||||
@@ -720,7 +726,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
if !receipt_bill_a5_pdf.empty?
|
if !receipt_bill_a5_pdf.empty?
|
||||||
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
||||||
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
|
||||||
if receipt_bilA5[1] == '1'
|
if receipt_bilA5[1] == '1'
|
||||||
unique_code = "ReceiptBillA5Pdf"
|
unique_code = "ReceiptBillA5Pdf"
|
||||||
# else
|
# else
|
||||||
@@ -734,12 +740,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_pdf(filename,receipt_no,print_settings.print_copies,printer_name)
|
printer.print_receipt_pdf(filename,receipt_no,print_settings.print_copies,printer_name)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
:status => true,
|
:status => true,
|
||||||
:filepath => filename,
|
:filepath => filename,
|
||||||
:printer_model => print_settings.brand_name,
|
:printer_model => print_settings.brand_name,
|
||||||
:printer_url => print_settings.api_settings
|
:printer_url => print_settings.api_settings
|
||||||
}
|
}
|
||||||
Rails.logger.debug "$$$$$$$$$ result ::"
|
Rails.logger.debug "$$$$$$$$$ result ::"
|
||||||
Rails.logger.debug result
|
Rails.logger.debug result
|
||||||
@@ -755,7 +761,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
tax_type = params[:tax_type]
|
tax_type = params[:tax_type]
|
||||||
sale = Sale.find(sale_id)
|
sale = Sale.find(sale_id)
|
||||||
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount,nil,order_source,tax_type)
|
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount,nil,order_source,tax_type)
|
||||||
|
|
||||||
render json: JSON.generate({:status => true})
|
render json: JSON.generate({:status => true})
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -768,4 +774,4 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
return from
|
return from
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
today = DateTime.now
|
today = DateTime.now
|
||||||
day = Date.today.wday
|
day = Date.today.wday
|
||||||
@@ -14,7 +14,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
@menus = []
|
@menus = []
|
||||||
@menu = []
|
@menu = []
|
||||||
# else
|
# else
|
||||||
# @menus = Menu.all
|
# @menus = Menu.all
|
||||||
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
||||||
# end
|
# end
|
||||||
@zone = Zone.all
|
@zone = Zone.all
|
||||||
@@ -28,20 +28,20 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
else
|
else
|
||||||
@display_type = nil
|
@display_type = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
#checked quick_service only
|
#checked quick_service only
|
||||||
@quick_service_only = true
|
@quick_service_only = true
|
||||||
lookup_dine_in = Lookup.collection_of('dinein_cashier')
|
lookup_dine_in = Lookup.collection_of('dinein_cashier')
|
||||||
if !lookup_dine_in.empty?
|
if !lookup_dine_in.empty?
|
||||||
lookup_dine_in.each do |dine_in|
|
lookup_dine_in.each do |dine_in|
|
||||||
if dine_in[0].downcase == "dineincashier"
|
if dine_in[0].downcase == "dineincashier"
|
||||||
if dine_in[1] == '1'
|
if dine_in[1] == '1'
|
||||||
@quick_service_only = false
|
@quick_service_only = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
render "origami/addorders/detail"
|
render "origami/addorders/detail"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
@menus = []
|
@menus = []
|
||||||
@menu = []
|
@menu = []
|
||||||
# else
|
# else
|
||||||
# @menus = Menu.all
|
# @menus = Menu.all
|
||||||
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
||||||
# end
|
# end
|
||||||
if(params[:id][0,3] == "BKI")
|
if(params[:id][0,3] == "BKI")
|
||||||
@@ -65,7 +65,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
@table = DiningFacility.find(@table_id)
|
@table = DiningFacility.find(@table_id)
|
||||||
@booking = @table.get_booking
|
@booking = @table.get_booking
|
||||||
end
|
end
|
||||||
|
|
||||||
@sale_id = params[:sale_id]
|
@sale_id = params[:sale_id]
|
||||||
|
|
||||||
if @booking
|
if @booking
|
||||||
@@ -96,7 +96,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
@cashier_type = "quick_service"
|
@cashier_type = "quick_service"
|
||||||
|
|
||||||
items_arr = []
|
items_arr = []
|
||||||
JSON.parse(params[:order_items]).each { |i|
|
JSON.parse(params[:order_items]).each { |i|
|
||||||
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
||||||
if i["item_instance_code"].include? "ext"
|
if i["item_instance_code"].include? "ext"
|
||||||
is_extra_time = true
|
is_extra_time = true
|
||||||
@@ -169,7 +169,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
@status, @booking = @order.generate
|
@status, @booking = @order.generate
|
||||||
if(params[:sale_id][0,3] == "SAL")
|
if(params[:sale_id][0,3] == "SAL")
|
||||||
if @status && @booking && @order.source == 'quick_service'
|
if @status && @booking && @order.source == 'quick_service'
|
||||||
if params[:sale_id]
|
if params[:sale_id]
|
||||||
@sale = Sale.find(params[:sale_id])
|
@sale = Sale.find(params[:sale_id])
|
||||||
@@ -180,17 +180,17 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
end
|
end
|
||||||
update = Sale.add_to_existing_pending_invoice(@table_id,params[:sale_id],@booking)
|
update = Sale.add_to_existing_pending_invoice(@table_id,params[:sale_id],@booking)
|
||||||
end
|
end
|
||||||
|
|
||||||
result = {:status=> true, :data => @sale }
|
result = {:status=> true, :data => @sale }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
end
|
end
|
||||||
elsif (params[:sale_id][0,3] == "BKI")
|
elsif (params[:sale_id][0,3] == "BKI")
|
||||||
result = {:status=> true, :data => 'OK' }
|
result = {:status=> true, :data => 'OK' }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
else
|
else
|
||||||
result = {:status=> true, :data => nil }
|
result = {:status=> true, :data => nil }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -216,9 +216,9 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
return @sub_menu
|
return @sub_menu
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_all_product()
|
def get_all_product()
|
||||||
@product = Product.all
|
@product = Product.all
|
||||||
end
|
end
|
||||||
|
|
||||||
# render json for http status code
|
# render json for http status code
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Origami::SecondDisplayController < BaseOrigamiController
|
|||||||
|
|
||||||
def customer_view
|
def customer_view
|
||||||
display_type = Lookup.find_by_lookup_type("display_type")
|
display_type = Lookup.find_by_lookup_type("display_type")
|
||||||
if !display_type.nil? && display_type.value.to_i == 2
|
if !display_type.nil? && display_type.value.to_i == 2
|
||||||
if params[:status]!= "billed"
|
if params[:status]!= "billed"
|
||||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
else
|
else
|
||||||
@@ -17,7 +17,7 @@ class Origami::SecondDisplayController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
from = request.subdomain + "." + request.domain
|
from = request.subdomain + "." + request.domain
|
||||||
else
|
else
|
||||||
from = ""
|
from = ""
|
||||||
end
|
end
|
||||||
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status],from:from
|
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status],from:from
|
||||||
|
|||||||
@@ -139,7 +139,16 @@
|
|||||||
<span class="font-15 shopinfo" >Team Viewer</span>
|
<span class="font-15 shopinfo" >Team Viewer</span>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
<%if current_login_employee.role =="cashier" %>
|
||||||
<li>
|
<li>
|
||||||
|
<p class="waves-effect waves-block p-l-30 m-b-5">
|
||||||
|
<a href="/origami/second_display" onclick="window.open('/origami/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
|
||||||
|
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
||||||
|
<span class="font-15 shopinfo" >Second Display</span>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||||
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
||||||
<span class="font-18">Logout</span>
|
<span class="font-18">Logout</span>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
||||||
|
|
||||||
|
|
||||||
<% type = request.path_info.include?('quick_service') || request.path_info.include?('food_court')%>
|
<% type = request.path_info.include?('quick_service') || request.path_info.include?('food_court')%>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<input type="hidden" name="link_type" id="link_type" value="<%= @cashier_type %>">
|
<input type="hidden" name="link_type" id="link_type" value="<%= @cashier_type %>">
|
||||||
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
|
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
|
||||||
<div class="row m-t--20">
|
<div class="row m-t--20">
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2 hidden" id="menu_data">
|
<div class="col-lg-2 col-md-2 col-sm-2 hidden" id="menu_data">
|
||||||
<li class="list-menu">
|
<li class="list-menu">
|
||||||
<a href="javascript:void(0);" class="menu-toggle dropdown-toggle toggled my-toggle " style="">
|
<a href="javascript:void(0);" class="menu-toggle dropdown-toggle toggled my-toggle " style="">
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<%end%>
|
<%end%>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<div id="menu1-slimscroll" data-height="0">
|
<div id="menu1-slimscroll" data-height="0">
|
||||||
<ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar">
|
<ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar">
|
||||||
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<% if type %>
|
<% if type %>
|
||||||
<% if !menu.code.include? "SPL" %>
|
<% if !menu.code.include? "SPL" %>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<p class="hidden menu-id"><%= menu.id %></p>
|
<p class="hidden menu-id"><%= menu.id %></p>
|
||||||
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
|
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
|
||||||
</a>
|
</a>
|
||||||
<ul class="sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
<ul class="sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<% if @table.get_current_checkout_booking.nil? %>
|
<% if @table.get_current_checkout_booking.nil? %>
|
||||||
<% if !menu.code.include? "SPL" %>
|
<% if !menu.code.include? "SPL" %>
|
||||||
<li class="nav-item ">
|
<li class="nav-item ">
|
||||||
<p class="hidden menu-id"><%= menu.id %></p>
|
<p class="hidden menu-id"><%= menu.id %></p>
|
||||||
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
|
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
|
||||||
</a>
|
</a>
|
||||||
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<% end%>
|
<% end%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<li class="nav-item ">
|
<li class="nav-item ">
|
||||||
<p class="hidden menu-id"><%= menu.id %></p>
|
<p class="hidden menu-id"><%= menu.id %></p>
|
||||||
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
|
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
|
||||||
</a>
|
</a>
|
||||||
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<ul class="ml-menu menu_list aria-hidden menu_cache_list" style="border-top: 1px solid #fff">
|
<ul class="ml-menu menu_list aria-hidden menu_cache_list" style="border-top: 1px solid #fff">
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<div id="menu-slimscroll" data-height="0">
|
<div id="menu-slimscroll" data-height="0">
|
||||||
<ul class="nav nav-tabs flex-column category_list category_cache_list" role="tablist" id="ul-navbar">
|
<ul class="nav nav-tabs flex-column category_list category_cache_list" role="tablist" id="ul-navbar">
|
||||||
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
<div class="col-md-1 col-lg-1 col-sm-1">
|
<div class="col-md-1 col-lg-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
|
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<% else%>
|
<% else%>
|
||||||
<p class="hidden" id="table_type"></p>
|
<p class="hidden" id="table_type"></p>
|
||||||
<div class="col-md-2 col-lg-2 col-sm-2">
|
<div class="col-md-2 col-lg-2 col-sm-2">
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
<div class="col-md-3 col-lg-3 col-sm-3">
|
<div class="col-md-3 col-lg-3 col-sm-3">
|
||||||
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
|
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Total:</strong></td>
|
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Total:</strong></td>
|
||||||
<td style="padding:2px;" width="15%"><strong id="total_qty">0</strong></td>
|
<td style="padding:2px;" width="15%"><strong id="total_qty">0</strong></td>
|
||||||
|
|
||||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total">0.00</strong></td>
|
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total">0.00</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -274,7 +274,7 @@
|
|||||||
<%elsif !modify_order && type%>
|
<%elsif !modify_order && type%>
|
||||||
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
|
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
|
||||||
<% if current_user.role != "waiter"%>
|
<% if current_user.role != "waiter"%>
|
||||||
|
|
||||||
<% if @quick_service_only %>
|
<% if @quick_service_only %>
|
||||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="create_pay_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-12" id="create_pay_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>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -393,8 +393,8 @@
|
|||||||
<p class="hidden" id="item_instances"></p>
|
<p class="hidden" id="item_instances"></p>
|
||||||
<p class="hidden" id="item_code"></p>
|
<p class="hidden" id="item_code"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-7 item-detail">
|
<div class="col-md-7 item-detail">
|
||||||
<h5>Attributes</h5>
|
<h5>Attributes</h5>
|
||||||
<div class="attributes-list">
|
<div class="attributes-list">
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -472,8 +472,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="instance-list row"></div>
|
<div class="instance-list row"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -511,14 +511,14 @@
|
|||||||
<% if table.get_booking.nil? %>
|
<% if table.get_booking.nil? %>
|
||||||
<% if table.get_checkout_booking.nil? %>
|
<% if table.get_checkout_booking.nil? %>
|
||||||
<% color="red"%>
|
<% color="red"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% color="orange"%>
|
<% color="orange"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if table.get_checkout_booking.nil? %>
|
<% if table.get_checkout_booking.nil? %>
|
||||||
<% color="blue"%>
|
<% color="blue"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% color="orange"%>
|
<% color="orange"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -537,13 +537,13 @@
|
|||||||
<% if table.get_booking.nil? %>
|
<% if table.get_booking.nil? %>
|
||||||
<% if table.get_checkout_booking.nil? %>
|
<% if table.get_checkout_booking.nil? %>
|
||||||
<% color="red"%>
|
<% color="red"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% color="orange"%>
|
<% color="orange"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if table.get_checkout_booking.nil? %>
|
<% if table.get_checkout_booking.nil? %>
|
||||||
<% color="blue"%>
|
<% color="blue"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% color="orange"%>
|
<% color="orange"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -595,11 +595,11 @@
|
|||||||
menu_cache_append(menus);
|
menu_cache_append(menus);
|
||||||
}else{
|
}else{
|
||||||
$("#menu_data").removeClass("hidden");
|
$("#menu_data").removeClass("hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
function menu_cache_append(menus){
|
function menu_cache_append(menus){
|
||||||
$("#menu_cache").removeClass("hidden");
|
$("#menu_cache").removeClass("hidden");
|
||||||
$(".menu_cache_name").text(menus[0]["name"])
|
$(".menu_cache_name").text(menus[0]["name"])
|
||||||
for(var i in menus) {
|
for(var i in menus) {
|
||||||
menu_list_template(menus[i]);
|
menu_list_template(menus[i]);
|
||||||
}
|
}
|
||||||
@@ -608,11 +608,11 @@
|
|||||||
for(var ii in category) {
|
for(var ii in category) {
|
||||||
if (category[ii]["is_available"]== true){
|
if (category[ii]["is_available"]== true){
|
||||||
if (category[ii]["valid_time"]== true){
|
if (category[ii]["valid_time"]== true){
|
||||||
if (category[ii]["parent_id"] == null ){
|
if (category[ii]["parent_id"] == null ){
|
||||||
if(cashier_type){
|
if(cashier_type){
|
||||||
if (category[ii]["code"].includes("SPL") != true) {
|
if (category[ii]["code"].includes("SPL") != true) {
|
||||||
category_list_template(category[ii]);
|
category_list_template(category[ii]);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if ($("#table_get_current").text()) {
|
if ($("#table_get_current").text()) {
|
||||||
if (category[ii]["code"].includes("SPL") != true) {
|
if (category[ii]["code"].includes("SPL") != true) {
|
||||||
@@ -625,7 +625,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".tables").on('click', function () {
|
$(".tables").on('click', function () {
|
||||||
@@ -659,13 +659,13 @@
|
|||||||
var name = $(this).attr("data-name");
|
var name = $(this).attr("data-name");
|
||||||
var menus = JSON.parse(localStorage.getItem("menus"));
|
var menus = JSON.parse(localStorage.getItem("menus"));
|
||||||
|
|
||||||
if (menus != null) {
|
if (menus != null) {
|
||||||
menu_click_cache_append(name,menus,menu_id);
|
menu_click_cache_append(name,menus,menu_id);
|
||||||
}else{
|
}else{
|
||||||
var url = "get_menu/"+menu_id;
|
var url = "get_menu/"+menu_id;
|
||||||
show_menu_cat_list(name, url);
|
show_menu_cat_list(name, url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//End menu category Click
|
//End menu category Click
|
||||||
|
|
||||||
function menu_click_cache_append(name,menus,menu_id) {
|
function menu_click_cache_append(name,menus,menu_id) {
|
||||||
@@ -682,22 +682,22 @@
|
|||||||
// +'</li>';
|
// +'</li>';
|
||||||
// $(".category_cache_list").append(row);
|
// $(".category_cache_list").append(row);
|
||||||
|
|
||||||
for(var i in menus) {
|
for(var i in menus) {
|
||||||
|
|
||||||
if (menu_id == menus[i]["id"] && menus[i]["is_active"] == true) {
|
if (menu_id == menus[i]["id"] && menus[i]["is_active"] == true) {
|
||||||
|
|
||||||
// menu_list_template(menus[i]);
|
// menu_list_template(menus[i]);
|
||||||
var category = menus[i]["categories"];
|
var category = menus[i]["categories"];
|
||||||
|
|
||||||
for(var ii in category) {
|
for(var ii in category) {
|
||||||
if (category[ii]["is_available"]== true){
|
if (category[ii]["is_available"]== true){
|
||||||
if (category[ii]["valid_time"]== true){
|
if (category[ii]["valid_time"]== true){
|
||||||
if (category[ii]["parent_id"] == null ){
|
if (category[ii]["parent_id"] == null ){
|
||||||
if(cashier_type){
|
if(cashier_type){
|
||||||
if (category[ii]["code"].includes("SPL") != true) {
|
if (category[ii]["code"].includes("SPL") != true) {
|
||||||
category_list_template(category[ii]);
|
category_list_template(category[ii]);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if ($("#table_get_current").text()) {
|
if ($("#table_get_current").text()) {
|
||||||
if (category[ii]["code"].includes("SPL") != true) {
|
if (category[ii]["code"].includes("SPL") != true) {
|
||||||
category_list_template(category[ii]);
|
category_list_template(category[ii]);
|
||||||
@@ -709,7 +709,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -726,7 +726,7 @@
|
|||||||
+'</ul>'
|
+'</ul>'
|
||||||
|
|
||||||
+' </li>';
|
+' </li>';
|
||||||
$(".category_cache_list").append(row);
|
$(".category_cache_list").append(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
function menu_list_template(menu) {
|
function menu_list_template(menu) {
|
||||||
@@ -735,11 +735,11 @@
|
|||||||
+' <a class="nav-link" data-toggle="tab" href="" role="tab"'
|
+' <a class="nav-link" data-toggle="tab" href="" role="tab"'
|
||||||
+' style="text-transform: lowercase;">'+menu.name+'</a>'
|
+' style="text-transform: lowercase;">'+menu.name+'</a>'
|
||||||
+'</li>';
|
+'</li>';
|
||||||
$(".menu_cache_list").append(row);
|
$(".menu_cache_list").append(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
//show menu item list when click menu category
|
//show menu item list when click menu category
|
||||||
function show_menu_cat_list(name, url_item){
|
function show_menu_cat_list(name, url_item){
|
||||||
var menu_list = $('.menu_items_list');
|
var menu_list = $('.menu_items_list');
|
||||||
menu_list.empty();
|
menu_list.empty();
|
||||||
|
|
||||||
@@ -759,13 +759,13 @@
|
|||||||
url_item = url_item;
|
url_item = url_item;
|
||||||
}
|
}
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url_item,
|
url: url_item,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
for(var i in data) {
|
for(var i in data) {
|
||||||
if (data[i].is_available == true) {
|
if (data[i].is_available == true) {
|
||||||
row = '<div class="card custom-card testimonial-card animated fadeInRight menu_category sub_click" data-id="'+ data[i].id +'">'
|
row = '<div class="card custom-card testimonial-card animated fadeInRight menu_category sub_click" data-id="'+ data[i].id +'">'
|
||||||
+' <div class="card-block custom-card-block">'
|
+' <div class="card-block custom-card-block">'
|
||||||
@@ -778,7 +778,7 @@
|
|||||||
list = '<li class="nav-item menu_category sub_click" data-id="'+ data[i].id +'">'
|
list = '<li class="nav-item menu_category sub_click" data-id="'+ data[i].id +'">'
|
||||||
+'<p class="hidden menu-id">'+ data[i].id +'</p> '
|
+'<p class="hidden menu-id">'+ data[i].id +'</p> '
|
||||||
+'<a class="nav-link" data-toggle="tab" href="" role="tab"> '+ data[i].name +''
|
+'<a class="nav-link" data-toggle="tab" href="" role="tab"> '+ data[i].name +''
|
||||||
+'<ul class=" sub_category_list hidden fadeInTop animated"'
|
+'<ul class=" sub_category_list hidden fadeInTop animated"'
|
||||||
+'id="sub_category_list">'
|
+'id="sub_category_list">'
|
||||||
+'</ul>'
|
+'</ul>'
|
||||||
+'</a>'
|
+'</a>'
|
||||||
@@ -788,15 +788,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//end Ajax
|
//end Ajax
|
||||||
}
|
}
|
||||||
//end show list function
|
//end show list function
|
||||||
|
|
||||||
$(document).on('click', '#clear_all', function(event){
|
$(document).on('click', '#clear_all', function(event){
|
||||||
$(".summary-items tbody").empty();
|
$(".summary-items tbody").empty();
|
||||||
$('#sub_total').text("0.00");
|
$('#sub_total').text("0.00");
|
||||||
$(".create").attr("disabled","disabled");
|
$(".create").attr("disabled","disabled");
|
||||||
});
|
customer_display_view(null,"reload");
|
||||||
|
});
|
||||||
|
|
||||||
|
function customer_display_view(data,status) {
|
||||||
|
url = '../../../../origami/customer_view';
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {"data":data,"status":status},
|
||||||
|
dataType: "json",
|
||||||
|
success:function(result){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
@@ -819,9 +832,9 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case 'add':
|
||||||
|
|
||||||
case 'del' :
|
case 'del' :
|
||||||
|
|
||||||
case 'clr':
|
case 'clr':
|
||||||
$('#modal-qty').val(1);
|
$('#modal-qty').val(1);
|
||||||
$('#modal-qty').attr('data-value',0);
|
$('#modal-qty').attr('data-value',0);
|
||||||
@@ -842,4 +855,4 @@
|
|||||||
showHideNavbar(webview);
|
showHideNavbar(webview);
|
||||||
<% end %>
|
<% end %>
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
else
|
else
|
||||||
delimiter = ""
|
delimiter = ""
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<!-- Widgets -->
|
<!-- Widgets -->
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
@@ -114,9 +114,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<% if payment.payment_method == 'paypar' %>
|
<% if payment.payment_method == 'paypar' %>
|
||||||
<td>Redeem Sale : </td>
|
<td>Redeem Sale : </td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<% @sale_data.each do |data| %>
|
<% @sale_data.each do |data| %>
|
||||||
<% pay_mth = payment.payment_method %>
|
<% pay_mth = payment.payment_method %>
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="body">
|
<div class="body">
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
<% if !@top_items.nil? %>
|
<% if !@top_items.nil? %>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||||
<td align="right" width="60px"><%= @top_items.item_name %>
|
<td align="right" width="60px"><%= @top_items.item_name %>
|
||||||
<br>(<%= @top_items.item_total_price %>)</td>
|
<br>(<%= @top_items.item_total_price %>)</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -249,7 +249,7 @@ $(function() {
|
|||||||
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
||||||
document.getElementById('second_view').click();
|
document.getElementById('second_view').click();
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/quick_service';
|
window.location.href = '/origami/quick_service';
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".fc_view").on('click', function() {
|
$(".fc_view").on('click', function() {
|
||||||
@@ -262,13 +262,13 @@ $(function() {
|
|||||||
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
||||||
document.getElementById('second_view').click();
|
document.getElementById('second_view').click();
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/food_court';
|
window.location.href = '/origami/food_court';
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".order_reservation").on('click', function() {
|
$(".order_reservation").on('click', function() {
|
||||||
window.location.href = '/origami/order_reservation';
|
window.location.href = '/origami/order_reservation';
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#second_view").on('click', function () {
|
$("#second_view").on('click', function () {
|
||||||
var url = $(this).attr("data-href");
|
var url = $(this).attr("data-href");
|
||||||
window.open(url,'_blank');
|
window.open(url,'_blank');
|
||||||
@@ -278,4 +278,4 @@ $(function() {
|
|||||||
window.location.href = '/origami/reservation';
|
window.location.href = '/origami/reservation';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<span class="hidden" id="dining"><%if !@dining.nil?%><%= @dining.id%><%end%></span>
|
<span class="hidden" id="dining"><%if !@dining.nil?%><%= @dining.id%><%end%></span>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Sale ID :</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></div>
|
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Sale ID :</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row p-l-5 p-r-5">
|
<div class="row p-l-5 p-r-5">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<strong>Customer :</strong>
|
<strong>Customer :</strong>
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row payment cash-color p-l-5 p-r-5">
|
<div class="row payment cash-color p-l-5 p-r-5">
|
||||||
<div class="col-md-8">Cash</div>
|
<div class="col-md-8">Cash</div>
|
||||||
<div class="col-md-4" id="cash" >
|
<div class="col-md-4" id="cash" >
|
||||||
@@ -387,6 +387,8 @@
|
|||||||
<div class="cashier_number border-top border- border-left payment-long" data-value="10000" data-type="add">10000</div>
|
<div class="cashier_number border-top border- border-left payment-long" data-value="10000" data-type="add">10000</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
|
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||||
|
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
|
||||||
<div class="pay border-top border- border-left purple payment-left" id="pay">Pay</div>
|
<div class="pay border-top border- border-left purple payment-left" id="pay">Pay</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -442,7 +444,7 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
@@ -468,7 +470,7 @@
|
|||||||
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -491,11 +493,11 @@
|
|||||||
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- pdf light box -->
|
<!-- pdf light box -->
|
||||||
<div class="modal fade" id="pdfModal" tabindex="-1" role="dialog" >
|
<div class="modal fade" id="pdfModal" tabindex="-1" role="dialog" >
|
||||||
@@ -511,20 +513,20 @@
|
|||||||
<input type="hidden" name="sale_receipt_no" id="sale_receipt_no">
|
<input type="hidden" name="sale_receipt_no" id="sale_receipt_no">
|
||||||
<input type="hidden" name="filename" id="filename">
|
<input type="hidden" name="filename" id="filename">
|
||||||
<input type="hidden" name="printer_name" id="printer_name">
|
<input type="hidden" name="printer_name" id="printer_name">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<iframe id="receipt_pdf" src="" class="pdf-iframe" scrolling="no"></iframe>
|
<iframe id="receipt_pdf" src="" class="pdf-iframe" scrolling="no"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt" id="print_receipt"> Print
|
<button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt" id="print_receipt"> Print
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn-lg btn-block bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
|
<button type="button" class="btn-lg btn-block bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
|
||||||
CLOSE
|
CLOSE
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- customer light box -->
|
<!-- customer light box -->
|
||||||
<div class="modal fade" id="is_memberModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="is_memberModal" tabindex="-1" role="dialog">
|
||||||
@@ -570,7 +572,7 @@
|
|||||||
<div class="modal-footer"></div>
|
<div class="modal-footer"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog modal-sm" role="document">
|
<div class="modal-dialog modal-sm" role="document">
|
||||||
@@ -579,7 +581,7 @@
|
|||||||
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
|
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
|
||||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">×</button>
|
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
||||||
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
|
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
|
||||||
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
||||||
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
|
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
|
||||||
@@ -598,12 +600,12 @@
|
|||||||
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
|
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||||
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
|
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
|
||||||
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
|
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- change tax modal -->
|
<!-- change tax modal -->
|
||||||
<div class="modal fade" id="change_taxModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="change_taxModal" tabindex="-1" role="dialog">
|
||||||
@@ -667,7 +669,7 @@
|
|||||||
<div class="m-r-20" align="right">
|
<div class="m-r-20" align="right">
|
||||||
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
|
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- customer light box -->
|
<!-- customer light box -->
|
||||||
<div class="modal fade m-t-40" id="is_paymemberModal" tabindex="-1" role="dialog">
|
<div class="modal fade m-t-40" id="is_paymemberModal" tabindex="-1" role="dialog">
|
||||||
@@ -694,14 +696,14 @@
|
|||||||
<div class="modal-footer"></div>
|
<div class="modal-footer"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// //control borwser back
|
// //control borwser back
|
||||||
window.location.hash="no-back-button";
|
window.location.hash="no-back-button";
|
||||||
window.location.hash="Again-No-back-button";//again because google chrome don't insert first hash into history
|
window.location.hash="Again-No-back-button";//again because google chrome don't insert first hash into history
|
||||||
window.onhashchange=function(){window.location.hash="";}
|
window.onhashchange=function(){window.location.hash="";}
|
||||||
var cashier_type = "<%= @cashier_type %>";
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
var customer_id = "<%= @customer.id %>";
|
var customer_id = "<%= @customer.id %>";
|
||||||
var customer_name = "<%= @customer.name %>";
|
var customer_name = "<%= @customer.name %>";
|
||||||
var pdf_view = '<%=@pdf_view%>';
|
var pdf_view = '<%=@pdf_view%>';
|
||||||
@@ -725,35 +727,35 @@ $(document).ready(function(){
|
|||||||
/* start check first bill or not*/
|
/* start check first bill or not*/
|
||||||
var member_id = $('#membership_id').text();
|
var member_id = $('#membership_id').text();
|
||||||
var member_discount = $('#member_discount').text();
|
var member_discount = $('#member_discount').text();
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
payment_type = '';
|
payment_type = '';
|
||||||
|
|
||||||
// if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
// if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
||||||
// console.log(payment_type)
|
// console.log(payment_type)
|
||||||
// console.log(parseInt(jQuery.inArray("MPU", payment_type)))
|
// console.log(parseInt(jQuery.inArray("MPU", payment_type)))
|
||||||
if (member_id && member_discount) {
|
if (member_id && member_discount) {
|
||||||
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
||||||
$("#credit_payment").hide();
|
$("#credit_payment").hide();
|
||||||
} else{
|
} else{
|
||||||
$("#credit_payment").show();
|
$("#credit_payment").show();
|
||||||
}
|
}
|
||||||
if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 ||
|
if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("VISA", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("VISA", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("JCB", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("JCB", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("Master", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("Master", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("Redeem", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("Redeem", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("Alipay", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("Alipay", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("DINGA", payment_type)) != -1 ||
|
parseInt(jQuery.inArray("DINGA", payment_type)) != -1 ||
|
||||||
parseInt(jQuery.inArray("GiftVoucher", payment_type)) != -1){
|
parseInt(jQuery.inArray("GiftVoucher", payment_type)) != -1){
|
||||||
$("#card_payment").show();
|
$("#card_payment").show();
|
||||||
} else{
|
} else{
|
||||||
$("#card_payment").hide();
|
$("#card_payment").hide();
|
||||||
}
|
}
|
||||||
@@ -775,9 +777,9 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/origami/table/'+ dining_id;
|
window.location.href = '/origami/table/'+ dining_id;
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/'+cashier_type+'/pending_order/'+sale_id;
|
window.location.href = '/origami/'+cashier_type+'/pending_order/'+sale_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
|
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
|
||||||
@@ -826,7 +828,7 @@ $(document).ready(function(){
|
|||||||
swal("Oops","Please Pay with Redeem Payment","warning");
|
swal("Oops","Please Pay with Redeem Payment","warning");
|
||||||
}else if(parseInt(jQuery.inArray("VISA", payment_type)) != -1 && $('#visacount').text()== 0 && sub_total != 0.0 && member){
|
}else if(parseInt(jQuery.inArray("VISA", payment_type)) != -1 && $('#visacount').text()== 0 && sub_total != 0.0 && member){
|
||||||
swal("Oops","Please Pay with Visa Payment","warning");
|
swal("Oops","Please Pay with Visa Payment","warning");
|
||||||
|
|
||||||
}else if(parseInt(jQuery.inArray("JCB", payment_type)) != -1 && $('#jcbcount').text()== 0 && sub_total != 0.0 && member){
|
}else if(parseInt(jQuery.inArray("JCB", payment_type)) != -1 && $('#jcbcount').text()== 0 && sub_total != 0.0 && member){
|
||||||
swal("Oops","Please Pay with jcb Payment","warning");
|
swal("Oops","Please Pay with jcb Payment","warning");
|
||||||
}
|
}
|
||||||
@@ -871,7 +873,7 @@ $(document).ready(function(){
|
|||||||
calculate_member_discount(sale_id,tax_type);
|
calculate_member_discount(sale_id,tax_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $("#pdfModal").on('shown.bs.modal', function () {
|
// $("#pdfModal").on('shown.bs.modal', function () {
|
||||||
// $('#pdfModal').focus() }).modal({show : true, backdrop : false, keyboard : false});
|
// $('#pdfModal').focus() }).modal({show : true, backdrop : false, keyboard : false});
|
||||||
/* check credit payment or not*/
|
/* check credit payment or not*/
|
||||||
if(location.pathname.includes("credit_payment")){
|
if(location.pathname.includes("credit_payment")){
|
||||||
@@ -891,7 +893,7 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
/* end delete receipt no in first bill*/
|
/* end delete receipt no in first bill*/
|
||||||
|
|
||||||
localStorage.removeItem("cash");
|
localStorage.removeItem("cash");
|
||||||
if (result.status) {
|
if (result.status) {
|
||||||
var msg = result.message;
|
var msg = result.message;
|
||||||
}
|
}
|
||||||
@@ -899,7 +901,7 @@ $(document).ready(function(){
|
|||||||
var msg = '';
|
var msg = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#loading_wrapper" ).hide();
|
$("#loading_wrapper" ).hide();
|
||||||
if(location.pathname.includes("credit_payment")){
|
if(location.pathname.includes("credit_payment")){
|
||||||
payment_success_alert();
|
payment_success_alert();
|
||||||
}else{
|
}else{
|
||||||
@@ -922,7 +924,7 @@ $(document).ready(function(){
|
|||||||
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
|
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
|
||||||
$("#pdfModalLabel").text("Sale Completed");
|
$("#pdfModalLabel").text("Sale Completed");
|
||||||
}else{
|
}else{
|
||||||
//PDF lightbox data
|
//PDF lightbox data
|
||||||
print_receipt();
|
print_receipt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -930,10 +932,26 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var second_display_lookup = $("#display_type").val();
|
||||||
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
|
||||||
|
customer_display_view(null,"reload");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function customer_display_view(data,status) {
|
||||||
|
url = '../../../../origami/customer_view';
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {"data":data,"status":status},
|
||||||
|
dataType: "json",
|
||||||
|
success:function(result){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// $('#void').on('click',function () {
|
// $('#void').on('click',function () {
|
||||||
// if ($(this).attr('active') === "true") {
|
// if ($(this).attr('active') === "true") {
|
||||||
// var sale_id = $('#sale_id').text();
|
// var sale_id = $('#sale_id').text();
|
||||||
// var remark = $("#remark").val();
|
// var remark = $("#remark").val();
|
||||||
// var ajax_url = "/origami/sale/" + sale_id + '/void';
|
// var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||||
@@ -949,7 +967,7 @@ $(document).ready(function(){
|
|||||||
// swal("Oops","You are not authorized for void","warning")
|
// swal("Oops","You are not authorized for void","warning")
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// bind survey to order or sale
|
// bind survey to order or sale
|
||||||
@@ -960,7 +978,7 @@ $(document).ready(function(){
|
|||||||
} else {
|
} else {
|
||||||
var sale_id = $('#dining').text();
|
var sale_id = $('#dining').text();
|
||||||
}
|
}
|
||||||
//var table_id = $('.tables').attr("data-id");
|
//var table_id = $('.tables').attr("data-id");
|
||||||
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys";
|
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys";
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1023,7 +1041,7 @@ $(document).ready(function(){
|
|||||||
}else{
|
}else{
|
||||||
window.location.href = "/origami/table/sale/" + sale_id + "/"+cashier_type+"/edit";
|
window.location.href = "/origami/table/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
swal("Oops","You are not authorized for void","warning")
|
swal("Oops","You are not authorized for void","warning")
|
||||||
}
|
}
|
||||||
@@ -1118,7 +1136,7 @@ $(document).ready(function(){
|
|||||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay) + parseFloat(paymal) + parseFloat(dinga) + parseFloat(giftvoucher);
|
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay) + parseFloat(paymal) + parseFloat(dinga) + parseFloat(giftvoucher);
|
||||||
|
|
||||||
var result = parseFloat(amount_due) - parseFloat(total);
|
var result = parseFloat(amount_due) - parseFloat(total);
|
||||||
|
|
||||||
<% if precision.to_i > 0 %>
|
<% if precision.to_i > 0 %>
|
||||||
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -1134,7 +1152,7 @@ $(document).ready(function(){
|
|||||||
url: '../../../customer_view',
|
url: '../../../customer_view',
|
||||||
data: {"data":data,"status":status},
|
data: {"data":data,"status":status},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1155,7 +1173,7 @@ $(document).ready(function(){
|
|||||||
url: "/origami/" + sale_id + "/member_discount",
|
url: "/origami/" + sale_id + "/member_discount",
|
||||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':cashier_type, 'tax_type':tax_type },
|
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':cashier_type, 'tax_type':tax_type },
|
||||||
async: false,
|
async: false,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1179,7 +1197,7 @@ $(document).ready(function(){
|
|||||||
var receipt_no = $("#sale_receipt_no").val();
|
var receipt_no = $("#sale_receipt_no").val();
|
||||||
var params = { 'filename':filename, 'receipt_no':receipt_no, 'printer_name':printer_name };
|
var params = { 'filename':filename, 'receipt_no':receipt_no, 'printer_name':printer_name };
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
|
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
|
||||||
data: params,
|
data: params,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
@@ -1203,7 +1221,7 @@ $(document).ready(function(){
|
|||||||
if (cashier_type=="quick_service"){
|
if (cashier_type=="quick_service"){
|
||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
payment_success_alert();
|
payment_success_alert();
|
||||||
@@ -1216,7 +1234,7 @@ $(document).ready(function(){
|
|||||||
var title = "Payment Successful!";
|
var title = "Payment Successful!";
|
||||||
if($('#balance').text() < 0){
|
if($('#balance').text() < 0){
|
||||||
var text = 'Changed amount ' + $('#balance').text() * (-1);
|
var text = 'Changed amount ' + $('#balance').text() * (-1);
|
||||||
}else{
|
}else{
|
||||||
$('#pay').text("Pay");
|
$('#pay').text("Pay");
|
||||||
var text = 'Thank You !';
|
var text = 'Thank You !';
|
||||||
}
|
}
|
||||||
@@ -1225,7 +1243,7 @@ $(document).ready(function(){
|
|||||||
title: "Payment Successful!",
|
title: "Payment Successful!",
|
||||||
text: text,
|
text: text,
|
||||||
html: true,
|
html: true,
|
||||||
closeOnConfirm: false,
|
closeOnConfirm: false,
|
||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
@@ -1245,7 +1263,7 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(".btn_pdf_close").on('click',function(){
|
$(".btn_pdf_close").on('click',function(){
|
||||||
var flag = localStorage.getItem("trans_flag");
|
var flag = localStorage.getItem("trans_flag");
|
||||||
@@ -1257,9 +1275,9 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/'+cashier_type;
|
window.location.href = '/origami/'+cashier_type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".btn_customer_yes").on('click',function(){
|
$(".btn_customer_yes").on('click',function(){
|
||||||
@@ -1268,8 +1286,8 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Read Card Reader
|
// Read Card Reader
|
||||||
$(".btn_member").on('click', function(){
|
$(".btn_member").on('click', function(){
|
||||||
var cardNo = "";
|
var cardNo = "";
|
||||||
var customer_id = '';
|
var customer_id = '';
|
||||||
var customer_name = '';
|
var customer_name = '';
|
||||||
var membership_id = '';
|
var membership_id = '';
|
||||||
@@ -1278,13 +1296,13 @@ $(document).ready(function(){
|
|||||||
var customer_mamber_card_no = 0;
|
var customer_mamber_card_no = 0;
|
||||||
|
|
||||||
$("#is_memberModal").hide();
|
$("#is_memberModal").hide();
|
||||||
$("#sxModal").show();
|
$("#sxModal").show();
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
getCardNo();
|
getCardNo();
|
||||||
$("#sxModal").hide();
|
$("#sxModal").hide();
|
||||||
customer_mamber_card_no = $("#paypar_account_no").val();
|
customer_mamber_card_no = $("#paypar_account_no").val();
|
||||||
|
|
||||||
if(sale_id != 0 && customer_mamber_card_no != 0){
|
if(sale_id != 0 && customer_mamber_card_no != 0){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/"+sale_id+"/get_customer" ,
|
url: "/origami/"+sale_id+"/get_customer" ,
|
||||||
@@ -1302,7 +1320,7 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},100);
|
},100);
|
||||||
});
|
});
|
||||||
@@ -1324,17 +1342,17 @@ $(document).ready(function(){
|
|||||||
// QR Code Reader
|
// QR Code Reader
|
||||||
$(".btn_qr_code").on('click', function(e){
|
$(".btn_qr_code").on('click', function(e){
|
||||||
$("#is_memberModal").hide();
|
$("#is_memberModal").hide();
|
||||||
var code = "";
|
var code = "";
|
||||||
var customer_id = '';
|
var customer_id = '';
|
||||||
var customer_name = '';
|
var customer_name = '';
|
||||||
var membership_id = '';
|
var membership_id = '';
|
||||||
var membership_type = '';
|
var membership_type = '';
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
code=getQRCode();
|
code=getQRCode();
|
||||||
$("#qr_code").val(code);
|
$("#qr_code").val(code);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(sale_id != 0 && code != ""){
|
if(sale_id != 0 && code != ""){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/"+sale_id+"/get_customer" ,
|
url: "/origami/"+sale_id+"/get_customer" ,
|
||||||
@@ -1352,13 +1370,13 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Read qrcode from java
|
// Read qrcode from java
|
||||||
function getQRCode(){
|
function getQRCode(){
|
||||||
return code2lab.readQRCode();
|
return code2lab.readQRCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_sale(membership_id, customer_id, customer_name, sale_id) {
|
function update_sale(membership_id, customer_id, customer_name, sale_id) {
|
||||||
@@ -1393,7 +1411,7 @@ $(document).ready(function(){
|
|||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1462,7 +1480,7 @@ $(document).ready(function(){
|
|||||||
var cash = $('#grand_total').text();
|
var cash = $('#grand_total').text();
|
||||||
var sub_total = $('#sub-total').text();
|
var sub_total = $('#sub-total').text();
|
||||||
var sale_id = $('#sale_id').text();
|
var sale_id = $('#sale_id').text();
|
||||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type,'access_code':access_code };
|
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type,'access_code':access_code };
|
||||||
swal({
|
swal({
|
||||||
title: "Alert",
|
title: "Alert",
|
||||||
text: "Are you sure want to FOC This Receipt?",
|
text: "Are you sure want to FOC This Receipt?",
|
||||||
@@ -1477,8 +1495,8 @@ $(document).ready(function(){
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/payment/"+cashier_type+"/foc",
|
url: "/origami/payment/"+cashier_type+"/foc",
|
||||||
data: params,
|
data: params,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
if (cash >= 0) {
|
if (cash >= 0) {
|
||||||
swal({
|
swal({
|
||||||
title: "Information!",
|
title: "Information!",
|
||||||
@@ -1498,14 +1516,14 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/'+cashier_type;
|
window.location.href = '/origami/'+cashier_type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#void').on('click', function () {
|
$('#void').on('click', function () {
|
||||||
@@ -1543,12 +1561,12 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/'+cashier_type;
|
window.location.href = '/origami/'+cashier_type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function waste_and_spoilage(remark) {
|
function waste_and_spoilage(remark) {
|
||||||
@@ -1588,12 +1606,12 @@ $(document).ready(function(){
|
|||||||
if(cashier_type=="quick_service"){
|
if(cashier_type=="quick_service"){
|
||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start function for tax changable */
|
/* Start function for tax changable */
|
||||||
@@ -1628,12 +1646,12 @@ $(document).ready(function(){
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/payment/"+cashier_type+"/change_tax",
|
url: "/origami/payment/"+cashier_type+"/change_tax",
|
||||||
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: type},
|
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: type},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
if(data.status){
|
if(data.status){
|
||||||
// console.log(type);
|
// console.log(type);
|
||||||
localStorage.setItem("tax_type", type);
|
localStorage.setItem("tax_type", type);
|
||||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment';
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
@@ -1666,10 +1684,10 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Read Card Reader - Paymal payment for FoodCourt
|
// Read Card Reader - Paymal payment for FoodCourt
|
||||||
$(".btn_paymal_member").on('click', function (){
|
$(".btn_paymal_member").on('click', function (){
|
||||||
var cardNo = "";
|
var cardNo = "";
|
||||||
var sale_id = $("#sale_id").text() || 0;
|
var sale_id = $("#sale_id").text() || 0;
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
@@ -1678,15 +1696,15 @@ $(document).ready(function(){
|
|||||||
var payment_amount = parseFloat($("#grand_total").text());
|
var payment_amount = parseFloat($("#grand_total").text());
|
||||||
|
|
||||||
$("#is_paymemberModal").hide();
|
$("#is_paymemberModal").hide();
|
||||||
$("#sxModal").show();
|
$("#sxModal").show();
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
getCardNo();
|
getCardNo();
|
||||||
$("#sxModal").hide();
|
$("#sxModal").hide();
|
||||||
customer_mamber_card_no = $("#paypar_account_no").val();
|
customer_mamber_card_no = $("#paypar_account_no").val();
|
||||||
if (customer_mamber_card_no == 0) {
|
if (customer_mamber_card_no == 0) {
|
||||||
customer_mamber_card_no = $("#membership_id").text() || 0;
|
customer_mamber_card_no = $("#membership_id").text() || 0;
|
||||||
}
|
}
|
||||||
if(sale_id != 0 && customer_mamber_card_no !=0){
|
if(sale_id != 0 && customer_mamber_card_no !=0){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/"+sale_id+"/send_account" ,
|
url: "/origami/"+sale_id+"/send_account" ,
|
||||||
@@ -1743,7 +1761,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
swal({
|
swal({
|
||||||
title: 'Oops',
|
title: 'Oops',
|
||||||
@@ -1763,16 +1781,16 @@ $(document).ready(function(){
|
|||||||
// QR Code Reader
|
// QR Code Reader
|
||||||
$(".btn_paymal_qr_code").on('click', function(e){
|
$(".btn_paymal_qr_code").on('click', function(e){
|
||||||
$("#is_paymemberModal").hide();
|
$("#is_paymemberModal").hide();
|
||||||
var code = "";
|
var code = "";
|
||||||
var sale_id = $("#sale_id").text() || 0;
|
var sale_id = $("#sale_id").text() || 0;
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
var payment_amount = parseFloat($("#grand_total").text());
|
var payment_amount = parseFloat($("#grand_total").text());
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
code=getQRCode();
|
code=getQRCode();
|
||||||
if(sale_id != 0 && code != ""){
|
if(sale_id != 0 && code != ""){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/"+sale_id+"/send_account" ,
|
url: "/origami/"+sale_id+"/send_account" ,
|
||||||
@@ -1828,8 +1846,8 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},100);
|
},100);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
class ChangeImageToAddLimitInDisplayImages < ActiveRecord::Migration[5.1]
|
||||||
|
|
||||||
|
def up
|
||||||
|
change_column :display_images, :image, :binary, :limit => 10.megabyte
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
change_column :display_images, :image, :binary, :limit => nil
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user