foodcourt
This commit is contained in:
@@ -17,11 +17,11 @@ class Customer < ApplicationRecord
|
||||
|
||||
paginates_per 50
|
||||
|
||||
def draft_customer(phone, pin)
|
||||
cus = Customer.find_by_contact_no(phone)
|
||||
def draft_customer(params, pin)
|
||||
cus = Customer.find_by_contact_no(params[:phone_number])
|
||||
if cus.nil?
|
||||
self.name = "User " + pin.to_s
|
||||
self.contact_no = phone
|
||||
self.name = params[:name]
|
||||
self.contact_no = params[:phone_number]
|
||||
self.email = pin.to_s + "@gmail.com"
|
||||
self.pin_code = pin.to_s
|
||||
self.pin_sent_at = Time.now
|
||||
|
||||
@@ -37,11 +37,13 @@ class Order < ApplicationRecord
|
||||
:checkin_at => Time.now.utc,:checkout_at => Time.now.utc + self.extra_time.to_i,
|
||||
:checkin_by => self.employee_name,
|
||||
:booking_status => "assign",
|
||||
:customer_id => self.customer_id,
|
||||
:shop_code=>self.shop_code})
|
||||
else
|
||||
booking = Booking.create({:dining_facility_id => table_id,:type => "TableBooking",
|
||||
:checkin_at => Time.now.utc, :checkin_by => self.employee_name,
|
||||
:booking_status => "assign",
|
||||
:customer_id => self.customer_id,
|
||||
:shop_code=>self.shop_code })
|
||||
end
|
||||
#end extra time
|
||||
|
||||
@@ -38,20 +38,20 @@ class Printer::PrinterWorker
|
||||
end
|
||||
|
||||
def print(file_path,printer_destination = nil )
|
||||
# if printer_destination.nil?
|
||||
# printer_destination = self.printer_destination
|
||||
# end
|
||||
#
|
||||
# puts printer_destination
|
||||
# puts '........Printer Destination..........'
|
||||
#
|
||||
# copy = self.print_copies
|
||||
# #Print only when printer information is not null
|
||||
# if !self.printer_destination.nil?
|
||||
# (1..copy).each do
|
||||
# page = Cups::PrintJob.new(file_path, printer_destination)
|
||||
# page.print
|
||||
# end
|
||||
# end
|
||||
if printer_destination.nil?
|
||||
printer_destination = self.printer_destination
|
||||
end
|
||||
|
||||
puts printer_destination
|
||||
puts '........Printer Destination..........'
|
||||
|
||||
copy = self.print_copies
|
||||
#Print only when printer information is not null
|
||||
if !self.printer_destination.nil?
|
||||
(1..copy).each do
|
||||
page = Cups::PrintJob.new(file_path, printer_destination)
|
||||
page.print
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user