update quick service for split bill
This commit is contained in:
@@ -86,18 +86,22 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
end
|
||||
|
||||
status = false
|
||||
if shift_by_terminal = ShiftSale.current_open_shift(get_cashier[0].id)
|
||||
if !ShiftSale.current_shift.nil?
|
||||
#create Bill by Booking ID
|
||||
table = 0
|
||||
if !params[:booking_id].empty?
|
||||
booking = Booking.find(params[:booking_id])
|
||||
# for Multiple Cashier by Zone
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
if booking.dining_facility_id.to_i>0
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
else
|
||||
table = nil
|
||||
end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
|
||||
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
|
||||
get_cashier_by_terminal = Employee.find(shift_by_terminal.employee_id)
|
||||
# shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
|
||||
# get_cashier_by_terminal = Employee.find(shift_by_terminal.employee_id)
|
||||
get_cashier_by_terminal = current_user
|
||||
|
||||
if booking
|
||||
if booking.sale_id.nil?
|
||||
@@ -320,8 +324,8 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
end
|
||||
|
||||
# Bind shift sale id to sale
|
||||
sale_data.shift_sale_id = shift_by_terminal.id
|
||||
sale_data.save
|
||||
# sale_data.shift_sale_id = shift_by_terminal.id
|
||||
# sale_data.save
|
||||
|
||||
Promotion.promo_activate(sale)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user