remove unnessary timezone convertion

This commit is contained in:
Thein Lin Kyaw
2022-04-19 19:40:53 +06:30
parent 3c7fd0aff4
commit 3c5416a154
154 changed files with 321 additions and 321 deletions

View File

@@ -29,9 +29,9 @@ class Api::CheckInProcessController < Api::ApiController
check_out_time = nil
extra_minutes = nil
alert_time_min = 0
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
check_in_time = booking.checkin_at.strftime("%Y-%m-%d %H:%M")
if booking.checkout_at
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
check_out_time = booking.checkout_at.strftime("%Y-%m-%d %H:%M")
if booking.reserved_at
extra_minutes = (booking.checkout_at - booking.reserved_at) / 1.minutes
end
@@ -146,7 +146,7 @@ class Api::CheckInProcessController < Api::ApiController
booking.checkout_at = checkout_at
booking.save!
render :json => { :status => true, :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") }
render :json => { :status => true, :checkout_at => booking.checkout_at.strftime("%Y-%m-%d %H:%M") }
elsif !params[:booking_id].nil? && params[:time].nil?
error_message = "time is required!"
render :json => { :status => false, :error_message => error_message }
@@ -170,7 +170,7 @@ class Api::CheckInProcessController < Api::ApiController
booking.reserved_at = checkout_time
booking.reserved_by = current_login_employee.name
if booking.save!
render :json => { :status => true, :checkin_at => booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M:%S"), :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M:%S"), :message => "Checkout success." }
render :json => { :status => true, :checkin_at => booking.checkin_at.strftime("%Y-%m-%d %H:%M:%S"), :checkout_at => booking.checkout_at.strftime("%Y-%m-%d %H:%M:%S"), :message => "Checkout success." }
end
else
render :json => { :status => false, :error_message => "Checkout time not available!" }

View File

@@ -2,14 +2,14 @@ class Origami::CheckInProcessController < BaseOrigamiController
def check_in_process
lookup_checkout_time = Lookup.collection_of("checkout_time")
today = Time.now.utc.getlocal
checkout_at = Time.now.utc.getlocal
today = Time.now
checkout_at = Time.now
if !lookup_checkout_time.empty?
lookup_checkout_time.each do |checkout_time|
arr_time = checkout_time[0].split("-")
start_time = Time.parse(arr_time[0].strip).utc.getlocal.strftime("%H:%M%p")
end_time = Time.parse(arr_time[1].strip).utc.getlocal.strftime("%H:%M%p")
start_time = Time.parse(arr_time[0].strip).strftime("%H:%M%p")
end_time = Time.parse(arr_time[1].strip).strftime("%H:%M%p")
if start_time <= checkout_at.strftime("%H:%M%p") && checkout_at.strftime("%H:%M%p") <= end_time
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
end

View File

@@ -53,8 +53,8 @@ class Reports::CardSaleTranController < BaseReportController
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end

View File

@@ -52,8 +52,8 @@ class Reports::CardSettleTranController < BaseReportController
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end

View File

@@ -27,8 +27,8 @@ class Reports::CommissionController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -29,8 +29,8 @@ authorize_resource :class => false
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -48,8 +48,8 @@ authorize_resource :class => false
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -43,8 +43,8 @@ class Reports::CustomerController < BaseReportController
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end

View File

@@ -52,8 +52,8 @@ class Reports::HourlySaleitemController < BaseReportController
if shift.present?
shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -70,8 +70,8 @@ class Reports::HourlySaleitemController < BaseReportController
sale_data = @sale_data
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id
@@ -113,7 +113,7 @@ class Reports::HourlySaleitemController < BaseReportController
end
end
sh_name = "#{shift_sale.shift_started_at.utc.getlocal.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.utc.getlocal.strftime('%d %B %l:%M%p')}"
sh_name = "#{shift_sale.shift_started_at.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.strftime('%d %B %l:%M%p')}"
employee = Employee.find(shift_sale.employee_id)
shift_name = employee.nil? ? sh_name : "#{sh_name} (#{employee.name})"
end

View File

@@ -52,8 +52,8 @@ class Reports::HourlySaleitemController < BaseReportController
if shift.present?
shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -73,8 +73,8 @@ class Reports::HourlySaleitemController < BaseReportController
sale_data = @sale_data
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id
@@ -114,7 +114,7 @@ class Reports::HourlySaleitemController < BaseReportController
end
end
sh_name = "#{shift_sale.shift_started_at.utc.getlocal.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.utc.getlocal.strftime('%d %B %l:%M%p')}"
sh_name = "#{shift_sale.shift_started_at.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.strftime('%d %B %l:%M%p')}"
employee = Employee.find(shift_sale.employee_id)
shift_name = employee.nil? ? sh_name : "#{sh_name} (#{employee.name})"
end

