Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Aung Myo
2018-08-31 13:50:24 +06:30
11 changed files with 44 additions and 11 deletions

View File

@@ -109,9 +109,13 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
remark = params[:remark]
if params[:status] && params[:remark]
reason = status +"||"+remark
order_reservation = OrderReservation.find(order_reservation_id)
if !order_reservation.remark.nil?
reason = order_reservation.remark + "//" + status +"||"+remark
else
reason = status +"||"+remark
end
if status == 'REMOVE'
if order_reservation.status == "new" || order_reservation.status == "accepted"
OrderReservation.update_order_reservation(order_reservation_id, nil, "rejected",nil,remark)

View File

@@ -1,21 +1,27 @@
class Reports::OrderReservationController < BaseReportController
# authorize_resource :class => false
def index
@providers = [["All",''], ["Direct Delivery","direct_delivery"],["Pick-Up","pick_up"],["food2u","food2u"], ["ygndoor2door","ygndoor2door"]]
@providers = [["All",''], ["Direct Delivery","direct_delivery"],["Pick-Up","pick_up"],["TURBO","turbo"],["food2u","food2u"], ["ygndoor2door","ygndoor2door"]]
@payment_types = [["All",''], ["COD","cash_on_delivery"],["DINGA","dinga"]]
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