automatic billable calculation (#3200)

This commit is contained in:
Kevin Papst
2022-03-18 22:31:50 +01:00
committed by GitHub
parent f7480902b4
commit 30c7782d6e
34 changed files with 409 additions and 53 deletions

View File

@@ -47,7 +47,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* }
* )
*
* @Exporter\Order({"id", "name", "project", "budget", "timeBudget", "budgetType", "color", "visible", "comment"})
* @Exporter\Order({"id", "name", "project", "budget", "timeBudget", "budgetType", "color", "visible", "comment", "billable"})
* @Exporter\Expose("project", label="label.project", exp="object.getProject() === null ? null : object.getProject().getName()")
*/
class Activity implements EntityWithMetaFields, EntityWithBudget
@@ -123,6 +123,18 @@ class Activity implements EntityWithMetaFields, EntityWithBudget
* @Assert\NotNull()
*/
private $visible = true;
/**
* @var bool
*
* @Serializer\Expose()
* @Serializer\Groups({"Default"})
*
* @Exporter\Expose(label="label.billable", type="boolean")
*
* @ORM\Column(name="billable", type="boolean", nullable=false)
* @Assert\NotNull()
*/
private $billable = true;
/**
* Meta fields
*
@@ -227,6 +239,16 @@ class Activity implements EntityWithMetaFields, EntityWithBudget
return $this->visible;
}
public function setBillable(bool $billable): void
{
$this->billable = $billable;
}
public function isBillable(): bool
{
return $this->billable;
}
/**
* @return Collection|MetaTableTypeInterface[]
*/