Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Aung Myo
2018-05-14 10:24:43 +06:30
14 changed files with 285 additions and 137 deletions

View File

@@ -8,5 +8,7 @@ COPY Gemfile /sxrestaurant/Gemfile
COPY Gemfile.lock /sxrestaurant/Gemfile.lock COPY Gemfile.lock /sxrestaurant/Gemfile.lock
RUN bundle install --without development test RUN bundle install --without development test
RUN bundle exec rails assets:precompile RUN bundle exec rails assets:precompile
RUN echo "Asia/Rangoon" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata
COPY . /sxrestaurant COPY . /sxrestaurant

View File

@@ -5,6 +5,7 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
received: function(data) { received: function(data) {
var order = data.data; var order = data.data;
var shop_code = data.shop_code;
if(order.length > 0){ if(order.length > 0){
var order_lists = ""; var order_lists = "";
$.each(order, function(key, value){ $.each(order, function(key, value){
@@ -18,30 +19,33 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
}); });
// alert(order_lists); // alert(order_lists);
// swal({ swal({
// title: 'Information', title: 'Information',
// target: document.getElementById("notify_new_order"), target: document.getElementById(shop_code+"_notify_new_order"),
// text: "You have new orders <br/>"+ text: "You have new orders <br/>"+
// "Are you accept or reject for these orders <b>"+order_lists+"</b>?", "Are you accept or reject for these orders <b>"+order_lists+"</b>?",
// type: 'success', type: 'success',
// html: true, html: true,
// closeOnConfirm: false, closeOnConfirm: false,
// closeOnCancel: false, closeOnCancel: false,
// allowOutsideClick: false allowOutsideClick: false
// }, function (isConfirm) { }, function (isConfirm) {
// if(isConfirm){ if(isConfirm){
// swal.close(); swal.close();
}
});
// $("#notify_new_order_lists").text(order_lists);
// if($("#notify_new_order").hasClass("hidden")){
// $("#notify_new_order").removeClass("hidden");
// } // }
// }); // $("#notify_new_order").on('show.bs.modal', function(e){
$("#notify_new_order_lists").text(order_lists); // $("#notify_order_send_to_kitchen").addClass("hidden");
$("#notify_new_order").on('show.bs.modal', function(e){ // $("#notify_order_ready_to_delivery").addClass("hidden");
$("#notify_order_send_to_kitchen").modal('hide'); // }).on('shown.bs.modal', function(e){
$("#notify_order_ready_to_delivery").modal('hide'); // $("#notify_new_order").focus();
}).on('shown.bs.modal', function(e){ // }).on('hide.bs.modal', function (e) {
$("#notify_new_order").focus(); // $("#notify_new_order").addClass("hidden");
}).on('hide.bs.modal', function (e) { // }).modal({show: true, keyboard: false, backdrop: false});
$("#notify_new_order").modal("hide");
}).modal({show: true, keyboard: false, backdrop: false});
} }
} }
}); });

View File

@@ -5,6 +5,7 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe
received: function(data) { received: function(data) {
var order = data.data; var order = data.data;
var shop_code = data.shop_code;
if(order.length > 0){ if(order.length > 0){
var order_lists = ""; var order_lists = "";
$.each(order, function(key, value){ $.each(order, function(key, value){
@@ -18,30 +19,33 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe
}); });
// alert(order_lists); // alert(order_lists);
// swal({ swal({
// title: 'Information', title: 'Information',
// target: document.getElementById("notify_order_ready_to_delivery"), target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
// text: "You have orders that are ready to deliver <br/>"+ text: "You have orders that are ready to deliver <br/>"+
// "Could you ready these orders <b>"+order_lists+"</b> to deliver?", "Could you ready these orders <b>"+order_lists+"</b> to deliver?",
// type: 'success', type: 'success',
// html: true, html: true,
// closeOnConfirm: false, closeOnConfirm: false,
// closeOnCancel: false, closeOnCancel: false,
// allowOutsideClick: false allowOutsideClick: false
// }, function (isConfirm) { }, function (isConfirm) {
// if(isConfirm){ if(isConfirm){
// swal.close(); swal.close();
}
});
// $("#notify_order_ready_to_delivery_lists").text(order_lists);
// if($("#notify_order_ready_to_delivery").hasClass("hidden")){
// $("#notify_order_ready_to_delivery").removeClass("hidden");
// } // }
// }); // $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){
$("#notify_order_ready_to_delivery_lists").text(order_lists); // $("#notify_new_order").addClass("hidden");
$("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ // $("#notify_order_send_to_kitchen").addClass("hidden");
$("#notify_new_order").modal('hide'); // }).on('shown.bs.modal', function(e){
$("#notify_order_send_to_kitchen").modal('hide'); // $("#notify_order_ready_to_delivery").focus();
}).on('shown.bs.modal', function(e){ // }).on('hide.bs.modal', function (e) {
$("#notify_order_ready_to_delivery").focus(); // $("#notify_order_ready_to_delivery").addClass("hidden");
}).on('hide.bs.modal', function (e) { // }).modal({show: true, keyboard: false, backdrop: false});
$("#notify_order_ready_to_delivery").modal("hide");
}).modal({show: true, keyboard: false, backdrop: false});
} }
} }
}); });

