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

This commit is contained in:
Aung Myo
2017-11-21 09:23:15 +06:30
9 changed files with 74 additions and 93 deletions

View File

@@ -1,9 +1,8 @@
$(function(){ $(function() {
//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);
console.log(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){
@@ -635,8 +634,9 @@ $(function(){
// Pay Discount for Payment // Pay Discount for Payment
$("#create_order").on('click', function(e){ $("#create_order").on('click', function(e){
$(this).attr('disabled', 'disabled');
e.preventDefault(); e.preventDefault();
$("#loading_wrapper").show(); $("#oqs_loading_wrapper").show();
var table_id = $('#table_id').text(); var table_id = $('#table_id').text();
var booking_id = $('#booking_id').text(); var booking_id = $('#booking_id').text();
if (!booking_id.length > 0) { if (!booking_id.length > 0) {
@@ -651,34 +651,34 @@ $(function(){
var ajax_url = '../addorders/create'; var ajax_url = '../addorders/create';
var params = {'order_source': "cashier", 'order_type': "dine_in", var params = {'order_source': "cashier", 'order_type': "dine_in",
'customer_id': "", 'guest_info': "", 'customer_id': "", 'guest_info': "",
'table_id': table_id, 'table_id': table_id,
'order_items': order_items }; 'order_items': order_items };
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: ajax_url, url: ajax_url,
data: params, data: params,
dataType: "json", dataType: "json",
success:function(result){ success:function(result){
$("#loading_wrapper").hide(); // $("#oqs_loading_wrapper").hide();
swal({ // swal({
title: "Information !", // title: "Information !",
text: 'Order has been successfully created', // text: 'Order has been successfully created',
confirmButtonColor: "green", // confirmButtonColor: "green",
confirmButtonText: "Yes!", // confirmButtonText: "Yes!",
closeOnConfirm: false, // closeOnConfirm: false,
}, function () { // }, function (isConfirm) {
if(table_type == "Table"){ // if (isConfirm) {
window.location.href = "/origami/table/" + table_id if(table_type == "Table"){
} window.location.href = "/origami/table/" + table_id
else { }
window.location.href = "/origami/room/" + table_id else {
} window.location.href = "/origami/room/" + table_id
}); }
} // }
// });
}
}); });
}); });

View File

@@ -11,6 +11,10 @@
@import "BSBMaterial/themes/all-themes"; @import "BSBMaterial/themes/all-themes";
@import "reset"; @import "reset";
.sx-margin-0 {
margin: 0 !important;
}
.selected-item { .selected-item {
color: #fff !important; color: #fff !important;
background-color: #7a62d3 !important; background-color: #7a62d3 !important;

View File

@@ -128,8 +128,7 @@ section.content{
/*Loading gif for payment*/ /*Loading gif for payment*/
#loading_wrapper{ #oqs_loading_wrapper{
position: fixed; position: fixed;
background-color: #C8C8C8 ; background-color: #C8C8C8 ;
height: 100%; height: 100%;
@@ -137,9 +136,9 @@ section.content{
left: 0; left: 0;
opacity: 0.6; opacity: 0.6;
top: 0; top: 0;
z-index: 9999999; z-index: 100;
} }
#loading{ #oqs_loading{
position: relative; position: relative;
height: 100%; height: 100%;
width: 100%; width: 100%;
@@ -147,9 +146,9 @@ section.content{
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
opacity: 1; opacity: 1;
z-index: 101;
filter: alpha(opacity=100); /* ie */ filter: alpha(opacity=100); /* ie */
-moz-opacity: 1; /* mozilla */ -moz-opacity: 1; /* mozilla */
} }
#count ,#set_count{ #count ,#set_count{

View File

@@ -1,7 +1,7 @@
class Crm::DiningQueuesController < BaseCrmController class Crm::DiningQueuesController < BaseCrmController
load_and_authorize_resource load_and_authorize_resource
before_action :set_dining_queue, only: [:show, :edit, :update, :destroy] before_action :set_dining_queue, only: [:show, :edit, :update, :destroy]
# GET /crm/dining_queues # GET /crm/dining_queues
# GET /crm/dining_queues.json # GET /crm/dining_queues.json
def index def index
@@ -86,6 +86,17 @@ class Crm::DiningQueuesController < BaseCrmController
queue = DiningQueue.find(params[:id]) queue = DiningQueue.find(params[:id])
table_id = params[:table_id] table_id = params[:table_id]
dining_facility = DiningFacility.find(params[:table_id])
if dining_facility.type == "Table"
type = "TableBooking"
else
type = "RoomBooking"
end
booking = Booking.create({:dining_facility_id => params[:table_id],:type => type,
:checkin_at => Time.now.utc,:customer_id => queue.customer_id,:booking_status => "assign" })
booking.save!
status = queue.update_attributes(dining_facility_id: table_id,status:"Assign") status = queue.update_attributes(dining_facility_id: table_id,status:"Assign")
# status = DiningFacility.find(table_id).update_attributes(status: "occupied") # status = DiningFacility.find(table_id).update_attributes(status: "occupied")

View File

@@ -11,7 +11,7 @@
</div> </div>
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-9 col-md-9 col-sm-9">
<!-- <div class="main-box-body clearfix"> --> <!-- <div class="main-box-body clearfix"> -->
<div class="body table-responsive"> <div class="body table-responsive">
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
@@ -19,21 +19,14 @@
<table class="table table-striped"> --> <table class="table table-striped"> -->
<thead> <thead>
<tr> <tr>
<td colspan="7"> <td colspan="7">
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
<!-- <div class=" col-md-7 form-group float-left">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control input-xs col-md-9">
<input type="hidden" name="type" id="type" value="">
<button type="submit" class="float-right btn btn-primary btn-md">Search</button>
</div> -->
<% end %>
<!-- <button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button> <!-- <button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
<button id="qr_code" class="btn btn-danger btn-md"> <button id="qr_code" class="btn btn-danger btn-md">
<span class="fa fa-credit-card"></span> QR CODE <span class="fa fa-credit-card"></span> QR CODE
</button> --> </button> -->
<div class="body"> <div class="body">
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %> <%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12"> <div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control"> <input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control">
<input type="hidden" name="type" id="type" value=""> <input type="hidden" name="type" id="type" value="">
@@ -45,9 +38,8 @@
<button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.qr_code") %></button> <button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.qr_code") %></button>
</div> </div>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
@@ -91,7 +83,7 @@
</div> </div>
<!-- </div> --> <!-- </div> -->
</div> </div>
<div class="col-lg-4 col-md-4 col-sm-4"> <div class="col-lg-3 col-md-3 col-sm-3">
<div id="custom-slimscroll"> <div id="custom-slimscroll">
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %> <%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
</div> </div>

View File

@@ -28,15 +28,26 @@
@bg_color = "normal" @bg_color = "normal"
end end
%> %>
<div class="card select-queue <%= @bg_color %>" data-id="<%= queue.id %>" style=""> <div class="card select-queue <%= @bg_color %>" data-id="<%= queue.id %>">
<div class="card-block"> <div class="card-block">
<p class="hidden queue-id"><%= queue.id %></p> <p class="hidden queue-id"><%= queue.id %></p>
<p class="hidden queue-status"><%= queue.status %></p> <p class="hidden queue-status"><%= queue.status %></p>
<span class="card-title"><strong> Queue No : <%= queue.queue_no %></strong></span> <div class="row card-title">
<span class="card-title float-right"><strong> Seater : <%= queue.seater %></strong></span><br> <div class="col-md-auto col-sm-12 sx-margin-0">
<span class="card-title"> Name : <%= queue.name %></span><br> <p class="padding-0 margin-0">
<span class="card-title"> Contact No : <%= queue.contact_no %></span><br> <strong> Queue No : <%= queue.queue_no %></strong>
<span class="card-title"> Remark : <%= queue.remark %></span> </p>
</div>
<div class="col-md-auto col-sm-12 sx-margin-0">
<p class="padding-0 margin-0">
<strong> Seater : <%= queue.seater %></strong>
</p>
</div>
</div>
<p class="card-title"> Name : <%= queue.name %></p>
<p class="card-title"> Contact No : <%= queue.contact_no %></p>
<p class="card-title"> Remark : <%= queue.remark %></p>
</div> </div>
</div> </div>
<% end %> <% end %>

View File

@@ -1,8 +1,9 @@
<%= 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' %>
<div id="loading_wrapper" style="display:none;"> <div id="oqs_loading_wrapper" style="display:none;">
<div id="loading"></div> <div id="oqs_loading"></div>
</div> </div>
<div class="row m-t--20"> <div class="row m-t--20">
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="col-lg-2 col-md-2 col-sm-2">
<ul class="nav nav-tabs flex-column" role="tablist" > <ul class="nav nav-tabs flex-column" role="tablist" >

View File

@@ -2,6 +2,7 @@ class DiningQueues < ActiveRecord::Migration[5.1]
def change def change
create_table :dining_queues do |t| create_table :dining_queues do |t|
t.string :name t.string :name
t.string :customer_id, :default => "CUS-000000000001"
t.string :contact_no t.string :contact_no
t.string :queue_no t.string :queue_no
t.string :status t.string :status

View File

@@ -181,44 +181,6 @@ queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf
cashier_terminal = CashierTerminal.create({name:"Terminal 1", printer_name: "Cashier"}) cashier_terminal = CashierTerminal.create({name:"Terminal 1", printer_name: "Cashier"})
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"}) zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
table = Table.create({name:"61", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"62", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"53", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"54", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"24", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"25", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"26", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"34", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"35", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"45", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"46", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"47", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"48", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
zone2 = Zone.create({id:2, name: "H2", is_active:true, created_by: "SYSTEM DEFAULT"})
table = Table.create({name:"51", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"52", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"11", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"12", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"21", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"22", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"23", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"31", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"32", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"33", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"41", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"42", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"43", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"44", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAULT"})
table = Table.create({name:"71", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"72", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"73", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"74", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"75", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"76", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"77", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
table = Table.create({name:"78", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"}) member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
@@ -248,7 +210,7 @@ zone_order_queue_station = OrderQueueStation.create({station_name: "K3", is_acti
# QueueStationZone # QueueStationZone
zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station1, zone: zone}) zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station1, zone: zone})
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone2}) zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone})
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone3}) zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone})
puts " Finished System Default Set Up Data vWSsseoZCzxd6xcNf_uS RxzaYyAGzm7VqAZ4hKnv " puts " Finished System Default Set Up Data vWSsseoZCzxd6xcNf_uS RxzaYyAGzm7VqAZ4hKnv "