Cuotas con detalle de UF y de Pies asociados

This commit is contained in:
Juan Pablo Vial
2024-03-26 13:21:47 -03:00
parent bef0a22758
commit c10f2e5912
7 changed files with 55 additions and 8 deletions

View File

@ -5,6 +5,29 @@
@endsection
@section('venta_content')
@if (count($asociadas) > 0)
<div class="ui grid">
<div class="two wide column">Asociados</div>
<div class="six wide column">
{!! implode(' - ', array_map(function(Incoviba\Model\Venta $venta) use ($urls) {
return "<a href=\"{$urls->base}/venta/{$venta->id}\">{$venta->propiedad()->departamentos()[0]->descripcion}</a>";
}, $asociadas)) !!}
</div>
</div>
@endif
<div class="ui grid">
<div class="column">Valor</div>
<div class="four wide column">
{{$format->ufs($venta->formaPago()->pie->valor)}}
@if (count($asociadas) > 0)
[{{$format->ufs($venta->formaPago()->pie->valor + array_reduce($asociadas, function(float $sum, Incoviba\Model\Venta $venta) {
return $sum + $venta->formaPago()->pie->valor;
}, 0.0))}}]
@endif
</div>
<div class="column">Cuotas</div>
<div class="column">{{$venta->formaPago()->pie->cuotas}}</div>
</div>
<table class="ui table" id="cuotas">
<thead>
<tr>
@ -37,8 +60,10 @@
<td>{{$cuota->pago->identificador}}</td>
<td class="right aligned">{{$format->pesos($cuota->pago->valor)}}</td>
<td class="right aligned">
@if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'abonado' and $cuota->pago->currentEstado->fecha <= $now)
@if (in_array($cuota->pago->currentEstado->tipoEstadoPago->descripcion, ['depositado', 'abonado']) and $cuota->pago->currentEstado->fecha <= $now)
{{$format->ufs($cuota->pago->valor())}}
@else
~{{$format->ufs($cuota->pago->valor / $uf_venta)}}
@endif
</td>
<td
@ -115,7 +140,7 @@
}, 0.0))}}
</th>
<th class="right aligned">
{{$format->number($pagado / $total * 100, 2)}}%
{{$format->number(($total > 0) ? $pagado / $total * 100 : 0, 2)}}%
</th>
<th colspan="3"></th>
</tr>
@ -128,7 +153,7 @@
{{$format->ufs($total - $pagado)}}
</th>
<th class="right aligned">
{{$format->number(($total - $pagado) / $total * 100, 2)}}%
{{$format->number(($total > 0) ? ($total - $pagado) / $total * 100 : 0, 2)}}%
</th>
<th colspan="3"></th>
</tr>