-- retourne un objet tableau de type T_UM_ENREG_STATUT(ID, CODE_STATUT, CODE_TYPE_INTERVENANT, DATE_DEB_STATUT, DATE_FIN_STATUT)
-- v1.0 - 10/09/2018 - MYP - statuts detailles pour OSE suivant Mapping_STATUT_SIHAM-OSE_v3.xlsx
-- !!! SI le TEST des codes statut_pip siham changent alors penser � adapter la procedure UM_SELECT_INTERVENANT (tests en dur)
v_id_statutNUMBER(9):=0;-- v3.0 08/03/2021 ID statut qui sera affect�
v_code_statutVARCHAR2(20):='HOSE';-- v1.14 Code statut intervenant qui sera affect� : par d�faut HORS HOSE = FLAG pour indiquer que crit�res non requis pour gestion dans OSE (pas d'enseignement)
v_type_intervVARCHAR2(1):='';-- v3.0 08/03/2021 type statut intervenant qui sera affect� P = PERM / E = IE
whenp_gp_hiein('DC')thenv_new_statut.CODE_STATUT:='ENS_1D';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_dat_grade);-- Enseignant premier degr�
andp_modservnotlike'TI%'thenv_new_statut.CODE_STATUT:='ENS_2D';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_dat_grade);-- Enseignant second degr� + EA corps 364 prof ensam
andp_modservlike'TI%'thenv_new_statut.CODE_STATUT:='SPART';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_dat_grade,p_dat_modserv);-- Service partag� FDE
whenp_gp_hiein('OA')thenv_new_statut.CODE_STATUT:='INF_ORIEN_EDU';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_dat_grade);-- Personnel d'�ducation et d'orientation
whenp_gp_hiein('SB','SD','SP','MG','HU')thenv_new_statut.CODE_STATUT:='ENS_HU';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_dat_grade);-- Enseignant-chercheur HU TITU -- v3.5 26/07/22
whenp_recrutement='G'thenv_new_statut.CODE_STATUT:='CEV_TIT_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- CEV TITU Titre gracieux
else
v_new_statut.CODE_STATUT:='HOSE';v_new_statut.DATE_DEB_STATUT:=p_date_systeme;-- Hors p�rim�tre OSE : pas g�r�s dans OSE -- v1.14
or(p_code_fonction>='UD32'andp_code_fonction<='UD64'))thenv_new_statut.CODE_STATUT:='DOC_MCE';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_dat_fonct);-- Doctorant contractuel avec MCE
whenp_statut_pip='C2041'andp_recrutement='G'thenv_new_statut.CODE_STATUT:='ATV_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- ATV Titre gracieux
whenp_statut_pip='HB111'andp_code_emploi='UEXTMAD_01'thenv_new_statut.CODE_STATUT:='MAD_1D';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut);-- MAD premier degr�
whenp_statut_pip='HB111'andp_code_emploi='UEXTMAD_02'thenv_new_statut.CODE_STATUT:='MAD_2D';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut);-- MAD second degr�
whenp_statut_pip='HB112'thenv_new_statut.CODE_STATUT:='CONV';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut);-- Enseignant avec convention entrante
when(p_statut_pip='C2038')andp_temoin_fonc='OUI'andp_recrutement='G'thenv_new_statut.CODE_STATUT:='CEV_TIT_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- CEV TITU Titre gracieux
when(p_statut_pip='C2038')andp_temoin_fonc='NON'andp_recrutement='G'thenv_new_statut.CODE_STATUT:='CEV_NTIT_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- CEV NTITU Titre gracieux
whenp_statut_piplike'HB%'andp_orec_type_vac='ATV'andp_recrutement='G'thenv_new_statut.CODE_STATUT:='ATV_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- ATV Titre gracieux
andp_temoin_fonc='OUI'andp_recrutement='G'thenv_new_statut.CODE_STATUT:='CEV_TIT_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- CEV TITU Titre gracieux
andp_temoin_fonc='NON'andp_recrutement='G'thenv_new_statut.CODE_STATUT:='CEV_NTIT_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- CEV NTITU Titre gracieux
-- TOUS LES AUTRES C% ou HB% ---------------------------------------------------------------------------------------------------
whenp_recrutement='G'thenv_new_statut.CODE_STATUT:='CEV_NTIT_G';v_new_statut.DATE_DEB_STATUT:=greatest(p_dat_aff,p_dat_statut,p_d_deb_annee_univ);-- CEV NTITU Titre gracieux
elsev_new_statut.CODE_STATUT:='HOSE';v_new_statut.DATE_DEB_STATUT:=p_date_systeme;-- Hors p�rim�tre OSE : pas g�r�s dans OSE -- v1.14
-- retourne un objet tableau de type T_UM_ENREG_STATUT � partir de UM_SYNCHRO_A_VALIDER et tem_validation AI
v_id_statutNUMBER(9):=0;-- v3.0 08/03/2021 ID statut qui sera affect�
v_code_statutVARCHAR2(20):='HOSE';-- v1.14 Code statut intervenant qui sera affect� : par d�faut HORS HOSE = FLAG pour indiquer que crit�res non requis pour gestion dans OSE (pas d'enseignement)
v_type_intervVARCHAR2(1):='';-- v3.0 08/03/2021 type statut intervenant qui sera affect� P = PERM / E = IE
v_date_deb_statutDATE:=sysdate;
v_date_fin_statutDATE:=sysdate;
v_nb_h_mceNUMBER(8,2):=0;
-- v3.0b -- une seule fonction pour id statut, code et dates