feat: cost unit for custom destinations

This commit is contained in:
Björn Fromme
2025-09-23 09:10:50 +02:00
parent d3c09e0cf6
commit d1cdfe461c
5 changed files with 23 additions and 2 deletions
@@ -38,6 +38,7 @@ trait DestinationTrait
->setHotelBusProId($hotel->getBusProId()) ->setHotelBusProId($hotel->getBusProId())
->setCountry($destinationDto->getCountry()) ->setCountry($destinationDto->getCountry())
->setPickups($pickups) ->setPickups($pickups)
->setCostUnit($destinationDto->getCostUnit())
; ;
} }
} }
@@ -43,6 +43,7 @@ class DuplicateController extends AbstractController
->setHotel($hotel->getName()) ->setHotel($hotel->getName())
->setHotelCode($hotel->getCode()) ->setHotelCode($hotel->getCode())
->setHotelBusProId($hotel->getBusProId()) ->setHotelBusProId($hotel->getBusProId())
->setCostUnit($destinationDto->getCostUnit())
; ;
$this->entityManager->persist($copy); $this->entityManager->persist($copy);
+3
View File
@@ -38,6 +38,9 @@ class DestinationType extends AbstractType
'allow_add' => true, 'allow_add' => true,
'allow_delete' => true, 'allow_delete' => true,
]) ])
->add('costUnit', TextType::class, [
'label' => 'Kostenstelle',
])
->add('country', ChoiceType::class, [ ->add('country', ChoiceType::class, [
'label' => 'Land', 'label' => 'Land',
'choices' => [ 'choices' => [
+15
View File
@@ -24,6 +24,8 @@ class DestinationDto
private array $pickups = []; private array $pickups = [];
private ?string $costUnit = null;
public static function fromEntity(Destination $destination): static public static function fromEntity(Destination $destination): static
{ {
$instance = new static(); $instance = new static();
@@ -39,6 +41,7 @@ class DestinationDto
->setHotelBusProId($destination->getHotelBusProId()) ->setHotelBusProId($destination->getHotelBusProId())
->setCountry($destination->getCountry()) ->setCountry($destination->getCountry())
->setPickups($pickupIds) ->setPickups($pickupIds)
->setCostUnit($destination->getCostUnit())
; ;
return $instance; return $instance;
@@ -115,4 +118,16 @@ class DestinationDto
return $this; 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.product) }}
{{ form_row(form.hotelBusProId) }} {{ form_row(form.hotelBusProId) }}
</div> </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.dateFrom) }}
{{ form_row(form.dateTo) }} {{ form_row(form.dateTo) }}
{{ form_row(form.costUnit) }}
</div> </div>
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4"> <div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
{{ form_row(form.country) }} {{ form_row(form.country) }}
@@ -49,4 +50,4 @@
</a> </a>
</div> </div>
{{ form_rest(form) }} {{ form_rest(form) }}
{{ form_end(form) }} {{ form_end(form) }}