From ddc759926b346951d0a61dd3db5ec08092ff7efa Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 4 May 2018 16:52:18 +0630 Subject: [PATCH] check sale_status for split bill --- app/controllers/origami/split_bill_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/origami/split_bill_controller.rb b/app/controllers/origami/split_bill_controller.rb index 5f074bb5..2d2ca4fb 100755 --- a/app/controllers/origami/split_bill_controller.rb +++ b/app/controllers/origami/split_bill_controller.rb @@ -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