Files
oficial/app/resources/views/ventas/show/propiedad.blade.php

64 lines
2.4 KiB
PHP

<div class="ui inverted grey two column grid segment">
<div class="column">
PROPIEDAD
</div>
<div class="right aligned column">
<a style="color: inherit;" href="{{$urls->base}}/venta/{{$venta->id}}/propiedad">
<i class="edit icon"></i>
</a>
</div>
</div>
<div class="ui segment">
<table class="ui very basic fluid table">
<thead>
<tr>
<th colspan="2">Unidad</th>
<th class="center aligned">Piso</th>
<th class="right aligned">Metros vendibles</th>
<th class="right aligned">Precio</th>
<th class="right aligned">Valor Venta</th>
<th class="right aligned">UF/</th>
<th class="center aligned">Orientacion</th>
</tr>
</thead>
<tbody>
@foreach($venta->propiedad()->unidades as $unidad)
@php
$precio = $unidad->precio($venta->fecha) ? $unidad->precio($venta->fecha)->valor : 0;
@endphp
<tr>
<td>
{{ucwords($unidad->proyectoTipoUnidad->tipoUnidad->descripcion)}}
@if ($unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento')
{{$unidad->proyectoTipoUnidad->abreviacion}}
@endif
</td>
<td class="right aligned">
{{$unidad->descripcion}}
</td>
<td class="center aligned">
{{$unidad->piso}}
</td>
<td class="right aligned">
{{$format->number($unidad->proyectoTipoUnidad->vendible(), 2)}}
</td>
<td class="right aligned">
{{$format->ufs($precio)}}
</td>
<td class="right aligned">
{{$format->ufs($unidad->valor)}}
</td>
<td class="right aligned">
@if ($unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento')
{{$format->number(($unidad->valor ?? $precio) / $unidad->proyectoTipoUnidad->vendible(), 2)}} UF/
@endif
</td>
<td class="center aligned">
{{$unidad->orientacion}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>