added freelancer invoice template (#254)

This commit is contained in:
Kevin Papst
2018-09-02 21:29:49 +02:00
committed by GitHub
parent ee4df36735
commit a636faa4ab
41 changed files with 1105 additions and 145 deletions

View File

@@ -62,7 +62,7 @@ class DefaultCalculator implements CalculatorInterface
/**
* @return float
*/
public function getVat()
public function getVat(): ?float
{
return $this->model->getTemplate()->getVat();
}
@@ -97,4 +97,19 @@ class DefaultCalculator implements CalculatorInterface
{
return $this->model->getCustomer()->getCurrency();
}
/**
* Returns the total amount of worked time in seconds.
*
* @return int
*/
public function getTimeWorked(): int
{
$time = 0;
foreach ($this->model->getEntries() as $entry) {
$time += $entry->getDuration();
}
return $time;
}
}