feat: cost unit for custom destinations
This commit is contained in:
@@ -38,6 +38,7 @@ trait DestinationTrait
|
||||
->setHotelBusProId($hotel->getBusProId())
|
||||
->setCountry($destinationDto->getCountry())
|
||||
->setPickups($pickups)
|
||||
->setCostUnit($destinationDto->getCostUnit())
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ class DuplicateController extends AbstractController
|
||||
->setHotel($hotel->getName())
|
||||
->setHotelCode($hotel->getCode())
|
||||
->setHotelBusProId($hotel->getBusProId())
|
||||
->setCostUnit($destinationDto->getCostUnit())
|
||||
;
|
||||
|
||||
$this->entityManager->persist($copy);
|
||||
|
||||
@@ -38,6 +38,9 @@ class DestinationType extends AbstractType
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
])
|
||||
->add('costUnit', TextType::class, [
|
||||
'label' => 'Kostenstelle',
|
||||
])
|
||||
->add('country', ChoiceType::class, [
|
||||
'label' => 'Land',
|
||||
'choices' => [
|
||||
|
||||
@@ -24,6 +24,8 @@ class DestinationDto
|
||||
|
||||
private array $pickups = [];
|
||||
|
||||
private ?string $costUnit = null;
|
||||
|
||||
public static function fromEntity(Destination $destination): static
|
||||
{
|
||||
$instance = new static();
|
||||
@@ -39,6 +41,7 @@ class DestinationDto
|
||||
->setHotelBusProId($destination->getHotelBusProId())
|
||||
->setCountry($destination->getCountry())
|
||||
->setPickups($pickupIds)
|
||||
->setCostUnit($destination->getCostUnit())
|
||||
;
|
||||
|
||||
return $instance;
|
||||
@@ -115,4 +118,16 @@ class DestinationDto
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCostUnit(): ?string
|
||||
{
|
||||
return $this->costUnit;
|
||||
}
|
||||
|
||||
public function setCostUnit(?string $costUnit): static
|
||||
{
|
||||
$this->costUnit = $costUnit;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
{{ form_row(form.product) }}
|
||||
{{ form_row(form.hotelBusProId) }}
|
||||
</div>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||
<div class="grid lg:grid-cols-3 gap-x-8 gap-y-4">
|
||||
{{ form_row(form.dateFrom) }}
|
||||
{{ form_row(form.dateTo) }}
|
||||
{{ form_row(form.costUnit) }}
|
||||
</div>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||
{{ form_row(form.country) }}
|
||||
@@ -49,4 +50,4 @@
|
||||
</a>
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{{ form_end(form) }}
|
||||
|
||||
Reference in New Issue
Block a user