diff --git a/app/resources/views/ventas/facturacion/show.blade.php b/app/resources/views/ventas/facturacion/show.blade.php index aa40a96..2efebea 100644 --- a/app/resources/views/ventas/facturacion/show.blade.php +++ b/app/resources/views/ventas/facturacion/show.blade.php @@ -187,7 +187,7 @@ $IPC->readjust($venta->proyecto()->terreno->valor, $venta->proyecto()->terreno->fecha, $venta->currentEstado()->fecha) : 0}}, uf: {{$UF->get($venta->currentEstado()->fecha)}}, unidades: JSON.parse('{!! json_encode(array_map(function(Incoviba\Model\Venta\PropiedadUnidad $unidad) use ($venta, $UF, $format) { - $precio = ($unidad->valor > 0) ? $unidad->valor : $unidad->precio($venta->currentEstado()->fecha)->valor; + $precio = ($unidad->valor > 0) ? $unidad->valor : ($unidad->precio($venta->currentEstado()->fecha) ? $unidad->precio($venta->currentEstado()->fecha)->valor : 0); return [ 'id' => $unidad->id, 'pid' => $unidad->pu_id, diff --git a/app/resources/views/ventas/show/propiedad.blade.php b/app/resources/views/ventas/show/propiedad.blade.php index bd67195..5bba106 100644 --- a/app/resources/views/ventas/show/propiedad.blade.php +++ b/app/resources/views/ventas/show/propiedad.blade.php @@ -23,6 +23,9 @@
@foreach($venta->propiedad()->unidades as $unidad) + @php + $precio = $unidad->precio($venta->fecha) ? $unidad->precio($venta->fecha)->valor : 0; + @endphp