format bill

This commit is contained in:
Yan
2017-07-05 16:15:15 +06:30
parent ff47acd134
commit da71a542ee

View File

@@ -140,12 +140,12 @@ class ReceiptBillPdf < Prawn::Document
y_position = cursor
pad_top(15) {
text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size, :overflow => :shrink_to_fix
text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_name_width,y_position], :width => self.qty_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size, :overflow => :shrink_to_fix
text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_name_width,y_position], :width => self.qty_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
}
move_down 1
move_down 3
end
end