Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSE
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
OSE
Commits
37a921b6
You need to sign in or sign up before continuing.
Commit
37a921b6
authored
Jun 28, 2023
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Plus de missions dans les paiements
parent
dbf0454c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
data/ddl/view/V_TBL_PAIEMENT.sql
+1
-96
1 addition, 96 deletions
data/ddl/view/V_TBL_PAIEMENT.sql
with
1 addition
and
96 deletions
data/ddl/view/V_TBL_PAIEMENT.sql
+
1
−
96
View file @
37a921b6
...
...
@@ -153,98 +153,3 @@ FROM
LEFT
JOIN
mise_en_paiement
mep
ON
mep
.
formule_res_service_ref_id
=
frs
.
id
AND
mep
.
histo_destruction
IS
NULL
)
t
\ No newline at end of file
UNION
ALL
SELECT
t
.
annee_id
,
NULL
service_id
,
NULL
service_referentiel_id
,
NULL
formule_res_service_id
,
NULL
formule_res_service_ref_id
,
t
.
mission_id
,
t
.
intervenant_id
,
t
.
structure_id
,
mep
.
id
mise_en_paiement_id
,
mep
.
periode_paiement_id
periode_paiement_id
,
mep
.
domaine_fonctionnel_id
domaine_fonctionnel_id
,
t
.
heures_a_payer
,
COUNT
(
*
)
OVER
(
PARTITION
BY
t
.
mission_id
,
t
.
taux_remu_id
,
t
.
taux_horaire
)
heures_a_payer_pond
,
COALESCE
(
mep
.
heures
,
0
)
heures_demandees
,
CASE
WHEN
mep
.
periode_paiement_id
IS
NULL
THEN
0
ELSE
mep
.
heures
END
heures_payees
,
ROUND
(
t
.
heures_aa
/
t
.
heures_a_payer
,
2
)
pourc_exercice_aa
,
1
-
ROUND
(
t
.
heures_aa
/
t
.
heures_a_payer
,
2
)
pourc_exercice_ac
,
t
.
heures_aa
,
t
.
heures_ac
,
t
.
taux_remu_id
,
t
.
taux_horaire
,
t
.
taux_conges_payes
FROM
(
SELECT
t
.
annee_id
,
t
.
mission_id
,
t
.
intervenant_id
,
t
.
structure_id
,
SUM
(
t
.
heures_a_payer
)
heures_a_payer
,
--CASE WHEN t.aa = 1 THEN SUM(t.heures_a_payer) / SUM(t.heures_a_payer) ELSE 0 END pourc_exercice_aa,
-- SUM(t.heures_a_payer) / SUM(CASE WHEN t.aa = 0 THEN t.heures_a_payer ELSE 0 END) pourc_exercice_ac,
SUM
(
CASE
WHEN
t
.
aa
=
1
THEN
t
.
heures_a_payer
ELSE
0
END
)
heures_aa
,
SUM
(
CASE
WHEN
t
.
aa
=
0
THEN
t
.
heures_a_payer
ELSE
0
END
)
heures_ac
,
t
.
taux_remu_id
,
t
.
taux_horaire
,
t
.
taux_conges_payes
FROM
(
SELECT
tm
.
annee_id
annee_id
,
tm
.
mission_id
mission_id
,
tm
.
intervenant_id
intervenant_id
,
tm
.
structure_id
structure_id
,
vhm
.
heures
heures_a_payer
,
CASE
WHEN
to_number
(
TO_CHAR
(
vhm
.
horaire_debut
,
'YYYY'
))
=
tm
.
annee_id
THEN
1
ELSE
0
END
aa
,
CASE
WHEN
TO_CHAR
(
vhm
.
horaire_debut
,
'HH24:MI'
)
>=
ose_parametre
.
get_horaire_nocturne
-- horaire nocturne
OR
jf
.
id
IS
NOT
NULL
-- jour ferie
OR
TO_CHAR
(
vhm
.
horaire_debut
,
'DAY'
,
'NLS_DATE_LANGUAGE=FRENCH'
)
=
'DIMANCHE'
-- dimanche
THEN
COALESCE
(
m
.
taux_remu_majore_id
,
m
.
taux_remu_id
)
ELSE
m
.
taux_remu_id
END
taux_remu_id
,
ose_paiement
.
get_taux_horaire
(
CASE
WHEN
TO_CHAR
(
vhm
.
horaire_debut
,
'HH24:MI'
)
>=
ose_parametre
.
get_horaire_nocturne
-- horaire nocturne
OR
jf
.
id
IS
NOT
NULL
-- jour ferie
OR
TO_CHAR
(
vhm
.
horaire_debut
,
'DAY'
,
'NLS_DATE_LANGUAGE=FRENCH'
)
=
'DIMANCHE'
-- dimanche
THEN
COALESCE
(
m
.
taux_remu_majore_id
,
m
.
taux_remu_id
)
ELSE
m
.
taux_remu_id
END
,
vhm
.
horaire_debut
)
taux_horaire
,
ose_parametre
.
get_taux_conges_payes
+
1
taux_conges_payes
FROM
tbl_mission
tm
JOIN
mission
m
ON
m
.
id
=
tm
.
mission_id
JOIN
volume_horaire_mission
vhm
ON
vhm
.
histo_destruction
IS
NULL
AND
vhm
.
mission_id
=
tm
.
mission_id
JOIN
type_volume_horaire
tvh
ON
tvh
.
id
=
vhm
.
type_volume_horaire_id
AND
tvh
.
code
=
'REALISE'
LEFT
JOIN
validation_vol_horaire_miss
vvhm
ON
vvhm
.
volume_horaire_mission_id
=
vhm
.
id
LEFT
JOIN
validation
v
ON
v
.
id
=
vvhm
.
validation_id
AND
v
.
histo_destruction
IS
NULL
LEFT
JOIN
jour_ferie
jf
ON
TO_CHAR
(
jf
.
date_jour
,
'dd/mm/YYYY'
)
=
TO_CHAR
(
vhm
.
horaire_debut
,
'dd/mm/YYYY'
)
WHERE
tm
.
valide
=
1
/*@INTERVENANT_ID=tm.intervenant_id*/
/*@ANNEE_ID=tm.annee_id*/
AND
(
vhm
.
auto_validation
=
1
OR
v
.
id
IS
NOT
NULL
)
ORDER
BY
vhm
.
horaire_debut
)
t
GROUP
BY
t
.
annee_id
,
t
.
mission_id
,
t
.
intervenant_id
,
t
.
structure_id
,
t
.
taux_remu_id
,
t
.
taux_horaire
,
t
.
taux_conges_payes
)
t
LEFT
JOIN
mise_en_paiement
mep
ON
mep
.
mission_id
=
t
.
mission_id
AND
mep
.
histo_destruction
IS
NULL
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment