Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Aung Myo
2018-08-08 14:19:07 +06:30
4 changed files with 35 additions and 35 deletions

View File

@@ -45,22 +45,7 @@ class Api::BillController < Api::ApiController
@sale_id = booking.sale_id
@sale_data = Sale.find_by_sale_id(@sale_id)
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, booking, table)
end
end
end
elsif (params[:order_id])
order = Order.find(params[:order_id])
@sale = Sale.new
@@ -75,6 +60,22 @@ class Api::BillController < Api::ApiController
# @sale_data.shift_sale_id = shift_by_terminal.id
# @sale_data.save
#check checkInOut pdf print
check_booking = Booking.find_by_sale_id(@sale_id)
checkout_time = Lookup.collection_of('checkout_time')
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, check_booking, table)
end
end
Promotion.promo_activate(@sale)
#BillBroadcastJob.perform_later(table)

View File

@@ -77,25 +77,23 @@ class Api::CheckInProcessController < Api::ApiController
dining_facility.save!
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, booking, dining_facility)
end
end
render :json => { :status => true, :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") }
else
render :json => { :status => true }
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
unique_code = "CheckInOutPdf"
booking = Booking.find_by_booking_id(booking.booking_id)
table = DiningFacility.find(params[:dining_id])
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, booking, table)
end
end
else
render :json => { :status => true }
end

View File

@@ -67,9 +67,10 @@ class Origami::RequestBillsController < ApplicationController
result = {:status=> @status, :data => @sale.sale_id }
render :json => result.to_json
else
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
#check checkInOut pdf print
check_booking = Booking.find_by_sale_id(@sale_id)
checkout_time = Lookup.collection_of('checkout_time')
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)

View File

@@ -12,8 +12,8 @@ class SalePayment < ApplicationRecord
self.sale = invoice
self.received_amount = cash_amount
self.payment_reference = remark
puts action_by
puts "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
# puts action_by
# puts "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
self.action_by = action_by
#get all payment for this invoices
if payment_for