Arreglado regex y agregado metodo para notas de barrio
This commit is contained in:
parent
092e98a456
commit
1aeb917ecf
1 changed files with 19 additions and 1 deletions
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\GrupoDeCompra;
|
||||
use App\Helpers\PedidosExportHelper;
|
||||
use App\Producto;
|
||||
use League\Csv\Exception;
|
||||
use Mpdf\MpdfException;
|
||||
|
||||
|
@ -68,7 +69,24 @@ class AdminController extends Controller
|
|||
} catch (Exception $e) {
|
||||
return response()->json(['message' => $e->getMessage()]);
|
||||
}
|
||||
$pattern = storage_path('csv/exports/'. $gdc->nombre . '-*.csv');
|
||||
$pattern = storage_path('csv/exports/'. $gdc->nombre . '-ollas-*.csv');
|
||||
$files = glob($pattern);
|
||||
|
||||
usort($files, function ($a, $b) {
|
||||
return filemtime($b) <=> filemtime($a);
|
||||
});
|
||||
|
||||
return response()->download($files[0]);
|
||||
}
|
||||
|
||||
public function exportarNotasACSV(GrupoDeCompra $gdc)
|
||||
{
|
||||
try {
|
||||
Producto::planillaNotasBarrio($gdc);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['message' => $e->getMessage()]);
|
||||
}
|
||||
$pattern = storage_path('csv/exports/notas-de-'. $gdc->nombre . '-*.csv');
|
||||
$files = glob($pattern);
|
||||
|
||||
usort($files, function ($a, $b) {
|
||||
|
|
Loading…
Add table
Reference in a new issue