Commit 4d1dd233 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Dernière corrections de bugs

parent 1111bd38
......@@ -630,7 +630,11 @@ class DataGen
];
foreach ($queries as $nom => $query) {
$data[$nom]['VALEUR'] = (string)$bdd->select($query, ['valeur' => $data[$nom]['VALEUR']], $bdd::FETCH_ONE)['VALEUR'];
$val = isset($data[$nom]['VALEUR']) ? $data[$nom]['VALEUR'] : null;
$res = $bdd->select($query, ['valeur' => $val], $bdd::FETCH_ONE);
if (isset($res['VALEUR'])){
$data[$nom]['VALEUR'] = (string)$res['VALEUR'];
}
}
$data['annee']['VALEUR'] = (string)$this->getAnneeCourante();
......
......@@ -34318,6 +34318,306 @@ WHERE
),
'BddAdmin\\Ddl\\DdlMaterializedView' =>
array (
'MV_EXT_SERVICE' =>
array (
'name' => 'MV_EXT_SERVICE',
'definition' => 'WITH t AS ( SELECT
vh.id volume_horaire_id,
null volume_horaire_ref_id,
s.id service_id,
null service_referentiel_id,
s.intervenant_id intervenant_id,
vh.type_volume_horaire_id type_volume_horaire_id,
fr.etat_volume_horaire_id etat_volume_horaire_id,
s.element_pedagogique_id element_pedagogique_id,
s.etablissement_id etablissement_id,
NULL structure_aff_id,
NULL structure_ens_id,
vh.periode_id periode_id,
vh.type_intervention_id type_intervention_id,
NULL fonction_referentiel_id,
s.description service_description,
vh.heures heures,
0 heures_ref,
0 heures_non_payees,
frvh.service_fi service_fi,
frvh.service_fa service_fa,
frvh.service_fc service_fc,
0 service_referentiel,
frvh.heures_compl_fi heures_compl_fi,
frvh.heures_compl_fa heures_compl_fa,
frvh.heures_compl_fc heures_compl_fc,
frvh.heures_compl_fc_majorees heures_compl_fc_majorees,
0 heures_compl_referentiel,
frvh.total total,
fr.solde solde,
NULL service_ref_formation,
NULL commentaires
FROM
formule_resultat_vh frvh
JOIN formule_resultat fr ON fr.id = frvh.formule_resultat_id
JOIN volume_horaire vh ON vh.id = frvh.volume_horaire_id AND vh.motif_non_paiement_id IS NULL AND vh.histo_destruction IS NULL
JOIN service s ON s.id = vh.service_id AND s.intervenant_id = fr.intervenant_id AND s.histo_destruction IS NULL
UNION ALL
SELECT
vh.id volume_horaire_id,
null volume_horaire_ref_id,
s.id service_id,
null service_referentiel_id,
s.intervenant_id intervenant_id,
vh.type_volume_horaire_id type_volume_horaire_id,
vhe.etat_volume_horaire_id etat_volume_horaire_id,
s.element_pedagogique_id element_pedagogique_id,
s.etablissement_id etablissement_id,
NULL structure_aff_id,
NULL structure_ens_id,
vh.periode_id periode_id,
vh.type_intervention_id type_intervention_id,
NULL fonction_referentiel_id,
s.description service_description,
vh.heures heures,
0 heures_ref,
1 heures_non_payees,
0 service_fi,
0 service_fa,
0 service_fc,
0 service_referentiel,
0 heures_compl_fi,
0 heures_compl_fa,
0 heures_compl_fc,
0 heures_compl_fc_majorees,
0 heures_compl_referentiel,
0 total,
fr.solde solde,
NULL service_ref_formation,
NULL commentaires
FROM
volume_horaire vh
JOIN service s ON s.id = vh.service_id
JOIN v_volume_horaire_etat vhe ON vhe.volume_horaire_id = vh.id
JOIN formule_resultat fr ON fr.intervenant_id = s.intervenant_id AND fr.type_volume_horaire_id = vh.type_volume_horaire_id AND fr.etat_volume_horaire_id = vhe.etat_volume_horaire_id
WHERE
vh.motif_non_paiement_id IS NOT NULL
AND vh.histo_destruction IS NULL
AND s.histo_destruction IS NULL
UNION ALL
SELECT
null volume_horaire_id,
vhr.id volume_horaire_ref_id,
null service_id,
sr.id service_referentiel_id,
sr.intervenant_id intervenant_id,
fr.type_volume_horaire_id type_volume_horaire_id,
fr.etat_volume_horaire_id etat_volume_horaire_id,
NULL element_pedagogique_id,
OSE_PARAMETRE.GET_ETABLISSEMENT etablissement_id,
NULL structure_aff_id,
sr.structure_id structure_ens_id,
NULL periode_id,
NULL type_intervention_id,
sr.fonction_id fonction_referentiel_id,
NULL service_description,
0 heures,
vhr.heures heures_ref,
0 heures_non_payees,
0 service_fi,
0 service_fa,
0 service_fc,
frvr.service_referentiel service_referentiel,
0 heures_compl_fi,
0 heures_compl_fa,
0 heures_compl_fc,
0 heures_compl_fc_majorees,
frvr.heures_compl_referentiel heures_compl_referentiel,
frvr.total total,
fr.solde solde,
sr.formation service_ref_formation,
sr.commentaires commentaires
FROM
formule_resultat_vh_ref frvr
JOIN formule_resultat fr ON fr.id = frvr.formule_resultat_id
JOIN volume_horaire_ref vhr ON vhr.id = frvr.volume_horaire_ref_id
JOIN service_referentiel sr ON sr.id = vhr.service_referentiel_id AND sr.intervenant_id = fr.intervenant_id AND sr.histo_destruction IS NULL
UNION ALL
SELECT
null volume_horaire_id,
null volume_horaire_ref_id,
null service_id,
null service_referentiel_id,
i.id intervenant_id,
tvh.id type_volume_horaire_id,
evh.id etat_volume_horaire_id,
NULL element_pedagogique_id,
OSE_PARAMETRE.GET_ETABLISSEMENT etablissement_id,
NULL structure_aff_id,
NULL structure_ens_id,
NULL periode_id,
NULL type_intervention_id,
NULL fonction_referentiel_id,
NULL service_description,
0 heures,
0 heures_ref,
0 heures_non_payees,
0 service_fi,
0 service_fa,
0 service_fc,
0 service_referentiel,
0 heures_compl_fi,
0 heures_compl_fa,
0 heures_compl_fc,
0 heures_compl_fc_majorees,
NULL heures_compl_referentiel,
0 total,
0 solde,
NULL service_ref_formation,
NULL commentaires
FROM
intervenant i
JOIN statut_intervenant si ON si.id = i.statut_id
JOIN etat_volume_horaire evh ON evh.code IN (\'saisi\',\'valide\')
JOIN type_volume_horaire tvh ON tvh.code IN (\'PREVU\',\'REALISE\')
LEFT JOIN modification_service_du msd ON msd.intervenant_id = i.id AND msd.histo_destruction IS NULL
LEFT JOIN motif_modification_service mms ON mms.id = msd.motif_id
WHERE
i.histo_destruction IS NULL
AND si.service_statutaire > 0
GROUP BY
i.id, si.service_statutaire, evh.id, tvh.id
HAVING
si.service_statutaire + SUM(msd.heures * mms.multiplicateur) = 0
), ponds AS (
SELECT
ep.id element_pedagogique_id,
MAX(COALESCE( m.ponderation_service_du, 1)) ponderation_service_du,
MAX(COALESCE( m.ponderation_service_compl, 1)) ponderation_service_compl
FROM
element_pedagogique ep
LEFT JOIN element_modulateur em ON em.element_id = ep.id
AND em.histo_destruction IS NULL
LEFT JOIN modulateur m ON m.id = em.modulateur_id
WHERE
ep.histo_destruction IS NULL
GROUP BY
ep.id
)
SELECT
i.annee_id annee_id,
t.type_volume_horaire_id type_volume_horaire_id,
t.etat_volume_horaire_id etat_volume_horaire_id,
t.volume_horaire_id volume_horaire_id,
t.volume_horaire_ref_id volume_horaire_ref_id,
t.service_id service_id,
t.service_referentiel_id service_referentiel_id,
i.id intervenant_id,
ti.id type_intervenant_id,
his.histo_modification service_date_modification,
etab.id etablissement_id,
saff.id structure_aff_id,
sens.id structure_ens_id,
ose_divers.niveau_formation_id_calc( gtf.id, gtf.pertinence_niveau, etp.niveau ) niveau_formation_id,
etp.id etape_id,
ep.id element_pedagogique_id,
t.periode_id periode_id,
t.type_intervention_id type_intervention_id,
t.fonction_referentiel_id fonction_referentiel_id,
di.id discipline_intervenant_id,
de.id discipline_enseignement_id,
tvh.libelle || \' \' || evh.libelle type_etat,
i.source_code intervenant_code,
i.nom_usuel || \' \' || i.prenom intervenant_nom,
i.date_naissance intervenant_date_naissance,
si.libelle intervenant_statut_libelle,
ti.code intervenant_type_code,
ti.libelle intervenant_type_libelle,
g.source_code intervenant_grade_code,
g.libelle_court intervenant_grade_libelle,
di.source_code intervenant_discipline_code,
di.libelle_court intervenant_discipline_libelle,
saff.libelle_court service_structure_aff_libelle,
sens.libelle_court service_structure_ens_libelle,
etab.libelle etablissement_libelle,
gtf.libelle_court groupe_type_formation_libelle,
tf.libelle_court type_formation_libelle,
etp.niveau etape_niveau,
etp.source_code etape_code,
etp.libelle etape_libelle,
ep.source_code element_code,
COALESCE(ep.libelle,to_char(t.service_description)) element_libelle,
de.source_code element_discipline_code,
de.libelle_court element_discipline_libelle,
fr.libelle_long fonction_referentiel_libelle,
ep.taux_fi element_taux_fi,
ep.taux_fc element_taux_fc,
ep.taux_fa element_taux_fa,
t.service_ref_formation service_ref_formation,
t.commentaires commentaires,
p.libelle_court periode_libelle,
CASE WHEN ponds.ponderation_service_compl = 1 THEN NULL ELSE ponds.ponderation_service_compl END element_ponderation_compl,
src.libelle element_source_libelle,
t.heures heures,
t.heures_ref heures_ref,
t.heures_non_payees heures_non_payees,
si.service_statutaire service_statutaire,
fi.heures_service_modifie service_du_modifie,
t.service_fi service_fi,
t.service_fa service_fa,
t.service_fc service_fc,
t.service_referentiel service_referentiel,
t.heures_compl_fi heures_compl_fi,
t.heures_compl_fa heures_compl_fa,
t.heures_compl_fc heures_compl_fc,
t.heures_compl_fc_majorees heures_compl_fc_majorees,
t.heures_compl_referentiel heures_compl_referentiel,
t.total total,
t.solde solde,
v.histo_modification date_cloture_realise
FROM
t
JOIN intervenant i ON i.id = t.intervenant_id AND i.histo_destruction IS NULL
JOIN statut_intervenant si ON si.id = i.statut_id
JOIN type_intervenant ti ON ti.id = si.type_intervenant_id
JOIN etablissement etab ON etab.id = t.etablissement_id
JOIN type_volume_horaire tvh ON tvh.id = t.type_volume_horaire_id
JOIN etat_volume_horaire evh ON evh.id = t.etat_volume_horaire_id
LEFT JOIN histo_intervenant_service his ON his.intervenant_id = i.id AND his.type_volume_horaire_id = tvh.id AND his.referentiel = 0
LEFT JOIN grade g ON g.id = i.grade_id
LEFT JOIN discipline di ON di.id = i.discipline_id
LEFT JOIN structure saff ON saff.id = i.structure_id AND ti.code = \'P\'
LEFT JOIN element_pedagogique ep ON ep.id = t.element_pedagogique_id
LEFT JOIN discipline de ON de.id = ep.discipline_id
LEFT JOIN structure sens ON sens.id = NVL(t.structure_ens_id, ep.structure_id)
LEFT JOIN periode p ON p.id = t.periode_id
LEFT JOIN source src ON src.id = ep.source_id OR (ep.source_id IS NULL AND src.code = \'OSE\')
LEFT JOIN etape etp ON etp.id = ep.etape_id
LEFT JOIN type_formation tf ON tf.id = etp.type_formation_id AND tf.histo_destruction IS NULL
LEFT JOIN groupe_type_formation gtf ON gtf.id = tf.groupe_id AND gtf.histo_destruction IS NULL
LEFT JOIN v_formule_intervenant fi ON fi.intervenant_id = i.id
LEFT JOIN ponds ponds ON ponds.element_pedagogique_id = ep.id
LEFT JOIN fonction_referentiel fr ON fr.id = t.fonction_referentiel_id
LEFT JOIN type_validation tv ON tvh.code = \'REALISE\' AND tv.code = \'CLOTURE_REALISE\'
LEFT JOIN validation v ON v.intervenant_id = i.id AND v.type_validation_id = tv.id AND v.histo_destruction IS NULL',
),
'TBL_NOEUD' =>
array (
'name' => 'TBL_NOEUD',
......@@ -42059,16 +42359,6 @@ WHERE
1 => 'ETAPE_PREC_ID',
),
),
'WF_ETAPE_ORDRE_UN' =>
array (
'name' => 'WF_ETAPE_ORDRE_UN',
'table' => 'WF_ETAPE',
'index' => 'WF_ETAPE_ORDRE_UN',
'columns' =>
array (
0 => 'ORDRE',
),
),
),
'BddAdmin\\Ddl\\DdlTrigger' =>
array (
......@@ -51364,16 +51654,6 @@ END;',
1 => 'ETAPE_PREC_ID',
),
),
'WF_ETAPE_ORDRE_UN' =>
array (
'name' => 'WF_ETAPE_ORDRE_UN',
'unique' => true,
'table' => 'WF_ETAPE',
'columns' =>
array (
0 => 'ORDRE',
),
),
'WF_ETAPE_PK' =>
array (
'name' => 'WF_ETAPE_PK',
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment