Skip to content
Snippets Groups Projects
Commit 0a291fad authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Finalisation vue pour préliquidation siham

parent 5d2143d4
No related branches found
No related tags found
No related merge requests found
CREATE CREATE
OR REPLACE FORCE VIEW V_EXPORT_PAIEMENT_WINPAIE AS OR REPLACE FORCE VIEW V_EXPORT_PAIEMENT_SIHAM AS
SELECT 'P' type, SELECT 'P' type,
code_rh matricule, code_rh matricule,
CASE WHEN type_intervenant_code = 'P' THEN '0204' ELSE '2251' END retenue, CASE WHEN type_intervenant_code = 'P' THEN '200204' ELSE '202251' END retenue,
annee_id 'du_mois', type_intervenant_id, ose_paiement.get_format_mois_du() du_mois,
structure_id, '20' || ose_paiement.get_annee_extraction_paie() annee_de_paye,
periode_id, ose_paiement.get_mois_extraction_paie() mois_de_paye,
intervenant_id, 'N' tg_specifique,
insee, 'A definir' dossier_de_paye,
nom, '01/' || ose_paiement.get_mois_extraction_paie() || '/20' ||
'20' carte, ose_paiement.get_annee_extraction_paie() date_pecuniaire,
code_origine, nbu nombre_d_unites,
'0' sens, montant montant,
'B' mc,
nbu,
montant,
libelle || ' ' || lpad(to_char(floor(nbu)), 2, '00') || ' H' || libelle || ' ' || lpad(to_char(floor(nbu)), 2, '00') || ' H' ||
CASE to_char(round(nbu - floor(nbu), 2) * 100, '00') CASE to_char(round(nbu - floor(nbu), 2) * 100, '00')
WHEN ' 00' THEN '' WHEN ' 00' THEN ''
ELSE ' ' || lpad(round(nbu - floor(nbu), 2) * 100, 2, '00') END libelle ELSE ' ' || lpad(round(nbu - floor(nbu), 2) * 100, 2, '00') END libelle,
'B' mode_de_calcul,
code_origine code_origine
FROM (SELECT i.annee_id annee_id, FROM (SELECT i.annee_id annee_id,
ti.id type_intervenant_id, ti.id type_intervenant_id,
ti.code type_intervenant_code, ti.code type_intervenant_code,
...@@ -95,9 +94,9 @@ FROM (SELECT i.annee_id ...@@ -95,9 +94,9 @@ FROM (SELECT i.annee_id
JOIN (SELECT level ind, 99 max_nbu FROM dual CONNECT BY 1=1 AND LEVEL <= 11) tnbu JOIN (SELECT level ind, 99 max_nbu FROM dual CONNECT BY 1=1 AND LEVEL <= 11) tnbu
ON ceil(t2.nbu / max_nbu) >= ind ON ceil(t2.nbu / max_nbu) >= ind
JOIN intervenant i ON i.id = t2.intervenant_id JOIN intervenant i ON i.id = t2.intervenant_id
JOIN annee a ON a.id = i.annee_id
LEFT JOIN intervenant_dossier d ON i.id = d.intervenant_id AND d.histo_destruction IS NULL LEFT JOIN intervenant_dossier d ON i.id = d.intervenant_id AND d.histo_destruction IS NULL
JOIN statut si ON si.id = i.statut_id JOIN statut si ON si.id = i.statut_id
JOIN type_intervenant ti ON ti.id = si.type_intervenant_id JOIN type_intervenant ti ON ti.id = si.type_intervenant_id
JOIN structure s ON s.id = t2.structure_id) t3 JOIN structure s ON s.id = t2.structure_id) t3
WHERE annee_id = 2021
ORDER BY annee_id, type_intervenant_id, structure_id, periode_id, nom, code_origine, nbu DESC ORDER BY annee_id, type_intervenant_id, structure_id, periode_id, nom, code_origine, nbu DESC
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment