update request bill
This commit is contained in:
@@ -79,6 +79,7 @@ class Sale < ApplicationRecord
|
||||
|
||||
# set cashier
|
||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
current_shift = ShiftSale.current_shift
|
||||
shift = ShiftSale.current_open_shift(cashier.id)
|
||||
|
||||
# set cashier
|
||||
@@ -90,11 +91,11 @@ class Sale < ApplicationRecord
|
||||
if open_cashier.nil?
|
||||
self.cashier_id = requested_by.id
|
||||
self.cashier_name = requested_by.name
|
||||
self.shift_sale_id = open_cashier[0].id
|
||||
self.shift_sale_id = current_shift.id
|
||||
else
|
||||
self.cashier_id = open_cashier[0].id
|
||||
self.cashier_name = open_cashier[0].name
|
||||
self.shift_sale_id = open_cashier[0].id
|
||||
self.cashier_id = current_shift.employee_id
|
||||
self.cashier_name = Employee.find(current_shift.employee_id).name
|
||||
self.shift_sale_id = current_shift.id
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user