fix: don't rely on individual prices being available for all participants
This commit is contained in:
@@ -249,7 +249,7 @@ class Booking
|
||||
foreach ([...$this->transportationServices, ...$this->additionalServices] as $service) {
|
||||
if ((in_array($participantIndex, $service->mapping) || true === $service->mandatory)
|
||||
&& isset($service->individualPrice[$participantIndex])) {
|
||||
$price += $service->individualPrice[$participantIndex];
|
||||
$price += $service->individualPrice[$participantIndex] ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,13 +257,13 @@ class Booking
|
||||
foreach ($this->surcharges as $surcharge) {
|
||||
if (in_array($participantIndex, $surcharge->mapping)
|
||||
&& isset($surcharge->individualPrice[$participantIndex])) {
|
||||
$price += $surcharge->individualPrice[$participantIndex];
|
||||
$price += $surcharge->individualPrice[$participantIndex] ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
$room = $this->getRoomForParticipant($participantIndex);
|
||||
if (null !== $room && isset($room->individualPrice[$participantIndex])) {
|
||||
$price += $room->individualPrice[$participantIndex];
|
||||
$price += $room->individualPrice[$participantIndex] ?? 0;
|
||||
}
|
||||
|
||||
return $price;
|
||||
|
||||
Reference in New Issue
Block a user