Show the form for creating a new resource.

@param Order $order
@return Response
180158
public function create(Order $order)
    {
        $user = Auth::user();
        // 직접 입력은 무통장입금만 가능
        $paymentMethodId = DirectBank::getId();
        $paymentGatewayId = (new DirectPayGateway)->getId();
        // 미결상태면
        $isWaitingPayment = $order->status_id < OrderStatus::PENDING;
        return view('order::admin.transactions.create', compact('order', 'user', 'paymentMethodId', 'paymentGatewayId', 'isWaitingPayment'));
    }
1112359
public function releaseAction(Order $order)
    {
        $order->releaseToBuyer();

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
95152
public function updateItemStatus(Order $order, Request $request)
    {
        $order->items->where('id', $request->item_id)->first()->update(['status_id' => $request->status_id]);

        return response()->json([
            'errors' => false,
            'message' => trans('core::core.messages.resource updated', ['name' => trans('order::orders.form.status')]),
            'data' => $order,
        ]);
    }
757503
public function updateStatus(Order $order, Request $request)
    {
        $order->status_id = $request->status_id;
        $order->save();

        return response()->json([
            'errors' => false,
            'message' => trans('core::core.messages.resource updated', ['name' => trans('order::orders.title.orders')]),
            'data' => $order,
        ]);
    }
216289
private function generateInvoice($order)
    {
        // create and persist the invoice entity
        $invoice = $this->orderInvoiceManager->generateDebitInvoice($order);

        // write invoice contents (pdf) in a temporary file
        $temp_file = sys_get_temp_dir() . '/librinfo_invoice_' . $invoice->getNumber() . '.pdf';
        if (file_exists($temp_file)) {
            unlink($temp_file);
        }
        file_put_contents($temp_file, $invoice->getFile());

        return $temp_file;
    }
295363
public function close(Order &$order)
    {
        $data = $order->exportData();
        $endpoint= '/admin/orders/'.$order->id.'/close.json';
        $response = $this->request($endpoint, 'POST');
        $order->setData($response['order']);
    }
364056
public function create($name, $parentId, $order = null, $partyId = null)
    {
        $params = [
            'name'     => $name,
            'parentid' => $parentId,
            'order'    => $order,
            'id'       => $partyId,
        ];

        return $this->parseJSON('json', [self::API_CREATE, $params]);
    }
308989
def create_order(self, order_deets):
        """"""
        request = self._post('transactions/orders', order_deets)
        return self.responder(request)
87289
public function createOrder(Request $request)
    {
        $records = RecordsRequest::fromRequest($this->app, $request, true, [\ACL::CANCMD]);

        try {
            if ($records->isEmpty()) {
                throw new OrderControllerException($this->app->trans('There is no record eligible for an order'));
            }

            if (null !== $deadLine = $request->request->get('deadline')) {
                $deadLine = new \DateTime($deadLine);
            }

            $orderUsage = $request->request->get('use', '');

            $order = new Order();
            $order->setUser($this->getAuthenticatedUser());
            $order->setDeadline($deadLine);
            $order->setOrderUsage($orderUsage);

            $filler = new OrderFiller($this->app['repo.collection-references'], $this->getEntityManager());

            try {
                $filler->assertAllRecordsHaveOrderMaster($records);
            } catch (\RuntimeException $exception) {
                throw new OrderControllerException($this->app->trans('There is no one to validate orders, please contact an administrator'));
            }

            $filler->fillOrder($order, $records);

            $this->dispatch(PhraseaEvents::ORDER_CREATE, new OrderEvent($order));

            $success = true;
            $msg = $this->app->trans('The records have been properly ordered');
        } catch (OrderControllerException $exception) {
            $success = false;
            $msg = $exception->getMessage();
        } catch (\Exception $exception) {
            $success = false;
            $msg = $this->app->trans('An error occurred');
        }

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success' => $success,
                'msg'     => $msg,
            ]);
        }

        return $this->app->redirectPath('prod_orders', [
            'success' => (int) $success,
            'action'  => 'send',
        ]);
    }
383028
public function orderBy(string $sort, string $order = 'ASC'): self
    {
        $order = 'ASC' === strtoupper($order) ? 'ASC' : 'DESC';
        $this->orderBy = [$sort => $order];
        return $this;
    }
1026617
public function show(Order $order)
    {
        Shop::instance($order->shop_id);
        $paymentMethods = Shop::getPaymentMethods()->flatten()->mapWithKeys(function($method) {
            return [$method::getId() => $method::getName()];
        })->all();
        $orderStatuses = $this->orderstatus->all()->pluck('name', 'id')->toArray();

        return view('order::admin.orders.view', compact('order', 'paymentMethods', 'orderStatuses'));
    }
793328
protected function prepareOrder(array &$order)
    {
        $this->setItemTotalFormatted($order, $this->price);
        $this->setItemTotalFormattedNumber($order, $this->price);
    }
706349
public function order($order = null) {
		if ($order) {
			$this->_config['order'] = $order;
			return $this;
		}
		return $this->_config['order'];
	}
669376
public function create($orderIncrementId, $itemsQty = null, $comment = null, $email = null, $includeComment = null)
    {
        return $this->__createAction('order_shipment.create', func_get_args());
    }
129128
public function createdToCustomer($order)
    {
        $store = $this->store->get($order['store_id']);
        $url = $this->store->getUrl($store);
        $user = $this->user->get($order['user_id']);
        $store_name = $this->store->getTranslation('title', $this->translation->getLangcode(), $store);

        $options = $this->store->getConfig(null, $store);
        $options['from'] = reset($store['data']['email']);

        $vars = array(
            '@store' => $store_name,
            '@order_id' => $order['order_id'],
            '@order' => "$url/account/{$order['user_id']}",
            '@status' => $this->order->getStatusName($order['status']),
        );

        $subject = $this->translation->text('Order #@order_id on @store', $vars);
        $message = $this->translation->text("Thank you for ordering on @store\r\n\r\nOrder ID: @order_id\r\nOrder status: @status\r\nView orders: @order", $vars);
        $message .= $this->getSignature($options);

        return array($user['email'], $subject, $message, $options);
    }
1347770
private function createCreateForm(ProductOrderItem $entity)
    {
        $form = $this->createForm(new ProductOrderItemType(), $entity, array(
            'action' => $this->generateUrl('admin_orderitem_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
1079018
public function mark_ready_for_dispatchAction(Order $order)
    {
        $order->markReadyForDispatchBySeller();

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }