added hourly and money budgets to activity, project and customer (#843)

This commit is contained in:
Kevin Papst
2019-06-11 13:18:57 +02:00
committed by GitHub
parent 833968a87d
commit 5702d7afa8
118 changed files with 1743 additions and 1077 deletions

View File

@@ -9,84 +9,6 @@
namespace App\Model;
/**
* Activity statistics
*/
class ActivityStatistic
class ActivityStatistic extends TimesheetCountedStatistic
{
/**
* @var int
*/
protected $count = 0;
/**
* @var int
*/
protected $recordAmount = 0;
/**
* @var int
*/
protected $recordDuration = 0;
/**
* Returns the total amount of included timesheet records.
*
* @return int
*/
public function getRecordAmount()
{
return $this->recordAmount;
}
/**
* @param int $recordAmount
* @return ActivityStatistic
*/
public function setRecordAmount($recordAmount)
{
$this->recordAmount = (int) $recordAmount;
return $this;
}
/**
* Returns the total duration of all included timesheet records.
*
* @return int
*/
public function getRecordDuration()
{
return $this->recordDuration;
}
/**
* @param int $recordDuration
* @return ActivityStatistic
*/
public function setRecordDuration($recordDuration)
{
$this->recordDuration = (int) $recordDuration;
return $this;
}
/**
* Returns the amount of activities that are included in the statistic result.
*
* @return int
*/
public function getCount()
{
return $this->count;
}
/**
* @param int $count
* @return ActivityStatistic
*/
public function setCount($count)
{
$this->count = (int) $count;
return $this;
}
}

View File

@@ -9,23 +9,8 @@
namespace App\Model;
/**
* Customer statistics
*/
class CustomerStatistic
class CustomerStatistic extends TimesheetCountedStatistic
{
/**
* @var int
*/
protected $count = 0;
/**
* @var int
*/
protected $recordAmount = 0;
/**
* @var int
*/
protected $recordDuration = 0;
/**
* @var int
*/
@@ -35,69 +20,6 @@ class CustomerStatistic
*/
protected $projectAmount = 0;
/**
* Returns the total amount of included timesheet records.
*
* @return int
*/
public function getRecordAmount()
{
return $this->recordAmount;
}
/**
* @param int $recordAmount
* @return $this
*/
public function setRecordAmount($recordAmount)
{
$this->recordAmount = (int) $recordAmount;
return $this;
}
/**
* Returns the total duration of all included timesheet records.
*
* @return int
*/
public function getRecordDuration()
{
return $this->recordDuration;
}
/**
* @param int $recordDuration
* @return $this
*/
public function setRecordDuration($recordDuration)
{
$this->recordDuration = (int) $recordDuration;
return $this;
}
/**
* Returns the amount of activities that are included in the statistic result.
*
* @return int
*/
public function getCount()
{
return $this->count;
}
/**
* @param int $count
* @return $this
*/
public function setCount($count)
{
$this->count = (int) $count;
return $this;
}
/**
* @return int
*/

View File

@@ -9,91 +9,13 @@
namespace App\Model;
/**
* Project statistics
*/
class ProjectStatistic
class ProjectStatistic extends TimesheetCountedStatistic
{
/**
* @var int
*/
protected $count = 0;
/**
* @var int
*/
protected $recordAmount = 0;
/**
* @var int
*/
protected $recordDuration = 0;
/**
* @var int
*/
protected $activityAmount = 0;
/**
* Returns the total amount of included timesheet records.
*
* @return int
*/
public function getRecordAmount()
{
return $this->recordAmount;
}
/**
* @param int $recordAmount
* @return ProjectStatistic
*/
public function setRecordAmount($recordAmount)
{
$this->recordAmount = (int) $recordAmount;
return $this;
}
/**
* Returns the total duration of all included timesheet records.
*
* @return int
*/
public function getRecordDuration()
{
return $this->recordDuration;
}
/**
* @param int $recordDuration
* @return ProjectStatistic
*/
public function setRecordDuration($recordDuration)
{
$this->recordDuration = (int) $recordDuration;
return $this;
}
/**
* Returns the amount of activities that are included in the statistic result.
*
* @return int
*/
public function getCount()
{
return $this->count;
}
/**
* @param int $count
* @return ProjectStatistic
*/
public function setCount($count)
{
$this->count = (int) $count;
return $this;
}
/**
* @return int
*/

View File

@@ -0,0 +1,89 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Model;
class TimesheetCountedStatistic
{
/**
* @var int
*/
protected $recordAmount = 0;
/**
* @var int
*/
protected $recordDuration = 0;
/**
* @var float
*/
protected $recordRate = 0.0;
/**
* Returns the total amount of included timesheet records.
*
* @return int
*/
public function getRecordAmount()
{
return $this->recordAmount;
}
/**
* @param int $recordAmount
* @return $this
*/
public function setRecordAmount($recordAmount)
{
$this->recordAmount = (int) $recordAmount;
return $this;
}
/**
* Returns the total duration of all included timesheet records.
*
* @return int
*/
public function getRecordDuration()
{
return $this->recordDuration;
}
/**
* @param int $recordDuration
* @return $this
*/
public function setRecordDuration($recordDuration)
{
$this->recordDuration = (int) $recordDuration;
return $this;
}
/**
* Returns the total rate of all included timesheet records.
*
* @return float
*/
public function getRecordRate()
{
return $this->recordRate;
}
/**
* @param float $recordRate
* @return $this
*/
public function setRecordRate($recordRate)
{
$this->recordRate = (float) $recordRate;
return $this;
}
}