Adds a MarketOrder instance to the list of market orders contained
        within this order list. Does some behind-the-scenes magic to get it
        all ready for serialization.

        :param MarketOrder order: The order to add to this order list.
439446
def add_order(self, order):
        
        # This key is used to group the orders based on region.
        key = '%s_%s' % (order.region_id, order.type_id)
        if not self._orders.has_key(key):
            # We don't have any orders for this yet. Prep the region+item
            # combo by instantiating a new MarketItemsInRegionList for
            # the MarketOrders.
            self.set_empty_region(
                order.region_id,
                order.type_id,
                order.generated_at
            )

        # The MarketOrder gets stuffed into the MarketItemsInRegionList for this
        # item+region combo.
        self._orders[key].add_order(order)
1063049
def orderbook(ctx, market):
    
    market = Market(market, bitshares_instance=ctx.bitshares)
    orderbook = market.orderbook()
    ta = {}
    ta["bids"] = [["quote", "sum quote", "base", "sum base", "price"]]
    cumsumquote = Amount(0, market["quote"])
    cumsumbase = Amount(0, market["base"])
    for order in orderbook["bids"]:
        cumsumbase += order["base"]
        cumsumquote += order["quote"]
        ta["bids"].append(
            [
                str(order["quote"]),
                str(cumsumquote),
                str(order["base"]),
                str(cumsumbase),
                "{:f} {}/{}".format(
                    order["price"],
                    order["base"]["asset"]["symbol"],
                    order["quote"]["asset"]["symbol"],
                ),
            ]
        )

    ta["asks"] = [["price", "base", "sum base", "quote", "sum quote"]]
    cumsumquote = Amount(0, market["quote"])
    cumsumbase = Amount(0, market["base"])
    for order in orderbook["asks"]:
        cumsumbase += order["base"]
        cumsumquote += order["quote"]
        ta["asks"].append(
            [
                "{:f} {}/{}".format(
                    order["price"],
                    order["base"]["asset"]["symbol"],
                    order["quote"]["asset"]["symbol"],
                ),
                str(order["base"]),
                str(cumsumbase),
                str(order["quote"]),
                str(cumsumquote),
            ]
        )
    t = [["bids", "asks"]]
    t.append([format_table(ta["bids"]), format_table(ta["asks"])])
    print_table(t)
951994
public function setOrder(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
923602
private function _addOrderTotalAndSellerInformationToOrder($orderTotal)
    {
        $response
            = $this->callStepAndCheckForException(
                'addOrderTotalAndSellerInformationToOrder',
                array($orderTotal, $this->currencyCode)
            );
        
        $this->printResponseToWebpage(
            "printSetOrderReferenceDetailsResponse", array($response)
        );
    }
1270719
protected function addOrderBy()
    {
        if (static::$versionTransformer->isOrdered()) {
            foreach (static::$versionTransformer->getOrderedColumns() as $index => $direction) {
                if (isset($this->columnNames[$index])) {
                    $this->builder->orderBy(
                        $this->columnNames[$index],
                        $direction
                    );
                }
            }
        }
    }
236999
def create_order(order):
    
    SaleOrder = client.model('sale.sale')
    SaleOrderLine = client.model('sale.line')

    # Check if customer exists, if not create one
    customer_id = get_customer(order['customer']['code'])
    if not customer_id:
        customer_id = create_customer(
            order['customer']['name'],
            order['customer']['email'],
            order['customer']['phone'],
        )

    # No check if there is a matching address
    invoice_address = get_address(
        customer_id,
        order['invoice_address']
    )
    if not invoice_address:
        invoice_address = create_address(
            customer_id,
            order['invoice_address']
        )

    # See if the shipping address exists, if not create it
    shipment_address = get_address(
        customer_id,
        order['shipment_address']
    )
    if not shipment_address:
        shipment_address = create_address(
            customer_id,
            order['shipment_address']
        )

    sale_order_id, = SaleOrder.create([{
        'reference': order['number'],
        'sale_date': order['date'],
        'party': customer_id,
        'invoice_address': invoice_address,
        'shipment_address': shipment_address,
    }])

    # fetch inventory of all the products before we create lines
    warehouses = get_warehouses()
    warehouse_ids = [warehouse['id'] for warehouse in warehouses]

    lines = []
    for item in order['items']:
        # get the product. We assume ti already exists.
        product = get_product(item['product'])

        # find the first location that has inventory
        product_inventory = get_product_inventory(product, warehouse_ids)
        for location, quantities in product_inventory.items():
            if quantities['quantity_available'] >= item['quantity']:
                break

        lines.append({
            'sale': sale_order_id,
            'product': product,
            'quantity': item['quantity'],
            'unit_price': item['unit_price'],
            'warehouse': location,
        })

    SaleOrderLine.create(lines)

    SaleOrder.quote([sale_order_id])
    SaleOrder.confirm([sale_order_id])
1304056
protected function addOrder()
    {
        if (!isset($this->params['order_number'])) {
            throw new ShopgateLibraryException(ShopgateLibraryException::PLUGIN_API_NO_ORDER_NUMBER);
        }
        /** @var ShopgateOrder[] $orders */
        $orders = $this->merchantApi->getOrders(
            array(
                'order_numbers[0]' => $this->params['order_number'],
                'with_items'       => 1,
            )
        )->getData();
        if (empty($orders)) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                '"orders" not set or empty. Response: ' . var_export($orders, true)
            );
        }
        if (count($orders) > 1) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                'more than one order in response. Response: ' . var_export($orders, true)
            );
        }

        if (empty($this->response)) {
            $this->response = new ShopgatePluginApiResponseAppJson($this->trace_id);
        }

        $orderData = $this->plugin->addOrder($orders[0]);
        if (is_array($orderData)) {
            $this->responseData = $orderData;
        } else {
            $this->responseData['external_order_id']     = $orderData;
            $this->responseData['external_order_number'] = null;
        }
    }
