Base
This commit is contained in:
80
resources/views/proyectos/add.blade.php
Normal file
80
resources/views/proyectos/add.blade.php
Normal file
@ -0,0 +1,80 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Proyecto</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'proyectos', 'a' => 'agregar'])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Nombre</div>
|
||||
<div class="col-md-5"><input type="text" name="descripcion" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Inmobiliaria</div>
|
||||
<div class="col-md-4"><select name="inmobiliaria" class="form-control">
|
||||
@foreach ($inmobiliarias as $inmobiliaria)
|
||||
<option value="{{$inmobiliaria->rut}}"
|
||||
@if ($inmobiliaria->rut == $rut)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$inmobiliaria->abreviacion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Dirección</div>
|
||||
<div class="col-md-4"><input type="text" name="calle" class="form-control" /></div>
|
||||
<div class="col-md-1"><input type="text" name="numero" class="form-control" /></div>
|
||||
<div class="col-md-3"><input type="text" name="extra" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-4"><select name="region" class="form-control">
|
||||
@foreach ($regiones as $region)
|
||||
<option value="{{$region->id}}"
|
||||
@if ($region->numeral == 'RM')
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$region->descripcion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
<div class="col-md-4"><select name="comuna" class="form-control"></select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Fecha de Inicio</div>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Agregar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("select[name='region']").change(function(e) {
|
||||
changeRegion($(this).val());
|
||||
});
|
||||
changeRegion($("select[name='region']").val());
|
||||
|
||||
$.post('{!!nUrl('ajax', 'calles', ['ajax' => true])!!}', function(data) {
|
||||
$("input[name='calle']").typeahead({"source": data});
|
||||
}, 'json');
|
||||
$("input[name='extra']").typeahead({"source": ['Casa', 'Departamento', 'Oficina', 'Villa']});
|
||||
});
|
||||
function changeRegion(region) {
|
||||
var jq_comunas = $("select[name='comuna']");
|
||||
var region = $("select[name='region']").val();
|
||||
jq_comunas.html('');
|
||||
return $.post('{!!url('', ['p' => 'ajax', 'a' => 'comunas', 'ajax' => true])!!}', {"region": region}, function(data) {
|
||||
info = $.parseJSON(data);
|
||||
$.each(info, function(i, e) {
|
||||
jq_comunas.append(
|
||||
$('<option></option>').attr('value', e.id).html(e.descripcion)
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
98
resources/views/proyectos/advance.blade.php
Normal file
98
resources/views/proyectos/advance.blade.php
Normal file
@ -0,0 +1,98 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Avanzar Proyecto</h3>
|
||||
</div>
|
||||
<br />
|
||||
@if ($proyecto->estado()->tipo()->etapa()->descripcion == 'Construcción' and (float) $proyecto->avances()[count($proyecto->avances())-1]->avance < 1)
|
||||
<form method="post" class="form-horizontal" action="{{nUrl('proyectos', 'avance', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12"><h4>{{$proyecto->descripcion}}</h4></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-5">{{$proyecto->estado()->tipo()->descripcion}}</div>
|
||||
<div class="col-md-2">{{format('shortDate', $proyecto->estado()->fecha)}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">% Avance</div>
|
||||
<div class="col-md-1"><input type="text" name="avance" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado de Pago</div>
|
||||
<div class="col-md-1"><input type="text" name="numero" class="form-control" placeholder="{{count($proyecto->avances()) + 1}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Valor Estado de Pago [UF]</div>
|
||||
<div class="col-md-3"><input type="text" name="estado_pago" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-2"><button class="form-control">Avanzar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@else
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'proyectos', 'a' => 'avanzar', 'proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12"><h4>{{$proyecto->descripcion}}</h4></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-5">{{$proyecto->estado()->tipo()->descripcion}}</div>
|
||||
<div class="col-md-2">{{format('shortDate', $proyecto->estado()->fecha)}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Nuevo Estado</div>
|
||||
<div class="col-md-4"><select name="estado" class="form-control">
|
||||
<?php $etapa = ''; $group = false ?>
|
||||
@foreach ($estados as $estado)
|
||||
@if ($etapa != $estado->etapa()->descripcion)
|
||||
<?php $etapa = $estado->etapa()->descripcion?>
|
||||
@if ($group)
|
||||
</optgroup>
|
||||
@endif
|
||||
<optgroup label="{{$etapa}}">
|
||||
<?php $group = true ?>
|
||||
@endif
|
||||
<option value="{{$estado->id}}">{{$estado->descripcion}}</option>
|
||||
@endforeach
|
||||
@if ($group)
|
||||
</optgroup>
|
||||
@endif
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<div class="col-md-1"><select name="day" class="form-control">
|
||||
<?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
@for ($i = 0; $i < 31; $i ++)
|
||||
<option value="{{$i + 1}}"
|
||||
@if ($i + 1 == $t->day)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
<div class="col-md-1"><select name="month" class="form-control">
|
||||
@for ($i = 0; $i < 12; $i ++)
|
||||
<option value="{{$i + 1}}"
|
||||
@if ($i + 1 == $t->month)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
<div class="col-md-2"><select name="year" class="form-control">
|
||||
@for ($i = $t->year; $i > $t->year - 5; $i --)
|
||||
<option value="{{$i}}">{{$i}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-3"><input type="submit" value="Avanzar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
@endsection
|
15
resources/views/proyectos/avance.blade.php
Normal file
15
resources/views/proyectos/avance.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
<div class="progress">
|
||||
<?php
|
||||
$total = 1;
|
||||
if ($proyecto->estado()->tipo()->orden < max($estados) - 1 and count($proyecto->estados()) > 1) {
|
||||
$tf = \Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'));
|
||||
$t0 = \Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'));
|
||||
$df = $tf->diffInSeconds($t0);
|
||||
$hoy = \Carbon\Carbon::now(config('app.timezone'));
|
||||
$dh = $hoy->diffInSeconds($t0);
|
||||
$total = $df / $dh;
|
||||
}
|
||||
$valor = round(($proyecto->estado()->tipo()->orden + 1) / max($estados) * 100 * $total);
|
||||
?>
|
||||
<div class="progress-bar" style="width: {{$valor}}%">{{$valor}}%</div>
|
||||
</div>
|
39
resources/views/proyectos/avances/edit.blade.php
Normal file
39
resources/views/proyectos/avances/edit.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Edit Avance - {{$avance->proyecto()->descripcion}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{nUrl('proyectos', 'edit_avance', ['avance' => $avance->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado de Pago</div>
|
||||
<div class="col-md-1">{{$avance->numero}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<?php $f = $avance->fecha() ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">% Avance</div>
|
||||
<div class="col-md-1"><input type="text" name="avance" class="form-control" value="{{$avance->avance * 100}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Valor Estado de Pago [UF]</div>
|
||||
<div class="col-md-3"><input type="text" name="estado_pago" class="form-control" value="{{$avance->estado_pago}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Pagado [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="pagado" class="form-control" value="{{$avance->pagado}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">Fecha</div>
|
||||
<?php $f = $avance->fechaPago(); $id = '_pago' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-2"><button class="form-control">Editar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
27
resources/views/proyectos/avances_row.blade.php
Normal file
27
resources/views/proyectos/avances_row.blade.php
Normal file
@ -0,0 +1,27 @@
|
||||
<tr>
|
||||
<td>EP {{$avance->numero}}</td>
|
||||
<td>{{$avance->pagare()->id}}</td>
|
||||
<td style="min-width: 150px;">
|
||||
<div class="progress">
|
||||
<div class="progress-bar" style="width: {{round($avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round($avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance > 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-warning" style="width: {{round(100 - $avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round(100 - $avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance <= 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{format('shortDate', $avance->fecha)}}</td>
|
||||
<td>{{format('ufs', $avance->estado_pago)}}</td>
|
||||
<td>{{format('shortDate', $avance->pagare()->fecha)}}</td>
|
||||
<td>{{format('ufs', $avance->pagare()->valor())}}</td>
|
||||
<th>{{format('ufs', $total_avance)}}</th>
|
||||
<th>{{format('ufs', $total_deuda)}}</th>
|
||||
<th>{{format('ufs', $total_dif)}}</th>
|
||||
</tr>
|
336
resources/views/proyectos/construccion.blade.php
Normal file
336
resources/views/proyectos/construccion.blade.php
Normal file
@ -0,0 +1,336 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3>Construcción Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-md-2"><b>Estado de Pago</b></div>
|
||||
<div class="col-md-10"><b>Avance</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@foreach ($proyecto->avances() as $avance)
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
@if ($avance->numero == 0)
|
||||
Anticipo
|
||||
@else
|
||||
{{$avance->numero}}
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="progress" style="margin: 2px 0;">
|
||||
<div class="progress-bar" style="width: {{round($avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round($avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance > 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-warning" style="width: {{round(100 - $avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round(100 - $avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance <= 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">
|
||||
Estado de Pago
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th colspan="4" class="text-center">Pagado</th>
|
||||
<th rowspan="2">
|
||||
Pagaré
|
||||
<a href="{{nUrl('pagares', 'add', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon small glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th colspan="4" class="text-center">Deuda</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Real</th>
|
||||
<th>Diferencia</th>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Abonado</th>
|
||||
<th>Diferencia</th>
|
||||
<th>Intereses</th>
|
||||
<th class="small">% Intereses</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $totales = (object) [
|
||||
'avance' => (object) [
|
||||
'pagado' => 0,
|
||||
'real' => 0,
|
||||
'dif' => 0
|
||||
],
|
||||
'deuda' => (object) [
|
||||
'pagare' => 0,
|
||||
'abonado' => 0,
|
||||
'dif' => 0,
|
||||
'intereses' => 0
|
||||
],
|
||||
'dif' => 0,
|
||||
'dif_real' => 0
|
||||
] ?>
|
||||
@foreach ($proyecto->avances() as $i => $avance)
|
||||
<?php
|
||||
$totales->avance->pagado += $avance->estado_pago;
|
||||
$totales->avance->real += $avance->pagado();
|
||||
if ($avance->pagado() > 0) {
|
||||
$totales->avance->dif += $avance->pagado() - $avance->estado_pago;
|
||||
}
|
||||
if ($avance->pagares()) {
|
||||
$arr = $avance->pagares();
|
||||
$totales->deuda->pagare += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->valor();
|
||||
});
|
||||
$totales->deuda->abonado += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->abonado();
|
||||
});
|
||||
$totales->deuda->dif += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->abonado() - $item->valor();
|
||||
});
|
||||
$totales->deuda->intereses += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->intereses();
|
||||
});
|
||||
$totales->dif += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->valor();
|
||||
}) - $avance->estado_pago;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{nUrl('proyectos', 'editar_avance', ['avance' => $avance->id])}}">
|
||||
@if ($avance->numero == 0)
|
||||
Anticipo
|
||||
@else
|
||||
{{$avance->numero}}</a>
|
||||
@endif
|
||||
</a>
|
||||
</td>
|
||||
<td>{{format('shortDate', $avance->fecha)}}</td>
|
||||
<td class="text-right">{{format('ufs', $avance->estado_pago)}}</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagado() > 0)
|
||||
{{format('ufs', $avance->pagado())}}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagado() > 0)
|
||||
{{format('ufs', $avance->estado_pago - $avance->pagado())}}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
<a href="{{nUrl('pagares', 'show', ['pagare' => $pagare->id])}}">
|
||||
{{$pagare->id}} ({{$pagare->moneda()->descripcion}})
|
||||
</a><br />
|
||||
@endforeach
|
||||
@else
|
||||
--
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('shortDate', $pagare->fecha)}} ({{$pagare->duracion}})<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('ufs', $pagare->valor())}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('ufs', $pagare->abonado())}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagare())
|
||||
{{format('ufs', $pagare->abonado() - $pagare->valor())}}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('ufs', - $pagare->intereses())}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right small">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('percent', round($pagare->intereses() / $pagare->valor() * 100, 2), null, true)}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td><b>Total</b></td>
|
||||
<td></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->avance->pagado)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->avance->real)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', - $totales->avance->dif)}}</b></td>
|
||||
<td colspan="2"></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->deuda->pagare)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->deuda->abonado)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->deuda->dif)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', - $totales->deuda->intereses)}}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<b>Diferencias en Caja</b>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<canvas id="estados_pago"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var estados_pago = []
|
||||
var pagado = []
|
||||
var abonado = []
|
||||
var diferencia = []
|
||||
var intereses = []
|
||||
var colores_dif = []
|
||||
function setUp() {
|
||||
@foreach ($proyecto->avances() as $avance)
|
||||
estados_pago.push({{$avance->numero}})
|
||||
pagado.push(({{$avance->pagado()}}).toFixed(2))
|
||||
valor = 0
|
||||
if (diferencia.length > 0) {
|
||||
valor = parseFloat(diferencia[diferencia.length - 1])
|
||||
}
|
||||
valor2 = 0
|
||||
if (intereses.length > 0) {
|
||||
valor2 = parseFloat(intereses[intereses.length - 1])
|
||||
}
|
||||
@if ($avance->pagares())
|
||||
<?php $arr = $avance->pagares() ?>
|
||||
abonado.push({{array_reduce($arr, function($sum, $item) {return $sum + $item->abonado();})}}.toFixed(2))
|
||||
diferencia.push((valor + {{array_reduce($arr, function($sum, $item) {return $sum + $item->abonado();}) - $avance->pagado()}}).toFixed(2))
|
||||
intereses.push((valor2 + {{array_reduce($arr, function($sum, $item) {return $sum + $item->intereses();})}}).toFixed(2))
|
||||
@else
|
||||
abonado.push(0)
|
||||
diferencia.push((valor + {{-$avance->pagado()}}).toFixed(2))
|
||||
intereses.push(valor2.toFixed(2))
|
||||
@endif
|
||||
if (diferencia[diferencia.length - 1] < 0) {
|
||||
colores_dif.push('rgba(255, 0, 0, 1)')
|
||||
} else {
|
||||
colores_dif.push('rgba(0, 255, 0, 1)')
|
||||
}
|
||||
@endforeach
|
||||
console.debug(intereses)
|
||||
}
|
||||
function formatNumber(number, decimals = 2, dec_sep = ',', thou_sep = '.') {
|
||||
var arr = ('' + number).split('.')
|
||||
var num = arr[0]
|
||||
var dec = arr.length > 1 ? dec_sep + arr[1] : ''
|
||||
var rgx = /(\d+)(\d{3})/
|
||||
while (rgx.test(num)) {
|
||||
num = num.replace(rgx, '$1' + thou_sep + '$2')
|
||||
}
|
||||
return num + dec
|
||||
}
|
||||
function build() {
|
||||
var ctx = $('#estados_pago').get(0).getContext('2d')
|
||||
var chart = new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: estados_pago,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Abonado por Banco',
|
||||
data: abonado,
|
||||
backgroundColor: 'rgba(0, 255, 255, 1)'
|
||||
},
|
||||
{
|
||||
label: 'Pagado a Constructora',
|
||||
data: pagado,
|
||||
backgroundColor: 'rgba(0, 0, 255, 1)'
|
||||
},
|
||||
{
|
||||
label: 'Diferencia',
|
||||
data: diferencia,
|
||||
backgroundColor: colores_dif
|
||||
},
|
||||
{
|
||||
label: 'Intereses',
|
||||
data: intereses,
|
||||
backgroundColor: 'rgba(255, 255, 0, 1)'
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [{
|
||||
afterTickToLabelConversion: (axis) => {
|
||||
$.each(axis.ticks, (i, el) => {
|
||||
axis.ticks[i] = formatNumber(parseInt(el))
|
||||
})
|
||||
return axis
|
||||
}
|
||||
}]
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
title: (tooltipItem, data) => {
|
||||
var ep = data.labels[tooltipItem[0].index]
|
||||
var label = 'Anticipo'
|
||||
if (ep > 0) {
|
||||
label = 'EP ' + ep
|
||||
}
|
||||
return label
|
||||
},
|
||||
label: (tooltipItem, data) => {
|
||||
var label = data.datasets[tooltipItem.datasetIndex].label || ''
|
||||
if (label) {
|
||||
label += ': '
|
||||
}
|
||||
label += formatNumber(tooltipItem.yLabel)
|
||||
return label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$(document).ready(function() {
|
||||
setUp()
|
||||
build()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
36
resources/views/proyectos/disponibles.blade.php
Normal file
36
resources/views/proyectos/disponibles.blade.php
Normal file
@ -0,0 +1,36 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col h3">Unidades Disponibles - <a href="{{url('', ['p' => 'proyectos', 'a' => 'show', 'proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a> [{{count($proyecto->unidadesDisponibles())}}]</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo</th>
|
||||
<th>Unidad</th>
|
||||
<th>Piso</th>
|
||||
<th>m² Vendibles</th>
|
||||
<th>Valor Referencial</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyecto->unidadesDisponibles() as $unidad)
|
||||
<tr>
|
||||
<td>{{ucwords($unidad->tipo()->descripcion)}}</td>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
<td>{{$unidad->piso}}</td>
|
||||
<td>
|
||||
@if ($unidad->tipo == 1)
|
||||
{{$unidad->m2('vendible')}}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{format('ufs', (($unidad->precio()) ? $unidad->precio()->valor : $unidad->valor) ?: 0, null, true)}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
42
resources/views/proyectos/estimado.blade.php
Normal file
42
resources/views/proyectos/estimado.blade.php
Normal file
@ -0,0 +1,42 @@
|
||||
@if (count($proyecto->ventas()) > 0 and $proyecto->valores()->estimados->departamentos->cantidad > 0)
|
||||
<tr>
|
||||
<td>Estimado Total</td>
|
||||
<td colspan="2">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
UF Total<br />
|
||||
Bruto - Neto
|
||||
</th>
|
||||
<th>UF/m² Neto</th>
|
||||
<th>UF Promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->vendidos->ingreso->bruto + $proyecto->valores()->estimados->ingreso->bruto, null, true)}} - {{format('ufs', $proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto, null, true)}}</td>
|
||||
<td>{{format('ufs', ($proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto) / $proyecto->superficie('vendible'), null, true)}}</td>
|
||||
<td>{{format('ufs', ($proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto) / count($proyecto->unidades(1)), null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Estacionamientos y Bodegas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="3">{{format('ufs', $proyecto->valores()->vendidos->otros->valor + $proyecto->valores()->estimados->otros->valor, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<th colspan="2">{{format('ufs', $proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto + $proyecto->valores()->vendidos->otros->valor + $proyecto->valores()->estimados->otros->valor, null, true)}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
74
resources/views/proyectos/historia.blade.php
Normal file
74
resources/views/proyectos/historia.blade.php
Normal file
@ -0,0 +1,74 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="row">
|
||||
<div class="col-md-6">
|
||||
Historial Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body"><?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
<th>Fecha</th>
|
||||
<th>Duración</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$estados = [];
|
||||
foreach ($proyecto->estados() as $estado) {
|
||||
$estados[$estado->fecha] []= $estado;
|
||||
}
|
||||
ksort($estados);
|
||||
$ff = null;
|
||||
?>
|
||||
@foreach ($estados as $fecha => $es)
|
||||
<?php
|
||||
$f = \Carbon\Carbon::parse($fecha, config('app.timezone'));
|
||||
usort($es, function($a, $b) {
|
||||
return $a->tipo()->orden - $b->tipo()->orden;
|
||||
});
|
||||
$estado = $es[count($es) - 1];
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
{{$estado->tipo()->etapa()->descripcion}}
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$estado->tipo()->descripcion}}</td>
|
||||
<td>
|
||||
@if ($f->timestamp > 0)
|
||||
{{$f->format('d M Y')}}
|
||||
@else
|
||||
--
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($ff !== null)
|
||||
{{$f->longAbsoluteDiffForHumans($ff)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php $ff = $f; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
82
resources/views/proyectos/historia.blade.php.old
Normal file
82
resources/views/proyectos/historia.blade.php.old
Normal file
@ -0,0 +1,82 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="row">
|
||||
<div class="col-md-6">
|
||||
Historial Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body"><?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fecha</th>
|
||||
<th></th>
|
||||
<th>Duración</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$estados = [];
|
||||
foreach ($proyecto->estados() as $estado) {
|
||||
$estados[$estado->fecha] []= $estado;
|
||||
}
|
||||
ksort($estados);
|
||||
$ff = \Carbon\Carbon::parse('0', config('app.timezone'));
|
||||
?>
|
||||
@foreach ($estados as $fecha => $es)
|
||||
<?php
|
||||
$f = \Carbon\Carbon::parse($fecha, config('app.timezone'));
|
||||
usort($es, function($a, $b) {
|
||||
return $a->tipo()->orden - $b->tipo()->orden;
|
||||
});
|
||||
?>
|
||||
<tr>
|
||||
<td>{{$f->format('d M Y')}}</td>
|
||||
<td>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($es as $estado)
|
||||
<tr>
|
||||
<td>
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
{{$estado->tipo()->etapa()->descripcion}}
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$estado->tipo()->descripcion}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
@if ($f->diffInYears($ff) < 100)
|
||||
{{$f->longAbsoluteDiffForHumans($ff)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php $ff = $f; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
42
resources/views/proyectos/list.blade.php
Normal file
42
resources/views/proyectos/list.blade.php
Normal file
@ -0,0 +1,42 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="h3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
Proyectos
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'add')}}">
|
||||
<span class="glyphicon small glyphicon-plus"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Proyecto</th>
|
||||
<th>Inmobiliaria</th>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
<th>Tiempo Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'show', 'proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></td>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'list', 'inmobiliaria' => $proyecto->inmobiliaria()->id])}}">{{$proyecto->inmobiliaria()->abreviacion}}</a></td>
|
||||
<td>{{$proyecto->estado()->tipo()->etapa()->descripcion}}</td>
|
||||
<td>{{$proyecto->estado()->tipo()->descripcion}} ({{\Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'))->diffForHumans()}})</td>
|
||||
<td>
|
||||
{{\Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'))->diffForHumans()}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
29
resources/views/proyectos/operadores/add.blade.php
Normal file
29
resources/views/proyectos/operadores/add.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Operadores - {{$proyecto->descripcion}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{nUrl('operadores', 'add', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Operadores</div>
|
||||
<div class="col-md-3">
|
||||
<select name="operadores[]" multiple="multiple">
|
||||
@foreach ($operadores as $operador)
|
||||
<option value="{{$operador->id}}"
|
||||
@if (array_search($operador, $vigentes) !== false)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$operador->abreviacion}}
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-3">
|
||||
<button class="form-control" type="submit">Agregar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
62
resources/views/proyectos/pagares/add.blade.php
Normal file
62
resources/views/proyectos/pagares/add.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Pagaré
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon small glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_add', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado Pago</div>
|
||||
<div class="col-md-1"><input type="text" name="estado_pago" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Número</div>
|
||||
<div class="col-md-3"><input type="text" name="numero" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Moneda</div>
|
||||
<div class="col-md-2">
|
||||
<select name="moneda" class="form-control">
|
||||
<option value="UF">UF</option>
|
||||
<option value="Pesos">Pesos</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Capital</div>
|
||||
<div class="col-md-3"><input type="text" name="capital" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Otorgado</div>
|
||||
<?php $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abonado</div>
|
||||
<?php unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Abonado [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="abonado" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Agregar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
44
resources/views/proyectos/pagares/add_renovacion.blade.php
Normal file
44
resources/views/proyectos/pagares/add_renovacion.blade.php
Normal file
@ -0,0 +1,44 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Renovación Pagaré <a href="{{nUrl('pagares', 'show', ['pagare' => $pagare->id])}}">{{$pagare->id}}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_add_renovacion', ['pagare' => $pagare->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<?php $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración [días]</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" class="form-control" /></div>
|
||||
<div class="col-md-3 small">* Pagaré {{$pagare->duracion}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Insoluto [{{$pagare->moneda()->descripcion}}]</div>
|
||||
<div class="col-md-3"><input type="text" name="insoluto" class="form-control" value="{{$pagare->capital}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" class="form-control" /></div>
|
||||
<div class="col-md-2 small">* Pagaré {{format('percent', $pagare->tasa, null, true)}} </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Intereses [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="intereses" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abono</div>
|
||||
<?php unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Agregar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
66
resources/views/proyectos/pagares/edit.blade.php
Normal file
66
resources/views/proyectos/pagares/edit.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Pagaré <a href="{{nUrl('pageres', 'show', ['pagare' => $pagare->id])}}">{{$pagare->id}}</a></h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_edit', ['pagare' => $pagare->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado Pago</div>
|
||||
<div class="col-md-1"><input type="text" name="estado_pago" value="{{$pagare->estado_pago}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Número</div>
|
||||
<div class="col-md-3"><input type="text" name="numero" value="{{$pagare->id}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Moneda</div>
|
||||
<div class="col-md-2">
|
||||
<select name="moneda" class="form-control">
|
||||
<option value="UF"
|
||||
@if (strtolower($pagare->moneda()->descripcion) == 'uf')
|
||||
selected="selected"
|
||||
@endif
|
||||
>UF</option>
|
||||
<option value="Pesos"
|
||||
@if (strtolower($pagare->moneda()->descripcion) == 'pesos')
|
||||
selected="selected"
|
||||
@endif
|
||||
>Pesos</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Capital</div>
|
||||
<div class="col-md-3"><input type="text" name="capital" value="{{$pagare->capital}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" value="{{$pagare->tasa}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Otorgado</div>
|
||||
<?php $f = $pagare->fechaBanco(); $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" class="form-control" value="{{$pagare->duracion}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abonado</div>
|
||||
<?php $f = $pagare->fecha(); unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Abonado [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="abonado" class="form-control" value="{{$pagare->abonado}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Editar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
45
resources/views/proyectos/pagares/edit_renovacion.blade.php
Normal file
45
resources/views/proyectos/pagares/edit_renovacion.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Renovación
|
||||
{{array_search($renovacion, $renovacion->pagare()->renovaciones()) + 1}}
|
||||
Pagaré <a href="{{nUrl('pagares', 'show', ['pagare' => $renovacion->pagare])}}">{{$renovacion->pagare}}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_edit_renovacion', ['renovacion' => $renovacion->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<?php $f = $renovacion->fechaBanco(); $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración [días]</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" value="{{$renovacion->duracion}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Insoluto [{{$renovacion->pagare()->moneda()->descripcion}}]</div>
|
||||
<div class="col-md-3"><input type="text" name="insoluto" value="{{$renovacion->insoluto}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" value="{{$renovacion->tasa}}" class="form-control" /></div>
|
||||
<div class="col-md-2 small">* Pagaré {{format('percent', $renovacion->pagare()->tasa, null, true)}} </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Intereses [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="intereses" value="{{$renovacion->intereses}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abono</div>
|
||||
<?php $f = $renovacion->fecha(); unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Editar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
100
resources/views/proyectos/pagares/show.blade.php
Normal file
100
resources/views/proyectos/pagares/show.blade.php
Normal file
@ -0,0 +1,100 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-6 h3">
|
||||
Pagaré {{$pagare->id}}
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $pagare->proyecto()->id])}}">
|
||||
<span class="glyphicon small glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6 h3 text-right">
|
||||
<a href="{{nUrl('pagares', 'edit', ['pagare' => $pagare->id])}}">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Estado Pago</td>
|
||||
<td>
|
||||
{{$pagare->estado_pago}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Moneda</td>
|
||||
<td>{{$pagare->moneda()->descripcion}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Capital</td>
|
||||
<td>{{format('ufs', $pagare->valor(), null, true)}}</td>
|
||||
<td>{{format('pesos', $pagare->valor('pesos'), null, true)}}</td>
|
||||
<td>{{format('shortDate', $pagare->fecha_banco)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Abonado</td>
|
||||
<td>{{format('ufs', $pagare->abonado(), null, true)}}</td>
|
||||
<td>{{format('pesos', $pagare->abonado('pesos'), null, true)}}</td>
|
||||
<td>
|
||||
@if ($pagare->fecha != '0000-00-00')
|
||||
{{format('shortDate', $pagare->fecha)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tasa Anualizada</td>
|
||||
<td colspan="3">{{format('percent', $pagare->tasa, null, true)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Duración</td>
|
||||
<td>{{$pagare->duracion}}</td>
|
||||
<td colspan="2">{{format('shortDate', $pagare->vencimiento()->format('Y-m-d'))}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@if ($pagare->renovaciones())
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Renovaciones</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fecha Renovación</th>
|
||||
<th>Intereses Pagados</th>
|
||||
<th>
|
||||
<a href="{{nUrl('pagares', 'add_renovacion', ['pagare' => $pagare->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $total = 0 ?>
|
||||
@foreach ($pagare->renovaciones() as $renovacion)
|
||||
<?php $total += $renovacion->intereses() ?>
|
||||
<tr>
|
||||
<td>
|
||||
{{format('shortDate', $renovacion->fecha)}}
|
||||
({{$renovacion->duracion}})
|
||||
{{format('shortDate', $renovacion->vencimiento()->format('Y-m-d'))}}
|
||||
</td>
|
||||
<td>{{format('ufs', $renovacion->intereses(), null, true)}}</td>
|
||||
<td>
|
||||
<a href="{{nUrl('pagares', 'edit_renovacion', ['renovacion' => $renovacion->id])}}">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td><b>Total</b></td>
|
||||
<td colspan="2"><b>{{format('ufs', $total, null, true)}}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<a href="{{nUrl('pagares', 'add_renovacion', ['pagare' => $pagare->id])}}">Agregar Renovación</a>
|
||||
@endif
|
||||
@endsection
|
66
resources/views/proyectos/por_vender.blade.php
Normal file
66
resources/views/proyectos/por_vender.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@if (count($proyecto->unidades()) > 0 and $proyecto->valores()->estimados->departamentos->cantidad > 0)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'disponibles', 'proyecto' => $proyecto->id])}}">Por vender</a></td>
|
||||
<td colspan="2">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>% Por Vender</th>
|
||||
<th>m² promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{$proyecto->valores()->estimados->departamentos->cantidad}}</td>
|
||||
<td>{{\App\Helper\Format::number($proyecto->valores()->estimados->departamentos->cantidad / count($proyecto->unidades(1)) * 100, 2)}} %</td>
|
||||
<td>{!!format('m2', $proyecto->valores()->estimados->departamentos->mts->vendibles->promedio, null, true)!!}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>UF Estimado<br />
|
||||
Bruto - Neto
|
||||
</th>
|
||||
<th>UF/m² Neto</th>
|
||||
<th>UF promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->ingreso->bruto, null, true)}} - {{format('ufs', $proyecto->valores()->estimados->ingreso->neto, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->departamentos->uf_m2->promedio, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->departamentos->precio->promedio, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Estacionamientos</th>
|
||||
<th>Bodegas</th>
|
||||
<th>Valor Estimado</th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{count($proyecto->unidadesDisponibles(2))}}</td>
|
||||
<td>{{count($proyecto->unidadesDisponibles(3))}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->otros->valor, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Operador</th>
|
||||
<th>Bono Pie</th>
|
||||
<th>Premios</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->comision, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->bono->valor, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->premios(), null, true)}}</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
72
resources/views/proyectos/reservas/base.blade.php
Normal file
72
resources/views/proyectos/reservas/base.blade.php
Normal file
@ -0,0 +1,72 @@
|
||||
@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
|
230
resources/views/proyectos/show.blade.php
Normal file
230
resources/views/proyectos/show.blade.php
Normal file
@ -0,0 +1,230 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-6 h3">Proyecto - {{$proyecto->descripcion}}</div>
|
||||
<div class="col-md-6 h3 text-right"><a href="{{url('', ['p' => 'proyectos', 'a' => 'edit', 'proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-edit"></span></a></div>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Dirección</td>
|
||||
<td>{{$proyecto->direccion()->completa(true)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inmobiliaria</td>
|
||||
<td colspan="2"><a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'show', 'rut' => $proyecto->inmobiliaria()->rut])}}">{{$proyecto->inmobiliaria()->abreviacion}}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inicio</td>
|
||||
<td>{{$proyecto->estados()[0]->tipo()->descripcion}} [{{$proyecto->estados()[0]->tipo()->etapa()->descripcion}}]] ({{format('shortDate', $proyecto->estados()[0]->fecha)}})
|
||||
(<?php
|
||||
$today = \Carbon\Carbon::today(config('app.timezone'));
|
||||
$f = \Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'));
|
||||
?>{{$f->diffForHumans($today)}})
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Estado <a href="{{nUrl('proyectos', 'historial', ['proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-list-alt"></span></a></td>
|
||||
<td>{{$proyecto->estado()->tipo()->descripcion}}
|
||||
@if ($proyecto->estado()->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
[{{$proyecto->estado()->tipo()->etapa()->descripcion}}]
|
||||
@if ($proyecto->estado()->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
({{format('shortDate', $proyecto->estado()->fecha)}}) (<?php
|
||||
$f = \Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'));
|
||||
?>{{$f->diffForHumans($today)}})</td>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'advance', 'proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-chevron-right"></span></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>@include('proyectos.avance')
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Operadores</td>
|
||||
<td>
|
||||
@if ($proyecto->operadoresVigentes())
|
||||
{{array_reduce($proyecto->operadoresVigentes(), function($list, $item) {
|
||||
return trim($list . ', ' . $item->agente()->agente()->abreviacion, ', ');
|
||||
})}}
|
||||
@endif
|
||||
<a href="{{nUrl('operadores', 'agregar', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@include('proyectos.superficies')
|
||||
@if (count($proyecto->proyectoTipoUnidades()) > 0)
|
||||
<tr>
|
||||
<td>Departamentos</td>
|
||||
<td colspan="2"><a href="{{nUrl('proyectos', 'list_unidades', ['proyecto' => $proyecto->id])}}">{{count($proyecto->unidades(1))}}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pisos</td>
|
||||
<td colspan="2">{{$proyecto->pisos()}}</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"><a href="{{url('', ['p' => 'proyectos', 'a' => 'add_tipo_unidad', 'proyecto' => $proyecto->id])}}">Agregar tipo de unidad <span class="glyphicon glyphicon-plus"></span></a></td>
|
||||
</tr>
|
||||
@endif
|
||||
@include('proyectos.ventas')
|
||||
@include('proyectos.por_vender')
|
||||
@include('proyectos.estimado')
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: center;">
|
||||
<canvas id="ventas_un" width="400" height="300" style="display: inline;"></canvas>
|
||||
<canvas id="ventas_uf" width="400" height="300" style="display: inline;"></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="text-center">
|
||||
<table class="table">
|
||||
<tr id="graficos_unidades"></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: center;">
|
||||
<canvas id="ventas_pt" width="1000" height="400" style="display: inline;"></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@if (count($proyecto->unidades()) > 0)
|
||||
<script>
|
||||
function buildPie(chart_id, data, options) {
|
||||
var ctx = document.getElementById(chart_id).getContext('2d')
|
||||
var vData = {
|
||||
datasets: [{
|
||||
data: data.values,
|
||||
backgroundColor: data.colors
|
||||
}],
|
||||
labels: data.labels
|
||||
}
|
||||
var vOptions = {
|
||||
responsive: false,
|
||||
title: {
|
||||
display: true,
|
||||
text: options.title
|
||||
},
|
||||
legend: {
|
||||
position: 'right'
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
label: changeLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
return chart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: vData,
|
||||
options: vOptions
|
||||
})
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@if ($proyecto->ventas())
|
||||
buildPie('ventas_un', {
|
||||
values: [
|
||||
{{count($proyecto->ventas())}},
|
||||
{{$proyecto->valores()->estimados->departamentos->cantidad}}
|
||||
],
|
||||
colors: [
|
||||
'rgba(0, 200, 0, .7)',
|
||||
'rgba(200, 0, 0, .7)'
|
||||
],
|
||||
labels: [
|
||||
'Vendida',
|
||||
'Por Vender'
|
||||
]
|
||||
}, {
|
||||
title: 'Unidades Vendidas'
|
||||
})
|
||||
buildPie('ventas_uf', {
|
||||
values: [
|
||||
{{round($proyecto->valores()->vendidos->ingreso->bruto, 0)}},
|
||||
{{round($proyecto->valores()->estimados->ingreso->bruto, 0)}}
|
||||
],
|
||||
colors: [
|
||||
'rgba(0, 200, 0, .7)',
|
||||
'rgba(200, 0, 0, .7)'
|
||||
],
|
||||
labels: [
|
||||
'Vendida',
|
||||
'Estimada'
|
||||
]
|
||||
}, {
|
||||
title: 'UF Neto Vendida'
|
||||
})
|
||||
|
||||
var width = {{floor(1000 / count($ventas_pt->data))}}
|
||||
<?php $c = 0 ?>
|
||||
@foreach ($ventas_pt->data as $tipo => $data)
|
||||
chart = $('<td></td>').append(
|
||||
$('<canvas></canvas>').attr('id', 'chart_{{$tipo}}').attr('width', width).attr('height', 300)
|
||||
)
|
||||
$('#graficos_unidades').append(chart)
|
||||
buildPie('chart_{{$tipo}}', {
|
||||
values: [
|
||||
{{$ventas_pt->totales[$tipo] * $data[count($data) - 1] / 100}},
|
||||
{{$ventas_pt->totales[$tipo] * (1 - $data[count($data) - 1] / 100)}}
|
||||
],
|
||||
colors: ['rgba(0, 255, 0, .7)', 'rgba(255, 0, 0, .7)'],
|
||||
labels: ['Vendido', 'Total']
|
||||
}, {
|
||||
title: '{{$tipo}}'
|
||||
})
|
||||
@endforeach
|
||||
|
||||
ctx = document.getElementById('ventas_pt').getContext('2d');
|
||||
vData = {
|
||||
labels: ["{!!implode('", "', $ventas_pt->fields)!!}"],
|
||||
datasets: [
|
||||
<?php $c = 0 ?>
|
||||
@foreach ($ventas_pt->data as $tipo => $data)
|
||||
{
|
||||
data: [{{implode(', ', $data)}}],
|
||||
borderColor: '{{$colors[$c]}}',
|
||||
backgroundColor: '{{$colors[$c ++]}}',
|
||||
fill: false,
|
||||
label: "{{$tipo}}"
|
||||
},
|
||||
@endforeach
|
||||
]
|
||||
}
|
||||
vOptions = {
|
||||
responsive: false,
|
||||
title: {
|
||||
display: true,
|
||||
text: "% Unidades Vendidas por Tipo"
|
||||
},
|
||||
legend: {
|
||||
position: 'bottom'
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
max: 100
|
||||
}
|
||||
}]
|
||||
}
|
||||
};
|
||||
ventas = new Chart(ctx, {
|
||||
type: "line",
|
||||
data: vData,
|
||||
options: vOptions
|
||||
})
|
||||
@endif
|
||||
})
|
||||
</script>
|
||||
@endif
|
||||
@endpush
|
97
resources/views/proyectos/superficies.blade.php
Normal file
97
resources/views/proyectos/superficies.blade.php
Normal file
@ -0,0 +1,97 @@
|
||||
@if ($proyecto->superficie('total') != null)
|
||||
<tr>
|
||||
<td>Superficies</td>
|
||||
<td colspan="2">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Total</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('total'), null, true)!!}</td>
|
||||
<td rowspan="6">
|
||||
<canvas id="superficies" width="300" height="200"></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sobre Nivel</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('snt'), null, true)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bajo Nivel</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('bnt'), null, true)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vendible</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('vendible'), null, true)!!}</td>
|
||||
</tr>
|
||||
@if (count($proyecto->ventas()) > 0)
|
||||
<tr>
|
||||
<td>Vendido</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('vendida'), null, true)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Por Vender</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('por vender'), null, true)!!}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@push('scripts')
|
||||
@if ($proyecto->superficie('total') != null)
|
||||
<script>
|
||||
Number.prototype.formatMoney = function(c, d, t) {
|
||||
var n = this,
|
||||
c = isNaN(c = Math.abs(c)) ? 2 : c,
|
||||
d = d == undefined ? "." : d,
|
||||
t = t == undefined ? "," : t,
|
||||
s = n < 0 ? "-" : "",
|
||||
i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))),
|
||||
j = ((j = i.length) > 3) ? j % 3 : 0;
|
||||
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
|
||||
};
|
||||
function changeLabel(tooltipItem, data) {
|
||||
var label = data.labels[tooltipItem.index] || '';
|
||||
var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
|
||||
var total = data.datasets[tooltipItem.datasetIndex].data.reduce((a, b) => a + b, 0);
|
||||
if (label) {
|
||||
label += ': ';
|
||||
}
|
||||
label += value.formatMoney(0, ',', '.') + ' (' + Math.round(value / total * 100, 1) + '%)';
|
||||
return label;
|
||||
}
|
||||
var ctx = document.getElementById('superficies').getContext('2d');
|
||||
var sData = {
|
||||
"datasets": [{
|
||||
"data": [
|
||||
{{(($proyecto->superficie('vendible') > 0) ? round($proyecto->superficie('vendida') / $proyecto->superficie('vendible') * 100, 2) : 0)}},
|
||||
{{(($proyecto->superficie('vendible') > 0) ? round($proyecto->superficie('por vender') / $proyecto->superficie('vendible') * 100, 2) : 0)}}
|
||||
],
|
||||
"backgroundColor": ['rgba(0, 200, 0, .7)', 'rgba(200, 0, 0, .7)']
|
||||
}],
|
||||
"labels": ["Vendida", "Por Vender"]
|
||||
};
|
||||
var sOptions = {
|
||||
"responsive": false,
|
||||
"title": {
|
||||
"display": true,
|
||||
"text": "Superfice Vendible"
|
||||
},
|
||||
"legend": {
|
||||
"position": 'right'
|
||||
},
|
||||
"tooltips": {
|
||||
"callbacks": {
|
||||
"label": changeLabel
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var superficies = new Chart(ctx, {
|
||||
"type": "pie",
|
||||
"data": sData,
|
||||
"options": sOptions
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
@endpush
|
44
resources/views/proyectos/tipo_unidades/add.blade.php
Normal file
44
resources/views/proyectos/tipo_unidades/add.blade.php
Normal file
@ -0,0 +1,44 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h2>Agregar Tipo Unidad - <a href="{{nUrl('proyectos', 'list_unidades', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></h2>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('proyectos', 'agregar_tipo_unidad', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Tipo</div>
|
||||
<div class="col-md-3"><select name="tipo" class="form-control">
|
||||
@foreach ($tipos as $tipo)
|
||||
<option value="{{$tipo->id}}">{{ucwords($tipo->descripcion)}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Nombre</div>
|
||||
<div class="col-md-3"><input type="text" name="nombre" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Abreviación</div>
|
||||
<div class="col-md-3"><input type="text" name="abreviacion" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">m²</div>
|
||||
<div class="col-md-2">Interior</div>
|
||||
<div class="col-md-2">Logia</div>
|
||||
<div class="col-md-2">Terraza</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-1"><input type="text" name="m2" class="form-control" /></div>
|
||||
<div class="col-md-offset-1 col-md-1"><input type="text" name="logia" class="form-control" /></div>
|
||||
<div class="col-md-offset-1 col-md-1"><input type="text" name="terraza" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Descripción</div>
|
||||
<div class="col-md-5"><textarea class="form-control" name="descripcion" rows="5"></textarea></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Agregar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
43
resources/views/proyectos/tipo_unidades/edit.blade.php
Normal file
43
resources/views/proyectos/tipo_unidades/edit.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h2>Editar Tipo Unidad - <a href="{{nUrl('proyecto', 'list_unidades', ['proyecto' => $tipo->proyecto()->id])}}">{{$tipo->proyecto()->descripcion}}</a></h2>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('proyecto_tipo_unidades', 'editar', ['tipo_unidad' => $tipo->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Tipo</div>
|
||||
<div class="col-md-3"><select name="tipo" class="form-control">
|
||||
@foreach ($tipos as $t)
|
||||
<option value="{{$t->id}}"
|
||||
@if ($t->id == $tipo->tipo)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{ucwords($t->descripcion)}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Nombre</div>
|
||||
<div class="col-md-3"><input type="text" name="nombre" class="form-control" value="{{$tipo->nombre}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Abreviación</div>
|
||||
<div class="col-md-3"><input type="text" name="abreviacion" class="form-control" value="{{$tipo->abreviacion}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">m²</div>
|
||||
<div class="col-md-1"><input type="text" name="m2" class="form-control" value="{{$tipo->m2}}" /></div>
|
||||
<div class="col-md-1"><input type="text" name="logia" class="form-control" value="{{$tipo->logia}}" /></div>
|
||||
<div class="col-md-1"><input type="text" name="terraza" class="form-control" value="{{$tipo->terraza}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Descripción</div>
|
||||
<div class="col-md-5"><textarea class="form-control" name="descripcion" rows="5">{{$tipo->descripcion}}</textarea></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Editar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
110
resources/views/proyectos/unidades/add.blade.php
Normal file
110
resources/views/proyectos/unidades/add.blade.php
Normal file
@ -0,0 +1,110 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Unidades - <a href="{{nUrl('proyectos', 'list_unidades', ['proyecto' => $tipo->proyecto()->id])}}">{{$tipo->proyecto()->descripcion}}</a> - {{$tipo->nombre}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-2">Tipo</div>
|
||||
<div class="col-md-3">{{$tipo->nombre}}</div>
|
||||
<div class="col-md-2">
|
||||
@if ($tipo->tipologia())
|
||||
{{$tipo->tipologia()->descripcion}}
|
||||
@else
|
||||
{{$tipo->abreviacion}}
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-2">{{format('m2', $tipo->m2())}} m²</div>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'unidades', 'a' => 'agregar', 'tipo' => $tipo->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Total Departamentos por Piso</div>
|
||||
<div class="col-md-1"><input type="text" name="total" maxlength="2" class="form-control" /></div>
|
||||
<div class="col-md-offset-7 col-md-1 text-right"><span class="glyphicon glyphicon-plus agregar" id="agregar_unidad"></span></div>
|
||||
<div class="col-md-1"><input type="text" size="3" maxlength="3" id="unis" value="1" class="form-control" /></div>
|
||||
<input type="hidden" name="unidades" value="[1]" />
|
||||
</div>
|
||||
<div class="form-group" id="primero">
|
||||
<div class="col-md-2">Línea</div>
|
||||
<div class="col-md-1"><input type="text" name="linea1" maxlength="2" class="form-control" /></div>
|
||||
<div class="col-md-2">Orientación</div>
|
||||
<div class="col-md-2">
|
||||
<?php $orientaciones = ['N', 'NO', 'O', 'SO', 'S', 'SP', 'P', 'NP'] ?>
|
||||
<select name="orientacion1" class="form-control">
|
||||
@foreach ($orientaciones as $orientacion)
|
||||
<option value="{{$orientacion}}">{{$orientacion}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">Pisos</div>
|
||||
<div class="col-md-1"><input type="text" name="piso_ini1" maxlength="3" class="form-control" /></div>
|
||||
<div class="col-md-1"><input type="text" name="piso_end1" maxlength="3" class="form-control" /></div>
|
||||
</div>
|
||||
<div id="unidades"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Agregar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var unidades = [1];
|
||||
$(document).ready(function() {
|
||||
$('#agregar_unidad').click(function(e) {
|
||||
var cnt = $('#unis').val();
|
||||
for (var i = 0; i < cnt; i ++) {
|
||||
addUnidad();
|
||||
}
|
||||
});
|
||||
});
|
||||
function addUnidad() {
|
||||
var n = unidades[unidades.length - 1] + 1;
|
||||
if (unidades.length == 0) {
|
||||
n = 1
|
||||
}
|
||||
unidades[unidades.length] = n;
|
||||
|
||||
var orientaciones = $('<select></select>').attr('name', 'orientacion' + n).attr('class', 'form-control')
|
||||
@foreach ($orientaciones as $orientacion)
|
||||
orientaciones.append($('<option></option>').attr('value', '{{$orientacion}}').html('{{$orientacion}}'))
|
||||
@endforeach
|
||||
|
||||
$('#unidades').append(
|
||||
$('<div></div>').attr('class', 'form-group').append(
|
||||
$('<div></div>').attr('class', 'col-md-2').html('Línea')
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-1').append($('<input/>').attr('type', 'text').attr('name', 'linea' + n).attr('maxlength', 2).attr('class', 'form-control'))
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-2').html('Orientación')
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-2').append(orientaciones)
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-2').html('Pisos')
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-1').append($('<input/>').attr('type', 'text').attr('name', 'piso_ini' + n).attr('maxlength', 3).attr('class', 'form-control'))
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-1').append($('<input/>').attr('type', 'text').attr('name', 'piso_end' + n).attr('maxlength', 3).attr('class', 'form-control'))
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-1').append($('<span></span>').attr('class', 'glyphicon glyphicon-minus remover').attr('id', 'remover_unidad' + n).attr('data-id', n))
|
||||
)
|
||||
)
|
||||
|
||||
$("input[name='unidades']").val(JSON.stringify(unidades));
|
||||
$('#remover_unidad' + n).click(function(e) {
|
||||
i = $(this).attr('data-id');
|
||||
removeUnidad(i);
|
||||
});
|
||||
}
|
||||
function removeUnidad(n) {
|
||||
var unis = $('#unidades');
|
||||
unis.find("input[name='linea" + n + "']").parent().parent().next().remove();
|
||||
unis.find("input[name='linea" + n + "']").parent().parent().remove();
|
||||
i = unidades.binaryIndexOf(n);
|
||||
unidades.splice(i, 1);
|
||||
$("input[name='unidades']").val(JSON.stringify(unidades));
|
||||
}
|
||||
</script>
|
||||
@endpush
|
86
resources/views/proyectos/unidades/add2.blade.php
Normal file
86
resources/views/proyectos/unidades/add2.blade.php
Normal file
@ -0,0 +1,86 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Unidades - <a href="{{nUrl('proyectos', 'list_unidades', ['proyecto' => $tipo->proyecto()->id])}}">{{$tipo->proyecto()->descripcion}}</a> - {{$tipo->nombre}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-2">Tipo</div>
|
||||
<div class="col-md-3">{{$tipo->nombre}}</div>
|
||||
<div class="col-md-2">{{$tipo->abreviacion}}</div>
|
||||
<div class="col-md-2">{{format('m2', $tipo->m2())}} m²</div>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'unidades', 'a' => 'agregar', 'tipo' => $tipo->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Unidades</div>
|
||||
<div class="col-md-1" id="n_unidades"></div>
|
||||
<div class="col-md-offset-7 col-md-1 text-right"><span class="glyphicon glyphicon-plus agregar" id="agregar_unidad"></span></div>
|
||||
<div class="col-md-1"><input type="text" size="3" maxlength="3" id="unis" value="1" class="form-control" /></div>
|
||||
<input type="hidden" name="unidades" value="[1]" />
|
||||
</div>
|
||||
<div class="form-group" id="primero">
|
||||
<div class="col-md-2">Descripción</div>
|
||||
<div class="col-md-2"><input type="text" name="descripcion1" class="form-control" /></div>
|
||||
<div class="col-md-2">Piso</div>
|
||||
<div class="col-md-1"><input type="text" name="piso1" maxlength="3" class="form-control" /></div>
|
||||
</div>
|
||||
<div id="unidades"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Agregar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var unidades = [1];
|
||||
$(document).ready(function() {
|
||||
$('#agregar_unidad').click(function(e) {
|
||||
var cnt = $('#unis').val();
|
||||
for (var i = 0; i < cnt; i ++) {
|
||||
addUnidad();
|
||||
}
|
||||
});
|
||||
$('#n_unidades').html(unidades.length)
|
||||
});
|
||||
function addUnidad() {
|
||||
var n = unidades[unidades.length - 1] + 1;
|
||||
if (unidades.length == 0) {
|
||||
n = 1
|
||||
}
|
||||
unidades[unidades.length] = n;
|
||||
$('#n_unidades').html(unidades.length)
|
||||
|
||||
$('#unidades').append(
|
||||
$('<div></div>').attr('class', 'form-group').append(
|
||||
$('<div></div>').attr('class', 'col-md-2').html('Descripción')
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-2').append($('<input/>').attr('type', 'text').attr('name', 'descripcion' + n).attr('class', 'form-control'))
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-2').html('Piso')
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-1').append($('<input/>').attr('type', 'text').attr('name', 'piso' + n).attr('maxlength', 3).attr('class', 'form-control'))
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'col-md-1').append($('<span></span>').attr('class', 'glyphicon glyphicon-minus remover').attr('id', 'remover_unidad' + n).attr('data-id', n))
|
||||
)
|
||||
)
|
||||
|
||||
$("input[name='unidades']").val(JSON.stringify(unidades));
|
||||
$('#remover_unidad' + n).click(function(e) {
|
||||
i = $(this).attr('data-id');
|
||||
removeUnidad(i);
|
||||
});
|
||||
}
|
||||
function removeUnidad(n) {
|
||||
var unis = $('#unidades');
|
||||
unis.find("input[name='descripcion" + n + "']").parent().parent().next().remove();
|
||||
unis.find("input[name='descripcion" + n + "']").parent().parent().remove();
|
||||
i = unidades.binaryIndexOf(n);
|
||||
unidades.splice(i, 1);
|
||||
$('#n_unidades').html(unidades.length)
|
||||
$("input[name='unidades']").val(JSON.stringify(unidades));
|
||||
}
|
||||
</script>
|
||||
@endpush
|
38
resources/views/proyectos/unidades/assign.blade.php
Normal file
38
resources/views/proyectos/unidades/assign.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h2>Asignar Tipo a Unidades - <a href="{{nUrl('proyectos', 'list_unidades', ['proyecto', $proyecto->id])}}">{{$proyecto->descripcion}}</a></h2>
|
||||
</div>
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('proyecto_tipo_unidades', 'asignar', ['proyecto' => $proyecto->id])}}">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Unidad</th>
|
||||
<th>Tipo</th>
|
||||
<th>PT</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($libres as $unidad)
|
||||
<tr>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
<td>{{$unidad->tipo()->descripcion}}</td>
|
||||
<td><select name="tipo{{$unidad->id}}" class="form-control">
|
||||
<option value="0">---</option>
|
||||
@foreach ($tipos as $tipo)
|
||||
<option value="{{$tipo->id}}"
|
||||
@if ($tipo->tipo == $unidad->tipo)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$tipo->descripcion}}</option>
|
||||
@endforeach
|
||||
</select></td>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button class="form-control" type="submit">Asignar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
52
resources/views/proyectos/unidades/edit.blade.php
Normal file
52
resources/views/proyectos/unidades/edit.blade.php
Normal file
@ -0,0 +1,52 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h2>Editar Unidad - <a href="{{nUrl('proyectos', 'list_unidades', ['proyecto' => $unidad->proyecto()->id])}}">{{$unidad->proyecto()->descripcion}}</a> - {{$unidad->descripcion}}</h2>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('unidades', 'editar', ['unidad' => $unidad->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Tipo</div>
|
||||
<div class="col-md-3"><select name="tipo" class="form-control">
|
||||
@foreach ($tipos as $tipo)
|
||||
<option value="{{$tipo->id}}"
|
||||
@if ($tipo->id == $unidad->pt)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{ucwords($tipo->tipo()->descripcion)}} {{$tipo->abreviacion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Descripción</div>
|
||||
<div class="col-md-3"><input name="descripcion" type="text" class="form-control" value="{{$unidad->descripcion}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Piso</div>
|
||||
<div class="col-md-2"><input type="text" name="piso" class="form-control" value="{{$unidad->piso}}" /></div>
|
||||
<div class="col-md-2">Línea</div>
|
||||
<div class="col-md-2"><input type="text" name="linea" class="form-control" value="{{$unidad->subtipo}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Orientación</div>
|
||||
<div class="col-md-3"><select name="orientacion" class="form-control">
|
||||
<option value=""
|
||||
@if ("" == $unidad->orientacion)
|
||||
selected="selected"
|
||||
@endif
|
||||
>---</option>
|
||||
@foreach ($orientaciones as $orientacion)
|
||||
<option value="{{$orientacion->abreviacion}}"
|
||||
@if ($orientacion->abreviacion == $unidad->orientacion)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$orientacion->descripcion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button class="form-control" type="submit">Editar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
197
resources/views/proyectos/unidades/list.blade.php
Normal file
197
resources/views/proyectos/unidades/list.blade.php
Normal file
@ -0,0 +1,197 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<?php $cnt = []; $pisos = [] ?>
|
||||
<div class="page-heading">
|
||||
<h2>Unidades - <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></h2>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo</th>
|
||||
<th>Nombre</th>
|
||||
<th>Abreviación</th>
|
||||
<th>Líneas</th>
|
||||
<th>m² Útil</th>
|
||||
<th>m² Terraza</th>
|
||||
<th>m² Vendible</th>
|
||||
<th>m² Total</th>
|
||||
<th>Descripción</th>
|
||||
<th>#</th>
|
||||
<th><a href="{{nUrl('proyectos', 'add_tipo_unidad', ['proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-plus"></span></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyecto->proyectoTipoUnidades() as $tipo)
|
||||
<tr class="show-unidades" data-status="closed" data-tipo="{{$tipo->id}}">
|
||||
<td>{{ucwords($tipo->tipo()->descripcion)}}</td>
|
||||
<td>{{$tipo->nombre}}</td>
|
||||
<td>
|
||||
@if ($tipo->tipologia())
|
||||
{{$tipo->tipologia()->descripcion}}
|
||||
@else
|
||||
{{$tipo->abreviacion}}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$tipo->lineas()}}</td>
|
||||
<td>{{format('m2', $tipo->m2 + $tipo->logia)}}</td>
|
||||
<td>{{format('m2', $tipo->terraza)}}</td>
|
||||
<td>{{format('m2', $tipo->m2())}}</td>
|
||||
<td>{{format('m2', $tipo->m2('total'))}}</td>
|
||||
<td>
|
||||
@if ($tipo->tipologia())
|
||||
{{$tipo->tipologia()->detalle}}
|
||||
@else
|
||||
{{$tipo->descripcion}}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{count($tipo->unidades())}}</td>
|
||||
<td><a href="{{nUrl('proyecto_tipo_unidades', 'edit', ['tipo_unidad' => $tipo->id])}}"><span class="glyphicon glyphicon-edit"></span></a></td>
|
||||
</tr>
|
||||
<tr class="unidades" data-tipo="{{$tipo->id}}">
|
||||
<td></td>
|
||||
<td colspan="8">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Piso</th>
|
||||
<th>Línea</th>
|
||||
<th>Orientación</th>
|
||||
<th class="text-right">
|
||||
<a href="{{nUrl('proyecto_tipo_unidades', 'add_unidad', ['tipo_unidad' => $tipo->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $subtipo = '' ?>
|
||||
@foreach ($tipo->unidades() as $unidad)
|
||||
@if ($subtipo != $unidad->subtipo)
|
||||
<?php $subtipo = $unidad->subtipo; $cnt[$tipo->nombre."-".$subtipo] = 0; $pisos[$tipo->nombre."-".$subtipo] = [] ?>
|
||||
<tr data-id="{{$tipo->nombre}}-{{$subtipo}}" data-status="closed" class="subtipo">
|
||||
<th>Línea {{$subtipo}}</th>
|
||||
<th class="pisos_subtipo" data-subtipo="{{$tipo->nombre}}-{{$subtipo}}"></th>
|
||||
<th>{{$subtipo}}</th>
|
||||
<th>{{$unidad->orientacion}}</th>
|
||||
<th class="cantidad_subtipo" data-subtipo="{{$tipo->nombre}}-{{$subtipo}}"></th>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
<td>{{$unidad->piso}}</td>
|
||||
<td>{{$unidad->subtipo}}</td>
|
||||
<td>{{$unidad->orientacion}}</td>
|
||||
<td class="text-right">
|
||||
<a href="{{nUrl('unidades', 'edit', ['unidad' => $unidad->id])}}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
<a href="{{nUrl('unidades', 'remove', ['unidad' => $unidad->id, 'proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-remove"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($subtipo != '') {
|
||||
$cnt[$tipo->nombre."-".$subtipo] ++;
|
||||
$pisos[$tipo->nombre."-".$subtipo] []= $unidad->piso;
|
||||
}
|
||||
?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@if (count($libres) > 0)
|
||||
<tr class="show-unidades" data-status="closed" data-tipo="libres">
|
||||
<td>Libres</td>
|
||||
<td colspan="5"></td>
|
||||
<td><a href="{{nUrl('proyecto_tipo_unidades', 'assign', ['proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-chevron-right"></span></a></td>
|
||||
</tr>
|
||||
<tr class="unidades" data-tipo="libres">
|
||||
<td></td>
|
||||
<td colspan="7">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Piso</th>
|
||||
<th>Línea</th>
|
||||
<th>Orientación</th>
|
||||
<th>Valor</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($libres as $unidad)
|
||||
<tr>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
<td>{{$unidad->piso}}</td>
|
||||
<td>{{$unidad->subtipo}}</td>
|
||||
<td>{{$unidad->orientacion}}</td>
|
||||
<td>{{format('ufs', $unidad->valor, null, true)}}</td>
|
||||
<td>
|
||||
<a href="{{nUrl('unidades', 'edit', ['unidad' => $unidad->id])}}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
<a href="{{nUrl('unidades', 'remove', ['unidad' => $unidad->id, 'proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-remove"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var cnt = {
|
||||
@foreach ($cnt as $subtipo => $c)
|
||||
"{{$subtipo}}": {{$c}},
|
||||
@endforeach
|
||||
}
|
||||
var pisos = {
|
||||
@foreach ($pisos as $subtipo => $piso)
|
||||
"{{$subtipo}}": "{{min($piso)}} - {{max($piso)}}",
|
||||
@endforeach
|
||||
}
|
||||
console.debug(pisos)
|
||||
$('.unidades').hide()
|
||||
$('.cantidad_subtipo').each(function(i, el) {
|
||||
var id = $(this).attr('data-subtipo')
|
||||
$(this).html(cnt[id])
|
||||
})
|
||||
$('.pisos_subtipo').each(function(i, el) {
|
||||
var id = $(this).attr('data-subtipo')
|
||||
$(this).html(pisos[id])
|
||||
})
|
||||
$('.show-unidades').css('cursor', 'pointer').click(function(e) {
|
||||
var id = $(this).attr('data-tipo')
|
||||
var status = $(this).attr('data-status')
|
||||
if (status == 'open') {
|
||||
$(".unidades[data-tipo='" + id + "']").hide()
|
||||
$(this).attr('data-status', 'closed')
|
||||
} else {
|
||||
$(".unidades[data-tipo='" + id + "']").show()
|
||||
if ($(".unidades[data-tipo='" + id + "']").find('.subtipo').length > 0) {
|
||||
$(".unidades[data-tipo='" + id + "']").find('tbody tr').hide()
|
||||
$(".unidades[data-tipo='" + id + "']").find('.subtipo').show()
|
||||
}
|
||||
$(this).attr('data-status', 'open')
|
||||
}
|
||||
})
|
||||
$('.subtipo').css('cursor', 'pointer').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
var status = $(this).attr('data-status')
|
||||
if (status == 'open') {
|
||||
$(this).nextUntil('.subtipo').hide()
|
||||
$(this).attr('data-status', 'closed')
|
||||
} else {
|
||||
$(this).nextUntil('.subtipo').show()
|
||||
$(this).attr('data-status', 'open')
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
29
resources/views/proyectos/unidades/proyectos.blade.php
Normal file
29
resources/views/proyectos/unidades/proyectos.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="h3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
Unidades de Proyectos
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Proyecto</th>
|
||||
<th>Inmobiliaria</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'unidades', 'proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></td>
|
||||
<td>{{$proyecto->inmobiliaria()->abreviacion}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
87
resources/views/proyectos/ventas.blade.php
Normal file
87
resources/views/proyectos/ventas.blade.php
Normal file
@ -0,0 +1,87 @@
|
||||
@if (count($proyecto->ventas()) > 0)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{url('', ['p' => 'ventas', 'a' => 'list', 'proyecto' => $proyecto->id])}}">Ventas</a>
|
||||
@if ($proyecto->estado()->tipo()->etapa()->orden >= 4)
|
||||
<br />
|
||||
<a href="{{nUrl('proyectos', 'reservas', ['proyecto' => $proyecto->id])}}">
|
||||
<i class="building icon"></i>
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>% Vendido</th>
|
||||
<th>m²</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{count($proyecto->ventas())}}</td>
|
||||
<td>{{\App\Helper\Format::number(count($proyecto->ventas())/count($proyecto->unidades(1)) * 100, 2)}} %</td>
|
||||
<td>{{\App\Helper\Format::number($proyecto->valores()->vendidos->departamentos->mts->vendibles->total, 2)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
UF vendido<br/>
|
||||
Bruto - Neto
|
||||
</th>
|
||||
<th>UF/m² Neto</th>
|
||||
<th>UF promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{{format('ufs', $proyecto->valores()->vendidos->ingreso->bruto, null, true)}} - {{\App\Helper\Format::ufs($proyecto->valores()->vendidos->ingreso->neto, true)}}
|
||||
<br />
|
||||
{{format('ufs', $proyecto->valores()->vendidos->ingreso->abonado, null, true)}} ({{format('ufs', $proyecto->valores()->vendidos->ingreso->pagado, null, true)}})
|
||||
</td>
|
||||
<td>{{\App\Helper\Format::ufs($proyecto->valores()->vendidos->departamentos->uf_m2->promedio, true)}}</td>
|
||||
<td>{{\App\Helper\Format::ufs($proyecto->valores()->vendidos->departamentos->precio->promedio, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Estacionamientos</th>
|
||||
<th>Bodegas</th>
|
||||
<th>Valor Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{count($proyecto->unidades(2)) - count($proyecto->unidadesDisponibles(2))}}</td>
|
||||
<td>{{count($proyecto->unidades(3)) - count($proyecto->unidadesDisponibles(3))}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->vendidos->otros->valor, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Operadores</th>
|
||||
<th>Bono Pie</th>
|
||||
<th>Premios</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->vendidos->comision, null, true)}} ({{format('percent', $proyecto->valores()->vendidos->comision / $proyecto->valores()->vendidos->ingreso->neto * 100, null, true)}} Neto)</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->vendidos->bono->valor, null, true)}} ({{format('percent', $proyecto->valores()->vendidos->bono->valor / $proyecto->valores()->vendidos->ingreso->neto * 100, null, true)}} Neto)</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->vendidos->premios(), null, true)}} ({{format('percent', $proyecto->valores()->vendidos->premios() / $proyecto->valores()->vendidos->ingreso->neto * 100, null, true)}} Neto)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ingreso Total</th>
|
||||
<th>{{format('ufs', $proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->vendidos->otros->valor, null, true)}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
Reference in New Issue
Block a user