public function denyOrder(Request $request, $order_id)
    {
        $elementIds = $request->request->get('elements', []);
        $acceptor = $this->getAuthenticatedUser();

        $elements = $this->doDenyElements($order_id, $elementIds, $acceptor);

        $success = !empty($elements);

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success'  => $success,
                'msg'      => $success
                    ? $this->app->trans('Order has been denied')
                    : $this->app->trans('An error occured while denying, please retry  or contact an admin if problem persists'),
                'order_id' => $order_id,
            ]);
        }

        return $this->app->redirectPath('prod_orders', [
            'success' => (int) $success,
            'action'  => 'send',
        ]);
    }
public function denyOrder(Request $request, $order_id)
    {
        $elementIds = $request->request->get('elements', []);
        $acceptor = $this->getAuthenticatedUser();

        $elements = $this->doDenyElements($order_id, $elementIds, $acceptor);

        $success = !empty($elements);

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success'  => $success,
                'msg'      => $success
                    ? $this->app->trans('Order has been denied')
                    : $this->app->trans('An error occured while denying, please retry  or contact an admin if problem persists'),
                'order_id' => $order_id,
            ]);
        }

        return $this->app->redirectPath('prod_orders', [
            'success' => (int) $success,
            'action'  => 'send',
        ]);
    }
public function denyOrder ( Request $ request , $ order_id ) { $ elementIds = $ request -> request -> get ( 'elements' , [ ] ) ; $ acceptor = $ this -> getAuthenticatedUser ( ) ; $ elements = $ this -> doDenyElements ( $ order_id , $ elementIds , $ acceptor ) ; $ success = ! empty ( $ elements ) ; if ( 'json' === $ request -> getRequestFormat ( ) ) { return $ this -> app -> json ( [ 'success' => $ success , 'msg' => $ success ? $ this -> app -> trans ( 'Order has been denied' ) : $ this -> app -> trans ( 'An error occured while denying, please retry  or contact an admin if problem persists' ) , 'order_id' => $ order_id , ] ) ; } return $ this -> app -> redirectPath ( 'prod_orders' , [ 'success' => ( int ) $ success , 'action' => 'send' , ] ) ; }
Deny an order

@param  Request                       $request
@param  integer                       $order_id
@return RedirectResponse|JsonResponse
Deny an order