<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="ECO000007" 
	label="ECO. Evolution mensuelle des commandes" 
	title="= SELECT.DATA01_LABEL + ' par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.DATE_BASE_LABEL + ' : ' +  SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'"
	database="iCTI" 
	swf="*CTI_view1" 
	globals="ECO_globals.XML" 
	componentsFile="ECO_components.XML"
	dboptimizer="ECO_dboptimizer.XML"
	softCode="iCTI_eco">	
	
	<VIEWPROPERTIES componentName="PROPERTIES_COMMANDES"/>
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY"/>
	<VIEWPROPERTIES componentName="PROPERTIES_DATA"/>
	
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
		<GROUP label="Période">
			<FIELD name="DATE_BASE" width="130" label="" UI="combo" default="CMD" default2="date_commande">
				<OPTION label="Date commande" data="CMD" data2="date_commande"/>
				<OPTION label="Date engagement" data="ENG" data2="date_engagement"/>
			</FIELD>
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="180" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="" UI="combo" tree="true" width="200" default="2010-01-01" globalListProvider="PERIODE_DEBUT">
			</FIELD>
			<FIELD name="TOPERIODE" label="au" UI="combo" tree="true" width="200" default="2010-01-31" globalListProvider="PERIODE_FIN">
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="PERIODICITE" label="Périodicité" width="200" UI="combo" default="MONTH">
				<OPTION label="Mensuelle" data="MONTH" />
				<OPTION label="Trimestrielle" data="QUARTER" />
				<OPTION label="Annuelle" data="YEAR" />
			</FIELD>
		</GROUP>
		<GROUP label="Données">
			<FIELD name="DATA01" label="" UI="combo" width="210" default="CTI_MTCOMTTC" tree="true" printable="false" visible="= 1=1" update="= if (SELECT.DATA015 == '' &amp;&amp; SELECT.DATA01.substr(0,1) == '-') {return SELECT.DATA01.substr(1)} else {return 'no_update'}">
				<OPTION label="Options" data="" globalListProvider="DATA_AP_IND" condition="dataItem.data6 &gt; 20 and dataItem.data6 &lt; 30"/>
			</FIELD>
		</GROUP>
		<GROUP label="Regroupement">
			<FIELD name="GROUPBY" label="" UI="combo" width="200" default="FOU" tree="true">
				<OPTION label="Article" data="ART" treeLevel="1"  globalListProvider="ARTICLE_GROUPBY"/>
				<OPTION label="Compte" data="CPA" treeLevel="1"  globalListProvider="COMPTE_ARTICLE_GROUPBY"/>
				<OPTION label="Fournisseur" data="FOU" treeLevel="1"  globalListProvider="FOURNISSEUR_GROUPBY"/>
				<OPTION label="Gestionnaire" data="GES" treeLevel="1"  globalListProvider="GESTIONNAIRE_GROUPBY"/>
				<OPTION label="Lieu" data="LIE" treeLevel="1"  globalListProvider="LIEU_GROUPBY"/>
				<OPTION label="Unité fonctionnelle" data="UFO" treeLevel="1"  globalListProvider="UNITE_FONCTIONNELLE_GROUPBY"/>
				<OPTION label="Commande" data="CMD" treeLevel="1"  />
				<OPTION label="Année-Mois Commande" globalListProvider="DATE_GROUPBY" treeLevel="1"  />
				<OPTION label="Source de données" data="PVD" treeLevel="1"  globalListProvider="PROVIDER_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_2" label="" width="200" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1"/>
				<OPTION label="Article" data="ART" treeLevel="1"  globalListProvider="ARTICLE_GROUPBY"/>
				<OPTION label="Compte" data="CPA" treeLevel="1"  globalListProvider="COMPTE_ARTICLE_GROUPBY"/>
				<OPTION label="Fournisseur" data="FOU" treeLevel="1"  globalListProvider="FOURNISSEUR_GROUPBY"/>
				<OPTION label="Gestionnaire" data="GES" treeLevel="1"  globalListProvider="GESTIONNAIRE_GROUPBY"/>
				<OPTION label="Lieu" data="LIE" treeLevel="1"  globalListProvider="LIEU_GROUPBY"/>
				<OPTION label="Unité fonctionnelle" data="UFO" treeLevel="1"  globalListProvider="UNITE_FONCTIONNELLE_GROUPBY"/>
				<OPTION label="Commande" data="CMD" treeLevel="1"  />
				<OPTION label="Année-Mois Commande" globalListProvider="DATE_GROUPBY" treeLevel="1"  />
				<OPTION label="Source de données" data="PVD" treeLevel="1"  globalListProvider="PROVIDER_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_3" label="" width="200" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="Article" data="ART" treeLevel="1"  globalListProvider="ARTICLE_GROUPBY"/>
				<OPTION label="Compte" data="CPA" treeLevel="1"  globalListProvider="COMPTE_ARTICLE_GROUPBY"/>
				<OPTION label="Fournisseur" data="FOU" treeLevel="1"  globalListProvider="FOURNISSEUR_GROUPBY"/>
				<OPTION label="Gestionnaire" data="GES" treeLevel="1"  globalListProvider="GESTIONNAIRE_GROUPBY"/>
				<OPTION label="Lieu" data="LIE" treeLevel="1"  globalListProvider="LIEU_GROUPBY"/>
				<OPTION label="Unité fonctionnelle" data="UFO" treeLevel="1"  globalListProvider="UNITE_FONCTIONNELLE_GROUPBY"/>
				<OPTION label="Commande" data="CMD" treeLevel="1"  />
				<OPTION label="Année-Mois Commande" globalListProvider="DATE_GROUPBY" treeLevel="1"  />
				<OPTION label="Source de données" data="PVD" treeLevel="1"  globalListProvider="PROVIDER_GROUPBY"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	
	<SELECTIONS componentName="FILTRES_COMMANDE_SIGNIFICATIF"/>
	<SELECTIONS componentName="FILTRES_COMMANDE_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_FOURNISSEUR_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_ARTICLE_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PROVIDER_SELECTIONS"/>
	
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_LIGNES_COMMANDES_X" optimizer2="V_ALL_X">
				<select><![CDATA[		

					CTISELECT_TREE
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						SIGNIFDATA{[VIEW.ECO_SIGNIFICATIVE_DATA],, [ECO_SIGNIFICATIVE_MODE],, [ECO_SIGNIFICATIVE_NUMBER]}
						COLUMNBY[PERIODICITE]{[DATE_BASE2],, '[PERIODE]' ,, '[TOPERIODE]' ,, 12,, [VIEW.COLUMN_OPTION]}
						[VIEW.DATASQL_EVOL]
					FROM #V_LIGNES_COMMANDES_X##V_ALL_X#
					WHERE [DATE_BASE2] BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.ARTICLE_SELECT]
						[VIEW.FOURNISSEUR_SELECT]
						[VIEW.COMMANDE_SELECT]
						[VIEW.PROVIDER_SELECT]

				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="N"/>
					<FIELD name="N0"/>
					<FIELD name="N1"/>
					<FIELD name="N2"/>
					<FIELD name="N3"/>
					<FIELD name="N4"/>
					<FIELD name="N5"/>
					<FIELD name="N6"/>
					<FIELD name="N7"/>
					<FIELD name="N8"/>
					<FIELD name="N9"/>
					<FIELD name="N10"/>
					<FIELD name="N11"/>
					<FIELD name="N12"/>
				</FIELDS>
			</SQL>
		</QUERY>
			<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select><![CDATA[
						SELECT 'X_PERIODE_D', greatest(to_date(to_char('[PERIODE]'::date - INTERVAL  '1 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(to_date(mois,'YYYYMM')) FROM eco.p_chiffrier_production))::text
					UNION ALL
						SELECT 'X_TOPERIODE_D', greatest(to_date(to_char('[TOPERIODE]'::date - INTERVAL  '1 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(to_date(mois,'YYYYMM')) FROM eco.p_chiffrier_production))::text
					UNION ALL
						SELECT 'X_PERIODE', greatest(to_date(to_char('[PERIODE]'::date - INTERVAL  '3 year', 'YYYY-MM-DD'), 'YYYY-MM-DD'), (SELECT min(to_date(mois,'YYYYMM')) FROM eco.p_chiffrier_production))::text
				]]></select>
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Analyse" shortLabel="Analyse" view="ECO000006.XML" enabled="true" componentName="ECO_VIEWLINK" component2Name="DATE_EVOL_VIEWLINK" buttonType="ANALYSE">
			</VIEWLINK>
			<VIEWLINK label="Comparatif" shortLabel="Comparatif" view="ECO000008.XML" enabled="true" rowContext="false" componentName="ECO_VIEWLINK" component2Name="DATE_EVOL_VIEWLINK" buttonType="COMPARATIF">
			</VIEWLINK>
			<VIEWLINK label="Analyse croisée" shortLabel="Analyse croisée" view="ECO000009.XML" enabled="true" rowContext="false"  componentName="ECO_VIEWLINK" component2Name="DATE_EVOL_VIEWLINK" buttonType="ANALYSE_CROISEE">
				<ARG name="PERIODE" value="return VIEW.X_PERIODE;" />
				<ARG name="GROUPBY_TAB" value="'TAB'"/>
				<ARG name="COLUMNBYCOUNT" value="'12'"/>
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['DATA02'] = '0';
						LINKVARIABLES['DATA03'] = '0';
						LINKVARIABLES['DATA04'] = '0';
						LINKVARIABLES['DATA05'] = '0';
						LINKVARIABLES['DATA06'] = '0';
						LINKVARIABLES['DATA07'] = '0';
						LINKVARIABLES['DATA08'] = '0';
						LINKVARIABLES['DATA09'] = '0';
						LINKVARIABLES['DATA10'] = '0';
						LINKVARIABLES['DATA11'] = '0';
						LINKVARIABLES['DATA12'] = '0';
						LINKVARIABLES['DATA13'] = '0';
						LINKVARIABLES['DATA14'] = '0';
						LINKVARIABLES['DATA15'] = '0';
						return 'OK';
					]]></value>
				</ARGS>
			</VIEWLINK>
			<VIEWLINK label="Liste des commandes" shortLabel="Liste commandes" view="ECO000011.XML" componentName="ECO_VIEWLINK" component2Name="DATE_EVOL_VIEWLINK" >
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY'] = '-1'
						LINKVARIABLES['GROUPBY_2'] = 'CMD'
						return 'OK';
			
					]]></value>
				</ARGS>
			</VIEWLINK>
			<VIEWLINK label="Liste des lignes de commande" shortLabel="Liste lignes" view="ECO000011.XML" componentName="ECO_VIEWLINK" component2Name="DATE_EVOL_VIEWLINK" >
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY'] = 'CMD'
						LINKVARIABLES['GROUPBY_2'] = 'CML'
						return 'OK';
			
					]]></value>
				</ARGS>
			</VIEWLINK>
			<VIEWLINK label="Détail article" shortLabel="Détail article" view="ECO000069.XML" componentName="ECO_VIEWLINK" component2Name="DATE_EVOL_VIEWLINK" >
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY'] = 'AMCMD'
						LINKVARIABLES['GROUPBY_2'] = 'AMMVT'
						LINKVARIABLES['GROUPBY_3'] = 'AMSTO'
						LINKVARIABLES['PERIODE'] = SELECT.PERIODE_D
						LINKVARIABLES['TOPERIODE'] = SELECT.TOPERIODE
						LINKVARIABLES['TAB'] = 'AUTO'
						return 'OK';
			
					]]></value>
				</ARGS>
			</VIEWLINK>
		</VIEWLINKS>

		<ONGLET excelLabel="Evolution mensuelle" label="Evolution mensuelle" multiTab="true">
			<CHART title="" type="group" subType="" percentHeight="100">
				<CHART title="Comparatif (10 premiers)" type="pieChart" maxItems="10" maxItemsSortOn="N" maxItemsSortSeq="D" sortField="N" sortSeq="D" condition="ROW.LVL == '1'" percentHeight="80">
					<CATEGORY field="TXT" type="Char" />
					<SERIE field="N" displayName="SELECT.DATA01_LABEL" displayNameCalc="true"/>
				</CHART>
				<CHART title="Evolution (10 premiers)" type="lineChart" maxItems="10" maxItemsSortOn="N"  maxItemsSortSeq="D" sortField="N" sortSeq="D" serieIsCategory="true" condition="ROW.LVL == '1'" percentWidth="300"  showLegend="false">
					<CATEGORY field="TXT" type="Char"/>
					<SERIE field="N1" displayName="VIEW.COLH1" displayNameCalc="true" visibleCondition="VIEW.COLH1 != null"/>
					<SERIE field="N2" displayName="VIEW.COLH2" displayNameCalc="true" visibleCondition="VIEW.COLH2 != null"/>
					<SERIE field="N3" displayName="VIEW.COLH3" displayNameCalc="true" visibleCondition="VIEW.COLH3 != null"/>
					<SERIE field="N4" displayName="VIEW.COLH4" displayNameCalc="true" visibleCondition="VIEW.COLH4 != null"/>
					<SERIE field="N5" displayName="VIEW.COLH5" displayNameCalc="true" visibleCondition="VIEW.COLH5 != null"/>
					<SERIE field="N6" displayName="VIEW.COLH6" displayNameCalc="true" visibleCondition="VIEW.COLH6 != null"/>
					<SERIE field="N7" displayName="VIEW.COLH7" displayNameCalc="true" visibleCondition="VIEW.COLH7 != null"/>
					<SERIE field="N8" displayName="VIEW.COLH8" displayNameCalc="true" visibleCondition="VIEW.COLH8 != null"/>
					<SERIE field="N9" displayName="VIEW.COLH9" displayNameCalc="true" visibleCondition="VIEW.COLH9 != null"/>
					<SERIE field="N10" displayName="VIEW.COLH10" displayNameCalc="true" visibleCondition="VIEW.COLH10 != null"/>
					<SERIE field="N11" displayName="VIEW.COLH11" displayNameCalc="true" visibleCondition="VIEW.COLH11 != null"/>
					<SERIE field="N12" displayName="VIEW.COLH12" displayNameCalc="true" visibleCondition="VIEW.COLH12 != null"/>
				</CHART>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="36" variableRowHeight="true" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid">
				</COLUMN>
				<COLUMN dataField="COD" width="100" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="50" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="*ROW">
				</COLUMN>
			
				<COLUMN dataField="N" width="80" visibleCondition="SELECT.PERIODICITE != 'YEAR'" type="Number" outputFormat="= SELECT.DATA014" headerText="Total" textAlign="right" totalFunction="sum" otherFunction="sum" description="= SELECT.DATA016">
				</COLUMN>
				
				<COLUMN dataField="N_P" type="Number" headerText="% / Total" width="40" visibleCondition="SELECT.PERIODICITE != 'YEAR' &amp;&amp; SELECT.DATA01 != 'PUMTTC' &amp;&amp; SELECT.DATA01 != 'PULTTC'" outputFormat="0%" textAlign="right" totalFunction="calc" totalComplement="" otherFunction="calc" calc="true">
					<CALC formula="ROW.N / TOTALROW.N * 100"/>
				</COLUMN>
				<COLUMN dataField="N0" width="70" visibleCondition="VIEW.COLH0 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" headerText="&lt;&lt;" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N1" width="70" visibleCondition="VIEW.COLH1 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH1" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N2" width="70" visibleCondition="VIEW.COLH2 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH2" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N3" width="70" visibleCondition="VIEW.COLH3 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH3" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N4" width="70" visibleCondition="VIEW.COLH4 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH4" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N5" width="70" visibleCondition="VIEW.COLH5 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH5" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N6" width="70" visibleCondition="VIEW.COLH6 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH6" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N7" width="70" visibleCondition="VIEW.COLH7 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH7" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N8" width="70" visibleCondition="VIEW.COLH8 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH8" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N9" width="70" visibleCondition="VIEW.COLH9 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH9" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N10" width="70" visibleCondition="VIEW.COLH10 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH10" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N11" width="70" visibleCondition="VIEW.COLH11 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH11" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
				<COLUMN dataField="N12" width="70" visibleCondition="VIEW.COLH12 != null" type="Number" outputFormat="= SELECT.DATA014" fixed="false" selectable="true" headerText="VIEW.COLH12" headerTextCalc="true" textAlign="right" otherFunction="sum" totalFunction="sum" description="= SELECT.DATA012">
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
