feat: additional custom discount applied to total price
This commit is contained in:
1 parent
dea7a3dc97
commit
8443dae5ad
14 files changed
+287
-23
No files matched your search
@@ -156,6 +156,18 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $additionalServicesDiscount = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $totalDiscount = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
#[Assert\Expression(
|
||||
'null === this.getTotalDiscount() or (null !== value and "" !== value)',
|
||||
message: 'Bitte eine Bezeichnung für den Rabatt angeben.',
|
||||
groups: ['edit'],
|
||||
)]
|
||||
private ?string $totalDiscountLabel = null;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
#[ORM\JoinColumn(onDelete: 'SET NULL')]
|
||||
private ?User $managedBy = null;
|
||||
@@ -638,6 +650,30 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTotalDiscount(): ?int
|
||||
{
|
||||
return $this->totalDiscount;
|
||||
}
|
||||
|
||||
public function setTotalDiscount(?int $totalDiscount): self
|
||||
{
|
||||
$this->totalDiscount = $totalDiscount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTotalDiscountLabel(): ?string
|
||||
{
|
||||
return $this->totalDiscountLabel;
|
||||
}
|
||||
|
||||
public function setTotalDiscountLabel(?string $totalDiscountLabel): self
|
||||
{
|
||||
$this->totalDiscountLabel = $totalDiscountLabel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getManagedBy(): ?User
|
||||
{
|
||||
return $this->managedBy;
|
||||
|
||||
Reference in new issue
Block a user