Simplify code
This commit is contained in:
@@ -224,8 +224,6 @@ class ContingentImportService implements SingletonInterface
|
||||
{
|
||||
$date = \DateTime::createFromFormat('d.m.Y', (string) $xmlDate['termin']);
|
||||
$status = Contingent::STATUS_OK;
|
||||
$statusBlocked = false;
|
||||
$statusOnRequest = false;
|
||||
foreach ($xmlDate->zimmerliste->children() as $xmlRoom)
|
||||
{
|
||||
$roomTypeBusProId = (string) $xmlRoom['idbuspro'];
|
||||
@@ -237,10 +235,10 @@ class ContingentImportService implements SingletonInterface
|
||||
$availablePax = 0;
|
||||
if ($roomType['ctrl'] === true) {
|
||||
if ((string) $xmlRoom['status'] === 'A') {
|
||||
$statusOnRequest = true;
|
||||
$status = Contingent::STATUS_ONREQUEST;
|
||||
}
|
||||
if ((string) $xmlRoom['status'] === 'S') {
|
||||
$statusBlocked = true;
|
||||
$status = Contingent::STATUS_BLOCKED;
|
||||
}
|
||||
} else {
|
||||
$pax = $roomType['pax'] * (int) $xmlRoom['kontingent'];
|
||||
@@ -250,11 +248,6 @@ class ContingentImportService implements SingletonInterface
|
||||
if ($availablePax === 0) {
|
||||
continue;
|
||||
}
|
||||
if ($statusBlocked) {
|
||||
$status = Contingent::STATUS_BLOCKED;
|
||||
} elseif ($statusOnRequest) {
|
||||
$status = Contingent::STATUS_ONREQUEST;
|
||||
}
|
||||
$minPrice = (int) $xmlRoom['abpreis'];
|
||||
$minNights = (int) $xmlRoom['abpreis_naechte'];
|
||||
$additionalNightMinPrice = (int) $xmlRoom['abpreis_verlaengerung'];
|
||||
|
||||
Reference in New Issue
Block a user