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

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