Resources
This commit is contained in:
190
resources/views/ventas/cierres/list.blade.php
Normal file
190
resources/views/ventas/cierres/list.blade.php
Normal file
@ -0,0 +1,190 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Cierres</h3>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5">Proyecto</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<tr>
|
||||
<td class="openProyecto" data-id="{{$proyecto->id}}" data-status="closed" colspan="5">
|
||||
{{$proyecto->descripcion}}
|
||||
<span class="glyphicon arrow glyphicon-chevron-down"></span>
|
||||
[{{count($proyecto->cierres())}}]
|
||||
</td>
|
||||
</tr>
|
||||
@if (count($proyecto->cierres(2)) > 0)
|
||||
<tr class="estado-cierres warning" data-status="closed" data-proyecto="{{$proyecto->id}}" data-estado="2">
|
||||
<th></th>
|
||||
<th colspan="4">
|
||||
Aprobado
|
||||
<span class="glyphicon arrow glyphicon-chevron-down"></span>
|
||||
[{{count($proyecto->cierres(2))}}] {{format('percent', count($proyecto->cierres(2)) / count($proyecto->cierres()) * 100, null, true)}}
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="cierre" data-id="{{$proyecto->id}}" data-estado="2">
|
||||
<th></th>
|
||||
<th>Departamento</th>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Estado</th>
|
||||
</tr>
|
||||
@foreach ($proyecto->cierres(2) as $cierre)
|
||||
<tr class="cierre warning" data-id="{{$proyecto->id}}" data-estado="2">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="{{nUrl('cierres', 'show', ['cierre' => $cierre->id])}}">
|
||||
{{$cierre->unidadPrincipal()->unidad()->descripcion}}
|
||||
({{$cierre->unidadPrincipal()->unidad()->tipologia()->tipologia()->descripcion}})
|
||||
</a>
|
||||
</td>
|
||||
<td>{{format('shortDate', $cierre->fecha)}}</td>
|
||||
<td>
|
||||
{{format('ufs', $cierre->neto(), null, true)}}
|
||||
({{format('ufs', $cierre->uf_m2(), null, true)}}/m²)
|
||||
</td>
|
||||
<td>
|
||||
{{ucfirst($cierre->estado()->tipo()->descripcion)}}
|
||||
@if (!$cierre->propietario())
|
||||
(Sin propietario)
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (count($proyecto->cierres(3)) > 0)
|
||||
<tr class="estado-cierres success" data-status="closed" data-proyecto="{{$proyecto->id}}" data-estado="3">
|
||||
<td></td>
|
||||
<th colspan="4">
|
||||
Promesado
|
||||
<span class="glyphicon arrow glyphicon-chevron-down"></span>
|
||||
[{{count($proyecto->cierres(3))}}] {{format('percent', count($proyecto->cierres(3)) / count($proyecto->cierres()) * 100, null, true)}}
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="cierre" data-id="{{$proyecto->id}}" data-estado="3">
|
||||
<th></th>
|
||||
<th>Departamento</th>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Estado</th>
|
||||
</tr>
|
||||
@foreach ($proyecto->cierres(3) as $cierre)
|
||||
<tr class="cierre success" data-id="{{$proyecto->id}}" data-estado="3">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="{{url('', ['p' => 'cierres', 'a' => 'show', 'cierre' => $cierre->id])}}">
|
||||
{{$cierre->unidadPrincipal()->unidad()->descripcion}}
|
||||
({{$cierre->unidadPrincipal()->unidad()->tipologia()->tipologia()->descripcion}})
|
||||
</a>
|
||||
</td>
|
||||
<td>{{format('shortDate', $cierre->fecha)}}</td>
|
||||
<td>
|
||||
{{format('ufs', $cierre->precio, null, true)}}
|
||||
({{format('ufs', $cierre->precio / $cierre->unidadPrincipal()->unidad()->m2(), null, true)}}/m²)
|
||||
</td>
|
||||
<td>
|
||||
@if ($cierre->estado()->tipo()->descripcion == 'promesado')
|
||||
<a href="{{nUrl('ventas', 'show', ['venta' => $cierre->promesa()->id])}}">
|
||||
@endif
|
||||
{{ucfirst($cierre->estado()->tipo()->descripcion)}}
|
||||
@if (!$cierre->propietario())
|
||||
(Sin propietario)
|
||||
@endif
|
||||
@if ($cierre->estado()->tipo()->descripcion == 'promesado')
|
||||
<span class="glyphicon small glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (count($proyecto->cierres(-1)))
|
||||
<tr class="estado-cierres danger" data-status="closed" data-proyecto="{{$proyecto->id}}" data-estado="-1">
|
||||
<td></td>
|
||||
<th colspan="4">
|
||||
Abandonado/Rechazado
|
||||
<span class="glyphicon arrow glyphicon-chevron-down"></span>
|
||||
[{{count($proyecto->cierres(-1))}}] {{format('percent', count($proyecto->cierres(-1)) / count($proyecto->cierres()) * 100, null, true)}}
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="cierre" data-id="{{$proyecto->id}}" data-estado="-1">
|
||||
<th></th>
|
||||
<th>Departamento</th>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Estado</th>
|
||||
</tr>
|
||||
@foreach ($proyecto->cierres(-1) as $cierre)
|
||||
<tr class="cierre danger" data-id="{{$proyecto->id}}" data-estado="-1">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="{{url('', ['p' => 'cierres', 'a' => 'show', 'cierre' => $cierre->id])}}">
|
||||
{{$cierre->unidadPrincipal()->unidad()->descripcion}}
|
||||
({{$cierre->unidadPrincipal()->unidad()->tipologia()->tipologia()->descripcion}})
|
||||
</a>
|
||||
</td>
|
||||
<td>{{format('shortDate', $cierre->fecha)}}</td>
|
||||
<td>
|
||||
{{format('ufs', $cierre->precio, null, true)}}
|
||||
({{format('ufs', $cierre->precio / $cierre->unidadPrincipal()->unidad()->m2(), null, true)}}/m²)
|
||||
</td>
|
||||
<td>
|
||||
{{ucfirst($cierre->estado()->tipo()->descripcion)}}
|
||||
@if (!$cierre->propietario())
|
||||
(Sin propietario)
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.cierre').hide()
|
||||
$('.estado-cierres').hide()
|
||||
$('.openProyecto').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
var status = $(this).attr('data-status')
|
||||
|
||||
if (status == 'closed') {
|
||||
$(this).attr('data-status', 'open')
|
||||
$('.estado-cierres[data-proyecto=' + id + ']').show()
|
||||
$(this).find('.glyphicon.arrow').attr('class', 'glyphicon arrow glyphicon-chevron-up')
|
||||
} else {
|
||||
$(this).attr('data-status', 'closed')
|
||||
$('.estado-cierres[data-proyecto=' + id + ']').hide()
|
||||
$('.estado-cierres[data-proyecto=' + id + ']').attr('data-status', 'closed')
|
||||
$('.estado-cierres[data-proyecto=' + id + ']').find('.glyphicon.arrow').attr('class', 'glyphicon arrow glyphicon-chevron-down')
|
||||
$('.cierre[data-id=' + id + ']').hide()
|
||||
$(this).find('.glyphicon.arrow').attr('class', 'glyphicon arrow glyphicon-chevron-down')
|
||||
}
|
||||
})
|
||||
$('.estado-cierres').css('cursor', 'pointer').click(function() {
|
||||
var proyecto = $(this).attr('data-proyecto')
|
||||
var estado = $(this).attr('data-estado')
|
||||
var status = $(this).attr('data-status')
|
||||
|
||||
if (status == 'closed') {
|
||||
$(this).attr('data-status', 'open')
|
||||
$('.cierre[data-id=' + proyecto + '][data-estado=' + estado + ']').show()
|
||||
$(this).find('.glyphicon.arrow').attr('class', 'glyphicon arrow glyphicon-chevron-up')
|
||||
} else {
|
||||
$(this).attr('data-status', 'closed')
|
||||
$('.cierre[data-id=' + proyecto + '][data-estado=' + estado + ']').hide()
|
||||
$(this).find('.glyphicon.arrow').attr('class', 'glyphicon arrow glyphicon-chevron-down')
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
Reference in New Issue
Block a user