This commit is contained in:
2020-12-01 17:23:13 -03:00
parent 09e8c226bb
commit 9852a8cbdc
274 changed files with 24706 additions and 0 deletions

View File

@ -0,0 +1,25 @@
@extends('layout.base')
@section('content')
<div class="row page-heading">
<h3><a href="{{url('', ['p' => 'ventas', 'a' => 'show', 'venta' => $venta->id])}}">Abonar Escritura - {{$venta->unidad()->descripcion}} - {{$venta->proyecto()->descripcion}}</a></h3>
</div>
<br />
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'escrituras', 'a' => 'abonado', 'venta' => $venta->id])}}">
<div class="form-group">
<div class="col-md-2">Fecha Pago</div>
<div class="col-md-3">{{format('shortDate', $venta->escritura()->pago()->estado()->fecha)}}</div>
</div>
<div class="form-group">
<div class="col-md-2">Fecha</div>
<?php $f = \Carbon\Carbon::parse($venta->escritura()->pago()->estado()->fecha, config('app.timezone')) ?>
@include('form.fecha')
</div>
<div class="form-group">
<div class="col-md-2">Valor Abonado [$]</div>
<div class="col-md-4"><input type="text" name="valor" class="form-control" value="{{$venta->escritura()->pago()->valor}}" /></div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Abonar" class="form-control" /></div>
</div>
@endsection

View File

@ -0,0 +1,219 @@
@extends('layout.base', ['titulo' => 'Escriturar'])
@section('content')
<div class="row page-heading">
<h3><a href="{{url('', ['p' => 'ventas', 'a' => 'show', 'venta' => $venta->id])}}">Escriturar - {{$venta->unidad()->descripcion}} - {{$venta->proyecto()->descripcion}}</a></h3>
</div>
<br />
<div class="row">
<div class="col-md-2">Faltante</div>
<div class="col-md-3">$ {{format('pesos', -$venta->saldo('pesos'))}}</div>
<div class="col-md-3">{{format('ufs', -$venta->saldo())}} UF</div>
</div>
<br />
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'escrituras', 'a' => 'agregar', 'venta' => $venta->id])}}">
<div class="form-group">
<div class="col-md-2">Fecha</div>
<?php $f = \Carbon\Carbon::today(config('app.timezone')) ?>
<div class="col-md-1">
<select name="escritura_day" class="form-control">
@for ($i = 0; $i < 31; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->day)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select>
</div>
<div class="col-md-1">
<select name="escritura_month" class="form-control">
@for ($i = 0; $i < 12; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->month)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select>
</div>
<div class="col-md-2">
<select name="escritura_year" class="form-control">
@for ($i = $f->year; $i > $f->year - 5; $i --)
<option value="{{$i}}">{{$i}}</option>
@endfor
</select>
</div>
</div>
@if ($venta->pie != 0 and $venta->pie()->reajuste == 0)
<div class="panel panel-default">
<div class="panel-heading fp-title" id="reajuste">Reajuste <span class="small glyphicon glyphicon-plus"></span></div>
<div class="panel-body fp-body">
<div class="form-group">
<div class="col-md-2">Valor [$]</div>
<div class="col-md-3"><input type="text" name="valor_reajuste" class="form-control" /></div>
</div>
<div class="form-group">
<div class="col-md-2">Fecha</div>
<div class="col-md-1">
<select name="reajuste_day" class="form-control fp-day">
@for ($i = 0; $i < 31; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->day)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select>
</div>
<div class="col-md-1">
<select name="reajuste_month" class="form-control fp-month">
@for ($i = 0; $i < 12; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->month)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select>
</div>
<div class="col-md-2">
<select name="reajuste_year" class="form-control fp-year">
@for ($i = $f->year; $i > $f->year - 5; $i --)
<option value="{{$i}}">{{$i}}</option>
@endfor
</select>
</div>
</div>
</div>
</div>
@endif
@if ($venta->escritura == 0)
<div class="panel panel-default">
<div class="panel-heading fp-title" id="escritura">Pago en Escritura <span class="small glyphicon glyphicon-plus"></span></div>
<div class="panel-body fp-body">
<div class="form-group">
<div class="col-md-2">Valor [$]</div>
<div class="col-md-4"><input type="text" name="escritura_valor" class="form-control" /></div>
</div>
<div class="form-group">
<div class="col-md-2">(Valor [UF])</div>
<div class="col-md-4"><input type="text" name="escritura_valor_uf" class="form-control" /></div>
</div>
<div class="form-group">
<div class="col-md-2">Fecha</div>
<div class="col-md-1">
<select name="pago_escritura_day" class="form-control fp-day">
@for ($i = 0; $i < 31; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->day)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select>
</div>
<div class="col-md-1">
<select name="pago_escritura_month" class="form-control fp-month">
@for ($i = 0; $i < 12; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->month)
selected="selected"
@endif
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
@endfor
</select>
</div>
<div class="col-md-2">
<select name="pago_escritura_year" class="form-control fp-year">
@for ($i = $f->year; $i > $f->year - 5; $i --)
<option value="{{$i}}">{{$i}}</option>
@endfor
</select>
</div>
</div>
</div>
</div>
@endif
@if ($venta->subsidio == 0)
<div class="panel panel-default">
<div class="panel-heading fp-title" id="subsidio">Subsidio <span class="small glyphicon glyphicon-plus"></span></div>
<div class="panel-body fp-body">
<div class="form-group">
<div class="col-md-2">Valor Ahorrado [UF]</div>
<div class="col-md-4"><input type="text" name="subsidio_ahorrado" class="form-control" /></div>
</div>
<div class="form-group">
<div class="col-md-2">Valor Subsidio [UF]</div>
<div class="col-md-4"><input type="text" name="subsidio_valor" class="form-control" /></div>
</div>
<div class="row">
<div class="col-md-2">Total</div>
<div class="col-md-4" id="subsidio_total"></div>
<div class="col-md-1">UF</div>
</div>
</div>
</div>
@endif
@if ($venta->credito == 0)
<div class="panel panel-default">
<div class="panel-heading fp-title" id="credito">Cr&eacute;dito <span class="small glyphicon glyphicon-plus"></span></div>
<div class="panel-body fp-body">
<div class="form-group">
<div class="col-md-2">Banco</div>
<div class="col-md-5"><input type="text" name="credito_banco" id="credito_banco" class="form-control" autocomplete="off" /></div>
</div>
<div class="form-group">
<div class="col-md-2">Valor [UF]</div>
<div class="col-md-4"><input type="text" name="credito_valor" class="form-control" /></div>
</div>
</div>
</div>
@elseif ($venta->credito()->pago()->banco == 0)
<div class="panel panel-default">
<div class="panel-heading">Cr&eacute;dito</div>
<div class="panel-body">
<div class="row form-group">
<div class="col-md-2">Valor [UF]</div>
<div class="col-md-4">{{format('ufs', $venta->credito()->pago()->valor('ufs'), null, true)}}</div>
</div>
<div class="form-group">
<div class="col-md-2">Banco</div>
<div class="col-md-5"><input type="text" name="credito_banco" id="credito_banco" class="form-control" autocomplete="off" /></div>
</div>
</div>
</div>
@endif
<div class="form-group">
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Escriturar" class="form-control" /></div>
</div>
</form>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function() {
$('.fp-body').toggle();
$('.fp-title').click(function(e) {
var body = $(this).next('.fp-body');
body.toggle();
body.find('input').val('');
body.find('select.fp-day').val({{$f->day}});
body.find('select.fp-month').val({{$f->month}});
body.find('select.fp-year').val({{$f->year}});
});
$('#subsidio').parent().find('input').change(function() {
changeSubsidio();
});
$.getJSON('{!!url('', ['p' => 'ajax', 'a' => 'buscar', 't' => 'bancos'])!!}', function(data, status, xhr) {
$('#credito_banco').typeahead({"source": data});
});
});
function changeSubsidio() {
var ahorro = parseFloat($("input[name='subsidio_ahorrado']").val()) || 0;
var valor = parseFloat($("input[name='subsidio_valor']").val()) || 0;
var total = ahorro + valor;
$('#subsidio_total').html(total);
}
</script>
@endpush

