check shift

This commit is contained in:
phyusin
2018-08-03 09:48:35 +06:30
parent a5efbe9af7
commit b1d0bf8daa

View File

@@ -82,7 +82,7 @@ class Sale < ApplicationRecord
self.tax_type = "exclusive"
# set cashier
if order_source = "emenu"
if order_source.downcase == "emenu"
table = DiningFacility.find(booking.dining_facility_id)
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{cashier_zone.cashier_terminal_id}").first