empty Season bug

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3446 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
adametz 2018-08-15 08:37:15 +00:00
parent bfa4347692
commit 48131f72e2
3 changed files with 17 additions and 11 deletions

View file

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

View file

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

View file

@ -780,6 +780,8 @@ class LodgingCalendarService
$checkDay = $paddedCalendar[$mSdt->format("Y-n")]['data'][$key]; $checkDay = $paddedCalendar[$mSdt->format("Y-n")]['data'][$key];
if(!empty($checkDay->getPrice())){
if(!empty($checkDay->getPrice()->getSeason()) && $minDays != $checkDay->getPrice()->getSeason()->getMinimumStay()){ if(!empty($checkDay->getPrice()->getSeason()) && $minDays != $checkDay->getPrice()->getSeason()->getMinimumStay()){
if($minDays > $checkDay->getPrice()->getSeason()->getMinimumStay()){ if($minDays > $checkDay->getPrice()->getSeason()->getMinimumStay()){
@ -795,6 +797,7 @@ class LodgingCalendarService
} }
$minDays = $checkDay->getPrice()->getSeason()->getMinimumStay(); $minDays = $checkDay->getPrice()->getSeason()->getMinimumStay();
} }
}
$counter++; $counter++;
if($counter <= $last) { if($counter <= $last) {