View File

@ -0,0 +1,53 @@
@extends('layout.base')
@section('content')
<div class="panel panel-default">
<div class="panel-heading">Editar Pago de Escritura - {{$venta->unidad()->descripcion}} - {{$venta->proyecto()->descripcion}}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" action="{{url('', ['p' => 'escrituras', 'a' => 'editar', 'venta' => $venta->id])}}">
<div class="form-group">
<div class="col-md-2">Valor [$]</div>
<div class="col-md-4"><input type="text" name="valor" value="{{$venta->escritura()->pago()->valor}}" class="form-control" /></div>
</div>
<div class="form-group">
<div class="col-md-2">(Valor [UF])</div>
<div class="col-md-4"><input type="text" name="valor_uf" value="{{$venta->escritura()->pago()->valor('ufs')}}" class="form-control" /></div>
</div>
<div class="form-group">
<div class="col-md-2">Fecha</div>
<?php $f = \Carbon\Carbon::parse($venta->escritura()->pago()->fecha, config('app.timezone')) ?>
<div class="col-md-1"><select name="day" class="form-control">
@for ($i = 0; $i < 31; $i ++)
<option value="{{$i + 1}}"
@if ($i + 1 == $f->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 == $f->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 = $f->year + 1; $i > $f->year - 5; $i --)
<option value="{{$i}}"
@if ($i == $f->year)
selected="selected"
@endif
>{{$i}}</option>
@endfor
</select></div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Editar" class="form-control" /></div>
</div>
</form>
</div>
</div>
@endsection

View File

