update customer seed shop and receipt bill
This commit is contained in:
@@ -30,7 +30,6 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
cashier_info(sale_data, customer_name)
|
||||
line_items(sale_items)
|
||||
items_account(item_price_by_accounts)
|
||||
all_total(sale_data)
|
||||
|
||||
|
||||
@@ -39,6 +38,8 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
customer(customer_name)
|
||||
|
||||
items_account(item_price_by_accounts)
|
||||
|
||||
footer
|
||||
end
|
||||
@@ -61,19 +62,10 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text "Receipt No: #{sale_data.receipt_no}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
|
||||
# y_position = cursor
|
||||
# bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
# text "Customer:", :size => self.item_font_size,:align => :left
|
||||
# end
|
||||
# bounding_box([self.label_width,y_position], :width =>self.item_width) do
|
||||
# text "#{customer_name}" , :size => self.item_font_size,:align => :left
|
||||
# end
|
||||
# move_down 5
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.item_width) do
|
||||
text "Waiter: #{sale_data.requested_by}" , :size => self.item_font_size, :align => :left
|
||||
@@ -86,27 +78,26 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
move_down 5
|
||||
|
||||
# bounding_box([self.label_width,y_position], :width =>self.item_width) do
|
||||
# text "#{customer_name}" , :size => self.item_font_size,:align => :left
|
||||
# end
|
||||
# move_down 5
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "Time In: #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
|
||||
text "Time Out: #{ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p') }" , :size => self.item_font_size,:align => :right
|
||||
bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do
|
||||
text "Receipt Date : #{ sale_data.receipt_date.strftime('%d-%m-%Y') } ( #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } )",:size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
|
||||
# bounding_box([self.item_description_width,y_position], :width =>self.label_width+5) do
|
||||
# text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }
|
||||
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
|
||||
# :size => self.item_font_size,:align => :right
|
||||
# end
|
||||
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
end
|
||||
|
||||
def line_items(sale_items)
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
|
||||
move_down 5
|
||||
pad_top(15) {
|
||||
# @item_width.to_i + @half_qty.to_i
|
||||
text_box "Items", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||
@@ -114,10 +105,8 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text_box "Qty", :at =>[(self.item_width+self.price_width),y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "Total", :at =>[(self.item_width+self.price_width+4),y_position], :width => self.total_width+3, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
|
||||
move_down 5
|
||||
move_down -5
|
||||
stroke_horizontal_rule
|
||||
|
||||
add_line_item_row(sale_items)
|
||||
end
|
||||
|
||||
@@ -142,7 +131,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text_box "#{qty}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{total_price}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
move_down 3
|
||||
move_down 1
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
@@ -158,20 +147,6 @@ class ReceiptBillPdf < Prawn::Document
|
||||
move_down 5
|
||||
end
|
||||
|
||||
def items_account(item_price_by_accounts)
|
||||
y_position = cursor
|
||||
item_price_by_accounts.each do |ipa|
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ ipa[:price] }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
end
|
||||
end
|
||||
|
||||
def all_total(sale_data)
|
||||
item_name_width = self.item_width
|
||||
y_position = cursor
|
||||
@@ -267,7 +242,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Rebate Amount", :size => self.item_font_size,:align => :left
|
||||
text "Current Rebate Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right
|
||||
@@ -278,10 +253,10 @@ class ReceiptBillPdf < Prawn::Document
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
text "Current Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ res["redeem"] }" , :size => self.item_font_size,:align => :right
|
||||
text "(#{ res["redeem"] })" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
@@ -317,7 +292,23 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ customer_name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def items_account(item_price_by_accounts)
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
item_price_by_accounts.each do |ipa|
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ ipa[:price] }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def footer
|
||||
@@ -331,3 +322,4 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user