Sumar cuotas.

This commit is contained in:
Juan Pablo Vial
2024-11-28 17:38:21 -03:00
parent f4b8634cb4
commit 52de72b507
3 changed files with 38 additions and 5 deletions

View File

@ -6,9 +6,20 @@
@section('venta_content')
@if (count($venta->formaPago()->cuotasAbono) > 0)
<a href="{{$urls->base}}/venta/{{$venta->id}}/escritura/cuotas" class="ui small green button">Ver Cuotas</a>
<p>{{$format->pesos(array_reduce($venta->formaPago()->cuotas, function($sum, $cuota) {return $sum + $cuota->pago->valor;}, 0))}}</p>
<p>{{$format->ufs(array_reduce($venta->formaPago()->cuotas, function($sum, $cuota) {return $sum + $cuota->pago->valor();}, 0.0))}}</p>
<a href="{{$urls->base}}/venta/{{$venta->id}}/escritura/cuotas" class="ui tertiary green button">Ver Cuotas</a>
<div class="ui compact segment">
<div class="header">
Cuotas
</div>
<div class="ui horizontal list">
<div class="item">
{{$format->pesos($venta->formaPago()->cuotasAbono('pesos'))}}
</div>
<div class="item">
{{$format->ufs($venta->formaPago()->cuotasAbono())}}
</div>
</div>
</div>
@else
<a href="{{$urls->base}}/venta/{{$venta->id}}/escritura/cuotas" class="ui small green button"><i class="plus icon"></i> Agregar Cuotas</a>
@endif