added hourly and money budgets to activity, project and customer (#843)

This commit is contained in:
Kevin Papst
2019-06-11 13:18:57 +02:00
committed by GitHub
parent 833968a87d
commit 5702d7afa8
118 changed files with 1743 additions and 1077 deletions

View File

@@ -53,12 +53,12 @@ class CustomerRepository extends AbstractRepository
public function getCustomerStatistics(Customer $customer)
{
$stats = new CustomerStatistic();
$stats->setCount(1);
$qb = $this->getEntityManager()->createQueryBuilder();
$qb
->addSelect('COUNT(t.id) as recordAmount')
->addSelect('SUM(t.duration) as recordDuration')
->addSelect('SUM(t.rate) as recordRate')
->from(Timesheet::class, 't')
->join(Project::class, 'p', Query\Expr\Join::WITH, 't.project = p.id')
->andWhere('p.customer = :customer')
@@ -68,6 +68,7 @@ class CustomerRepository extends AbstractRepository
if (isset($timesheetResult[0])) {
$stats->setRecordAmount($timesheetResult[0]['recordAmount']);
$stats->setRecordDuration($timesheetResult[0]['recordDuration']);
$stats->setRecordRate($timesheetResult[0]['recordRate']);
}
$qb = $this->getEntityManager()->createQueryBuilder();