wip: improved refresh logic
This commit is contained in:
@@ -286,6 +286,12 @@ class BookingPriceCalculatorService
|
||||
}
|
||||
|
||||
$subType = $serviceData['subType'] ?? 'other';
|
||||
|
||||
// Normalize rental subtypes to avoid duplicate sections
|
||||
if (true === in_array($subType, Constants::TOKEN_RENTALS, true)) {
|
||||
$subType = 'rentals'; // Normalize all rental subtypes to a single key
|
||||
}
|
||||
|
||||
$isDiscount = $serviceData['totalPrice'] < 0;
|
||||
|
||||
// Create separate buckets for positive costs and discounts
|
||||
@@ -332,9 +338,10 @@ class BookingPriceCalculatorService
|
||||
Constants::TOKEN_ADDITIONAL => 'Zusatzleistungen',
|
||||
Constants::TOKEN_BOARD => 'Verpflegung',
|
||||
'transportation' => 'Beförderung',
|
||||
'rentals' => 'Leihmaterial', // Normalized rental subtype
|
||||
];
|
||||
|
||||
// Handle rentals array
|
||||
// Handle rentals array (keep for backward compatibility with non-normalized subtypes)
|
||||
if (true === in_array($subType, Constants::TOKEN_RENTALS, true)) {
|
||||
return 'Leihmaterial';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user