separate foodcourt module
This commit is contained in:
@@ -78,13 +78,13 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
|
||||
def cashier_info(sale_data, customer_name, latest_order_no,order_reservation)
|
||||
move_down line_move
|
||||
|
||||
|
||||
# move_down 2
|
||||
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width , :height => self.item_height) do
|
||||
text "Order Date " , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{order_reservation.created_at.strftime('%d-%m-%Y %H:%M %p')}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -92,7 +92,7 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width , :height => self.item_height) do
|
||||
text "Requested Date Time " , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{order_reservation.requested_time.strftime('%d-%m-%Y %H:%M %p')}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -100,7 +100,7 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width , :height => self.item_height) do
|
||||
text "Payment Type" , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{order_reservation.payment_type}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -108,7 +108,7 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width , :height => self.item_height) do
|
||||
text "#{customer_name} " , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "Online Order", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -167,14 +167,14 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
total_qty = 0.0
|
||||
show_price = Lookup.find_by_lookup_type("show_price")
|
||||
sale_items.each do |item|
|
||||
# check for item not to show
|
||||
# check for item not to show
|
||||
|
||||
if item.status != 'Discount' && item.qty > 0
|
||||
if !show_price.nil? && show_price.value.to_i > 0 && item.price == 0
|
||||
total_qty += item.qty
|
||||
total_qty += item.qty
|
||||
else
|
||||
if item.price != 0
|
||||
total_qty += item.qty
|
||||
total_qty += item.qty
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -191,7 +191,7 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
qty = item.qty
|
||||
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
||||
price = item.unit_price
|
||||
|
||||
|
||||
# end
|
||||
if !show_price.nil? && show_price.value.to_i>0
|
||||
item_row(item,precision,delimiter,product_name,price,qty ,total_price)
|
||||
@@ -220,24 +220,24 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
|
||||
bounding_box([self.description_width - 48,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{number_with_precision(order_reservation.delivery_fee, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if order_reservation.total_tax > 0
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.item_description_width , :height => self.item_height) do
|
||||
text "Tax " , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{number_with_precision(order_reservation.total_tax, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.item_description_width , :height => self.item_height) do
|
||||
text "Convenience Charges " , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{number_with_precision(order_reservation.convenience_charge, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -250,8 +250,8 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{number_with_precision(order_reservation.discount_amount, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#Change items rows
|
||||
@@ -277,10 +277,10 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
bounding_box([0,y_position], :width =>self.item_width) do
|
||||
text "#{product_name}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
# text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size
|
||||
text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
# text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size
|
||||
text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
|
||||
if show_alt_name
|
||||
if !(item.product_alt_name).empty?
|
||||
@@ -310,10 +310,10 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(order_reservation.grand_total, :precision => precision.to_i, :delimiter => delimiter)}" , :style => :bold, :size => self.header_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
move_down line_move
|
||||
|
||||
# sale_payment(sale_data,precision,delimiter)
|
||||
# sale_payment(sale_data,precision,delimiter)
|
||||
end
|
||||
|
||||
#Change Footer
|
||||
@@ -326,10 +326,10 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width) do
|
||||
text "#{printed_status}",:style => :bold, :size => header_font_size - 1,:align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Thank You! See you Again", :left_margin => -5, :size => self.item_font_size - 1,:align => :left
|
||||
end
|
||||
end
|
||||
|
||||
move_down line_move
|
||||
end
|
||||
@@ -351,4 +351,4 @@ class ReceiptBillOrderPdf < Prawn::Document
|
||||
end
|
||||
return status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user