View File

@@ -5,6 +5,7 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend
received: function(data) { received: function(data) {
var order = data.data; var order = data.data;
var shop_code = data.shop_code;
if(order.length > 0){ if(order.length > 0){
var order_lists = ""; var order_lists = "";
$.each(order, function(key, value){ $.each(order, function(key, value){
@@ -18,30 +19,33 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend
}); });
// alert(order_lists); // alert(order_lists);
// swal({ swal({
// title: 'Information', title: 'Information',
// target: document.getElementById("notify_order_send_to_kitchen"), target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
// text: "You have to send order to kitchen <br/>"+ text: "You have to send order to kitchen <br/>"+
// "Could you send these orders <b>"+order_lists+"</b> to kitchen?", "Could you send these orders <b>"+order_lists+"</b> to kitchen?",
// type: 'success', type: 'success',
// html: true, html: true,
// closeOnConfirm: false, closeOnConfirm: false,
// closeOnCancel: false, closeOnCancel: false,
// allowOutsideClick: false allowOutsideClick: false
// }, function (isConfirm) { }, function (isConfirm) {
// if(isConfirm){ if(isConfirm){
// swal.close(); swal.close();
}
});
// $("#notify_order_send_to_kitchen_lists").text(order_lists);
// if($("#notify_order_send_to_kitchen").hasClass("hidden")){
// $("#notify_order_send_to_kitchen").removeClass("hidden");
// } // }
// }); // $("#notify_order_send_to_kitchen").on('show.bs.modal', function(e){
$("#notify_order_send_to_kitchen_lists").text(order_lists); // $("#notify_new_order").addClass("hidden");
$("#notify_order_send_to_kitchen").on('show.bs.modal', function(e){ // $("#notify_order_ready_to_delivery").addClass("hidden");
$("#notify_new_order").modal('hide'); // }).on('shown.bs.modal', function(e){
$("#notify_order_ready_to_delivery").modal('hide'); // $("#notify_order_send_to_kitchen").focus();
}).on('shown.bs.modal', function(e){ // }).on('hide.bs.modal', function (e) {
$("#notify_order_send_to_kitchen").focus(); // $("#notify_order_send_to_kitchen").addClass("hidden");
}).on('hide.bs.modal', function (e) { // }).modal({show: true, keyboard: false, backdrop: false});
$("#notify_order_send_to_kitchen").modal("hide");
}).modal({show: true, keyboard: false, backdrop: false});
} }
} }
}); });

View File

