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
Showing only changes of commit df05b31b86 - Show all commits

View file

@ -224,22 +224,6 @@ class GrupoDeCompra extends Model
return array($records, $i, $cantidad);
}
public static function exportarTodosLosPedidosEnCSV(){
$gdcs = GrupoDeCompra::all()->filter(function ($grupoDeCompra) {
return !$grupoDeCompra->pedidosAprobados()->isEmpty();
});
$planilla = GrupoDeCompra::obtenerTemplateDeFilasVacias($gdcs->count());
$planilla = self::getPlanilla($gdcs, $planilla);
// Guardar en un archivo .csv
try {
$writer = Writer::createFromPath(resource_path('csv/exports/total-pedidos.csv'), 'w');
$writer->insertAll($planilla);
} catch (CannotInsertRecord $e) {
var_export($e->getRecords());
}
}
public static function exportarProductosConNotasEnCSV() {
$gdcs = GrupoDeCompra::all();
foreach ($gdcs as $i => $gdc) {