<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000156" label="Activité. Comparaison facturation" 
	database="iCTI" swf="*CTI_view1" 
	softCode="iCTI_activite" 
	globals="ACTI_globals.XML" 
	componentsFile="ACTI_components.XML" 
	helpFile="iCTI_ACTI_ACTI000156.HTML"
    helpDokuWIkiDir="activite:activite_facturee_et_valorisee:activite_clinique" 
    helpDokuWIkiFile="acti000156" 
>    
	
	<title><![CDATA[=	
		
		var group_by_label = '';
		if (SELECT.GROUPBY != '-1') {
			group_by_label = ' par ' + SELECT.GROUPBY_LABEL;
		}
		if (SELECT.GROUPBY_2 != '-1') {
			group_by_label = group_by_label + ' et ' + SELECT.GROUPBY_2_LABEL;
		}
		
		var date_label = '('+ SELECT.QUELLEDATE_LABEL +' : '+ 'N-1 : '+ VIEW.PERIODE_D_LABEL + ' à ' +  VIEW.TOPERIODE_D_LABEL + ' vs ' + ' N : '+ SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')';

		
		return 'Comparatif période et dernier mois de facturation ' + group_by_label + ' ' + date_label;
		
	]]></title>
	
	<VIEWPROPERTIES componentName="PROPERTIES_PRESTATIONS"/>
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
		<PROPERTY name="JOURNEES_FIELD">
			<value>
					<![CDATA[
						[EVAL 
							$field = 'nb_jours';
							if ('[QJMUT]' == 'd') {$field = $field . '_d';}
							else {
								if ('[QJMUT]' == 'f') {$field = $field . '_f';}
								else {
									if ('[QJMUT]' == '12') {$field = $field . '_12';}
									else {
										if ('[QJMUT]' == 'prorata') {$field = $field . '_prorata';}
										else {
											$field = $field . '_f';
										}
									}
								}
							}
							return $field;
						EVAL]
					]]>
				</value>
		</PROPERTY>	
		<PROPERTY name="QUELLEDATE_MVT">
			<value><![CDATA[[EVAL 
                    $column_date = "v_mouvements_sejour_2.date";
                    if ('[QUELLEDATE]' == '2') {
                        $column_date = "p_factures_reference.date_fin_facture";
					}
					return $column_date;
				EVAL]]]></value>
		</PROPERTY>
        <PROPERTY name="QMVT_SELECT">
			<value><![CDATA[[EVAL 
                    $qmvt_select = "AND 1=1";
                    if ('[QUELLEDATE]' != '1' && '[QUELLEDATE]' != '2') {
                        $qmvt_select = "AND 1<>1";
                    }
					return $qmvt_select;
				EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA01F">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA1]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA01D">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA1]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA02F">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA2]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA02D">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA2]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'", "","0"); EVAL]]]></value>
		</PROPERTY>			
		<PROPERTY name="DATA03F">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA3]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA03D">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA3]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'", "","0"); EVAL]]]></value>
		</PROPERTY>	
		<PROPERTY name="DATA1F">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA1]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[PERIODE]' AND '[TOPERIODE]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA1D">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA1]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA2F">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA2]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[PERIODE]' AND '[TOPERIODE]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA2D">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA2]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'", "","0"); EVAL]]]></value>
		</PROPERTY>			
		<PROPERTY name="DATA3F">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA3]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[PERIODE]' AND '[TOPERIODE]'", "","0"); EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="DATA3D">
			<value><![CDATA[[EVAL return ACTI_facturation_clinique_data('[DATA3]', 0, "v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'", "","0"); EVAL]]]></value>
		</PROPERTY>		
	</VIEWPROPERTIES>
	
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
			<FIELD name="QUELLEDATE" label="" UI="combo" width="130" 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="De" UI="combo" tree="true" width="150" default="2009-01-01" globalListProvider="DATE_DEBUT" >
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2009-01-31" globalListProvider="DATE_FIN" >
			</FIELD>
		</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="De" UI="combo" tree="true" width="150" default="2008-01-01" globalListProvider="DATE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2008-01-31" globalListProvider="DATE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
		</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>
			<FIELD name="GROUPBY" label="Regroupement" UI="combo" default="PRF" tree="true" width="300">
				<OPTION label="PRESTATIONS_GROUPBY" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" 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>
			<FIELD name="GROUPBY_2" label="" UI="combo" default="-1" tree="true" width="300">
				<OPTION label="" data="-1"/>
				<OPTION label="PRESTATIONS_GROUPBY" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY_3" label="" UI="combo" default="-1" tree="true" width="300">
				<OPTION label="" data="-1"/>
				<OPTION label="PRESTATIONS_GROUPBY" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="LGROUPBY" label="Regroupement" UI="combo" default="SER" width="200" tree="true" visible="false">
				<OPTION label="PRESTATIONS_GROUPBY" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>			
			<FIELD name="LGROUPBY_2" label="Regroupement" UI="combo" default="SER" width="200" tree="true" visible="false">
				<OPTION label="PRESTATIONS_GROUPBY" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>				
			<FIELD name="LGROUPBY_3" label="Regroupement" UI="combo" default="SER" width="200" tree="true" visible="false">
				<OPTION label="PRESTATIONS_GROUPBY" data="" globalListProvider="PRESTATIONS_GROUPBY"/>
			</FIELD>			
		</GROUP>
		<GROUP label="Données">
			<FIELD name="DATA1" tree="true" label="Données" UI="combo" default="MTFAC" width="400" showIfNotDefault="true" printable="false">
				<OPTION label="PRESTATIONS_DATA" data="" globalListProvider="PRESTATIONS_DATA"/>
			</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="PRESTATIONS_DATA" data="" globalListProvider="PRESTATIONS_DATA"/>
			</FIELD>
		</GROUP>		
		<GROUP label="">
			<FIELD name="DATA3" tree="true" label="" UI="combo" default="0" default2="0" width="400" showIfNotDefault="true" printable="false" visible="= (SELECT.DATA1 != '0') &amp;&amp; ( SELECT.DATA2 != '0')">
				<OPTION label="" data="0"/>				
				<OPTION label="PRESTATIONS_DATA" data="" globalListProvider="PRESTATIONS_DATA"/>
			</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" optimizer2="V_FACTURES_LIGNES_C_X">
				<select><![CDATA[ 
					
					DROP TABLE IF EXISTS ACTI000063_SEJ;
                    CREATE TEMP TABLE ACTI000063_SEJ AS
                    SELECT v_factures_lignes_c_4.no_sejour
                        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]' 
                        
                        [VIEW.SEJOURS_SELECT]
                        [VIEW.PRESTATIONS_SELECT]
                        [VIEW.PASSAGES_SELECT]
						[VIEW.PATIENTS_SELECT]
                        [VIEW.QMVT_SELECT]
						GROUP BY 1
					UNION
                    SELECT v_factures_lignes_c_4.no_sejour
                        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 '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' 
                        
                        [VIEW.SEJOURS_SELECT]
                        [VIEW.PRESTATIONS_SELECT]
                        [VIEW.PASSAGES_SELECT]
						[VIEW.PATIENTS_SELECT]
                        [VIEW.QMVT_SELECT]
                    GROUP BY 1
                    ;
                    CREATE INDEX ACTI000063_SEJ_i1 ON ACTI000063_SEJ USING btree (no_sejour);
				
				
				]]></select>
			</SQL>
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_MOUVEMENTS_SEJOUR_X" >
				<select><![CDATA[

                    DROP TABLE IF EXISTS empty;
                    CREATE TEMP TABLE empty AS
                    SELECT -123::bigint AS empty_id, ''::text AS empty_code, ''::text AS empty_texte
                    ;
					
					DROP TABLE IF EXISTS w_factures_reference;
					CREATE TEMP TABLE w_factures_reference AS
					SELECT p_factures_reference.no_sejour,
							p_factures_reference.date_debut_facture,
							p_factures_reference.date_fin_facture,
							p_factures_reference.code_facture,
							p_factures_reference.montant_comptabilise_c,
							p_factures_reference.montant_comptabilise_budget_global_c,
							p_factures_reference.montant_comptabilise_h,
							row_number() OVER (PARTITION BY p_factures_reference.no_sejour ORDER BY date_debut_facture, date_facture) AS seq
					FROM activite.p_factures_reference
					JOIN ACTI000063_SEJ ON p_factures_reference.no_sejour = ACTI000063_SEJ.no_sejour
					;

					
					CREATE INDEX w_factures_reference_i1 ON w_factures_reference USING btree (no_sejour)
					;

					UPDATE w_factures_reference
					SET date_debut_facture = date(w_factures_reference1.date_fin_facture+interval '1 day')
					FROM w_factures_reference w_factures_reference1
					WHERE w_factures_reference.no_sejour = w_factures_reference1.no_sejour AND
						w_factures_reference.seq = w_factures_reference1.seq +1
					;
					
					CTIPREPAR_TREE 
						WORKTABLE{ACTI000063_MVT} 
						GROUPBY1{[VIEW.GROUPBY_MVT_OID_FIELD],, [VIEW.GROUPBY_MVT_COD_FIELD],, [VIEW.GROUPBY_MVT_TXT_FIELD]} 
						GROUPBY1MODE{[GROUPBY_TAB]} 
						GROUPBY2{[VIEW.GROUPBY_MVT_2_OID_FIELD],, [VIEW.GROUPBY_MVT_2_COD_FIELD],, [VIEW.GROUPBY_MVT_2_TXT_FIELD]} 
						GROUPBY3{[VIEW.GROUPBY_MVT_3_OID_FIELD],, [VIEW.GROUPBY_MVT_3_COD_FIELD],, [VIEW.GROUPBY_MVT_3_TXT_FIELD]} 
					INDICATORS{ 
					/* 01_1_1 FACEMC (N)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]'   and  (p_factures_reference.code_facture = '1') THEN equivalent_malade_complet ELSE 0 END),,                   
                    /* 01_2_2 FACEMC (N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'   and  (p_factures_reference.code_facture = '1') THEN equivalent_malade_complet ELSE 0 END),,
                                 
				   
                    /* 02_1_3 FACNBJ (N)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND (p_factures_reference.code_facture = '1') THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
					/* 02_2_4 FACNBJ (N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND (p_factures_reference.code_facture = '1') THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
                    
                    /* 03_1_5 VALEMC (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND p_factures_reference.code_facture = '0' THEN equivalent_malade_complet ELSE 0 END),,                    						
					/* 03_1_6 VALEMC (N-1)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'  and p_factures_reference.code_facture = '0' THEN equivalent_malade_complet ELSE 0 END),,
                    
					
                    /* 04_1_7 VALNBJ (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND p_factures_reference.code_facture = '0' THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,                    
                    /* 04_2_8 VALNBJ (N-1)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'  and  p_factures_reference.code_facture = '0' THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
                    
                    /* 05_1_9 FAVEMC (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' then equivalent_malade_complet ELSE 0 END),,                            						
					/* 05_2_10 FAVEMC (N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'  then equivalent_malade_complet ELSE 0 END),,                    
					
                    /* 06_1_11 FAVNBJ (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]'    then nb_jours_f + nb_ambulatoires  + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
					/* 06_2_12 FAVNBJ (N-1)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' and  (p_factures_reference.code_facture = '1' or p_factures_reference.code_facture = '0' )   then nb_jours_f + nb_ambulatoires   + CASE WHEN  type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
                   
					/*07_01_13 DMS hospitalisés (N)	*/		
						base.cti_division(SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' and v_sejours_1.date_sortie <= '[TOPERIODE]' AND v_sejours_1.code_sorti = 1 then [VIEW.JOURNEES_FIELD] ELSE null END),SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' then nb_sorties_directes else 0 end)),,
					/*07_01_14 DMS hospitalisés (N-1)*/			
						base.cti_division(SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' and v_sejours_1.date_sortie <= '[VIEW.TOPERIODE_D]' AND v_sejours_1.code_sorti = 1 then [VIEW.JOURNEES_FIELD] ELSE null END),SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' then nb_sorties_directes else 0 end)),,
					
					
					/* 08_1_15 FAVNBEMCHC (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND type_sejour = '1' then equivalent_malade_complet ELSE 0 END),,                            						
					/* 08_2_16 FAVNBEMCHC (N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' AND type_sejour = '1' then equivalent_malade_complet ELSE 0 END),,
                   
                    /* 01_2_17 FACEMC (DM N)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' and  (p_factures_reference.code_facture = '1') THEN equivalent_malade_complet ELSE 0 END),,
				    /* 01_2_18 FACEMC (DM N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'  and  (p_factures_reference.code_facture = '1') THEN equivalent_malade_complet ELSE 0 END),,
					
					/* 02_2_19 FACNBJ (DM N)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND (p_factures_reference.code_facture = '1') THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
 	
					/* 02_1_20 FACNBJ (DM N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND (p_factures_reference.code_facture = '1') THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
                    
                    /* 03_1_21 VALEMC (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND p_factures_reference.code_facture = '0' THEN equivalent_malade_complet ELSE 0 END),,                    						
					/* 03_1_22 VALEMC (N-1)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'  and p_factures_reference.code_facture = '0' THEN equivalent_malade_complet ELSE 0 END),,
					
					/* 04_1_23 VALNBJ (DM N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND p_factures_reference.code_facture = '0' THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,                    
                    /* 04_2_24 VALNBJ (DM N-1)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT]  BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'  and  p_factures_reference.code_facture = '0' THEN nb_jours_f + nb_ambulatoires + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
					
					/* 05_1_25 FAVEMC (N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' then equivalent_malade_complet ELSE 0 END),,                            						
					/* 05_2_26 FAVEMC (N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]'  then equivalent_malade_complet ELSE 0 END),,    
                   
				   /* 06_1_27 FAVNBJ (DM N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]'    then nb_jours_f + nb_ambulatoires  + CASE WHEN type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
					/* 06_2_28 FAVNBJ (DM N-1)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' and  (p_factures_reference.code_facture = '1' or p_factures_reference.code_facture = '0' )   then nb_jours_f + nb_ambulatoires   + CASE WHEN  type_sejour = '5' THEN nb_seances ELSE 0 END ELSE 0 END),,
                   						
					/*07_01_29 DMS hospitalisés (DM N)	*/		
						base.cti_division(SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' and v_sejours_1.date_sortie <= '[TOPERIODE]' AND v_sejours_1.code_sorti = 1 then [VIEW.JOURNEES_FIELD] ELSE null END),SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' then nb_sorties_directes else 0 end)),,
					/*07_01_30 DMS hospitalisés (DM N-1)*/			
						base.cti_division(SUM(CASE WHEN  [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' and v_sejours_1.date_sortie <= '[VIEW.TOPERIODE_D]' AND v_sejours_1.code_sorti = 1 then [VIEW.JOURNEES_FIELD] ELSE null END),SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN  date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' then nb_sorties_directes else 0 end)),,
					
					/* 08_1_31 FAVNBEMCHC (DM N)*/
                        SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN date_trunc('month','[TOPERIODE]'::date) AND '[TOPERIODE]' AND type_sejour = '1' then equivalent_malade_complet ELSE 0 END),,                            						
					/* 08_2_32 FAVNBEMCHC (DM N-1)*/
						SUM(CASE WHEN [VIEW.QUELLEDATE_MVT] BETWEEN date_trunc('month','[VIEW.TOPERIODE_D]'::date) AND '[VIEW.TOPERIODE_D]' AND type_sejour = '1' then equivalent_malade_complet ELSE 0 END)
                        						
					}
					
				FROM #V_SEJOURS_X#,#V_MOUVEMENTS_SEJOUR_X#
                    JOIN ACTI000063_SEJ ON v_mouvements_sejour_2.no_sejour = ACTI000063_SEJ.no_sejour
                    JOIN w_factures_reference p_factures_reference ON
                        p_factures_reference.no_sejour = v_mouvements_sejour_2.no_sejour AND
                        (v_mouvements_sejour_2.date BETWEEN p_factures_reference.date_debut_facture AND p_factures_reference.date_fin_facture) 
                    JOIN empty ON 1=1
				WHERE '[QUELLEDATE]' IN ('1','2') AND
						v_mouvements_sejour_2.no_sejour = v_sejours_1.no_sejour AND
						([VIEW.QUELLEDATE_MVT] BETWEEN '[PERIODE]' AND '[TOPERIODE]' OR 
						[VIEW.QUELLEDATE_MVT] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]')
						
						[VIEW.SEJOURS_SELECT] 
                        [VIEW.PASSAGES_SELECT]
						[VIEW.PATIENTS_SELECT]
                        [VIEW.QMVT_SELECT]
                        [VIEW.MOUVEMENTS_SELECT]
						AND v_sejours_1.type_sejour <> '9' 
				
				]]></select>
			</SQL>
			<SQL optimizer="V_SEJOURS_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]}
						INDICATORS{
						
							[VIEW.DATA1F],,
							[VIEW.DATA1D],,
							0,,
							0,,
							[VIEW.DATA2F],,
							[VIEW.DATA2D],,
							0,,
							0,,							
							[VIEW.DATA01F],,
							[VIEW.DATA01D],,
							0,,
							0,,
							[VIEW.DATA02F],,
							[VIEW.DATA02D],,
							0,,
							0,,	
							[VIEW.DATA3F],,
							[VIEW.DATA3D],,
							0,,
							0,,							
							[VIEW.DATA03F],,
							[VIEW.DATA03D],,
							0,,
							0
						}
					FROM #V_FACTURES_LIGNES_C_X#
						JOIN #V_SEJOURS_X# ON v_sejours_1.no_sejour = v_factures_lignes_c_4.no_sejour
						LEFT JOIN ACTI000063_SEJ ON v_factures_lignes_c_4.no_sejour = ACTI000063_SEJ.no_sejour

					WHERE 
							(v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]' OR
							v_factures_lignes_c_4.[VIEW.QUELLEDATE_FIELD] BETWEEN '[PERIODE]' AND '[TOPERIODE]') 
							[VIEW.SEJOURS_SELECT]
							[VIEW.PRESTATIONS_SELECT]
							[VIEW.PASSAGES_SELECT]
							[VIEW.PATIENTS_SELECT]
					AFTER{
				
					UPDATE w_table 
						SET indicateurs[3] = COALESCE(ACTI000063_MVT.indicateurs[001],0) - COALESCE(ACTI000063_MVT.indicateurs[002],0)
							[EVAL 
								if ('[DATA1]' == 'EMC') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[001],
										indicateurs[2] = ACTI000063_MVT.indicateurs[002],
										indicateurs[9] = ACTI000063_MVT.indicateurs[017],
										indicateurs[10] = ACTI000063_MVT.indicateurs[018]									
																													
									"; 
								}								
								if ('[DATA1]' == 'VALEMC') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[005],
										indicateurs[2] = ACTI000063_MVT.indicateurs[006],
										indicateurs[9] = ACTI000063_MVT.indicateurs[021],
										indicateurs[10] = ACTI000063_MVT.indicateurs[022]
										
									";
								}								
								if ('[DATA1]' == 'FAVEMC') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[009],
										indicateurs[2] = ACTI000063_MVT.indicateurs[010],
										indicateurs[9] = ACTI000063_MVT.indicateurs[025],
										indicateurs[10] = ACTI000063_MVT.indicateurs[026]
										
									";
								}	
								if ('[DATA1]' == 'FACNBJ') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[003],
										indicateurs[2] = ACTI000063_MVT.indicateurs[004],
										indicateurs[9] = ACTI000063_MVT.indicateurs[019],
										indicateurs[10] = ACTI000063_MVT.indicateurs[020]
										
									";
								}									
								if ('[DATA1]' == 'VALNBJ') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[007],
										indicateurs[2] = ACTI000063_MVT.indicateurs[008],
										indicateurs[9] = ACTI000063_MVT.indicateurs[023],
										indicateurs[10] = ACTI000063_MVT.indicateurs[024]
										
									";
								}								
								if ('[DATA1]' == 'FAVNBJ') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[011],
										indicateurs[2] = ACTI000063_MVT.indicateurs[012],
										indicateurs[9] = ACTI000063_MVT.indicateurs[027],
										indicateurs[10] = ACTI000063_MVT.indicateurs[028]
										
									";
								}									
								if ('[DATA1]' == 'FAVDMS') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[013],
										indicateurs[2] = ACTI000063_MVT.indicateurs[014],
										indicateurs[9] = ACTI000063_MVT.indicateurs[029],
										indicateurs[10] = ACTI000063_MVT.indicateurs[030]
										
									";
								}									
								if ('[DATA1]' == 'FAVNBEMCHC') {
									return "
										,
										indicateurs[1] = ACTI000063_MVT.indicateurs[015],
										indicateurs[2] = ACTI000063_MVT.indicateurs[016],
										indicateurs[9] = ACTI000063_MVT.indicateurs[031],
										indicateurs[10] = ACTI000063_MVT.indicateurs[032]
										
									";
								}								
								if ('[DATA1]' == 'MFAVCAMHC') {
									return "
										,
										indicateurs[1] = base.cti_division(w_table.indicateurs[1],ACTI000063_MVT.indicateurs[015]),
										indicateurs[2] = base.cti_division(w_table.indicateurs[2],ACTI000063_MVT.indicateurs[016]),										
										indicateurs[9] = base.cti_division(w_table.indicateurs[9],ACTI000063_MVT.indicateurs[031]),
										indicateurs[10] = base.cti_division(w_table.indicateurs[10],ACTI000063_MVT.indicateurs[032])
										
									";
								}									
								if ('[DATA1]' == 'MMFPVEMC') {
									return "
										,
										indicateurs[1] = base.cti_division(w_table.indicateurs[1],ACTI000063_MVT.indicateurs[009]),
										indicateurs[2] = base.cti_division(w_table.indicateurs[2],ACTI000063_MVT.indicateurs[010]),
										indicateurs[9] = base.cti_division(w_table.indicateurs[9],ACTI000063_MVT.indicateurs[025]),
										indicateurs[10] = base.cti_division(w_table.indicateurs[10],ACTI000063_MVT.indicateurs[026])
										
										
									";
								}									
								if ('[DATA1]' == 'MMFACEMC') {
									return "
										,
										indicateurs[1] = base.cti_division(w_table.indicateurs[1],ACTI000063_MVT.indicateurs[001]),
										indicateurs[2] = base.cti_division(w_table.indicateurs[2],ACTI000063_MVT.indicateurs[002]),
										indicateurs[9] = base.cti_division(w_table.indicateurs[9],ACTI000063_MVT.indicateurs[017]),
										indicateurs[10] = base.cti_division(w_table.indicateurs[10],ACTI000063_MVT.indicateurs[018])
										
									";
								}								
								if ('[DATA1]' == 'MMVALEMC') {
									return "
										,
										indicateurs[1] = base.cti_division(w_table.indicateurs[1],ACTI000063_MVT.indicateurs[005]),
										indicateurs[2] = base.cti_division(w_table.indicateurs[2],ACTI000063_MVT.indicateurs[006]),
										indicateurs[9] = base.cti_division(w_table.indicateurs[9],ACTI000063_MVT.indicateurs[021]),
										indicateurs[10] = base.cti_division(w_table.indicateurs[10],ACTI000063_MVT.indicateurs[022])
										
									";
								}								
							EVAL]							
							[EVAL 
								if ('[DATA2]' == 'EMC') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[001],
										indicateurs[6] = ACTI000063_MVT.indicateurs[002],
										indicateurs[13] = ACTI000063_MVT.indicateurs[017],
										indicateurs[14] = ACTI000063_MVT.indicateurs[018]										

										
										
									";
								}								
								if ('[DATA2]' == 'VALEMC') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[005],
										indicateurs[6] = ACTI000063_MVT.indicateurs[006],
										indicateurs[13] = ACTI000063_MVT.indicateurs[021],
										indicateurs[14] = ACTI000063_MVT.indicateurs[022]
										
									";
								}								
								if ('[DATA2]' == 'FAVEMC') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[009],
										indicateurs[6] = ACTI000063_MVT.indicateurs[010],
										indicateurs[13] = ACTI000063_MVT.indicateurs[025],
										indicateurs[14] = ACTI000063_MVT.indicateurs[026]
										
									";
								}	
								if ('[DATA2]' == 'FACNBJ') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[003],
										indicateurs[6] = ACTI000063_MVT.indicateurs[004],
										indicateurs[13] = ACTI000063_MVT.indicateurs[019],
										indicateurs[14] = ACTI000063_MVT.indicateurs[020]
										
									";
								}								
								if ('[DATA2]' == 'VALNBJ') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[007],
										indicateurs[6] = ACTI000063_MVT.indicateurs[008],
										indicateurs[13] = ACTI000063_MVT.indicateurs[023],
										indicateurs[14] = ACTI000063_MVT.indicateurs[024]
										
									";
								}
								if ('[DATA2]' == 'FAVNBJ') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[011],
										indicateurs[6] = ACTI000063_MVT.indicateurs[012],
										indicateurs[13] = ACTI000063_MVT.indicateurs[027],
										indicateurs[14] = ACTI000063_MVT.indicateurs[028]
										
									";
								}								
								if ('[DATA2]' == 'FAVDMS') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[013],
										indicateurs[6] = ACTI000063_MVT.indicateurs[014],
										indicateurs[13] = ACTI000063_MVT.indicateurs[029],
										indicateurs[14] = ACTI000063_MVT.indicateurs[030]
										
									";
								}									
								if ('[DATA2]' == 'FAVNBEMCHC') {
									return "
										,
										indicateurs[5] = ACTI000063_MVT.indicateurs[015],
										indicateurs[6] = ACTI000063_MVT.indicateurs[016],
										indicateurs[13] = ACTI000063_MVT.indicateurs[031],
										indicateurs[14] = ACTI000063_MVT.indicateurs[032]
										
									";
								}
								if ('[DATA2]' == 'MFAVCAMHC') {
									return "
										,
										indicateurs[5] = base.cti_division(w_table.indicateurs[5],ACTI000063_MVT.indicateurs[015]),
										indicateurs[6] = base.cti_division(w_table.indicateurs[6],ACTI000063_MVT.indicateurs[016]),										
										indicateurs[13] = base.cti_division(w_table.indicateurs[13],ACTI000063_MVT.indicateurs[031]),
										indicateurs[14] = base.cti_division(w_table.indicateurs[14],ACTI000063_MVT.indicateurs[032])
										
									";
								}									
								if ('[DATA2]' == 'MMFPVEMC') {
									return "
										,
										indicateurs[5] = base.cti_division(w_table.indicateurs[5],ACTI000063_MVT.indicateurs[009]),
										indicateurs[6] = base.cti_division(w_table.indicateurs[6],ACTI000063_MVT.indicateurs[010]),
										indicateurs[13] = base.cti_division(w_table.indicateurs[13],ACTI000063_MVT.indicateurs[025]),
										indicateurs[14] = base.cti_division(w_table.indicateurs[14],ACTI000063_MVT.indicateurs[026])
										
										
									";
								}									
								if ('[DATA2]' == 'MMFACEMC') {
									return "
										,
										indicateurs[5] = base.cti_division(w_table.indicateurs[5],ACTI000063_MVT.indicateurs[001]),
										indicateurs[6] = base.cti_division(w_table.indicateurs[6],ACTI000063_MVT.indicateurs[002]),
										indicateurs[13] = base.cti_division(w_table.indicateurs[13],ACTI000063_MVT.indicateurs[017]),
										indicateurs[14] = base.cti_division(w_table.indicateurs[14],ACTI000063_MVT.indicateurs[018])
										
									";
								}								
								if ('[DATA2]' == 'MMVALEMC') {
									return "
										,
										indicateurs[5] = base.cti_division(w_table.indicateurs[5],ACTI000063_MVT.indicateurs[005]),
										indicateurs[6] = base.cti_division(w_table.indicateurs[6],ACTI000063_MVT.indicateurs[006]),
										indicateurs[13] = base.cti_division(w_table.indicateurs[13],ACTI000063_MVT.indicateurs[021]),
										indicateurs[14] = base.cti_division(w_table.indicateurs[14],ACTI000063_MVT.indicateurs[022])
										
									";
								}									
							EVAL]							
							[EVAL 
								if ('[DATA3]' == 'EMC') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[001],
										indicateurs[18] = ACTI000063_MVT.indicateurs[002],
										indicateurs[21] = ACTI000063_MVT.indicateurs[017],
										indicateurs[22] = ACTI000063_MVT.indicateurs[018]										

										
										
									";
								}								
								if ('[DATA3]' == 'VALEMC') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[005],
										indicateurs[18] = ACTI000063_MVT.indicateurs[006],
										indicateurs[21] = ACTI000063_MVT.indicateurs[021],
										indicateurs[22] = ACTI000063_MVT.indicateurs[022]
										
									";
								}								
								if ('[DATA3]' == 'FAVEMC') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[009],
										indicateurs[18] = ACTI000063_MVT.indicateurs[010],
										indicateurs[21] = ACTI000063_MVT.indicateurs[025],
										indicateurs[22] = ACTI000063_MVT.indicateurs[026]
										
									";
								}	
								if ('[DATA3]' == 'FACNBJ') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[003],
										indicateurs[18] = ACTI000063_MVT.indicateurs[004],
										indicateurs[21] = ACTI000063_MVT.indicateurs[019],
										indicateurs[22] = ACTI000063_MVT.indicateurs[020]
										
									";
								}								
								if ('[DATA3]' == 'VALNBJ') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[007],
										indicateurs[18] = ACTI000063_MVT.indicateurs[008],
										indicateurs[21] = ACTI000063_MVT.indicateurs[023],
										indicateurs[22] = ACTI000063_MVT.indicateurs[024]
										
									";
								}
								if ('[DATA3]' == 'FAVNBJ') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[011],
										indicateurs[18] = ACTI000063_MVT.indicateurs[012],
										indicateurs[21] = ACTI000063_MVT.indicateurs[027],
										indicateurs[22] = ACTI000063_MVT.indicateurs[028]
										
									";
								}								
								if ('[DATA3]' == 'FAVDMS') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[013],
										indicateurs[18] = ACTI000063_MVT.indicateurs[014],
										indicateurs[21] = ACTI000063_MVT.indicateurs[029],
										indicateurs[22] = ACTI000063_MVT.indicateurs[030]
										
									";
								}									
								if ('[DATA3]' == 'FAVNBEMCHC') {
									return "
										,
										indicateurs[17] = ACTI000063_MVT.indicateurs[015],
										indicateurs[18] = ACTI000063_MVT.indicateurs[016],
										indicateurs[21] = ACTI000063_MVT.indicateurs[031],
										indicateurs[22] = ACTI000063_MVT.indicateurs[032]
										
									";
								}
								if ('[DATA3]' == 'MFAVCAMHC') {
									return "
										,
										indicateurs[17] = base.cti_division(w_table.indicateurs[17],ACTI000063_MVT.indicateurs[015]),
										indicateurs[18] = base.cti_division(w_table.indicateurs[18],ACTI000063_MVT.indicateurs[016]),										
										indicateurs[21] = base.cti_division(w_table.indicateurs[21],ACTI000063_MVT.indicateurs[031]),
										indicateurs[22] = base.cti_division(w_table.indicateurs[22],ACTI000063_MVT.indicateurs[032])
										
									";
								}									
								if ('[DATA3]' == 'MMFPVEMC') {
									return "
										,
										indicateurs[17] = base.cti_division(w_table.indicateurs[17],ACTI000063_MVT.indicateurs[009]),
										indicateurs[18] = base.cti_division(w_table.indicateurs[18],ACTI000063_MVT.indicateurs[010]),
										indicateurs[21] = base.cti_division(w_table.indicateurs[21],ACTI000063_MVT.indicateurs[025]),
										indicateurs[22] = base.cti_division(w_table.indicateurs[22],ACTI000063_MVT.indicateurs[026])
										
										
									";
								}									
								if ('[DATA3]' == 'MMFACEMC') {
									return "
										,
										indicateurs[17] = base.cti_division(w_table.indicateurs[17],ACTI000063_MVT.indicateurs[001]),
										indicateurs[18] = base.cti_division(w_table.indicateurs[18],ACTI000063_MVT.indicateurs[002]),
										indicateurs[21] = base.cti_division(w_table.indicateurs[21],ACTI000063_MVT.indicateurs[017]),
										indicateurs[22] = base.cti_division(w_table.indicateurs[22],ACTI000063_MVT.indicateurs[018])
										
									";
								}								
								if ('[DATA3]' == 'MMVALEMC') {
									return "
										,
										indicateurs[17] = base.cti_division(w_table.indicateurs[17],ACTI000063_MVT.indicateurs[005]),
										indicateurs[18] = base.cti_division(w_table.indicateurs[18],ACTI000063_MVT.indicateurs[006]),
										indicateurs[21] = base.cti_division(w_table.indicateurs[21],ACTI000063_MVT.indicateurs[021]),
										indicateurs[22] = base.cti_division(w_table.indicateurs[22],ACTI000063_MVT.indicateurs[022])
										
									";
								}									
							EVAL]							
								FROM ACTI000063_MVT
									WHERE w_table.OIDT = ACTI000063_MVT.OIDT AND
										w_table.OID1 = ACTI000063_MVT.OID1 AND
										w_table.OID2 = ACTI000063_MVT.OID2 AND
										w_table.OID3 = ACTI000063_MVT.OID3
						.,
						UPDATE w_table 
						SET 
							indicateurs[3] = COALESCE(indicateurs[1],0) - COALESCE(indicateurs[2],0),
							indicateurs[4] = base.cti_division(COALESCE(indicateurs[1],0) - indicateurs[2],indicateurs[2]/100.00),
							indicateurs[7] = COALESCE(indicateurs[5],0) - COALESCE(indicateurs[6],0),
							indicateurs[8] = base.cti_division(COALESCE(indicateurs[5],0) - indicateurs[6],indicateurs[6]/100.00),
							indicateurs[11] = COALESCE(indicateurs[9],0) - COALESCE(indicateurs[10],0),
							indicateurs[12] = base.cti_division(COALESCE(indicateurs[9],0) - indicateurs[10],indicateurs[10]/100.00),					
							indicateurs[15] = COALESCE(indicateurs[13],0) - COALESCE(indicateurs[14],0),
							indicateurs[16] = base.cti_division(COALESCE(indicateurs[13],0) - indicateurs[14],indicateurs[14]/100.00),
							indicateurs[19] = COALESCE(indicateurs[17],0) - COALESCE(indicateurs[18],0),
							indicateurs[20] = base.cti_division(COALESCE(indicateurs[17],0) - indicateurs[18],indicateurs[18]/100.00),						
							indicateurs[23] = COALESCE(indicateurs[21],0) - COALESCE(indicateurs[22],0),
							indicateurs[24] = base.cti_division(COALESCE(indicateurs[21],0) - indicateurs[22],indicateurs[22]/100.00)								
							
					}
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="F1"/>
					<FIELD name="D1"/>
					<FIELD name="E1"/>
					<FIELD name="P1"/>
					<FIELD name="F2"/>
					<FIELD name="D2"/>
					<FIELD name="E2"/>
					<FIELD name="P2"/>
					<FIELD name="MF1"/>
					<FIELD name="MD1"/>
					<FIELD name="ME1"/>
					<FIELD name="MP1"/>
					<FIELD name="MF2"/>
					<FIELD name="MD2"/>
					<FIELD name="ME2"/>
					<FIELD name="MP2"/>	
					<FIELD name="F3"/>
					<FIELD name="D3"/>
					<FIELD name="E3"/>
					<FIELD name="P3"/>
					<FIELD name="MF3"/>
					<FIELD name="MD3"/>
					<FIELD name="ME3"/>
					<FIELD name="MP3"/>						
				</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
				]]></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.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="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="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="return SELECT.GROUPBY;"/>
					<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" view="ACTI000018.XML" enabled="true" rowContext="false" buttonType="ANALYSE" >
				<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'" />
			</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="GROUPBY_TAB" value="'TAB'" />
					<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="ETA_DOS_BASE_VIEWLINK">
				<ARG name="ALIAS_PERIODE" value="return '-1';" />
				<ARG name="GROUPBY_2" value="return '-1';"/>
				<ARG name="QUELLEDATE" value="return SELECT.QUELLEDATE;" />   
				<ARG name="QUELMONTANT" value="return 'FAV';"/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition mensuelle" label="Répartition mensuelle" multiTab="true">
			<CHART title="Comparatif (30 premiers)" type="lineChart" maxItems="30" maxItemsSortOn="D1" maxItemsSortSeq="D" sortField="" visibleCondition="(SELECT.GROUPBY == 'JOURS') || (SELECT.GROUPBY == 'JOURSF')|| (SELECT.GROUPBY == 'JOURSA')|| (SELECT.GROUPBY == 'JOURSV')" sortSeq="D1"  condition="ROW.LVL == '1'">
				<CATEGORY field="TXT" type="Char"/>
				<SERIE field="D1" displayName="SELECT.DATA13 + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true" />
				<SERIE field="F1" displayName="SELECT.DATA13 + ' ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true" />
			</CHART>			
			<CHART title="Comparatif (30 premiers)" type="lineChart" maxItems="30" maxItemsSortOn="D1" maxItemsSortSeq="D" sortField="" visibleCondition="(SELECT.GROUPBY == 'NUMEROMOIS') || (SELECT.GROUPBY == 'NUMEROMOISF') || (SELECT.GROUPBY == 'NUMEROMOISA') || (SELECT.GROUPBY == 'NUMEROMOISV')" sortSeq="D1"  condition="ROW.LVL == '1'">
				<CATEGORY field="TXT" type="Char"/>
				<SERIE field="D1" displayName="SELECT.DATA13 + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true" />
				<SERIE field="F1" 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.DATA13 + ' ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="F1" displayName="SELECT.DATA13 + ' ' + 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" >
					<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="D1" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &gt; 12){return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';} else {return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA14" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
				</COLUMN>
				<COLUMN dataField="F1" width="85" visible="true" type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &gt; 12){return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';} else {return SELECT.DATA13 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA14" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						</COLUMN>
				<COLUMN dataField="E1" type="Number" headerText="Ecart" width="85" visibleCondition="(SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' || SELECT.PRESENTATION == '4'" outputFormat="= SELECT.DATA12" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.D1 &lt; ROW.F1)) || (ROW.F1 &lt; ROW.D1)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.F1 &lt; ROW.D1)) || (ROW.D1 &lt; ROW.F1)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D1 == ROW.F1" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
						</COLUMN>
				<COLUMN dataField="P1" type="Number" headerText="%" width="45" visibleCondition="(SELECT.PRESENTATION != '1') &amp;&amp; (SELECT.PRESENTATION != '2') &amp;&amp; (SELECT.PRESENTATION == '4') || (SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA1 !='0')" outputFormat="= if (ROW.D1 != 0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>
				</COLUMN>
				<COLUMN dataField="D2" width="85" visibleCondition="SELECT.DATA2 != '0' " type="Number" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &gt; 12){return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';} else {return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA24" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="F2" width="85" visibleCondition="SELECT.DATA2 != '0'" type="Number" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &gt; 12){return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';} else {return SELECT.DATA23 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA24" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="E2" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA2 != '0'  &amp;&amp; (SELECT.PRESENTATION == '1' )  || SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA2 !='0'  || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0' " outputFormat="= SELECT.DATA22" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA2.substr(0,3) == 'DEL' &amp;&amp; (ROW.D2 &lt; ROW.F2)) || (ROW.F2 &lt; ROW.D2)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA2.substr(0,3) == 'DEL' &amp;&amp; (ROW.F2 &lt; ROW.D2)) || (ROW.D2 &lt; ROW.F2)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D2 == ROW.F2" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="P2" type="Number" headerText="%  " width="70" visibleCondition="SELECT.DATA2 != '0' &amp;&amp; (SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp; (SELECT.PRESENTATION != '1') || (SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA2 !='0') || (SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0')" outputFormat="= if (ROW.D2 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="D3" width="85" visibleCondition="SELECT.DATA3 != '0'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &gt; 12){return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';} else {return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N-1&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA34" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>	
				<COLUMN dataField="F3" width="85" visibleCondition="SELECT.DATA3 != '0'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &gt; 12){return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';} else {return SELECT.DATA33 + String.fromCharCode(13) +'\n'+ '&lt;font color=\'#DB1702\'&gt;N&lt;/font&gt;';}"  headerTextCalc="true" textAlign="right" description="=SELECT.DATA34" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>	
				<COLUMN dataField="E3" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA3 != '0'  &amp;&amp; (SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA3 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='0'" outputFormat="= SELECT.DATA32" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.D3 &lt; ROW.F3)) || (ROW.F3 &lt; ROW.D3)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.F3 &lt; ROW.D3)) || (ROW.D3 &lt; ROW.F3)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.D3 == ROW.F3" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>	
				<COLUMN dataField="P3" type="Number" headerText="%  " width="45" visibleCondition="SELECT.DATA3 != '0' &amp;&amp; (SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp;  (SELECT.PRESENTATION != '1') || SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA3 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='0'" outputFormat="= if (ROW.D3 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MD1" width="85"  type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &lt; 13){return SELECT.DATA13 + String.fromCharCode(13)+'\n'+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} else {SELECT.DATA13 + String.fromCharCode(13)+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA14" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MF1" width="85"  type="Number" outputFormat="= SELECT.DATA12" fixed="false" selectable="true" headerText="if(SELECT.DATA13.length &lt; 13) {return SELECT.DATA13 + String.fromCharCode(13)+'\n' +SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA13 + String.fromCharCode(13)+ SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;'}" headerTextCalc="true" textAlign="right"  description="=SELECT.DATA14" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="ME1" type="Number" headerText="Ecart" width="85" visibleCondition="(SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' || SELECT.PRESENTATION == '4'"  outputFormat="= SELECT.DATA12" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MD1 &lt; ROW.MF1)) || (ROW.MF1 &lt; ROW.MD1)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MF1 &lt; ROW.MD1)) || (ROW.MD1 &lt; ROW.MF1)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.MD1 == ROW.MF1" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MP1" type="Number" headerText="%" width="45" visibleCondition="(SELECT.PRESENTATION == '4')  &amp;&amp; (SELECT.PRESENTATION != '1') || (SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA1 !='0') || (SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA1 !='0')" outputFormat="= if (ROW.MD1) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MD2" width="85"  type="Number" visibleCondition="SELECT.DATA2 != '0'" outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &lt; 13) {return SELECT.DATA23 + String.fromCharCode(13)+'\n'+VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA23 + String.fromCharCode(13)+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}" headerTextCalc="true" textAlign="right" description="=SELECT.DATA24" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MF2" width="85"  type="Number" visibleCondition="SELECT.DATA2 != '0'"  outputFormat="= SELECT.DATA22" fixed="false" selectable="true" headerText="if(SELECT.DATA23.length &lt; 13) {return SELECT.DATA23 +String.fromCharCode(13)+'\n'+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA23 +String.fromCharCode(13)+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} " headerTextCalc="true" textAlign="right" description="=SELECT.DATA24" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="ME2" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA2 != '0'  &amp;&amp; (SELECT.PRESENTATION == '1')  || (SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA2 !='0')  || (SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0') " outputFormat="= SELECT.DATA22" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MD2 &lt; ROW.MF2)) || (ROW.MF2 &lt; ROW.MD2)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA1.substr(0,3) == 'DEL' &amp;&amp; (ROW.MF2 &lt; ROW.MD2)) || (ROW.MD2 &lt; ROW.MF2)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.MD2 == ROW.MF2" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MP2" type="Number" headerText="%" width="45" visibleCondition=" (SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.DATA2 != '0' &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp; (SELECT.PRESENTATION != '1' || SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA2 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA2 !='0')"  outputFormat="= if (ROW.MD2 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MD3" width="85" visibleCondition="SELECT.DATA3 != '0'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &lt; 13){return SELECT.DATA33 + String.fromCharCode(13)+'\n'+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} else {SELECT.DATA33 + String.fromCharCode(13)+ VIEW.TOPERIODE_D_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}" headerTextCalc="true" description="=SELECT.DATA34" textAlign="right" totalFunction="sum" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MF3" width="85" visibleCondition="SELECT.DATA3 != '0'" type="Number" outputFormat="= SELECT.DATA32" fixed="false" selectable="true" headerText="if(SELECT.DATA33.length &lt; 13) {return SELECT.DATA33 +String.fromCharCode(13)+'\n'+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';}else {return SELECT.DATA33 +String.fromCharCode(13)+SELECT.TOPERIODE_LABEL+'\n'+'&lt;font color=\'#DB1702\'&gt;Mois&lt;/font&gt;';} " headerTextCalc="true" description="=SELECT.DATA34" textAlign="right" totalFunction="sum" otherFunction="sum">	
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="ME3" type="Number" headerText="Ecart" width="85" visibleCondition="SELECT.DATA3 != '0' &amp;&amp; SELECT.PRESENTATION != '2'  &amp;&amp; (SELECT.PRESENTATION == '1')  || SELECT.PRESENTATION == '2' &amp;&amp; SELECT.DATA3 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='0'" outputFormat="= SELECT.DATA32" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
					<CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.MD3 &lt; ROW.MF3)) || (ROW.MF3 &lt; ROW.MD3)" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition="(SELECT.DATA3.substr(0,3) == 'DEL' &amp;&amp; (ROW.MF3 &lt; ROW.MD3)) || (ROW.MD3 &lt; ROW.MF3)" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.MD3 == ROW.MF3" />
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
				<COLUMN dataField="MP3" type="Number" headerText="%" width="45" visibleCondition="(SELECT.PRESENTATION == '4')  &amp;&amp; SELECT.DATA3 != '0' &amp;&amp; SELECT.PRESENTATION != '2' &amp;&amp; (SELECT.PRESENTATION != '1') || SELECT.PRESENTATION == '3' &amp;&amp; SELECT.DATA3 !='0' || SELECT.PRESENTATION == '4' &amp;&amp; SELECT.DATA3 !='0'" outputFormat="= if (ROW.MD3 !=0) {return '0%'} else {return '#'}" fixed="false" textAlign="right" totalFunction="sum" totalComplement="" otherFunction="sum">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<HEADERCELLSTYLE name="textAlign" value="center"/>				
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
