improved invoice handling for fixed rates (#1058)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user