Returns the order total.

@param OrderInterface $order
@param bool           $ati

@return float
320226
public function getOrderTotal(OrderInterface $order, $ati = false)
    {
        return $this->calculator->calculateOrderTotal($order, $ati);
    }
750634
public function addOrderBy($sort, $order = null)
    {
        return $this->add('orderBy', $sort . ' ' . (! $order ? 'ASC' : $order), true);
    }
802171
public function countByOrderId($orderId, $statusIds = array(), $comparator = "=")
    {
        return $this->getShippingRepository()->countByOrderId($orderId, $statusIds, $comparator);
    }
1193724
public function total($format = true, $withDiscount = true, $withTax = true, $withFees = true)
    {
        $total = $this->subTotal(false);

        if ($withFees) {
            $total += $this->feeTotals(false);
        }

        if ($withDiscount) {
            $total -= $this->totalDiscount(false, false);
        }

        if ($withTax) {
            $total += $this->taxTotal(false, $withFees, false);
        }

        return $this->formatMoney($total, null, null, $format);
    }
385165
public function fetchAll($order=array()) {
		$obj = $this->getConnection();
        if (empty($order) == false) {
            foreach ($order as $key => $value) {
                $obj->orderBy($key, $value);
            }
        }
        return $obj->get($this->getDao()->getTableName());
	}
99642
protected function compareOrderToParams(OrderInterface $order, array $params)
    {
        return $order->getReference() === $params['orderID']
            && $order->getCurrency() === $params['currency']
            && (float) ($order->getTotalInc()) === (float) ($params['amount']);
    }
1042846
public function orderBy($order = null) {
		if (is_null($order)) //remove option
			return $this->discard('query.orderBy');
			
		return $this->merge(['query.orderBy' => func_get_args()]);
	}
269553
private function resolvePaymentsState(OrderInterface $order)
    {
        $capturedTotal = $authorizedTotal = $refundTotal = $failedTotal = 0;

        $payments = $order->getPayments();
        if (0 < $payments->count()) {
            // Gather state amounts
            foreach ($payments as $payment) {
                if ($payment->getState() == PaymentStates::STATE_CAPTURED) {
                    $capturedTotal += $payment->getAmount();
                } else if ($payment->getState() == PaymentStates::STATE_AUTHORIZED) {
                    $authorizedTotal += $payment->getAmount();
                } else if ($payment->getState() == PaymentStates::STATE_REFUNDED) {
                    $refundTotal += $payment->getAmount();
                } else if ($payment->getState() == PaymentStates::STATE_FAILED) {
                    $failedTotal += $payment->getAmount();
                }
            }

            // State by amounts
            if ($capturedTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_CAPTURED;
            } elseif ($authorizedTotal + $capturedTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_AUTHORIZED;
            } elseif ($refundTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_REFUNDED;
            } elseif ($failedTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_FAILED;
            }

            // Check for offline pending payment
            foreach ($payments as $payment) {
                if (in_array($payment->getState(), [PaymentStates::STATE_PENDING, PaymentStates::STATE_PENDING])
                    && $payment->getMethod()->getFactoryName() === 'offline') {
                    return PaymentStates::STATE_PENDING;
                }
            }
        }

        return PaymentStates::STATE_NEW;
    }
34333
public function getOrderNumber() : ?int 
    {
        if ( ! $this->hasOrderNumber()) {
            $this->setOrderNumber($this->getDefaultOrderNumber());
        }
        return $this->orderNumber;
    }
1370374
public function supports(OrderInterface $order, ZoneInterface $zone): bool
    {
        $channel = $order->getChannel();

        /** @var ChannelInterface $channel */
        Assert::isInstanceOf($channel, ChannelInterface::class);

        return $channel->getTaxCalculationStrategy() === $this->type;
    }
1088423
public function getTotal()
    {
        $query = $this->getQuery()->select('COUNT(*) as total');

        $rows = $this->database->query($query, $this->database->getBinds());

        if (!isset($rows[0]['total'])) {
            return 0;
        }

        return $rows[0]['total'];
    }
1248004
public function pickAction(Order $order)
    {
        $order->pickBySeller();

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

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
263244
public function generateUrlCheck(OrderInterface $order)
    {
        if (!$order->getCreatedAt() instanceof \DateTime) {
            throw new \RuntimeException(sprintf('The order must have a creation date - id:%s, reference:%s ', $order->getId(), $order->getReference()));
        }

        return sha1(
            $order->getReference().
            $order->getCreatedAt()->format('m/d/Y:G:i:s').
            $order->getId().
            $this->getOption('shop_secret_key')
        );
    }
306167
public function countByOrderId($orderId, $statusIds = array(), $comparator = "=")
    {
        try {
            $qb = $this->createQueryBuilder('shipping')
                ->select('count(shipping.id)')
                ->join('shipping.order', 'o')
                ->join('shipping.status', 'status')
                ->where('o.id = :orderId')
                ->groupBy('o.id')
                ->setParameter('orderId', $orderId);
            foreach ($statusIds as $statusId) {
                $qb->andWhere('status.id ' . $comparator . ' :excludeStatus');
                $qb->setParameter('excludeStatus', $statusId);
            }

            return $qb->getQuery()->getSingleScalarResult();
        } catch (NoResultException $nre) {
            return 0;
        }
    }
1109921
public function getTotal($handler_id, array $arguments = array())
    {
        try {
            $handlers = $this->getHandlers();
            return (int) Handler::call($handlers, $handler_id, 'total', array($arguments));
        } catch (Exception $ex) {
            return 0;
        }
    }
954593
public function getFor(Order $order, $shipmentId, array $parameters = [])
    {
        return $this->getForId($order->id, $shipmentId, $parameters);
    }
207787
public function addOrderBy($sort, $order = null)
    {
        if (false !== strpos($sort, '.')) {
            return parent::addOrderBy($sort, $order);
        }

        if (true === in_array($sort, self::$joinCriteria)) {
            $sort = $this->getSectionAlias().'.'.$sort;
        } elseif (0 !== strpos($this->getAlias().'.', $sort)) {
            $sort = $this->getAlias().'.'.$sort;
        }

        return parent::addOrderBy($sort, $order);
    }