added invoice calculator to sum by day (#982)

This commit is contained in:
Kevin Papst
2019-07-24 18:36:06 +02:00
committed by GitHub
parent 53eda31179
commit 7583498735
5 changed files with 201 additions and 10 deletions

View File

@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Invoice\Calculator;
use App\Entity\Timesheet;
use App\Invoice\CalculatorInterface;
/**
* A calculator that sums up the timesheet records for each day.
*/
class DateInvoiceCalculator extends AbstractSumInvoiceCalculator implements CalculatorInterface
{
protected function calculateSumIdentifier(Timesheet $timesheet): string
{
return $timesheet->getBegin()->format('Y-m-d');
}
/**
* @return string
*/
public function getId(): string
{
return 'date';
}
}