View File

@@ -28,8 +28,8 @@ class Reports::IndutyController < BaseReportController
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -48,8 +48,8 @@ class Reports::IndutyController < BaseReportController
date_arr = Array.new
@induty_data.each do |induty|
local_opening_date = induty.opening_date.nil? ? '-' : induty.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = induty.closing_date.nil? ? '-' : induty.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = induty.opening_date.nil? ? '-' : induty.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = induty.closing_date.nil? ? '-' : induty.closing_date.strftime("%e %b %I:%M%p")
opening_date = induty.opening_date.nil? ? '-' : induty.opening_date.utc
closing_date = induty.closing_date.nil? ? '-' : induty.closing_date.utc
shift_id = induty.id.nil? ? '-' : induty.id

View File

@@ -34,8 +34,8 @@ class Reports::OrderReservationController < BaseReportController
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -53,8 +53,8 @@ class Reports::OrderReservationController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -28,8 +28,8 @@ class Reports::PaymentMethodController < BaseReportController
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -47,8 +47,8 @@ class Reports::PaymentMethodController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -41,8 +41,8 @@ authorize_resource :class => false
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -60,8 +60,8 @@ authorize_resource :class => false
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -36,8 +36,8 @@ class Reports::ReceiptNoDetailController < BaseReportController
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -54,8 +54,8 @@ class Reports::ReceiptNoDetailController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -47,8 +47,8 @@ class Reports::SaleitemController < BaseReportController
if shift.present?
shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -64,8 +64,8 @@ class Reports::SaleitemController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id
@@ -105,7 +105,7 @@ class Reports::SaleitemController < BaseReportController
end
end
sh_name = "#{shift_sale.shift_started_at.utc.getlocal.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.utc.getlocal.strftime('%d %B %l:%M%p')}"
sh_name = "#{shift_sale.shift_started_at.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.strftime('%d %B %l:%M%p')}"
employee = Employee.find(shift_sale.employee_id)
shift_name = employee.nil? ? sh_name : "#{sh_name} (#{employee.name})"
end

View File

@@ -13,8 +13,8 @@ class Reports::ShiftsaleController < BaseReportController
@to = to
if @shift.present?
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = @shift
end
# get printer info
@@ -32,8 +32,8 @@ class Reports::ShiftsaleController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -55,8 +55,8 @@ class Reports::StaffMealController < BaseReportController
if shift.present?
shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -72,8 +72,8 @@ class Reports::StaffMealController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -3,11 +3,11 @@ class Reports::StockCheckController < BaseReportController
def index
# from_date = DateTime.now.beginning_of_day.utc.getlocal
# to_date = DateTime.now.end_of_day.utc.getlocal
# from_date = DateTime.now.beginning_of_day
# to_date = DateTime.now.end_of_day
# unless params[:daterange].blank?
# from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal
# to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal
# from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day
# to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day
# @daterange = params[:daterange]
# end
from_date, to_date = get_date_range_from_params
@@ -33,8 +33,8 @@ class Reports::StockCheckController < BaseReportController
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -24,8 +24,8 @@ authorize_resource :class => false
@print_settings = PrintSetting.get_precision_delimiter()
if @shift.present?
@shift.each do |sh|
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = sh
end
end
@@ -43,8 +43,8 @@ authorize_resource :class => false
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.strftime("%e %b %I:%M%p")
local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.strftime("%e %b %I:%M%p")
opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
shift_id = sale.id.nil? ? '-' : sale.id

View File

@@ -32,10 +32,10 @@ class Settings::CommissionersController < ApplicationController
@commissioner = Commissioner.new(commissioner_params)
@commissioner.created_by = current_user.id
unless @commissioner.joined_date.nil?
@commissioner.joined_date = @commissioner.joined_date.utc.getlocal.strftime('%Y-%b-%d')
@commissioner.joined_date = @commissioner.joined_date.strftime('%Y-%b-%d')
end
unless @commissioner.resigned_date.nil?
@commissioner.resigned_date = @commissioner.resigned_date.utc.getlocal.strftime('%Y-%b-%d')
@commissioner.resigned_date = @commissioner.resigned_date.strftime('%Y-%b-%d')
end
if (params[:from_induty] != "true")
respond_to do |format|

View File

@@ -52,14 +52,14 @@ class Transactions::CardSaleTransController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]

View File

@@ -53,14 +53,14 @@ class Transactions::CardSettleTransController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]

View File

@@ -75,15 +75,15 @@ class Transactions::OrderReservationsController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]

View File

@@ -37,8 +37,8 @@ class Transactions::SalesController < ApplicationController
@food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")
if @shift.present?
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = @shift
end
@@ -183,15 +183,15 @@ class Transactions::SalesController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]