fix timezone
This commit is contained in:
@@ -5,9 +5,9 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
# GET /crm/dining_queues
|
||||
# GET /crm/dining_queues.json
|
||||
def index
|
||||
today = DateTime.now.strftime('%Y-%m-%d')
|
||||
@dining_queues = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
|
||||
@complete_queue = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
|
||||
today = Time.current.strftime('%Y-%m-%d')
|
||||
@dining_queues = DiningQueue.where("DATE_FORMAT(CONVERT_TZ(created_at,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
|
||||
@complete_queue = DiningQueue.where("DATE_FORMAT(CONVERT_TZ(created_at,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
|
||||
|
||||
if params[:term]
|
||||
@customer = Customer.order(:name).where('lower(name) LIKE ?', "%#{params[:term].downcase}%")
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class Crm::HomeController < BaseCrmController
|
||||
def index
|
||||
|
||||
|
||||
@booking = Booking.all
|
||||
@customer = Customer.all
|
||||
from = Time.current.beginning_of_day
|
||||
to = Time.current.end_of_day
|
||||
@queue = DiningQueue.where('created_at BETWEEN ? AND ?', from, to).order('queue_no ASC')
|
||||
redirect_to crm_customers_path
|
||||
redirect_to crm_customers_path
|
||||
# .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
|
||||
end
|
||||
@@ -16,12 +16,12 @@ class Crm::HomeController < BaseCrmController
|
||||
|
||||
#print for crm
|
||||
def print_order
|
||||
|
||||
|
||||
@booking = Booking.find(params[:id])
|
||||
|
||||
@total_amount = 0.00
|
||||
@total_tax = 0.00
|
||||
|
||||
|
||||
if @booking.booking_orders
|
||||
order_items = []
|
||||
@booking.booking_orders.each do |bo|
|
||||
@@ -32,14 +32,14 @@ class Crm::HomeController < BaseCrmController
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
# unique_code="CrmOrderPdf"
|
||||
|
||||
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
# printer.print_crm_order(@booking,order_items,print_settings)
|
||||
# printer.print_crm_order(@booking,order_items,print_settings)
|
||||
|
||||
end
|
||||
|
||||
@@ -53,8 +53,7 @@ class Crm::HomeController < BaseCrmController
|
||||
# else
|
||||
# render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user