688781
public SqlQuery addOrder(final List<Order> orders) {
    if (null != orders) {
      this.orders.addAll(orders);
    }
    return this;
  }
729583
public function addOrder(Order $order)
    {
        if (count($this->orders)+1 >= self::MAX_NUM_ORDERS)
        {
            throw new Exception('Cannot have more than '.self::MAX_NUM_ORDERS.' Orders in a single Order Collection');
        }

        $this->orders[] = $order;
        $order->setCollection($this);
    }
949394
public void placeMFOrder(KiteConnect kiteConnect) throws KiteException, IOException {
        System.out.println("place order: "+ kiteConnect.placeMFOrder("INF174K01LS2", Constants.TRANSACTION_TYPE_BUY, 5000, 0, "myTag").orderId);
    }
644801
private static void addOrder(PersistentEntity entity,
                                 CriteriaQuery query,
                                 From queryRoot,
                                 CriteriaBuilder criteriaBuilder,
                                 String sort, String order, boolean ignoreCase) {
        if (sort.equalsIgnoreCase(entity.getIdentity().getName())) {
            Expression path = queryRoot;

            if (ignoreCase) {
                path = criteriaBuilder.upper(path);
            }
            if (DynamicFinder.ORDER_DESC.equals(order)) {
                query.orderBy(criteriaBuilder.desc(path));
            } else {
                query.orderBy(criteriaBuilder.asc(path));
            }
        } else {
            Expression path = queryRoot.get(sort);

            if (ignoreCase) {
                path = criteriaBuilder.upper(path);
            }
            if (DynamicFinder.ORDER_DESC.equals(order)) {
                query.orderBy(criteriaBuilder.desc(path));
            } else {
                query.orderBy(criteriaBuilder.asc(path));
            }
        }
    }
1366294
public static com.liferay.commerce.model.CommerceOrderPayment addCommerceOrderPayment(
		com.liferay.commerce.model.CommerceOrderPayment commerceOrderPayment) {
		return getService().addCommerceOrderPayment(commerceOrderPayment);
	}
1044273
def __place_order(self, token):
        
        order_id = 0
        response = None

        if not token or token['value'] == '':
            raise LendingClubError('The token parameter is False, None or unknown.')

        # Process order confirmation page
        try:
            # Place the order
            payload = {}
            if token:
                payload['struts.token.name'] = token['name']
                payload[token['name']] = token['value']
            response = self.lc.session.post('/portfolio/orderConfirmed.action', data=payload)

            # Process HTML for the order ID
            html = response.text
            soup = BeautifulSoup(html, 'html5lib')

            # Order num
            order_field = soup.find(id='order_id')
            if order_field:
                order_id = int(order_field['value'])

            # Did not find an ID
            if order_id == 0:
                self.__log('An investment order was submitted, but a confirmation ID could not be determined')
                raise LendingClubError('No order ID was found when placing the order.', response)
            else:
                return order_id

        except Exception as e:
            raise LendingClubError('Could not place the order: {0}'.format(str(e)), response)
1001998
public Orderer newOrderer(String name, String grpcURL) throws InvalidArgumentException {
        clientCheck();
        return newOrderer(name, grpcURL, null);
    }
1289059
public void addOrderBy(String fieldName, boolean sortAscending)
    {
        if (fieldName != null)
        {
            m_orderby.add(new FieldHelper(fieldName, sortAscending));
        }
    }
425113
public function addOrderBy(string $orderBy, string $order)
    {
        if ($this->sql['orderby'] === null) {
            $this->sql['orderby'] = " ORDER BY ".$orderBy." ".$order." ";
        } else {
            $this->sql['orderby'] .= " , ".$orderBy." ".$order." ";
        }
    }
4965
public function setOrder($order_field, $order_type)
    {
        $this->order_field = $order_field;
        $this->order_type  = $order_type;
        $this->queryBuilder->orderBy($order_field, $order_type);
        return $this;
    }