@@ -21,9 +21,9 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
var created_at = date.getFullYear() +'-'+ (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >=10?date.getDate() : '0'+date.getDate()); var created_at = date.getFullYear() +'-'+ (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >=10?date.getDate() : '0'+date.getDate());
var delivery_type = ""; var delivery_type = "";
if(value.delivery_type == "service"){ if(value.provider == "food2u" || value.provider == "yangondoor2door"){
delivery_type = "DELIVERY"; delivery_type = "DELIVERY";
}else if(value.delivery_type == "pick_up"){ }else if(value.provider == "pick_up"){
delivery_type = "PICK-UP"; delivery_type = "PICK-UP";
}else{ }else{
delivery_type = "DIRECT DELIVERY"; delivery_type = "DIRECT DELIVERY";

View File

@@ -54,7 +54,17 @@ $(document).ready(function() {
}); });
$('#modal-set-slimscroll').slimScroll({ $('#modal-set-slimscroll').slimScroll({
height: height-$('#modal-slimscroll').attr('data-height'), height: height-$('#modal-set-slimscroll').attr('data-height'),
size: '5px',
color: 'rgba(0,0,0,0.5)',
alwaysVisible: false,
borderRadius: '0',
railBorderRadius: '0',
touchScrollStep : 45
});
$('#customer-info-slimscroll').slimScroll({
height: height-$('#customer-info-slimscroll').attr('data-height'),
size: '5px', size: '5px',
color: 'rgba(0,0,0,0.5)', color: 'rgba(0,0,0,0.5)',
alwaysVisible: false, alwaysVisible: false,

View File

@@ -5,6 +5,7 @@ $(function() {
$('#accepted').hide(); $('#accepted').hide();
$('#cancel').hide(); $('#cancel').hide();
$(".tbl_customer").hide(); $(".tbl_customer").hide();
$(".order_close_cashier").hide();
$(function() { $(function() {
$('.first-1').click(); $('.first-1').click();
}); });
@@ -17,6 +18,7 @@ $(function() {
$('#accepted').hide(); $('#accepted').hide();
$('#cancel').hide(); $('#cancel').hide();
$(".tbl_customer").hide(); $(".tbl_customer").hide();
$(".order_close_cashier").hide();
if (type == "pending") { if (type == "pending") {
$(".first-1").click(); $(".first-1").click();
$('#accepted').text("ACCEPT"); $('#accepted').text("ACCEPT");
@@ -36,6 +38,7 @@ $(function() {
$('#accepted').attr("data-value","completed"); $('#accepted').attr("data-value","completed");
}else if(type == "processed"){ }else if(type == "processed"){
$(".fifth-1").click(); $(".fifth-1").click();
$(".order_close_cashier").show();
// $('#accepted').hide(); // $('#accepted').hide();
// $('#cancel').hide(); // $('#cancel').hide();
} }
@@ -119,6 +122,12 @@ $(function() {
callback_url(callback,ref_no,order_id,status,type,minutes); callback_url(callback,ref_no,order_id,status,type,minutes);
}); });
$('#order_close_cashier').on('click',function(e){
e.preventDefault(); // Prevent the href from redirecting directly
var linkURL = '/origami/shift/ordering/close';
warnBeforeRedirect(linkURL);
});
$(document).on('click','.access_number', function(event){ $(document).on('click','.access_number', function(event){
if(event.handled !== true) { if(event.handled !== true) {
var original_value = $('#access_code').val(); var original_value = $('#access_code').val();
@@ -148,9 +157,39 @@ $(function() {
} }
}); });
$('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); }); // $('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); });
// $(".new_order_close").on("click",function(){
// var code = $(this).attr("data-value");
// $("#"+code+"_doemal_new_order").modal("hide");
// });
// $("[data-dismiss='modal']").on('click', function() {
// $('body').addClass('modal-open-fix');
// if($('body').css("padding-right") == '15px') {
// $('body').addClass('modal-open-fix-pad');
// }
// setTimeout(function() {
// if($('body').hasClass('modal-open-fix-pad')) {
// $('body').css('padding-right', '15px');
// }
// $('body').addClass('modal-open').removeClass('modal-open-fix, modal-open-fix-pad');
// }, 1000);
// });
}); });
function warnBeforeRedirect(linkURL) {
swal({
title: "Alert!",
text: "Are you sure you want to close cashier?",
type: "warning",
showCancelButton: true
}, function() {
// Redirect the user
window.location.href = linkURL;
});
}
function check_emp_access_code(access_code,type) { function check_emp_access_code(access_code,type) {
var url = "/origami/check_emp_access_code/" + access_code ; var url = "/origami/check_emp_access_code/" + access_code ;
$.ajax({ $.ajax({
@@ -195,6 +234,8 @@ function refreshDetailData(){
$('#discount_amount').text("0.00"); $('#discount_amount').text("0.00");
$('#total_tax').text("0.00"); $('#total_tax').text("0.00");
$('#grand_total').text("0.00"); $('#grand_total').text("0.00");
$(".tbl_customer").hide();
$(".order_close_cashier").hide();
} }
//show order list //show order list
@@ -282,19 +323,21 @@ function show_order_detail(url,sr_no){
$('#customer_name').text(data.customer_name); $('#customer_name').text(data.customer_name);
$('#phone').text(data.phone); $('#phone').text(data.phone);
$('#address').text(address); $('#address').text(address);
$('#delivery_to').text(delivery.provider);
$('#ref_no').text(data.transaction_ref); $('#ref_no').text(data.transaction_ref);
$('#callback_url').text(data.callback_url); $('#callback_url').text(data.callback_url);
$('#order_id').text(data.order_reservation_id); $('#order_id').text(data.order_reservation_id);
$("#trans_ref").text(data.transaction_ref); $("#trans_ref").text(data.transaction_ref);
if(delivery.delivery_type == "service"){ if(delivery.provider == "food2u" || delivery.provider == "yangondoor2door"){
$("#delivery_info").text("(DELIVERY)"); $("#delivery_info").text("(DELIVERY)");
}else if(delivery.delivery_type == "pick_up"){ $("#delivery_to").text("DELIVERY");
}else if(delivery.provider == "pick_up"){
$("#delivery_info").text("(PICK-UP)"); $("#delivery_info").text("(PICK-UP)");
$("#delivery_to").text("PICK-UP");
}else{ }else{
$("#delivery_info").text("(DIRECT DELIVERY)"); $("#delivery_info").text("(DIRECT DELIVERY)");
$("#delivery_to").text("DIRECT DELIVERY");
} }
if(data.order_remark!=null && data.order_remark!=""){ if(data.order_remark!=null && data.order_remark!=""){
@@ -377,6 +420,18 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
}, function () { }, function () {
window.location.href = '/origami/order_reservation'; window.location.href = '/origami/order_reservation';
}); });
}else{
swal({
title: 'Oops',
text: data.message,
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/order_reservation';
});
} }
} }
}); });
@@ -418,18 +473,36 @@ function showNewOrder(order_reservation,shop_code){
audio.play(); audio.play();
// },10000); // },10000);
$("#new_order").text(order_reservation.order_reservation_id); // $("#new_order").text(order_reservation.order_reservation_id);
$("#new_order_date").text(requested_date); // $("#new_order_date").text(requested_date);
$("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){ // if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){
$("#notify_new_order").modal('hide'); // $("#"+shop_code+"_doemal_new_order").removeClass("hidden");
$("#notify_order_send_to_kitchen").modal('hide'); // }
$("#notify_order_ready_to_delivery").modal('hide'); // $("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){
}).on('shown.bs.modal', function(e){ // $("#notify_new_order").addClass("hidden");
$("#"+shop_code+"_doemal_new_order").focus(); // $("#notify_order_send_to_kitchen").addClass("hidden");
}).on('hide.bs.modal', function (e) { // $("#notify_order_ready_to_delivery").addClass("hidden");
// }).on('shown.bs.modal', function(e){
// $("#"+shop_code+"_doemal_new_order").focus();
// }).on('hide.bs.modal', function (e) {
// $("#"+shop_code+"_doemal_new_order").addClass("hidden");
// }).modal({show: true, keyboard: false, backdrop: false});
swal({
title: 'Information',
target: document.getElementById(shop_code+"_notify_new_order"),
text: "You have new order "+
"<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
type: 'success',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function (isConfirm) {
if(isConfirm){
audio.pause(); audio.pause();
$("#"+shop_code+"_doemal_new_order").modal("hide"); swal.close();
}).modal({show: true, keyboard: false, backdrop: false}); }
});
} }
} }

