FIX: Cuando no hay cierres asociados

This commit is contained in:
2021-03-26 15:25:32 -03:00
parent 016bc51eb5
commit 5850f14295

View File

@ -226,9 +226,11 @@ class Unidad extends Model
if ($this->is_reservada == null) {
$this->is_reservada = false;
$cierres = $this->cierres();
foreach ($cierres as $cierre) {
if ($cierre->isVigente()) {
$this->is_reservada = true;
if ($cierres) {
foreach ($cierres as $cierre) {
if ($cierre->isVigente()) {
$this->is_reservada = true;
}
}
}
if (!$this->isVendida()) {