<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="RH000107" 
    label="RH-Paie. Extrait de base de données" 
    title="= 'Extrait de base de données (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'" 
    database="iCTI" 
    swf="*CTI_view1" 
    globals="RH_globals.XML" 
    componentsFile="RH_components.XML" 
    softCode="iCTI_rh">
    <CACHE cachable="false" />
    <SELECTIONS label="Paramètres de l'analyse" displayText="">
        <GROUP label="Période">
            <FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
            <FIELD name="PERIODE" label="" UI="combo" tree="true" width="200" default="2010-01-01" globalListProvider="PERIODE_DEBUT" />
            <FIELD name="TOPERIODE" label="au" UI="combo" tree="true" width="200" default="2010-01-31" globalListProvider="PERIODE_FIN" />
        </GROUP>
        <GROUP label="Données">
            <FIELD name="CSVHISTOP" label="Historique de paie" UI="check" selectedValue="1" unselectedValue="0" default="1" />
            <FIELD name="CSVCONT" label="Contrats" UI="check" selectedValue="1" unselectedValue="0" default="0" />
            <FIELD name="CSVPLAH" label="Planning" UI="check" selectedValue="1" unselectedValue="0" default="0" />
        </GROUP>
        <GROUP label="Format">
            <FIELD name="CSVFMT" label="" UI="combo" default="DFT">
                <OPTION label="Format par défaut du PC" data="DFT" />
                <OPTION label="SILK (Excel et OpenOffice)" data="SLK"  />
                <OPTION label="SILK sans limite (Excel 2007 et OpenOffice)" data="SLK_EXCEL2007"  />
                <OPTION label="CSV avec ; (Excel)" data="CSV_PV" />
                <OPTION label="CSV avec ; sans limite (Excel 2007)" data="CSV_EXCEL2007_PV" />
                <OPTION label="CSV avec , (OpenOffice)" data="CSV_V"  />
                <OPTION label="CSV sans entete avec |" data="CSV_PIPE_WITHOUT_HEADER" />
            </FIELD>
        </GROUP>
    </SELECTIONS>
    <SELECTIONS componentName="FILTRES_PAIE_SELECTIONS"/>
    <SELECTIONS componentName="FILTRES_PLANNING_SELECTIONS"/>
    <SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
    <SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
    <SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
    <QUERIES>
        <QUERY label="Historique de paie"> 
            <SQL>
                <select><![CDATA[
                
                SELECT
                    etablissement_texte,
                    contrat_code,
                    matricule, 
                    annee_paie_id,
                    mois_paie_id,
                    rubrique_code,
                    rubrique_texte,
                    compte_code,
                    base,
                    nombre,
                    heures_contrat,
                    heures_payees,
                    heures_travaillees,
                    etp_contrat,
                    etp_paye,
                    etp_travaille,
                    montant_masse_salariale,
                    montant_brut,
                    montant_avantage_nature,
                    montant_frais_imposables,
                    taux_cotisation_salarie,
                    montant_cotisation_salarie,
                    montant_od_net_salarie,
                    taux_cotisation_patronale,
                    montant_cotisation_patronale,
                    montant_od_net_patronale,
                    montant_net_imposable_salarie,
                    montant_net_a_payer_salarie
                FROM rh.v_historique_paie_1 AS v_rh_view_1
                    JOIN rh.v_etablissements_2 ON v_etablissements_2.etablissement_id = v_rh_view_1.rhp_etablissement_id
                    JOIN rh.v_compte_2 ON v_compte_2.compte_id = v_rh_view_1.rhp_compte_id
                WHERE 1=1
                    AND v_rh_view_1.date_paie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]
                    [VIEW.PAIE_SELECT]
                ORDER BY 1,2,3,4,5,6
                ]]></select>
                <FIELDS>
                    <FIELD name="ETST" />
                    <FIELD name="CNT" />
                    <FIELD name="MAT" />
                    <FIELD name="ANNEE" />
                    <FIELD name="MOIS" />
                    <FIELD name="RUBCODE" />
                    <FIELD name="RUBTEXT" />
                    <FIELD name="CTPCODE" />
                    <FIELD name="BASE" />
                    <FIELD name="NOMBRE" />
                    <FIELD name="HC" />
                    <FIELD name="HP" />
                    <FIELD name="HW" />
                    <FIELD name="ETPC" />
                    <FIELD name="ETPP" />
                    <FIELD name="ETPW" />
                    <FIELD name="MASSE" />
                    <FIELD name="BRUT" />
                    <FIELD name="AVTNAT" />
                    <FIELD name="FRAIS" />
                    <FIELD name="TXCOTS" />
                    <FIELD name="MTCOTS" />
                    <FIELD name="ODS" />
                    <FIELD name="TXCOTP" />
                    <FIELD name="MTCOTP" />
                    <FIELD name="ODP" />
                    <FIELD name="IMPOS" />
                    <FIELD name="APAYER" />
                </FIELDS>
            </SQL>
        </QUERY>
        <QUERY label="Contrats"> 
            <SQL>
                <select><![CDATA[
                
                    SELECT
                        etablissement_texte,
                        contrat_code,
                        salarie_code, 
                        annee_activite_id,
                        mois_activite_id,
                        categorie_socio_professionnelle_code,
                        categorie_socio_professionnelle_texte,
                        code_emploi_code,
                        code_emploi_texte,
                        grille_code,
                        grille_texte,
                        grille_groupe_code,
                        grille_groupe_texte,
                        groupe_cotisant_code,
                        groupe_cotisant_texte,
                        motif_debut_code,
                        motif_debut_texte,
                        motif_fin_code,
                        motif_fin_texte,
                        qualification_code,
                        qualification_texte,
                        service_code,
                        service_texte,
                        specialite_code,
                        specialite_texte,
                        statut_code,
                        statut_texte,
                        type_contrat_code,
                        type_contrat_texte,
                        type_horaire_code,
                        type_horaire_texte,
                        type_temps_travail_code,
                        type_temps_travail_texte
                    FROM rh.v_contrats_mois_1 AS v_rh_view_1
                        JOIN rh.v_etablissements_2 ON v_etablissements_2.etablissement_id = v_rh_view_1.rhp_etablissement_id
                        JOIN rh.v_profils_1 ON v_profils_1.profil_id = v_rh_view_1.rhp_profil_id
                    WHERE 1=1
                      AND v_rh_view_1.date_fin_activite BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        AND est_hors_periode IS DISTINCT FROM '1'
                        AND fictif <> '1'
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]
                    ORDER BY 1,2,3,4,5
                    ;
                    
                ]]></select>  
                <FIELDS>
                    <FIELD name="ETST" />
                    <FIELD name="CNT" />
                    <FIELD name="MAT" />
                    <FIELD name="ANNEE" />
                    <FIELD name="MOIS" />
                    <FIELD name="CSPCODE" />
                    <FIELD name="CSPTEXT" />
                    <FIELD name="CEMCODE" />
                    <FIELD name="CEMTEXT" />
                    <FIELD name="GRICODE" />
                    <FIELD name="GRITEXT" />
                    <FIELD name="GGRCODE" />
                    <FIELD name="GGRTEXT" />
                    <FIELD name="GCOCODE" />
                    <FIELD name="GCOTEXT" />
                    <FIELD name="MDECODE" />
                    <FIELD name="MDETEXT" />
                    <FIELD name="MFICODE" />
                    <FIELD name="MFITEXT" />
                    <FIELD name="QUACODE" />
                    <FIELD name="QUATEXT" />
                    <FIELD name="SERCODE" />
                    <FIELD name="SERTEXT" />
                    <FIELD name="SPECODE" />
                    <FIELD name="SPETEXT" />
                    <FIELD name="STACODE" />
                    <FIELD name="STATEXT" />
                    <FIELD name="TCNCODE" />
                    <FIELD name="TCNTEXT" />
                    <FIELD name="THOCODE" />
                    <FIELD name="THOTEXT" />
                    <FIELD name="TTTCODE" />
                    <FIELD name="TTTTEXT" />
                </FIELDS>
            </SQL>
        </QUERY>
        <QUERY label="Heures du planning"> 
            <SQL>
                <select><![CDATA[

                SELECT
                    etablissement_texte,
                    contrat_code,
                    salarie_code, 
                    date_fin_activite,
                    planning_niveau_section_code[1],
                    planning_niveau_section_texte[1],
                    planning_niveau_section_code[2],
                    planning_niveau_section_texte[2],
                    planning_niveau_section_code[3],
                    planning_niveau_section_texte[3],
                    planning_service_source_code,
                    planning_service_source_texte,
                    planning_qualification_source_code,
                    planning_qualification_source_texte,
                    planning_type_absence_code,
                    planning_type_absence_texte,
                    planning_code_horaire_code,
                    planning_code_horaire_texte,
                    temps_du_initial,
                    temps_du,
                    temps_valide,
                    temps_absence
                FROM rh.v_planning_mouvement_1 AS v_rh_view_1
                    JOIN rh.v_etablissements_2 ON v_etablissements_2.etablissement_id = v_rh_view_1.rhp_etablissement_id
                    JOIN rh.v_planning_niveau_2 ON v_planning_niveau_2.planning_niveau_id = v_rh_view_1.rhp_planning_niveau_id
                    JOIN rh.v_planning_service_2 ON v_planning_service_2.planning_service_source_id = v_rh_view_1.rhp_planning_service_id
                    JOIN rh.v_planning_qualification_2 ON v_planning_qualification_2.planning_qualification_source_id = v_rh_view_1.rhp_planning_qualification_id
                    JOIN rh.v_planning_type_absence_2 ON v_planning_type_absence_2.planning_type_absence_id = v_rh_view_1.rhp_planning_type_absence_id
                    JOIN rh.v_planning_code_horaire_2 ON v_planning_code_horaire_2.planning_code_horaire_id = v_rh_view_1.rhp_planning_code_horaire_id
                WHERE 1=1
                    AND v_rh_view_1.date_fin_activite BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                    [VIEW.SALARIES_SELECT]
                    [VIEW.CONTRATS_SELECT]
                    [VIEW.REFERENTIEL_SAE_SELECT]
                    [VIEW.PLANNING_SELECT]
                ORDER BY 1,2,3

                ]]></select> 
                <FIELDS>
                    <FIELD name="ETST" />
                    <FIELD name="CNT" />
                    <FIELD name="MAT" />
                    <FIELD name="DATE" />
                    <FIELD name="NIV1CODE" />
                    <FIELD name="NIV1TEXT" />
                    <FIELD name="NIV2CODE" />
                    <FIELD name="NIV2TEXT" />
                    <FIELD name="NIV3CODE" />
                    <FIELD name="NIV3TEXT" />
                    <FIELD name="SERCODE" />
                    <FIELD name="SERTEXT" />
                    <FIELD name="QUACODE" />
                    <FIELD name="QUATEXT" />
                    <FIELD name="TYPCODE" />
                    <FIELD name="TYPTEXT" />
                    <FIELD name="HORCODE" />
                    <FIELD name="HORTEXT" />
                    <FIELD name="TPSDUI" />
                    <FIELD name="TPSDUU" />
                    <FIELD name="TPSVAL" />
                    <FIELD name="TPSABS" />
                </FIELDS>
            </SQL>
        </QUERY>
    </QUERIES>
    <CSVFILES>
        <CSVFILE label="Historique de paie" name="historique_paie" queryNumber="0" enabled="[CSVHISTOP!=1::false]" format="[CSVFMT]">
            <COLUMN dataField="ETST"  headerText="Etablissement" />
            <COLUMN dataField="CNT"  headerText="Contrat" />
            <COLUMN dataField="MAT"    headerText="Matricule" />
            <COLUMN dataField="ANNEE" headerText="Année" />
            <COLUMN dataField="MOIS"    headerText="Mois" />
            <COLUMN dataField="RUBCODE" headerText="Rubrique" />
            <COLUMN dataField="RUBTEXT" headerText="Libellé" />
            <COLUMN dataField="CTPCODE" headerText="Compte" />
            <COLUMN dataField="BASE"    headerText="Base" />
            <COLUMN dataField="NOMBRE"  headerText="Date Nombre" />
            <COLUMN dataField="HC" headerText="Heures contrat" />
            <COLUMN dataField="HP" headerText="Heures payées" />
            <COLUMN dataField="HW"  headerText="Heures travaillées" />
            <COLUMN dataField="ETPC" headerText="ETP contrat" />
            <COLUMN dataField="ETPP" headerText="ETP payé" />
            <COLUMN dataField="ETPW" headerText="ETP travaillé" />
            <COLUMN dataField="MASSE" headerText="Masse salariale" />
            <COLUMN dataField="BRUT" headerText="Montant brut" />
            <COLUMN dataField="AVTNAT" headerText="Avantage en nature" />
            <COLUMN dataField="FRAIS" headerText="Frais imposable" />
            <COLUMN dataField="TXCOTS" headerText="Taux cotisation salariale" />
            <COLUMN dataField="MTCOTS" headerText="Montant cotisation salariale" />
            <COLUMN dataField="ODS" headerText="OD/Net salariale" />
            <COLUMN dataField="TXCOTP" headerText="Taux cotisation patronale" />
            <COLUMN dataField="MTCOTP" headerText="Montant cotisation patronale" />
            <COLUMN dataField="ODP" headerText="OD/Net patronale" />
            <COLUMN dataField="IMPOS" headerText="Net imposable" />
            <COLUMN dataField="APAYER" headerText="Net à payer" />
        </CSVFILE>
        <CSVFILE label="Contrats" name="contrats" queryNumber="1" enabled="[CSVCONT!=1::false]" format="[CSVFMT]">
            <COLUMN dataField="ETST"    headerText="Etablissement" />
            <COLUMN dataField="CNT"  headerText="Contrat" />
            <COLUMN dataField="MAT"     headerText="Matricule" />
            <COLUMN dataField="ANNEE"   headerText="Année" />
            <COLUMN dataField="MOIS"    headerText="Mois" />
            <COLUMN dataField="CSPCODE" headerText="Code - Catégorie socio-pro" />
            <COLUMN dataField="CSPTEXT" headerText="Libellé - Catégorie socio-pro" />
            <COLUMN dataField="CEMCODE" headerText="Code - Code emploi" />
            <COLUMN dataField="CEMTEXT" headerText="Libellé - Code emploi" />
            <COLUMN dataField="GRICODE" headerText="Code - Grille" />
            <COLUMN dataField="GRITEXT" headerText="Libellé - Grille" />
            <COLUMN dataField="GGRCODE" headerText="Code - Groupe de grille" />
            <COLUMN dataField="GGRTEXT" headerText="Libellé - Groupe de grille" />
            <COLUMN dataField="GCOCODE" headerText="Code - Groupe de cotisants" />
            <COLUMN dataField="GCOTEXT" headerText="Libellé - Groupe de cotisants" />
            <COLUMN dataField="MDECODE" headerText="Code - Motif de début de contrat" />
            <COLUMN dataField="MDETEXT" headerText="Libellé - Motif de début de contrat" />
            <COLUMN dataField="MFICODE" headerText="Code - Motif de fin de contrat" />
            <COLUMN dataField="MFITEXT" headerText="Libellé - Motif de fin de contrat" />
            <COLUMN dataField="QUACODE" headerText="Code - Qualification" />
            <COLUMN dataField="QUATEXT" headerText="Libellé - Qualification" />
            <COLUMN dataField="SERCODE" headerText="Code - Service" />
            <COLUMN dataField="SERTEXT" headerText="Libellé - Service" />
            <COLUMN dataField="SPECODE" headerText="Code - Spécialité" />
            <COLUMN dataField="SPETEXT" headerText="Libellé - Spécialité" />
            <COLUMN dataField="STACODE" headerText="Code - Statut" />
            <COLUMN dataField="STATEXT" headerText="Libellé - Statut" />
            <COLUMN dataField="TCNCODE" headerText="Code - Type de contrat" />
            <COLUMN dataField="TCNTEXT" headerText="Libellé - Type de contrat" />
            <COLUMN dataField="THOCODE" headerText="Code - Type horaire" />
            <COLUMN dataField="THOTEXT" headerText="Libellé - Type horaire" />
            <COLUMN dataField="TTTCODE" headerText="Code - Type de temps de travail" />
            <COLUMN dataField="TTTTEXT" headerText="Libellé - Type de temps de travail" />
        </CSVFILE>
        <CSVFILE label="Planning" name="planning" queryNumber="2" enabled="[CSVPLAH!=1::false]" format="[CSVFMT]">
            <COLUMN dataField="ETST"  headerText="Etablissement" />
            <COLUMN dataField="CNT"  headerText="Contrat" />
            <COLUMN dataField="MAT"  headerText="Matricule" />
            <COLUMN dataField="DATE" headerText="Date" />
            <COLUMN dataField="NIV1CODE" headerText="Code - Niveau 1" />
            <COLUMN dataField="NIV1TEXT"    headerText="Libellé - Niveau 1" />
            <COLUMN dataField="NIV2CODE" headerText="Code - Niveau 2" />
            <COLUMN dataField="NIV2TEXT"    headerText="Libellé - Niveau 2" />
            <COLUMN dataField="NIV3CODE" headerText="Code - Niveau 3" />
            <COLUMN dataField="NIV3TEXT"    headerText="Libellé - Niveau 3" />
            <COLUMN dataField="SERCODE" headerText="Code - Service source" />
            <COLUMN dataField="SERTEXT"    headerText="Libellé - Service source" />
            <COLUMN dataField="QUACODE"  headerText="Code - Qualification source" />
            <COLUMN dataField="QUATEXT" headerText="Libellé - Qualification source" />
            <COLUMN dataField="TYPCODE"  headerText="Code - Type absence" />
            <COLUMN dataField="TYPTEXT" headerText="Libellé - Type absence" />
            <COLUMN dataField="HORCODE"  headerText="Code - Code horaire" />
            <COLUMN dataField="HORTEXT" headerText="Libellé - Code horaire" />
            <COLUMN dataField="TPSDUI"  headerText="Temps du initial" />
            <COLUMN dataField="TPSDUU" headerText="Temps du" />
            <COLUMN dataField="TPSVAL" headerText="Temps validé" />
            <COLUMN dataField="TPSABS" headerText="Temps absence" />
        </CSVFILE>
    </CSVFILES>
    <PRESENTATION>
    </PRESENTATION>
</VUE>