fix nfc add customer flow

This commit is contained in:
Thein Lin Kyaw
2020-09-05 13:28:01 +06:30
parent fa630fd527
commit febb398605
8 changed files with 513 additions and 533 deletions

View File

@@ -30,49 +30,48 @@ class Origami::HomeController < BaseOrigamiController
@status_order = ""
@status_sale = ""
@sale_array = Array.new
@shop = shop_detail
@membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.all
@order_items = Array.new
@dining.current_bookings.each do |booking|
if @obj_sale || @booking.blank?
@booking = booking
end
@sale_array = @dining.current_sales
if (booking = @dining.current_checkin_booking)
@booking = booking
@order_items = booking.order_items
@obj_order = booking.orders.first
end
if booking.sale_id
@sale_array.push(booking.sale)
if (booking = @dining.current_checkout_booking)
@booking = booking
@obj_sale = booking.sale
@sale_taxes = @obj_sale.sale_taxes
@status_sale = 'sale'
end
if @obj_sale.blank?
@obj_sale = booking.sale
@sale_taxes = @obj_sale.sale_taxes
@status_sale = 'sale'
end
else
@order_items += booking.order_items
@obj_order = booking.orders.first
end
if @obj_sale || @customer.blank?
if obj = @obj_sale || @obj_order
@customer = obj.customer
@date = obj.created_at
end
end
if @obj_sale
@status_order = 'sale'
else
@status_order = 'order'
end
if (@obj_sale || @account_arr.blank?) && @customer
@account_arr = TaxProfile.find_by(id: @customer.tax_profiles)
if @obj_sale || @customer.blank?
if obj = @obj_sale || @obj_order
@customer = obj.customer
@date = obj.created_at
end
end
if @obj_sale
@status_order = 'sale'
else
@status_order = 'order'
end
if (@obj_sale || @account_arr.blank?) && @customer
@account_arr = TaxProfile.find_by(id: @customer.tax_profiles)
end
# @dining.current_bookings.each do |booking|
# if @obj_sale || @booking.blank?
# @booking = booking
# end
# end
#for bank integration
@checkout_time = Lookup.collection_of('checkout_time')
@checkout_alert_time = Lookup.collection_of('checkout_alert_time')