From 2592794a49551dc1d8fefd1c0871d8ca5f3e3a80 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Thu, 3 Oct 2024 21:11:06 -0300 Subject: [PATCH] Alertas --- .../views/ventas/pies/cuotas.blade.php | 37 +++++++++++++++---- .../ventas/show/forma_pago/pie.blade.php | 2 +- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/app/resources/views/ventas/pies/cuotas.blade.php b/app/resources/views/ventas/pies/cuotas.blade.php index a00a072..83f132f 100644 --- a/app/resources/views/ventas/pies/cuotas.blade.php +++ b/app/resources/views/ventas/pies/cuotas.blade.php @@ -13,6 +13,13 @@ return "base}/venta/{$venta->id}\">{$venta->propiedad()->departamentos()[0]->descripcion}"; }, $asociadas)) !!} + @if ($venta->formaPago()->pie->asociado !== null) +
+
+ * Este pie no es la base para el cálculo de las cuotas +
+
+ @endif @endif
@@ -113,13 +120,13 @@ TOTAL - {{$format->pesos($total_pesos = array_reduce($venta->formaPago()->pie->cuotas(), - function(float $sum, Incoviba\Model\Venta\Cuota $cuota) { + {{$format->pesos($total_pesos = array_reduce($venta->formaPago()->pie->cuotas(vigentes: true), + function(int $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor; }, 0))}} - {{$format->ufs($total = array_reduce($venta->formaPago()->pie->cuotas(), + {{$format->ufs($total = array_reduce($venta->formaPago()->pie->cuotas(vigentes: true), function(float $sum, Incoviba\Model\Venta\Cuota $cuota) use ($now, $uf_venta) { return $sum + (($cuota->pago->fecha > $now or $cuota->pago->uf === null) ? $cuota->pago->valor / $uf_venta : @@ -131,13 +138,13 @@ TOTAL PAGADO - {{$format->pesos($pagado_pesos = array_reduce($venta->formaPago()->pie->cuotas(true), + {{$format->pesos($pagado_pesos = array_reduce($venta->formaPago()->pie->cuotas(pagadas: true, vigentes: true), function(int $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor; }, 0))}} - {{$format->ufs($pagado = array_reduce($venta->formaPago()->pie->cuotas(true), + {{$format->ufs($pagado = array_reduce($venta->formaPago()->pie->cuotas(pagadas: true, vigentes: true), function(float $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor(); }, 0.0))}} @@ -156,12 +163,15 @@ {{$format->ufs($total - $pagado)}} - {{$format->number(($total > 0) ? ($total - $pagado) / $total * 100 : 0, 2)}}% + {{$format->percent(($total > 0) ? ($total - $pagado) / $total * 100 : 0, 2)}}* +
+ * Porcentaje calculado sobre el valor de la venta +
@endsection @include('layout.head.styles.datatables') @@ -303,13 +313,26 @@ columnDefs: [ { target: 1, - orderData: [2] + orderData: [2], + className: 'dt-center' }, { target: 2, visible: false, searchable: false }, + { + target: 3, + className: 'dt-center' + }, + { + targets: [5, 6], + className: 'dt-right' + }, + { + target: 7, + className: 'dt-center' + }, { target: 8, orderData: [9] diff --git a/app/resources/views/ventas/show/forma_pago/pie.blade.php b/app/resources/views/ventas/show/forma_pago/pie.blade.php index f399a04..6f3df32 100644 --- a/app/resources/views/ventas/show/forma_pago/pie.blade.php +++ b/app/resources/views/ventas/show/forma_pago/pie.blade.php @@ -14,7 +14,7 @@ Cuotas - {{count($pie->cuotas(true))}}/{{$pie->cuotas}} + {{count($pie->cuotas(true, true))}}/{{$pie->cuotas}} @if (count($pie->cuotas(vigentes: true)) < $pie->cuotas)