wip: additional services with constraints
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user