change UI set menu and add lateset order no in receipt bill for QuickService

This commit is contained in:
phyusin
2018-09-06 15:15:28 +06:30
parent 6af0c40456
commit e450927d81
9 changed files with 468 additions and 432 deletions

View File

@@ -2,7 +2,7 @@ class ReceiptBillA5Pdf < Prawn::Document
include ActionView::Helpers::NumberHelper
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount)
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no)
self.page_width = printer_settings.page_width
self.page_height = printer_settings.page_height
self.header_font_size = printer_settings.header_font_size.to_i
@@ -56,7 +56,7 @@ class ReceiptBillA5Pdf < Prawn::Document
stroke_horizontal_rule
cashier_info(sale_data, customer_name)
cashier_info(sale_data, customer_name, latest_order_no)
line_items(sale_items,printer_settings.precision,delimiter)
all_total(sale_data,printer_settings.precision,delimiter)
@@ -112,7 +112,7 @@ class ReceiptBillA5Pdf < Prawn::Document
stroke_horizontal_rule
end
def cashier_info(sale_data, customer_name)
def cashier_info(sale_data, customer_name, latest_order_no)
move_down line_move
# move_down 2
y_position = cursor
@@ -160,6 +160,14 @@ class ReceiptBillA5Pdf < Prawn::Document
# :size => self.item_font_size,:align => :right
# end
if !latest_order_no.nil?
y_position = cursor
move_down line_move
bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do
text "OrderNo : #{ latest_order_no }",:size => self.item_font_size,:align => :left
end
end
move_down line_move
stroke_horizontal_rule
end

View File

@@ -3,7 +3,7 @@ class ReceiptBillPdf < Prawn::Document
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount)
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no)
self.page_width = printer_settings.page_width
self.page_height = printer_settings.page_height
self.header_font_size = printer_settings.header_font_size.to_i
@@ -57,7 +57,7 @@ class ReceiptBillPdf < Prawn::Document
stroke_horizontal_rule
cashier_info(sale_data, customer_name)
cashier_info(sale_data, customer_name, latest_order_no)
line_items(sale_items,printer_settings.precision,delimiter)
all_total(sale_data,printer_settings.precision,delimiter)
@@ -112,7 +112,7 @@ class ReceiptBillPdf < Prawn::Document
stroke_horizontal_rule
end
def cashier_info(sale_data, customer_name)
def cashier_info(sale_data, customer_name, latest_order_no)
move_down line_move
# move_down 2
@@ -153,7 +153,13 @@ class ReceiptBillPdf < Prawn::Document
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
# :size => self.item_font_size,:align => :right
# end
if !latest_order_no.nil?
y_position = cursor
move_down line_move
bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do
text "OrderNo : #{ latest_order_no }",:size => self.item_font_size,:align => :left
end
end
move_down line_move
stroke_horizontal_rule
end