<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000141" label="ACTI. Effets Prix - Volume" 
	 title="= 'Effets Prix - Volume par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.QUELLEDATE_LABEL + ' : ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ' vs ' + VIEW.PERIODE_D_LABEL + ' à ' + VIEW.TOPERIODE_D_LABEL + ')' + ' sur le CA facturé + valorisé et les ' + SELECT.DATA01_LABEL " 
	 database="iCTI" 
	 swf="*CTI_view1" 
	 softCode="iCTI_activite" 
	 typeEts="" 
	 globals="ACTI_globals.XML" 
	 componentsFile="ACTI_components.XML" 
	 helpDokuWIkiDir="activite:activite_facturee_et_valorisee:activite_clinique"  
	 helpDokuWIkiFile="acti000141"  
	 helpFile="iCTI_ACTI_ACTI000141.HTML">

	<VIEWPROPERTIES componentName="PROPERTIES_ETATDOSSIERS"/>
	<VIEWPROPERTIES componentName="PROPERTIES_PRESTATIONS"/>
	<VIEWPROPERTIES>
        <PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
		<PROPERTY name="DATAFUNC">
			<value><![CDATA[[EVAL 
				// <?php
				
				function ACTI000141_calcSQL($data) {
					
					$ctiDivision = "base.cti_division(%s, %s)";
					$countDistinct = "count(DISTINCT CASE WHEN v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN @date_debut@ AND @date_fin@ THEN %s ELSE null END)";
					$countDistinctCaseWhen = "count(DISTINCT CASE WHEN v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN @date_debut@ AND @date_fin@ AND type_sejour IN (%s) THEN %s ELSE null END)";
					$periodeDebut = '\'[PERIODE]\'::date';
					$periodeFin = '\'[TOPERIODE]\'::date';
					$periodePrecDebut = '\'[VIEW.PERIODE_D]\'::date';
					$periodePrecFin = '\'[VIEW.TOPERIODE_D]\'::date';
					
					switch ($data) {
						case '1.1':	// Nombre de séjours
							$tmp = sprintf($countDistinct, 'v_sejours_1.no_sejour');
							break;
						case '1.2':	// Nombre de séjours HC
							$tmp0 = '1';
                            $tmp = sprintf($countDistinctCaseWhen, $tmp0, 'v_sejours_1.no_sejour');
							break;
						case '1.3':	// Nombre de séjours HJ
							$tmp0 = '2,5';
                            $tmp = sprintf($countDistinctCaseWhen, $tmp0, 'v_sejours_1.no_sejour');
							break;
                        case '1.4':	// Nombre de séjours Autres
							$tmp0 = '3';
                            $tmp = sprintf($countDistinctCaseWhen, $tmp0, 'v_sejours_1.no_sejour');
							break;
						default :	// Nombre de séjours par défaut
							$tmp = sprintf($countDistinct, 'v_sejours_1.no_sejour');
					}
					
					$toReplace = array(
						'@date_debut@',
						'@date_fin@'
					);
					
					$curPeriod = array(
						$periodeDebut,
						$periodeFin
					);
					
					$prevPeriod = array(
						$periodePrecDebut,
						$periodePrecFin
					);
					
					return str_replace($toReplace, $curPeriod, $tmp) . ', ' . str_replace($toReplace, $prevPeriod, $tmp);
				}
                
                function ACTI000141_CA_calcSQL($data,$data2) {
					
					
					$ctiDivision = "base.cti_division(%s, %s)";
					$sum = "sum( CASE WHEN v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN @date_debut@ AND @date_fin@ THEN %s[VIEW.CLIHON] ELSE 0 END ) + sum( CASE WHEN v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN @date_debut@ AND @date_fin@ THEN %s[VIEW.CLIHON] ELSE 0 END )";
					$sum2 = "sum( CASE WHEN v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN @date_debut@ AND @date_fin@ AND type_sejour IN (%s) THEN %s[VIEW.CLIHON] ELSE NULL END ) + sum( CASE WHEN v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN @date_debut@ AND @date_fin@ AND type_sejour IN (%s) THEN %s[VIEW.CLIHON] ELSE NULL END )";
					$periodeDebut = '\'[PERIODE]\'::date';
					$periodeFin = '\'[TOPERIODE]\'::date';
					$periodePrecDebut = '\'[VIEW.PERIODE_D]\'::date';
					$periodePrecFin = '\'[VIEW.TOPERIODE_D]\'::date';
					
					switch ($data) {
						case '1.1':
                            
                                    $tmp = sprintf($sum, 'montant_facture', 'montant_encours');
                                    break;
                                    
                        case '1.2':
                            
                                   $tmp0 = '1';
                                   $tmp = sprintf($sum2, $tmp0, 'montant_facture', $tmp0, 'montant_encours');
                                    break;
                                
                        case '1.3':
                            
                                    $tmp0 = '2,5';
                                    $tmp = sprintf($sum2, $tmp0, 'montant_facture', $tmp0, 'montant_encours');
                                    break;
                                
                        case '1.4':
                            
                                    $tmp0 = '3';
                                    $tmp = sprintf($sum2, $tmp0, 'montant_facture', $tmp0,'montant_encours');
                                    break;
                                
						default :	// CA facturé + valorisé
							$tmp = sprintf($sum, 'montant_facture', 'montant_encours');
					}
					
					$toReplace = array(
						'@date_debut@',
						'@date_fin@'
					);
					
					$curPeriod = array(
						$periodeDebut,
						$periodeFin
					);
					
					$prevPeriod = array(
						$periodePrecDebut,
						$periodePrecFin
					);
					
					return str_replace($toReplace, $curPeriod, $tmp) . ', ' . str_replace($toReplace, $prevPeriod, $tmp);
				}
				
				// ?>
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATASQL">
			<value><![CDATA[[EVAL 
				// <?php
				
				return 
					ACTI000141_calcSQL('[DATA01]') . ', 0, 0, ' . PHP_EOL . 
					ACTI000141_CA_calcSQL('[DATA01]','[DATA02]'). ', 0, 0'; 
				// ?>
			EVAL]]]></value>
		</PROPERTY>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
            <FIELD name="QUELLEDATE" label="" UI="combo" default="1" default2="date_fin">
				<OPTION label="Date activité" data="1" data2="v_factures_lignes_c_4.date_fin"/>
				<OPTION label="Date sortie" data="2" data2="v_factures_lignes_c_4.date_fin_facture"/>
				<OPTION label="Date facture" data="3" data2="v_factures_lignes_c_4.date_facture"/>
				<OPTION label="Date vente" data="4" data2="v_factures_lignes_c_4.date_vente"/>
				<OPTION label="Date groupage" data="5" data2="v_sejours_1.date_groupage"/>
			</FIELD>
            <FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="Période" UI="combo" tree="true" width="150" default="2014-07-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2014-12-31" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
		<GROUP label="Période précédente">
			<FIELD name="TYPE_COMPARAISON" label="" UI="combo" default="2" width="150">
				<OPTION label="Année précédente" data="2" />
				<OPTION label="Saisie période" data="S" />
			</FIELD>
            <FIELD name="PERIODE_D" label="Période précédente" UI="combo" tree="true" width="150" default="2015-01-01" printable="false" globalListProvider="DATE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'"/>
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2015-12-30" printable="false" globalListProvider="DATE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'"/>
		</GROUP>
		<GROUP>
			<FIELD name="DATA01" label="Données" UI="combo" tree="true" width="200" default="1.1" default2="1.1" default3="Séjours" default4="P" printable="false">
                <OPTION label="Séjours" data="1.1" data2="#" data3="Nombre de séjours. Pour les séjours de la CMD 28, nombre de séances" data4="P" treeLevel="1"/>
                <OPTION label="Séjours HC" data="1.2" data2="#" data3="Nombre de séjours en hospitalisation complète" data4="P" treeLevel="1"/>
                <OPTION label="Séjours HJ" data="1.3" data2="#" data3="Nombre de séjours en hospitalisation de jour" data4="P" treeLevel="1"/>
                <OPTION label="Séjours Autres" data="1.4" data2="#" data3="Nombre de séjours externes" data4="P" treeLevel="1"/>
			</FIELD>
            <FIELD name="DATA02" label="Données" UI="combo" tree="true" width="200" default="1" default2="1" default3="Ca fac + val" default4="P" printable="false" visible="false">
                <OPTION label="CA facturé + valorisé" data="1" data2="#E" data3="CA facturé + CA valorisé non facturé." data4="P" treeLevel="1" />			
			</FIELD>
		</GROUP>
        
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="220" label="Regroupements" UI="combo" default="SER" tree="true">
				<OPTION label="Options" data="" globalListProvider="PRESTATIONS_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" width="220" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" treeLevel="1" />
				<OPTION label="Options" data="" globalListProvider="PRESTATIONS_GROUPBY" />
			</FIELD>
            <FIELD name="GROUPBY_3" label="" UI="combo" default="-1" width="220" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="Options" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>
		</GROUP>
        <GROUP>
			<FIELD name="RUBRIQUE_CA" label="C.A." UI="combo" tree="true" width="200" default="-1"  globalListProvider="RUBRIQUES_CA" showIfNotDefault="true" />
			<FIELD name="RUBRIQUE_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.RUBRIQUE == 'SAISIECODE' " />
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_PRESTATIONS_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PRESTATIONS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PATIENTS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PASSAGES_SELECTIONS" />
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="#V_SEJOURS_X#" cacheEnabled="true">
				<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.DATA01],, DESC}
						INDICATORS{
							[VIEW.DATASQL]
						}
					FROM #V_FACTURES_LIGNES_C_X#
                        JOIN #V_SEJOURS_X# ON v_sejours_1.no_sejour = v_factures_lignes_c_4.no_sejour
					WHERE (v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[PERIODE]' AND '[TOPERIODE]' OR
						v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]')
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
						[VIEW.PASSAGES_SELECT]
						[VIEW.PATIENTS_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
					}
					
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					<FIELD name="SORT" />
					
					<!-- Première donnée -->
					<FIELD name="F1" />
					<FIELD name="D1" />
					<FIELD name="D1_ECA" />
					<FIELD name="D1_PCT" />
					
					<!-- Deuxième donnée -->
					<FIELD name="F2" />
					<FIELD name="D2" />
					<FIELD name="D2_ECA" />
					<FIELD name="D2_PCT" />
					
				</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 year') ELSE '[PERIODE_D]' END::text
					UNION
					SELECT 'TOPERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date - interval '1 year') ELSE '[TOPERIODE_D]' END::text
					UNION
					SELECT 'PERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date - interval '1 year') ELSE '[PERIODE_D]' END = p_calendrier_mois.date_debut 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('[PERIODE]'::date - interval '1 year') ELSE '[PERIODE_D]' END
					UNION
					SELECT 'TOPERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date - interval '1 year') 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 year') ELSE '[TOPERIODE_D]' END
				]]></select>
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>
        </QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[
						SELECT 'X_PERIODE', greatest(to_date(to_char('[PERIODE]'::date - INTERVAL  '3 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(date_debut) FROM activite.p_factures ))::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">
				<VIEWITEM label="Dernier mois" shortLabel="Dernier mois"  view="ACTI000063.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" componentName="PRESTATIONS_BASE_VIEWLINK">
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,8)+'01';"/>
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;"/>
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'JOURS'; 		break;
								case 'TRIM' :			s = 'JOURS';		break;
								case 'MOIS' :			s = 'JOURS';		break;
								case 'NUMEROMOIS' :		s = 'JOURS';		break;
								case 'NUMEROTRIM' :		s = 'JOURS';		break;
								case 'SEMAINEWE' :		s = 'JOURS';		break;
								case 'SEMAINEANNE' :	s = 'JOURS';		break;
								case 'NUMEROJOUR' :		s = 'JOURS';		break;
								case 'JOURS' :			s = 'JOURS';		break;
								case 'JOUR' :			s = 'JOURS';		break;
								
								case 'ANNEEF' :			s = 'JOURSF'; 		break;
								case 'TRIMF' :			s = 'JOURSF';		break;
								case 'MOISF' :			s = 'JOURSF';		break;
								case 'NUMEROMOISF' :	s = 'JOURSF';		break;
								case 'NUMEROTRIMF' :	s = 'JOURSF';		break;
								case 'SEMAINEWEF' :		s = 'JOURSF';		break;
								case 'SEMAINEANNEF' :	s = 'JOURSF';		break;
								case 'NUMEROJOURF' :	s = 'JOURSF';		break;
								case 'JOURSF' :			s = 'JOURSF';		break;
								case 'JOURF' :			s = 'JOURSF';		break;
								
								case 'ANNEEA' :			s = 'JOURSA'; 		break;
								case 'TRIMA' :			s = 'JOURSA';		break;
								case 'MOISA' :			s = 'JOURSA';		break;
								case 'NUMEROMOISA' :	s = 'JOURSA';		break;
								case 'NUMEROTRIMA' :	s = 'JOURSA';		break;
								case 'SEMAINEWEA' :		s = 'JOURSA';		break;
								case 'SEMAINEANNEA' :	s = 'JOURSA';		break;
								case 'NUMEROJOURA' :	s = 'JOURSA';		break;
								case 'JOURSA' :			s = 'JOURSA';		break;
								case 'JOURA' :			s = 'JOURSA';		break;
								
								case 'ANNEEV' :			s = 'JOURSV'; 		break;
								case 'TRIMV' :			s = 'JOURSV';		break;
								case 'MOISV' :			s = 'JOURSV';		break;
								case 'NUMEROMOISV' :	s = 'JOURSV';		break;
								case 'NUMEROTRIMV' :	s = 'JOURSV';		break;
								case 'SEMAINEWEV' :		s = 'JOURSV';		break;
								case 'SEMAINEANNEV' :	s = 'JOURSV';		break;
								case 'NUMEROJOURV' :	s = 'JOURSV';		break;
								case 'JOURSV' :			s = 'JOURSV';		break;
								case 'JOURV' :			s = 'JOURSV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'JOURSA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'JOURS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'JOURSF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'JOURSV';			break;}
										if(SELECT.QUELLEDATE == 5) {s = 'JOURS';			break;}
								
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<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="DATA1" value="'FAVNBS'" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="DATA3" value="'MTENC'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
				<VIEWITEM label="&#8721; dernier mois" data="2" shortLabel="&#8721; dernier  mois"  view="ACTI000149.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,8)+'01';"/>
					<ARG name="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'JOURS'; 		break;
								case 'TRIM' :			s = 'JOURS';		break;
								case 'MOIS' :			s = 'JOURS';		break;
								case 'NUMEROMOIS' :		s = 'JOURS';		break;
								case 'NUMEROTRIM' :		s = 'JOURS';		break;
								case 'SEMAINEWE' :		s = 'JOURS';		break;
								case 'SEMAINEANNE' :	s = 'JOURS';		break;
								case 'NUMEROJOUR' :		s = 'JOURS';		break;
								case 'JOURS' :			s = 'JOURS';		break;
								case 'JOUR' :			s = 'JOURS';		break;
								
								case 'ANNEEF' :			s = 'JOURSF'; 		break;
								case 'TRIMF' :			s = 'JOURSF';		break;
								case 'MOISF' :			s = 'JOURSF';		break;
								case 'NUMEROMOISF' :	s = 'JOURSF';		break;
								case 'NUMEROTRIMF' :	s = 'JOURSF';		break;
								case 'SEMAINEWEF' :		s = 'JOURSF';		break;
								case 'SEMAINEANNEF' :	s = 'JOURSF';		break;
								case 'NUMEROJOURF' :	s = 'JOURSF';		break;
								case 'JOURSF' :			s = 'JOURSF';		break;
								case 'JOURF' :			s = 'JOURSF';		break;
								
								case 'ANNEEA' :			s = 'JOURSA'; 		break;
								case 'TRIMA' :			s = 'JOURSA';		break;
								case 'MOISA' :			s = 'JOURSA';		break;
								case 'NUMEROMOISA' :	s = 'JOURSA';		break;
								case 'NUMEROTRIMA' :	s = 'JOURSA';		break;
								case 'SEMAINEWEA' :		s = 'JOURSA';		break;
								case 'SEMAINEANNEA' :	s = 'JOURSA';		break;
								case 'NUMEROJOURA' :	s = 'JOURSA';		break;
								case 'JOURSA' :			s = 'JOURSA';		break;
								case 'JOURA' :			s = 'JOURSA';		break;
								
								case 'ANNEEV' :			s = 'JOURSV'; 		break;
								case 'TRIMV' :			s = 'JOURSV';		break;
								case 'MOISV' :			s = 'JOURSV';		break;
								case 'NUMEROMOISV' :	s = 'JOURSV';		break;
								case 'NUMEROTRIMV' :	s = 'JOURSV';		break;
								case 'SEMAINEWEV' :		s = 'JOURSV';		break;
								case 'SEMAINEANNEV' :	s = 'JOURSV';		break;
								case 'NUMEROJOURV' :	s = 'JOURSV';		break;
								case 'JOURSV' :			s = 'JOURSV';		break;
								case 'JOURV' :			s = 'JOURSV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'JOURSA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'JOURS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'JOURSF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'JOURSV';			break;}
										if(SELECT.QUELLEDATE == 5) {s = 'JOURS';			break;}
								
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<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="QUELLEDATE" value="return SELECT.QUELLEDATE"/>
					<ARG name="TYPE_COMPARAISON" value="return '2';" />
				</VIEWITEM>
				<VIEWITEM  label="Dernière année" data="2" shortLabel="derniere  année"  view="ACTI000063.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="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'NUMEROMOIS'; 		break;
								case 'TRIM' :			s = 'NUMEROMOIS';		break;
								case 'MOIS' :			s = 'NUMEROMOIS';		break;
								case 'NUMEROMOIS' :		s = 'NUMEROMOIS';		break;
								case 'NUMEROTRIM' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEWE' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEANNE' :	s = 'NUMEROMOIS';		break;
								case 'NUMEROJOUR' :		s = 'NUMEROMOIS';		break;
								case 'JOURS' :			s = 'NUMEROMOIS';		break;
								case 'JOUR' :			s = 'NUMEROMOIS';		break;
								
								case 'ANNEEF' :			s = 'NUMEROMOISF'; 		break;
								case 'TRIMF' :			s = 'NUMEROMOISF';		break;
								case 'MOISF' :			s = 'NUMEROMOISF';		break;
								case 'NUMEROMOISF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROTRIMF' :	s = 'NUMEROMOISF';		break;
								case 'SEMAINEWEF' :		s = 'NUMEROMOISF';		break;
								case 'SEMAINEANNEF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROJOURF' :	s = 'NUMEROMOISF';		break;
								case 'JOURSF' :			s = 'NUMEROMOISF';		break;
								case 'JOURF' :			s = 'NUMEROMOISF';		break;
								
								case 'ANNEEA' :			s = 'NUMEROMOISA'; 		break;
								case 'TRIMA' :			s = 'NUMEROMOISA';		break;
								case 'MOISA' :			s = 'NUMEROMOISA';		break;
								case 'NUMEROMOISA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROTRIMA' :	s = 'NUMEROMOISA';		break;
								case 'SEMAINEWEA' :		s = 'NUMEROMOISA';		break;
								case 'SEMAINEANNEA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROJOURA' :	s = 'NUMEROMOISA';		break;
								case 'JOURSA' :			s = 'NUMEROMOISA';		break;
								case 'JOURA' :			s = 'NUMEROMOISA';		break;
								
								case 'ANNEEV' :			s = 'NUMEROMOISV'; 		break;
								case 'TRIMV' :			s = 'NUMEROMOISV';		break;
								case 'MOISV' :			s = 'NUMEROMOISV';		break;
								case 'NUMEROMOISV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROTRIMV' :	s = 'NUMEROMOISV';		break;
								case 'SEMAINEWEV' :		s = 'NUMEROMOISV';		break;
								case 'SEMAINEANNEV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROJOURV' :	s = 'NUMEROMOISV';		break;
								case 'JOURSV' :			s = 'NUMEROMOISV';		break;
								case 'JOURV' :			s = 'NUMEROMOISV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'NUMEROMOISA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'NUMEROMOIS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'NUMEROMOISF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'NUMEROMOISV';			break;}
										if(SELECT.QUELLEDATE == 5) {s = 'NUMEROMOIS';			break;}
								
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';" />
					<ARG name="GROUPBY_3" value="return '-1';" />
					<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="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
				<VIEWITEM label="&#8721; dernière Année" shortLabel="&#8721; derniere année"  view="ACTI000149.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
					<ARG name="PERIODE_D" value="return VIEW.COMP_PERIODE_D;" />
					<ARG name="TOPERIODE_D" value="return VIEW.COMP_TOPERIODE_D;" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
					<ARG name="TOPERIODE" value=" return SELECT.TOPERIODE;" />
					<ARG name="GROUPBY">
						<value>
							<![CDATA[
								
							var s:String = '';
							switch (SELECT.GROUPBY) {
								case 'ANNEE' :			s = 'NUMEROMOIS'; 		break;
								case 'TRIM' :			s = 'NUMEROMOIS';		break;
								case 'MOIS' :			s = 'NUMEROMOIS';		break;
								case 'NUMEROMOIS' :		s = 'NUMEROMOIS';		break;
								case 'NUMEROTRIM' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEWE' :		s = 'NUMEROMOIS';		break;
								case 'SEMAINEANNE' :	s = 'NUMEROMOIS';		break;
								case 'NUMEROJOUR' :		s = 'NUMEROMOIS';		break;
								case 'JOURS' :			s = 'NUMEROMOIS';		break;
								case 'JOUR' :			s = 'NUMEROMOIS';		break;
								
								case 'ANNEEF' :			s = 'NUMEROMOISF'; 		break;
								case 'TRIMF' :			s = 'NUMEROMOISF';		break;
								case 'MOISF' :			s = 'NUMEROMOISF';		break;
								case 'NUMEROMOISF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROTRIMF' :	s = 'NUMEROMOISF';		break;
								case 'SEMAINEWEF' :		s = 'NUMEROMOISF';		break;
								case 'SEMAINEANNEF' :	s = 'NUMEROMOISF';		break;
								case 'NUMEROJOURF' :	s = 'NUMEROMOISF';		break;
								case 'JOURSF' :			s = 'NUMEROMOISF';		break;
								case 'JOURF' :			s = 'NUMEROMOISF';		break;
								
								case 'ANNEEA' :			s = 'NUMEROMOISA'; 		break;
								case 'TRIMA' :			s = 'NUMEROMOISA';		break;
								case 'MOISA' :			s = 'NUMEROMOISA';		break;
								case 'NUMEROMOISA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROTRIMA' :	s = 'NUMEROMOISA';		break;
								case 'SEMAINEWEA' :		s = 'NUMEROMOISA';		break;
								case 'SEMAINEANNEA' :	s = 'NUMEROMOISA';		break;
								case 'NUMEROJOURA' :	s = 'NUMEROMOISA';		break;
								case 'JOURSA' :			s = 'NUMEROMOISA';		break;
								case 'JOURA' :			s = 'NUMEROMOISA';		break;
								
								case 'ANNEEV' :			s = 'NUMEROMOISV'; 		break;
								case 'TRIMV' :			s = 'NUMEROMOISV';		break;
								case 'MOISV' :			s = 'NUMEROMOISV';		break;
								case 'NUMEROMOISV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROTRIMV' :	s = 'NUMEROMOISV';		break;
								case 'SEMAINEWEV' :		s = 'NUMEROMOISV';		break;
								case 'SEMAINEANNEV' :	s = 'NUMEROMOISV';		break;
								case 'NUMEROJOURV' :	s = 'NUMEROMOISV';		break;
								case 'JOURSV' :			s = 'NUMEROMOISV';		break;
								case 'JOURV' :			s = 'NUMEROMOISV';		break;
					
								default :				
										if(SELECT.QUELLEDATE == 1) {s = 'NUMEROMOISA';			break;}
										if(SELECT.QUELLEDATE == 2) {s = 'NUMEROMOIS';			break;}
										if(SELECT.QUELLEDATE == 3) {s = 'NUMEROMOISF';			break;}
										if(SELECT.QUELLEDATE == 4) {s = 'NUMEROMOISV';			break;}
										if(SELECT.QUELLEDATE == 5) {s = 'NUMEROMOIS';			break;}
							}
							return s;
							]]>
						</value>
					</ARG>
					<ARG name="GROUPBY_2" value="return '-1';"/>
					<ARG name="GROUPBY_3" value="return '-1';"/>
					<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="DATA1" value="'NBSEJ'" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
			</VIEWLINK>	
			<VIEWLINK label="Comparatif" shortLabel="Comparatif" view="ACTI000063.XML" enabled="true" rowContext="false" >
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
				<ARGS name="SPEC">
					<value><![CDATA[
						LINKVARIABLES['TYPE_COMPARAISON'] = '2';
						LINKVARIABLES['DATA1'] = 'MTFAC';
						LINKVARIABLES['DATA2'] = '0';
						LINKVARIABLES['DATA3'] = '0';
						if (SELECT.QUELMONTANT == '2') {
							LINKVARIABLES['DATA1'] = 'MTCPT';
						}
						if (SELECT.QUELMONTANT == 'FACVSBG') {
							//LINKVARIABLES['DATA1'] = 'MTCPT';
						}
						if (SELECT.QUELMONTANT == 'ENF') {
							LINKVARIABLES['DATA1'] = 'MTENC';
						}
						if (SELECT.QUELMONTANT == 'MF-ENF') {
							LINKVARIABLES['DATA1'] = 'MTFACENC';
						}
						if (SELECT.QUELMONTANT == 'MC-ENF') {
							LINKVARIABLES['DATA1'] = 'MTFACENC';
						}
						return 'OK';
					]]></value>
				</ARGS>
				<ARG name="GROUPBY" value="return SELECT.LGROUPBY;" />
				<ARG name="DATA1" value="'FAVNBS'" />
				<ARG name="DATA2" value="'MTFACENC'" />
				<ARG name="DATA3" value="'MTFACENC'" />
				<ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>	
			<VIEWLINK label="Comparatif mensuel" shortLabel="Comp. Mensuel" view="ACTI000156.XML" enabled="true" rowContext="false" buttonType="COMPARATIF" >
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
				<ARGS name="SPEC">
					<value><![CDATA[
						LINKVARIABLES['TYPE_COMPARAISON'] = '2';
						LINKVARIABLES['DATA1'] = 'MTFAC';
						LINKVARIABLES['DATA2'] = '0';
						LINKVARIABLES['DATA3'] = '0';
						if (SELECT.QUELMONTANT == '2') {
							LINKVARIABLES['DATA1'] = 'MTCPT';
						}
						if (SELECT.QUELMONTANT == 'FACVSBG') {
							//LINKVARIABLES['DATA1'] = 'MTCPT';
						}
						if (SELECT.QUELMONTANT == 'ENF') {
							LINKVARIABLES['DATA1'] = 'MTENC';
						}
						if (SELECT.QUELMONTANT == 'MF-ENF') {
							LINKVARIABLES['DATA1'] = 'MTFACENC';
						}
						if (SELECT.QUELMONTANT == 'MC-ENF') {
							LINKVARIABLES['DATA1'] = 'MTFACENC';
						}
						return 'OK';
					]]></value>
				</ARGS>
				<ARG name="GROUPBY" value="return SELECT.GROUPBY;"/>
				<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;"/>
				<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_3;"/>
				<ARG name="DATA1" value="if(SELECT.QUELLEDATE == '1') {return 'FAVEMC';} else {return 'FAVNBS';}" />
				<ARG name="DATA2" value="'MTFACENC'" />
				<ARG name="DATA3" value="if(SELECT.QUELLEDATE == '1') {return 'MMFPVEMC';} else {return 'MMTFACENC';}" />
				<ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Effets" shortLabel="Effets"  view="ACTI000141.XML" rowContext="false" enabled="true" buttonType="COMPARATIF" >
					<ARG name="ALIAS_PERIODE" value="return '-1';" />
                    <ARG name="PERIODE" value="return VIEW.COMP_PERIODE;" />
					<ARG name="GROUPBY" value="if (SELECT.GROUPBY == 'JOUR' ) {return 'JOURS'}
											   if (SELECT.GROUPBY == 'JOURF' ) {return 'JOURSF'}
											   if (SELECT.GROUPBY == 'MOIS' ) {return 'NUMEROMOIS'}
											   if (SELECT.GROUPBY == 'MOISF' ) {return 'NUMEROMOISF'}
					" />
					<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;"/>
					<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_3;"/>
					<ARG name="DATA01" value="'1.1'" />
                    <ARG name="TYPE_COMPARAISON" value="'2'" />
			</VIEWLINK>
			<VIEWLINK label="Evolution comparative" shortLabel="Evol. comparative"   rowContext="false" buttonType="VIEWLINK_EVO_COMP" >			
				<VIEWITEM label="Standard" shortLabel="Evolution comparative" view="ACTI000154.XML" rowContext="false" enabled="true" buttonType="VIEWLINK_EVO_COMP">
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
					<ARGS name="SPEC">
						<value><![CDATA[
							LINKVARIABLES['TYPE_COMPARAISON'] = '2';
							LINKVARIABLES['DATA1'] = 'MTFAC';
							LINKVARIABLES['DATA2'] = '0';
							LINKVARIABLES['DATA3'] = '0';
							if (SELECT.QUELMONTANT == '2') {
								LINKVARIABLES['DATA1'] = 'MTCPT';
							}
							if (SELECT.QUELMONTANT == 'FACVSBG') {
								//LINKVARIABLES['DATA1'] = 'MTCPT';
							}
							if (SELECT.QUELMONTANT == 'ENF') {
								LINKVARIABLES['DATA1'] = 'MTENC';
							}
							if (SELECT.QUELMONTANT == 'MF-ENF') {
								LINKVARIABLES['DATA1'] = 'MTFACENC';
							}
							if (SELECT.QUELMONTANT == 'MC-ENF') {
								LINKVARIABLES['DATA1'] = 'MTFACENC';
							}
							return 'OK';
						]]></value>
					</ARGS>
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="if (SELECT.QUELLEDATE == '1' ) {return 'NUMEROMOISA';}
												if (SELECT.QUELLEDATE == '2' ) {return 'NUMEROMOIS';}
												if (SELECT.QUELLEDATE == '3'  ) {return 'NUMEROMOISF';}
												if (SELECT.QUELLEDATE == '4'  ) {return 'NUMEROMOISV';}
						" />
					<ARG name="DATA1" value="if(SELECT.QUELLEDATE == '1') {return 'FAVEMC';} else {return 'FAVNBS';}" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="DATA3" value="if(SELECT.QUELLEDATE == '1') {return 'MMFPVEMC';} else {return 'MMTFACENC';}" />
					<ARG name="DATA4" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FACNBJ';} else {return 'FAVNBSHC';}"/>
					<ARG name="DATA5" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVDMS';} else {return 'FAVMTTHC';}"/>					
					<ARG name="DATA6"   value="return '0';" />
					<ARG name="DATA7"   value="return '0';" />
					<ARG name="DATA8"   value="return '0';" />
					<ARG name="DATA9"   value="return '0';"/>
					<ARG name="DATA10" 	value="return '0';"/>			
					<ARG name="DATA011" value="return '0';" />
					<ARG name="DATA012" value="return '0';" />
					<ARG name="DATA013" value="return '0';" />
					<ARG name="DATA014" value="return '0';"/>
					<ARG name="DATA015" value="return '0';"/>
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
				<VIEWITEM label="Détaillée" shortLabel="Evol. comparative" view="ACTI000154.XML" rowContext="false" enabled="true" buttonType="COMPARATIF">
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
					<ARGS name="SPEC">
						<value><![CDATA[
							LINKVARIABLES['TYPE_COMPARAISON'] = '2';
							LINKVARIABLES['DATA1'] = 'MTFAC';
							LINKVARIABLES['DATA2'] = '0';
							LINKVARIABLES['DATA3'] = '0';
							if (SELECT.QUELMONTANT == '2') {
								LINKVARIABLES['DATA1'] = 'MTCPT';
							}
							if (SELECT.QUELMONTANT == 'FACVSBG') {
								//LINKVARIABLES['DATA1'] = 'MTCPT';
							}
							if (SELECT.QUELMONTANT == 'ENF') {
								LINKVARIABLES['DATA1'] = 'MTENC';
							}
							if (SELECT.QUELMONTANT == 'MF-ENF') {
								LINKVARIABLES['DATA1'] = 'MTFACENC';
							}
							if (SELECT.QUELMONTANT == 'MC-ENF') {
								LINKVARIABLES['DATA1'] = 'MTFACENC';
							}
							return 'OK';
						]]></value>
					</ARGS>
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="if (SELECT.QUELLEDATE == '1' ) {return 'NUMEROMOISA';}
												 if (SELECT.QUELLEDATE == '2' ) {return 'NUMEROMOIS';}
												 if (SELECT.QUELLEDATE == '3'  ) {return 'NUMEROMOISF';}
												if (SELECT.QUELLEDATE == '4'  ) {return 'NUMEROMOISV';}
						" />
					<ARG name="DATA1" value="if(SELECT.QUELLEDATE == '1') {return 'FAVEMC';} else {return 'FAVNBS';}" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="DATA3" value="if(SELECT.QUELLEDATE == '1') {return 'MMFPVEMC';} else {return 'MMTFACENC';}" />
					<ARG name="DATA4" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FACNBJ';} else {return 'FAVNBSHC';}"/>
					<ARG name="DATA5" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVDMS';} else {return 'FAVMTTHC';}"/>
					<ARG name="DATA6" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVNBSHC';} else {return 'FAVCAMHC';}"/>
					<ARG name="DATA7" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVMTTHC';} else {return 'FAVNBSHJ';}"/>
					<ARG name="DATA8" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVCAMHC';} else {return 'FAVMTTHJ';}"/>
					<ARG name="DATA9" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVNBSHJ';} else {return 'FAVCAMHJ';}"/>
					<ARG name="DATA10" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVMTTHJ';} else {return 'FAVNBSHA';}"/>
					<ARG name="DATA011" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVCAMHJ';} else {return 'FAVMTTHA';}"/>
					<ARG name="DATA012" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVNBSHA';} else {return 'FAVCAMAU';}"/>
					<ARG name="DATA013" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVMTTHA';} else {return '0';}"/>
					<ARG name="DATA014" value="if(SELECT.QUELLEDATE == '1' || SELECT.QUELLEDATE == '2') {return 'FAVCAMAU';} else {return '0';}"/>
				
					<ARG name="LGROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="LGROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="GROUPBY_TAB" value="return 'TAB';" />
					<ARG name="TYPE_COMPARAISON" value="'2'" />
				</VIEWITEM>	
			</VIEWLINK>	
			<VIEWLINK label="Evolution" shortLabel="Evolution" view="ACTI000062.XML" enabled="true" rowContext="false" componentName="PERIODICITE_VIEWLINK" component2Name="PRESTATIONS_BASE_VIEWLINK">
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';" />
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
				<ARGS name="SPEC">
					<value><![CDATA[
						LINKVARIABLES['TYPE_COMPARAISON'] = '2';
						LINKVARIABLES['DATA'] = 'MTFAC';
						if (SELECT.QUELMONTANT == '2') {
							LINKVARIABLES['DATA'] = 'MTCPT';
						}
						if (SELECT.QUELMONTANT == 'FACVSBG') {
							//LINKVARIABLES['DATA'] = 'MTCPT';
						}
						if (SELECT.QUELMONTANT == 'ENF') {
							LINKVARIABLES['DATA'] = 'MTENC';
						}
						if (SELECT.QUELMONTANT == 'MF-ENF') {
							LINKVARIABLES['DATA'] = 'MTFACENC';
						}
						if (SELECT.QUELMONTANT == 'MC-ENF') {
							LINKVARIABLES['DATA'] = 'MTFACENC';
						}
						return 'OK';
					]]></value>
				</ARGS>
				<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
				<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;"/>
				<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_3;"/>
				<ARG name="DATA1" value="return 'FAVMTT';" />   
				<ARG name="PERIODICITE" value="'MONTH'" />   
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="ACTI000082.XML" enabled="true" rowContext="false" componentName="PRESTATIONS_ANALYSE_CROISEE_MULTIVIEWLINK" buttonType="ANALYSE_CROISEE" >
				<ARG name="PERIODE" value="return VIEW.X_PERIODE.substr(0,4)+'-01-01';"/>
			</VIEWLINK>	
			<VIEWLINK label="Analyse"  shortLabel="Analyse"  rowContext="false" buttonType="ANALYSE_VIEWLINK">
				<VIEWITEM label="Analyse" shortLabel="Analyse"  view="ACTI000018.XML" rowContext="false" enabled="true" buttonType="ANALYSE_VIEWLINK" componentName="PRESTATIONS_BASE_VIEWLINK">
					<ARG name="ALIAS_PERIODE" value="return '-1'" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_3;" />

					<ARG name="GROUPBY_TAB" value="'TAB'" />
				</VIEWITEM>					
				<VIEWITEM label="Analyse paramètrable" shortLabel="Analyse"  view="ACTI000165.XML" rowContext="false" enabled="true" buttonType="ANALYSE_VIEWLINK" componentName="PRESTATIONS_BASE_VIEWLINK" >
					<ARG name="ALIAS_PERIODE" value="return '-1'" />
					<ARG name="PERIODE" value="return SELECT.TOPERIODE.substr(0,4)+'-01-01';"/>
					<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" /> 
					<ARG name="GROUPBY" value="return SELECT.GROUPBY;" />
					<ARG name="GROUPBY_2" value="return SELECT.GROUPBY_2;" />
					<ARG name="GROUPBY_3" value="return SELECT.GROUPBY_3;" />
					<ARG name="LS_DATA" value="return '-1';"/>
					<ARG name="DATA1" value="if(SELECT.QUELLEDATE == '1') {return 'FAVEMC';} else {return 'FAVNBS';}" />
					<ARG name="DATA2" value="'MTFACENC'" />
					<ARG name="DATA3" value="if(SELECT.QUELLEDATE == '1') {return 'MMFPVEMC';} else {return 'MMTFACENC';}" />
					<ARG name="DATA4" value="return 'FAVNBEMCHC';"/>
					<ARG name="DATA5" value="return 'FAVMTTHC';"/>
					<ARG name="DATA6" value="return 'FAVCAMHC';"/>
					<ARG name="DATA7" value="return 'FAVNBSHJ';"/>
					<ARG name="DATA8" value="return 'FAVMTTHJ';"/>
					<ARG name="DATA9" value="return 'FAVCAMHJ';"/>
					<ARG name="DATA10" value="return '0'" />
					<ARG name="DATA011" value="return '0'" />
					<ARG name="DATA012" value="return '0'" />
					<ARG name="DATA013" value="return '0'" />
					<ARG name="DATA014" value="return '0'" />
					<ARG name="DATA014" value="return '0'" />
					<ARG name="DATA015" value="return '0'" />
					<ARG name="GROUPBY_TAB" value="'TAB'" />
				</VIEWITEM>	
			</VIEWLINK>	
			<VIEWLINK label="Liste des séjours" shortLabel="Séjours" view="ACTI000016.XML" componentName="PRESTATIONS_BASE_VIEWLINK" component2Name="STANDARD_BASE_VIEWLINK" component3Name="ETA_DOS_BASE_VIEWLINK">
				<ARG name="PERIODE">
					<value>
						<![CDATA[
                            if (SELECT.GROUPBY == 'MOIS') {return ROW.OID1;}
							if (SELECT.GROUPBY_2 == 'MOIS' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOIS' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISF') {return ROW.OID1;}
							if (SELECT.GROUPBY_2 == 'MOISF' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISF' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISEX') {return ROW.OID1;}
							if (SELECT.GROUPBY_2 == 'MOISEX' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISEX' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
						]]>
					</value>
				</ARG>
				<ARG name="TOPERIODE">
					<value>
						<![CDATA[
							if (SELECT.GROUPBY == 'MOIS') {return ROW.OID1;} 	
							if (SELECT.GROUPBY_2 == 'MOIS' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOIS' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISF') {return ROW.OID1;}	
							if (SELECT.GROUPBY_2 == 'MOISF' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISF' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISEX') {return ROW.OID1;}	
							if (SELECT.GROUPBY_2 == 'MOISEX' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISEX' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 

						]]>
					</value>
				</ARG>
				<ARG name="QUELLEDATE">
					<value>
						<![CDATA[
								if('[GROUPBY]' == 'ANNEEF' || '[GROUPBY]' == 'TRIMF' || '[GROUPBY]' == 'JOURF' || '[GROUPBY]' == 'NUMEROTRIMF' || '[GROUPBY]' == 'NUMEROMOISF' || '[GROUPBY]' == 'NUMEROJOURF' || '[GROUPBY]' == 'SEMAINEANNEF' || '[GROUPBY]' == 'JOURSF' || '[GROUPBY]' == 'SEMAINEWEF' 
                                    || '[GROUPBY_2]' == 'ANNEEF' || '[GROUPBY_2]' == 'TRIMF' || '[GROUPBY_2]' == 'JOURF' || '[GROUPBY_2]' == 'NUMEROTRIMF' || '[GROUPBY_2]' == 'NUMEROMOISF' || '[GROUPBY_2]' == 'NUMEROJOURF' || '[GROUPBY_2]' == 'SEMAINEANNEF' || '[GROUPBY_2]' == 'JOURSF' || '[GROUPBY_2]' == 'SEMAINEWEF'
                                    || '[GROUPBY_3]' == 'ANNEEF' || '[GROUPBY_3]' == 'TRIMF' || '[GROUPBY_3]' == 'JOURF' || '[GROUPBY_3]' == 'NUMEROTRIMF' || '[GROUPBY_3]' == 'NUMEROMOISF' || '[GROUPBY_3]' == 'NUMEROJOURF' || '[GROUPBY_3]' == 'SEMAINEANNEF' || '[GROUPBY_3]' == 'JOURSF' || '[GROUPBY_3]' == 'SEMAINEWEF') 
                                {return '2';}
								if('[GROUPBY]' == 'ANNEEEX' || '[GROUPBY]' == 'TRIMEX' || '[GROUPBY]' == 'JOUREX' || '[GROUPBY]' == 'NUMEROTRIMEX' || '[GROUPBY]' == 'NUMEROMOISEX' || '[GROUPBY]' == 'NUMEROJOUREX' || '[GROUPBY]' == 'SEMAINEANNEEX' || '[GROUPBY]' == 'JOURSEX' || '[GROUPBY]' == 'SEMAINEWEEX'
                                    || '[GROUPBY_2]' == 'ANNEEEX' || '[GROUPBY_2]' == 'TRIMEX' || '[GROUPBY_2]' == 'JOUREX' || '[GROUPBY_2]' == 'NUMEROTRIMEX' || '[GROUPBY_2]' == 'NUMEROMOISEX' || '[GROUPBY_2]' == 'NUMEROJOUREX' || '[GROUPBY_2]' == 'SEMAINEANNEEX' || '[GROUPBY_2]' == 'JOURSEX' || '[GROUPBY_2]' == 'SEMAINEWEEX'
                                    || '[GROUPBY_3]' == 'ANNEEEX' || '[GROUPBY_3]' == 'TRIMEX' || '[GROUPBY_3]' == 'JOUREX' || '[GROUPBY_3]' == 'NUMEROTRIMEX' || '[GROUPBY_3]' == 'NUMEROMOISEX' || '[GROUPBY_3]' == 'NUMEROJOUREX' || '[GROUPBY_3]' == 'SEMAINEANNEEX' || '[GROUPBY_3]' == 'JOURSEX' || '[GROUPBY_3]' == 'SEMAINEWEEX') 
                                {return '3';}
								return '[QUELLEDATE]';
						]]>
					</value>
				</ARG>
				<ARG name="QDETAIL_TIERS"> 
					<value>
						<![CDATA[
							return '-1';
						]]>
					</value>
				</ARG>
                <ARG name="ALIAS_PERIODE" value="return '-1';" />
			</VIEWLINK>
		</VIEWLINKS>
        <ONGLET excelLabel="Effet Simplifié" label="Effet Simplifié" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="" type="group" subType="" percentHeight="100" >
				<CHART title="C.A Total (10 premiers)" type="pieChart" subType="" maxItems="10" maxItemsSortOn="" maxItemsSortSeq="" sortField="F2" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="F2" displayName="C.A Total" />
				</CHART>
                <CHART title="Séjours pour les 10 premiers" type="columnChart" maxItems="10" maxItemsSortOn="F1" maxItemsSortSeq="D" sortField="COD" sortSeq="A" condition="ROW.LVL == '1'">
                    <CATEGORY field="CODTXT" type="Char" />
                    <SERIE field="EPXS" displayName="Effet Prix " displayNameCalc="false" />
                    <SERIE field="EVLS" displayName="Effet Volume" displayNameCalc="false" />
                </CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="70" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<COLUMN dataField="LVL" width="50" type="Char" visible="false" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" />
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid" />
				<COLUMN dataField="COD" width="70" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLE name="paddingLeft" value="15" condition="ROW.LVL == '2' &amp;&amp; SELECT.GROUPBY_TAB != 'TAB'" />
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="200" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" />
				<COLUMN dataField="CODTXT" type="Char" minWidth="200" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.COD + ' ' + ROW.TXT.toString().substr(0,10)" />
				</COLUMN>
				
				<COLUMN dataField="D1" type="Number" width="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q1)'+ '\n' +SELECT.DATA01_LABEL +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'" headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="F1" type="Number" width="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q2)' +'\n' +SELECT.DATA01_LABEL +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'"  headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_ECA" type="Number" width="80" outputFormat="= SELECT.DATA012" headerText="@LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.F1 &lt; ROW.D1) || (SELECT.DATA014 == 'N' &amp;&amp; ROW.F1 &gt; ROW.D1)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.F1 &gt; ROW.D1) || (SELECT.DATA014 == 'N' &amp;&amp; ROW.F1 &lt; ROW.D1)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.F1 != null &amp;&amp; ROW.D1 != null &amp;&amp; ROW.F1 == ROW.D1" />
                        <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
                </COLUMN>
				<COLUMN dataField="D1_PCT" type="Number" width="45" outputFormat="= if (ROW.D1 !=0) {return '0%'} else {return '#'}" headerText="@LF@ %" textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				
				<COLUMN dataField="D2" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + 'CA total'+ '\n' +  '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'  + '\n' " headerTextCalc="true" description="= SELECT.DATA023 " textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="F2" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + 'CA total'+ '\n' +  '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'  + '\n' " headerTextCalc="true" description="= SELECT.DATA023" textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_ECA" type="Number" width="95" outputFormat="#E" headerText="(X1) @LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.F2 &lt; ROW.D2) || (SELECT.DATA024 == 'N' &amp;&amp; ROW.F2 &gt; ROW.D2)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.F2 &gt; ROW.D2) || (SELECT.DATA024 == 'N' &amp;&amp; ROW.F2 &lt; ROW.D2)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.F2 != null &amp;&amp; ROW.D2 != null &amp;&amp; ROW.F2 == ROW.D2" />
                        <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_PCT" type="Number" width="45" outputFormat="= if (ROW.D2 !=0) {return '0%'} else {return '#'}" headerText="@LF@ %" textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="CA_MOY_OLD" type="Number" width="80" outputFormat="#E" headerText="'(P1)' + '\n' + 'CA moyen '+'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'" headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D2 / ROW.D1)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="CA_MOY_NOW" type="Number" width="80" outputFormat="#E" headerText="'(P2)' + '\n' + 'CA moyen ' +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'" headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.F2 / ROW.F1)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
                    <FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="EPXS" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Prix" description="EP=(P2-P1)*Q2" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.CA_MOY_NOW - ROW.CA_MOY_OLD)* ROW.F1" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EPXS &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="EVLS" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Volume" description="EV=(Q2-Q1)*P1" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.F1 - ROW.D1)* ROW.CA_MOY_OLD" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EVLS &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ETOT" type="Number" width="90" outputFormat="#E" headerText="@LF@ Somme des Effets" description="X1 = EP + EV " totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.EPXS + ROW.EVLS)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
		<ONGLET excelLabel="Effet Croisé" label="Effet Croisé" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHART title="" type="group" subType="" percentHeight="100" >
				<CHART title="C.A Total (10 premiers)" type="pieChart" subType="" maxItems="10" maxItemsSortOn="" maxItemsSortSeq="" sortField="F2" sortSeq="D" condition="ROW.LVL == '1'">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="F2" displayName="C.A Total" />
				</CHART>
                <CHART title="Séjours pour les 10 premiers" type="columnChart" maxItems="10" maxItemsSortOn="F1" maxItemsSortSeq="D" sortField="COD" sortSeq="A" condition="ROW.LVL == '1'">
                    <CATEGORY field="CODTXT" type="Char" />
                    <SERIE field="EPX" displayName="Effet Prix " displayNameCalc="false" />
                    <SERIE field="EVL" displayName="Effet Volume" displayNameCalc="false" />
                    <SERIE field="ECR" displayName="Effet Croisé" displayNameCalc="false" />
                </CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="70" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<COLUMN dataField="LVL" width="50" type="Char" visible="false" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" />
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid" />
				<COLUMN dataField="COD" width="70" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLE name="paddingLeft" value="15" condition="ROW.LVL == '2' &amp;&amp; SELECT.GROUPBY_TAB != 'TAB'" />
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="200" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" />
				<COLUMN dataField="CODTXT" type="Char" minWidth="200" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.COD + ' ' + ROW.TXT.toString().substr(0,10)" />
				</COLUMN>
				
				<COLUMN dataField="D1" type="Number" width="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q1)'+ '\n' +SELECT.DATA01_LABEL +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'" headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="F1" type="Number" width="80" outputFormat="= SELECT.DATA012" selectable="true" headerText="'(Q2)' +'\n' +SELECT.DATA01_LABEL +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'"  headerTextCalc="true" description="= SELECT.DATA013 " textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="D1_ECA" type="Number" width="80" outputFormat="= SELECT.DATA012" headerText="@LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.F1 &lt; ROW.D1) || (SELECT.DATA014 == 'N' &amp;&amp; ROW.F1 &gt; ROW.D1)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA014 == 'P' &amp;&amp; ROW.F1 &gt; ROW.D1) || (SELECT.DATA014 == 'N' &amp;&amp; ROW.F1 &lt; ROW.D1)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.F1 != null &amp;&amp; ROW.D1 != null &amp;&amp; ROW.F1 == ROW.D1" />
                        <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
                </COLUMN>
				<COLUMN dataField="D1_PCT" type="Number" width="45" outputFormat="= if (ROW.D1 !=0) {return '0%'} else {return '#'}" headerText="@LF@ %" textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				
				<COLUMN dataField="D2" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + 'CA total'+ '\n' +  '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'  + '\n' " headerTextCalc="true" description="= SELECT.DATA023 " textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="F2" type="Number" width="85" outputFormat="#E" selectable="true" headerText="+ '\n' + 'CA total'+ '\n' +  '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'  + '\n' " headerTextCalc="true" description="= SELECT.DATA023" textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_ECA" type="Number" width="95" outputFormat="#E" headerText="(X1) @LF@ Ecart" textAlign="center">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.F2 &lt; ROW.D2) || (SELECT.DATA024 == 'N' &amp;&amp; ROW.F2 &gt; ROW.D2)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA024 == 'P' &amp;&amp; ROW.F2 &gt; ROW.D2) || (SELECT.DATA024 == 'N' &amp;&amp; ROW.F2 &lt; ROW.D2)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.F2 != null &amp;&amp; ROW.D2 != null &amp;&amp; ROW.F2 == ROW.D2" />
                        <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="D2_PCT" type="Number" width="45" outputFormat="= if (ROW.D2 !=0) {return '0%'} else {return '#'}" headerText="@LF@ %" textAlign="center">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="CA_MOY_OLD" type="Number" width="80" outputFormat="#E" headerText="'(P1)' + '\n' + 'CA moyen '+'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;'" headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.D2 / ROW.D1)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="CA_MOY_NOW" type="Number" width="80" outputFormat="#E" headerText="'(P2)' + '\n' + 'CA moyen ' +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;'" headerTextCalc="true"  description="CA / nb Séjours" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.F2 / ROW.F1)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
                    <FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
				<COLUMN dataField="EPX" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Prix" description="EP=(P2-P1)*Q1" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.CA_MOY_NOW - ROW.CA_MOY_OLD)* ROW.D1" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EPX &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="EVL" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Volume" description="EV=(Q2-Q1)*P1" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.F1 - ROW.D1)* ROW.CA_MOY_OLD" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.EVL &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ECR" type="Number" width="95" outputFormat="#E" headerText="@LF@ Effet Croisé" description="EC=(Q2-Q1)*(P2-P1)" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="((ROW.F1 - ROW.D1)*(ROW.CA_MOY_NOW - ROW.CA_MOY_OLD) )" />
                    <CELLSTYLE name="cellIndicator" value="circle, 5, left middle, 0xD63E00" condition="(ROW.ECR &lt; '0')" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				<COLUMN dataField="ETOT" type="Number" width="90" outputFormat="#E" headerText="@LF@ Somme des Effets" description="X1 = EP + EV + EC" totalFunction="calc" otherFunction="calc" calc="true" textAlign="center">
					<CALC formula="(ROW.EPX + ROW.EVL + ROW.ECR)" />
                    <HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
					<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>