Compare commits

...

3 commits

Author SHA1 Message Date
Kevin Adametz
0138bb6036 On master: Tower Auto-Stash: 2018-08-15 10:36:45 +0200 2018-08-15 10:36:46 +02:00
Kevin Adametz
3fc27b87eb index on master: 7a717af empty Season bug 2018-08-15 10:36:46 +02:00
Kevin Adametz
7a717af6c6 empty Season bug 2018-08-15 10:36:23 +02:00
4 changed files with 18 additions and 12 deletions

View file

@ -177,6 +177,7 @@
</thead>
<tbody>
{% for price in fewo_lodging.prices %}
{% if price.season is not empty %}
<tr>
<td data-title="Name">
<strong class="small">
@ -204,6 +205,7 @@
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>

View file

@ -531,6 +531,7 @@ class FewoLodging
{
return $this->getPrices()->filter(function(FewoPrice $price) use ($dateFrom, $dateTo) {
if(!empty($price->getSeason()))
return ($price->getSeason()->getFromDate() >= $dateFrom && $price->getSeason()->getFromDate() <= $dateTo) ||
($price->getSeason()->getToDate() >= $dateFrom && $price->getSeason()->getToDate() <= $dateTo);
});
@ -614,7 +615,7 @@ class FewoLodging
public function getReservationsFilter($dateFrom, $dateTo)
{
return $this->getReservations()->filter(function(FewoReservation $reservation) use ($dateFrom, $dateTo) {
return ($reservation->getFromDate() >= $dateFrom && $reservation->getFromDate() <= $dateTo) ||
return ($reservation->getFromDate() >= $dateFrom && $reservation->getFromDate() <= $dateTo) ||
($reservation->getToDate() >= $dateFrom && $reservation->getToDate() <= $dateTo);
});
}

View file

@ -780,20 +780,23 @@ class LodgingCalendarService
$checkDay = $paddedCalendar[$mSdt->format("Y-n")]['data'][$key];
if(!empty($checkDay->getPrice()->getSeason()) && $minDays != $checkDay->getPrice()->getSeason()->getMinimumStay()){
if($minDays > $checkDay->getPrice()->getSeason()->getMinimumStay()){
$last = $counter+$checkDay->getPrice()->getSeason()->getMinimumStay();
if(!empty($checkDay->getPrice())){
if(!empty($checkDay->getPrice()->getSeason()) && $minDays != $checkDay->getPrice()->getSeason()->getMinimumStay()){
if($minDays > $checkDay->getPrice()->getSeason()->getMinimumStay()){
$last = $counter+$checkDay->getPrice()->getSeason()->getMinimumStay();
$setMinStayTo->modify('-'.($last).' days');
$setMinStayTo->modify('-'.($last).' days');
}
if($minDays < $checkDay->getPrice()->getSeason()->getMinimumStay()){
$last = $counter+$checkDay->getPrice()->getSeason()->getMinimumStay();
$setMinStayTo->modify('-'.($last).' days');
}
$minDays = $checkDay->getPrice()->getSeason()->getMinimumStay();
}
if($minDays < $checkDay->getPrice()->getSeason()->getMinimumStay()){
$last = $counter+$checkDay->getPrice()->getSeason()->getMinimumStay();
$setMinStayTo->modify('-'.($last).' days');
}
$minDays = $checkDay->getPrice()->getSeason()->getMinimumStay();
}
$counter++;

View file

@ -8,7 +8,7 @@ libxml_use_internal_errors(true);
$loader = require __DIR__.'/../app/autoload.php';
include_once __DIR__.'/../var/bootstrap.php.cache';
$kernel = new AppKernel('prod', false);
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);