FIX: Precio Unidad no existe
This commit is contained in:
@ -47,7 +47,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="right aligned">
|
<td class="right aligned">
|
||||||
@if ($unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento')
|
@if ($unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento')
|
||||||
{{$format->number(($unidad->valor ?? $unidad->precio($venta->fecha)->valor) / $unidad->proyectoTipoUnidad->vendible(), 2)}} UF/m²
|
{{$format->number(($unidad->valor ?? ($unidad->precio($venta->fecha)->valor ?? 0)) / $unidad->proyectoTipoUnidad->vendible(), 2)}} UF/m²
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td class="center aligned">
|
<td class="center aligned">
|
||||||
|
@ -3,6 +3,7 @@ namespace Incoviba\Model\Venta;
|
|||||||
|
|
||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use Incoviba\Common\Ideal;
|
use Incoviba\Common\Ideal;
|
||||||
|
use Incoviba\Common\Implement\Exception\EmptyResult;
|
||||||
use Incoviba\Model;
|
use Incoviba\Model;
|
||||||
|
|
||||||
class Unidad extends Ideal\Model
|
class Unidad extends Ideal\Model
|
||||||
@ -40,6 +41,9 @@ class Unidad extends Ideal\Model
|
|||||||
return $min->current->fecha < $precio->current->fecha ? $min : $precio;
|
return $min->current->fecha < $precio->current->fecha ? $min : $precio;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if ($precio === null) {
|
||||||
|
throw new EmptyResult('SELECT * FROM precio WHERE unidad = ? AND fecha = ?');
|
||||||
|
}
|
||||||
|
|
||||||
return $precio;
|
return $precio;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user