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