@ -0,0 +1,95 @@
@extends('layout.base')
@section('content')
<div class="panel panel-default">
<div class="panel-heading"><a href="{{url('', ['p' => 'ventas', 'a' => 'show', 'venta' => $venta->id])}}">Escritura - {{$venta->unidad()->descripcion}} - {{$venta->proyecto()->descripcion}}</a></div>
<div class="panel-body">
El departamento {{$venta->unidad()->descripcion}}:<br />
@if (count($venta->propiedad()->estacionamientos()) > 0)
@if (count($venta->propiedad()->estacionamientos()) > 1)
tiene los estacionamientos
@foreach ($venta->propiedad()->estacionamientos() as $i => $est)
@if ($i == count($venta->propiedad()->estacionamientos()) - 1)
y
@elseif ($i > 0)
,
@endif
{{$est->descripcion}}
@endforeach
@else
tiene el estacionamiento {{$venta->propiedad()->estacionamientos()[0]->descripcion}}
@endif
@else
no tiene estacionamientos
@endif
y
@if (count($venta->propiedad()->bodegas()) > 0)
@if (count($venta->propiedad()->bodegas()) > 1)
tiene las bodegas
@foreach ($venta->propiedad()->bodegas() as $i => $est)
@if ($i == count($venta->propiedad()->bodegas()) - 1)
y
@elseif ($i > 0)
,
@endif
{{$est->descripcion}}
@endforeach
@else
tiene la bodega {{$venta->propiedad()->bodegas()[0]->descripcion}}.
@endif
@else
no tiene bodegas.
@endif
<br />
<br />
<b>PRECIO</b> {{format('ufs', $venta->valor('ufs'))}} UF.<br/>
@if ($venta->pie != 0)
<b>PIE</b> {{count($venta->pie()->cuotas())}} cuota{{(count($venta->pie()->cuotas()) > 1) ? 's que suman' : ' de'}}
$ {{format('pesos', $venta->pie()->valorPagado('pesos'))}} equivalente a {{format('ufs', $venta->pieReajustado())}} UF.<br />
@if ($venta->pie()->reajuste != 0)
<b>REAJUSTE</b>
@if ($venta->pie()->reajuste()->estado()->estado >= 1)
$ {{format('pesos', $venta->pie()->reajuste()->valor)}} el {{format('shortDate', $venta->pie()->reajuste()->fecha)}}
equivalente a {{format('ufs', $venta->pie()->reajuste()->valor('ufs'))}} UF.
@else
{{format('ufs', $venta->pie()->reajuste()->valor('ufs'))}} UF por pagar.
@endif
<br />
@endif
@endif
@if ($venta->escritura != 0)
<b>ESCRITURA</b>
@if ($venta->escritura()->pago()->estado()->estado >= 1)
$ {{format('pesos', $venta->escritura()->pago()->valor)}} el {{format('shortDate', $venta->escritura()->pago()->fecha)}}
equivalente a {{format('ufs', $venta->escritura()->pago()->valor('ufs'))}} UF.
@else
{{format('ufs', $venta->escritura()->pago()->valor('ufs'))}} UF por pagar.
@endif
<br />
@endif
@if ($venta->saldo() / $venta->valor_uf > 0.01)
(DEVOLVER {{format('ufs', $venta->saldo())}} UF).<br />
@endif
@if ($venta->anticipo() > 0)
<b>TOTAL ANTICIPO</b> {{format('ufs', $venta->anticipo())}} UF.<br />
@endif
@if ($venta->bono_pie != 0)
<b>BONO</b> {{format('ufs', $venta->bonoPie()->pago()->valor('ufs'))}} UF.<br />
@endif
@if ($venta->subsidio != 0)
<b>SUBSIDIO</b> {{format('ufs', $venta->subsidio()->pago()->valor('ufs'))}} UF con ahorro y
{{format('ufs', $venta->subsidio()->subsidio()->valor('ufs'))}} UF con subsidio.<br />
@endif
@if ($venta->credito != 0)
Saldo {{format('ufs', $venta->credito()->pago()->valor('ufs'))}} UF con <b>CR&Eacute;DITO</b> en {{$venta->credito()->pago()->banco()->nombreCompleto()}}.<br />
@endif
<b>TOTAL</b> {{format('ufs', $venta->pagado())}} UF.
@if ($venta->saldo() > 0.0001)
<br />
<br />
Diferencia {{format('ufs', $venta->saldo())}} UF ({{\App\Helper\Format::number(($venta->saldo()) / $venta->valor_uf * 100, 2)}}%).
@endif
</div>
</div>
@endsection

View File

@ -0,0 +1,24 @@
@extends('layout.base')
@section('content')
<div class="row page-heading">
<h3><a href="{{url('', ['p' => 'ventas', 'a' => 'show', 'venta' => $venta->id])}}">Pagar Escritura - {{$venta->unidad()->descripcion}} - {{$venta->proyecto()->descripcion}}</a></h3>
</div>
<br />
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'escrituras', 'a' => 'pagado', 'venta' => $venta->id])}}">
<div class="form-group">
<div class="col-md-2">Fecha Pago</div>
<div class="col-md-3">{{format('shortDate', $venta->escritura()->pago()->fecha)}}</div>
</div>
<div class="form-group">
<div class="col-md-2">Fecha</div>
@include('form.fecha')
</div>
<div class="form-group">
<div class="col-md-2">Valor Pagado [$]</div>
<div class="col-md-4"><input type="text" name="valor" class="form-control" value="{{$venta->escritura()->pago()->valor}}" /></div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Pagar" class="form-control" /></div>
</div>
@endsection