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:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ class TimesheetCountedStatistic implements \JsonSerializable
|
||||
/**
|
||||
* @param float $recordInternalRate
|
||||
* @return $this
|
||||
* @deprecated since 1.15 use setInternalRate() instead
|
||||
*/
|
||||
public function setRecordInternalRate($recordInternalRate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user