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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user