diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 2694766f..b0c51031 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -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+"'>" - +"" - +'add' + +"" + +'view_list' +'' +'' @@ -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 = '' diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 1a73ef8c..f552430a 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -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| diff --git a/app/controllers/origami/rooms_controller.rb b/app/controllers/origami/rooms_controller.rb index e49c82e7..6117d01d 100755 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -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| diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index bb74c2f2..1866a630 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -356,10 +356,10 @@ class SalePayment < ApplicationRecord self.sale.save! table_update_status(sObj) - + if check_foc update_shift - elsif paid_amount != "0.0" + elsif paid_amount.to_f > 0 #|| paid_amount != "0.0" update_shift end end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index d08d55f4..6f341572 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -50,11 +50,11 @@ <% end %>
<%= table.name %> - <% if !@order_items_count.nil? %> + billed
@@ -67,11 +67,11 @@ <% end %>
<%= table.name %> - <% if !@order_items_count.nil? %> + new
@@ -97,11 +97,11 @@
<%= room.name %> - <% if !@order_items_count.nil? %> + billed
@@ -109,11 +109,11 @@
<%= room.name %> - <% if !@order_items_count.nil? %> + new
diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 6ece5bda..1edb07cf 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -50,11 +50,11 @@ <% end %>
<%= table.name %> - <% if !@order_items_count.nil? %> + billed
@@ -66,11 +66,11 @@ <% end %>
<%= table.name %> - <% if !@order_items_count.nil? %> + new
@@ -97,11 +97,11 @@
<%= room.name %> - <% if !@order_items_count.nil? %> + billed
@@ -110,11 +110,11 @@
<%= room.name %> - <% if !@order_items_count.nil? %> + new
diff --git a/lib/tasks/clear_data.rake b/lib/tasks/clear_data.rake index 651ff7cd..43ba291e 100755 --- a/lib/tasks/clear_data.rake +++ b/lib/tasks/clear_data.rake @@ -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