<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE 
	name="ACTI000029" 
	label="Activité. Rapport personnalisé" 
	title="=  SELECT.RAPPORT_LABEL + ' par ' +  SELECT.GROUPBY_LABEL + ' ('  +  SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ') - ' + VIEW.JOUROUVRE_LABEL"
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_activite" 
	globals="ACTI_globals.XML" 
	componentsFile="ACTI_components.XML">

	<VIEWPROPERTIES componentName="PROPERTIES_RAPPORT"/>
	<VIEWPROPERTIES>
		
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
        <PROPERTY name="N" value="[EVAL 
											if ('[TYPE_COMPARAISON]' == '2') {return '@LF@N';}
                                            if ('[TYPE_COMPARAISON]' == '2B') {return '@LF@N';}
											return '';
										EVAL]"/>
		<PROPERTY name="N1" value="[EVAL 
											if ('[TYPE_COMPARAISON]' == '2') {return '@LF@N-1';}
                                            if ('[TYPE_COMPARAISON]' == '2B') {return '@LF@N-1';}
											return '';
										EVAL]"/>
                                       
        <PROPERTY name="B" value="[EVAL 
											if ('[TYPE_COMPARAISON]' == '2B') {return '@LF@Budget';}
											return '';
										EVAL]"/>
		
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période">
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="" UI="combo" tree="true" width="150" default="2007-01-01" globalListProvider="DATE_DEBUT" >
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2007-01-31" globalListProvider="DATE_FIN" >
			</FIELD>
		</GROUP>
		<GROUP label="Comparer avec">
			<FIELD name="TYPE_COMPARAISON" label="" UI="combo" default="-1">
				<OPTION label="Pas de comparaison" data="-1"/>
				<OPTION label="Année précédente" data="2"/>
				<OPTION label="Année précédente et Budget" data="2B"/>
				<OPTIONx label="Deux années précédentes" data="3"/>
				<OPTIONx label="Saisie période" data="S"/>
			</FIELD>
			<FIELD name="PERIODE_D" label="Période" UI="combo" tree="true" width="150" default="2006-01-01" globalListProvider="DATE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2006-01-31" globalListProvider="DATE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
		</GROUP>
		<GROUP label="Regroupement">
			<FIELD name="GROUPBY" label="" UI="combo" default="4" tree="true">
				<OPTION label="SEJOUR_GROUPBY" data="" globalListProvider="SEJOUR_GROUPBY"/>
				<OPTION label="Mois" data="MOIS"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" label="Présentation" UI="combo" default="AUTO">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP label="Niveaux suivants">
			<FIELD name="GROUPBY_2" label="" UI="combo" default="-1" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="SEJOUR_GROUPBY" data="" globalListProvider="SEJOUR_GROUPBY"/>
				<OPTION label="Mois" data="MOIS"/>
			</FIELD>
			<FIELD name="GROUPBY_3" label="" UI="combo" default="-1" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="SEJOUR_GROUPBY" data="" globalListProvider="SEJOUR_GROUPBY"/>
				<OPTION label="Mois" data="MOIS"/>
			</FIELD>
		</GROUP>
		<GROUP label="Rapport">
			<FIELD name="RAPPORT" label="" UI="combo" default="-1" globalListProvider="RAPPORT">
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_SEJOURS_RAPPORTS_SELECTIONS"/>
	<QUERIES>
		<QUERY label=""> 
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_BUDGET }
						GROUPBY1{[VIEW.GROUPBY_BUDGET_OID_FIELD],, [VIEW.GROUPBY_BUDGET_COD_FIELD],, [VIEW.GROUPBY_BUDGET_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_BUDGET_OID_FIELD],, [VIEW.GROUPBY_2_BUDGET_COD_FIELD],, [VIEW.GROUPBY_2_BUDGET_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_BUDGET_OID_FIELD],, [VIEW.GROUPBY_3_BUDGET_COD_FIELD],, [VIEW.GROUPBY_3_BUDGET_TXT_FIELD]}
						INDICATORS{
							[VIEW.INDICATEURS_BUDGET]
						}	
					FROM activite.v_budget_cle_budget_r_1
					WHERE date_trunc('month',date_reference) BETWEEN '[PERIODE]' AND '[TOPERIODE]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
						[VIEW.INDICATEURS_WHERE_BUDGET]
						[VIEW.BUDGET_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_OCCUPATION#1]
						}	
					FROM activite.v_mouvements_sejour_r_1 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_OCCUPATION#1]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_OCCUPATION#1]
						}	
					FROM activite.v_mouvements_sejour_r_1 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_OCCUPATION#1]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			
			
			<SQL>
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_PLACES}
						GROUPBY1{[VIEW.GROUPBY_PLACES_OID_FIELD],, [VIEW.GROUPBY_PLACES_COD_FIELD],, [VIEW.GROUPBY_PLACES_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_PLACES_OID_FIELD],, [VIEW.GROUPBY_2_PLACES_COD_FIELD],, [VIEW.GROUPBY_2_PLACES_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_PLACES_OID_FIELD],, [VIEW.GROUPBY_3_PLACES_COD_FIELD],, [VIEW.GROUPBY_3_PLACES_TXT_FIELD]}
						INDICATORS{
							[VIEW.INDICATEURS_PLACES#1],
						}	
					FROM activite.v_places_r_1
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.ETAGE_PLACES_SELECT]
						
					AFTER{	
						UPDATE temp.ACTI000029_P SET 
							indicateurs = base.cti_array_sum(temp.ACTI000029_P.indicateurs, temp.ACTI000029_PLACES.indicateurs)					
						FROM temp.ACTI000029_PLACES
						WHERE 
							(temp.ACTI000029_PLACES.oidt = temp.ACTI000029_P.oidt OR temp.ACTI000029_PLACES.oidt = -111) AND
							(temp.ACTI000029_PLACES.oid1 = temp.ACTI000029_P.oid1 OR temp.ACTI000029_PLACES.oid1 = -111) AND
							(temp.ACTI000029_PLACES.oid2 = temp.ACTI000029_P.oid2 OR temp.ACTI000029_PLACES.oid2 = -111) AND
							(temp.ACTI000029_PLACES.oid3 = temp.ACTI000029_P.oid3 OR temp.ACTI000029_PLACES.oid3 = -111)
					}
				]]></select>
				
			</SQL>
            
            <SQL>
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_PLACES}
						GROUPBY1{[VIEW.GROUPBY_PLACES_OID_FIELD],, [VIEW.GROUPBY_PLACES_COD_FIELD],, [VIEW.GROUPBY_PLACES_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_PLACES_OID_FIELD],, [VIEW.GROUPBY_2_PLACES_COD_FIELD],, [VIEW.GROUPBY_2_PLACES_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_PLACES_OID_FIELD],, [VIEW.GROUPBY_3_PLACES_COD_FIELD],, [VIEW.GROUPBY_3_PLACES_TXT_FIELD]}
						INDICATORS{
							[VIEW.INDICATEURS_PLACES#1],
						}	
					FROM activite.v_places_r_1
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
						[VIEW.ETAGE_PLACES_SELECT]
						
					AFTER{	
						UPDATE temp.ACTI000029_P2 SET 
							indicateurs = base.cti_array_sum(temp.ACTI000029_P2.indicateurs, temp.ACTI000029_PLACES.indicateurs)					
						FROM temp.ACTI000029_PLACES
						WHERE 
							(temp.ACTI000029_PLACES.oidt = temp.ACTI000029_P2.oidt OR temp.ACTI000029_PLACES.oidt = -111) AND
							(temp.ACTI000029_PLACES.oid1 = temp.ACTI000029_P2.oid1 OR temp.ACTI000029_PLACES.oid1 = -111) AND
							(temp.ACTI000029_PLACES.oid2 = temp.ACTI000029_P2.oid2 OR temp.ACTI000029_PLACES.oid2 = -111) AND
							(temp.ACTI000029_PLACES.oid3 = temp.ACTI000029_P2.oid3 OR temp.ACTI000029_PLACES.oid3 = -111)
					}
				]]></select>
				
			</SQL>
			
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_SEJOURS#2]
						}	
					FROM activite.v_factures_reference_r_2 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_SEJOURS#2]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_SEJOURS#2]
						}	
					FROM activite.v_factures_reference_r_2 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_SEJOURS#2]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_SEJOURS#5]
						}	
					FROM activite.v_factures_reference_r_5 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_SEJOURS#5]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_SEJOURS#5]
						}	
					FROM activite.v_factures_reference_r_5 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_SEJOURS#5]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#1]
						}	
					FROM activite.v_factures_lignes_c_r_1 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#1]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#1]
						}	
					FROM activite.v_factures_lignes_c_r_1 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#1]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#2]
						}	
					FROM activite.v_factures_lignes_c_r_2 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#2]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#2]
						}	
					FROM activite.v_factures_lignes_c_r_2 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#2]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#3]
						}	
					FROM activite.v_factures_lignes_c_r_3 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#3]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#3]
						}	
					FROM activite.v_factures_lignes_c_r_3 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#3]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#4]
						}	
					FROM activite.v_factures_lignes_c_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_CLINIQUE#4]
						}	
					FROM activite.v_factures_lignes_c_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_CLINIQUE#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#1]
						}	
					FROM activite.v_factures_lignes_h_r_1 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#1]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#1]
						}	
					FROM activite.v_factures_lignes_h_r_1 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#1]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#2]
						}	
					FROM activite.v_factures_lignes_h_r_2 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#2]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#2]
						}	
					FROM activite.v_factures_lignes_h_r_2 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#2]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#3]
						}	
					FROM activite.v_factures_lignes_h_r_3 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#3]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#3]
						}	
					FROM activite.v_factures_lignes_h_r_3 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#3]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#4]
						}	
					FROM activite.v_factures_lignes_h_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_FACTURATION_HONORAIRE#4]
						}	
					FROM activite.v_factures_lignes_h_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_FACTURATION_HONORAIRE#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_CLIENTS_CLINIQUE#4]
						}	
					FROM activite.v_facture_solde_tiers_c_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_CLIENTS_CLINIQUE#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_CLIENTS_CLINIQUE#4]
						}	
					FROM activite.v_facture_solde_tiers_c_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_CLIENTS_CLINIQUE#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
			<SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_EN_COURS#4]
						}	
					FROM activite.v_factures_encours_lignes_c_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[PERIODE]' AND '[TOPERIODE]'
                        [VIEW.INDICATEURS_WHERE_EN_COURS#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            <SQL optimizer="V_RAPPORT_JOIN">
				<select><![CDATA[		
					CTIPREPAR_TREE
						WORKTABLE{temp.ACTI000029_P2,, ADD}
						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]}
						INDICATORS{
							[VIEW.INDICATEURS_EN_COURS#4]
						}	
					FROM activite.v_factures_encours_lignes_c_r_4 #V_RAPPORT_JOIN#
					WHERE date_reference BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' AND '[TYPE_COMPARAISON]' IN ('2','2B')
                        [VIEW.INDICATEURS_WHERE_EN_COURS#4]
						[VIEW.RAPPORT_SELECT]
				]]></select>
			</SQL>
            
			
			<SQL>
				<select><![CDATA[		

                    DROP TABLE IF EXISTS ACTI000029_ALL;
                    CREATE TEMP TABLE ACTI000029_ALL AS
					SELECT oidt, labelt, textet, 
						oid1, code1, 
						oid2, code2, 
						oid3, code3, 
						oid, code, texte, level, 
						Array[[VIEW.RUBRIQUES_RAPPORT]] AS indicateurs_1,
                        NULL::numeric[] AS indicateurs_2,
                        NULL::numeric[] AS indicateurs_b
					FROM temp.ACTI000029_P
					GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13
					ORDER BY labelt,oidt,code1,oid1,code2,oid2,code3,oid3
                    ;
                    INSERT INTO ACTI000029_ALL
                    SELECT oidt, labelt, textet, 
						oid1, code1, 
						oid2, code2, 
						oid3, code3, 
						oid, code, texte, level, 
                        NULL::numeric[] AS indicateurs_1,
						Array[[VIEW.RUBRIQUES_RAPPORT]] AS indicateurs_2,
                        NULL::numeric[] AS indicateurs_b
					FROM temp.ACTI000029_P2
					GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13
					ORDER BY labelt,oidt,code1,oid1,code2,oid2,code3,oid3
                    ;
                    INSERT INTO ACTI000029_ALL
                    SELECT oidt, labelt, textet, 
						oid1, code1, 
						oid2, code2, 
						oid3, code3, 
						oid, code, texte, level, 
                        NULL::numeric[] AS indicateurs_1,
                        NULL::numeric[] AS indicateurs_2,
						Array[[VIEW.RUBRIQUES_RAPPORT]] AS indicateurs_b
					FROM temp.ACTI000029_BUDGET
					GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13
					ORDER BY labelt,oidt,code1,oid1,code2,oid2,code3,oid3
                    ;
                    
                    -- Pour savoir s'il faut afficher le budget ou pas
                    CTISELECT_PROPERTY 'QB'||to_char(i,'FM00'), MAX(CASE WHEN indicateurs_b[i] <> 0 THEN '1' ELSE '0' END)
					FROM ACTI000029_ALL
					JOIN (SELECT generate_series(1,20) AS i) subview ON 1=1
					GROUP BY 1
					ORDER BY 1
					;
                    
                    -- Retour des données
                    SELECT oidt, labelt, textet, 
						oid1, code1, 
						oid2, code2, 
						oid3, code3, 
						oid, code, texte, level,
                        MAX(indicateurs_1[01]),
                        MAX(indicateurs_1[02]),
                        MAX(indicateurs_1[03]),
                        MAX(indicateurs_1[04]),
                        MAX(indicateurs_1[05]),
                        MAX(indicateurs_1[06]),
                        MAX(indicateurs_1[07]),
                        MAX(indicateurs_1[08]),
                        MAX(indicateurs_1[09]),
                        MAX(indicateurs_1[10]),
                        MAX(indicateurs_1[11]),
                        MAX(indicateurs_1[12]),
                        MAX(indicateurs_1[13]),
                        MAX(indicateurs_1[14]),
                        MAX(indicateurs_1[15]),
                        MAX(indicateurs_1[16]),
                        MAX(indicateurs_1[17]),
                        MAX(indicateurs_1[18]),
                        MAX(indicateurs_1[19]),
                        MAX(indicateurs_1[20]),
                        MAX(indicateurs_2[01]),
                        MAX(indicateurs_2[02]),
                        MAX(indicateurs_2[03]),
                        MAX(indicateurs_2[04]),
                        MAX(indicateurs_2[05]),
                        MAX(indicateurs_2[06]),
                        MAX(indicateurs_2[07]),
                        MAX(indicateurs_2[08]),
                        MAX(indicateurs_2[09]),
                        MAX(indicateurs_2[10]),
                        MAX(indicateurs_2[11]),
                        MAX(indicateurs_2[12]),
                        MAX(indicateurs_2[13]),
                        MAX(indicateurs_2[14]),
                        MAX(indicateurs_2[15]),
                        MAX(indicateurs_2[16]),
                        MAX(indicateurs_2[17]),
                        MAX(indicateurs_2[18]),
                        MAX(indicateurs_2[19]),
                        MAX(indicateurs_2[20]),
                        MAX(indicateurs_b[01]),
                        MAX(indicateurs_b[02]),
                        MAX(indicateurs_b[03]),
                        MAX(indicateurs_b[04]),
                        MAX(indicateurs_b[05]),
                        MAX(indicateurs_b[06]),
                        MAX(indicateurs_b[07]),
                        MAX(indicateurs_b[08]),
                        MAX(indicateurs_b[09]),
                        MAX(indicateurs_b[10]),
                        MAX(indicateurs_b[11]),
                        MAX(indicateurs_b[12]),
                        MAX(indicateurs_b[13]),
                        MAX(indicateurs_b[14]),
                        MAX(indicateurs_b[15]),
                        MAX(indicateurs_b[16]),
                        MAX(indicateurs_b[17]),
                        MAX(indicateurs_b[18]),
                        MAX(indicateurs_b[19]),
                        MAX(indicateurs_b[20])
                    FROM ACTI000029_ALL
                    GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13
					ORDER BY labelt,oidt,code1,oid1,code2,oid2,code3,oid3;

				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="IN01" />
					<FIELD name="IN02" />
					<FIELD name="IN03" />
					<FIELD name="IN04" />
					<FIELD name="IN05" />
					<FIELD name="IN06" />
					<FIELD name="IN07" />
					<FIELD name="IN08" />
					<FIELD name="IN09" />
					<FIELD name="IN10" />
					<FIELD name="IN11" />
					<FIELD name="IN12" />
					<FIELD name="IN13" />
					<FIELD name="IN14" />
					<FIELD name="IN15" />
					<FIELD name="IN16" />
					<FIELD name="IN17" />
					<FIELD name="IN18" />
					<FIELD name="IN19" />
					<FIELD name="IN20" />
                    <FIELD name="IN01P" />
					<FIELD name="IN02P" />
					<FIELD name="IN03P" />
					<FIELD name="IN04P" />
					<FIELD name="IN05P" />
					<FIELD name="IN06P" />
					<FIELD name="IN07P" />
					<FIELD name="IN08P" />
					<FIELD name="IN09P" />
					<FIELD name="IN10P" />
					<FIELD name="IN11P" />
					<FIELD name="IN12P" />
					<FIELD name="IN13P" />
					<FIELD name="IN14P" />
					<FIELD name="IN15P" />
					<FIELD name="IN16P" />
					<FIELD name="IN17P" />
					<FIELD name="IN18P" />
					<FIELD name="IN19P" />
					<FIELD name="IN20P" />
                    <FIELD name="IN01B" />
					<FIELD name="IN02B" />
					<FIELD name="IN03B" />
					<FIELD name="IN04B" />
					<FIELD name="IN05B" />
					<FIELD name="IN06B" />
					<FIELD name="IN07B" />
					<FIELD name="IN08B" />
					<FIELD name="IN09B" />
					<FIELD name="IN10B" />
					<FIELD name="IN11B" />
					<FIELD name="IN12B" />
					<FIELD name="IN13B" />
					<FIELD name="IN14B" />
					<FIELD name="IN15B" />
					<FIELD name="IN16B" />
					<FIELD name="IN17B" />
					<FIELD name="IN18B" />
					<FIELD name="IN19B" />
					<FIELD name="IN20B" />
				</FIELDS>
			</SQL>
			
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[	
				
					SELECT * FROM activite.cti_prepare_rapport([RAPPORT]) AS (name text, value text)

				]]></select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL select="SELECT 'WPERIODE_D', (date '[PERIODE]' + interval '1 day' - interval '1 year' - interval '1 day')::date
						UNION ALL
							SELECT 'WPERIODE_2_D', (date '[PERIODE]' + interval '1 day' - interval '2 year' - interval '1 day')::date
						UNION ALL
							SELECT 'WTOPERIODE_D', (date '[TOPERIODE]' + interval '1 day' - interval '1 year' - interval '1 day')::date
						UNION ALL
							SELECT 'WTOPERIODE_2_D', (date '[TOPERIODE]' + interval '1 day' - interval '2 year' - interval '1 day')::date
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL select="SELECT 'PERIODE_D_LABEL', 
							CASE WHEN extract(day from p_calendrier.date) &gt; 1 THEN p_calendrier.texte_court ELSE p_calendrier_mois.texte_court END
							FROM base.p_calendrier, base.p_calendrier_mois 
							WHERE 
							p_calendrier.mois = p_calendrier_mois.mois 
							AND ((p_calendrier.date + interval '1 day' + interval '1 year' - interval '1 day')::date = '[PERIODE]' AND '[TYPE_COMPARAISON]' &lt;&gt; 'S'
							OR
								p_calendrier.date = '[PERIODE_D]' AND '[TYPE_COMPARAISON]' = 'S')
						UNION ALL
						SELECT 'PERIODE_2_D_LABEL', 
							CASE WHEN extract(day from p_calendrier.date) &gt; 1 THEN p_calendrier.texte_court ELSE p_calendrier_mois.texte_court END
							FROM base.p_calendrier, base.p_calendrier_mois 
							WHERE 
							p_calendrier.mois = p_calendrier_mois.mois 
							AND (p_calendrier.date + interval '1 day' + interval '2 year' - interval '1 day')::date = '[PERIODE]'
								
						UNION ALL
							SELECT 'TOPERIODE_D_LABEL', 
							CASE WHEN dernier_jour = '1' THEN p_calendrier_mois.texte_court ELSE p_calendrier.texte_court END
							FROM base.p_calendrier, base.p_calendrier_mois 
							WHERE 
							p_calendrier.mois = p_calendrier_mois.mois 
							AND 
								((p_calendrier.date + interval '1 day' + interval '1 year' - interval '1 day')::date = '[TOPERIODE]' AND '[TYPE_COMPARAISON]' &lt;&gt; 'S'
							OR
								p_calendrier.date = '[TOPERIODE_D]' AND '[TYPE_COMPARAISON]' = 'S')
						UNION ALL
							SELECT 'TOPERIODE_2_D_LABEL', 
							CASE WHEN dernier_jour = '1' THEN p_calendrier_mois.texte_court ELSE p_calendrier.texte_court END
							FROM base.p_calendrier, base.p_calendrier_mois 
							WHERE 
							p_calendrier.mois = p_calendrier_mois.mois 
							AND (p_calendrier.date + interval '1 day' + interval '2 year' - interval '1 day')::date = '[TOPERIODE]'
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
            
            <SQL>
				<select><![CDATA[	
				
					SELECT 'JOUROUVRE_LABEL',
					SUM(CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN nb_jour_ouvre ELSE 0 END) || ' jours ouvrés (N-1=' ||
					SUM(CASE WHEN date BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' THEN nb_jour_ouvre ELSE 0 END) || ' budget=' ||
					SUM(CASE WHEN date BETWEEN '[PERIODE]' AND date(date_trunc('month','[TOPERIODE]'::date)+ interval '1 month' - interval '1 day') THEN nb_jour_ouvre ELSE 0 END) || ')'
					FROM base.v_calendrier_indicateurs_1
					WHERE '[TYPE_COMPARAISON]' = '2B'
					UNION
					SELECT 'JOUROUVRE_LABEL',
					SUM(CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN nb_jour_ouvre ELSE 0 END) || ' jours ouvrés (N-1=' ||
					SUM(CASE WHEN date BETWEEN '[VIEW.WPERIODE_D]' AND '[VIEW.WTOPERIODE_D]' THEN nb_jour_ouvre ELSE 0 END) || ')'
					FROM base.v_calendrier_indicateurs_1
					WHERE '[TYPE_COMPARAISON]' = '2'
					UNION
					SELECT 'JOUROUVRE_LABEL',
					SUM(CASE WHEN date BETWEEN '[PERIODE]' AND '[TOPERIODE]' THEN nb_jour_ouvre ELSE 0 END) || ' jours ouvrés '
					FROM base.v_calendrier_indicateurs_1
					WHERE '[TYPE_COMPARAISON]' NOT IN  ('2','2B')

				]]></select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
		</VIEWLINKS>
		<ONGLET label="Onglet" multiTab="true" >
		
			
			<DATAGRID 	title="" 
						total="true" 
						headerHeight="54" 
						selectRowInRows="= ROW.OID == '-9999997'" 
						otherRowInRows="= ROW.OID == '-9999998'" 
						totalRowInRows="= ROW.OID == '-9999999'"
						variableRowHeight="true" 
						sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'"> 
				
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<HEADERROWSTYLE name="textAlign" value="center"/>
				<COLUMN dataField="OID"
					type="Number"
					visible="false" />
				<COLUMN dataField="COD" 
					type="Char" 
					width="60"
					outputFormat="#"
					headerText="Code" 
					textAlign="left" 
					totalComplement="*ROW">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" 
					type="Char" 
					minWidth="110"
					headerText="Texte" 
					textAlign="left" 
					totalComplement="*ROW"/>
				<COLUMN dataField="IN01" 
					width="= Number(VIEW.IW1)" 
					type="Number" 
					outputFormat="= VIEW.IO1" 
					fixed="false" 
					visibleCondition="VIEW.IC1 != null" 
					headerText="VIEW.IH1 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN01B" 
					width="= Number(VIEW.IW1)" 
					type="Number" 
					outputFormat="= VIEW.IO1" 
					fixed="false" 
					visibleCondition="VIEW.IC1 != null &amp;&amp; VIEW.QB01 == '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH1 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN01P" 
					width="= Number(VIEW.IW1)" 
					type="Number" 
					outputFormat="= VIEW.IO1" 
					fixed="false" 
					visibleCondition="VIEW.IC1 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH1 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN02" 
					width="= Number(VIEW.IW2)" 
					type="Number" 
					outputFormat="= VIEW.IO2" 
					fixed="false" 
					visibleCondition="VIEW.IC2 != null" 
					headerText="VIEW.IH2 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN02B" 
					width="= Number(VIEW.IW2)" 
					type="Number" 
					outputFormat="= VIEW.IO2" 
					fixed="false" 
					visibleCondition="VIEW.IC2 != null &amp;&amp; VIEW.QB02 == '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH2 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN02P" 
					width="= Number(VIEW.IW2)" 
					type="Number" 
					outputFormat="= VIEW.IO2" 
					fixed="false" 
					visibleCondition="VIEW.IC2 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH2 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN03" 
					width="= Number(VIEW.IW3)" 
					type="Number" 
					outputFormat="= VIEW.IO3" 
					fixed="false" 
					visibleCondition="VIEW.IC3 != null" 
					headerText="VIEW.IH3 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN03B" 
					width="= Number(VIEW.IW3)" 
					type="Number" 
					outputFormat="= VIEW.IO3" 
					fixed="false" 
					visibleCondition="VIEW.IC3 != null &amp;&amp; VIEW.QB03 == '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH3 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN03P" 
					width="= Number(VIEW.IW3)" 
					type="Number" 
					outputFormat="= VIEW.IO3" 
					fixed="false" 
					visibleCondition="VIEW.IC3 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH3 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN04" 
					width="= Number(VIEW.IW4)" 
					type="Number" 
					outputFormat="= VIEW.IO4" 
					fixed="false" 
					visibleCondition="VIEW.IC4 != null" 
					headerText="VIEW.IH4 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN04B" 
					width="= Number(VIEW.IW4)" 
					type="Number" 
					outputFormat="= VIEW.IO4" 
					fixed="false" 
					visibleCondition="VIEW.IC4 != null &amp;&amp; VIEW.QB04 == '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH4 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN04P" 
					width="= Number(VIEW.IW4)" 
					type="Number" 
					outputFormat="= VIEW.IO4" 
					fixed="false" 
					visibleCondition="VIEW.IC4 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH4 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN05" 
					width="= Number(VIEW.IW5)" 
					type="Number" 
					outputFormat="= VIEW.IO5" 
					fixed="false" 
					visibleCondition="VIEW.IC5 != null" 
					headerText="VIEW.IH5 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN05B" 
					width="= Number(VIEW.IW5)" 
					type="Number" 
					outputFormat="= VIEW.IO5" 
					fixed="false" 
					visibleCondition="VIEW.IC5 != null &amp;&amp; VIEW.QB05 == '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH5 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN05P" 
					width="= Number(VIEW.IW5)" 
					type="Number" 
					outputFormat="= VIEW.IO5" 
					fixed="false" 
					visibleCondition="VIEW.IC5 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH5 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN06" 
					width="= Number(VIEW.IW6)" 
					type="Number" 
					outputFormat="= VIEW.IO6" 
					fixed="false" 
					visibleCondition="VIEW.IC6 != null" 
					headerText="VIEW.IH6 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN06B" 
					width="= Number(VIEW.IW6)" 
					type="Number" 
					outputFormat="= VIEW.IO6" 
					fixed="false" 
					visibleCondition="VIEW.IC6 != null &amp;&amp; VIEW.QB06 == '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH6 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN06P" 
					width="= Number(VIEW.IW6)" 
					type="Number" 
					outputFormat="= VIEW.IO6" 
					fixed="false" 
					visibleCondition="VIEW.IC6 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH6 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN07" 
					width="= Number(VIEW.IW7)" 
					type="Number" 
					outputFormat="= VIEW.IO7" 
					fixed="false" 
					visibleCondition="VIEW.IC7 != null" 
					headerText="VIEW.IH7 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN07B" 
					width="= Number(VIEW.IW7)" 
					type="Number" 
					outputFormat="= VIEW.IO7" 
					fixed="false" 
					visibleCondition="VIEW.IC7 != null &amp;&amp; VIEW.QB07 = '1' &amp;&amp; VIEW.B != ''" 
					headerText="VIEW.IH7 + VIEW.B" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN07P" 
					width="= Number(VIEW.IW7)" 
					type="Number" 
					outputFormat="= VIEW.IO7" 
					fixed="false" 
					visibleCondition="VIEW.IC7 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH7 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN08" 
					width="= Number(VIEW.IW8)" 
					type="Number" 
					outputFormat="= VIEW.IO8" 
					fixed="false" 
					visibleCondition="VIEW.IC8 != null" 
					headerText="VIEW.IH8 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN08P" 
					width="= Number(VIEW.IW8)" 
					type="Number" 
					outputFormat="= VIEW.IO8" 
					fixed="false" 
					visibleCondition="VIEW.IC8 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH8 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN09" 
					width="= Number(VIEW.IW9)" 
					type="Number" 
					outputFormat="= VIEW.IO9" 
					fixed="false" 
					visibleCondition="VIEW.IC9 != null" 
					headerText="VIEW.IH9 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN09P" 
					width="= Number(VIEW.IW9)" 
					type="Number" 
					outputFormat="= VIEW.IO9" 
					fixed="false" 
					visibleCondition="VIEW.IC9 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH9 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN10" 
					width="= Number(VIEW.IW10)" 
					type="Number" 
					outputFormat="= VIEW.IO10" 
					fixed="false" 
					visibleCondition="VIEW.IC10 != null" 
					headerText="VIEW.IH10 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN10P" 
					width="= Number(VIEW.IW10)" 
					type="Number" 
					outputFormat="= VIEW.IO10" 
					fixed="false" 
					visibleCondition="VIEW.IC10 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH10 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN11" 
					width="= Number(VIEW.IW11)" 
					type="Number" 
					outputFormat="= VIEW.IO11" 
					fixed="false" 
					visibleCondition="VIEW.IC11 != null" 
					headerText="VIEW.IH11 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN11P" 
					width="= Number(VIEW.IW11)" 
					type="Number" 
					outputFormat="= VIEW.IO11" 
					fixed="false" 
					visibleCondition="VIEW.IC11 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH11 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN12" 
					width="= Number(VIEW.IW12)" 
					type="Number" 
					outputFormat="= VIEW.IO12" 
					fixed="false" 
					visibleCondition="VIEW.IC12 != null" 
					headerText="VIEW.IH12 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                 <COLUMN dataField="IN12P" 
					width="= Number(VIEW.IW12)" 
					type="Number" 
					outputFormat="= VIEW.IO12" 
					fixed="false" 
					visibleCondition="VIEW.IC12 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH12 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN13" 
					width="= Number(VIEW.IW13)" 
					type="Number" 
					outputFormat="= VIEW.IO13" 
					fixed="false" 
					visibleCondition="VIEW.IC13 != null" 
					headerText="VIEW.IH13 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN13P" 
					width="= Number(VIEW.IW13)" 
					type="Number" 
					outputFormat="= VIEW.IO13" 
					fixed="false" 
					visibleCondition="VIEW.IC13 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH13 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN14" 
					width="= Number(VIEW.IW14)" 
					type="Number" 
					outputFormat="= VIEW.IO14" 
					fixed="false" 
					visibleCondition="VIEW.IC14 != null" 
					headerText="VIEW.IH14 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN14P" 
					width="= Number(VIEW.IW14)" 
					type="Number" 
					outputFormat="= VIEW.IO14" 
					fixed="false" 
					visibleCondition="VIEW.IC14 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH14 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN15" 
					width="= Number(VIEW.IW15)" 
					type="Number" 
					outputFormat="= VIEW.IO15" 
					fixed="false" 
					visibleCondition="VIEW.IC15 != null" 
					headerText="VIEW.IH15 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN15P" 
					width="= Number(VIEW.IW15)" 
					type="Number" 
					outputFormat="= VIEW.IO15" 
					fixed="false" 
					visibleCondition="VIEW.IC15 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH15 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN16" 
					width="= Number(VIEW.IW16)" 
					type="Number" 
					outputFormat="= VIEW.IO16" 
					fixed="false" 
					visibleCondition="VIEW.IC16 != null" 
					headerText="VIEW.IH16 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN16P" 
					width="= Number(VIEW.IW16)" 
					type="Number" 
					outputFormat="= VIEW.IO16" 
					fixed="false" 
					visibleCondition="VIEW.IC16 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH16 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN17" 
					width="= Number(VIEW.IW17)" 
					type="Number" 
					outputFormat="= VIEW.IO17" 
					fixed="false" 
					visibleCondition="VIEW.IC17 != null" 
					headerText="VIEW.IH17 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN17P" 
					width="= Number(VIEW.IW17)" 
					type="Number" 
					outputFormat="= VIEW.IO17" 
					fixed="false" 
					visibleCondition="VIEW.IC17 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH17 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN18" 
					width="= Number(VIEW.IW18)" 
					type="Number" 
					outputFormat="= VIEW.IO18" 
					fixed="false" 
					visibleCondition="VIEW.IC18 != null" 
					headerText="VIEW.IH18 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN18P" 
					width="= Number(VIEW.IW18)" 
					type="Number" 
					outputFormat="= VIEW.IO18" 
					fixed="false" 
					visibleCondition="VIEW.IC18 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH18 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN19" 
					width="= Number(VIEW.IW19)" 
					type="Number" 
					outputFormat="= VIEW.IO19" 
					fixed="false" 
					visibleCondition="VIEW.IC19 != null" 
					headerText="VIEW.IH19 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN19P" 
					width="= Number(VIEW.IW19)" 
					type="Number" 
					outputFormat="= VIEW.IO19" 
					fixed="false" 
					visibleCondition="VIEW.IC19 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH19 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				<COLUMN dataField="IN20" 
					width="= Number(VIEW.IW20)" 
					type="Number" 
					outputFormat="= VIEW.IO20" 
					fixed="false" 
					visibleCondition="VIEW.IC20 != null" 
					headerText="VIEW.IH20 + VIEW.N" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
                <COLUMN dataField="IN20P" 
					width="= Number(VIEW.IW20)" 
					type="Number" 
					outputFormat="= VIEW.IO20" 
					fixed="false" 
					visibleCondition="VIEW.IC20 != null &amp;&amp; VIEW.N1 != ''" 
					headerText="VIEW.IH20 + VIEW.N1" 
					headerTextCalc="true" 
					textAlign="right" 
					totalFunction="sum" 
					otherFunction="" 
					/>
				
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
