diff --git a/app/controllers/reports/order_reservation_controller.rb b/app/controllers/reports/order_reservation_controller.rb index 20eabb90..02f2478c 100644 --- a/app/controllers/reports/order_reservation_controller.rb +++ b/app/controllers/reports/order_reservation_controller.rb @@ -6,7 +6,7 @@ class Reports::OrderReservationController < BaseReportController from, to = get_date_range_from_params - @shift_sale_range = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED) + @shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED) @shift = '' if params[:shift_name].to_i != 0 diff --git a/app/views/reports/order_reservation/index.html.erb b/app/views/reports/order_reservation/index.html.erb index 0ccaef5b..4a342775 100755 --- a/app/views/reports/order_reservation/index.html.erb +++ b/app/views/reports/order_reservation/index.html.erb @@ -98,7 +98,7 @@ discount_amount = order_reservation.discount_amount delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0 convenience_charge = order_reservation.convenience_charge - if !JSON.parse(order_reservation.taxes).empty? + if !JSON.parse(order_reservation.taxes).nil? && !JSON.parse(order_reservation.taxes).empty? JSON.parse(order_reservation.taxes).each do |tax_data| if tax_data[0] == "delivery_tax" delivery_tax = tax_data[1] diff --git a/app/views/reports/order_reservation/index.xls.erb b/app/views/reports/order_reservation/index.xls.erb index 08f2c5e9..f9565356 100755 --- a/app/views/reports/order_reservation/index.xls.erb +++ b/app/views/reports/order_reservation/index.xls.erb @@ -71,7 +71,7 @@ discount_amount = order_reservation.discount_amount delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0 convenience_charge = order_reservation.convenience_charge - if !JSON.parse(order_reservation.taxes).empty? + if !JSON.parse(order_reservation.taxes).nil? && !JSON.parse(order_reservation.taxes).empty? JSON.parse(order_reservation.taxes).each do |tax_data| if tax_data[0] == "delivery_tax" delivery_tax = tax_data[1] diff --git a/app/views/reports/stock_check/index.html.erb b/app/views/reports/stock_check/index.html.erb index 2235459d..4d06363b 100755 --- a/app/views/reports/stock_check/index.html.erb +++ b/app/views/reports/stock_check/index.html.erb @@ -3,7 +3,7 @@