Release 2.0.20 (#4028)
* max duration per entry increased from 8 to 10 hours * fixes #3981 - clickable area in dropdown too small * fixes #4008 - duplicate activities in project-details report * headers and summary styling in project-details report * show billable stats in project-details report * added new invoice variable for entry.duration_format
This commit is contained in:
@@ -17,8 +17,7 @@ class Timesheet
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return int
|
||||
* @see getDuration()
|
||||
*/
|
||||
public function getValue(): int
|
||||
{
|
||||
@@ -27,8 +26,7 @@ class Timesheet
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return int
|
||||
* @see getTotalDuration()
|
||||
*/
|
||||
public function getDuration(): int
|
||||
{
|
||||
@@ -47,8 +45,7 @@ class Timesheet
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return float
|
||||
* @see getTotalRate()
|
||||
*/
|
||||
public function getRate(): float
|
||||
{
|
||||
@@ -67,8 +64,7 @@ class Timesheet
|
||||
|
||||
/**
|
||||
* For unified access, used in frontend.
|
||||
*
|
||||
* @return float
|
||||
* @see getTotalInternalRate()
|
||||
*/
|
||||
public function getInternalRate(): float
|
||||
{
|
||||
|
||||
@@ -29,21 +29,26 @@ final class UserYear
|
||||
|
||||
public function getDuration(): int
|
||||
{
|
||||
$duration = 0;
|
||||
foreach ($this->year->getMonths() as $month) {
|
||||
$duration += $month->getDuration();
|
||||
}
|
||||
return $this->year->getDuration();
|
||||
}
|
||||
|
||||
return $duration;
|
||||
public function getBillableDuration(): int
|
||||
{
|
||||
return $this->year->getBillableDuration();
|
||||
}
|
||||
|
||||
public function getRate(): float
|
||||
{
|
||||
$rate = 0;
|
||||
foreach ($this->year->getMonths() as $month) {
|
||||
$rate += $month->getRate();
|
||||
}
|
||||
return $this->year->getRate();
|
||||
}
|
||||
|
||||
return $rate;
|
||||
public function getBillableRate(): float
|
||||
{
|
||||
return $this->year->getBillableRate();
|
||||
}
|
||||
|
||||
public function getInternalRate(): float
|
||||
{
|
||||
return $this->year->getInternalRate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,12 @@
|
||||
|
||||
namespace App\Model\Statistic;
|
||||
|
||||
final class Year extends Timesheet
|
||||
final class Year
|
||||
{
|
||||
/**
|
||||
* @var Month[]
|
||||
*/
|
||||
private array $months = [];
|
||||
private int $billableDuration = 0;
|
||||
private float $billableRate = 0.00;
|
||||
|
||||
public function __construct(private string $year)
|
||||
{
|
||||
@@ -51,23 +49,58 @@ final class Year extends Timesheet
|
||||
return array_values($this->months);
|
||||
}
|
||||
|
||||
public function getBillableDuration(): int
|
||||
public function getDuration(): int
|
||||
{
|
||||
return $this->billableDuration;
|
||||
$duration = 0;
|
||||
|
||||
foreach ($this->months as $month) {
|
||||
$duration += $month->getDuration();
|
||||
}
|
||||
|
||||
return $duration;
|
||||
}
|
||||
|
||||
public function setBillableDuration(int $billableDuration): void
|
||||
public function getBillableDuration(): int
|
||||
{
|
||||
$this->billableDuration = $billableDuration;
|
||||
$duration = 0;
|
||||
|
||||
foreach ($this->months as $month) {
|
||||
$duration += $month->getBillableDuration();
|
||||
}
|
||||
|
||||
return $duration;
|
||||
}
|
||||
|
||||
public function getRate(): float
|
||||
{
|
||||
$rate = 0.0;
|
||||
|
||||
foreach ($this->months as $month) {
|
||||
$rate += $month->getRate();
|
||||
}
|
||||
|
||||
return $rate;
|
||||
}
|
||||
|
||||
public function getBillableRate(): float
|
||||
{
|
||||
return $this->billableRate;
|
||||
$rate = 0.0;
|
||||
|
||||
foreach ($this->months as $month) {
|
||||
$rate += $month->getBillableRate();
|
||||
}
|
||||
|
||||
return $rate;
|
||||
}
|
||||
|
||||
public function setBillableRate(float $billableRate): void
|
||||
public function getInternalRate(): float
|
||||
{
|
||||
$this->billableRate = $billableRate;
|
||||
$rate = 0.0;
|
||||
|
||||
foreach ($this->months as $month) {
|
||||
$rate += $month->getInternalRate();
|
||||
}
|
||||
|
||||
return $rate;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user