finished customer to sale assign in crm
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
class OrderItemPdf < Prawn::Document
|
||||
class CrmOrderPdf < Prawn::Document
|
||||
|
||||
def initialize(order_item)
|
||||
def initialize(order_item, print_settings)
|
||||
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
|
||||
text "#{order_item.type}", :size => 15
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
#order_info
|
||||
order_info(order_item.order_by,order_item.order_at, order_item.customer)
|
||||
order_info(order_item.checkin_by,order_item.checkin_at, order_item.customer_id)
|
||||
|
||||
# order items
|
||||
# order_items(order_item)
|
||||
order_items(order_item)
|
||||
end
|
||||
|
||||
# Write Order Information to PDF
|
||||
@@ -31,7 +31,40 @@ class OrderItemPdf < Prawn::Document
|
||||
move_down 20
|
||||
end
|
||||
|
||||
|
||||
# Write Order items to PDF
|
||||
def order_items(order_item)
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width => 180, :height => 15) do
|
||||
text "Item", :size => 7,:align => :left
|
||||
end
|
||||
|
||||
bounding_box([160,y_position], :width => 20, :height => 15) do
|
||||
text "Qty", :size => 7,:align => :right
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
#Add Order Item
|
||||
add_order_items(order_item)
|
||||
end
|
||||
|
||||
# Add order items under order info
|
||||
def add_order_items(order_item)
|
||||
y_position = cursor
|
||||
|
||||
move_down 5
|
||||
|
||||
bounding_box([0,y_position], :width => 180, :height => 20) do
|
||||
text "#{order_item.sale_id}", :size => 7,:align => :left
|
||||
end
|
||||
|
||||
bounding_box([160,y_position], :width => 20, :height => 20) do
|
||||
text "#{order_item.sale_id}", :size => 7,:align => :right
|
||||
end
|
||||
|
||||
move_down 5
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user