View File

@@ -32,31 +32,31 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
def create def create
status = false status = false
if !params[:cus_info] if !params[:cus_info]
render :json => { :status => false, :message => "cus_info is required!" } result = { :status => false, :message => "cus_info is required!" }
elsif !params[:requested_time] elsif !params[:requested_time]
render :json => { :status => false, :message => "requested_time is required!" } result = { :status => false, :message => "requested_time is required!" }
elsif !params[:callback_url] elsif !params[:callback_url]
render :json => { :status => false, :message => "callback_url is required!" } result = { :status => false, :message => "callback_url is required!" }
elsif !params[:reference] elsif !params[:reference]
render :json => { :status => false, :message => "reference is required!" } result = { :status => false, :message => "reference is required!" }
elsif !params[:order_type] elsif !params[:order_type]
render :json => { :status => false, :message => "order_type is required!" } result = { :status => false, :message => "order_type is required!" }
elsif params[:order_type] == ORDER || params[:order_type] == ORDER_RESERVATION elsif params[:order_type] == ORDER || params[:order_type] == ORDER_RESERVATION
if !params[:order_info] if !params[:order_info]
render :json => { :status => false, :message => "order_info is required!" } result = { :status => false, :message => "order_info is required!" }
else else
status = true status = true
end end
elsif params[:order_type] == RESERVATION || params[:order_type] == ORDER_RESERVATION elsif params[:order_type] == RESERVATION || params[:order_type] == ORDER_RESERVATION
if !params[:reservation_info] if !params[:reservation_info]
render :json => { :status => false, :message => "reservation_info is required!" } result = { :status => false, :message => "reservation_info is required!" }
else else
status = true status = true
end end
elsif !params[:payment_info] elsif !params[:payment_info]
render :json => { :status => false, :message => "payment_info is required!" } result = { :status => false, :message => "payment_info is required!" }
elsif !params[:delivery_info] elsif !params[:delivery_info]
render :json => { :status => false, :message => "delivery_info is required!" } result = { :status => false, :message => "delivery_info is required!" }
end end
if status == true if status == true
@@ -70,16 +70,21 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
else else
shop_code = '' shop_code = ''
end end
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is successfully created!" }
order_reservation = OrderReservation.get_pending_orders #find(order_reservation_id) order_reservation = OrderReservation.get_pending_orders #find(order_reservation_id)
ActionCable.server.broadcast "order_reservation_channel",data: order_reservation,shop_code: shop_code ActionCable.server.broadcast "order_reservation_channel",data: order_reservation,shop_code: shop_code
else
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is already existed!" }
end
end end
if flag puts "!!! send doemal ::"
render :json => { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is successfully created!" } puts result
else
render :json => { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is already existed!" } Rails.logger.debug "send status to doemal"
end Rails.logger.debug result
end render :json => result
end end
def update_status def update_status

View File

@@ -64,7 +64,7 @@ class MyAesCrypt
shop_json["data"].each do |j| shop_json["data"].each do |j|
if j["lookup"] == from if j["lookup"] == from
# add [0...44] for production cloud for remove \n # add [0...44] for production cloud for remove \n
if(j["value"]["key"] == token) if(j["value"]["key"].gsub(/\s+/, "") == token)
return true return true
end end
end end

View File

@@ -93,9 +93,6 @@ class OrderReservation < ApplicationRecord
count += 1 count += 1
items_arr.push(items) items_arr.push(items)
} }
puts items_arr.to_json
puts "sssssssssssssssssssssss"
customer_id = order.customer_id customer_id = order.customer_id
@order = Order.new @order = Order.new
@@ -125,8 +122,11 @@ class OrderReservation < ApplicationRecord
update_order_reservation(order.id, @sale.sale_id, SEND_TO_KITCHEN) update_order_reservation(order.id, @sale.sale_id, SEND_TO_KITCHEN)
result = {:status=> @status, :data => @sale, :message => "send to kitchen" } result = {:status=> @status, :data => @sale, :message => "send to kitchen" }
return result else
result = {:status=> @status, :message => "No current shift open for this employee!" }
end end
return result
end end
def self.update_doemal_payment(order,current_user) def self.update_doemal_payment(order,current_user)
@@ -178,10 +178,9 @@ class OrderReservation < ApplicationRecord
end end
Rails.logger.debug "Doemal URL" + base_url Rails.logger.debug "Doemal URL" + base_url
post_url = base_url + url post_url = base_url + url
if waiting_time != ""
if !waiting_time.nil?
send_params = {id: ref_no,type: min_type, waiting_time: waiting_time, status: status} send_params = {id: ref_no,type: min_type, waiting_time: waiting_time, status: status}
elsif !reason.nil? elsif reason != ""
send_params = {id: ref_no, status: status, reason: reason} send_params = {id: ref_no, status: status, reason: reason}
else else
send_params = {id: ref_no, status: status} send_params = {id: ref_no, status: status}
@@ -290,28 +289,46 @@ class OrderReservation < ApplicationRecord
end end
def self.check_new_order def self.check_new_order
shop = Shop.find_by_id(1)
if !shop.shop_code.nil?
shop_code = shop.shop_code
else
shop_code = ''
end
order_reservation = OrderReservation.where("status='new'") order_reservation = OrderReservation.where("status='new'")
if order_reservation.length > 0 if order_reservation.length > 0
if ENV["SERVER_MODE"] == 'cloud' if ENV["SERVER_MODE"] == 'cloud'
ActionCable.server.broadcast "check_new_order_channel",data: order_reservation ActionCable.server.broadcast "check_new_order_channel",data: order_reservation, shop_code: shop_code
end end
end end
end end
def self.check_order_send_to_kitchen def self.check_order_send_to_kitchen
shop = Shop.find_by_id(1)
if !shop.shop_code.nil?
shop_code = shop.shop_code
else
shop_code = ''
end
order_reservation = OrderReservation.where("status='accepted' and requested_time <= '#{Time.now.utc}'") order_reservation = OrderReservation.where("status='accepted' and requested_time <= '#{Time.now.utc}'")
if order_reservation.length > 0 if order_reservation.length > 0
if ENV["SERVER_MODE"] == 'cloud' if ENV["SERVER_MODE"] == 'cloud'
ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation, shop_code: shop_code
end end
end end
end end
def self.check_order_ready_to_delivery def self.check_order_ready_to_delivery
shop = Shop.find_by_id(1)
if !shop.shop_code.nil?
shop_code = shop.shop_code
else
shop_code = ''
end
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time <= '#{Time.now.utc}'") order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time <= '#{Time.now.utc}'")
if order_reservation.length > 0 if order_reservation.length > 0
if ENV["SERVER_MODE"] == 'cloud' if ENV["SERVER_MODE"] == 'cloud'
ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation, shop_code: shop_code
end end
end end
end end

