From 98953cce42f091442f469b0837f4010d58a19397 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Wed, 13 Mar 2024 14:38:44 -0300 Subject: [PATCH] FormaPago Service --- app/resources/views/ventas/show.blade.php | 43 ------ .../views/ventas/show/forma_pago.blade.php | 14 +- app/src/Controller/Login.php | 2 +- app/src/Controller/Ventas.php | 9 +- app/src/Middleware/Authentication.php | 8 +- app/src/Model/Venta.php | 7 +- app/src/Model/Venta/FormaPago.php | 12 +- app/src/Repository/Venta.php | 4 +- app/src/Repository/Venta/BonoPie.php | 9 ++ app/src/Repository/Venta/Credito.php | 9 ++ app/src/Repository/Venta/Escritura.php | 9 ++ app/src/Repository/Venta/Pago.php | 9 ++ app/src/Repository/Venta/Pie.php | 9 ++ app/src/Repository/Venta/Subsidio.php | 9 ++ app/src/Service/Venta.php | 14 +- app/src/Service/Venta/BonoPie.php | 4 + app/src/Service/Venta/Credito.php | 5 + app/src/Service/Venta/FormaPago.php | 143 ++++++++++++++++++ app/src/Service/Venta/Pago.php | 4 + app/src/Service/Venta/Pie.php | 4 + app/src/Service/Venta/Subsidio.php | 5 + 21 files changed, 261 insertions(+), 71 deletions(-) create mode 100644 app/src/Service/Venta/FormaPago.php diff --git a/app/resources/views/ventas/show.blade.php b/app/resources/views/ventas/show.blade.php index ff7d258..0260d2e 100644 --- a/app/resources/views/ventas/show.blade.php +++ b/app/resources/views/ventas/show.blade.php @@ -32,46 +32,3 @@ $showPropietario = true; @include('ventas.show.comentarios') @endsection - -{{--@section('page_content') -
-
-

-
-
{{$venta->proyecto()->descripcion}}
- {{$venta->propiedad()->summary()}} -
-

-
- @include('ventas.show.propietario') -
-
-
-
- @if ($venta->currentEstado()->tipoEstadoVenta->activa) - - Desistir - - - Ceder - - @else -
- - {{ucwords($venta->currentEstado()->tipoEstadoVenta->descripcion)}} - ( - {{$format->pesos($venta->resciliacion()->valor)}} - ) -
- @endif -
-
- @include('ventas.show.propiedad') - @include('ventas.show.detalle') - @include('ventas.show.forma_pago', ['formaPago' => $venta->formaPago()]) - @include('ventas.show.escritura') - @include('ventas.show.entrega') - @include('ventas.show.comentarios') -
-
-@endsection--}} diff --git a/app/resources/views/ventas/show/forma_pago.blade.php b/app/resources/views/ventas/show/forma_pago.blade.php index 201bff6..2f2a264 100644 --- a/app/resources/views/ventas/show/forma_pago.blade.php +++ b/app/resources/views/ventas/show/forma_pago.blade.php @@ -3,14 +3,14 @@
- @include('ventas.show.forma_pago.pie', ['pie' => $formaPago->pie]) - @include('ventas.show.forma_pago.escritura', ['escritura' => $formaPago->escritura]) - @include('ventas.show.forma_pago.anticipo', ['anticipo' => ['uf' => $formaPago->anticipo(), 'pesos' => $formaPago->anticipo('pesos')]]) - @include('ventas.show.forma_pago.bono_pie', ['bonoPie' => $formaPago->bonoPie]) - @include('ventas.show.forma_pago.subsidio', ['subsidio' => $formaPago->subsidio]) - @include('ventas.show.forma_pago.credito', ['credito' => $formaPago->credito]) + @include('ventas.show.forma_pago.pie', ['pie' => $formaPago?->pie]) + @include('ventas.show.forma_pago.escritura', ['escritura' => $formaPago?->escritura]) + @include('ventas.show.forma_pago.anticipo', ['anticipo' => ['uf' => $formaPago?->anticipo(), 'pesos' => $formaPago?->anticipo('pesos')]]) + @include('ventas.show.forma_pago.bono_pie', ['bonoPie' => $formaPago?->bonoPie]) + @include('ventas.show.forma_pago.subsidio', ['subsidio' => $formaPago?->subsidio]) + @include('ventas.show.forma_pago.credito', ['credito' => $formaPago?->credito]) @include('ventas.show.forma_pago.total') - @include('ventas.show.forma_pago.devolucion', ['devolucion' => $formaPago->devolucion]) + @include('ventas.show.forma_pago.devolucion', ['devolucion' => $formaPago?->devolucion])