This commit is contained in:
@@ -22,6 +22,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
self.description_width = 150
|
||||
self.price_num_width = 50
|
||||
self.line_move = 2
|
||||
|
||||
# @item_width = self.page_width.to_i / 2
|
||||
# @qty_width = @item_width.to_i / 3
|
||||
# @double = @qty_width * 1.3
|
||||
@@ -48,19 +49,19 @@ class ReceiptBillPdf < Prawn::Document
|
||||
if sale_data.orders[0].source =='app'
|
||||
move_down 3
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
|
||||
text "Mobile Order", :size => self.header_font_size,:align => :left
|
||||
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
|
||||
move_down 1
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||
end
|
||||
if !sale_data.bookings[0].dining_facility.nil?
|
||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } -#{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
move_down 1
|
||||
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||
move_down 1
|
||||
end
|
||||
stroke_horizontal_rule
|
||||
|
||||
cashier_info(sale_data, customer_account, latest_order_no)
|
||||
line_items(sale_items,precision,delimiter)
|
||||
@@ -126,11 +127,10 @@ class ReceiptBillPdf < Prawn::Document
|
||||
move_down line_move
|
||||
text "#{shop_details.phone_no}", :size => self.item_font_size,:align => :center
|
||||
move_down line_move
|
||||
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
def cashier_info(sale_data, customer_account, latest_order_no)
|
||||
stroke_horizontal_rule
|
||||
if latest_order_no.nil?
|
||||
move_down line_move
|
||||
text "Booking : #{ sale_data.bookings[0].booking_id }", :size => self.header_font_size+2,:align => :left
|
||||
@@ -456,7 +456,8 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
def sale_payment(sale_data,precision,delimiter)
|
||||
stroke_horizontal_rule
|
||||
#move_down line_move
|
||||
# move_down 2
|
||||
move_down line_move
|
||||
# sql = "SELECT SUM(payment_amount)
|
||||
# FROM sale_payments where payment_method='creditnote'
|
||||
# and sale_id='#{sale_data.sale_id}'"
|
||||
|
||||
Reference in New Issue
Block a user