check sale_status for split bill

This commit is contained in:
phyusin
2018-05-04 16:52:18 +06:30
parent 6eecd2bdb7
commit ddc759926b

View File

@@ -19,7 +19,9 @@ class Origami::SplitBillController < BaseOrigamiController
table_bookings = Booking.where("dining_facility_id = #{dining_id} and sale_id IS NOT NULL")
if !table_bookings.nil?
table_bookings.each do |table_booking|
@sale_data.push(table_booking.sale)
if table_booking.sale.sale_status != 'waste' && table_booking.sale.sale_status != 'spoile'
@sale_data.push(table_booking.sale)
end
end
end