change query for report
This commit is contained in:
@@ -24,6 +24,8 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
|
||||
delivery_type = "DELIVERY";
|
||||
}else if(value.provider == "pick_up"){
|
||||
delivery_type = "PICK-UP";
|
||||
}else if(value.provider == "turbo"){
|
||||
delivery_type = "TURBO";
|
||||
}else{
|
||||
delivery_type = "DIRECT DELIVERY";
|
||||
}
|
||||
|
||||
@@ -6,16 +6,22 @@ class Reports::OrderReservationController < BaseReportController
|
||||
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@shift_sale_range = ''
|
||||
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at)
|
||||
else
|
||||
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
|
||||
if shift_sale.shift_closed_at.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',shift_sale.shift_started_at)
|
||||
else
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -252,6 +252,8 @@
|
||||
provider = "Pick-Up"
|
||||
elsif @delivery.provider == 'direct_delivery'
|
||||
provider = "Direct Delivery"
|
||||
elsif @delivery.provider == 'turbo'
|
||||
provider = "TURBO"
|
||||
else
|
||||
provider = @delivery.provider
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user