add order item and order summary slim pdf

This commit is contained in:
phyusin
2017-12-20 15:57:37 +06:30
parent d7a3ba7004
commit fce3785912
10 changed files with 321 additions and 30 deletions

View File

@@ -105,18 +105,22 @@ class OrderItemPdf < Prawn::Document
end
if alt_name
move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
if !(order_item.alt_name).empty?
move_down 4
font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end
end
end
move_down 5
if !options.empty?
move_down 5
# add option
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "#{options}", :size => self.item_font_size,:align => :left
# add option
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "#{options}", :size => self.item_font_size,:align => :left
end
end
move_down 5