merge with master
This commit is contained in:
@@ -61,7 +61,7 @@ $(document).on('turbolinks:load', function() {
|
||||
if (data[field]["options"] == "[]" || data[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = data.options;
|
||||
var options = data[field]["options"];
|
||||
}
|
||||
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
@@ -80,7 +80,7 @@ $(document).on('turbolinks:load', function() {
|
||||
+'<span class="order-qty"> [x'+ data[field]["qty"] +'] </span>'
|
||||
+'</p>'
|
||||
|
||||
+'<p class="card-text item-options">'+ options +'</p>'
|
||||
+'<br/><p class="card-text item-options">'+ options +'</p>'
|
||||
|
||||
+'<span class="card-text">'
|
||||
+'<span class="text-muted">Order at - '
|
||||
|
||||
@@ -206,6 +206,7 @@ $(function() {
|
||||
$('.set_order').attr('data-min-qty',item_sets[field]["min_selectable_qty"]);
|
||||
|
||||
value = item_sets[field]["instances"];
|
||||
|
||||
$(value).each(function(i){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -241,6 +242,11 @@ $(function() {
|
||||
});
|
||||
}
|
||||
|
||||
$('.set-item').attr('data-code',instances[0]['code']);
|
||||
$('.set-item').attr('data-name',instances[0]['name']);
|
||||
$('.set-item').attr('data-price',instances[0]['price']);
|
||||
$('.set-item').attr('data-options','[]');
|
||||
|
||||
$('#set_change_qty').val(1);
|
||||
$('#set_item_instances').text(instances);
|
||||
$('#set_name').text(data.attr('data-name'));
|
||||
@@ -313,6 +319,8 @@ $(function() {
|
||||
item_name = $('#set_name').text();
|
||||
min_qty = $(this).data('min-qty');
|
||||
|
||||
default_instance = $('.set-item');
|
||||
|
||||
var items = $('.selected-instance');
|
||||
|
||||
if (items.length >= min_qty) {
|
||||
@@ -342,6 +350,29 @@ $(function() {
|
||||
$(".summary-items tbody").append(row);
|
||||
rowCount = rowCount + 1;
|
||||
});
|
||||
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
option_arr = []
|
||||
code = $('.set-item').attr('data-code');
|
||||
name = $('.set-item').attr('data-name');
|
||||
price = $('.set-item').attr('data-price');
|
||||
option = $('.set-item').attr('data-options');
|
||||
total = qty * price ;
|
||||
option_arr.push(option);
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
||||
+code+"' data-attributes='"
|
||||
+attribute_arr+"' data-options ='"
|
||||
+option_arr+"' data-row ='"+rowCount+ "'>"
|
||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +'</td>'
|
||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||
+'<td class="item-cell-price" id="item_price">'
|
||||
+ parseFloat(total).toFixed(2)
|
||||
+'</td>'
|
||||
+'</tr>';
|
||||
$(".summary-items tbody").append(row);
|
||||
calculate_sub_total();
|
||||
$(".sx_item_set_detailModal").css({ 'display': "none" });
|
||||
}else{
|
||||
@@ -526,7 +557,7 @@ $(function() {
|
||||
}
|
||||
});
|
||||
if (active) {
|
||||
$(this).revoveClass('selected-option');
|
||||
$(this).removeClass('selected-option');
|
||||
}else{
|
||||
$(this).addClass('selected-option');
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ App.checkin = App.cable.subscriptions.create('CheckInBookingChannel', {
|
||||
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(data) {
|
||||
$('.table_'+data.table.id).removeClass('green');
|
||||
$('.table_'+data.table.id).addClass('blue');
|
||||
$('.new_text_'+data.table.id).removeClass('hide')
|
||||
received: function(data) {
|
||||
if($('.table_'+data.table.id).hasClass('green')){
|
||||
$('.table_'+data.table.id).removeClass('green');
|
||||
$('.table_'+data.table.id).addClass('blue');
|
||||
}
|
||||
$('.new_text_'+data.table.id).removeClass('hide');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -6,21 +6,21 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(data) {
|
||||
$.each(data.table,function(key,value){
|
||||
if($('.table_'+value.table_id).hasClass('blue')){
|
||||
$('.table_'+value.table_id).removeClass('blue');
|
||||
$('.table_'+value.table_id).addClass('orange');
|
||||
}
|
||||
else if($('.table_'+value.table_id).hasClass('red')){
|
||||
$('.table_'+value.table_id).removeClass('red');
|
||||
$('.table_'+value.table_id).addClass('orange');
|
||||
}
|
||||
else {
|
||||
$('.table_'+value.table_id).removeClass('green');
|
||||
$('.table_'+value.table_id).addClass('orange');
|
||||
}
|
||||
$('.new_text_'+value.table_id).removeClass('hide');
|
||||
});
|
||||
$.each(data.table,function(key,value){
|
||||
if($('.table_'+value.table_id).hasClass('blue')){
|
||||
$('.table_'+value.table_id).removeClass('blue');
|
||||
$('.table_'+value.table_id).addClass('orange');
|
||||
}
|
||||
else if($('.table_'+value.table_id).hasClass('red')){
|
||||
$('.table_'+value.table_id).removeClass('red');
|
||||
$('.table_'+value.table_id).addClass('orange');
|
||||
}
|
||||
else {
|
||||
$('.table_'+value.table_id).removeClass('green');
|
||||
$('.table_'+value.table_id).addClass('orange');
|
||||
}
|
||||
$('.new_text_'+value.table_id).removeClass('hide');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
if (items[field]["options"] == "[]" || items[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = items.options;
|
||||
var options = items[field]["options"];
|
||||
}
|
||||
//for count
|
||||
test = document.getElementsByClassName("oqs_count");
|
||||
@@ -49,7 +49,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
+'<span class="order-qty"> [x'+ items[field]["qty"] +'] </span>'
|
||||
+'</p>'
|
||||
|
||||
+'<p class="card-text item-options">'+ options +'</p>'
|
||||
+'<br/><p class="card-text item-options">'+ options +'</p>'
|
||||
|
||||
+'<span class="card-text">'
|
||||
+'<span class="text-muted">Order at - '
|
||||
|
||||
@@ -143,3 +143,55 @@ $(document).on('turbolinks:load', function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
/* start check first bill or not funs: */
|
||||
function checkReceiptNoInFirstBillData(receipt_no,payment) {
|
||||
// localStorage.removeItem('receipt_lists');
|
||||
var status = false;
|
||||
if((receipt_no!=undefined) && (receipt_no!="")){
|
||||
if(localStorage.hasOwnProperty("receipt_lists")===true){
|
||||
var arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
||||
if (payment) {
|
||||
var json_data = arr_data.filter(function(e) { return e.receipt_no == receipt_no });
|
||||
}else{
|
||||
var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
||||
}
|
||||
|
||||
if((arr_data.length) > (json_data.length)){
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (payment) {
|
||||
return json_data[0]["payment"];
|
||||
}else{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
function createReceiptNoInFirstBillData(receipt_no,payment) {
|
||||
var arr_data = [];
|
||||
var json_data = [];
|
||||
if(localStorage.hasOwnProperty("receipt_lists") === true){
|
||||
arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
||||
json_data = arr_data.filter(function(e) { return e.receipt_no == receipt_no });
|
||||
if (payment) {
|
||||
jdata = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
||||
jdata.push({'receipt_no':receipt_no,'payment':payment});
|
||||
localStorage.setItem("receipt_lists",JSON.stringify(jdata));
|
||||
}
|
||||
}
|
||||
if(((arr_data.length == 0) && (json_data.length == 0)) || ((arr_data.length > 0) && (json_data.length == 0))){
|
||||
arr_data.push({'receipt_no':receipt_no,'payment':payment});
|
||||
localStorage.setItem("receipt_lists",JSON.stringify(arr_data));
|
||||
}
|
||||
}
|
||||
|
||||
function deleteReceiptNoInFirstBillData(receipt_no) {
|
||||
if(localStorage.hasOwnProperty("receipt_lists") ===true ){
|
||||
var arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
||||
var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
||||
localStorage.setItem("receipt_lists",JSON.stringify(json_data));
|
||||
}
|
||||
}
|
||||
/* end check first bill or not funs: */
|
||||
Reference in New Issue
Block a user