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

This commit is contained in:
Aung Myo
2018-06-12 18:02:40 +06:30
6 changed files with 113 additions and 41 deletions

View File

@@ -467,4 +467,33 @@ iframe {
.tax-btn-box { .tax-btn-box {
width: 230px; width: 230px;
height: 80px; height: 80px;
}
/*Pagination*/
nav.pagination {
margin:10px;
}
nav.pagination .current{
background-color:#1f91f3;
color:#fff;
padding:4px 10px;
margin-top:-4px;
}
nav.pagination .page a,.next a,.last a,.prev a,.first a{
padding:6.5px 10px;
margin-left: 3px;
}
nav.pagination .page a:hover,
a:focus {
background-color: #ccc;
text-decoration: none;
}
nav.pagination .page a:hover,
.first a:hover,.last a:hover,.prev a:hover,.next a:hover{
background-color: #ccc;
text-decoration: none;
} }

View File

@@ -53,7 +53,7 @@ class Origami::CustomersController < BaseOrigamiController
@sale_id = params[:sale_id] @sale_id = params[:sale_id]
@cashier_type = params[:type] @cashier_type = params[:type]
@page = params[:page] @page = params[:dir_page]
if(@sale_id[0,3] == "SAL") if(@sale_id[0,3] == "SAL")
@booking = Booking.find_by_sale_id(@sale_id) @booking = Booking.find_by_sale_id(@sale_id)
@@ -74,15 +74,17 @@ class Origami::CustomersController < BaseOrigamiController
end end
filter = params[:filter] filter = params[:filter]
puts "filter"
puts filter
if filter.nil? if filter.nil?
@crm_customers = Customer.order("customer_id").page(params[:page]) puts params[:page]
@crm_customers = Customer.order("customer_id") #.page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5) #@products = Product.order("name").page(params[:page]).per(5)
else else
@crm_customers = Customer.search(filter) @crm_customers = Customer.search(filter)
end end
#@crm_customers = Customer.all #@crm_customers = Customer.all
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50) @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(20)
@crm_customer = Customer.new @crm_customer = Customer.new
@count_customer = Customer.count_customer @count_customer = Customer.count_customer

View File

@@ -494,7 +494,7 @@
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> --> <button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> -->
<% if current_login_employee.role == "cashier" %> <% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a> <a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a> <a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
<% 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>
<button type="button" class="btn btn-block bg-red waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> <button type="button" class="btn btn-block bg-red waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button>

View File

@@ -469,7 +469,7 @@
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button> <button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
<% if current_login_employee.role == "cashier" %> <% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a> <a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a> <a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
<% 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>
<button type="button" class="btn btn-block bg-red waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> <button type="button" class="btn btn-block bg-red waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button>

View File

@@ -39,24 +39,49 @@
<div class="tab-pane " id="tables" role="tabpanel" style=""> <div class="tab-pane " id="tables" role="tabpanel" style="">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;"> <div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @tables.each do |table| %> <% @tables.each do |table| %>
<% if table.status == 'occupied' %> <% if table.status == 'occupied' %>
<div class="card tables bg-red text-white" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<% if table.get_booking.nil? %> <% if table.get_booking.nil? %>
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span> <% if table.get_checkout_booking.nil? %>
<% else %> <div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<span style="font-size:12px;float:right;line-height:inherit;"> new</span> <% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block">
<%= table.name %>
<!-- <% if !@order_items_count.nil? %>
<% if @order_items_count.key?(table.id) %>
(Orders : <%= @order_items_count[table.id] %>)
<% end %>
<% end %> -->
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
<div style="font-size:12px;"></div>
</div>
</div>
<% else %>
<% if table.get_checkout_booking.nil? %>
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block">
<%= table.name %>
<!-- <% if !@order_items_count.nil? %>
<% if @order_items_count.key?(table.id) %>
(Orders : <%= @order_items_count[table.id] %>)
<% end %>
<% end %> -->
<span class="float-right font-12 new_text_<%= table.id %>"> new</span>
</div>
</div>
<% end %> <% end %>
</div> <% else %>
</div> <div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %> <div class="card-block">
<div class="card tables green text-white" data-id="<%= table.id %>"> <%= table.name %>
<div class="card-block"> <span class="float-right font-12 new_text_<%= table.id %> hide"> new</span>
<%= table.name %> </div>
</div> </div>
</div> <% end %>
<% end %>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -65,24 +90,40 @@
<div class="tab-pane" id="rooms" role="tabpanel" style=""> <div class="tab-pane" id="rooms" role="tabpanel" style="">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;"> <div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @rooms.each do |room| %> <% @rooms.each do |room| %>
<% if room.status == 'occupied' %> <% if room.status == 'occupied' %>
<div class="card rooms bg-red text-white" data-id="<%= room.id %>"> <% if room.get_booking.nil? %>
<div class="card-block"> <div class="card rooms red text-white table_<%= room.id %>" data-id="<%= room.id %>">
<%= room.name %> <div class="card-block">
<% if room.get_booking.nil? %> <%= room.name %>
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span> <!-- <% if !@order_items_count.nil? %>
<% else %> <% if @order_items_count.key?(room.id) %>
<span style="font-size:12px;float:right;line-height:inherit;"> new</span> (Orders : <%= @order_items_count[room.id] %>)
<% end %>
<% end %> -->
<span class="float-right font-12 new_text_<%= room.id %>"> billed</span>
</div>
</div>
<% else %>
<div class="card rooms blue text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
<!-- <% if !@order_items_count.nil? %>
<% if @order_items_count.key?(room.id) %>
(Orders : <%= @order_items_count[room.id] %>)
<% end %>
<% end %> -->
<span class="float-right font-12 new_text_<%= room.id %>"> new</span>
</div>
</div>
<% end %> <% end %>
</div> <% else %>
</div> <div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
<% else %> <div class="card-block">
<div class="card rooms green text-white" data-id="<%= room.id %>"> <%= room.name %>
<div class="card-block"> <span class="float-right font-12 new_text_<%= room.id %> hide">
<%= room.name %> </div>
</div> </div>
</div> <% end %>
<% end %>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -217,7 +258,7 @@
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %> <% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
<% if current_login_employee.role == "cashier" %> <% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-danger waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a> <a class="btn btn-block bg-danger waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="reprint"> Re.Print</a> <a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="reprint"> Re.Print</a>
<% else %> <% else %>
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button> <button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
<button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button> <button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button>

View File

@@ -231,7 +231,7 @@ scope "(:locale)", locale: /en|mm/ do
#---------Add Customer --------------# #---------Add Customer --------------#
#resources :customers #resources :customers
get '/:sale_id/:type/customers/:page', to: "customers#add_customer" get '/:sale_id/:type/customers/:dir_page', to: "customers#add_customer"
get '/:customer_id/get_customer' => 'home#get_customer', :as => "show_customer_details" get '/:customer_id/get_customer' => 'home#get_customer', :as => "show_customer_details"
post '/:sale_id/:type/customers/update_sale', to: "customers#update_sale_by_customer" # update customer id in sale table post '/:sale_id/:type/customers/update_sale', to: "customers#update_sale_by_customer" # update customer id in sale table