edit in check time

This commit is contained in:
San Wai Lwin
2018-08-14 15:22:49 +06:30
parent 671aa155cd
commit 61e4b930c8
7 changed files with 20 additions and 25 deletions

View File

@@ -63,8 +63,8 @@ class Api::BillController < Api::ApiController
#check checkInOut pdf print
check_booking = Booking.find_by_sale_id(@sale_id)
checkout_time = Lookup.collection_of('checkout_time')
terminal_id = DiningFacility.find_by_id(check_booking.dining_facility_id)
terminal = CashierTerminal.find_by_id(terminal_id.zone_id)
terminal = DiningFacility.find_by_id(check_booking.dining_facility_id)
cashier_terminal = CashierTerminal.find_by_id(terminal.zone_id)
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
@@ -75,7 +75,7 @@ class Api::BillController < Api::ApiController
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer,terminal, check_booking, table)
order_queue_printer.print_check_in_out(printer,cashier_terminal , check_booking, table)
end
end

View File

@@ -76,9 +76,8 @@ class Api::CheckInProcessController < Api::ApiController
dining_facility.status = "occupied"
dining_facility.save!
end
terminal_id = DiningFacility.find_by_id(booking.dining_facility_id)
terminal = CashierTerminal.find_by_id(terminal_id.zone_id)
terminal = DiningFacility.find_by_id(booking.dining_facility_id)
cashier_terminal = CashierTerminal.find_by_id(terminal.zone_id)
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
@@ -89,7 +88,7 @@ class Api::CheckInProcessController < Api::ApiController
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, terminal, booking, dining_facility)
order_queue_printer.print_check_in_out(printer, cashier_terminal, booking, dining_facility)
end
end
render :json => { :status => true, :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") }

View File

@@ -27,8 +27,7 @@ class Origami::CheckInProcessController < BaseOrigamiController
@booking = Booking.create({:dining_facility_id => params[:dining_id],:type => "TableBooking",
:checkin_by=>current_login_employee.name,:checkin_at => Time.now.utc,:checkout_at =>checkout_at, :booking_status => "assign", :reserved_at => checkout_at, :reserved_by => current_login_employee.name })
terminal_id = DiningFacility.find_by_id(@booking.dining_facility_id)
terminal = CashierTerminal.find_by_id(terminal_id.zone_id)
cashier_terminal = CashierTerminal.find_by_id(@dining_facility.zone_id)
if @booking.save!
@dining_facility.status = "occupied"
@@ -37,7 +36,6 @@ class Origami::CheckInProcessController < BaseOrigamiController
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)
@@ -47,7 +45,7 @@ class Origami::CheckInProcessController < BaseOrigamiController
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, terminal, booking, table)
order_queue_printer.print_check_in_out(printer, cashier_terminal, booking, table)
end
end
end

View File

@@ -70,8 +70,8 @@ class Origami::RequestBillsController < ApplicationController
#check checkInOut pdf print
check_booking = Booking.find_by_sale_id(@sale_id)
checkout_time = Lookup.collection_of('checkout_time')
terminal_id = DiningFacility.find_by_id(check_booking.dining_facility_id)
terminal = CashierTerminal.find_by_id(terminal_id.zone_id)
terminal = DiningFacility.find_by_id(check_booking.dining_facility_id)
cashier_terminal = CashierTerminal.find_by_id(terminal.zone_id)
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
unique_code = "CheckInOutPdf"
@@ -81,7 +81,7 @@ class Origami::RequestBillsController < ApplicationController
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, terminal, check_booking, table)
order_queue_printer.print_check_in_out(printer, cashier_terminal, check_booking, table)
end
end
end

View File

@@ -299,7 +299,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
end
# Check in-out time
def print_check_in_out(print_settings, terminal, booking, table)
def print_check_in_out(print_settings, cashier_terminal, booking, table)
#Use CUPS service
#Generate PDF
#Print
@@ -330,7 +330,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
#no print in cloud server
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, terminal.printer_name)
self.print(filename, cashier_terminal.printer_name)
end
end
end

View File

@@ -163,9 +163,7 @@ class Sale < ApplicationRecord
booking.sale_id = self.id
if !booking.checkout_at.nil?
if booking.checkout_at < Time.now.utc.getlocal
booking.checkout_at = Time.now.utc.getlocal
end
else
booking.checkout_at = Time.now.utc.getlocal
end

View File

@@ -18,13 +18,13 @@ class ActionController::Base
# redirect_to root_url(:host => request.domain) + "store_error"
render :json => [{ status: false, message: 'Invalid Access!'}]
end
else
# check for license file
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end
# else
# # check for license file
# if check_license
# current_license(ENV["SX_PROVISION_URL"])
# else
# redirect_to activate_path
# end
end
end