Delect Lookup for check in out
This commit is contained in:
@@ -72,7 +72,7 @@ For Check in-out Printing
|
|||||||
********* Check in-out Pdf *********
|
********* Check in-out Pdf *********
|
||||||
1) settings/print_settings
|
1) settings/print_settings
|
||||||
(a) Unique Code => CheckInOutPdf
|
(a) Unique Code => CheckInOutPdf
|
||||||
2) settings/lookups => { type:print_settings, name:CheckInOutPdf, value:1 }
|
(b) Heading Space => 5
|
||||||
|
|
||||||
For ReceiptBillA5Pdf
|
For ReceiptBillA5Pdf
|
||||||
*** change ReceiptBillPdf to ReceiptBillA5Pdf
|
*** change ReceiptBillPdf to ReceiptBillA5Pdf
|
||||||
|
|||||||
@@ -32,29 +32,18 @@ class Api::BillController < Api::ApiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
#bill channel
|
|
||||||
check_in_out_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
|
||||||
printer = PrintSetting.all
|
unique_code = "CheckInOutPdf"
|
||||||
unique_code="CheckInOutPdf"
|
|
||||||
if !check_in_out_pdf.empty?
|
|
||||||
if !printer.empty?
|
|
||||||
printer.each do |printer_setting|
|
|
||||||
if printer_setting.unique_code == 'CheckInOutPdf'
|
|
||||||
unique_code="CheckInOutPdf"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
booking = Booking.find_by_booking_id(booking.booking_id)
|
booking = Booking.find_by_booking_id(booking.booking_id)
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
|
||||||
order_queue_printer.print_check_in_out(print_settings, booking, table)
|
if !printer.nil?
|
||||||
|
order_queue_printer.print_check_in_out(printer, booking, table)
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
elsif (params[:order_id])
|
elsif (params[:order_id])
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
@@ -113,16 +102,6 @@ class Api::BillController < Api::ApiController
|
|||||||
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts, member_info, shop_details)
|
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts, member_info, shop_details)
|
||||||
end
|
end
|
||||||
|
|
||||||
#get cloud domain
|
|
||||||
def getCloudDomain
|
|
||||||
from = ""
|
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
|
||||||
from = request.subdomain + "." + request.domain
|
|
||||||
end
|
|
||||||
|
|
||||||
return from
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def bill_params
|
def bill_params
|
||||||
params.permit(:booking_id, :order_id)
|
params.permit(:booking_id, :order_id)
|
||||||
|
|||||||
@@ -83,28 +83,19 @@ class Api::CheckInProcessController < Api::ApiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
check_in_out_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
|
||||||
printer = PrintSetting.all
|
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
|
||||||
unique_code="CheckInOutPdf"
|
unique_code = "CheckInOutPdf"
|
||||||
if !check_in_out_pdf.empty?
|
|
||||||
if !printer.empty?
|
|
||||||
printer.each do |printer_setting|
|
|
||||||
if printer_setting.unique_code == 'CheckInOutPdf'
|
|
||||||
unique_code="CheckInOutPdf"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
booking = Booking.find_by_booking_id(booking.booking_id)
|
booking = Booking.find_by_booking_id(booking.booking_id)
|
||||||
table = DiningFacility.find(params[:dining_id])
|
table = DiningFacility.find(params[:dining_id])
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
|
||||||
order_queue_printer.print_check_in_out(print_settings, booking, table)
|
if !printer.nil?
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
order_queue_printer.print_check_in_out(printer, booking, table)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
render :json => { :status => true }
|
render :json => { :status => true }
|
||||||
end
|
end
|
||||||
@@ -145,16 +136,6 @@ class Api::CheckInProcessController < Api::ApiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#get cloud domain
|
|
||||||
def getCloudDomain
|
|
||||||
from = ""
|
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
|
||||||
from = request.subdomain + "." + request.domain
|
|
||||||
end
|
|
||||||
|
|
||||||
return from
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def check_in_process_params
|
def check_in_process_params
|
||||||
params.permit(:dining_id,:booking_id,:time)
|
params.permit(:dining_id,:booking_id,:time)
|
||||||
|
|||||||
@@ -31,27 +31,19 @@ class Origami::CheckInProcessController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
check_in_out_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
|
||||||
printer = PrintSetting.all
|
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
|
||||||
unique_code="CheckInOutPdf"
|
unique_code = "CheckInOutPdf"
|
||||||
if !check_in_out_pdf.empty?
|
|
||||||
if !printer.empty?
|
|
||||||
printer.each do |printer_setting|
|
|
||||||
if printer_setting.unique_code == 'CheckInOutPdf'
|
|
||||||
unique_code="CheckInOutPdf"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
booking = Booking.find_by_booking_id(@booking.booking_id)
|
booking = Booking.find_by_booking_id(@booking.booking_id)
|
||||||
table = DiningFacility.find(params[:dining_id])
|
table = DiningFacility.find(params[:dining_id])
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
|
||||||
order_queue_printer.print_check_in_out(print_settings, booking, table)
|
if !printer.nil?
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
order_queue_printer.print_check_in_out(printer, booking, table)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
respond = {:status => 'ok'}
|
respond = {:status => 'ok'}
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@@ -59,14 +51,4 @@ class Origami::CheckInProcessController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#get cloud domain
|
|
||||||
def getCloudDomain
|
|
||||||
from = ""
|
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
|
||||||
from = request.subdomain + "." + request.domain
|
|
||||||
end
|
|
||||||
|
|
||||||
return from
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -51,30 +51,20 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
result = {:status=> @status, :data => @sale.sale_id }
|
result = {:status=> @status, :data => @sale.sale_id }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
else
|
else
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
#bill channel
|
|
||||||
check_in_out_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
|
||||||
printer = PrintSetting.all
|
|
||||||
unique_code="CheckInOutPdf"
|
|
||||||
if !check_in_out_pdf.empty?
|
|
||||||
if !printer.empty?
|
|
||||||
printer.each do |printer_setting|
|
|
||||||
if printer_setting.unique_code == 'CheckInOutPdf'
|
|
||||||
unique_code="CheckInOutPdf"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
booking = Booking.find_by_booking_id(bk_order.booking_id)
|
|
||||||
|
|
||||||
# print when complete click
|
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
|
||||||
order_queue_printer.print_check_in_out(print_settings, booking, table)
|
|
||||||
|
|
||||||
from = getCloudDomain #get sub domain in cloud mode
|
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
|
||||||
end
|
unique_code = "CheckInOutPdf"
|
||||||
|
booking = Booking.find_by_booking_id(bk_order.booking_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
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@status = false
|
@status = false
|
||||||
@@ -103,15 +93,5 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
|
|
||||||
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details)
|
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details)
|
||||||
end
|
end
|
||||||
|
|
||||||
#get cloud domain
|
|
||||||
def getCloudDomain
|
|
||||||
from = ""
|
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
|
||||||
from = request.subdomain + "." + request.domain
|
|
||||||
end
|
|
||||||
|
|
||||||
return from
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ class PrintSetting < ApplicationRecord
|
|||||||
def self.get_precision_delimiter
|
def self.get_precision_delimiter
|
||||||
PrintSetting.find_by_unique_code("CloseCashierPdf")
|
PrintSetting.find_by_unique_code("CloseCashierPdf")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user