Edit in bill and request bill controller
This commit is contained in:
@@ -45,21 +45,21 @@ class Api::BillController < Api::ApiController
|
|||||||
@sale_id = booking.sale_id
|
@sale_id = booking.sale_id
|
||||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
end
|
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
|
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)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
elsif (params[:order_id])
|
elsif (params[:order_id])
|
||||||
order = Order.find(params[:order_id])
|
order = Order.find(params[:order_id])
|
||||||
|
|||||||
@@ -21,36 +21,6 @@ class ApplicationController < ActionController::Base
|
|||||||
def shop_detail
|
def shop_detail
|
||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
end
|
end
|
||||||
|
|
||||||
def order_reservation
|
|
||||||
order_reserve = Lookup.collection_of('order_reservation')
|
|
||||||
status = false
|
|
||||||
if !order_reserve.empty?
|
|
||||||
order_reserve.each do |order|
|
|
||||||
if order[0] == 'OrderReservation'
|
|
||||||
if order[1] == '1'
|
|
||||||
status = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return status
|
|
||||||
end
|
|
||||||
|
|
||||||
def bank_integration
|
|
||||||
bank_integration = Lookup.collection_of('bank_integration')
|
|
||||||
status = false
|
|
||||||
if !bank_integration.empty?
|
|
||||||
bank_integration.each do |bank|
|
|
||||||
if bank[0] == 'Bank Integration'
|
|
||||||
if bank[1] == '1'
|
|
||||||
status = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return status
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module LoginVerification
|
|||||||
|
|
||||||
included do
|
included do
|
||||||
before_action :authenticate_session_token
|
before_action :authenticate_session_token
|
||||||
helper_method :current_company, :current_login_employee, :current_user, :get_cashier
|
helper_method :current_company, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration
|
||||||
end
|
end
|
||||||
|
|
||||||
#this is base api base controller to need to inherit.
|
#this is base api base controller to need to inherit.
|
||||||
@@ -30,6 +30,38 @@ module LoginVerification
|
|||||||
@cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
@cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#check order reservation used
|
||||||
|
def order_reservation
|
||||||
|
order_reserve = Lookup.collection_of('order_reservation')
|
||||||
|
status = false
|
||||||
|
if !order_reserve.empty?
|
||||||
|
order_reserve.each do |order|
|
||||||
|
if order[0] == 'OrderReservation'
|
||||||
|
if order[1] == '1'
|
||||||
|
status = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return status
|
||||||
|
end
|
||||||
|
|
||||||
|
#check bank integration used
|
||||||
|
def bank_integration
|
||||||
|
bank_integration = Lookup.collection_of('bank_integration')
|
||||||
|
status = false
|
||||||
|
if !bank_integration.empty?
|
||||||
|
bank_integration.each do |bank|
|
||||||
|
if bank[0] == 'Bank Integration'
|
||||||
|
if bank[1] == '1'
|
||||||
|
status = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return status
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
# Authenticate the user with token based authentication
|
# Authenticate the user with token based authentication
|
||||||
def authenticate
|
def authenticate
|
||||||
|
|||||||
@@ -69,16 +69,15 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
else
|
else
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
|
|
||||||
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
|
unique_code = "CheckInOutPdf"
|
||||||
unique_code = "CheckInOutPdf"
|
printer = PrintSetting.find_by_unique_code(unique_code)
|
||||||
booking = Booking.find_by_booking_id(bk_order.booking_id)
|
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
|
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
|
||||||
|
|
||||||
if !printer.nil?
|
if !printer.nil?
|
||||||
order_queue_printer.print_check_in_out(printer, booking, table)
|
order_queue_printer.print_check_in_out(printer, check_booking, table)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user