improved invoice handling for fixed rates (#1058)

This commit is contained in:
Kevin Papst
2019-08-24 00:02:16 +02:00
committed by GitHub
parent 46e5650882
commit ceeec7b8a6
40 changed files with 581 additions and 131 deletions

View File

@@ -9,8 +9,8 @@
namespace App\Invoice\Calculator;
use App\Entity\Timesheet;
use App\Model\InvoiceModel;
use App\Invoice\InvoiceItem;
use App\Invoice\InvoiceModel;
abstract class AbstractCalculator
{
@@ -25,7 +25,7 @@ abstract class AbstractCalculator
protected $model;
/**
* @return Timesheet[]
* @return InvoiceItem[]
*/
abstract public function getEntries();
@@ -103,7 +103,9 @@ abstract class AbstractCalculator
{
$time = 0;
foreach ($this->model->getEntries() as $entry) {
$time += $entry->getDuration();
if (null === $entry->getFixedRate()) {
$time += $entry->getDuration();
}
}
return $time;