<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000163" label="Activité. Comparaison comptabilisation et en-cours" 
	database="iCTI" swf="*CTI_view1" 
	softCode="iCTI_activite" 
	globals="ACTI_globals.XML" 
	componentsFile="ACTI_components.XML" 
	helpFile="iCTI_ACTI_ACTI000163.HTML">
	
	<title><![CDATA[=	
		
		var group_by_label = '';
		if (SELECT.GROUPBY != '-1') {
			group_by_label = 'par ' + SELECT.GROUPBY_LABEL;
		}
		if (SELECT.GROUPBY_2 != '-1') {
			group_by_label = group_by_label + ' et ' + SELECT.GROUPBY_2_LABEL;
		}
		
		var date_label = '(' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ' vs ' + ' ' + VIEW.PERIODE_D_LABEL + ' à ' + VIEW.TOPERIODE_D_LABEL + ')';
		var option = '(' + SELECT.OPTION2_LABEL + ') ';
		return 'Comparaison en-cours ' + option + group_by_label + ' ' + date_label;
		
	]]></title>
	
	<VIEWPROPERTIES componentName="PROPERTIES_PRESTATIONS"/>
	<VIEWPROPERTIES>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
        <PROPERTY name="OPTION2_WHERE">
			<value><![CDATA[[EVAL 
								switch ('[OPTION2]') {
								case 'SOR':
									return "AND montant_encours_sorti <> 0";
									break;
								default:
									return "";
								}
					EVAL]]]></value>
		</PROPERTY>
	</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="De" UI="combo" tree="true" width="150" default="2009-01-01" globalListProvider="DATE_DEBUT" >
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2009-01-31" globalListProvider="DATE_FIN" >
			</FIELD>
		</GROUP>
		<GROUP label="Comparer avec">
			<FIELD name="TYPE_COMPARAISON" label="" UI="combo" default="2" width="130">
				<OPTION label="Année précédente" data="2" />
				<OPTION label="Saisie période" data="S" />
			</FIELD>
			<FIELD name="PERIODE_D" label="De" UI="combo" tree="true" width="150" default="2008-01-01" globalListProvider="DATE_DEBUT" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
			<FIELD name="TOPERIODE_D" label="à" UI="combo" tree="true" width="150" default="2008-01-31" globalListProvider="DATE_FIN" visible="= SELECT.TYPE_COMPARAISON == 'S'">
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY" label="Regroupement" UI="combo" default="PRF" width="250" tree="true">
				<OPTION label="PRESTATIONS_ENCOURS_GROUPBY" data="" globalListProvider="PRESTATIONS_ENCOURS_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP>
			<FIELD name="GROUPBY_2" label="" UI="combo" default="-1" width="250" tree="true">
				<OPTION label="" data="-1"/>
				<OPTION label="PRESTATIONS_ENCOURS_GROUPBY" data="" globalListProvider="PRESTATIONS_ENCOURS_GROUPBY"/>
			</FIELD>
		</GROUP>
		<GROUP label="Données">
			<FIELD name="DATA1" tree="true" label="Données" UI="combo" default="MTVENENC" width="200">
				<OPTION label="Options" data="" globalListProvider="DATA_ENC" />
            </FIELD>
            <FIELD name="DATA2" tree="true" label="" UI="combo" default="0" default2="0" width="200">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_ENC" />
			</FIELD>
            <FIELD name="DATA3" tree="true" label="" UI="combo" default="0" default2="0" width="200">
				<OPTION label="" data="0" />
				<OPTION label="Options" data="" globalListProvider="DATA_ENC" />
			</FIELD>
		</GROUP>
        <GROUP label="Options">
			<FIELD name="OPTION2" label="" UI="combo" width="200" default="-1" >
				<OPTION label="Présents et Sortis" data="-1"/>
				<OPTION label="Sortis uniquement" data="SOR"/>
			</FIELD>
		</GROUP>
		<GROUP label="Source en-cours">
			<FIELD name="SOURCE_ENCOURS" label="" UI="combo" width="200" default="C" >
				<OPTION label="CTI Santé" data="C"/>
				<OPTION label="Prestataire facturation" data="P"/>
			</FIELD>
		</GROUP>
        <GROUP visible="false">
			<FIELD name="RUBRIQUE_CA" label="C.A." UI="combo" tree="true" width="200" default="-1"  globalListProvider="RUBRIQUES_CA" showIfNotDefault="true" />
			<FIELD name="RUBRIQUE_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.RUBRIQUE == 'SAISIECODE' " />
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_PRESTATIONS_SOUSSELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PRESTATIONS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<QUERIES>
		<QUERY label="">
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_ENCOURS_LIGNES_C_X">
				<select><![CDATA[		
					CTIPREPAR_TREE
					WORKTABLE{ACTI000163_R}
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						0,,
						0,,
						0,,
						0,,
					
						0,,
						0,,
						0,,
						0,,
					
						SUM(montant_encours),,
						0,,
						0,,
						0,,
						
					}
					FROM #V_FACTURES_ENCOURS_LIGNES_C_X#
					WHERE 
						date_trunc('month', date_comptable) = date_trunc('month', '[TOPERIODE]'::date) AND
						code_origine = '[SOURCE_ENCOURS]'
						[VIEW.OPTION2_WHERE]
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
				
				
				]]></select>
			</SQL>
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_ENCOURS_LIGNES_C_X">
				<select><![CDATA[		
					CTIPREPAR_TREE
					WORKTABLE{ACTI000163_R2}
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						0,,
						0,,
						0,,
						0,,
					
						0,,
						0,,
						0,,
						0,,
					
						0,,
						SUM(montant_encours),,
						0,,
						0,,
						
					}
					FROM #V_FACTURES_ENCOURS_LIGNES_C_X#
					WHERE 
						date_trunc('month', date_comptable) = date_trunc('month', '[VIEW.TOPERIODE_D]'::date) AND
						code_origine = '[SOURCE_ENCOURS]'
						[VIEW.OPTION2_WHERE]
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
				
				
				]]></select>
			</SQL>
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_ENCOURS_LIGNES_C_X">
				<select><![CDATA[		
					CTIPREPAR_TREE
					WORKTABLE{ACTI000163_E}
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						SUM(montant_encours),,
						0,,
						0,,
						0,,
					
						0,,
						0,,
						0,,
						0,,
					
						0,,
						0,,
						0,,
						0,,
					}
					FROM #V_FACTURES_ENCOURS_LIGNES_C_X#
					WHERE 
						date_trunc('month', date_comptable) = date_trunc('month', '[PERIODE]'::date - interval '1 month') AND
						code_origine = '[SOURCE_ENCOURS]'
						[VIEW.OPTION2_WHERE]
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
				
				
				]]></select>
			</SQL>
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_ENCOURS_LIGNES_C_X">
				<select><![CDATA[		
					CTIPREPAR_TREE
					WORKTABLE{ACTI000163_E2}
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						0,,
						SUM(montant_encours),,
						0,,
						0,,
					
						0,,
						0,,
						0,,
						0,,
					
						0,,
						0,,
						0,,
						0,,
					}
					FROM #V_FACTURES_ENCOURS_LIGNES_C_X#
					WHERE 
						date_trunc('month', date_comptable) = date_trunc('month', '[VIEW.PERIODE_D]'::date - interval '1 month') AND
						code_origine = '[SOURCE_ENCOURS]'
						[VIEW.OPTION2_WHERE]
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
				
				
				]]></select>
			</SQL>
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_LIGNES_C_X">
				<select><![CDATA[		
					CTIPREPAR_TREE
					WORKTABLE{ACTI000163_V}
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						0,,
						0,,
						0,,
						0,,
					
						SUM(montant_comptabilise),,
						0,,
                        0,,
                        0,,
					
						0,,
						0,,
						0,,
						0,,
					}
					FROM #V_FACTURES_LIGNES_C_X#
						JOIN #V_SEJOURS_X# ON v_sejours_1.no_sejour = v_factures_lignes_c_4.no_sejour
					WHERE 
						date_trunc('month', date_vente) BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
				
				
				]]></select>
			</SQL>
            <SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_LIGNES_C_X">
				<select><![CDATA[		
					CTIPREPAR_TREE
					WORKTABLE{ACTI000163_V2}
					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]}
					SIGNIFDATA{[VIEW.ACTIVITE_SIGNIFICATIVE_DATA],, [ACTIVITE_SIGNIFICATIVE_MODE],, [ACTIVITE_SIGNIFICATIVE_NUMBER]}
					INDICATORS{
						0,,
						0,,
						0,,
						0,,
					
						0,,
						SUM(montant_comptabilise),,
                        0,,
                        0,,
					
						0,,
						0,,
						0,,
						0,,
					}
					FROM #V_FACTURES_LIGNES_C_X#
						JOIN #V_SEJOURS_X# ON v_sejours_1.no_sejour = v_factures_lignes_c_4.no_sejour
					WHERE 
						date_trunc('month', date_vente) BETWEEN '[VIEW.PERIODE_D]' AND '[VIEW.TOPERIODE_D]'
						[VIEW.SEJOURS_SELECT]
						[VIEW.PRESTATIONS_SELECT]
				
				
				]]></select>
			</SQL>
            <SQL>
				<select><![CDATA[		
                    SELECT oidt, labelt, textet, 
						oid1, code1, 
						oid2, code2, 
						oid3, code3, 
						oid, code, texte, level, 
						SUM(indicateurs[1]), 
						SUM(indicateurs[2]), 
						SUM(indicateurs[1] - indicateurs[2]), 
						SUM(indicateurs[4]), 
						SUM(indicateurs[5]), 
						SUM(indicateurs[6]), 
						SUM(indicateurs[5] - indicateurs[6]), 
						SUM(indicateurs[8]), 
						SUM(indicateurs[9]), 
						SUM(indicateurs[10]), 
						SUM(indicateurs[9] - indicateurs[10]), 
						SUM(indicateurs[12]), 
						SUM(indicateurs[9] - indicateurs[1]),
						SUM(indicateurs[10] - indicateurs[2]),
						SUM(indicateurs[9] - indicateurs[1] + indicateurs[5]),
						SUM(indicateurs[10] - indicateurs[2] + indicateurs[6])
					FROM
					(
						SELECT 
							oidt, labelt, textet, 
							oid1, code1, 
							oid2, code2, 
							oid3, code3, 
							oid, code, texte, level, 
							indicateurs
							FROM ACTI000163_R
						UNION ALL
                        SELECT 
							oidt, labelt, textet, 
							oid1, code1, 
							oid2, code2, 
							oid3, code3, 
							oid, code, texte, level, 
							indicateurs
							FROM ACTI000163_R2
						UNION ALL
						SELECT 
							oidt, labelt, textet, 
							oid1, code1, 
							oid2, code2, 
							oid3, code3, 
							oid, code, texte, level, 
							indicateurs
							FROM ACTI000163_E
						UNION ALL
                        SELECT 
							oidt, labelt, textet, 
							oid1, code1, 
							oid2, code2, 
							oid3, code3, 
							oid, code, texte, level, 
							indicateurs
							FROM ACTI000163_E2
						UNION ALL
						SELECT 
							oidt, labelt, textet, 
							oid1, code1, 
							oid2, code2, 
							oid3, code3, 
							oid, code, texte, level, 
							indicateurs
							FROM ACTI000163_V
                        UNION ALL
						SELECT 
							oidt, labelt, textet, 
							oid1, code1, 
							oid2, code2, 
							oid3, code3, 
							oid, code, texte, level, 
							indicateurs
							FROM ACTI000163_V2
						) subview
					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="R_MT"/>
					<FIELD name="R_MT2"/>
					<FIELD name="R_MTE"/>
					<FIELD name="R_MTP"/>
					<FIELD name="V_MT"/>
					<FIELD name="V_MT2"/>
					<FIELD name="V_MTE"/>
					<FIELD name="V_MTP"/>
                    <FIELD name="E_MT"/>
					<FIELD name="E_MT2"/>
					<FIELD name="E_MTE"/>
					<FIELD name="E_MTP"/>
					<FIELD name="VAR_MT"/>
					<FIELD name="VAR_MT2"/>
					<FIELD name="VENC_MT"/>
					<FIELD name="VENC_MT2"/>
				</FIELDS>
			</SQL>
			
		</QUERY>
	
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false"> 
		
			<SQL>
				<select><![CDATA[	
					SELECT 'PERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date - interval '1 year') ELSE '[PERIODE_D]' END::text
					UNION
					SELECT 'TOPERIODE_D' , CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date - interval '1 year') ELSE '[TOPERIODE_D]' END::text
					UNION
					SELECT 'PERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date - interval '1 year') ELSE '[PERIODE_D]' END = p_calendrier_mois.date_debut THEN p_calendrier_mois.texte ELSE p_calendrier.texte_court END
					FROM base.p_calendrier
						JOIN base.p_calendrier_mois ON p_calendrier.mois = p_calendrier_mois.mois
					WHERE date = CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[PERIODE]'::date - interval '1 year') ELSE '[PERIODE_D]' END
					UNION
					SELECT 'TOPERIODE_D_LABEL', CASE WHEN  CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date - interval '1 year') ELSE '[TOPERIODE_D]' END = p_calendrier_mois.date_fin THEN p_calendrier_mois.texte ELSE p_calendrier.texte_court END
					FROM base.p_calendrier
						JOIN base.p_calendrier_mois ON p_calendrier.mois = p_calendrier_mois.mois
					WHERE date = CASE WHEN '[TYPE_COMPARAISON]' = '2' THEN date('[TOPERIODE]'::date - interval '1 year') ELSE '[TOPERIODE_D]' END
				]]></select>
				<FIELDS>
					<FIELD name="name" />
					<FIELD name="value" />
				</FIELDS>
			</SQL>

		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Liste des séjours" shortLabel="Liste séjours" view="ACTI000107.XML" componentName="PRESTATIONS_BASE_VIEWLINK" component2Name="STANDARD_BASE_VIEWLINK">
				<ARG name="PERIODE" value="						
					var name:String = COLUMN.NAME; 
					switch(name) 
					{ 
					    case 'V_MT2':case 'E_MT2':case 'VAR_MT2':case 'VENC_MT2':
					        return (SELECT.TYPE_COMPARAISON == '2') ? VIEW.PERIODE_D : SELECT.PERIODE_D;
					        break; 
					    case 'V_MT':case 'E_MT':case 'VAR_MT':case 'VENC_MT':
					        return (SELECT.TYPE_COMPARAISON == '2') ? VIEW.PERIODE : SELECT.PERIODE;
					        break; 
					    default: 
					        return SELECT.PERIODE; 
					        break; 
					}
				"/>
				<ARG name="TOPERIODE" value="
					var name:String = COLUMN.NAME; 
					switch(name) 
					{ 
					    case 'V_MT2':case 'E_MT2':case 'VAR_MT2':case 'VENC_MT2':
					        return (SELECT.TYPE_COMPARAISON == '2') ? VIEW.TOPERIODE_D : SELECT.TOPERIODE_D;
					        break; 
					    case 'V_MT':case 'E_MT':case 'VAR_MT':case 'VENC_MT':
					        return (SELECT.TYPE_COMPARAISON == '2') ? VIEW.TOPERIODE : SELECT.TOPERIODE;
					        break; 
					    default: 
					        return SELECT.TOPERIODE; 
					        break; 
					}
				"/>
				
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition mensuelle" label="Répartition mensuelle" multiTab="true">
			<CHART title="" type="columnChart" maxItems="20" maxItemsSortOn="V_MT" maxItemsSortSeq="D" sortField="COD" sortSeq="A" visibleCondition="SELECT.DATA1 == 'MTVEN' || SELECT.DATA2 == 'MTVEN' || SELECT.DATA3 == 'MTVEN'">
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="V_MT2" displayName="'Vente Montant ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="V_MT" displayName="'Vente Montant ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true"/>
			</CHART>
			<CHART title="" type="columnChart" maxItems="20" maxItemsSortOn="E_MT" maxItemsSortSeq="D" sortField="COD" sortSeq="A" visibleCondition="SELECT.DATA1 == 'MTENC' || SELECT.DATA2 == 'MTENC' || SELECT.DATA3 == 'MTENC'">
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="E_MT2" displayName="'En-cours Montant ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="E_MT" displayName="'En-cours Montant '  + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true"/>
			</CHART>
			<CHART title="" type="columnChart" maxItems="20" maxItemsSortOn="VAR_MT" maxItemsSortSeq="D" sortField="COD" sortSeq="A" visibleCondition="SELECT.DATA1 == 'MTVARENC' || SELECT.DATA2 == 'MTVARENC' || SELECT.DATA3 == 'MTVARENC'">
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="VAR_MT2" displayName="'Variation En-cours '+ VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="VAR_MT" displayName="'Variation En-cours ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true"/>
			</CHART>
            <CHART title="" type="columnChart" maxItems="20" maxItemsSortOn="VENC_MT" maxItemsSortSeq="D" sortField="COD" sortSeq="A" visibleCondition="SELECT.DATA1 == 'MTVENENC' || SELECT.DATA2 == 'MTVENENC' || SELECT.DATA3 == 'MTVENENC'">
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="VENC_MT2" displayName="'Vente + En-cours ' + VIEW.PERIODE_D_LABEL + '-' + VIEW.TOPERIODE_D_LABEL" displayNameCalc="true"/>
				<SERIE field="VENC_MT" displayName="'Vente + En-cours ' + SELECT.PERIODE_LABEL + '-' + SELECT.TOPERIODE_LABEL" displayNameCalc="true"/>
			</CHART>
			<DATAGRID title="" total="true" showOthers="true" headerHeight="70" variableRowHeight="true" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid">
				</COLUMN>
				<COLUMN dataField="COD" width="80" type="Char" visibleCondition="SELECT.GROUPBY != '5'" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" 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="V_MT2" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVEN' || SELECT.DATA2 == 'MTVEN' || SELECT.DATA3 == 'MTVEN'" headerText="'Ventes' + '\n' + 'Montant ' + '\n' + VIEW.PERIODE_D_LABEL + '\n' + VIEW.TOPERIODE_D_LABEL " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des ventes de la période">
				</COLUMN>
                <COLUMN dataField="V_MT" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVEN' || SELECT.DATA2 == 'MTVEN' || SELECT.DATA3 == 'MTVEN'" headerText="'Ventes' + '\n' + 'Montant ' + '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL  " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des ventes de la période">
				</COLUMN>
                <COLUMN dataField="V_MTE" width="80" type="Number" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVEN' || SELECT.DATA2 == 'MTVEN' || SELECT.DATA3 == 'MTVEN'" headerText="Ecart" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des ventes de la période">
                    <CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.V_MT2 &gt; ROW.V_MT" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition=" ROW.V_MT &gt; ROW.V_MT2" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.V_MT2 != null &amp;&amp; ROW.V_MT != null &amp;&amp; ROW.V_MT2 == ROW.V_MT" />
                </COLUMN>
                <COLUMN dataField="V_MTP" width="45" type="Number" outputFormat="#%" visibleCondition="SELECT.DATA1 == 'MTVEN' || SELECT.DATA2 == 'MTVEN' || SELECT.DATA3 == 'MTVEN'" headerText="% évol." textAlign="right" totalFunction="calc" otherFunction="calc" description="Montant des ventes de la période" calc="true">
                    <CALC formula="((ROW.V_MT - ROW.V_MT2)/ ROW.V_MT2)*100" />
                </COLUMN>
                <COLUMN dataField="E_MT2" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTENC' || SELECT.DATA2 == 'MTENC' || SELECT.DATA3 == 'MTENC'" headerText="'En-cours' + '\n' + 'Montant ' + '\n' + VIEW.PERIODE_D_LABEL + '\n' + VIEW.TOPERIODE_D_LABEL " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
				</COLUMN>
                <COLUMN dataField="E_MT" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTENC' || SELECT.DATA2 == 'MTENC' || SELECT.DATA3 == 'MTENC'" headerText="'En-cours' + '\n' + 'Montant ' + '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL  " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
				</COLUMN>
                <COLUMN dataField="E_MTE" width="80" type="Number" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTENC' || SELECT.DATA2 == 'MTENC' || SELECT.DATA3 == 'MTENC'" headerText="Ecart" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
                    <CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.E_MT2 &gt; ROW.E_MT" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition=" ROW.E_MT &gt; ROW.E_MT2" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.E_MT2 != null &amp;&amp; ROW.E_MT != null &amp;&amp; ROW.E_MT2 == ROW.E_MT" />
                </COLUMN>
                <COLUMN dataField="E_MTP" width="45" type="Number" outputFormat="#%" visibleCondition="SELECT.DATA1 == 'MTENC' || SELECT.DATA2 == 'MTENC' || SELECT.DATA3 == 'MTENC'" headerText="% évol." textAlign="right" totalFunction="calc" otherFunction="calc" description="Montant des En-cours du mois" calc="true">
                    <CALC formula="((ROW.E_MT - ROW.E_MT2)/ ROW.E_MT2)*100" />
                </COLUMN>
                <COLUMN dataField="VAR_MT2" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVARENC' || SELECT.DATA2 == 'MTVARENC' || SELECT.DATA3 == 'MTVARENC'" headerText="'Variation'+ '\n' + ' En-cours' + '\n' + VIEW.PERIODE_D_LABEL + '\n' + VIEW.TOPERIODE_D_LABEL " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
				</COLUMN>
                <COLUMN dataField="VAR_MT" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVARENC' || SELECT.DATA2 == 'MTVARENC' || SELECT.DATA3 == 'MTVARENC'" headerText="'Variation'+ '\n' + ' En-cours' + '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL  " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
				</COLUMN>
                <COLUMN dataField="VAR_E" width="80" type="Number" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVARENC' || SELECT.DATA2 == 'MTVARENC' || SELECT.DATA3 == 'MTVARENC'" headerText="Ecart" textAlign="right" totalFunction="calc" otherFunction="calc" description="Montant des En-cours du mois" calc="true">
                    <CALC formula="ROW.VAR_MT - ROW.VAR_MT2" />
                    <CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.VAR_MT2 &gt; ROW.VAR_MT" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition=" ROW.VAR_MT &gt; ROW.VAR_MT2" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.VAR_MT2 != null &amp;&amp; ROW.VAR_MT != null &amp;&amp; ROW.VAR_MT2 == ROW.VAR_MT" />
                </COLUMN>
                <COLUMN dataField="VAR_P" width="45" type="Number" outputFormat="#%" visibleCondition="SELECT.DATA1 == 'MTVARENC' || SELECT.DATA2 == 'MTVARENC' || SELECT.DATA3 == 'MTVARENC'" headerText="% évol." textAlign="right" totalFunction="calc" otherFunction="calc" description="Montant des En-cours du mois" calc="true">
                    <CALC formula="((ROW.VAR_MT - ROW.VAR_MT2)/ ROW.VAR_MT2)*100" />
                </COLUMN>
                <COLUMN dataField="VENC_MT2" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVENENC' || SELECT.DATA2 == 'MTVENENC' || SELECT.DATA3 == 'MTVENENC'" headerText="'Ventes '+ '\n' + ' + En-cours' + '\n' + VIEW.PERIODE_D_LABEL + '\n' + VIEW.TOPERIODE_D_LABEL " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
				</COLUMN>
                <COLUMN dataField="VENC_MT" width="90" type="Number" selectable="true" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVENENC' || SELECT.DATA2 == 'MTVENENC' || SELECT.DATA3 == 'MTVENENC'" headerText="'Ventes '+ '\n' + ' + En-cours' + '\n' + SELECT.PERIODE_LABEL + '\n' + SELECT.TOPERIODE_LABEL  " headerTextCalc="true" textAlign="right" totalFunction="sum" otherFunction="" description="Montant des En-cours du mois">
				</COLUMN>
                <COLUMN dataField="VENC_E" width="80" type="Number" outputFormat="#E" visibleCondition="SELECT.DATA1 == 'MTVENENC' || SELECT.DATA2 == 'MTVENENC' || SELECT.DATA3 == 'MTVENENC'" headerText="Ecart" textAlign="right" totalFunction="calc" otherFunction="calc" description="Montant des En-cours du mois" calc="true">
                    <CALC formula="ROW.VENC_MT - ROW.VENC_MT2" />
                    <CELLSTYLE name="cellIndicator" value="triangle_down, 10, left middle, 0xD63E00" condition="ROW.VENC_MT2 &gt; ROW.VENC_MT" />
					<CELLSTYLE name="cellIndicator" value="triangle_up, 10, left middle, 0x75a0eb" condition=" ROW.VENC_MT &gt; ROW.VENC_MT2" />
					<CELLSTYLE name="cellIndicator" value="rectangle, 10, left middle, 0xFFA500" condition="ROW.VENC_MT2 != null &amp;&amp; ROW.VENC_MT != null &amp;&amp; ROW.VENC_MT2 == ROW.VENC_MT" />
                </COLUMN>
                <COLUMN dataField="VEN_P" width="45" type="Number" outputFormat="#%" visibleCondition="SELECT.DATA1 == 'MTVENENC' || SELECT.DATA2 == 'MTVENENC' || SELECT.DATA3 == 'MTVENENC'" headerText="% évol." textAlign="right" totalFunction="calc" otherFunction="calc" description="Montant des En-cours du mois" calc="true">
                    <CALC formula="((ROW.VENC_MT - ROW.VENC_MT2)/ ROW.VENC_MT2)*100" />
                </COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
