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

@@ -72,14 +72,14 @@ class CheckInOutPdf < Prawn::Document
y_position = cursor
bounding_box([0,y_position], :width => self.item_width) do
text "Check In : #{checkin_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Check In : #{checkin_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
move_down 2
y_position = cursor
bounding_box([0,y_position], :width => self.item_width) do
text "Check Out : #{checkout_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Check Out : #{checkout_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
end
end

View File

@@ -82,7 +82,7 @@ class CloseCashierCustomisePdf < Prawn::Document
text "Opening Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
text "#{ shift_sale.shift_started_at.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor
@@ -90,7 +90,7 @@ class CloseCashierCustomisePdf < Prawn::Document
text "Closing Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ shift_sale.shift_closed_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
text "#{ shift_sale.shift_closed_at.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor

View File

@@ -86,7 +86,7 @@ class CloseCashierPdf < Prawn::Document
text "Opening Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
text "#{ shift_sale.shift_started_at.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor
@@ -94,7 +94,7 @@ class CloseCashierPdf < Prawn::Document
text "Closing Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ shift_sale.shift_closed_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
text "#{ shift_sale.shift_closed_at.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor

View File

@@ -83,7 +83,7 @@ class CloseCashierPdf < Prawn::Document
text "Opening Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
text "#{ shift_sale.shift_started_at.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor
@@ -91,7 +91,7 @@ class CloseCashierPdf < Prawn::Document
text "Closing Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ shift_sale.shift_closed_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
text "#{ shift_sale.shift_closed_at.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor

View File

@@ -57,7 +57,7 @@ class MoveTablePdf < Prawn::Document
def call_move_table (to,from,date,type,moved_by)
move_down 3
text "Date Time : #{date.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :left_margin => -10, :size => self.header_font_size
text "Date Time : #{date.strftime("%Y-%m-%d %I:%M %p")}", :left_margin => -10, :size => self.header_font_size
text "Change [#{from}] To [#{to}]", :left_margin => -10, :size => self.header_font_size
text "Moved By : #{moved_by}", :left_margin => -10, :size => self.header_font_size
end

View File

@@ -56,7 +56,7 @@ class MoveTableStarPdf < Prawn::Document
def call_move_table (to,from,date,type,moved_by)
move_down 3
text "Date Time : #{date.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :left_margin => -10, :size => self.header_font_size
text "Date Time : #{date.strftime("%Y-%m-%d %I:%M %p")}", :left_margin => -10, :size => self.header_font_size
text "Change [#{from}] To [#{to}]", :left_margin => -10, :size => self.header_font_size
text "Moved By : #{moved_by}", :left_margin => -10, :size => self.header_font_size
end

View File

@@ -89,7 +89,7 @@ class OrderItemCustomisePdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -89,7 +89,7 @@ class OrderItemPdf < Prawn::Document
move_down 2
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -89,7 +89,7 @@ class OrderItemSlimCustomisePdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_slim_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_slim_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -89,7 +89,7 @@ class OrderItemSlimPdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -90,7 +90,7 @@ class OrderItemStarPdf < Prawn::Document
move_down 2
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -89,7 +89,7 @@ class OrderSetItemCustomisePdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -88,7 +88,7 @@ class OrderSetItemPdf < Prawn::Document
move_down 2
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -92,7 +92,7 @@ class OrderSummaryCustomisePdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -90,7 +90,7 @@ class OrderSummaryPdf < Prawn::Document
move_down 5
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -92,7 +92,7 @@ class OrderSummarySetCustomisePdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -92,7 +92,7 @@ class OrderSummarySetPdf < Prawn::Document
move_down 5
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -93,7 +93,7 @@ class OrderSummarySlimCustomisePdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_slim_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_slim_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -92,7 +92,7 @@ class OrderSummarySlimPdf < Prawn::Document
move_down 1
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
end
stroke_horizontal_rule

View File

