Fix bugs and improvements

fix payment outstanding with amount <= 0
fix payment outstanding with other payments
This commit is contained in:
Thein Lin Kyaw
2019-12-18 15:41:18 +06:30
parent e6392c3bd4
commit 92e467d512
11 changed files with 122 additions and 217 deletions

View File

@@ -19,7 +19,7 @@ class ShiftSale < ApplicationRecord
def self.current_shift
# today_date = DateTime.now.strftime("%Y-%m-%d")
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null").first
shift = ShiftSale.where.not(shift_started_at: nil).where(shift_closed_at: nil).first
return shift
end