wip: additional services with constraints

This commit is contained in:
Björn Fromme
2026-03-16 11:59:09 +01:00
parent 4b92f56ed7
commit 0f7d95d31b
28 changed files with 141 additions and 63 deletions
+2 -2
View File
@@ -187,7 +187,7 @@ class Booking
// Sum up all services
foreach ([...$this->transportationServices, ...$this->additionalServices] as $service) {
if ((in_array($participantIndex, $service->mapping) || true === $service->mandatory)
if ((in_array($participantIndex, $service->mapping) || true === $service->mandatory)
&& isset($service->individualPrice[$participantIndex])) {
$price += $service->individualPrice[$participantIndex];
}
@@ -195,7 +195,7 @@ class Booking
// Sum up all surcharges
foreach ($this->surcharges as $surcharge) {
if (in_array($participantIndex, $surcharge->mapping)
if (in_array($participantIndex, $surcharge->mapping)
&& isset($surcharge->individualPrice[$participantIndex])) {
$price += $surcharge->individualPrice[$participantIndex];
}