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

@@ -39,7 +39,7 @@ class CustomerRepository extends EntityRepository
* @param null $lockVersion
* @return Customer|null
*/
public function find($id, $lockMode = null, $lockVersion = null)
public function find($id, $lockMode = null, $lockVersion = null): ?Customer
{
/** @var Customer|null $customer */
$customer = parent::find($id, $lockMode, $lockVersion);
@@ -56,28 +56,31 @@ class CustomerRepository extends EntityRepository
/**
* @param Customer $customer
* @throws ORMException
* @throws \Doctrine\ORM\OptimisticLockException
*/
public function saveCustomer(Customer $customer)
public function saveCustomer(Customer $customer): void
{
$entityManager = $this->getEntityManager();
$entityManager->persist($customer);
$entityManager->flush();
}
/**
* @param null|bool $visible
* @return int
*/
public function countCustomer($visible = null)
public function countCustomer(bool $visible = false): int
{
if (null !== $visible) {
if ($visible) {
return $this->count(['visible' => (bool) $visible]);
}
return $this->count([]);
}
/**
* @deprecated since 1.15 use CustomerStatisticService::getCustomerStatistics() instead - will be removed with 2.0
* @codeCoverageIgnore
*
* @param Customer $customer
* @return CustomerStatistic
* @throws \Doctrine\ORM\NonUniqueResultException
*/
public function getCustomerStatistics(Customer $customer): CustomerStatistic
{
$stats = new CustomerStatistic();
@@ -114,7 +117,7 @@ class CustomerRepository extends EntityRepository
$stats->setRecordAmountBillable($resultRow['amount']);
}
}
$stats->setRecordAmount($amount);
$stats->setCounter($amount);
$stats->setRecordDuration($duration);
$stats->setRecordRate($rate);
$stats->setRecordInternalRate($rateInternal);
@@ -189,6 +192,7 @@ class CustomerRepository extends EntityRepository
/**
* @deprecated since 1.1 - use getQueryBuilderForFormType() instead - will be removed with 2.0
* @codeCoverageIgnore
*/
public function builderForEntityType($customer)
{