Request open orders - loads up orders that wasn't created using this session
491678
def requestOpenOrders(self, all_clients=False):
        
        if all_clients:
            self.ibConn.reqAllOpenOrders()
        self.ibConn.reqOpenOrders()
873562
def openTrades(self) -> List[Trade]:
        
        return [v for v in self.wrapper.trades.values()
                if v.orderStatus.status not in OrderStatus.DoneStates]
1130581
def query_order(self, status=None, begintime=None, endtime=None):
        
        return self._post(
            'merchant/order/getbyfilter',
            data={
                'status': status,
                'begintime': begintime,
                'endtime': endtime
            }
        )
833513
def populate_items(self, request):
        ''''''
        self._items = self.get_items(request)
        return self.items
848277
private function loadOrderQuery(): OrderVisitor
    {
        $logger = $this->getLogger();
        $query = new OrderQueryRequest();

        if ($wheres = $this->getDefaultWhere()) {
            $logger->debug('Added where-clause to fech orders.', ['predicates' => $wheres]);

            array_walk($wheres, function (string $where) use ($logger, $query) {
                $query->where($where);
            });
        } else {
            $logger->debug('No where-clause to fetch orders.');
        }

        $this->setOrderQuery($query);

        return $this;
    }
211725
def openOrders(self) -> List[Order]:
        
        return [trade.order for trade in self.wrapper.trades.values()
                if trade.orderStatus.status not in OrderStatus.DoneStates]
602102
function after_process() {
    global $insert_id, $db;
    $sql = "insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )";
    $sql = $db->bindVars($sql, ':orderComments', 'eCheck payment.  AUTH: ' . $this->auth_code . '. TransID: ' . $this->transaction_id . '.', 'string');
    $sql = $db->bindVars($sql, ':orderID', $insert_id, 'integer');
    $sql = $db->bindVars($sql, ':orderStatus', $this->order_status, 'integer');
    $db->Execute($sql);
    return false;
  }
306686
def make_request!(pickup_location, options, notes = '')
      resp = request_item_request(pickup_location, options, notes)

      number = extract_request_number(resp)

      if number.nil?
        raise BorrowDirect::Error.new("Can not request for: #{options.inspect}: #{resp.inspect}")
      end

      return number
    end
1051072
def _request_bulk(self, urls: List[str]) -> List:
        """"""
        if not urls:
            raise Exception("No results were found")
        session: FuturesSession = FuturesSession(max_workers=len(urls))
        self.log.info("Bulk requesting: %d" % len(urls))
        futures = [session.get(u, headers=gen_headers(), timeout=3) for u in urls]
        done, incomplete = wait(futures)
        results: List = list()
        for response in done:
            try:
                results.append(response.result())
            except Exception as err:
                self.log.warn("Failed result: %s" % err)
        return results
569698
def get_checkout_orders(self, checkout_id, **params):
        """"""
        response = self._get('v2', 'checkouts', checkout_id, 'orders', params=params)
        return self._make_api_object(response, Order)
222620
def batchcancel_openOrders(self, acc_id, symbol=None, side=None, size=None, _async=False):
        

        params = {}
        path = '/v1/order/batchCancelOpenOrders'
        params['account-id'] = acc_id
        if symbol:
            params['symbol'] = symbol
        if side:
            assert side in ['buy', 'sell']
            params['side'] = side
        if size:
            params['size'] = size

        return api_key_get(params, path, _async=_async)
568467
def fetch(self, order_id, data={}, **kwargs):
        "
        return super(Order, self).fetch(order_id, data, **kwargs)
524310
def QA_SU_save_order(orderlist, client=DATABASE):
    
    if isinstance(orderlist, pd.DataFrame):

        collection = client.order
        collection.create_index(
            [('account_cookie',
              ASCENDING),
             ('realorder_id',
              ASCENDING)],
            unique=True
        )
        try:

            orderlist = QA_util_to_json_from_pandas(orderlist.reset_index())

            for item in orderlist:
                if item:
                    #item['date']= QA_util_get_order_day()
                    collection.update_one(
                        {
                            'account_cookie': item.get('account_cookie'),
                            'realorder_id': item.get('realorder_id')
                        },
                        {'$set': item},
                        upsert=True
                    )
        except Exception as e:
            print(e)
            pass
844236
def create_order(self, **params):
        """"""
        for required in ['amount', 'currency', 'name']:
            if required not in params:
                raise ValueError("Missing required parameter: %s" % required)
        response = self._post('v2', 'orders', data=params)
        return self._make_api_object(response, Order)
1002756
private function loadItemCounts()
    {
        $storeId     = $this->getStoreId();
        $requestName = $this->searchRequestName;

        $searchRequest = $this->requestBuilder->create(
            $storeId,
            $requestName,
            0,
            0,
            $this->query,
            [],
            $this->filters,
            $this->queryFilters
        );

        $searchResponse = $this->searchEngine->search($searchRequest);

        $this->_totalRecords = $searchResponse->count();
    }
1259752
def batchcancel_order(self, order_ids: list):
        
        assert isinstance(order_ids, list)
        params = {'order-ids': order_ids}
        path = f'/v1/order/orders/batchcancel'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_post(params, path))

            return handle

        return _wrapper
1179902
def queryset(self, request):
        """"""
        query_set = self.model._default_manager.all_with_deleted()
        ordering = self.ordering or ()
        if ordering:
            query_set = query_set.order_by(*ordering)
        return query_set