Files
intranet/resources/views/proyectos/reservas/base.blade.php
2020-12-01 17:23:13 -03:00

73 lines
2.6 KiB
PHP

@extends('layout.base')
@section('content')
<h1 class="page-heading">
<a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">
<span class="glyphicon small glyphicon-chevron-up"></span></a>
Ventas y Reservas - {{$proyecto->descripcion}}
</h1>
<table class="ui celled table">
<thead>
<tr>
<th>Piso</th>
@for ($i = 1; $i <= $max_unidades; $i ++)
<th>{{$i}}</th>
@endfor
</tr>
</thead>
<tbody>
@foreach ($pisos as $piso)
<tr>
<td>{{$piso->descripcion}}</td>
@for ($i = 1; $i <= $max_unidades; $i ++)
@if (!isset($piso->unidades[$i]))
<td style="min-width: 12ex;"></td>
@continue
@endif
<?php $unidad = $piso->unidades[$i] ?>
<td style="min-width: 12ex;">
<strong>{{$unidad->descripcion}}</strong>
<br />
{{$unidad->tipologia()->tipologia()->descripcion}}
<br />
{{format('ufs', $unidad->precio()->valor, null, true)}}
<br />
@if ($unidad->isVendida())
<span style="color: white; background-color: darkgreen; width: 100%; padding: 2px;">{{format('shortDate', $unidad->venta()->fecha)}}</span>
@endif
<br />
@if ($unidad->isReservada())
<span style="color: white; background-color: olive; padding: 2px;">{{format('shortDate', $unidad->cierre()->fecha)}}</span>
@endif
</td>
@endfor
</tr>
@endforeach
<tr>
<td>
<div style="color: white; background-color: darkgreen; min-width: 5ex; text-align: center">
<strong>
{{array_reduce($totales, function($sum, $item) {
return $sum + $item->ventas;
})}}
</strong>
</div>
<div style="color: white; background-color: olive; min-width: 5ex; text-align: center;">
<strong>
{{array_reduce($totales, function($sum, $item) {
return $sum + $item->reservas;
})}}
</strong>
</div>
</td>
@for ($i = 1; $i <= $max_unidades; $i ++)
<td>
<div style="color: white; background-color: darkgreen; min-width: 12ex; text-align: center;"><strong>{{$totales[$i]->ventas}}</strong></div>
<div style="color: white; background-color: olive; min-width: 12ex; text-align: center;"><strong>{{$totales[$i]->reservas}}</strong></div>
</td>
@endfor
</tr>
</tbody>
</table>
@endsection