fix relative times in budget calculation in export (#3216)

This commit is contained in:
Kevin Papst
2022-03-22 21:02:29 +01:00
committed by GitHub
parent 6c1d79fe5b
commit 3c6b5c6c1e
2 changed files with 10 additions and 6 deletions

View File

@@ -108,14 +108,14 @@ class BudgetStatisticModel implements BudgetStatisticModelInterface
{
$value = $this->getTimeBudget() - $this->getDurationBillable();
return $value > 0 ? $value : 0;
return max($value, 0);
}
public function getTimeBudgetOpenRelative(): int
{
$value = $this->getTimeBudget() - $this->getDurationBillableRelative();
return $value > 0 ? $value : 0;
return max($value, 0);
}
public function getTimeBudgetSpent(): int
@@ -137,14 +137,14 @@ class BudgetStatisticModel implements BudgetStatisticModelInterface
{
$value = $this->getBudget() - $this->getRateBillable();
return $value > 0 ? $value : 0;
return max($value, 0);
}
public function getBudgetOpenRelative(): float
{
$value = $this->getBudget() - $this->getRateBillableRelative();
return $value > 0 ? $value : 0;
return max($value, 0);
}
public function getBudgetSpent(): float