public function getTotalBetweenDates($dates)
    {
        $date1 = new \DateTime($dates['date1']);
        $date2 = new \DateTime($dates['date2']);

        $qb = $this->getQueryBuilder()
            ->select('SUM(i.totalPrice)')
            ->innerJoin('t.items', 'i')
            ->where('t.status = :status')
            ->andWhere('t.created BETWEEN :date1 AND :date2')
            ->setParameter('status', Transaction::STATUS_PAID)
            ->setParameter('date1', $date1)
            ->setParameter('date2', $date2);

        return $qb->getQuery()
            ->getSingleScalarResult();
    }