<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="RH000003"
	label="RH. Analyse des [DICT.RH.CONTRAT#4]"
	title="= 'Analyse des [DICT.RH.CONTRAT#4] par ' +  SELECT.GROUPBY_LABEL + ' de ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL "
	database="iCTI"
	swf="*CTI_view1"
	globals="RH_globals.XML"
	componentsFile="RH_components.XML"
	softCode="iCTI_rh"
	dboptimizer="RH_dboptimizer.XML"
	helpDokuWIkiDir="rh:vues:contrats" helpDokuWIkiFile="rh000003"  helpFile="iCTI_RH_RH000003.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_CONTRAT"/>
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY"/>
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
		<PROPERTY name="ORDERBY1">
			<value><![CDATA[[EVAL 
					
					$groupBys = array(
						'[GROUPBY]', 
						'[GROUPBY_2]', 
						'[GROUPBY_3]'
					);
					$exceptions = array('AMCAL', 'ATRIMCAL', 'ACAL', 'MCAL', 'TRIMCAL', 'AMACT', 'ATRIMACT', 'AACT', 'MACT', 'TRIMACT');
					
					$result = array_intersect($groupBys, $exceptions);
					
					if (count($result) > 0) {
						return "DEFAULT";
					} else {
						return "indicateurs[8]";
					}
					
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="ORDERBY2">
			<value><![CDATA[[EVAL 
					
					$groupBys = array(
						'[GROUPBY]', 
						'[GROUPBY_2]', 
						'[GROUPBY_3]'
					);
					$exceptions = array('AMCAL', 'ATRIMCAL', 'ACAL', 'MCAL', 'TRIMCAL', 'AMACT', 'ATRIMACT', 'AACT', 'MACT', 'TRIMACT');
					
					$result = array_intersect($groupBys, $exceptions);
					
					if (count($result) > 0) {
						return "DEFAULT";
					} else {
						return "indicateurs[4]";
					}
					
			EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	<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="Regroupement">
			<FIELD name="GROUPBY" label="" UI="combo" width="300" default="SAL" tree="true" >
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_2" label="" width="300" UI="combo" default="-1" tree="true" >
				<OPTION label="Pas de second niveau" data="-1"/>
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_3" label="" width="300" UI="combo" default="-1" tree="true" >
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_SALCNT_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
	<QUERIES>
		<QUERY label="[DICT.RH.SALARIE#3]">
			<SQL optimizer="V_CNT_X" optimizer2="V_ALL_X">
				<select><![CDATA[		
				
					CTISELECT_TREE
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						OPTIONS{NOTZERO=1}
						ORDERBY{[VIEW.ORDERBY1],, DESC}
						INDICATORS{
							count(DISTINCT CASE
							  WHEN 1=1
								AND '[PERIODE]'::date BETWEEN date_debut_contrat AND date_fin_contrat
							  THEN salarie_id 
							  ELSE null 
							END),
							count(DISTINCT CASE
							  WHEN 1=1
								AND '[TOPERIODE]'::date BETWEEN date_debut_contrat AND date_fin_contrat
							  THEN salarie_id 
							  ELSE null 
							END),
							count(DISTINCT CASE WHEN date_entree_ets < '[PERIODE]'::date THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT CASE WHEN nombre_entrees = 1 THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT CASE WHEN nombre_departs = 1 THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT CASE WHEN date_sortie_ets != '2099-12-31'::date and date_sortie_ets > '[TOPERIODE]'::date THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT CASE WHEN date_sortie_ets = '2099-12-31'::date THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT v_rh_view_1.salarie_id),
							count(DISTINCT case when v_rh_view_1.mois_activite_id = to_char('[TOPERIODE]'::date, 'YYYYMM') AND effectif_permanent = 1 then v_rh_view_1.salarie_id else null end),
							count(DISTINCT CASE WHEN v_rh_view_1.sexe_code = 'M' THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT CASE WHEN v_rh_view_1.sexe_code IS DISTINCT FROM 'M' THEN v_rh_view_1.salarie_id ELSE null END),
							0 - count(DISTINCT CASE WHEN v_rh_view_1.sexe_code = 'M' THEN v_rh_view_1.salarie_id ELSE null END),
							count(DISTINCT CASE WHEN v_rh_view_1.sexe_code IS DISTINCT FROM 'M' THEN v_rh_view_1.salarie_id ELSE null END),
							base.cti_avg_distinct_on(DISTINCT ARRAY[salarie_id::numeric, age_id::numeric]),
							base.cti_avg_distinct_on(DISTINCT ARRAY[salarie_id::numeric, anciennete_jours::numeric]) / 365.25,
							base.cti_avg_distinct_on(DISTINCT ARRAY[salarie_id::numeric, anciennete_reprise_jours::numeric]) / 365.25,
                            count(DISTINCT (CASE WHEN 1=1 AND nombre_debut_contrat = 1 THEN salarie_id ELSE null END)),
                            count(DISTINCT (CASE WHEN 1=1 AND nombre_fin_contrat = 1 THEN salarie_id ELSE null END))
						}	
					FROM #V_CNT_X##V_ALL_X#
					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]
						
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT" /><!-- colonne exploitée pour le mécanisme de tri uniquement ORDERBY{indicateur[7]} -->
					<FIELD name="SALDEB"/>
					<FIELD name="SALFIN"/>
					<FIELD name="ENTAVPER"/>
					<FIELD name="ENTPER"/>
					<FIELD name="SORPER"/>
					<FIELD name="SORAPPER"/>
					<FIELD name="NONSOR"/>
					<FIELD name="NSAL"/>
					<FIELD name="EFFPERM"/>
					<FIELD name="NSALM"/>
					<FIELD name="NSALF"/>
					<FIELD name="NSALMPYR"/>
					<FIELD name="NSALFPYR"/>
					<FIELD name="AGEM"/>
					<FIELD name="ANCM"/>
					<FIELD name="ANCMREP"/>
					<FIELD name="EMB"/>
					<FIELD name="DEP"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY label="contrats">
			<SQL optimizer="V_CNT_X">
				<select><![CDATA[

					DROP TABLE IF EXISTS w_RH000003_TCP
					;

					CREATE TEMP TABLE w_RH000003_TCP AS
						SELECT contrat_id AS c_id
						FROM #V_CNT_X##V_ALL_X#
						WHERE 1=1
							AND 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]						
						GROUP BY 1
						HAVING count(DISTINCT CASE WHEN type_temps_travail_section_code[9] IN ('TC', 'TP') THEN type_temps_travail_section_code[9] ELSE null END) = 2
					;		

					CTISELECT_TREE
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
						OPTIONS{NOTZERO=1}
						ORDERBY{[VIEW.ORDERBY2],, DESC}
						INDICATORS{
							count(DISTINCT CASE WHEN date_debut_contrat < '[PERIODE]' THEN v_rh_view_1.contrat_id ELSE null END),
							count(DISTINCT CASE WHEN nombre_debut_contrat > 0 THEN contrat_id ELSE null END),
							count(DISTINCT CASE WHEN date_debut_contrat >= '[PERIODE]' AND date_fin_contrat <= '[TOPERIODE]' THEN v_rh_view_1.contrat_id ELSE null END),
							count(DISTINCT v_rh_view_1.contrat_id),
							count(DISTINCT CASE WHEN nombre_fin_contrat > 0 THEN contrat_id ELSE null END),
							count(DISTINCT CASE WHEN date_fin_contrat > '[TOPERIODE]' and date_fin_contrat != '2099-12-31'::date THEN v_rh_view_1.contrat_id ELSE null END),
							count(DISTINCT CASE WHEN date_fin_contrat = '2099-12-31'::date THEN v_rh_view_1.contrat_id ELSE null END),
							count(DISTINCT v_rh_view_1.salarie_id),
                            SUM(v_rh_view_1.nombre_heures),
							SUM(v_rh_view_1.equivalent_temps_plein) / base.cti_months_between('[PERIODE]'::date, '[TOPERIODE]'::date),
							count(DISTINCT CASE WHEN nombre_entrees = 1 THEN salarie_id ELSE null END),
							count(DISTINCT CASE WHEN type_contrat_section_code[9] = 'CDI' THEN contrat_id ELSE null END),
							count(DISTINCT CASE WHEN type_contrat_section_code[9] = 'CDD' THEN contrat_id ELSE null END),
							count(DISTINCT CASE WHEN type_temps_travail_section_code[9] = 'TC' THEN contrat_id ELSE null END),
							count(DISTINCT CASE WHEN type_temps_travail_section_code[9] = 'TP' THEN contrat_id ELSE null END),
							count(DISTINCT w_RH000003_TCP.c_id),
							count(DISTINCT case when v_rh_view_1.mois_activite_id = to_char('[TOPERIODE]'::date, 'YYYYMM') AND effectif_permanent = 1 then v_rh_view_1.salarie_id else null end)
						}
					FROM #V_CNT_X##V_ALL_X#
						LEFT JOIN w_RH000003_TCP ON w_RH000003_TCP.c_id = v_rh_view_1.contrat_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]	
					;
					
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT" /><!-- colonne exploitée pour le mécanisme de tri uniquement ORDERBY{indicateur[7]} -->
					<FIELD name="CNTDEJACOM"/>
					<FIELD name="CNTCOMSP"/>
					<FIELD name="NCNTSP"/>
					<FIELD name="NCNT"/>
					<FIELD name="CNTTERMSP"/>
					<FIELD name="CNTTERMAP"/>
					<FIELD name="CNTPASTERM"/>
					<FIELD name="NSAL"/>
                    <FIELD name="NHCNT"/>
					<FIELD name="NETP"/>
					<FIELD name="NEMB"/>
					<FIELD name="NCDI"/>
					<FIELD name="NCDD"/>
					<FIELD name="NTC"/>
					<FIELD name="NTP"/>
					<FIELD name="NTCP"/>
					<FIELD name="EFFPERM"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[
						SELECT 'X_PERIODE_D', greatest(('[PERIODE]'::date - '1 year'::interval)::date, (SELECT (min(mois)::text||'01')::date FROM rh.p_chiffrier_production))::text
					UNION ALL
						SELECT 'X_TOPERIODE_D', greatest(('[TOPERIODE]'::date - '1 year'::interval)::date, (SELECT (min(mois)::text||'01')::date FROM rh.p_chiffrier_production))::text
					UNION ALL
						SELECT 'X_PERIODE', greatest(('[PERIODE]'::date - '3 years'::interval)::date, (SELECT (min(mois)::text||'01')::date FROM rh.p_chiffrier_production))::text
				]]></select>
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Dernière année"  shortLabel="Dernière année"  view="RH000096.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;"/>
					<ARG name="TYPE_COMPARAISON" value="'2'" />              
					<ARG name="GROUPBY" value="return 'MACT';"/>
					<ARG name="LGROUPBY" value="SELECT.GROUPBY;"/>
					<ARG name="LGROUPBY_2" value="if(SELECT.GROUPBY_2 != '-1'){return SELECT.GROUPBY_2;}else {return '-1';}"/>
					<ARG name="LGROUPBY_3" value="if(SELECT.GROUPBY_3 != '-1'){return SELECT.GROUPBY_3;}else {return '-1';}"/>
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
                    <ARG name="DATA1" value="'NSAL'" />
                    <ARG name="DATA2" value="'CNTTOT'" />
                    <ARG name="DATA3" value="'NCDI'" />
                    <ARG name="DATA4" value="'NCDD'" />
                    <ARG name="DATA5" value="'ETPTH'" />
                    <ARG name="DATA6" value="'0'" />
                    <ARG name="DATA7" value="'0'" />
                    <ARG name="DATA8" value="'0'" />
                    <ARG name="DATA9" value="'0'" />
                    <ARG name="DATA10" value="'0'" />
                    <ARG name="DATA011" value="'0'" />
                    <ARG name="DATA012" value="'0'" />
                    <ARG name="DATA013" value="'0'" />
                    <ARG name="DATA014" value="'0'" />
                    <ARG name="DATA015" value="'0'" />
			</VIEWLINK>			
            <VIEWLINK label="Comparatif" shortLabel="Comparatif" view="RH000096.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
				<ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
				<ARG name="TYPE_COMPARAISON" value="'2'" />
				<ARG name="LGROUPBY" value="SELECT.GROUPBY;"/>
				<ARG name="LGROUPBY_2" value="if(SELECT.GROUPBY_2 != '-1'){return SELECT.GROUPBY_2;}else {return '-1';}"/>
				<ARG name="LGROUPBY_3" value="if(SELECT.GROUPBY_3 != '-1'){return SELECT.GROUPBY_3;}else {return '-1';}"/>                
                <ARG name="DATA1" value="'NSAL'" />
                <ARG name="DATA2" value="'CNTTOT'" />
                <ARG name="DATA3" value="'NCDI'" />
                <ARG name="DATA4" value="'NCDD'" />
                <ARG name="DATA5" value="'ETPTH'" />
                <ARG name="DATA6" value="'0'" />
                <ARG name="DATA7" value="'0'" />
                <ARG name="DATA8" value="'0'" />
                <ARG name="DATA9" value="'0'" />
                <ARG name="DATA10" value="'0'" />
                <ARG name="DATA011" value="'0'" />
                <ARG name="DATA012" value="'0'" />
                <ARG name="DATA013" value="'0'" />
                <ARG name="DATA014" value="'0'" />
                <ARG name="DATA015" value="'0'" />  
			</VIEWLINK>			
            <VIEWLINK label="Comparatif mensuel" shortLabel="Comp. Mensuel" view="RH000116.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
				<ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
				<ARG name="TYPE_COMPARAISON" value="'2'" /> 
				<ARG name="DATA1" value="'NSAL'" />
				<ARG name="DATA2" value="'CNTTOT'" />
				<ARG name="DATA3" value="'ETPTH'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative" view="RH000117.XML" rowContext="false" buttonType="VIEWLINK_EVO_COMP_RH" >			
				<VIEWITEM label="Standard" shortLabel="Evolution comparative" view="RH000117.XML" rowContext="false" enabled="true" buttonType="VIEWLINK_EVO_COMP_RH">
                    <ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
                    <ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
					<ARG name="GROUPBY_2" value="return 'MACT';" />
				    <ARG name="TYPE_COMPARAISON" value="'2'" /> 
                    <ARG name="DATA1" value="'NSAL'" />
                    <ARG name="DATA2" value="'CNTTOT'" />
                    <ARG name="DATA3" value="'NCDI'" />
                    <ARG name="DATA4" value="'NCDD'" />
                    <ARG name="DATA5" value="'ETPTH'" />
                    <ARG name="DATA6" value="'0'" />
                    <ARG name="DATA7" value="'0'" />
                    <ARG name="DATA8" value="'0'" />
                    <ARG name="DATA9" value="'0'" />
                    <ARG name="DATA10" value="'0'" />
                    <ARG name="DATA011" value="'0'" />
                    <ARG name="DATA012" value="'0'" />
                    <ARG name="DATA013" value="'0'" />
                    <ARG name="DATA014" value="'0'" />
                    <ARG name="DATA015" value="'0'" />
                </VIEWITEM>	
				<VIEWITEM label="Détaillée" shortLabel="Evol. comparative" view="RH000117.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
                    <ARG name="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
                    <ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />
					<ARG name="GROUPBY_2" value="return 'MCAL';" />
                    <ARG name="DATA1" value="'NSAL'" />
                    <ARG name="DATA2" value="'CNTTOT'" />
                    <ARG name="DATA3" value="'NCDI'" />
                    <ARG name="DATA4" value="'NCDD'" />
                    <ARG name="DATA5" value="'NSALH'" />
                    <ARG name="DATA6" value="'NSALF'" />
                    <ARG name="DATA7" value="'CNTTOT'" />
                    <ARG name="DATA8" value="'CNTTERM'" />
                    <ARG name="DATA9" value="'ANCMOY'" />
                    <ARG name="DATA10" value="'ETPTH'" />
                    <ARG name="DATA011" value="'0'" />
                    <ARG name="DATA012" value="'0'" />
                    <ARG name="DATA013" value="'0'" />
                    <ARG name="DATA014" value="'0'" />
                    <ARG name="DATA015" value="'0'" />	
                </VIEWITEM>	
			</VIEWLINK>	
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="RH000013.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" buttonType="EVOLUTION">
				<ARG name="DATA" value="'NSAL'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="RH000099.XML" enabled="true" rowContext="false" buttonType="ANALYSE_CROISEE">
				<ARG name="ALIAS_PERIODE" value="return '-1'" />				
				<ARG name="PERIODE" value="return VIEW.X_PERIODE.substr(0,4)+'-01-01';"/>
				<ARG name="DATA" value="'NSAL'" />
				<ARG name="COLUMNBY" value="'MACT'" />
				<ARG name="GROUPBY" value="'AACT'" />
				<ARG name="GROUPBY_2" value="return SELECT.GROUPBY;" />
				<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_2;" />
                <ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="LGROUPBY_2" value="return SELECT.GROUPBY_2;" />
				<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
				<ARG name="GROUPBY_TAB" value="'TAB'" />
				<ARG name="COLUMNBYCOUNT" value="'12'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse"  shortLabel="Analyse"  view="RH000003.XML" rowContext="false" buttonType="ANALYSE_VIEWLINK_RH">
				<VIEWITEM label="Analyse" shortLabel="Analyse"  view="RH000003.XML" rowContext="false" enabled="true" buttonType="ANALYSE_VIEWLINK_RH" componentName="RH_VIEWLINK">
                    <ARGS name="SPEC" >
                        <value><![CDATA[
                            LINKVARIABLES['ALIAS_PERIODE'] = '-1';
                            LINKVARIABLES['PERIODE'] = SELECT.PERIODE;
                            LINKVARIABLES['TOPERIODE'] = SELECT.TOPERIODE;
                            LINKVARIABLES['GROUPBY'] = SELECT.GROUPBY;
                            LINKVARIABLES['GROUPBY_2'] = SELECT.GROUPBY_2;
                            LINKVARIABLES['GROUPBY_3'] = SELECT.GROUPBY_3;
                            LINKVARIABLES['GROUPBY_TAB'] = 'TAB';
                            return 'OK';
                        ]]></value>
                    </ARGS>                    
                </VIEWITEM>					
				<VIEWITEM label="Analyse paramètrable" shortLabel="Analyse"  view="RH000118.XML" rowContext="false" enabled="true" buttonType="ANALYSE_VIEWLINK_RH" componentName="RH_VIEWLINK">
                    <ARGS name="SPEC" >
                        <value><![CDATA[
                            LINKVARIABLES['ALIAS_PERIODE'] = '-1';
                            LINKVARIABLES['PERIODE'] = SELECT.PERIODE;
                            LINKVARIABLES['TOPERIODE'] = SELECT.TOPERIODE;
                            LINKVARIABLES['GROUPBY'] = SELECT.GROUPBY;
                            LINKVARIABLES['GROUPBY_2'] = SELECT.GROUPBY_2;
                            LINKVARIABLES['GROUPBY_3'] = SELECT.GROUPBY_3;
                            LINKVARIABLES['GROUPBY_TAB'] = 'TAB';
                            LINKVARIABLES['DATA1'] = 'NSAL';
                            LINKVARIABLES['DATA2'] = 'CNTTOT';
                            LINKVARIABLES['DATA3'] = 'NCDI';
                            LINKVARIABLES['DATA4'] = 'NCDD';
                            LINKVARIABLES['DATA5'] = 'ETPTH';
                            LINKVARIABLES['DATA6'] = '0';
                            LINKVARIABLES['DATA7'] = '0';
                            LINKVARIABLES['DATA8'] = '0';
                            LINKVARIABLES['DATA9'] = '0';
                            LINKVARIABLES['DATA10'] = '0';
                            LINKVARIABLES['DATA011'] = '0';
                            LINKVARIABLES['DATA012'] = '0';
                            LINKVARIABLES['DATA013'] = '0';
                            LINKVARIABLES['DATA014'] = '0';
                            LINKVARIABLES['DATA015'] = '0';
                            return 'OK';
                        ]]></value>
                    </ARGS> 				
                </VIEWITEM>	
			</VIEWLINK>			
            <VIEWLINK label="Justificatif"  shortLabel="Justificatif"  rowContext="false" buttonType="BUTTON_RHP_ZOOM" >
				<VIEWITEM label="Liste des [DICT.RH.CONTRAT#4]" shortLabel="Liste [DICT.RH.CONTRAT#4]" view="RH000006.XML" componentName="RH_VIEWLINK">
                    <ARGS name="SPEC">
                        <value><![CDATA[
                            LINKVARIABLES['GROUPBY_2'] = 'CNT'
                            return 'OK';
                
                        ]]></value>
                    </ARGS>                   
                </VIEWITEM>				
                <VIEWITEM label="Liste des [DICT.RH.SALARIE#4]" shortLabel="Liste [DICT.RH.SALARIE#2]" view="RH000006.XML" componentName="RH_VIEWLINK">
                    <ARGS name="SPEC">
                        <value><![CDATA[
                            LINKVARIABLES['GROUPBY_2'] = 'SAL'
                            return 'OK';
                
                        ]]></value>
                    </ARGS>                 
                </VIEWITEM>					
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET label="[DICT.RH.SALARIE#3]" multiTab="true">
			<CHART title="" type="group" subType="h" percentHeight="100" fromTotal="true" maxItems="10">
				<CHART title="Entrée/Sortie [DICT.RH.SALARIE#3]" type="columnChart" serieIsCategory="true" fromTotal="true">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="SALDEB" displayName="[DICT.RH.SALARIE#3] début période" />
					<SERIE field="ENTPER" displayName="Entrées période" />
					<SERIE field="SORPER" displayName="Sorties période" />
					<SERIE field="SALFIN" displayName="[DICT.RH.SALARIE#3] fin période" />
				</CHART>
				<CHART title="Ratio Effectif permanent" subType="stacked" fromTotal="false" type="columnChart"
					maxItems="10"
					maxItemsSortOn="EFFPERM"
					maxItemsSortSeq="D"
					sortField="EFFPERM"
					sortSeq="D"
					condition="ROW.LVL == '1'">
					<CATEGORY field="COD" type="Char" />
					<SERIE field="EFFPERM" displayName="Effectif permanent"/>
					<SERIE field="EFFNONPERM" displayName="Reste de l'effectif" />
				</CHART>
			</CHART>
			<DATAGRID title="" total="true" headerHeight="40" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" variableRowHeight="true" sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB')">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" type="Number" visible="false"/>
				<COLUMN dataField="COD" type="Char" width="90" outputFormat="#" headerText="Code" textAlign="left" totalComplement="*ROW">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="110" headerText="Texte" textAlign="left" totalComplement="*ROW"/>
				<COLUMN dataField="ENTAVPER" type="Number" width="90" fixed="false" outputFormat="#" headerText="Entrées Ets.&#xD; avant Période" description="Nombre de [DICT.RH.SALARIE#4] entrés pour la première fois dans l'Etablissement avant la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="SALDEB" type="Number" width="90" outputFormat="#" headerText="[DICT.RH.SALARIE#3]&#xD;Début Période" textAlign="right" description="[DICT.RH.SALARIE#3] présents au 1er jour de la période." totalComplement="*ROW"/>
				<COLUMN dataField="ENTPER" type="Number" width="80" outputFormat="#" headerText="Entrées Ets.&#xD;sur Période" description="Nombre de [DICT.RH.SALARIE#4] entrés pour la première fois dans l'Etablissement sur la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="SORPER" type="Number" width="80" outputFormat="#" headerText="Sorties Ets.&#xD;sur Période" description="Nombre de [DICT.RH.SALARIE#4] sortis définitivement de l'Etablissement sur la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="SALFIN" type="Number" width="90" outputFormat="#" headerText="[DICT.RH.SALARIE#3]&#xD;Fin Période" description="[DICT.RH.SALARIE#3] présents au dernier jour de la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="SORAPPER" type="Number" width="90" outputFormat="#" headerText="Sorties Ets.&#xD;après Période" description="Nombre de [DICT.RH.SALARIE#4] sortis définitivement de l'Etablissement après la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NONSOR" type="Number" width="80" outputFormat="#" headerText="Non sortis" textAlign="right" description="Nombre de [DICT.RH.SALARIE#4] toujours présents dans l'Etablissement." totalComplement="*ROW"/>
				<COLUMN dataField="NSAL" type="Number" width="80" outputFormat="#" headerText="[DICT.RH.SALARIE#3] total" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="PSAL" type="Number" width="70" outputFormat="#,0%" headerText="% [DICT.RH.SALARIE#3] total" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NSAL / TOTALROW.NSAL * 100"/>
				</COLUMN>
				<COLUMN dataField="EMB" type="Number" width="80" outputFormat="#" headerText="Embauches" description="Nombre de [DICT.RH.SALARIE#4] ayant eu un début de contrat sur la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="DEP" type="Number" width="80" outputFormat="#" headerText="Départs" description="Nombre de [DICT.RH.SALARIE#4] ayant eu une fin de contrat sur la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="EFFPERM" type="Number" width="80" outputFormat="#" headerText="Effectif permanent" textAlign="right" description="[DICT.RH.SALARIE#3] titulaires d'un CDI à temps complet et présents sur l'ensemble de la période." totalComplement="*ROW"/>
				<COLUMN dataField="EFFNONPERM" visible="false" type="Number" width="80" outputFormat="#" headerText="Effectif NON permanent" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NSAL - ROW.EFFPERM"/>
				</COLUMN>
				<COLUMN dataField="ROTEMP" type="Number" width="70" outputFormat="#,0%" headerText="Rotation de l'emploi" textAlign="right" description="(nb d'entrées Ets. + nb de sorties Ets.) / 2 / nb de [DICT.RH.SALARIE#4] en début de période * 100" totalComplement="" calc="true">
					<CALC formula="(ROW.ENTPER + ROW.SORPER) / 2 / ROW.SALDEB * 100"/>
				</COLUMN>
				<COLUMN dataField="NSALM" type="Number" width="80" outputFormat="#" headerText="[DICT.RH.SALARIE#3] Hommes" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NSALF" type="Number" width="80" outputFormat="#" headerText="[DICT.RH.SALARIE#3] Femmes" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="PNSALF" type="Number" width="80" outputFormat="#,0%" headerText="% Femmes" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NSALF / ROW.NSAL * 100"/>
				</COLUMN>
				<COLUMN dataField="AGEM" type="Number" width="80" outputFormat="#,0" headerText="Age moyen" textAlign="right" totalComplement="*ROW" />
				<COLUMN dataField="ANCM" type="Number" width="80" outputFormat="#,00" headerText="Ancienneté Etablissement moyenne" description="Moyenne de l'ancienneté établissement par [DICT.RH.SALARIE#2] sur la période" textAlign="right" totalComplement="*ROW" />
				<COLUMN dataField="ANCMREP" type="Number" width="80" outputFormat="#,00" headerText="Ancienneté Reprise moyenne" description="Moyenne de l'ancienneté reprise par [DICT.RH.SALARIE#2] sur la période" textAlign="right" totalComplement="*ROW" />
			</DATAGRID>
		</ONGLET>
		<ONGLET label="[DICT.RH.CONTRAT#3]" queryNumber="1" multiTab="true">
			<CHART title="" type="group" subType="h" percentHeight="100" maxItems="10">
				<CHART title="Ratio Temps complet/Temps partiel" subType="stacked" fromTotal="false" type="columnChart"
					maxItems="10"
					maxItemsSortOn="NTC"
					maxItemsSortSeq="D"
					sortField="NTC"
					sortSeq="D"
					condition="ROW.LVL == '1'">
					<CATEGORY field="COD" type="Char" />
					<SERIE field="NTC" displayName="Temps complet"/>
					<SERIE field="NTP" displayName="Temps partiel" />
				</CHART>
				<CHART title="Répartition CDI/CDD" type="pieChart" serieIsCategory="true" fromTotal="true" showDataTips="true">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="NCDI" displayName="CDI" />
					<SERIE field="NCDD" displayName="CDD"/>
				</CHART>
			</CHART>
			<DATAGRID title="" total="true" headerHeight="40" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" variableRowHeight="true" sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB')">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" type="Number" visible="false"/>
				<COLUMN dataField="COD" type="Char" width="90" outputFormat="#" headerText="Code" textAlign="left" totalComplement="*ROW">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="110" headerText="Texte" textAlign="left" totalComplement="*ROW"/>
				<COLUMN dataField="CNTDEJACOM" type="Number" fixed="false" width="100" outputFormat="#" headerText="Débutés&#xD;&lt; Période" description="[DICT.RH.CONTRAT#1] débutés avant la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="CNTCOMSP" type="Number" width="100" outputFormat="#" headerText="Débutés&#xD;sur Période" description="[DICT.RH.CONTRAT#1] débutés sur la période." textAlign="right" totalComplement="*ROW"/>
				<!--<COLUMN dataField="NEMB" type="Number" width="100" outputFormat="#" headerText="Embauches" textAlign="right" totalComplement="*ROW"/>-->
				<!-- <COLUMN dataField="NCNTSP" type="Number" width="80" outputFormat="#" headerText="[DICT.RH.CONTRAT#3] sur Pér." textAlign="right" totalComplement="*ROW"/> -->
				<COLUMN dataField="CNTTERMSP" type="Number" width="100" outputFormat="#" headerText="Terminés&#xD;sur Période" description="[DICT.RH.CONTRAT#1] terminés sur la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="CNTTERMAP" type="Number" width="100" outputFormat="#" headerText="Terminés&#xD;&gt; Période" description="[DICT.RH.CONTRAT#1] terminés après la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="CNTPASTERM" type="Number" width="100" outputFormat="#" headerText="Non terminés" description="[DICT.RH.CONTRAT#1] en cours." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NCNT" type="Number" width="80" outputFormat="#" headerText="Total" description="Nb. de [DICT.RH.CONTRAT#4] total, qu'il chevauche ou s'inscrive dans la période." textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NCNTP" type="Number" width="70" outputFormat="#,0%" headerText="% total" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NCNT / TOTALROW.NCNT * 100"/>
				</COLUMN>
				<COLUMN dataField="NCDI" type="Number" width="80" outputFormat="#" headerText="Nb CDI" description="Nombre de [DICT.RH.CONTRAT#4] à durée indéterminée" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NCDD" type="Number" width="80" outputFormat="#" headerText="Nb CDD" description="Nombre de [DICT.RH.CONTRAT#4] à durée déterminée" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NTC" type="Number" width="80" outputFormat="#" headerText="Nb temps complet" description="Nombre de [DICT.RH.CONTRAT#4] à temps complet" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NTP" type="Number" width="80" outputFormat="#" headerText="Nb temps partiel" description="Nombre de [DICT.RH.CONTRAT#4] à temps partiel" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NTCP" type="Number" width="100" outputFormat="#" headerText="Nb temps complet/partiel" description="Nombre de [DICT.RH.CONTRAT#4] passant, en cours de [DICT.RH.CONTRAT#2], de temps complet à partiel ou inversement" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NSAL" type="Number" visible="false" width="80" outputFormat="#" headerText="[DICT.RH.SALARIE#3]" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="RATIOSALCNT" type="Number" width="80" outputFormat="#,0" headerText="[DICT.RH.CONTRAT#1] / [DICT.RH.SALARIE#1]" description="Nombre de [DICT.RH.CONTRAT#4] par [DICT.RH.SALARIE#2]" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NCNT / ROW.NSAL"/>
				</COLUMN>
				<COLUMN dataField="RATIOSALCDD" type="Number" width="80" outputFormat="#,0" headerText="CDD / [DICT.RH.SALARIE#1]" description="Nombre de [DICT.RH.CONTRAT#4] à durée déterminée par [DICT.RH.SALARIE#2]" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NCDD / ROW.NSAL"/>
				</COLUMN>
				<COLUMN dataField="EFFNONPERM" visible="false" type="Number" width="80" outputFormat="#" headerText="Effectif NON permanent" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NSAL - ROW.EFFPERM"/>
				</COLUMN>
				<COLUMN dataField="EFFPERM" visible="false" type="Number" width="80" outputFormat="#" headerText="Effectif permanent" textAlign="right" totalComplement="*ROW"/>
                <COLUMN dataField="NHCNT" type="Number" width="80" outputFormat="#,00" headerText="Heures [DICT.RH.CONTRAT#2]" textAlign="right" totalComplement="*ROW"/>
				<COLUMN dataField="NETP" type="Number" width="80" outputFormat="#,00" headerText="ETP [DICT.RH.CONTRAT#1]" textAlign="right" totalComplement="*ROW" description="ETP calculé en jours"/>
				<COLUMN dataField="PETP" type="Number" width="80" outputFormat="#,0%" headerText="% ETP [DICT.RH.CONTRAT#1]" textAlign="right" totalComplement="" calc="true">
					<CALC formula="ROW.NETP / TOTALROW.NETP * 100"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