View File

@@ -30,7 +30,7 @@
<!-- end count function --> <!-- end count function -->
<div class="row m-t--10"> <div class="row m-t--10">
<div class="col-lg-5 col-md-5 col-sm-5 div_order_margin"> <div class="col-lg-5 col-md-5 col-sm-5 div_order_margin">
<ul class="nav nav-tabs tab-col-teal <%= @shop.shop_code %>" role="tablist"> <ul class="nav nav-tabs tab-col-teal <%= @shop.shop_code ? @shop.shop_code : '' %>" role="tablist">
<li class="nav-item red m-b-5" data-color="#F44336" data-type="pending"> <li class="nav-item red m-b-5" data-color="#F44336" data-type="pending">
<a class="nav-link" data-toggle="tab" href="#pending" role="tab"> <a class="nav-link" data-toggle="tab" href="#pending" role="tab">
<p class="num p-t-5"> <p class="num p-t-5">
@@ -67,7 +67,7 @@
<div class="tab-pane active" id="pending" role="tabpanel"> <div class="tab-pane active" id="pending" role="tabpanel">
<div class="card-block font-13"> <div class="card-block font-13">
<div id="menu-slimscroll" data-height="50"> <div id="menu-slimscroll" data-height="50">
<table class="table table-stripe custom-table <%= @shop.shop_code %>_order_reserve_cable"> <table class="table table-stripe custom-table <%= @shop.shop_code ? @shop.shop_code : '' %>_order_reserve_cable">
<tbody> <tbody>
<% i=1 <% i=1
@order.each do |order| %> @order.each do |order| %>
@@ -389,34 +389,36 @@
<div class="card-header custom-card-header" style="background-color: #E8EAF6"> <div class="card-header custom-card-header" style="background-color: #E8EAF6">
<table class="table"> <table class="table">
<tr> <tr>
<td width ="" class="header-td align-left col-blue">CUSTOMER & DELIVERY INFORMATION <td class="header-td align-left col-blue">CUSTOMER & DELIVERY INFORMATION
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="card-block" style="height: 520px"> <div class="card-block" id="customer-info-slimscroll" data-height="95">
<table class="table tbl_customer"> <table class="table tbl_customer">
<tbody> <tbody>
<tr> <tr>
<td class="body-td align-left"> <td colspan="2" class="body-td align-left">
<span class="font-13">REF.</span><br> <span class="font-13">REF.</span><br>
<b id="trans_ref"></b> <b id="trans_ref"></b>
</td> </td>
<td class="body-td align-right">
<span class="font-13">REQUESTED TIME</span><br>
<b id="requested_time"></b>
</td>
</tr> </tr>
<tr> <tr>
<td class="body-td align-left"> <td class="body-td align-left">
<span class="font-13">NAME</span><br> <span class="font-13">REQUESTED TIME</span><br>
<b id="customer_name"></b> <b id="requested_time"></b>
</td> </td>
<td class="body-td align-right expected_time"> <td class="body-td align-right expected_time">
<span class="font-13">COOKING TIME</span><br> <span class="font-13">COOKING TIME</span><br>
<b><span id="expected_time"></span> MINS</b> <b><span id="expected_time"></span> MINS</b>
</td> </td>
</tr> </tr>
<tr>
<td colspan="2" class="body-td align-left">
<span class="font-13">NAME</span><br>
<b id="customer_name"></b>
</td>
</tr>
<tr> <tr>
<td colspan="2" class="body-td align-left"> <td colspan="2" class="body-td align-left">
<span class="font-13">PHONE</span><br> <span class="font-13">PHONE</span><br>
@@ -449,12 +451,23 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="card-footer order_close_cashier">
<% if current_user.role != "waiter" %>
<div class="row">
<div class="col-sm-7 col-xs-7 col-md-7 col-lg-7"></div>
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<button id="order_close_cashier" class="align-right text-center btn btn-md btn-link btn-primary waves-effect"><%= t("views.btn.close_cashier") %></button>
</div>
</div>
<% end %>
</div>
</div> </div>
</div> </div>
<!-- <div id="notify_new_order"></div> <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order"></div>
<div id="notify_order_send_to_kitchen"></div> <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_new_order"></div>
<div id="notify_order_ready_to_delivery"></div> --> <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_send_to_kitchen"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_ready_to_delivery"></div>
</div> </div>
<p id="ref_no" class="hidden"></p> <p id="ref_no" class="hidden"></p>
@@ -571,7 +584,7 @@
</div> </div>
</div> </div>
<div class="modal fade text-center" id="<%= @shop.shop_code %>_doemal_new_order" tabindex="-1" role="dialog"> <!-- <div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document"> <div class="modal-dialog modal-md" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@@ -585,7 +598,7 @@
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5">
<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 new_order_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>" data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>
@@ -658,4 +671,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->

