merge with master

This commit is contained in:
Yan
2017-06-14 19:43:05 +06:30
15 changed files with 284 additions and 70 deletions

View File

@@ -8,9 +8,9 @@ class ReceiptBillPdf < Prawn::Document
self.qty_width = 20
self.total_width = 40
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width)+(self.margin*4))
self.item_height = 15
self.item_height = 15
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
self.label_width=80
self.label_width=80
# @item_width = self.page_width.to_i / 2
# @qty_width = @item_width.to_i / 3
@@ -101,7 +101,7 @@ class ReceiptBillPdf < Prawn::Document
stroke_horizontal_rule
add_line_item_row(sale_items, food_total, beverage_total)
end
def add_line_item_row(sale_items, food_total, beverage_total)
@@ -115,17 +115,15 @@ class ReceiptBillPdf < Prawn::Document
total_price = item.qty*item.unit_price
price = item.unit_price
product_name = item.product_name
y_position = cursor
pad_top(15) {
# @item_width.to_i + @half_qty.to_i
text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size, :overflow => :shrink_to_fix
text_box "#{price}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{qty.to_i}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{total_price}", :at =>[(item_name_width+2),y_position], :width =>self.total_width+2, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
}
move_down 3
end
@@ -156,7 +154,7 @@ class ReceiptBillPdf < Prawn::Document
end
def all_total(sale_data)
item_name_width = self.item_width
item_name_width = self.item_width
move_down 5
y_position = cursor