monthly budget, monthly report, unified report calculation (#2684)

This commit is contained in:
Kevin Papst
2021-08-06 18:38:41 +02:00
committed by GitHub
parent 21f785638c
commit cefd747e91
196 changed files with 5031 additions and 2167 deletions

View File

@@ -30,6 +30,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Index(columns={"start_time"}),
* @ORM\Index(columns={"start_time","end_time"}),
* @ORM\Index(columns={"start_time","end_time","user"}),
* @ORM\Index(columns={"date_tz","user"}),
* }
* )
* @ORM\Entity(repositoryClass="App\Repository\TimesheetRepository")
@@ -108,6 +109,16 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* Reflects the date in the users timezone (not in UTC).
* This value is automatically set through the begin column and ONLY used in statistic queries.
*
* @var \DateTime
*
* @ORM\Column(name="date_tz", type="date", nullable=false)
* @Assert\NotNull()
*/
private $date;
/**
* @var DateTime
*
@@ -360,6 +371,8 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
{
$this->begin = $begin;
$this->timezone = $begin->getTimezone()->getName();
// make sure that the original date is always
$this->date = new DateTime($begin->format('Y-m-d 00:00:00'), new DateTimeZone('UTC'));
return $this;
}
@@ -588,8 +601,8 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
}
/**
* BE WARNED: this method should NOT be used.
* It was ONLY introduced for the command "kimai:import-v1".
* BE WARNED: this method should NOT be used from outside.
* It is reserved for some very rare use-cases.
*
* @internal
* @param string $timezone