From 2486826dbaf0e63c2c88f3c74fd4c33b553cffd8 Mon Sep 17 00:00:00 2001 From: ale Date: Mon, 9 Dec 2024 12:59:59 -0300 Subject: [PATCH] =?UTF-8?q?Agregada=20ruta=20y=20m=C3=A9todo=20de=20contro?= =?UTF-8?q?lador=20para=20planilla=20de=20transporte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ComprasController.php | 6 ++++++ app/Producto.php | 2 +- routes/web.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ComprasController.php b/app/Http/Controllers/ComprasController.php index dd2fc6b..5bafc3f 100644 --- a/app/Http/Controllers/ComprasController.php +++ b/app/Http/Controllers/ComprasController.php @@ -23,6 +23,12 @@ class ComprasController return response()->download($file); } + public function descargarTransporte() { + GrupoDeCompra::planillaTransporte(); + $file = resource_path('csv/exports/transporte-por-barrio.csv'); + return response()->download($file); + } + public function show() { return view('auth/compras_login'); diff --git a/app/Producto.php b/app/Producto.php index 9375c20..39c2601 100644 --- a/app/Producto.php +++ b/app/Producto.php @@ -107,7 +107,7 @@ class Producto extends Model } try { - $writer = Writer::createFromPath(resource_path('csv/exports/total-pedidos.csv'), 'w'); + $writer = Writer::createFromPath(resource_path('csv/exports/pedidos-por-barrio.csv'), 'w'); $writer->insertOne($headers); $writer->insertAll($planilla); } catch (CannotInsertRecord $e) { diff --git a/routes/web.php b/routes/web.php index baaa801..d6f239f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -82,4 +82,5 @@ Route::middleware(['compras'])->group( function() { Route::get('/compras/pedidos', 'ComprasController@indexPedidos')->name('compras.pedidos'); Route::get('/compras/pedidos/descargar', 'ComprasController@descargarPedidos')->name('compras.pedidos.descargar'); Route::get('/compras/pedidos/notas', 'ComprasController@descargarNotas')->name('compras.pedidos.descargar'); + Route::get('/compras/pedidos/transporte', 'ComprasController@descargarTransporte')->name('compras.pedidos.descargar'); });