From b1d0bf8daa5a9c056481fd567da771e65cfceb68 Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 3 Aug 2018 09:48:35 +0630 Subject: [PATCH] check shift --- app/models/sale.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 779e5f91..1f2d591a 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -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