shop code

This commit is contained in:
Nweni
2019-12-04 10:49:46 +06:30
18 changed files with 108 additions and 120 deletions

View File

@@ -17,9 +17,9 @@ class ShiftSale < ApplicationRecord
belongs_to :employee, :foreign_key => 'employee_id'
has_many :sales
def self.current_shift(shop_code)
def self.current_shift
# today_date = DateTime.now.strftime("%Y-%m-%d")
shift = ShiftSale.where("shop_code='#{shop_code}' and shift_started_at is not null and shift_closed_at is null").first
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null").first
return shift
end