check req bil
This commit is contained in:
@@ -45,22 +45,7 @@ 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
|
||||||
|
|
||||||
|
|
||||||
elsif (params[:order_id])
|
elsif (params[:order_id])
|
||||||
order = Order.find(params[:order_id])
|
order = Order.find(params[:order_id])
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
@@ -75,6 +60,22 @@ class Api::BillController < Api::ApiController
|
|||||||
# @sale_data.shift_sale_id = shift_by_terminal.id
|
# @sale_data.shift_sale_id = shift_by_terminal.id
|
||||||
# @sale_data.save
|
# @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)
|
Promotion.promo_activate(@sale)
|
||||||
|
|
||||||
#BillBroadcastJob.perform_later(table)
|
#BillBroadcastJob.perform_later(table)
|
||||||
|
|||||||
@@ -67,9 +67,10 @@ 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
|
||||||
|
#check checkInOut pdf print
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
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"
|
unique_code = "CheckInOutPdf"
|
||||||
printer = PrintSetting.find_by_unique_code(unique_code)
|
printer = PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ class SalePayment < ApplicationRecord
|
|||||||
self.sale = invoice
|
self.sale = invoice
|
||||||
self.received_amount = cash_amount
|
self.received_amount = cash_amount
|
||||||
self.payment_reference = remark
|
self.payment_reference = remark
|
||||||
puts action_by
|
# puts action_by
|
||||||
puts "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
# puts "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||||
self.action_by = action_by
|
self.action_by = action_by
|
||||||
#get all payment for this invoices
|
#get all payment for this invoices
|
||||||
if payment_for
|
if payment_for
|
||||||
|
|||||||
Reference in New Issue
Block a user