From ad64ffa4365007a7ddb87fba329bc84230f2a1f7 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Wed, 27 Aug 2025 19:27:18 -0400 Subject: [PATCH] Import Precios --- app/resources/routes/api/ventas/precios.php | 1 + app/resources/routes/ventas/precios.php | 2 +- .../views/ventas/precios/list.blade.php | 63 ++++- .../ventas/precios/modal/import.blade.php | 120 +++++++++ app/setup/setups/services.php | 4 + app/src/Controller/API/Ventas/Precios.php | 34 ++- app/src/Controller/Ventas/Precios.php | 4 +- app/src/Repository/Inmobiliaria.php | 19 ++ app/src/Repository/Proyecto.php | 5 + app/src/Repository/Venta/EstadoPrecio.php | 15 ++ app/src/Repository/Venta/Precio.php | 1 + app/src/Repository/Venta/TipoEstadoPrecio.php | 15 ++ app/src/Service/FileUpload.php | 59 +++++ app/src/Service/FileUpload/ExcelBase.php | 147 +++++++++++ .../FileUpload/FileUploadInterface.php | 9 + app/src/Service/Venta/Precio.php | 76 +++++- app/src/Service/Venta/Precio/Estado.php | 89 +++++++ app/src/Service/Venta/Precio/Import.php | 243 ++++++++++++++++++ .../src/Service/Venta/Precio/EstadoTest.php | 164 ++++++++++++ 19 files changed, 1049 insertions(+), 21 deletions(-) create mode 100644 app/resources/views/ventas/precios/modal/import.blade.php create mode 100644 app/src/Service/FileUpload.php create mode 100644 app/src/Service/FileUpload/ExcelBase.php create mode 100644 app/src/Service/FileUpload/FileUploadInterface.php create mode 100644 app/src/Service/Venta/Precio/Estado.php create mode 100644 app/src/Service/Venta/Precio/Import.php create mode 100644 app/tests/unit/src/Service/Venta/Precio/EstadoTest.php diff --git a/app/resources/routes/api/ventas/precios.php b/app/resources/routes/api/ventas/precios.php index 6546f48..471a071 100644 --- a/app/resources/routes/api/ventas/precios.php +++ b/app/resources/routes/api/ventas/precios.php @@ -2,6 +2,7 @@ use Incoviba\Controller\API\Ventas\Precios; $app->group('/precios', function($app) { + $app->post('/import[/]', [Precios::class, 'import']); $app->post('[/]', [Precios::class, 'proyecto']); }); $app->group('/precio', function($app) { diff --git a/app/resources/routes/ventas/precios.php b/app/resources/routes/ventas/precios.php index c035216..a52f7ef 100644 --- a/app/resources/routes/ventas/precios.php +++ b/app/resources/routes/ventas/precios.php @@ -2,5 +2,5 @@ use Incoviba\Controller\Ventas\Precios; $app->group('/precios', function($app) { - $app->get('[/]', Precios::class); + $app->get('[/{project_id}[/]]', Precios::class); }); diff --git a/app/resources/views/ventas/precios/list.blade.php b/app/resources/views/ventas/precios/list.blade.php index 21c35ef..e51fbb2 100644 --- a/app/resources/views/ventas/precios/list.blade.php +++ b/app/resources/views/ventas/precios/list.blade.php @@ -24,6 +24,9 @@ + @@ -31,6 +34,7 @@
+ @include('ventas.precios.modal.import')