Add Moved By in MoveTablePdf
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class MoveTablePdf < Prawn::Document
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(printer_settings,to,from,shop_detail,date,type)
|
||||
def initialize(printer_settings,to,from,shop_detail,date,type,moved_by)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 5
|
||||
@@ -32,7 +32,7 @@ class MoveTablePdf < Prawn::Document
|
||||
|
||||
header(printer_settings.name,type)
|
||||
|
||||
call_move_table(to,from,date,type)
|
||||
call_move_table(to,from,date,type,moved_by)
|
||||
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
@@ -41,17 +41,18 @@ class MoveTablePdf < Prawn::Document
|
||||
end
|
||||
|
||||
def header (name,type)
|
||||
text "Move #{type}", :left_margin => -10, :size => self.header_font_size,:align => :center
|
||||
text "Move #{type}", :left_margin => -10, :size => self.header_font_size.to_i + 3,:align => :center
|
||||
# move_down self.item_height
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
end
|
||||
|
||||
def call_move_table (to,from,date,type)
|
||||
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 "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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user