Agregado método de controlador para faltantes y sobrantes
This commit is contained in:
parent
0ecff9ae68
commit
7d87471d8b
1 changed files with 17 additions and 0 deletions
|
@ -65,6 +65,23 @@ class ComisionesController
|
|||
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()
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue