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'); });