Loading admin/actions/chargens-calcul-effectifs.php +12 −2 Changes for admin/actions/chargens-calcul-effectifs.php: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -5,16 +5,22 @@ $bdd->setLogger($c); $sql = " SELECT sne.id scenario_noeud_effectif_id, sne.effectif effectif, sn.noeud_id, sn.scenario_id, sne.type_heures_id, sne.etape_id sne.etape_id, n.annee_id FROM scenario_noeud_effectif sne JOIN scenario_noeud sn ON sn.id = sne.scenario_noeud_id JOIN noeud n ON n.id = sn.noeud_id WHERE n.etape_id IS NOT NULL AND COALESCE(sne.effectif_calcule,-1) <> sne.effectif ORDER BY n.annee_id DESC "; Loading @@ -25,14 +31,18 @@ $c->msg("Attention : ce traitement peut être long."); $snes = $bdd->select($sql); $count = count($snes); foreach ($snes as $index => $sne) { $sneId = (int)$sne['SCENARIO_NOEUD_EFFECTIF_ID']; $effectif = (float)$sne['EFFECTIF']; $noeud = (int)$sne['NOEUD_ID']; $scenario = (int)$sne['SCENARIO_ID']; $typeHeures = (int)$sne['TYPE_HEURES_ID']; $etape = (int)$sne['ETAPE_ID']; $annee = ((int)$sne['ANNEE_ID']) . '/' . ((int)$sne['ANNEE_ID'] + 1); $c->msg("Calcul de la formation $index / $count ...", true); $c->msg("Calcul de la formation $index / $count (année $annee)...", true); $bdd->exec("BEGIN OSE_CHARGENS.CALC_SUB_EFFECTIF( $noeud, $scenario, $typeHeures, $etape ); END;"); $bdd->getTable('SCENARIO_NOEUD_EFFECTIF')->update(['EFFECTIF_CALCULE' => $effectif], ['ID' => $sneId]); } $c->end("Fin du calcul"); No newline at end of file data/ddl/table/SCENARIO_NOEUD_EFFECTIF.php +12 −0 Changes for data/ddl/table/SCENARIO_NOEUD_EFFECTIF.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -21,6 +21,18 @@ return [ 'position' => 4, 'commentaire' => NULL, ], 'EFFECTIF_CALCULE' => [ 'name' => 'EFFECTIF_CALCULE', 'type' => 'float', 'bdd-type' => 'FLOAT', 'length' => 0, 'scale' => NULL, 'precision' => 126, 'nullable' => TRUE, 'default' => NULL, 'position' => 14, 'commentaire' => NULL, ], 'ETAPE_ID' => [ 'name' => 'ETAPE_ID', 'type' => 'int', Loading data/ddl_columns_pos.php +1 −0 Changes for data/ddl_columns_pos.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1158,6 +1158,7 @@ return [ 'HISTO_MODIFICATEUR_ID', 'HISTO_DESTRUCTION', 'HISTO_DESTRUCTEUR_ID', 'EFFECTIF_CALCULE', ], 'SCENARIO_NOEUD_SEUIL' => [ 'ID', Loading Loading
admin/actions/chargens-calcul-effectifs.php +12 −2 Changes for admin/actions/chargens-calcul-effectifs.php: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -5,16 +5,22 @@ $bdd->setLogger($c); $sql = " SELECT sne.id scenario_noeud_effectif_id, sne.effectif effectif, sn.noeud_id, sn.scenario_id, sne.type_heures_id, sne.etape_id sne.etape_id, n.annee_id FROM scenario_noeud_effectif sne JOIN scenario_noeud sn ON sn.id = sne.scenario_noeud_id JOIN noeud n ON n.id = sn.noeud_id WHERE n.etape_id IS NOT NULL AND COALESCE(sne.effectif_calcule,-1) <> sne.effectif ORDER BY n.annee_id DESC "; Loading @@ -25,14 +31,18 @@ $c->msg("Attention : ce traitement peut être long."); $snes = $bdd->select($sql); $count = count($snes); foreach ($snes as $index => $sne) { $sneId = (int)$sne['SCENARIO_NOEUD_EFFECTIF_ID']; $effectif = (float)$sne['EFFECTIF']; $noeud = (int)$sne['NOEUD_ID']; $scenario = (int)$sne['SCENARIO_ID']; $typeHeures = (int)$sne['TYPE_HEURES_ID']; $etape = (int)$sne['ETAPE_ID']; $annee = ((int)$sne['ANNEE_ID']) . '/' . ((int)$sne['ANNEE_ID'] + 1); $c->msg("Calcul de la formation $index / $count ...", true); $c->msg("Calcul de la formation $index / $count (année $annee)...", true); $bdd->exec("BEGIN OSE_CHARGENS.CALC_SUB_EFFECTIF( $noeud, $scenario, $typeHeures, $etape ); END;"); $bdd->getTable('SCENARIO_NOEUD_EFFECTIF')->update(['EFFECTIF_CALCULE' => $effectif], ['ID' => $sneId]); } $c->end("Fin du calcul"); No newline at end of file
data/ddl/table/SCENARIO_NOEUD_EFFECTIF.php +12 −0 Changes for data/ddl/table/SCENARIO_NOEUD_EFFECTIF.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -21,6 +21,18 @@ return [ 'position' => 4, 'commentaire' => NULL, ], 'EFFECTIF_CALCULE' => [ 'name' => 'EFFECTIF_CALCULE', 'type' => 'float', 'bdd-type' => 'FLOAT', 'length' => 0, 'scale' => NULL, 'precision' => 126, 'nullable' => TRUE, 'default' => NULL, 'position' => 14, 'commentaire' => NULL, ], 'ETAPE_ID' => [ 'name' => 'ETAPE_ID', 'type' => 'int', Loading
data/ddl_columns_pos.php +1 −0 Changes for data/ddl_columns_pos.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1158,6 +1158,7 @@ return [ 'HISTO_MODIFICATEUR_ID', 'HISTO_DESTRUCTION', 'HISTO_DESTRUCTEUR_ID', 'EFFECTIF_CALCULE', ], 'SCENARIO_NOEUD_SEUIL' => [ 'ID', Loading