Fix failing contingent calculation due to missing typecast

This commit is contained in:
Björn Fromme
2021-06-08 14:54:06 +02:00
parent c1e3a4daa3
commit 2cbaa305eb
@@ -207,11 +207,12 @@ class ContingentImportService implements SingletonInterface, LoggerAwareInterfac
$types = []; $types = [];
foreach ($xmlTypes->unterbringung as $xmlType) foreach ($xmlTypes->unterbringung as $xmlType)
{ {
$code = (string) $xmlType['code'];
$types[(string) $xmlType['idbuspro']] = [ $types[(string) $xmlType['idbuspro']] = [
'pax' => (int) $xmlType['pax_max'], 'pax' => (int) $xmlType['pax_max'],
'code' => (string) $xmlType['code'], 'code' => $code,
'label' => (string) $xmlType['zimmerbezeichnung'], 'label' => (string) $xmlType['zimmerbezeichnung'],
'ctrl' => (string) $xmlType['code'] === self::ROOMCODE_STATUS, 'ctrl' => $code === self::ROOMCODE_STATUS,
]; ];
} }
return $types; return $types;
@@ -249,7 +250,7 @@ class ContingentImportService implements SingletonInterface, LoggerAwareInterfac
$status = Contingent::STATUS_BLOCKED; $status = Contingent::STATUS_BLOCKED;
} }
} else { } else {
$capacity = (int) $xmlRoom['kontingent'] * $roomType['pax']; $capacity = (int) $xmlRoom['kontingent'] * (int) $roomType['pax'];
$availableRooms = (int) $xmlRoom['frei'] > 0 ? (int) $xmlRoom['frei'] : 0; $availableRooms = (int) $xmlRoom['frei'] > 0 ? (int) $xmlRoom['frei'] : 0;
$availablePax = $availableRooms * $roomType['pax']; $availablePax = $availableRooms * $roomType['pax'];
} }