Budget graph in project details (#3406)

* do not copy description if restarting via calendar
* added support to display negative durations
* fix charts for larger numbers
This commit is contained in:
Kevin Papst
2022-07-13 17:21:36 +02:00
committed by GitHub
parent 245dd47082
commit 0dba83d8e9
26 changed files with 400 additions and 80 deletions

View File

@@ -17,7 +17,10 @@ final class Month extends Timesheet
private $billableDuration = 0;
private $billableRate = 0.00;
public function __construct(string $month)
/**
* @param string|int $month
*/
public function __construct($month)
{
$monthNumber = (int) $month;
if ($monthNumber < 1 || $monthNumber > 12) {

View File

@@ -16,6 +16,8 @@ final class Year extends Timesheet
* @var Month[]
*/
private $months = [];
private $billableDuration = 0;
private $billableRate = 0.00;
public function __construct(string $year)
{
@@ -50,4 +52,24 @@ final class Year extends Timesheet
{
return array_values($this->months);
}
public function getBillableDuration(): int
{
return $this->billableDuration;
}
public function setBillableDuration(int $billableDuration): void
{
$this->billableDuration = $billableDuration;
}
public function getBillableRate(): float
{
return $this->billableRate;
}
public function setBillableRate(float $billableRate): void
{
$this->billableRate = $billableRate;
}
}

View File

@@ -209,6 +209,7 @@ class TimesheetCountedStatistic implements \JsonSerializable
/**
* @param float $recordInternalRate
* @return $this
* @deprecated since 1.15 use setInternalRate() instead
*/
public function setRecordInternalRate($recordInternalRate)
{