Agregada ruta y método de controlador para planilla de transporte

This commit is contained in:
Alejandro Tasistro 2024-12-09 12:59:59 -03:00
parent 1b82700db3
commit 2486826dba
3 changed files with 8 additions and 1 deletions

View File

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

View File

@ -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) {

View File

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