check shop code in order reservation

This commit is contained in:
phyusin
2018-05-11 17:14:42 +06:30
parent e618cd6e6d
commit c65bf1c163
3 changed files with 8 additions and 8 deletions

View File

@@ -8,12 +8,12 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
var order = data.data;
if(order.length > 0){
$('.custom-table.'+shop_code+'_order_reserve_cable tbody').html("");
$(".nav-item.red > a > p.num").text(order.length);
$(".nav-item ."+shop_code+" .red > a > p.num").text(order.length);
$.each(order, function(key,value){
var active_class = "";
if(key==0){
active_class = "tr-active";
showNewOrder(order[key]);
showNewOrder(order[key],shop_code);
}
var rowCount = key+1;
var date = new Date(value.created_at);

View File

@@ -404,7 +404,7 @@ function timeFormat(date){
return time;
}
function showNewOrder(order_reservation){
function showNewOrder(order_reservation,shop_code){
if((order_reservation!=undefined) && (order_reservation!=null) && (order_reservation!="")){
var date = new Date(order_reservation.requested_time);
var time = timeFormat(date);
@@ -418,15 +418,15 @@ function showNewOrder(order_reservation){
$("#new_order").text(order_reservation.order_reservation_id);
$("#new_order_date").text(requested_date);
$("#doemal_new_order").on('show.bs.modal', function(e){
$("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){
$("#notify_new_order").modal('hide');
$("#notify_order_send_to_kitchen").modal('hide');
$("#notify_order_ready_to_delivery").modal('hide');
}).on('shown.bs.modal', function(e){
$("#doemal_new_order").focus();
$("#"+shop_code+"_doemal_new_order").focus();
}).on('hide.bs.modal', function (e) {
audio.pause();
$("#doemal_new_order").modal("hide");
$("#"+shop_code+"_doemal_new_order").modal("hide");
}).modal({show: true, keyboard: false, backdrop: false});
}
}