funcion/arreglar-planilla-totales #38

Merged
atasistro merged 23 commits from funcion/arreglar-planilla-totales into master 2024-12-21 11:06:25 -03:00
3 changed files with 8 additions and 1 deletions
Showing only changes of commit 2486826dba - Show all commits

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