fixed conflict

This commit is contained in:
Nweni
2018-04-23 18:21:47 +06:30
414 changed files with 25645 additions and 4243 deletions

View File

@@ -1,34 +1,71 @@
class Origami::HomeController < BaseOrigamiController
before_action :set_dining, only: [:show]
authorize_resource :class => false
before_action :set_dining, only: [:show]
def index
@webview = check_mobile
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
@orders = Order.all.order('date desc')
@shop = Shop::ShopDetail
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
@shop = Shop.first
# @shift = ShiftSale.current_open_shift(current_user.id)
end
# origami table detail
def show
@webview = check_mobile
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
@orders = Order.all.order('date desc')
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
@status_order = ""
@status_sale = ""
@sale_array = Array.new
@shop = Shop::ShopDetail
@shop = Shop.first
@membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.all
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
end
@dining.bookings.active.each do |booking|
if booking.sale_id.nil? && booking.booking_status != 'moved'
@order_items = Array.new
# @assigned_order_items = Array.new
if booking.booking_orders.empty?
@booking = booking
else
@@ -41,12 +78,19 @@ class Origami::HomeController < BaseOrigamiController
@booking= booking
order.order_items.each do |item|
@order_items.push(item)
# assigned_order_items = AssignedOrderItem.find_by_item_code_and_instance_code_and_order_id(item.item_code,item.item_instance_code,item.order_id)
# if !assigned_order_items.nil?
# @assigned_order_items.push({item.order_items_id => assigned_order_items.assigned_order_item_id})
# end
end
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
@account_arr = Array.new
if @customer.tax_profiles
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
end
end
end
@@ -54,8 +98,7 @@ class Origami::HomeController < BaseOrigamiController
@status_order = 'order'
else
sale = Sale.find(booking.sale_id)
if sale.sale_status != "completed" && sale.sale_status != 'void'
if sale.sale_status != "completed" && sale.sale_status != 'void' && sale.sale_status != 'spoile' && sale.sale_status != 'waste'
@sale_array.push(sale)
if @status_order == 'order'
@status_order = 'sale'
@@ -75,6 +118,15 @@ class Origami::HomeController < BaseOrigamiController
end
end
#for bank integration
@checkout_time = Lookup.collection_of('checkout_time')
@checkout_alert_time = Lookup.collection_of('checkout_alert_time')
lookup_spit_bill = Lookup.collection_of('split_bill')
@split_bill = 0
if !lookup_spit_bill[0].nil?
@split_bill = lookup_spit_bill[0][1]
end
end
private