billable timesheets, inactive projects report, bookmark export search (#2503)

This commit is contained in:
Kevin Papst
2021-04-18 21:51:27 +02:00
committed by GitHub
parent 8664d94ea6
commit 0330f45c6a
97 changed files with 1516 additions and 664 deletions

View File

@@ -17,6 +17,10 @@ class Day
* @var int
*/
protected $totalDuration = 0;
/**
* @var int|null
*/
private $totalDurationBillable = 0;
/**
* @var float
*/
@@ -54,6 +58,16 @@ class Day
return $this;
}
public function getTotalDurationBillable(): int
{
return $this->totalDurationBillable;
}
public function setTotalDurationBillable(int $seconds): void
{
$this->totalDurationBillable = $seconds;
}
public function getTotalRate(): float
{
return $this->totalRate;

View File

@@ -11,27 +11,14 @@ namespace App\Model\Statistic;
use InvalidArgumentException;
/**
* Monthly statistics
*/
class Month
final class Month
{
/**
* @var string
*/
protected $month;
/**
* @var int
*/
protected $totalDuration = 0;
/**
* @var float
*/
protected $totalRate = 0.00;
private $month;
private $totalDuration = 0;
private $totalRate = 0.00;
private $billableDuration = 0;
private $billableRate = 0.00;
/**
* @param string $month
*/
public function __construct(string $month)
{
$monthNumber = (int) $month;
@@ -43,14 +30,16 @@ class Month
$this->month = $month;
}
/**
* @return string
*/
public function getMonth()
public function getMonth(): string
{
return $this->month;
}
public function getMonthNumber(): int
{
return (int) $this->month;
}
public function getTotalDuration(): int
{
return $this->totalDuration;
@@ -74,4 +63,24 @@ class Month
return $this;
}
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

@@ -23,25 +23,19 @@ class Year
*/
protected $months = [];
/**
* @param string $year
*/
public function __construct($year)
public function __construct(string $year)
{
$this->year = $year;
}
/**
* @return string
*/
public function getYear()
public function getYear(): string
{
return $this->year;
}
public function setMonth(Month $month): Year
{
$this->months[(int) $month->getMonth()] = $month;
$this->months[$month->getMonthNumber()] = $month;
return $this;
}