@@ -165,7 +165,7 @@ class ReceiptBillA5Pdf < Prawn::Document
y_position = cursor
if sale_data.bookings[0].dining_facility_id.to_i > 0
time =sale_data.receipt_date.strftime('%d-%m-%Y') +"("+ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') +"-"+ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p')+")"
time =sale_data.receipt_date.strftime('%d-%m-%Y') +"("+ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') +"-"+ sale_data.bookings[0].checkout_at.strftime('%I:%M %p')+")"
else
time = time = sale_data.receipt_date.strftime('%d-%m-%Y %H:%M %p')
end
@@ -175,8 +175,8 @@ class ReceiptBillA5Pdf < Prawn::Document
# bounding_box([self.item_description_width,y_position], :width =>self.label_width+5) do
# text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
# text "(#{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') }
# - #{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') })" ,
# :size => self.item_font_size,:align => :right
# end
move_down line_move

View File

@@ -170,7 +170,7 @@ class ReceiptBillPdf < Prawn::Document
y_position = cursor
if sale_data.bookings[0].dining_facility_id.to_i > 0
time = sale_data.receipt_date.strftime('%d-%m-%Y') +"("+ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') +"-"+ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p')+")"
time = sale_data.receipt_date.strftime('%d-%m-%Y') +"("+ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') +"-"+ sale_data.bookings[0].checkout_at.strftime('%I:%M %p')+")"
else
time = sale_data.receipt_date.strftime('%d-%m-%Y %H:%M %p')
end
@@ -180,8 +180,8 @@ class ReceiptBillPdf < Prawn::Document
end
# bounding_box([self.item_description_width,y_position], :width =>self.label_width+5) do
# text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
# text "(#{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') }
# - #{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') })" ,
# :size => self.item_font_size,:align => :right
# end
move_down line_move

View File

@@ -159,7 +159,7 @@ class ReceiptBillStarPdf < Prawn::Document
y_position = cursor
if sale_data.bookings[0].dining_facility_id.to_i > 0
time = sale_data.receipt_date.strftime('%d-%m-%Y') +"("+ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') +"-"+ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p')+")"
time = sale_data.receipt_date.strftime('%d-%m-%Y') +"("+ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') +"-"+ sale_data.bookings[0].checkout_at.strftime('%I:%M %p')+")"
else
time = sale_data.receipt_date.strftime('%d-%m-%Y %H:%M %p')
end
@@ -169,8 +169,8 @@ class ReceiptBillStarPdf < Prawn::Document
end
# bounding_box([self.item_description_width,y_position], :width =>self.label_width+5) do
# text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
# text "(#{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') }
# - #{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') })" ,
# :size => self.item_font_size,:align => :right
# end
move_down line_move

View File

@@ -95,7 +95,7 @@ class SaleItemsPdf < Prawn::Document
text "From Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
text "#{ from_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
text "#{ from_date.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
end
y_position = cursor
@@ -103,7 +103,7 @@ class SaleItemsPdf < Prawn::Document
text "To Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
text "#{ to_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
text "#{ to_date.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
end
y_position = cursor

View File

@@ -94,7 +94,7 @@ class SaleItemsStarPdf < Prawn::Document
text "From Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
text "#{ from_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
text "#{ from_date.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
end
y_position = cursor
@@ -102,7 +102,7 @@ class SaleItemsStarPdf < Prawn::Document
text "To Date : ", :size => self.item_font_size,:align => :left
end
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
text "#{ to_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
text "#{ to_date.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
end
y_position = cursor

View File

@@ -74,7 +74,7 @@ class StockCheckPdf < Prawn::Document
text "Check Start Time : ", :size => self.item_font_size, :align => :left
end
bounding_box([self.label_width, y_position], :width => self.label_width, :height => self.item_height) do
text "#{ stockcheck.check_start.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }", :size => self.item_font_size, :align => :left
text "#{ stockcheck.check_start.strftime('%d-%m-%Y %I:%M %p') }", :size => self.item_font_size, :align => :left
end
y_position = cursor
@@ -82,7 +82,7 @@ class StockCheckPdf < Prawn::Document
text "Check End Time ", :size => self.item_font_size, :align => :left
end
bounding_box([self.label_width, y_position], :width => self.label_width, :height => self.item_height) do
text "#{ stockcheck.check_start.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }", :size => self.item_font_size, :align => :left
text "#{ stockcheck.check_start.strftime('%d-%m-%Y %I:%M %p') }", :size => self.item_font_size, :align => :left
end
if stockcheck_items.length > 0