View File

@@ -31,7 +31,7 @@
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="col-lg-2 col-md-2 col-sm-2">
<button type="button" class="btn bg-default btn-block" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button> <button type="button" class="btn bg-default btn-block" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button>
<button type="button" class="btn bg-blue btn-block green" id='close_cashier'> <%= t("views.btn.close_cashier") %> </button> <button type="button" class="btn bg-blue btn-block green" id='close_cashier'> <%= t("views.btn.close_cashier") %> </button>
<% if @bank_integration == '1' %> <% if @bank_integration == '1' && @cashier_type!="ordering" %>
<button type="button" class="btn bg-blue btn-block green" id="card_settlement"> <%= t("views.btn.card_settle") %> </button> <button type="button" class="btn bg-blue btn-block green" id="card_settlement"> <%= t("views.btn.card_settle") %> </button>
<% end %> <% end %>
</div> </div>
@@ -73,10 +73,12 @@
}); });
$('#back').on('click',function(){ $('#back').on('click',function(){
if(cashier_type!='quick_service'){ if(cashier_type=='cashier'){
window.location.href = '/origami'; window.location.href = '/origami';
}else{ }else if(cashier_type=='quick_service'){
window.location.href = '/origami/quick_service'; window.location.href = '/origami/quick_service';
}else{
window.location.href = '/origami/order_reservation';
} }
}); });

View File

@@ -13,6 +13,20 @@
"key": "634W2ioj6QA88vafKamHBRu5aKX/BLIPdTWuuXGFBsA=\n", "key": "634W2ioj6QA88vafKamHBRu5aKX/BLIPdTWuuXGFBsA=\n",
"iv": "QqpO/h7o60dYTbNETRbZ4g==\n" "iv": "QqpO/h7o60dYTbNETRbZ4g==\n"
} }
},
{
"lookup": "order-111.pos-myanmar.test",
"value": {
"key": "7NA6WkE58MZ56w6CUPEyUN5ZlWzuidRDkc2ao6LeHTs=\n",
"iv": "B94kSYIdH6ff8s1ltQzB1Q==\n"
}
},
{
"lookup": "aungcafe-212.pos-myanmar.test",
"value": {
"key": "DvPxzB6QjHNnfuxBz6rdOuSn0/5TkckwCu3jNv0geHY=\n",
"iv": "pJ5k8JKbfti70KQoLZCm/Q==\n"
}
} }
] ]
} }