<?xml version="1.0" encoding="ISO-8859-15"?>
<GLOBALS
	name="ECO_globals"
	database="iCTI"
	softCode="iCTI_eco"
	>
	

	<LISTPROVIDERS>

		<LISTPROVIDER name="ALIAS_PERIODE" tree="true">
            <OPTION label="Saisie période" data="-1" treeLevel="1" />
            <OPTION dataLink="ALIAS_PERIODE" treeLevelField="lvl" dataField="cod" data2Field="deb" data3Field="fin" labelField="txt" />
        </LISTPROVIDER>        
				
		<LISTPROVIDER name="PERIODE_DEBUT" tree="true">
			<OPTION dataLink="PERIODE_DEBUT" dataField="cod" aliasField="alias" labelField="txt"  treeLevelField="lvl" />
		</LISTPROVIDER>
		<LISTPROVIDER name="PERIODE_FIN" tree="true">
			<OPTION dataLink="PERIODE_FIN" dataField="cod"  aliasField="alias" labelField="txt" treeLevelField="lvl" />
		</LISTPROVIDER>
		
		
		<LISTPROVIDER name="ARTICLE_GROUPBY" tree="true" >
			<OPTION label="Articles" data="ART" treeLevel="1"  />
			<OPTION label="Référence Articles CACIC" data="RA1" treeLevel="2"  />
			<OPTION label="Référence Articles Etablissement" data="RA9" treeLevel="2"  />
			<OPTION dataLink="ARTICLE_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
			<OPTION label="Articles (ref fournisseur)" data="ARF" treeLevel="2"  />
			<OPTION label="Type article CTI" data="TAC" treeLevel="2"  />
			<OPTION label="[DICT.ECO.TYPE_ARTICLE#3] (source)" data="TYA" treeLevel="2"  />
			<OPTION label="UCD" data="UCD" treeLevel="2"  />
			<OPTION label="UCD7" data="UCD" treeLevel="3"  />
			<OPTION label="UCD13" data="UCD13" treeLevel="3"  />
			<OPTION dataLink="UCD_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
			<OPTION label="LPP" data="LPP" treeLevel="2"  />
			<OPTION dataLink="LPP_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
			<OPTION label="ATC/CLADIMED" data="ATC" treeLevel="2"  />
			<OPTION label="ATC/CLADIMED. (1)" data="ATC1" treeLevel="3"  />
			<OPTION label="ATC/CLADIMED. (2)" data="ATC2" treeLevel="3"  />
			<OPTION label="ATC/CLADIMED. (3)" data="ATC3" treeLevel="3"  />
			<OPTION label="ATC/CLADIMED. (4)" data="ATC4" treeLevel="3"  />
			<OPTION label="[DICT.ECO.FAMILLE#3]" data="FAA" treeLevel="2" visible="= VIEW.FAA_VISIBLE == '1'" />
			<OPTION label="[DICT.ECO.SOUS_FAMILLE#3]" data="SFA" treeLevel="2"  />
			<OPTION label="[DICT.ECO.CATEGORIE#3]" data="CAA" treeLevel="2"  />
			<OPTION label="[DICT.ECO.SOUS_CATEGORIE#3]" data="SCA" treeLevel="2"  />
			<OPTION label="[DICT.ECO.UNITE#3]" data="USD" treeLevel="2"  />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="DATE_GROUPBY" tree="true" >
			<OPTION label="Année-Mois" data="AMDEF" treeLevel="1" />
			<OPTION label="Année-Trimestre" data="ATRIMDEF" treeLevel="2" />
			<OPTION label="Année" data="ADEF" treeLevel="2" />
			<OPTION label="Trimestre" data="TRIMDEF" treeLevel="2" />	
			<OPTION label="Mois" data="MDEF" treeLevel="2" />
			<OPTION label="Jour" data="JDEF" treeLevel="2" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="DATECMD_GROUPBY" tree="true" >
			<OPTION label="Année-Mois commande" data="AMCMD" treeLevel="1" />
			<OPTION label="Année-Trimestre commande" data="ATRIMCMD" treeLevel="2" />
			<OPTION label="Année commande" data="ACMD" treeLevel="2" />
			<OPTION label="Trimestre commande" data="TRIMCMD" treeLevel="2" />	
			<OPTION label="Mois commande" data="MCMD" treeLevel="2" />
			<OPTION label="Jour commande" data="JCMD" treeLevel="2" />
		</LISTPROVIDER>
		<LISTPROVIDER name="DATEENG_GROUPBY" tree="true" >
			<OPTION label="Année-Mois engagement" data="AMENG" treeLevel="1" />
			<OPTION label="Année-Trimestre engagement" data="ATRIMENG" treeLevel="2" />
			<OPTION label="Année engagement" data="AENG" treeLevel="2" />
			<OPTION label="Trimestre engagement" data="TRIMENG" treeLevel="2" />	
			<OPTION label="Mois engagement" data="MENG" treeLevel="2" />
			<OPTION label="Jour engagement" data="JENG" treeLevel="2" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="COMPTE_ARTICLE_GROUPBY" tree="true" >
			<OPTION label="Compte" data="CPA" treeLevel="1"  />
			<OPTION dataLink="COMPTE_ARTICLE_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="FOURNISSEUR_GROUPBY" tree="true" >
			<OPTION label="Fournisseurs" data="FOU" treeLevel="1"  />
			<OPTION label="Référence Fournisseurs CACIC" data="RF1" treeLevel="2"  />
			<OPTION label="Référence Fournisseurs Etablissement" data="RF9" treeLevel="2"  />
			<OPTION dataLink="FOURNISSEUR_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
			<OPTION label="Types fournisseur" data="TYF" treeLevel="2"  />
		</LISTPROVIDER>
        
        <LISTPROVIDER name="SITE_GROUPBY" tree="true" >
			<OPTION label="[DICT.ECO.SITE#1]" data="SIT" treeLevel="1"  />
			<OPTION dataLink="SITE_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="GESTIONNAIRE_GROUPBY" tree="true" >
			<OPTION label="[DICT.ECO.GESTIONNAIRE#1]" data="GES" treeLevel="1"  />
			<OPTION dataLink="GESTIONNAIRE_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="LIEU_GROUPBY" tree="true" >
			<OPTION label="[DICT.ECO.LIEU#1]" data="LIE" treeLevel="1"  />
			<OPTION dataLink="LIEU_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="UCD_MOUVEMENT_GROUPBY" tree="true" >
			<OPTION label="UCD" data="UCM" treeLevel="1"  />
			<OPTION dataLink="UCM_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="LPP_MOUVEMENT_GROUPBY" tree="true" >
			<OPTION label="LPP" data="LPM" treeLevel="1"  />
			<OPTION dataLink="LPM_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>

		<LISTPROVIDER name="TYPE_MOUVEMENT_GROUPBY" tree="true" >
			<OPTION label="Type mouvement" data="TYM" treeLevel="1"  />
			<OPTION dataLink="TYPE_MOUVEMENT_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
        
        <LISTPROVIDER name="POLE_GROUPBY" tree="true" >
			<OPTION label="Pole" data="POL" treeLevel="1"  />
			<OPTION dataLink="POL_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="UNITE_FONCTIONNELLE_GROUPBY" tree="true" >
			<OPTION label="[DICT.ECO.UF#1]" data="UFO" treeLevel="1"  />
			<OPTION dataLink="UNITE_FONCTIONNELLE_CLASSES" dataField="cod" labelField="txt" treeLevelField="lvl" data2Field="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="PROVIDER_GROUPBY" tree="true" >
			<OPTION label="Source de données" data="PVD" treeLevel="1"  />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION label="Saisie texte"  data="T*" treeLevel="1"  />
			<OPTION dataLink="ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="TAC" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="TAC" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="TYPE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="TYPE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="ATC" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="ATC" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="COMPTE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="COMPTE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="FAMILLE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="FAMILLE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="SOUS_FAMILLE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="SOUS_FAMILLE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" />
		</LISTPROVIDER>
		<LISTPROVIDER name="CATEGORIE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="CATEGORIE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="SOUS_CATEGORIE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="SOUS_CATEGORIE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="UNITE_STOCKAGE_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="UNITE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="UNITE_APPROVISIONNEMENT_ARTICLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="UNITE_ARTICLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="REF_ARTICLE_CTI" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION label="Saisie texte"  data="T*" treeLevel="1"  />
			<OPTION dataLink="REF_ARTICLE_CTI" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="REF_ARTICLE_FOU" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION label="Saisie texte"  data="T*" treeLevel="1"  />
		</LISTPROVIDER>
		<LISTPROVIDER name="FOURNISSEUR" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION label="Saisie texte"  data="T*" treeLevel="1"  />
			<OPTION dataLink="FOURNISSEUR" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="TYPE_FOURNISSEUR" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="TYPE_FOURNISSEUR" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		
		<LISTPROVIDER name="REF_FOURNISSEUR_CTI" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION label="Saisie texte"  data="T*" treeLevel="1"  />
			<OPTION dataLink="REF_FOURNISSEUR_CTI" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
        
		<LISTPROVIDER name="SITE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="SITE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="GESTIONNAIRE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="GESTIONNAIRE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="LIEU_MOUVEMENT" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="LIEU_MOUVEMENT" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="LIEU_COMMANDE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="LIEU_COMMANDE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
        <LISTPROVIDER name="POLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="POLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="UNITE_FONCTIONNELLE" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="UNITE_FONCTIONNELLE" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="SENS_MOUVEMENT" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Entrée"  data="E" treeLevel="1"  />
			<OPTION label="Sortie"  data="S" treeLevel="1"  />
		</LISTPROVIDER>
		<LISTPROVIDER name="UCD" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Hors UCD" data="H*" treeLevel="1"  />
			<OPTION label="Saisie code" data="C*" treeLevel="1"  />
			<OPTION dataLink="UCD" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="TYPE_UCD" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Médicaments en SUS" data="SUS" treeLevel="1"  />
			<OPTION label="Inclus dans GHM" data="INC" treeLevel="1"  />
			<OPTION label="Médicaments en SUS (facture)" data="FSUS" treeLevel="1"  />
			<OPTION label="Inclus dans GHM (facture)" data="FINC" treeLevel="1"  />
			<OPTION label="Inclus dans GHM (valorisé)" data="FINC" treeLevel="1"  />
		</LISTPROVIDER>

		<LISTPROVIDER name="LPP" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Hors LPP" data="H*" treeLevel="1"  />
			<OPTION label="Saisie code" data="C*" treeLevel="1"  />
			<OPTION dataLink="LPP" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="TYPE_LPP" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="LPP Liste en sus" data="SUS" treeLevel="1"  />
			<OPTION label="Inclus dans GHM" data="INC" treeLevel="1"  />
			<OPTION label="LPP Liste en sus (facture)" data="FSUS" treeLevel="1"  />
			<OPTION label="Inclus dans GHM (facture)" data="FINC" treeLevel="1"  />
			<OPTION label="Inclus dans GHM (valorisé)" data="VINC" treeLevel="1"  />
		</LISTPROVIDER>

		<LISTPROVIDER name="TYPE_MOUVEMENT" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="TYPE_MOUVEMENT" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="ETAT_LIVRAISON" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Livraison totale"  data="T" treeLevel="1"  />
			<OPTION label="Livraison supérieure à la commande"  data="S" treeLevel="1"  />
			<OPTION label="Aucune livraison ou livraison partielle"  data="NP" treeLevel="1"  />
			<OPTION label="Livraison partielle"  data="P" treeLevel="1"  />
			<OPTION label="Aucune livraison"  data="N" treeLevel="1"  />
		</LISTPROVIDER>
		<LISTPROVIDER name="ETAT_LIQUIDATION" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Liquidation totale"  data="T" treeLevel="1"  />
			<OPTION label="Aucune Liquidation ou Liquidation partielle"  data="NP" treeLevel="1"  />
			<OPTION label="Liquidation partielle"  data="P" treeLevel="1"  />
			<OPTION label="Aucune Liquidation"  data="N" treeLevel="1"  />
		</LISTPROVIDER>
		<LISTPROVIDER name="PROVIDER" tree="true">
			<OPTION label="Pas de sélection"  data="-1" treeLevel="1"  />
			<OPTION label="Saisie code"  data="C*" treeLevel="1"  />
			<OPTION dataLink="PROVIDER" dataField="cod" labelField="txt" treeLevelField="lvl" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="DATA_AP_IND" tree="true">
			<OPTION dataLink="INDICATEURS" dataField="code" data2Field="desc"  data3Field="width"  data4Field="output" data5Field="query" data6Field="oid" labelField="txt" treeLevelField="lvl" />
		</LISTPROVIDER>
		<LISTPROVIDER name="MEDECIN" tree="true">
			<OPTION label="Pas de sélection" treeLevel="1" data="-1" />
			<!-- <OPTION label="Saisie code" data="C*" treeLevel="1" /> -->
			<OPTION dataLink="MEDECINS" treeLevelField="lvl" dataField="cod" labelField="txt" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="SPECIALITE" tree="true">
			<OPTION label="Pas de sélection" treeLevel="1" data="-1" />
			<!-- <OPTION label="Saisie code" data="C*" treeLevel="1" /> -->
			<OPTION dataLink="SPECIALITES" treeLevelField="lvl" dataField="cod" labelField="txt" ctiField="cti" />
		</LISTPROVIDER>
		<LISTPROVIDER name="DATA_LISTE_IND" tree="true">
			<OPTION dataLink="INDICATEURS_LISTE" dataField="code" labelField="txt" treeLevelField="lvl" ctiField="cti" data2Field="list" data6Field="oid" />
		</LISTPROVIDER>	
        <LISTPROVIDER name="DATA_EC" tree="true">
           	<OPTION label="Ratio" data="4.2" data4="#,0%" data6="Représentation en % des chiffres de la colonne précédente" treeLevel="1"/>
			<OPTION label="% Total" data="4.2" data4="#,0%" data6="Représentation en % des chiffres de la colonne précédente" treeLevel="2"/>
			<OPTION label="Ecart en nbre" data="4.3" data4="#,0" data6="Ecart en nombre entre les deux colonnes précédentes" treeLevel="2"/>
			<OPTION label="Ecart en %" data="4.4" data4="#,0%" data6="Ecart en % entre les deux colonnes précédentes" treeLevel="2"/>
        </LISTPROVIDER>
	</LISTPROVIDERS>

	<QUERIES>
		<QUERY type="comboLink" name="ALIAS_PERIODE"> 
            <SQL><select><![CDATA[

                select
                    tri,
                    lvl,
                    txt,
                    cod,
                    deb,
                    fin
                from eco.v_alias_periode_1

                ]]></select>
                <FIELDS>
                    <FIELD name="tri" />
                    <FIELD name="lvl" />
                    <FIELD name="txt" />
                    <FIELD name="cod" />
                    <FIELD name="deb" />
                    <FIELD name="fin" />
                </FIELDS>
            </SQL>
        </QUERY>  
		
		<QUERY type="comboLink" name="PERIODE_DEBUT" > 
			<SQL select="(
				SELECT p_calendrier.date, p_calendrier_mois.texte , p_calendrier_mois.mois::text as alias, p_calendrier_mois.mois::text, 2
				FROM eco.p_chiffrier_production 
					JOIN base.p_calendrier_mois ON (p_chiffrier_production.mois = p_calendrier_mois.mois)
					JOIN base.p_calendrier ON (p_calendrier_mois.mois = p_calendrier.mois AND extract (day from p_calendrier.date) = 1)
				GROUP BY 1,2,3,4,5
				)
				UNION ALL
				(
				SELECT min(p_calendrier.date), p_calendrier_mois.annee::text,min(p_calendrier_mois.annee::text||'01'::text), min(p_calendrier_mois.annee::text||'99'::text), 1
				FROM eco.p_chiffrier_production 
					JOIN base.p_calendrier_mois ON (p_chiffrier_production.mois = p_calendrier_mois.mois)
					JOIN base.p_calendrier ON (p_calendrier_mois.mois = p_calendrier.mois AND extract (day from p_calendrier.date) = 1)
				GROUP BY 2,5
				)
				UNION ALL
				(
				SELECT p_calendrier.date, p_calendrier.texte::text, to_char(p_calendrier.date,'YYYYMMDD'), min(p_calendrier.mois::text), 3
				FROM eco.p_chiffrier_production 
					JOIN base.p_calendrier ON (p_chiffrier_production.mois = p_calendrier.mois)
				GROUP BY 1,2,3,5
				)
				ORDER BY 4 DESC, 1 ASC , 5 ASC" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="alias"/>
					<FIELD name="tri" />
					<FIELD name="lvl" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="PERIODE_FIN" > 
			<SQL select="(
				SELECT p_calendrier.date, p_calendrier_mois.texte, p_calendrier_mois.mois::text as alias, p_calendrier_mois.mois::text, 2
				FROM eco.p_chiffrier_production 
					JOIN base.p_calendrier_mois ON (p_chiffrier_production.mois = p_calendrier_mois.mois)
					JOIN base.p_calendrier ON (p_calendrier_mois.mois = p_calendrier.mois AND p_calendrier.dernier_jour = '1')
				GROUP BY 1,2,3,4
				)
				UNION ALL
				(
				SELECT max(p_calendrier.date), p_calendrier_mois.annee::text, max(p_calendrier_mois.annee::text||'12'::text) as alias , max(p_calendrier_mois.annee::text||'99'::text), 1
				FROM eco.p_chiffrier_production 
					JOIN base.p_calendrier_mois ON (p_chiffrier_production.mois = p_calendrier_mois.mois)
					JOIN base.p_calendrier ON (p_calendrier_mois.mois = p_calendrier.mois AND p_calendrier.dernier_jour = '1')
				GROUP BY 2,5
				)
				UNION ALL
				(
				SELECT p_calendrier.date, p_calendrier.texte::text, to_char(p_calendrier.date,'YYYYMMDD'), min(p_calendrier.mois::text), 3
				FROM eco.p_chiffrier_production 
					JOIN base.p_calendrier ON (p_chiffrier_production.mois = p_calendrier.mois)
				GROUP BY 1,2,3,5
				)
				ORDER BY 4 DESC, 5 ASC , 1 ASC" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="alias"/>
					<FIELD name="tri" />
					<FIELD name="lvl" />
				</FIELDS>
			</SQL>
		</QUERY>
		

		
		<QUERY type="comboLink" name="ARTICLE_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('ART', 'TYA', 'FAA', 'ATC', 'SFA', 'CAA', 'SCA', 'USD')
						
							ORDER BY 3
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="COMPTE_ARTICLE_CLASSES" > 
			<SQL select="SELECT 'CPACLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('CPT')

							ORDER BY 1
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="FOURNISSEUR_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('FOU')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
        
        <QUERY type="comboLink" name="SITE_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('SIT')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="GESTIONNAIRE_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('GES')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="LIEU_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('LIE')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		
		<QUERY type="comboLink" name="TYPE_MOUVEMENT_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('TYM')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="UCD_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '3', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('UCD')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="LPP_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '3', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('LPP')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
        
        <QUERY type="comboLink" name="POL_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('POL')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="UNITE_FONCTIONNELLE_CLASSES" > 
			<SQL select="SELECT t_listes_tables.code || 'CLS'::text || lpad(t_classes.sequence::text, 2, '0'::text), t_classes.texte, '2', is_cti
							FROM eco.t_classes, eco.t_listes_tables
							WHERE t_classes.table_id = t_listes_tables.oid AND t_listes_tables.code::text IN ('UFO')
							ORDER BY t_classes.texte
						" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		
		
		
		
		<QUERY type="comboLink" name="ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_articles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="TAC" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_type_article_cti_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="TYPE_ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_types_articles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="ATC" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_classification_atc_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="COMPTE_ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_compte_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="FAMILLE_ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_familles_articles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="SOUS_FAMILLE_ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level FROM eco.v_sous_familles_articles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="CATEGORIE_ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_categories_articles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="SOUS_CATEGORIE_ARTICLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_sous_categories_articles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="UNITE_ARTICLE" > 
			<SQL select="SELECT oid, texte, level, is_cti FROM eco.v_unites_stockage_articles_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="REF_ARTICLE_CTI" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_article_reference_cti_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="FOURNISSEUR" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_fournisseurs_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="TYPE_FOURNISSEUR" > 
			<SQL select="SELECT oid, texte, level, is_cti FROM eco.v_types_fournisseurs_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="comboLink" name="REF_FOURNISSEUR_CTI" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_fournisseur_reference_cti_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
        
        <QUERY type="comboLink" name="SITE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_sites_1
						
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="GESTIONNAIRE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_gestionnaires_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="LIEU_MOUVEMENT" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_lieux_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="LIEU_COMMANDE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_lieux_2
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="TYPE_MOUVEMENT" > 
			<SQL select="SELECT oid, texte, level, is_cti FROM eco.v_types_mouvements_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="UCD" > 
			<SQL select="SELECT oid, texte, level, is_cti FROM eco.v_ucd_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="LPP" > 
			<SQL select="SELECT oid, texte, level, is_cti FROM eco.v_lpp_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
        
        <QUERY type="comboLink" name="POLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_pole_2
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="UNITE_FONCTIONNELLE" > 
			<SQL>
				<select><![CDATA[
						SELECT oid, texte, level, is_cti FROM eco.v_unites_fonctionnelles_1
					]]>
				</select>
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		
		<QUERY type="comboLink" name="PROVIDER" > 
			<SQL select="SELECT oid, texte, level, is_cti FROM eco.v_providers_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="MEDECINS" > 
			<SQL select="SELECT 'DT' || medecin_id, medecin_texte, 1, 1 FROM eco.v_medecins_1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="SPECIALITE" > 
			<SQL select="SELECT 'DT' || specialite_id, specialite_texte, 1, 1 FROM eco.v_medecins_1 GROUP BY 1,2,3,4 ORDER BY 1" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="RAPPORTS" > 
			<SQL select="SELECT oid, texte FROM eco.t_rapports WHERE oid > 0 AND is_essentiel IS DISTINCT FROM '1' ORDER BY texte" >
				<FIELDS>
					<FIELD name="cod" />
					<FIELD name="txt" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="INDICATEURS">
			<SQL select="
				DROP TABLE IF EXISTS indicateurs_den;
				CREATE TEMP TABLE indicateurs_den AS
					SELECT t_indicateurs.oid
						,t_indicateurs.code
						,t_indicateurs.entete
						,t_indicateurs.description
						,replace(
							replace(t_indicateurs.total_function,'SUMFIRSTMONTH','SUM'),
							'SUMLASTMONTH','SUM'
							)
							|| '(' 
							|| regexp_replace(
								regexp_replace(
								t_indicateurs.column_name
							   , '\[LISTE:([^\]]*)\]', '(select to_id from eco.t_listes_contenu JOIN eco.t_listes on liste_id = t_listes.oid WHERE code = ''\1'')', 'g')
							   , '\[CLASSE:([^\:]*):([^\]]*)\]', '(select to_id from eco.t_classes JOIN eco.t_classes_sections on classe_id = t_classes.oid JOIN eco.t_classes_sections_elements ON section_id = t_classes_sections.oid WHERE t_classes.code = ''\1'' AND t_classes_sections.code = ''\2'')', 'g')
							|| ')' AS column_name
						,t_indicateurs.output_format
						,t_indicateurs.table_name
						,t_indicateurs.theme_id
					FROM eco.t_indicateurs
					WHERE total_function NOT IN ('*CALC','SEP')
						AND is_template != 1
						AND dimension_date = dimension_date_1
						;

				DROP TABLE IF EXISTS indicateurs;
				CREATE TEMP TABLE indicateurs AS
					SELECT t_indicateurs.oid
						,t_indicateurs.code
						,t_indicateurs.entete
						,t_indicateurs.description
						,t_indicateurs.width
						,regexp_replace(
								regexp_replace(
								t_indicateurs.column_name
							   , '\[LISTE:([^\]]*)\]', '(select to_id from eco.t_listes_contenu JOIN eco.t_listes on liste_id = t_listes.oid WHERE code = ''\1'')', 'g')
							   , '\[CLASSE:([^\:]*):([^\]]*)\]', '(select to_id from eco.t_classes JOIN eco.t_classes_sections on classe_id = t_classes.oid JOIN eco.t_classes_sections_elements ON section_id = t_classes_sections.oid WHERE t_classes.code = ''\1'' AND t_classes_sections.code = ''\2'')', 'g')
							AS column_name
						,replace(
							replace(t_indicateurs.total_function,'SUMFIRSTMONTH','SUM'),
							'SUMLASTMONTH','SUM'
							) as total_function
						,t_indicateurs.output_format
						,t_indicateurs.table_name
						,COALESCE(template.theme_id,t_indicateurs.theme_id) AS theme_id
					FROM eco.t_indicateurs
						LEFT JOIN eco.t_indicateurs template ON t_indicateurs.indicateur_template_id = template.oid
					WHERE t_indicateurs.total_function NOT IN ('*CALC','SEP')
						AND t_indicateurs.is_hide = 0
						AND COALESCE(template.is_hide,'0') = 0
						AND t_indicateurs.is_template != 1
						AND t_indicateurs.dimension_date = t_indicateurs.dimension_date_1
						;

				DROP TABLE IF EXISTS w_res;
				CREATE TEMP TABLE w_res AS
				SELECT indicateurs.code
					,entete
					,indicateurs.description
					,width
					,total_function || '(' || column_name || ')' as total_function
					,output_format
					,1 + COALESCE(level,lvl) as lvl
					,v_rapports_tables_indicateurs_1.oid + left(t_indicateur_theme.code,1)::int + 0.1 AS oid
				FROM indicateurs
					JOIN eco.v_rapports_tables_indicateurs_1 ON v_rapports_tables_indicateurs_1.code = table_name
					LEFT JOIN eco.t_indicateur_theme ON theme_id[1] = t_indicateur_theme.oid
				UNION
					SELECT ''
						,split_part(tables.texte,'(',1) AS entete
						,tables.texte
						,0
						,''
						,''
						,lvl
						,tables.oid
					FROM eco.v_rapports_tables_indicateurs_1 tables
						LEFT JOIN eco.t_indicateurs ON tables.code = table_name AND is_hide = 0
					WHERE tables.code != '*CALC'
					GROUP BY 1,2,3,4,5,6,7,8
					HAVING (count(t_indicateurs.code) > 0 OR lvl = 1)
				UNION
					SELECT ''
						,t_indicateur_theme.texte AS entete
						,t_indicateur_theme.texte
						,0
						,''
						,''
						,level
						,tables.oid::int + (left(t_indicateur_theme.code,1))::int
					FROM eco.t_indicateurs
						LEFT JOIN eco.t_indicateurs assoc ON t_indicateurs.indicateur_associe_1_id = assoc.oid
						JOIN eco.v_rapports_tables_indicateurs_1 tables ON tables.code = CASE WHEN t_indicateurs.table_name != '*CALC' THEN t_indicateurs.table_name ELSE assoc.table_name END AND t_indicateurs.is_hide = 0
						LEFT JOIN eco.t_indicateur_theme ON t_indicateurs.theme_id[1] = t_indicateur_theme.oid
					WHERE t_indicateur_theme.oid is not null
						AND t_indicateurs.code NOT LIKE '%#%'
					GROUP BY 1,2,3,4,5,6,7,8
					HAVING (count(t_indicateurs.code) > 0)
				UNION
					SELECT t_indicateurs.code
						,t_indicateurs.entete
						,t_indicateurs.description
						,t_indicateurs.width
						,replace(replace(replace(replace(replace(replace(t_indicateurs.column_name, '[1]', ind_1.column_name), '[5]', coalesce(ind_5.column_name, '')), '[4]', coalesce(ind_4.column_name, '')), '[3]', coalesce(ind_3.column_name, '')), '[2]', coalesce(ind_2.column_name, '')), '[1]', ind_1.column_name)
						,t_indicateurs.output_format
						,1 + COALESCE(level,lvl)
						,v_rapports_tables_indicateurs_1.oid + left(t_indicateur_theme.code,1)::int + 0.1 AS oid
					FROM eco.t_indicateurs
						LEFT JOIN eco.t_indicateur_theme ON theme_id[1] = t_indicateur_theme.oid
						LEFT JOIN eco.t_indicateurs template ON t_indicateurs.indicateur_template_id = template.oid
						LEFT JOIN indicateurs_den ind_1 ON t_indicateurs.indicateur_associe_1_id = ind_1.oid
						LEFT JOIN indicateurs_den ind_2 ON t_indicateurs.indicateur_associe_2_id = ind_2.oid
						LEFT JOIN indicateurs_den ind_3 ON t_indicateurs.indicateur_associe_3_id = ind_3.oid
						LEFT JOIN indicateurs_den ind_4 ON t_indicateurs.indicateur_associe_4_id = ind_4.oid
						LEFT JOIN indicateurs_den ind_5 ON t_indicateurs.indicateur_associe_5_id = ind_5.oid
						JOIN eco.v_rapports_tables_indicateurs_1 ON v_rapports_tables_indicateurs_1.code = ind_1.table_name
					WHERE t_indicateurs.table_name = '*CALC'
						AND t_indicateurs.total_function IN ('*CALC')
						AND t_indicateurs.is_hide = 0
						AND t_indicateurs.is_template != 1
						AND t_indicateurs.dimension_date = t_indicateurs.dimension_date_1
				ORDER BY oid,entete;

				UPDATE w_res
				SET code = '-' || sub.code
				FROM (SELECT oid,
					lead(code) OVER (ORDER BY oid) AS code,
					lead(description) OVER (ORDER BY oid) AS description,
					lead(width) OVER (ORDER BY oid) AS width,
					lead(total_function) OVER (ORDER BY oid) AS total_function,
					lead(output_format) OVER (ORDER BY oid) AS output_format 
					FROM w_res) sub
				WHERE w_res.oid = sub.oid AND w_res.code = '';

				SELECT * FROM w_res ORDER BY oid, entete;
				">
				<FIELDS>
					<FIELD name="code" />
					<FIELD name="txt" />
					<FIELD name="desc" />
					<FIELD name="width" />
					<FIELD name="query" />
					<FIELD name="output"/>
					<FIELD name="lvl" />
					<FIELD name="oid" />
				</FIELDS>
			</SQL>
		</QUERY>
		
		<QUERY type="comboLink" name="INDICATEURS_LISTE">
			<SQL select="
				  SELECT v_listes_1.code AS oid,
					v_listes_1.texte,
					v_listes_1.lvl AS level,
					CASE
							WHEN v_listes_1.is_cti = '1'::text OR v_listes_1.code ~~ 'CTI_%'::text THEN '1'::character(1)
							ELSE '0'::character(1)
						END AS is_cti,
					COALESCE(10*(ind_table_1.oid/10)::int,10*(v_rapports_tables_indicateurs_1.oid/10)::int) + 0.2 as oid,
					array_to_string(array_agg(t_indicateurs.code ORDER BY ctid),'|'),
					('0'::text || v_listes_1.sort) || chr(1) AS tri
				   FROM eco.v_listes_1
					LEFT JOIN (SELECT liste_id, to_id, ctid FROM eco.t_listes_contenu ORDER by ctid) t_listes_contenu ON v_listes_1.liste_id = t_listes_contenu.liste_id
					LEFT JOIN eco.t_indicateurs ON to_id = t_indicateurs.oid
					LEFT JOIN eco.v_rapports_tables_indicateurs_1 on table_name = v_rapports_tables_indicateurs_1.code
					
					LEFT JOIN eco.t_indicateurs ind_1 ON t_indicateurs.indicateur_associe_1_id = ind_1.oid
					LEFT JOIN eco.v_rapports_tables_indicateurs_1 ind_table_1 on ind_1.table_name = ind_table_1.code
					
				  WHERE v_listes_1.table_code = 'IND'::text AND v_listes_1.lvl != '0'::text
				  GROUP BY 1,2,3,4,5,7 
				  ORDER BY 7
">
				<FIELDS>
					<FIELD name="code" />
					<FIELD name="txt" />
					<FIELD name="lvl" />
					<FIELD name="cti" />
					<FIELD name="oid" />
					<FIELD name="list" />
					<FIELD name="tri" />
				</FIELDS>
			</SQL>
		</QUERY>
		
			

		
	</QUERIES>
	
	
	
</GLOBALS>

			
