fix: don't rely on individual prices being available for all participants

This commit is contained in:
Björn Fromme
2025-11-06 15:32:39 +01:00
parent 0a0bef9e82
commit 1e5fe23159
+3 -3
View File
@@ -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;