added project detail report (#2651)
- avatars via css only - random colors for entities - improves print view - added colors for teams - added color to tag
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class TimesheetCountedStatistic
|
||||
class TimesheetCountedStatistic implements \JsonSerializable
|
||||
{
|
||||
private $recordAmount = 0;
|
||||
private $recordDuration = 0;
|
||||
@@ -40,6 +40,26 @@ class TimesheetCountedStatistic
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getValue(): int
|
||||
{
|
||||
return $this->recordDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDuration(): int
|
||||
{
|
||||
return $this->recordDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total duration of all included timesheet records.
|
||||
*
|
||||
@@ -61,6 +81,16 @@ class TimesheetCountedStatistic
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getRate(): float
|
||||
{
|
||||
return $this->recordRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total rate of all included timesheet records.
|
||||
*
|
||||
@@ -132,4 +162,17 @@ class TimesheetCountedStatistic
|
||||
{
|
||||
$this->recordRateBillable = $recordRate;
|
||||
}
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'duration' => $this->recordDuration,
|
||||
'duration_billable' => $this->recordDurationBillable,
|
||||
'rate' => $this->recordRate,
|
||||
'rate_billable' => $this->recordRateBillable,
|
||||
'rate_internal' => $this->recordInternalRate,
|
||||
'amount' => $this->recordAmount,
|
||||
'amount_billable' => $this->recordAmountBillable,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user