From 8f5ea9417dd446e577f84c31db8e1fd9eaa152cf Mon Sep 17 00:00:00 2001 From: Thein Lin Kyaw Date: Sat, 30 May 2020 15:43:05 +0630 Subject: [PATCH] fix bug update_shift --- app/models/sale_payment.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 06c8cefb..9db6f78d 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -699,7 +699,8 @@ class SalePayment < ApplicationRecord # update for cashier shift def update_shift - shift = ShiftSale.current_open_shift(self.action_by.id) + current_shift_user = Employee.find_by_id(self.action_by.id) + shift = ShiftSale.current_open_shift(current_shift_user) if shift.nil? current_shift_user = Employee.find_by_id(self.sale.cashier_id)