<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="RH000115" 
	label="RH. Cumul de la paie" 
	title="= 'Cumul par ' +  SELECT.GROUPBY_LABEL + ' ('+ 'N-1 : '+ VIEW.PERIODE_D_LABEL + ' à ' + VIEW.TOPERIODE_D_LABEL  + ' vs ' + '  N : '+   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:historique_de_paie" helpDokuWIkiFile="rh000115"  helpFile=""
>	

	<VIEWPROPERTIES componentName="PROPERTIES_PAIE"/>
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY"/>
	
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
		<PROPERTY name="DATAFUNC">
			<value><![CDATA[[EVAL 
				// <?php
				
				function RH000017_calcSQL($data) {
					$ctiDivision = "base.cti_division(%s, %s)";
					$countDistinctCaseWhen = "count(DISTINCT CASE WHEN v_rh_view_1.date_paie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE null END)";
					$sumDistinctCaseWhen = "sum(CASE WHEN v_rh_view_1.date_paie BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE 0 END)";
					$periodeDebut = '\'[PERIODE]\'::date';
					$periodeFin = '\'[TOPERIODE]\'::date';
					$periodePrecDebut = '\'[VIEW.PERIODE_D]\'::date';
					$periodePrecFin = '\'[VIEW.TOPERIODE_D]\'::date';
					
					switch ($data) {
						case 'NBSAL':
							$tmp1 = sprintf($countDistinctCaseWhen, 'v_rh_view_1.salarie_id');
							break;
						case 'NBRUB':
							$tmp1 = sprintf($countDistinctCaseWhen, 'v_rh_view_1.rubrique_id');
							break;
						case 'NBETP':
							$tmp1 = 'base.cti_division('.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_paye').', base.cti_months_between(@date_debut@, @date_fin@))';
							break;   
						case 'NBETPT':
							$tmp1 = 'base.cti_division('.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_travaille').', base.cti_months_between(@date_debut@, @date_fin@))';
							break;
						case 'NBHP':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.heures_payees');
							break;
						case 'NBHT':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.heures_travaillees');
							break;
						case 'MTMASSE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_masse_salariale');
							break;


						case 'MTHORMOYCHAR':
							$tmp1 = 'base.cti_division('.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_masse_salariale').', '.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.heures_payees').')';
							break;
						case 'MTMASSEMOY':
							$tmp1 = '
								base.cti_division('.
									sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_masse_salariale').','.
									sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_paye').'
								)
							';
							break;
						case 'MTMASSEPCT':
							$tmp1 = '
								base.cti_division(
									base.cti_division('.
										sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_net_a_payer_salarie').','.
										sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_paye').'
									),
									base.cti_division('.
										sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_masse_salariale').','.
										sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_paye').'
									)
								) * 100
							';
							break;
						case 'MTNETAPAYERMOY' :
							$tmp1 = 'base.cti_division('.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_net_a_payer_salarie').', '.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_paye').')';
							break;


						case 'MTBRUT':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_brut');
							break;
						case 'MTBRUTMOY':
							$tmp1 = 'base.cti_division('.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_brut').','.sprintf($sumDistinctCaseWhen, 'v_rh_view_1.etp_paye').')';
							break;
						case 'MTBRUTAVANTAGE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_brut + v_rh_view_1.montant_avantage_nature');
							break;
						case 'MTAVANTAGE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_avantage_nature');
							break;
						case 'MTFRAISIMPOS':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_frais_imposables');
							break;
						case 'MTODNETSALARIE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_od_net_salarie');
							break;
						case 'MTODNETPATRONALE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_od_net_patronale');
							break;
						case 'MTCOTSALARIE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_cotisation_salarie');
							break;
						case 'MTCOTPATRONALE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_cotisation_patronale');
							break;
						case 'MTNETIMPOSABLE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_net_imposable_salarie');
							break;
						case 'MTNETAPAYER':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.montant_net_a_payer_salarie');
							break;
						case 'BASE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.base');
							break;
						case 'NOMBRE':
							$tmp1 = sprintf($sumDistinctCaseWhen, 'v_rh_view_1.nombre');
							break;
						default :
							$tmp1 = 'null';
					}
					
					return str_replace(array('@date_debut@', '@date_fin@'), array($periodeDebut, $periodeFin), $tmp1) . ',' . str_replace(array('@date_debut@', '@date_fin@'), array($periodePrecDebut, $periodePrecFin), $tmp1);
				}
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATASQL">
			<value><![CDATA[[EVAL 
				// <?php
				
				return RH000017_calcSQL('[DATA1]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA2]') . ',0,0,'
                    . RH000017_calcSQL('[DATA3]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA4]') . ',0,0,'
                    . RH000017_calcSQL('[DATA5]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA6]') . ',0,0,'
                    . RH000017_calcSQL('[DATA7]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA8]') . ',0,0,'
                    . RH000017_calcSQL('[DATA9]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA10]') . ',0,0,'
                    . RH000017_calcSQL('[DATA011]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA012]') . ',0,0,'
                    . RH000017_calcSQL('[DATA013]') . ',0,0,'. PHP_EOL . RH000017_calcSQL('[DATA014]') . ',0,0,'
                    . RH000017_calcSQL('[DATA015]') . ',0,0';
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="ORDERBY">
			<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[1]";
					}
					
			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="Comparer avec">
			<FIELD name="TYPE_COMPARAISON" label="" UI="combo" default="2" width="130">
				<OPTION label="Année précédente" data="2" />
				<OPTION label="Saisie période" data="S" />
			</FIELD>
			<FIELD name="PERIODE_D" label="" UI="combo" tree="true" width="200" default="2010-01-01" globalListProvider="PERIODE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'" />
			<FIELD name="TOPERIODE_D" label="au" UI="combo" tree="true" width="200" default="2010-01-31" globalListProvider="PERIODE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'" />
		</GROUP>
		<GROUP>
			<FIELD name="PRESENTATION" label="Présentation" UI="combo" default="1" width="300">
				<OPTION label="Automatique" data="1" />
				<OPTION label="Ecart en nombre" data="2" />
				<OPTION label="Ecart en %" data="3" />
				<OPTION label="Ecart en nombre et %" data="4" />
				<OPTION label="Aucun" data="5" />
			</FIELD>
		</GROUP>
		<GROUP label="Données">
			<FIELD name="DATA1" tree="true" label="" UI="combo" default="MTMASSE" width="400" showIfNotDefault="true" printable="false">
				<OPTION label="" data="0"/>				
				<OPTION label="DATA_HISTO_PAIE" data="" globalListProvider="DATA_HISTO_PAIE"/>
			</FIELD>
			<FIELD name="DATA2" tree="true" label="" UI="combo" default="0" default2="0" width="400" showIfNotDefault="true" printable="false" visible="= (SELECT.DATA1 != '0')">
				<OPTION label="" data="0"/>
				<OPTION label="DATA_HISTO_PAIE" data="" globalListProvider="DATA_HISTO_PAIE"/>
			</FIELD>
		</GROUP>
		<GROUP label="Regroupement">
			<FIELD name="GROUPBY" label="" width="250" UI="combo" default="RUP" tree="true" >
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="Paie" data="RUP" treeLevel="1" globalListProvider="PAIE_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_PAIE_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
		</GROUP>		
        <GROUP label="">
			<FIELD name="LGROUPBY" label="" width="250" UI="combo" default="RUP" tree="true" visible="false" >
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="Paie" data="RUP" treeLevel="1" globalListProvider="PAIE_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_PAIE_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>			
            <FIELD name="LGROUPBY_2" label="" width="250" UI="combo" default="RUP" tree="true" visible="false" >
				<OPTION label="Entreprise" data="ENT" treeLevel="1" globalListProvider="ENTREPRISE_GROUPBY"/>
				<OPTION label="Paie" data="RUP" treeLevel="1" globalListProvider="PAIE_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_PAIE_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_PAIE_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_HP_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.ORDERBY],, DESC}
						INDICATORS{
							[VIEW.DATASQL]
						}
					FROM #V_HP_X##V_ALL_X#
					WHERE 
						(v_rh_view_1.date_paie BETWEEN '[PERIODE]' AND '[TOPERIODE]' OR
						v_rh_view_1.date_paie BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]')
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]	
						[VIEW.PAIE_SELECT]
						
					AFTER{
						UPDATE w_table SET 
							indicateurs[3] = indicateurs[1] - indicateurs[2],
							indicateurs[4] = CASE 
											WHEN indicateurs[1] > 0 AND indicateurs[2] > 0 THEN base.cti_division(indicateurs[1] - indicateurs[2], indicateurs[2]) * 100
											ELSE 0 END,
							indicateurs[7] = indicateurs[5] - indicateurs[6],
							indicateurs[8] = CASE 
											WHEN indicateurs[5] > 0 AND indicateurs[6] > 0 THEN base.cti_division(indicateurs[5] - indicateurs[6], indicateurs[6]) * 100
											ELSE 0 END,
							indicateurs[11] = indicateurs[9] - indicateurs[10],
							indicateurs[12] = CASE 
											WHEN indicateurs[9] > 0 AND indicateurs[10] > 0 THEN base.cti_division(indicateurs[9] - indicateurs[10], indicateurs[10]) * 100
											ELSE 0 END,							
                            indicateurs[15] = indicateurs[13] - indicateurs[14],
							indicateurs[16] = CASE 
											WHEN indicateurs[13] > 0 AND indicateurs[14] > 0 THEN base.cti_division(indicateurs[13] - indicateurs[14], indicateurs[14]) * 100
											ELSE 0 END,                         
                            indicateurs[19] = indicateurs[17] - indicateurs[18],
							indicateurs[20] = CASE 
											WHEN indicateurs[17] > 0 AND indicateurs[18] > 0 THEN base.cti_division(indicateurs[17] - indicateurs[18], indicateurs[18]) * 100
											ELSE 0 END,                           
                            indicateurs[23] = indicateurs[21] - indicateurs[22],
							indicateurs[24] = CASE 
											WHEN indicateurs[21] > 0 AND indicateurs[22] > 0 THEN base.cti_division(indicateurs[21] - indicateurs[22], indicateurs[22]) * 100
											ELSE 0 END,                             
                            indicateurs[27] = indicateurs[25] - indicateurs[26],
							indicateurs[28] = CASE 
											WHEN indicateurs[25] > 0 AND indicateurs[26] > 0 THEN base.cti_division(indicateurs[25] - indicateurs[26], indicateurs[26]) * 100
											ELSE 0 END,                             
                            indicateurs[31] = indicateurs[29] - indicateurs[30],
							indicateurs[32] = CASE 
											WHEN indicateurs[29] > 0 AND indicateurs[30] > 0 THEN base.cti_division(indicateurs[29] - indicateurs[30], indicateurs[30]) * 100
											ELSE 0 END,                             
                            indicateurs[35] = indicateurs[33] - indicateurs[34],
							indicateurs[36] = CASE 
											WHEN indicateurs[33] > 0 AND indicateurs[34] > 0 THEN base.cti_division(indicateurs[33] - indicateurs[34], indicateurs[34]) * 100
											ELSE 0 END,                              
                            indicateurs[39] = indicateurs[37] - indicateurs[38],
							indicateurs[40] = CASE 
											WHEN indicateurs[37] > 0 AND indicateurs[38] > 0 THEN base.cti_division(indicateurs[37] - indicateurs[38], indicateurs[38]) * 100
											ELSE 0 END,                            
                            indicateurs[43] = indicateurs[41] - indicateurs[42],
							indicateurs[44] = CASE 
											WHEN indicateurs[41] > 0 AND indicateurs[42] > 0 THEN base.cti_division(indicateurs[41] - indicateurs[42], indicateurs[42]) * 100
											ELSE 0 END,                             
                            indicateurs[47] = indicateurs[45] - indicateurs[46],
							indicateurs[48] = CASE 
											WHEN indicateurs[45] > 0 AND indicateurs[46] > 0 THEN base.cti_division(indicateurs[45] - indicateurs[46], indicateurs[46]) * 100
											ELSE 0 END,                             
                            indicateurs[51] = indicateurs[49] - indicateurs[50],
							indicateurs[52] = CASE 
											WHEN indicateurs[49] > 0 AND indicateurs[50] > 0 THEN base.cti_division(indicateurs[49] - indicateurs[50], indicateurs[50]) * 100
											ELSE 0 END,                             
                            indicateurs[55] = indicateurs[53] - indicateurs[54],
							indicateurs[56] = CASE 
											WHEN indicateurs[53] > 0 AND indicateurs[54] > 0 THEN base.cti_division(indicateurs[53] - indicateurs[54], indicateurs[54]) * 100
											ELSE 0 END,                             
                            indicateurs[59] = indicateurs[57] - indicateurs[58],
							indicateurs[60] = CASE 
											WHEN indicateurs[57] > 0 AND indicateurs[58] > 0 THEN base.cti_division(indicateurs[57] - indicateurs[58], indicateurs[58]) * 100
											ELSE 0 END         
                                            
					}
					;
					DROP TABLE IF EXISTS w_table_1;
					CREATE TEMP TABLE w_table_1 AS

					SELECT oidt
							,labelt
							,textet
							,oid1
							,code1
							,oid2
							,code2
							,oid3
							,code3
							,oid
							,code
							,texte
							,LEVEL
							,sort
							,( SELECT SUM(CASE 
											WHEN '[GROUPBY]' = 'MCAL' OR '[GROUPBY]' = 'MACT' 
													THEN (
															SELECT sum(1 - is_weekend::INTEGER)
															FROM base.p_calendrier
															WHERE DATE BETWEEN (substring('[TOPERIODE]' FROM 1 FOR 4) || '-' || code || '-01')::DATE
																AND (substring('[TOPERIODE]' FROM 1 FOR 4) || '-' || code || '-01')::DATE + interval '1 Month - 1 day'
															)
												ELSE 0
												END)
								FROM w_table AS b
								WHERE b.oid <= w_table.oid
									AND b.LEVEL <> 9
								) AS j_o_p

								,(	SELECT SUM(CASE 
											WHEN '[GROUPBY]' = 'MCAL' OR '[GROUPBY]' = 'MACT' 
													THEN (
															SELECT sum(1 - is_weekend::INTEGER)
															FROM base.p_calendrier
															WHERE DATE BETWEEN (substring('[VIEW.PERIODE_D]' FROM 1 FOR 4) || '-' || code || '-01')::DATE
																AND (substring('[VIEW.PERIODE_D]' FROM 1 FOR 4) || '-' || code || '-01')::DATE + interval '1 Month - 1 day'
															)
												ELSE 0
												END)
									FROM w_table AS b
									WHERE b.oid <= w_table.oid
										AND b.LEVEL <> 9
								) AS j_o_p_d
							,(select sum(indicateurs[1]) from w_table as b where b.oid <= w_table.oid and b.level <> 9) as  cumul_1
							,(select sum(indicateurs[2]) from w_table as b where b.oid <= w_table.oid and b.level <> 9) as cumul_12						
							,(select sum(indicateurs[5]) from w_table as b where b.oid <= w_table.oid and b.level <> 9) as cumul_2
							,(select sum(indicateurs[6]) from w_table as b where b.oid <= w_table.oid and b.level <> 9) as cumul_21
							,indicateurs [1]  as indi_1
							,indicateurs [2]  as indi_2
							,indicateurs [3]  as indi_3
							,indicateurs [4]  as indi_4
							,indicateurs [5]  as indi_5
							,indicateurs [6]  as indi_6
							,indicateurs [7]  as indi_7
							,indicateurs [8]  as indi_8
							,indicateurs [9]  as indi_9
							,indicateurs [10] as indi_10
							,indicateurs [11] as indi_11
							,indicateurs [12] as indi_12
							,indicateurs [13] as indi_13
							,indicateurs_text [1]
						FROM w_table
						WHERE  indicateurs [1]  <> 0
							OR indicateurs [2]  <> 0
							OR indicateurs [3]  <> 0
							OR indicateurs [4]  <> 0
							OR indicateurs [5]  <> 0
							OR indicateurs [6]  <> 0
							OR indicateurs [7]  <> 0
							OR indicateurs [8]  <> 0
							OR indicateurs [9]  <> 0
							OR indicateurs [10] <> 0
							OR indicateurs [11] <> 0
							OR indicateurs [12] <> 0
							OR indicateurs [13] <> 0
						ORDER BY sort
							,0::NUMERIC DESC
							,labelt
							,oidt
							,code1
							,oid1
							,code2
							,oid2
							,code3
							,oid3;


						update w_table_1 set j_o_p = (select  max(j_o_p) from w_table_1) where level = 9 ;
						update w_table_1 set j_o_p_d = (select  max(j_o_p_d) from w_table_1) where level = 9 ;
						update w_table_1 set cumul_1 = (select  max(cumul_1) from w_table_1) where level = 9 ;
						update w_table_1 set cumul_12 = (select  max(cumul_12) from w_table_1) where level = 9 ;
						update w_table_1 set cumul_2 = (select  max(cumul_2) from w_table_1) where level = 9 ;
						update w_table_1 set cumul_21 = (select  max(cumul_21) from w_table_1) where level = 9 ;
						select * from w_table_1

				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="SORT" />
					<FIELD name="F111"/>
					<FIELD name="F112"/>
					<FIELD name="F11"/>
					<FIELD name="D11"/>
					<FIELD name="F22"/>
					<FIELD name="D22"/>
					<FIELD name="F1"/>
					<FIELD name="D1"/>
					<FIELD name="E1"/>
					<FIELD name="P1"/>
					<FIELD name="F2"/>
					<FIELD name="D2"/>
					<FIELD name="E2"/>
					<FIELD name="P2"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false"> 
		
			<SQL>
				<select><![CDATA[	
					SELECT 'PERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[PERIODE_D]' END::text
					UNION
					SELECT 'TOPERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[TOPERIODE_D]' END::text
					UNION
					SELECT 'PERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[PERIODE_D]' END = p_calendrier_mois.date_debut THEN p_calendrier_mois.texte ELSE p_calendrier.texte END
					FROM base.p_calendrier
						JOIN base.p_calendrier_mois ON p_calendrier.mois = p_calendrier_mois.mois
					WHERE date = CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[PERIODE_D]' END
					UNION
					SELECT 'TOPERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[TOPERIODE_D]' END = p_calendrier_mois.date_fin THEN p_calendrier_mois.texte ELSE p_calendrier.texte_court END
					FROM base.p_calendrier
						JOIN base.p_calendrier_mois ON p_calendrier.mois = p_calendrier_mois.mois
					WHERE date = CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date + interval '1 day' - interval '1 year' - interval '1 day') ELSE '[TOPERIODE_D]' END
					UNION
						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="(&#8721;) Dernier Mois/Année " shortLabel="Mois/Année"   rowContext="false" buttonType="VIEWLINKPOPUP_RH">
				<VIEWITEM  label="Dernière année"  shortLabel="derniere  année"  view="RH000017.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="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
                    <ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />                    
					<ARG name="GROUPBY" value="return 'MCAL';"/>
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />                    
                </VIEWITEM>	
				<VIEWITEM label="&#8721; dernière Année" shortLabel="&#8721; derniere année"  view="RH000115.XML" rowContext="false" enabled="true" 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="PERIODE_D" value="return VIEW.X_PERIODE_D;" />
                    <ARG name="TOPERIODE_D" value="return VIEW.X_TOPERIODE_D;" />                    
					<ARG name="GROUPBY" value="return 'MCAL';"/>
					<ARG name="DATA1" value="return 'MTMASSE';"/>
					<ARG name="DATA2" value="return 'MTBRUT';"/>                    
                </VIEWITEM>	
			</VIEWLINK>
			<VIEWLINK label="Comparatif" shortLabel="Comparatif" view="RH000017.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="GROUPBY" value="SELECT.LGROUPBY" />
				<ARG name="GROUPBY_2" value="return SELECT.LGROUPBY_2;" />
				<ARG name="DATA1" value="SELECT.DATA1" />
				<ARG name="DATA2" value="SELECT.DATA2" />
				<ARG name="DATA3" value="SELECT.DATA3" />
			</VIEWLINK>			
            <VIEWLINK label="Comparatif mensuel" shortLabel="Comp. Mensuel" view="RH000112.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="ALIAS_PERIODE" value="return '-1';"/>				
				<ARG name="DATA1" value="SELECT.DATA1" />
				<ARG name="DATA2" value="SELECT.DATA2" />
				<ARG name="DATA3" value="SELECT.DATA3" />
				<ARG name="GROUPBY" value="SELECT.LGROUPBY" />
				<ARG name="GROUPBY_2" value="return SELECT.LGROUPBY_2;" />
                <ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
            <VIEWLINK label="Effets" shortLabel="Effets" view="RH000111.XML" enabled="true" rowContext="false" buttonType="COMPARATIF">
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="GROUPBY" value="SELECT.LGROUPBY" />
				<ARG name="GROUPBY_2" value="return SELECT.LGROUPBY_2;" />                
				<ARG name="DATA01" value="'NBETP'" />
				<ARG name="DATA02" value="'MSAL'" />
                <ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative"  view="RH000114.XML"  rowContext="false"  enabled="true" buttonType="VIEWLINK_EVO_COMP_1" >			
                    <ARG name="GROUPBY" value="SELECT.LGROUPBY" />
					<ARG name="GROUPBY_2" value="return 'MCAL';" />
                    <ARG name="DATA1" value="SELECT.DATA1"/>
                    <ARG name="DATA2" value="SELECT.DATA2"/>
                    <ARG name="DATA3" value="SELECT.DATA3"/>
                    <ARG name="DATA4" value="SELECT.DATA4"/>
                    <ARG name="DATA5" value="SELECT.DATA5"/>
                    <ARG name="DATA6" value="SELECT.DATA6"/>
                    <ARG name="DATA7" value="SELECT.DATA7"/>
                    <ARG name="DATA8" value="SELECT.DATA8"/>
                    <ARG name="DATA9" value="SELECT.DATA9"/>
                    <ARG name="DATA10" value="SELECT.DATA10"/>
                    <ARG name="DATA011" value="SELECT.DATA011"/>
                    <ARG name="DATA012" value="SELECT.DATA012"/>
                    <ARG name="DATA013" value="SELECT.DATA013"/>
                    <ARG name="DATA014" value="SELECT.DATA014"/>
                    <ARG name="DATA015" value="SELECT.DATA015"/>
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>	            
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="RH000015.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" buttonType="EVOLUTION">
			   	<ARG name="ALIAS_PERIODE" value="return '-1'"/>
				<ARG name="GROUPBY" value="return SELECT.LGROUPBY;" />                    
				<ARG name="GROUPBY_2" value="return SELECT.LGROUPBY_2;" />                    
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>				
                <ARG name="DATA" value="'MTMASSE'"/>
				<ARG name="PERIODICITE" value="'MONTH'"/>
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="RH000016.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="'MTMASSE'" />
				<ARG name="COLUMNBY" value="'MCAL'" />
				<ARG name="GROUPBY" value="'ACAL'" />
				<ARG name="GROUPBY_2" value="return SELECT.LGROUPBY;" />
				<ARG name="GROUPBY_3" value="return SELECT.LGROUPBY_2;" />
				<ARG name="GROUPBY_TAB" value="'TAB'" />
				<ARG name="COLUMNBYCOUNT" value="'12'" />
			</VIEWLINK>
			<VIEWLINK label="Analyse"  shortLabel="Analyse"  rowContext="false" buttonType="ANALYSE_VIEWLINK_RH">
				<VIEWITEM label="Analyse" shortLabel="Analyse"  view="RH000007.XML" rowContext="false" enabled="true" buttonType="ANALYSE_VIEWLINK_RH" componentName="">
                    <ARGS name="SPEC" >
                        <value><![CDATA[
                            LINKVARIABLES['ALIAS_PERIODE'] = '-1';
                            LINKVARIABLES['PERIODE'] = SELECT.PERIODE;
                            LINKVARIABLES['TOPERIODE'] = SELECT.TOPERIODE;
                            LINKVARIABLES['GROUPBY'] = SELECT.LGROUPBY;
                            LINKVARIABLES['GROUPBY_2'] = SELECT.LGROUPBY_2;
                            LINKVARIABLES['GROUPBY_TAB'] = 'TAB';
                            return 'OK';
                        ]]></value>
                    </ARGS>                    
                </VIEWITEM>					
				<VIEWITEM label="Analyse paramètrable" shortLabel="Analyse"  view="RH000113.XML" rowContext="false" enabled="true" buttonType="ANALYSE_VIEWLINK_RH" componentName="" component2Name="" >
                    <ARGS name="SPEC" >
                        <value><![CDATA[
                            LINKVARIABLES['ALIAS_PERIODE'] = '-1';
                            LINKVARIABLES['PERIODE'] = SELECT.PERIODE;
                            LINKVARIABLES['TOPERIODE'] = SELECT.TOPERIODE;
                            LINKVARIABLES['GROUPBY'] = SELECT.LGROUPBY;
                            LINKVARIABLES['GROUPBY_2'] = SELECT.LGROUPBY_2;
                            LINKVARIABLES['GROUPBY_3'] = SELECT.LGROUPBY_3;
                            LINKVARIABLES['GROUPBY_TAB'] = 'TAB';
                            LINKVARIABLES['DATA1'] = SELECT.DATA1;
                            LINKVARIABLES['DATA2'] = SELECT.DATA2;
                            LINKVARIABLES['DATA3'] = SELECT.DATA3;
                            LINKVARIABLES['DATA4'] = SELECT.DATA4;
                            LINKVARIABLES['DATA5'] = SELECT.DATA5;
                            LINKVARIABLES['DATA6'] = SELECT.DATA6;
                            LINKVARIABLES['DATA7'] = SELECT.DATA7;
                            LINKVARIABLES['DATA8'] = SELECT.DATA8;
                            LINKVARIABLES['DATA9'] = SELECT.DATA9;
                            LINKVARIABLES['DATA10'] = SELECT.DATA10;
                            LINKVARIABLES['DATA011'] = SELECT.DATA011;
                            LINKVARIABLES['DATA012'] = SELECT.DATA012;
                            LINKVARIABLES['DATA013'] = SELECT.DATA013;
                            LINKVARIABLES['DATA014'] = SELECT.DATA014;
                            LINKVARIABLES['DATA015'] = SELECT.DATA015;
                            return 'OK';
                        ]]></value>
                    </ARGS>
                </VIEWITEM>	
			</VIEWLINK>
			<VIEWLINK label="Justificatif paie" shortLabel="Justificatif paie" view="RH000011.XML" componentName="RH_VIEWLINK" >
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY_2'] = 'SAL'
						return 'OK';
					]]></value>
				</ARGS>
				<ARG name="PERIODE" value="	if (COLUMN.NAME == 'F1') {return SELECT.PERIODE}
											if (COLUMN.NAME == 'D1') {return SELECT.PERIODE_D}
											if (COLUMN.NAME == 'F2') {return SELECT.PERIODE}
											if (COLUMN.NAME == 'D2') {return SELECT.PERIODE_D}
											if (COLUMN.NAME == 'F3') {return SELECT.PERIODE}
											if (COLUMN.NAME == 'D3') {return SELECT.PERIODE_D}
											if (COLUMN.NAME == 'E1') {return SELECT.TOPERIODE}
											if (COLUMN.NAME == 'E2') {return SELECT.TOPERIODE}
											if (COLUMN.NAME == 'E3') {return SELECT.TOPERIODE}
											if (COLUMN.NAME == 'P1') {return SELECT.TOPERIODE}
											if (COLUMN.NAME == 'P2') {return SELECT.TOPERIODE}
											if (COLUMN.NAME == 'P3') {return SELECT.TOPERIODE}
											"/>
				<ARG name="TOPERIODE" value="if (COLUMN.NAME == 'F1') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'D1') {return SELECT.TOPERIODE_D}
											 if (COLUMN.NAME == 'F2') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'D2') {return SELECT.TOPERIODE_D}
											 if (COLUMN.NAME == 'F3') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'D3') {return SELECT.TOPERIODE_D}
											 if (COLUMN.NAME == 'E1') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'E2') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'E3') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'P1') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'P2') {return SELECT.TOPERIODE}
											 if (COLUMN.NAME == 'P3') {return SELECT.TOPERIODE}
											 "/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition mensuelle" label="Répartition mensuelle" multiTab="true"> 			
			<CHART title="Evolution annuelle" type="lineChart" maxItems="30" maxItemsSortOn="D1" maxItemsSortSeq="D" sortField="" sortSeq="D1" visibleCondition="(SELECT.GROUPBY == 'MCAL') || (SELECT.GROUPBY == 'MACT')" condition="ROW.LVL == '1'">
				<CATEGORY field="TXT" type="Char"/>
				<SERIE field="D11" displayName="SELECT.DATA13 + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true" />
				<SERIE field="F11" displayName="SELECT.DATA13 + ' ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true" />
			</CHART>
			<CHART title="" type="columnChart" maxItems="20" maxItemsSortOn="F1" maxItemsSortSeq="D" sortField="COD"  sortSeq="A">
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="D1" displayName="SELECT.DATA1_LABEL + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="F1" displayName="SELECT.DATA1_LABEL + ' ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true"/>
			</CHART>
 			<CHART title="" type="columnChart" maxItems="20" maxItemsSortOn="F2" maxItemsSortSeq="D" sortField="COD" sortSeq="A" visibleCondition="SELECT.DATA2 != '0'">
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="D2" displayName="SELECT.DATA2_LABEL + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="F2" displayName="SELECT.DATA2_LABEL + ' ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true"/>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="70" variableRowHeight="true" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid">
				</COLUMN>
				<COLUMN dataField="COD" width="80" type="Char" visibleCondition="SELECT.GROUPBY != '5'" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="150" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="*ROW">
				</COLUMN>
				
				<COLUMN dataField="F112" width="35" visible="true" type="Number" outputFormat="#"   headerText="'Jour'+'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;' "  headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum"  visibleCondition="(SELECT.GROUPBY != 'SEMAINEANNE') &amp;&amp; (SELECT.GROUPBY != 'NUMEROTRIM')" description= "Jours ouvrés. +1 si jour ouvré , +0  si jour weekend. Période N-1">
				</COLUMN>
				<COLUMN dataField="F111" width="35" visible="true" type="Number" outputFormat="#"   headerText=" 'Jour'+'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;' " headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum" visibleCondition="(SELECT.GROUPBY != 'SEMAINEANNE') &amp;&amp; (SELECT.GROUPBY != 'NUMEROTRIM')"  description= "Jours ouvrés. +1 si jour ouvré , +0  si jour weekend. Période N">
				</COLUMN>
				
				<COLUMN dataField="D1" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="SELECT.DATA13 + String.fromCharCode(13)  +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="F1" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="E1" type="Number" headerText="Ecart" width="85" visible="true" outputFormat="= SELECT.DATA12" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="if(SELECT.DATA1.substr(0,3)== 'DEL'){ROW.D1 &lt; ROW.F1} else {ROW.F1 &lt; ROW.D1}" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="if(SELECT.DATA1.substr(0,3)== 'DEL'){ROW.F1 &lt; ROW.D1} else {ROW.D1 &lt; ROW.F1}" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D1== ROW.F1" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="P1" type="Number" headerText="%  " width="45" visible="true" outputFormat="= if (ROW.D1 != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D11" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false"  headerText=" SELECT.DATA13 + String.fromCharCode(13) + 'cumul \n'+'&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;' " headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="F11" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false"  headerText=" SELECT.DATA13 + String.fromCharCode(13) +'cumul \n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;' " headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="E11" type="Number" headerText="Ecart" width="70" visible="true" outputFormat="= SELECT.DATA12" fixed="false" textAlign="center" totalFunction="" totalComplement="" otherFunction="" calc="true">
					<CALC formula="ROW.F11 - ROW.D11"/>
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="if(SELECT.DATA1.substr(0,3)== 'DEL'){ROW.D11 &lt; ROW.F11} else {ROW.F11 &lt; ROW.D11}" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="if(SELECT.DATA1.substr(0,3)== 'DEL'){ROW.F11 &lt; ROW.D11} else {ROW.D11 &lt; ROW.F11}" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D11== ROW.F11" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="P11" type="Number" headerText="% évol." width="45" visible="true" outputFormat="= if (ROW.D1 != 0 &amp;&amp; ROW.F1 != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="" totalComplement="" otherFunction="" calc="true">
				<CALC formula="(ROW.E11 / ROW.D11)*100"/>
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D2" width="85" visibleCondition="SELECT.DATA2 != '0'" type="Number" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="F2" width="85" visibleCondition="SELECT.DATA2 != '0'" type="Number" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'" headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="E2" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= SELECT.DATA22" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="if(SELECT.DATA2.substr(0,3)== 'DEL'){ROW.D2 &lt; ROW.F2} else {ROW.F2 &lt; ROW.D2}" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="if(SELECT.DATA2.substr(0,3)== 'DEL'){ROW.F2 &lt; ROW.D2} else {ROW.D2 &lt; ROW.F2}" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D2== ROW.F2" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="P2" type="Number" headerText="%  " width="45" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= if (ROW.D2 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="sum" totalComplement="" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D22" width="85" visibleCondition="SELECT.DATA2 != '-1'" type="Number" outputFormat="= SELECT.DATA22" fixed="false"  headerText=" SELECT.DATA23 + String.fromCharCode(13) + 'cumul  \n'+'&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;' " headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="F22" width="85" visibleCondition="SELECT.DATA2 != '-1'" type="Number" outputFormat="= SELECT.DATA22" fixed="false"  headerText=" SELECT.DATA23 + String.fromCharCode(13)  + 'cumul  \n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;' " headerTextCalc="true" textAlign="center" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="E22" type="Number" headerText="Ecart" width="70" visibleCondition="SELECT.DATA2 != '-1'" outputFormat="= SELECT.DATA22" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum" calc="true">
					<CALC formula="ROW.F22 - ROW.D22"/>
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="if(SELECT.DATA2.substr(0,3)== 'DEL'){ROW.D2 &lt; ROW.F2} else {ROW.F2 &lt; ROW.D2}" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="if(SELECT.DATA2.substr(0,3)== 'DEL'){ROW.F2 &lt; ROW.D2} else {ROW.D2 &lt; ROW.F2}" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D2== ROW.F2" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="P22" type="Number" headerText="% évol." width="45" visibleCondition="SELECT.DATA2 != '-1'" outputFormat="= if (ROW.D2 !=0  &amp;&amp;  ROW.F2 != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="center" totalFunction="" totalComplement="" otherFunction="" calc="true">
					<CALC formula="(ROW.E22 / ROW.D22)*100"/>
					<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>