Bridge/Doctrine/ORM/Repository/SupplierOrderRepository.php
private function getExpiredDueQueryBuilder($prefix)
    {
        $qb = $this->createQueryBuilder();
        $as = $this->getAlias();
        $ex = $qb->expr();

        return $qb
            ->andWhere($ex->gt($as . '.' . $prefix . 'Total', 0))
            ->andWhere($ex->isNull($as . '.' . $prefix . 'Date'))
            ->andWhere($ex->andX(
                $ex->isNotNull($as . '.' . $prefix . 'DueDate'),
                $ex->lt($as . '.' . $prefix . 'DueDate', ':today')
            ))
            ->setParameter('today', (new \DateTime())->setTime(0, 0, 0), Type::DATETIME);
    }
private function getExpiredDueQueryBuilder($prefix)
    {
        $qb = $this->createQueryBuilder();
        $as = $this->getAlias();
        $ex = $qb->expr();

        return $qb
            ->andWhere($ex->gt($as . '.' . $prefix . 'Total', 0))
            ->andWhere($ex->isNull($as . '.' . $prefix . 'Date'))
            ->andWhere($ex->andX(
                $ex->isNotNull($as . '.' . $prefix . 'DueDate'),
                $ex->lt($as . '.' . $prefix . 'DueDate', ':today')
            ))
            ->setParameter('today', (new \DateTime())->setTime(0, 0, 0), Type::DATETIME);
    }
Returns the expired due total.

@param string $prefix

@return \Doctrine\ORM\QueryBuilder