check shift open or not
This commit is contained in:
@@ -63,7 +63,7 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
|
|||||||
order_reservation = params
|
order_reservation = params
|
||||||
order_reservation_id, flag = OrderReservation.addOrderReservationInfo(order_reservation)
|
order_reservation_id, flag = OrderReservation.addOrderReservationInfo(order_reservation)
|
||||||
|
|
||||||
if flag #&& ENV["SERVER_MODE"] != 'cloud'
|
if flag
|
||||||
shop = Shop.find_by_id(1)
|
shop = Shop.find_by_id(1)
|
||||||
if !shop.shop_code.nil?
|
if !shop.shop_code.nil?
|
||||||
shop_code = shop.shop_code
|
shop_code = shop.shop_code
|
||||||
|
|||||||
@@ -48,8 +48,16 @@ class Origami::OrderReservationController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def send_status
|
def send_status
|
||||||
|
order_reservation = OrderReservation.find_by_transaction_ref(params[:ref_no])
|
||||||
|
if !order_reservation.nil?
|
||||||
|
if !ShiftSale.current_shift.nil? || params[:status] == 'accepted' || (order_reservation.status == 'new' && params[:status] == 'rejected')
|
||||||
response = OrderReservation.send_status_to_ordering(params[:url],params[:ref_no],params[:status],params[:waiting_time],params[:min_type],params[:reason])
|
response = OrderReservation.send_status_to_ordering(params[:url],params[:ref_no],params[:status],params[:waiting_time],params[:min_type],params[:reason])
|
||||||
|
else
|
||||||
|
response = { status: false, message: 'No current shift open for this employee!'}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
response = { status: false, message: 'There is no order for '+params[:ref_no]+'!'}
|
||||||
|
end
|
||||||
render :json => response
|
render :json => response
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user