WIP: funcion/faltantes-y-sobrantes #52

Draft
atasistro wants to merge 39 commits from funcion/faltantes-y-sobrantes into master
Showing only changes of commit 7d87471d8b - Show all commits

View file

@ -65,6 +65,23 @@ class ComisionesController
return response()->download($files[0]); return response()->download($files[0]);
} }
public function descargarFaltantesYSobrantes()
{
try {
PedidosExportHelper::faltantesYSobrantes();
} catch (CannotInsertRecord|InvalidArgument|Exception $e) {
return response()->json(['message' => $e->getMessage()], 500);
}
$pattern = storage_path('csv/exports/faltantes-y-sobrantes-*.csv');
$files = glob($pattern);
usort($files, function ($a, $b) {
return filemtime($b) <=> filemtime($a);
});
return response()->download($files[0]);
}
public function descargarNotas() public function descargarNotas()
{ {
try { try {