finished customer and join membership in crm
This commit is contained in:
38
app/pdf/crm_order_pdf.rb
Normal file
38
app/pdf/crm_order_pdf.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
class OrderItemPdf < Prawn::Document
|
||||
|
||||
def initialize(order_item)
|
||||
super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
||||
|
||||
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
||||
# font "public/fonts/Zawgyi-One.ttf"
|
||||
# font "public/fonts/padauk.ttf"
|
||||
font_size 9
|
||||
text "#{order_item.dining}", :size => 15
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
#order_info
|
||||
order_info(order_item.order_by,order_item.order_at, order_item.customer)
|
||||
|
||||
# order items
|
||||
# order_items(order_item)
|
||||
end
|
||||
|
||||
# Write Order Information to PDF
|
||||
def order_info(order_by, order_at, customer)
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width => 200, :height => 15) do
|
||||
text "OrderBy:#{order_by} Customer:#{customer} Date:#{order_at.strftime("%Y-%m-%d")}", :size => 7,:align => :left
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
move_down 20
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user