foodcourt

This commit is contained in:
Myat Zin Wai Maw
2019-12-10 13:37:06 +06:30
parent 5b3a62917d
commit c606ca73db
8 changed files with 29 additions and 36 deletions

View File

@@ -25,7 +25,6 @@ class Foodcourt::AddordersController < BaseFoodcourtController
else
@display_type = nil
end
# if params[:menu] == "true"
@menus = []
@menu = []

View File

@@ -15,7 +15,7 @@ class Foodcourt::CashInsController < BaseFoodcourtController
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user)
shift = ShiftSale.current_open_shift(current_user)
current_shift = ShiftSale.current_shift(Shop.current_shopshop_code)
current_shift = ShiftSale.current_shift(Shop.current_shop.shop_code)
# set cashier
if shift != nil
shift = shift
@@ -36,7 +36,6 @@ class Foodcourt::CashInsController < BaseFoodcourtController
shift =current_shift
end
end
puts shift.to_json
shift.cash_in = shift.cash_in + amount.to_f
shift.save
end

View File

@@ -60,18 +60,17 @@ class Foodcourt::OrdersController < BaseFoodcourtController
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
.where("orders.source='app' and bookings.booking_id='#{params[:booking_id]}'").first
@customer_id =@booking.customer_id
@booking_id =@booking.booking_id
@order_id =@booking.order_id
@sale_data = Sale.find_by_sale_id(@booking.sale_id)
@customer_id =@booking.customer_id
@booking_id =@booking.booking_id
@order_id =@booking.order_id
@sale_data = Sale.find_by_sale_id(@booking.sale_id)
end
@bookings = Booking.select("bookings.*,customers.*")
.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
.where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}'").order("bookings.created_at desc").uniq
# .where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}' and DATE(bookings.created_at) = '#{Date.today}'").order("bookings.created_at desc").uniq
.where("orders.source='app' and bookings.shop_code=? and DATE(bookings.created_at)=?",Shop.current_shop.shop_code,Date.today).order("bookings.created_at desc").uniq
end
def completed
customer =Customer.find_by_customer_id(params[:customer_id])