update bill request for employee
This commit is contained in:
@@ -16,11 +16,15 @@ class Api::BillController < Api::ApiController
|
||||
|
||||
bk_order = BookingOrder.find_by_booking_id(booking.booking_id)
|
||||
order = Order.find(bk_order.order_id)
|
||||
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{cashier_zone.cashier_terminal_id}").first
|
||||
cashier = Employee.find(shift.employee_id)
|
||||
|
||||
if booking
|
||||
if booking.sale_id.nil?
|
||||
@sale = Sale.new
|
||||
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee, current_login_employee, order.source)
|
||||
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee, cashier, order.source)
|
||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
else
|
||||
@status = true
|
||||
|
||||
Reference in New Issue
Block a user