add bill channel for req bill
This commit is contained in:
@@ -7,8 +7,11 @@ class Api::BillController < Api::ApiController
|
||||
@error_message = "Order ID or Booking ID is require to request for a bill."
|
||||
if ShiftSale.current_shift
|
||||
#create Bill by Booking ID
|
||||
table = 0
|
||||
if (params[:booking_id])
|
||||
booking = Booking.find(params[:booking_id])
|
||||
# for Job
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
|
||||
if booking
|
||||
if booking.sale_id.nil?
|
||||
@@ -23,8 +26,14 @@ class Api::BillController < Api::ApiController
|
||||
elsif (params[:order_id])
|
||||
@sale = Sale.new
|
||||
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee, get_cashier)
|
||||
|
||||
# for Job
|
||||
booking = Booking.find_by_sale_id(@sale_id)
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
end
|
||||
Promotion.promo_activate(@sale)
|
||||
|
||||
BillBroadcastJob.perform_later(table)
|
||||
else
|
||||
@status = false
|
||||
@error_message = "No Current Open Shift"
|
||||
|
||||
Reference in New Issue
Block a user