fix bugs and improvement
This commit is contained in:
@@ -28,7 +28,7 @@ class ShiftSale < ApplicationRecord
|
||||
#find open shift where is open today and is not closed and login by current cashier
|
||||
#DATE(shift_started_at)=? and
|
||||
today_date = DateTime.now.strftime("%Y-%m-%d")
|
||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take
|
||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and employee_id = ?", current_user).take
|
||||
return shift
|
||||
#end
|
||||
end
|
||||
@@ -132,7 +132,7 @@ class ShiftSale < ApplicationRecord
|
||||
self.commercial_taxes = self.commercial_taxes.to_f - tax.to_f
|
||||
self.total_rounding = self.total_rounding - saleobj.rounding_adjustment
|
||||
self.total_void = self.total_void + saleobj.grand_total
|
||||
|
||||
|
||||
if saleobj.customer.customer_type == "Dinein"
|
||||
self.dining_count = self.dining_count - 1
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user