update taday list and addorder

This commit is contained in:
Aung Myo
2018-02-22 18:48:59 +06:30
parent 0e70f3b763
commit c7b77aebfa
9 changed files with 191 additions and 30 deletions

View File

@@ -92,7 +92,12 @@ class Sale < ApplicationRecord
self.cashier_id = open_cashier[0].id
self.cashier_name = open_cashier[0].name
shift_id = ShiftSale.current_open_shift(open_cashier[0].id)
self.shift_sale_id = shift_id.id
if shift_id
self.shift_sale_id = shift_id.id
else
self.shift_sale_id = current_shift.id
end
else
self.cashier_id = current_shift.employee_id
self.cashier_name = Employee.find(current_shift.employee_id).name