2024-08-27 20:57:11 -03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\GrupoDeCompra;
|
2024-11-25 21:45:09 -03:00
|
|
|
use App\Producto;
|
2024-12-21 14:29:48 -03:00
|
|
|
use Illuminate\Http\Request;
|
2024-08-27 20:57:11 -03:00
|
|
|
|
|
|
|
class ComprasController
|
|
|
|
{
|
2024-09-17 20:41:50 -03:00
|
|
|
public function indexPedidos() {
|
|
|
|
return view('compras_pedidos');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function descargarPedidos() {
|
2024-11-25 21:45:09 -03:00
|
|
|
Producto::planillaTotales();
|
2024-12-09 21:13:51 -03:00
|
|
|
$file = resource_path('csv/exports/pedidos-por-barrio.csv');
|
2024-08-27 20:57:11 -03:00
|
|
|
return response()->download($file);
|
|
|
|
}
|
2024-11-25 21:45:09 -03:00
|
|
|
|
2024-10-15 20:44:28 -03:00
|
|
|
public function descargarNotas() {
|
2024-12-09 07:20:28 -03:00
|
|
|
Producto::planillaNotas();
|
|
|
|
$file = resource_path('csv/exports/notas-por-barrio.csv');
|
2024-10-15 20:44:28 -03:00
|
|
|
return response()->download($file);
|
|
|
|
}
|
2024-09-10 21:11:22 -03:00
|
|
|
|
2024-12-09 12:59:59 -03:00
|
|
|
public function descargarTransporte() {
|
|
|
|
GrupoDeCompra::planillaTransporte();
|
|
|
|
$file = resource_path('csv/exports/transporte-por-barrio.csv');
|
|
|
|
return response()->download($file);
|
|
|
|
}
|
|
|
|
|
2024-09-14 13:37:06 -03:00
|
|
|
public function show()
|
2024-09-10 21:11:22 -03:00
|
|
|
{
|
|
|
|
return view('auth/compras_login');
|
|
|
|
}
|
2024-12-21 14:29:48 -03:00
|
|
|
|
|
|
|
public function cargarCanasta(Request $request)
|
|
|
|
{
|
|
|
|
$request->validate([
|
|
|
|
'data' => 'required|file|mimes:csv,txt|max:2048',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$archivo = $request->file('data');
|
|
|
|
$path = resource_path('/csv/canastas/');
|
|
|
|
$archivo->move($path, $archivo->getClientOriginalName());
|
|
|
|
|
|
|
|
return response()->json([
|
|
|
|
'message' => 'Canasta cargada exitosamente',
|
|
|
|
], 200);
|
|
|
|
}
|
2024-08-27 20:57:11 -03:00
|
|
|
}
|