fix timezone

This commit is contained in:
Thein Lin Kyaw
2023-02-09 14:55:43 +06:30
parent c580cc731a
commit 944f7a7259
52 changed files with 238 additions and 236 deletions

View File

@@ -2,13 +2,13 @@ class Origami::OrdersController < BaseOrigamiController
def show
@webview = false
if check_mobile
@webview = true
@webview = true
end
@tables = Table.unscope(:order).all.active.order('status desc')
@rooms = Room.unscope(:order).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.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
@complete = Sale.where("DATE_FORMAT(CONVERT_TZ(created_at,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') = ? and sale_status != 'new'",Time.current.strftime('%Y-%m-%d'))
@orders = Order.includes("sale_orders").where("DATE_FORMAT(CONVERT_TZ(created_at,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",Time.current.strftime('%Y-%m-%d')).order('date desc')
@order = Order.find(params[:order_id])
booking = Booking.select('bookings.booking_id, bookings.dining_facility_id')
.joins(" JOIN booking_orders as bo on bo.booking_id = bookings.booking_id")
@@ -22,7 +22,7 @@ class Origami::OrdersController < BaseOrigamiController
else
@booking.push({'booking_id' => booking.booking_id, 'dining_facility_id' => booking.dining_facility_id, 'type' => nil})
end
end
@customers = Customer.pluck("customer_id, name")
#for split bill
@@ -39,7 +39,7 @@ class Origami::OrdersController < BaseOrigamiController
@sale_status = sale.sale_status
end
end
@order.order_items.each_with_index do |item, order_item_index|
if !item.set_menu_items.nil?
instance_item_sets = JSON.parse(item.set_menu_items)
@@ -52,7 +52,7 @@ class Origami::OrdersController < BaseOrigamiController
@order.order_items[order_item_index].set_menu_items = arr_instance_item_sets
end
end
# bookings = Booking.all
# if !bookings.today.nil?
# @order_items_count = Hash.new
@@ -85,5 +85,5 @@ class Origami::OrdersController < BaseOrigamiController
# end
# end
end
end