From bcdca32075a2f19005f87703655a84948bafb0c7 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Tue, 28 Nov 2023 21:38:24 -0300 Subject: [PATCH] Reajuste --- app/resources/views/ventas/pies/cuotas.blade.php | 2 +- app/resources/views/ventas/show/forma_pago/pie.blade.php | 9 +++++++++ app/src/Service/Venta/Pago.php | 6 ++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/resources/views/ventas/pies/cuotas.blade.php b/app/resources/views/ventas/pies/cuotas.blade.php index f94b54a..3ab9460 100644 --- a/app/resources/views/ventas/pies/cuotas.blade.php +++ b/app/resources/views/ventas/pies/cuotas.blade.php @@ -36,7 +36,7 @@ {{$cuota->pago->identificador}} {{$format->pesos($cuota->pago->valor)}} - @if ($cuota->pago->currentEstado->fecha <= $now) + @if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'abonado' and $cuota->pago->currentEstado->fecha <= $now) {{$format->ufs($cuota->pago->valor())}} @endif 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 5b6a751..a04255d 100644 --- a/app/resources/views/ventas/show/forma_pago/pie.blade.php +++ b/app/resources/views/ventas/show/forma_pago/pie.blade.php @@ -28,4 +28,13 @@ {{$format->pesos($pie->pagado('pesos'))}} +@if ($pie->reajuste) + + Reajuste + + {{$format->ufs($pie->reajuste->valor())}} + {{$format->pesos($pie->reajuste->valor)}} + + +@endif @endif diff --git a/app/src/Service/Venta/Pago.php b/app/src/Service/Venta/Pago.php index 3f8d161..3d58e3a 100644 --- a/app/src/Service/Venta/Pago.php +++ b/app/src/Service/Venta/Pago.php @@ -123,8 +123,10 @@ class Pago { $pago->estados = $this->estadoPagoRepository->fetchByPago($pago->id); $pago->currentEstado = $this->estadoPagoRepository->fetchCurrentByPago($pago->id); - if (($pago->uf === null or $pago->uf === 0.0) and $pago->fecha < new DateTimeImmutable()) { - $pago->uf = $this->moneyService->getUF($pago->fecha); + if (($pago->uf === null or $pago->uf === 0.0) + and $pago->currentEstado->tipoEstadoPago->descripcion === 'abonado' + and $pago->currentEstado->fecha <= new DateTimeImmutable()) { + $pago->uf = $this->moneyService->getUF($pago->currentEstado->fecha); if ($pago->uf !== 0.0) { $this->pagoRepository->edit($pago, ['uf' => $pago->uf]); }