FIX: Cierre vigentes para unidad reservada

This commit is contained in:
2021-03-26 13:54:10 -03:00
parent 2bc6958a1c
commit 0ee3bc9661

View File

@ -225,7 +225,13 @@ class Unidad extends Model
public function isReservada() {
if ($this->is_reservada == null) {
$this->is_reservada = false;
if (!$this->isVendida() and $this->cierres() !== false) {
$cierres = $this->cierres();
foreach ($cierres as $cierre) {
if ($cierre->isVigente()) {
$this->is_reservada = true;
}
}
if (!$this->isVendida()) {
$this->is_reservada = true;
}
}