automatic billable calculation (#3200)
This commit is contained in:
@@ -48,7 +48,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* @Exporter\Order({"id", "name", "customer", "orderNumber", "orderDate", "start", "end", "budget", "timeBudget", "budgetType", "color", "visible", "teams", "comment"})
|
||||
* @Exporter\Order({"id", "name", "customer", "orderNumber", "orderDate", "start", "end", "budget", "timeBudget", "budgetType", "color", "visible", "teams", "comment", "billable"})
|
||||
* @Exporter\Expose("customer", label="label.customer", exp="object.getCustomer() === null ? null : object.getCustomer().getName()")
|
||||
* @ Exporter\Expose("teams", label="label.team", exp="object.getTeams().toArray()", type="array")
|
||||
*/
|
||||
@@ -195,6 +195,18 @@ class Project 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
|
||||
*
|
||||
@@ -294,6 +306,16 @@ class Project implements EntityWithMetaFields, EntityWithBudget
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
public function setBillable(bool $billable): void
|
||||
{
|
||||
$this->billable = $billable;
|
||||
}
|
||||
|
||||
public function isBillable(): bool
|
||||
{
|
||||
return $this->billable;
|
||||
}
|
||||
|
||||
public function getOrderNumber(): ?string
|
||||
{
|
||||
return $this->orderNumber;
|
||||
|
||||
Reference in New Issue
Block a user