FIX: Cierre vigentes para unidad reservada
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user