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