feat: simplify pricing and room selection display
This commit is contained in:
@@ -38,12 +38,11 @@ class RoomSelectType extends AbstractType
|
|||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
|
|
||||||
$view->vars['label_room'] = $data->label;
|
$view->vars['label_room'] = $data->label;
|
||||||
$view->vars['label_price'] = null;
|
$view->vars['label_price_amount'] = null;
|
||||||
$view->vars['is_inquiry'] = Constants::STATUS_ON_REQUEST === $data->status;
|
$view->vars['is_inquiry'] = Constants::STATUS_ON_REQUEST === $data->status;
|
||||||
|
|
||||||
if (null !== $data->price) {
|
if (null !== $data->price) {
|
||||||
$formattedPrice = number_format((float) $data->price, 2, ',', '.');
|
$view->vars['label_price_amount'] = (float) $data->price;
|
||||||
$view->vars['label_price'] = sprintf(' %s € pro Person', $formattedPrice);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,30 +183,6 @@ class BookingPriceCalculatorService
|
|||||||
return $surchargePricing;
|
return $surchargePricing;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Formats a price value for display with proper German formatting.
|
|
||||||
*
|
|
||||||
* @param float $price The price to format
|
|
||||||
*
|
|
||||||
* @return string Formatted price string (e.g., "123,45")
|
|
||||||
*/
|
|
||||||
public function formatPrice(float $price): string
|
|
||||||
{
|
|
||||||
return number_format($price, 2, ',', '.');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Formats a price with Euro symbol for display.
|
|
||||||
*
|
|
||||||
* @param float $price The price to format
|
|
||||||
*
|
|
||||||
* @return string Formatted price string with Euro symbol (e.g., "€123,45")
|
|
||||||
*/
|
|
||||||
public function formatPriceWithSymbol(float $price): string
|
|
||||||
{
|
|
||||||
return '€'.$this->formatPrice($price);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aggregates all transportation-related services and pricing into separate line items.
|
* Aggregates all transportation-related services and pricing into separate line items.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -334,18 +334,6 @@ class BookingService
|
|||||||
return $participantsCount;
|
return $participantsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculates the number of participants assigned to each room ID.
|
|
||||||
*
|
|
||||||
* @return array<int, int> an array where the key is the room ID and the value is the count of assigned participants
|
|
||||||
*
|
|
||||||
* @deprecated Use BookingDto::getRoomAssignmentCounts() instead
|
|
||||||
*/
|
|
||||||
public function getRoomAssignmentCounts(BookingDto $bookingDto): array
|
|
||||||
{
|
|
||||||
return $bookingDto->getRoomAssignmentCounts();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a summary of selected rooms, participant count, and pricing information for a booking.
|
* Returns a summary of selected rooms, participant count, and pricing information for a booking.
|
||||||
*
|
*
|
||||||
@@ -424,45 +412,6 @@ class BookingService
|
|||||||
return $groups;
|
return $groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets all participant room assignments in the DTO.
|
|
||||||
*
|
|
||||||
* @param BookingDto $dto The booking DTO to reset assignments for
|
|
||||||
*
|
|
||||||
* @deprecated Use BookingDto::resetParticipantAssignments() instead
|
|
||||||
*/
|
|
||||||
public function resetParticipantAssignments(BookingDto $dto): void
|
|
||||||
{
|
|
||||||
$dto->resetParticipantAssignments();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a snapshot of the current room selection state.
|
|
||||||
*
|
|
||||||
* @return array<int, array{int, int}> Array of [roomId, quantity] pairs
|
|
||||||
*
|
|
||||||
* @deprecated Use BookingDto::createRoomSelectionSnapshot() instead
|
|
||||||
*/
|
|
||||||
public function createRoomSelectionSnapshot(BookingDto $dto): array
|
|
||||||
{
|
|
||||||
return $dto->createRoomSelectionSnapshot();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if room selection has changed compared to a previous snapshot.
|
|
||||||
*
|
|
||||||
* @param array $oldSnapshot The baseline room selection snapshot
|
|
||||||
* @param BookingDto $newDto The current booking DTO
|
|
||||||
*
|
|
||||||
* @return bool True if room selections have changed, false otherwise
|
|
||||||
*
|
|
||||||
* @deprecated Use BookingDto::hasRoomSelectionChanged() instead
|
|
||||||
*/
|
|
||||||
public function hasRoomSelectionChanged(array $oldSnapshot, BookingDto $newDto): bool
|
|
||||||
{
|
|
||||||
return $newDto->hasRoomSelectionChanged($oldSnapshot);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pre-selects default services for all participants.
|
* Pre-selects default services for all participants.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
{{ form.vars.label_room }} {% if form.vars.is_inquiry %}(nur auf Anfrage){% endif %}
|
{{ form.vars.label_room }} {% if form.vars.is_inquiry %}(nur auf Anfrage){% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-gray-500">
|
<div class="text-gray-500">
|
||||||
{{ form.vars.label_price }}
|
{% if form.vars.label_price_amount is defined and form.vars.label_price_amount is not null %}
|
||||||
|
{{ form.vars.label_price_amount|format_currency('EUR') }} pro Person
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user