check shift update data
This commit is contained in:
@@ -46,8 +46,8 @@ $(function() {
|
||||
+ product[field].name +"' data-promotion-price = '"+ 1 +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<i class='fa fa-plus material-icons'>"
|
||||
+'add</i>'
|
||||
+"<i class='fa fa-bars material-icons'>"
|
||||
+'view_list</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
@@ -146,7 +146,7 @@ $(function() {
|
||||
promotion_price = menu_items[field].promotion_price;
|
||||
}else{
|
||||
fa_plus = 'material-icons';
|
||||
add = 'add'
|
||||
add = 'view_list'
|
||||
menu_item_box = 'menu_item_box';
|
||||
data_target = 'sx_item_detailModal';
|
||||
data_modal = ''
|
||||
|
||||
@@ -30,33 +30,33 @@ class Origami::HomeController < BaseOrigamiController
|
||||
bookings = Booking.all
|
||||
if !bookings.today.nil?
|
||||
@order_items_count = Hash.new
|
||||
bookings.each do |booking|
|
||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
if !booking.booking_orders.empty?
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
if !order.order_items.empty?
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if !booking.sale_id.nil?
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# bookings.each do |booking|
|
||||
# if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
# if !booking.booking_orders.empty?
|
||||
# booking.booking_orders.each do |booking_order|
|
||||
# order = Order.find(booking_order.order_id)
|
||||
# if !order.order_items.empty?
|
||||
# if !@order_items_count.key?(booking.dining_facility_id)
|
||||
# @order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
# else
|
||||
# @order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
# if !booking.sale_id.nil?
|
||||
# sale = Sale.find(booking.sale_id)
|
||||
# if sale.sale_status !='completed'
|
||||
# if !@order_items_count.key?(booking.dining_facility_id)
|
||||
# @order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
# else
|
||||
# @order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
@dining.bookings.active.each do |booking|
|
||||
|
||||
@@ -26,33 +26,33 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
bookings = Booking.all
|
||||
if !bookings.today.nil?
|
||||
@order_items_count = Hash.new
|
||||
bookings.each do |booking|
|
||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
if !booking.booking_orders.empty?
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
if !order.order_items.empty?
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if !booking.sale_id.nil?
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status !='completed'
|
||||
if !@order_items_count.key?(booking.dining_facility_id)
|
||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
else
|
||||
@order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# bookings.each do |booking|
|
||||
# if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
# if !booking.booking_orders.empty?
|
||||
# booking.booking_orders.each do |booking_order|
|
||||
# order = Order.find(booking_order.order_id)
|
||||
# if !order.order_items.empty?
|
||||
# if !@order_items_count.key?(booking.dining_facility_id)
|
||||
# @order_items_count.store(booking.dining_facility_id, order.order_items.count)
|
||||
# else
|
||||
# @order_items_count[booking.dining_facility_id] += order.order_items.count
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
# if !booking.sale_id.nil?
|
||||
# sale = Sale.find(booking.sale_id)
|
||||
# if sale.sale_status !='completed'
|
||||
# if !@order_items_count.key?(booking.dining_facility_id)
|
||||
# @order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||
# else
|
||||
# @order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
@room.bookings.active.each do |booking|
|
||||
|
||||
@@ -359,7 +359,7 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
if check_foc
|
||||
update_shift
|
||||
elsif paid_amount != "0.0"
|
||||
elsif paid_amount.to_f > 0 #|| paid_amount != "0.0"
|
||||
update_shift
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,11 +50,11 @@
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<% if !@order_items_count.nil? %>
|
||||
<!-- <% if !@order_items_count.nil? %>
|
||||
<% if @order_items_count.key?(table.id) %>
|
||||
(Orders : <%= @order_items_count[table.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||
<div style="font-size:12px;"></div>
|
||||
</div>
|
||||
@@ -67,11 +67,11 @@
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<% if !@order_items_count.nil? %>
|
||||
<!-- <% if !@order_items_count.nil? %>
|
||||
<% if @order_items_count.key?(table.id) %>
|
||||
(Orders : <%= @order_items_count[table.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="float-right font-12 new_text_<%= table.id %>"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,11 +97,11 @@
|
||||
<div class="card rooms red text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<% if !@order_items_count.nil? %>
|
||||
<!-- <% if !@order_items_count.nil? %>
|
||||
<% if @order_items_count.key?(room.id) %>
|
||||
(Orders : <%= @order_items_count[room.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="float-right font-12 new_text_<%= room.id %>"> billed</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,11 +109,11 @@
|
||||
<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.nil? %>
|
||||
<% if @order_items_count.key?(room.id) %>
|
||||
(Orders : <%= @order_items_count[room.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="float-right font-12 new_text_<%= room.id %>"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -50,11 +50,11 @@
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<% if !@order_items_count.nil? %>
|
||||
<!-- <% if !@order_items_count.nil? %>
|
||||
<% if @order_items_count.key?(table.id) %>
|
||||
(Orders : <%= @order_items_count[table.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,11 +66,11 @@
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<% if !@order_items_count.nil? %>
|
||||
<!-- <% if !@order_items_count.nil? %>
|
||||
<% if @order_items_count.key?(table.id) %>
|
||||
(Orders : <%= @order_items_count[table.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,11 +97,11 @@
|
||||
<div class="card rooms red text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<% if !@order_items_count.nil? %>
|
||||
<!-- <% if !@order_items_count.nil? %>
|
||||
<% if @order_items_count.key?(room.id) %>
|
||||
(Orders : <%= @order_items_count[room.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="pull-right font-12 new_text_<%= room.id %>"> billed</span>
|
||||
<div style="font-size:12px;"></div>
|
||||
</div>
|
||||
@@ -110,11 +110,11 @@
|
||||
<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.nil? %>
|
||||
<% if @order_items_count.key?(room.id) %>
|
||||
(Orders : <%= @order_items_count[room.id] %>)
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
<span class="pull-right font-12 new_text_<%= room.id %>"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace :clear do
|
||||
Survey.delete_all
|
||||
DiningFacility.update_all(status:'available')
|
||||
CashierTerminal.update_all(is_currently_login: 0)
|
||||
SeedGenerator.where("id > 1").update(:current => 0, :next => 0)
|
||||
SeedGenerator.where("id > 1").update(:current => 0, :next => 1)
|
||||
puts "Clear Data Done."
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user