monthly budget, monthly report, unified report calculation (#2684)

This commit is contained in:
Kevin Papst
2021-08-06 18:38:41 +02:00
committed by GitHub
parent 21f785638c
commit cefd747e91
196 changed files with 5031 additions and 2167 deletions

View File

@@ -54,6 +54,26 @@ class ProjectRepository extends EntityRepository
return $project;
}
/**
* @param int[] $projectIds
* @return Project[]
*/
public function findByIds(array $projectIds)
{
$qb = $this->createQueryBuilder('p');
$qb
->where($qb->expr()->in('p.id', ':id'))
->setParameter('id', $projectIds)
;
$projects = $qb->getQuery()->getResult();
$loader = new ProjectLoader($qb->getEntityManager());
$loader->loadResults($projects);
return $projects;
}
/**
* @param Project $project
* @throws ORMException
@@ -79,6 +99,16 @@ class ProjectRepository extends EntityRepository
return $this->count([]);
}
/**
* @deprecated since 1.15 use ProjectStatisticService::getProjectStatistics() instead - will be removed with 2.0
* @codeCoverageIgnore
*
* @param Project $project
* @param DateTime|null $begin
* @param DateTime|null $end
* @return ProjectStatistic
* @throws \Doctrine\ORM\NonUniqueResultException
*/
public function getProjectStatistics(Project $project, ?DateTime $begin = null, ?DateTime $end = null): ProjectStatistic
{
$qb = $this->getEntityManager()->createQueryBuilder();
@@ -103,7 +133,7 @@ class ProjectRepository extends EntityRepository
$stats = new ProjectStatistic();
if (null !== $timesheetResult) {
$stats->setRecordAmount($timesheetResult['amount']);
$stats->setCounter($timesheetResult['amount']);
$stats->setRecordDuration($timesheetResult['duration']);
$stats->setRecordRate($timesheetResult['rate']);
$stats->setRecordInternalRate($timesheetResult['internal_rate']);
@@ -196,6 +226,7 @@ class ProjectRepository extends EntityRepository
/**
* @deprecated since 1.1 - use getQueryBuilderForFormType() istead - will be removed with 2.0
* @codeCoverageIgnore
*/
public function builderForEntityType($project, $customer)
{