Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
open-source
OSE
Commits
74f50550
Commit
74f50550
authored
Sep 27, 2021
by
Antony Le Courtes
Browse files
Merge branch 'master' into module-unicaen-siham
parents
d28526fd
c31e899c
Changes
4
Show whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
74f50550
...
...
@@ -18,6 +18,9 @@ Objectif : Plafonds personnalisables
# OSE 17 (à venir)
Objectif : Connecteur Export OSE => Logiciel RH
## Corrections de bugs
*
Au niveau du connecteur Actul+, les formations fermées étaient ignorées, elles sont également synchronisées
...
...
data/ddl/view/V_IMPORT_DEPUIS_DOSSIERS.sql
0 → 100644
View file @
74f50550
CREATE
OR
REPLACE
FORCE
VIEW
V_IMPORT_DEPUIS_DOSSIERS
AS
SELECT
t
.
annee_id
,
t
.
intervenant_code
,
si
.
code
z_statut_id
,
t
.
z_civilite_id
,
t
.
nom_usuel
,
t
.
prenom
,
t
.
date_naissance
,
t
.
nom_patronymique
,
t
.
commune_naissance
,
t
.
z_pays_naissance_id
,
t
.
z_departement_naissance_id
,
t
.
z_pays_nationalite_id
,
t
.
tel_pro
,
t
.
tel_perso
,
t
.
email_pro
,
t
.
email_perso
,
t
.
adresse_precisions
,
t
.
adresse_numero
,
t
.
z_adresse_numero_compl_id
,
t
.
z_adresse_voirie_id
,
t
.
adresse_voie
,
t
.
adresse_lieu_dit
,
t
.
adresse_code_postal
,
t
.
adresse_commune
,
t
.
z_adresse_pays_id
,
t
.
numero_insee
,
t
.
numero_insee_provisoire
,
t
.
iban
,
t
.
bic
,
t
.
rib_hors_sepa
,
t
.
autre_1
,
t
.
autre_2
,
t
.
autre_3
,
t
.
autre_4
,
t
.
autre_5
,
t
.
z_employeur_id
FROM
(
SELECT
i
.
annee_id
annee_id
,
i
.
code
intervenant_code
,
MIN
(
ds
.
ordre
)
z_statut_ordre
,
MAX
(
cv
.
libelle_court
)
z_civilite_id
,
MAX
(
d
.
nom_usuel
)
nom_usuel
,
MAX
(
d
.
prenom
)
prenom
,
MAX
(
d
.
date_naissance
)
date_naissance
,
MAX
(
d
.
nom_patronymique
)
nom_patronymique
,
MAX
(
d
.
commune_naissance
)
commune_naissance
,
MAX
(
pn
.
source_code
)
z_pays_naissance_id
,
MAX
(
dep
.
source_code
)
z_departement_naissance_id
,
MAX
(
pnat
.
source_code
)
z_pays_nationalite_id
,
MAX
(
d
.
tel_pro
)
tel_pro
,
MAX
(
d
.
tel_perso
)
tel_perso
,
MAX
(
d
.
email_pro
)
email_pro
,
MAX
(
d
.
email_perso
)
email_perso
,
MAX
(
d
.
adresse_precisions
)
adresse_precisions
,
MAX
(
d
.
adresse_numero
)
adresse_numero
,
MAX
(
anc
.
code
)
z_adresse_numero_compl_id
,
MAX
(
av
.
source_code
)
z_adresse_voirie_id
,
MAX
(
d
.
adresse_voie
)
adresse_voie
,
MAX
(
d
.
adresse_lieu_dit
)
adresse_lieu_dit
,
MAX
(
d
.
adresse_code_postal
)
adresse_code_postal
,
MAX
(
d
.
adresse_commune
)
adresse_commune
,
MAX
(
padr
.
source_code
)
z_adresse_pays_id
,
MAX
(
d
.
numero_insee
)
numero_insee
,
MAX
(
d
.
numero_insee_provisoire
)
numero_insee_provisoire
,
MAX
(
d
.
iban
)
iban
,
MAX
(
d
.
bic
)
bic
,
MAX
(
d
.
rib_hors_sepa
)
rib_hors_sepa
,
MAX
(
d
.
autre_1
)
autre_1
,
MAX
(
d
.
autre_2
)
autre_2
,
MAX
(
d
.
autre_3
)
autre_3
,
MAX
(
d
.
autre_4
)
autre_4
,
MAX
(
d
.
autre_5
)
autre_5
,
MAX
(
empl
.
source_code
)
z_employeur_id
FROM
intervenant
i
JOIN
statut_intervenant
si
ON
si
.
id
=
i
.
statut_id
JOIN
intervenant_dossier
d
ON
d
.
intervenant_id
=
i
.
id
AND
d
.
histo_destruction
IS
NULL
JOIN
type_validation
tv
ON
tv
.
code
=
'DONNEES_PERSO_PAR_COMP'
JOIN
validation
v
ON
v
.
intervenant_id
=
i
.
id
AND
v
.
type_validation_id
=
tv
.
id
AND
v
.
histo_destruction
IS
NULL
JOIN
statut_intervenant
ds
ON
ds
.
id
=
d
.
statut_id
JOIN
civilite
cv
ON
cv
.
id
=
d
.
civilite_id
LEFT
JOIN
pays
pn
ON
pn
.
id
=
d
.
pays_naissance_id
LEFT
JOIN
departement
dep
ON
dep
.
id
=
d
.
departement_naissance_id
LEFT
JOIN
pays
pnat
ON
pnat
.
id
=
d
.
pays_nationalite_id
LEFT
JOIN
adresse_numero_compl
anc
ON
anc
.
id
=
d
.
adresse_numero_compl_id
LEFT
JOIN
voirie
av
ON
av
.
id
=
d
.
adresse_voirie_id
LEFT
JOIN
pays
padr
ON
padr
.
id
=
d
.
adresse_pays_id
LEFT
JOIN
employeur
empl
ON
empl
.
id
=
d
.
employeur_id
WHERE
i
.
histo_destruction
IS
NULL
AND
si
.
code
NOT
IN
(
'AUTRES'
)
AND
si
.
peut_saisir_dossier
=
1
GROUP
BY
i
.
annee_id
,
i
.
code
)
t
JOIN
statut_intervenant
si
ON
si
.
ordre
=
t
.
z_statut_ordre
doc/Connecteurs-Import/Générique/SRC_INTERVENANT.sql
View file @
74f50550
...
...
@@ -37,9 +37,13 @@ SELECT
adresse_pays_id
,
numero_insee
,
numero_insee_provisoire
,
iban
,
bic
,
rib_hors_sepa
,
-- Pour synchroniser les coord. bancaires uniquement sur l'année n, il faut décommenter les 3 lignes ci-dessous et commenter les trois lignes d'après
--CASE WHEN annee_id < current_annee_id THEN i_iban ELSE s_iban END iban,
--CASE WHEN annee_id < current_annee_id THEN i_bic ELSE s_bic END bic,
--CASE WHEN annee_id < current_annee_id THEN i_rib_hors_sepa ELSE s_rib_hors_sepa END rib_hors_sepa,
s_iban
iban
,
s_bic
bic
,
s_rib_hors_sepa
rib_hors_sepa
,
autre_1
,
autre_2
,
autre_3
,
...
...
@@ -240,9 +244,12 @@ FROM (
padr
.
id
adresse_pays_id
,
s
.
numero_insee
numero_insee
,
COALESCE
(
s
.
numero_insee_provisoire
,
i
.
numero_insee_provisoire
,
0
)
numero_insee_provisoire
,
s
.
iban
iban
,
s
.
bic
bic
,
s
.
rib_hors_sepa
rib_hors_sepa
,
s
.
iban
s_iban
,
s
.
bic
s_bic
,
s
.
rib_hors_sepa
s_rib_hors_sepa
,
i
.
iban
i_iban
,
i
.
bic
i_bic
,
i
.
rib_hors_sepa
i_rib_hors_sepa
,
s
.
autre_1
autre_1
,
s
.
autre_2
autre_2
,
s
.
autre_3
autre_3
,
...
...
doc/Connecteurs-Import/Octopus/MV_INTERVENANT.sql
View file @
74f50550
...
...
@@ -7,7 +7,9 @@ WITH i AS (
MAX
(
z_type
)
OVER
(
partition
by
code
,
z_statut_id
)
z_type
,
MIN
(
source_code
)
OVER
(
partition
by
code
,
z_statut_id
)
source_code
,
MIN
(
validite_debut
)
OVER
(
partition
by
code
,
z_statut_id
)
validite_debut
,
MAX
(
validite_fin
)
OVER
(
partition
by
code
,
z_statut_id
)
validite_fin
MAX
(
validite_fin
)
OVER
(
partition
by
code
,
z_statut_id
)
validite_fin
,
MAX
(
fin_affectation_siham
)
OVER
(
partition
by
code
,
z_statut_id
)
fin_affectation_siham
FROM
(
--Step 1 : On prend tous les individus qui ont ou ont eu un contrat à l'université
SELECT
icto
.
individu_id
code
,
...
...
@@ -20,7 +22,8 @@ WITH i AS (
ELSE
'vacataire'
END
z_type
,
icto
.
id_orig
source_code
,
COALESCE
(
icto
.
d_debut
,
to_date
(
'01/01/1900'
,
'dd/mm/YYYY'
))
validite_debut
,
COALESCE
(
icto
.
d_fin
,
to_date
(
'01/01/9999'
,
'dd/mm/YYYY'
))
validite_fin
COALESCE
(
icto
.
d_fin
,
to_date
(
'01/01/9999'
,
'dd/mm/YYYY'
))
validite_fin
,
NULL
fin_affectation_siham
FROM
octo
.
v_individu_contrat_type_ose
@
octoprod
icto
JOIN
octo
.
individu_unique
@
octoprod
uni
ON
icto
.
individu_id
=
uni
.
c_individu_chaine
JOIN
octo
.
v_individu_statut
@
octoprod
vinds
ON
vinds
.
individu_id
=
uni
.
c_individu_chaine
...
...
@@ -37,9 +40,14 @@ WITH i AS (
ELSE
'vacataire'
END
z_type
,
uni
.
c_individu_chaine
||
'-autre'
source_code
,
COALESCE
(
inds
.
d_debut
,
to_date
(
'01/01/1900'
,
'dd/mm/YYYY'
))
validite_debut
,
COALESCE
(
inds
.
d_fin
,
to_date
(
'01/01/9999'
,
'dd/mm/YYYY'
))
validite_fin
COALESCE
(
inds
.
d_fin
,
to_date
(
'01/01/9999'
,
'dd/mm/YYYY'
))
validite_fin
,
CASE
WHEN
inds
.
c_source
=
'SIHAM'
THEN
inds
.
d_fin
ELSE
NULL
END
fin_affectation_siham
FROM
octo
.
individu_unique
@
octoprod
uni
JOIN
octo
.
individu_statut
@
octoprod
inds
ON
inds
.
individu_id
=
uni
.
c_individu_chaine
LEFT
JOIN
octo
.
v_individu_statut
@
octoprod
vinds
ON
vinds
.
individu_id
=
uni
.
c_individu_chaine
LEFT
JOIN
octo
.
v_individu_contrat_type_ose
@
octoprod
icto
ON
uni
.
c_individu_chaine
=
icto
.
individu_id
AND
(
icto
.
code_ose
IN
(
'DOCTOR'
)
AND
icto
.
d_debut
-
184
<=
SYSDATE
)
WHERE
inds
.
d_debut
-
184
<=
SYSDATE
--On ne remonte pas de statut autre pour ceux qui ont déjà un certain type de contrat
...
...
@@ -49,6 +57,7 @@ WITH i AS (
OR
(
inds
.
t_enseignant
=
'O'
AND
inds
.
t_heberge
=
'O'
)
OR
(
inds
.
t_vacataire
=
'O'
)
OR
(
inds
.
t_heberge
=
'O'
))
AND
(
vinds
.
t_doctorant
=
'N'
OR
vinds
.
individu_id
IS
NULL
)
AND
inds
.
c_source
IN
(
'HARP'
,
'OCTO'
,
'SIHAM'
)
)
t
),
...
...
@@ -235,11 +244,8 @@ SELECT DISTINCT
WHEN
(
i
.
z_type
=
'vacataire'
AND
i
.
validite_fin
<
compte
.
date_fin
AND
i
.
validite_fin
IS
NOT
NULL
)
THEN
compte
.
date_fin
ELSE
i
.
validite_fin
END
validite_fin
,
CASE
WHEN
i
.
validite_fin
=
to_date
(
'01/01/9999'
,
'dd/mm/YYYY'
)
THEN
NULL
ELSE
i
.
validite_fin
END
affectation_fin
i
.
fin_affectation_siham
affectation_fin
FROM
i
JOIN
induni
ON
i
.
code
=
induni
.
c_individu_chaine
--AND induni.c_source IN ('HARP', 'OCTO', 'SIHAM'))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment