feat: show room prices in room assignment form field
This commit is contained in:
@@ -255,9 +255,9 @@ class BookingService
|
||||
private function createRoomSelection(Room $room, array $roomsIdsAndQuantities): RoomSelectionDto
|
||||
{
|
||||
$selection = new RoomSelectionDto();
|
||||
$selection->roomId = $room->id;
|
||||
$selection->roomLabel = $room->label;
|
||||
$selection->roomPrice = $room->price;
|
||||
$selection->id = $room->id;
|
||||
$selection->label = $room->label;
|
||||
$selection->price = $room->price;
|
||||
$selection->maxQuantity = $room->available;
|
||||
$selection->capacity = $room->minPax;
|
||||
$selection->quantity = $roomsIdsAndQuantities[$room->id] ?? 0;
|
||||
@@ -282,7 +282,7 @@ class BookingService
|
||||
$rooms = $travelData->getAvailableRooms();
|
||||
|
||||
foreach ($roomSelections as $roomSelection) {
|
||||
$room = $rooms[$roomSelection->roomId];
|
||||
$room = $rooms[$roomSelection->id];
|
||||
$participantsCount += $room->minPax * $roomSelection->quantity;
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ class BookingService
|
||||
Room::SELECTION_TYPE_BY_ROOM => [],
|
||||
];
|
||||
foreach ($roomSelections as $roomSelection) {
|
||||
$room = $roomsById[$roomSelection->roomId] ?? null;
|
||||
$room = $roomsById[$roomSelection->id] ?? null;
|
||||
if ($room) {
|
||||
$type = $room->getSelectionType();
|
||||
$groups[$type][] = $roomSelection;
|
||||
@@ -535,7 +535,7 @@ class BookingService
|
||||
|
||||
// Check selected rooms for inquiry-only status
|
||||
foreach ($bookingDto->getSelectedRooms() as $roomSelection) {
|
||||
$room = $bookingDto->travel->getRoomById($roomSelection->roomId);
|
||||
$room = $bookingDto->travel->getRoomById($roomSelection->id);
|
||||
if ($room
|
||||
&& Constants::STATUS_ON_REQUEST === $room->status
|
||||
&& $room->available > 0) {
|
||||
|
||||
@@ -118,8 +118,8 @@ class BookingSummaryDataService
|
||||
$availableRooms = $bookingDto->travel->getAvailableRooms();
|
||||
|
||||
foreach ($bookingDto->roomSelections as $selection) {
|
||||
if ($selection->quantity > 0 && isset($availableRooms[$selection->roomId])) {
|
||||
$room = $availableRooms[$selection->roomId];
|
||||
if ($selection->quantity > 0 && isset($availableRooms[$selection->id])) {
|
||||
$room = $availableRooms[$selection->id];
|
||||
$totalCapacity += $selection->quantity * ($room->maxPax ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class RoomAssignmentService
|
||||
$availableRooms = $dto->travel->getAvailableRooms();
|
||||
|
||||
foreach ($selectedRooms as $roomSelection) {
|
||||
$room = $availableRooms[$roomSelection->roomId] ?? null;
|
||||
$room = $availableRooms[$roomSelection->id] ?? null;
|
||||
|
||||
if (null === $room) {
|
||||
continue; // Skip if room not found
|
||||
|
||||
@@ -78,7 +78,7 @@ class RoomPricingCalculator
|
||||
}
|
||||
|
||||
foreach ($selectedRooms as $roomSelection) {
|
||||
$room = $this->getRoomById($bookingDto, $roomSelection->roomId);
|
||||
$room = $this->getRoomById($bookingDto, $roomSelection->id);
|
||||
if (null === $room || null === $room->price) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user