<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="COMPTA000064" label="Comparatif par critère" title="= 'Comptabilité Budgétaire ' + SELECT.CH_LABEL + '. Comparatif ' + SELECT.DATA_LABEL + ' par ' + SELECT.GROUPBY_LABEL + ' à ' + SELECT.MOIS_LABEL + ' (' + SELECT.TYPEPERIODE_LABEL + ')'" database="iCTI" swf="*CTI_view1" globals="COMPTA_globals.XML" componentsFile="COMPTA_components.XML" dboptimizer="COMPTA_dboptimizer.XML" softCode="iCTI_compta" helpFile="iCTI_COMPTA_COMPTA000064.HTML">
	<VIEWPROPERTIES componentName="MULTICRITERES_PROPERTIES"/>
	<VIEWPROPERTIES>
		<PROPERTY name="ARBRE2_PADDING" value="[EVAL 
			$padding = 0;
			if ('[ARBRE1]' != '-1') {
				$padding = $padding + 1;
			}
			return $padding;
		EVAL]"/>
		<PROPERTY name="ARBRE3_PADDING" value="[EVAL 
			$padding = 0;
			if ('[ARBRE1]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE2]' != '-1') {
				$padding = $padding + 1;
			}
			return $padding;
		EVAL]"/>
		<PROPERTY name="ARBRE4_PADDING" value="[EVAL 
			$padding = 0;
			if ('[ARBRE1]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE2]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE3]' != '-1') {
				$padding = $padding + 1;
			}
			return $padding;
		EVAL]"/>
		<PROPERTY name="ARBRE5_PADDING" value="[EVAL 
			$padding = 0;
			if ('[ARBRE1]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE2]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE3]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE4]' != '-1') {
				$padding = $padding + 1;
			}
			return $padding;
		EVAL]"/>
		<PROPERTY name="GROUPBY_PADDING" value="[EVAL 
			$padding = 0;
			if ('[ARBRE1]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE2]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE3]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE4]' != '-1') {
				$padding = $padding + 1;
			}
			if ('[ARBRE5]' != '-1') {
				$padding = $padding + 1;
			}
			return $padding;
		EVAL]"/>
		<PROPERTY name="DATA_FIELD" value="[EVAL 
												if ('[DATA]' == 'C') {return 'v_historique_ecritures_1.montant_credit';}
												if ('[DATA]' == 'D') {return 'v_historique_ecritures_1.montant_debit';}
												if ('[DATA]' == 'SC') {return 'v_historique_ecritures_1.montant_solde_credit';}
												if ('[DATA]' == 'SD') {return 'v_historique_ecritures_1.montant_solde_debit';}
												if ('[DATA]' == 'NB') {return 'v_historique_ecritures_1.nombre_ecritures';}
												return 'v_historique_ecritures_1.montant_credit';
											EVAL]"/>
		<PROPERTY name="DATA_FIELD_B" value="[EVAL 
												if ('[DATA]' == 'C') {return '0';}
												if ('[DATA]' == 'D') {return '0';}
												if ('[DATA]' == 'SC') {return 'v_historique_ecritures_1.montant_solde_credit_budget';}
												if ('[DATA]' == 'SD') {return 'v_historique_ecritures_1.montant_solde_debit_budget';}
												if ('[DATA]' == 'NB') {return '0';}
												return 'v_historique_ecritures_1.montant_credit';
											EVAL]"/>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
		<GROUP label="Comptabilité">
			<FIELD name="CH" label="" UI="combo" width="250" default="C">
				<OPTION data="C" label="Clinique"/>
				<OPTION data="H" label="Honoraires"/>
			</FIELD>
		</GROUP>
		<GROUP label="Période">
			<FIELD name="MOIS" label="" UI="combo" width="150" default="*FIRST" globalListProvider="MOIS">
			</FIELD>
			<FIELD name="TYPEPERIODE" label="" UI="combo" width="250" default="X">
				<OPTION data="X" label="Exercice"/>
				<OPTION data="A" label="Année civile"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="DATA" label="Indicateur" UI="combo" width="200" default="C">
				<OPTION data="D" label="Débit"/>
				<OPTION data="C" label="Crédit"/>
				<OPTION data="SD" label="Solde Débiteur"/>
				<OPTION data="SC" label="Solde Créditeur"/>
				<OPTION data="NB" label="Nombre écritures"/>
			</FIELD>
		</GROUP>
		<GROUP label="Comparer Budget">
			<FIELD name="QBUDGET" label="" UI="combo" width="200" default="-1" >
				<OPTION data="-1" label="Pas de budget"/>
				<OPTION data="P" label="Avec Budget Période" />
				<OPTION data="T" label="Avec Budget Total" />
				<OPTION data="PT" label="Avec Budget Période et Total" />
			</FIELD>
		</GROUP>
		<GROUP label="Soldes du mois">
			<FIELD name="QSOLDE" label="" UI="combo" width="200" default="-1">
				<OPTION data="-1" label="Soldes mois et période"/>
				<OPTION data="T" label="Uniquement Soldes période"/>
			</FIELD>
		</GROUP>
		<GROUP label="Arborescence">
			<FIELD name="ARBRE1" label="" UI="combo" width="250" default="-1" tree="true">
				<OPTION data="-1" label="Pas de 1er niveau"/>
				<OPTION label="Options" data="" globalListProvider="COMPTA_GROUPBY_OPTION" />
				<OPTION data="CPT" label="Compte Budgétaire" globalListProvider="CPB_GROUPBY_OPTION"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.ARBRE1 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="ARBRE2" label="" UI="combo" width="250" default="-1" tree="true">
				<OPTION data="-1" label="Pas de 2nd niveau"/>
				<OPTION label="Options" data="" globalListProvider="COMPTA_GROUPBY_OPTION" />
				<OPTION data="CPT" label="Compte Budgétaire" globalListProvider="CPB_GROUPBY_OPTION"/>
			</FIELD>
			<FIELD name="ARBRE3" label="" UI="combo" width="250" default="-1" tree="true">
				<OPTION data="-1" label="Pas de 3ème niveau"/>
				<OPTION label="Options" data="" globalListProvider="COMPTA_GROUPBY_OPTION" />
				<OPTION data="CPT" label="Compte Budgétaire" globalListProvider="CPB_GROUPBY_OPTION"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="ARBRE4" label="" UI="combo" width="250" default="-1" tree="true">
				<OPTION data="-1" label="Pas de 4ème niveau"/>
				<OPTION label="Options" data="" globalListProvider="COMPTA_GROUPBY_OPTION" />
				<OPTION data="CPT" label="Compte Budgétaire" globalListProvider="CPB_GROUPBY_OPTION"/>
			</FIELD>
			<FIELD name="ARBRE5" label="" UI="combo" width="250" default="-1" tree="true">
				<OPTION data="-1" label="Pas de 5ème niveau"/>
				<OPTION label="Options" data="" globalListProvider="COMPTA_GROUPBY_OPTION" />
				<OPTION data="CPT" label="Compte Budgétaire" globalListProvider="CPB_GROUPBY_OPTION"/>
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY" label="Regroupement" UI="combo" width="250" default="JRN" tree="true">
				<OPTION label="Options" data="" globalListProvider="COMPTA_GROUPBY_OPTION" />
				<OPTION data="CPT" label="Compte Budgétaire" globalListProvider="CPB_GROUPBY_OPTION"/>
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="ECRITURES_SELECTIONS_BUDGETAIRE"/>
	<SELECTIONS componentName="ECRITURES_SELECTIONS_COMPLEMENTAIRES"/>
	<QUERIES>
		<QUERY>
			<SQL optimizer="V_HISTORIQUE_ECRITURES_X" cacheEnabled="true" select="
					[EVAL 
					if ('[ARBRE1]' != '-1') {
						$groupby = '';
						$qtab = false;
						if ('[GROUPBY_TAB]' == 'TAB') {
							$qtab = true;
						}
						if ('[GROUPBY_TAB]' == 'AUTO' &amp;&amp; '[ARBRE2]' != '-1') {
							$qtab = true;
						}

						if ($qtab == false) {
							return &quot;
							(SELECT 
								[VIEW.TAB1_RESUME_FIELDS],
								[VIEW.ARBRE1_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
								[VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
								[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE1TEXT_FIELDS],
								1, 0,
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
								MAX(fin_exercice), MAX(ajustement)
							FROM compta.#V_HISTORIQUE_ECRITURES_X# 
							WHERE 
							(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
								OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
								OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
								[VIEW.ECRITURES_SELECT_BUDG]
								AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
							GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
							)
							UNION ALL &quot;;
						}
						else {
							return &quot;
							(SELECT 
								[VIEW.TAB1_RESUME_FIELDS],
								[VIEW.ARBRE1_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
								[VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
								[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE1TEXT_FIELDS],
								1, 0,
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
								MAX(fin_exercice), MAX(ajustement)
							FROM compta.#V_HISTORIQUE_ECRITURES_X# 
							WHERE 
							(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
								OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
								OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
								[VIEW.ECRITURES_SELECT_BUDG]
								AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
							GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
							)
							UNION ALL
							(SELECT 
								[VIEW.TAB1_FIELDS],
								[VIEW.ARBRE1_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
								[VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
								-9999999, 'Total', 'Total',
								9, 0,
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
								sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
								MAX(fin_exercice), MAX(ajustement)
							FROM compta.#V_HISTORIQUE_ECRITURES_X# 
							WHERE 
							(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
								OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
								OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
								[VIEW.ECRITURES_SELECT_BUDG]
								AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
							GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
							)
							UNION ALL&quot; ;
						}
					}
					EVAL]
					
					
					
					[EVAL 
					if ([ARBRE2] != '-1') {
						return &quot;
						(SELECT  
							[VIEW.TAB1_FIELDS],
							[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE2_FIELDS], [VIEW.GROUP0BY_FIELDS], 
							[VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
							[VIEW.ARBRE2_FIELDS], [VIEW.ARBRE2TEXT_FIELDS],
							2, [VIEW.ARBRE2_PADDING],
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
						
							MAX(fin_exercice), MAX(ajustement)
						FROM compta.#V_HISTORIQUE_ECRITURES_X# 
						WHERE 
						(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
							[VIEW.ECRITURES_SELECT_BUDG]
							AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
						GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
						)
						UNION ALL&quot;;
					}
					EVAL]
					
					[EVAL 
					if ([ARBRE3] != '-1') {
						return &quot;
						(SELECT  
							[VIEW.TAB1_FIELDS],
							[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE2_FIELDS], [VIEW.ARBRE3_FIELDS], 
							[VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
							[VIEW.ARBRE3_FIELDS], [VIEW.ARBRE3TEXT_FIELDS],
							3, [VIEW.ARBRE3_PADDING],
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
							
							MAX(fin_exercice), MAX(ajustement)
						FROM compta.#V_HISTORIQUE_ECRITURES_X# 
						WHERE 
						(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
							[VIEW.ECRITURES_SELECT_BUDG]
							AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
						GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
						)
						UNION ALL&quot;;
					}
					EVAL]
					
					[EVAL 
					if ([ARBRE4] != '-1') {
						return &quot;
						(SELECT  
							[VIEW.TAB1_FIELDS],
							[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE2_FIELDS], [VIEW.ARBRE3_FIELDS], 
							[VIEW.ARBRE4_FIELDS], [VIEW.GROUP0BY_FIELDS], [VIEW.GROUP0BY_FIELDS], 
							[VIEW.ARBRE4_FIELDS], [VIEW.ARBRE4TEXT_FIELDS],
							4, [VIEW.ARBRE4_PADDING],
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
							
							MAX(fin_exercice), MAX(ajustement)
						FROM compta.#V_HISTORIQUE_ECRITURES_X# 
						WHERE 
						(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
							[VIEW.ECRITURES_SELECT_BUDG]
							AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
						GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
						)
						UNION ALL&quot;;
					}
					EVAL]
					
					[EVAL 
					if ([ARBRE5] != '-1') {
						return &quot;
						(SELECT  
							[VIEW.TAB1_FIELDS],
							[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE2_FIELDS], [VIEW.ARBRE3_FIELDS], 
							[VIEW.ARBRE4_FIELDS], [VIEW.ARBRE5_FIELDS], [VIEW.GROUP0BY_FIELDS], 
							[VIEW.ARBRE5_FIELDS], [VIEW.ARBRE5TEXT_FIELDS],
							5, [VIEW.ARBRE5_PADDING],
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
							
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
							sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
							
							MAX(fin_exercice), MAX(ajustement)
						FROM compta.#V_HISTORIQUE_ECRITURES_X# 
						WHERE 
						(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
							[VIEW.ECRITURES_SELECT_BUDG]
							AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)
						GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
						)
						UNION ALL&quot;;
					}
					EVAL]
					
					(SELECT  
						[VIEW.TAB1_FIELDS],
						[VIEW.ARBRE1_FIELDS], [VIEW.ARBRE2_FIELDS], [VIEW.ARBRE3_FIELDS], 
						[VIEW.ARBRE4_FIELDS], [VIEW.ARBRE5_FIELDS], [VIEW.GROUPBY_FIELDS], 
						[VIEW.GROUPBY_FIELDS], [VIEW.TEXT_FIELDS],
						6, [VIEW.GROUPBY_PADDING],
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
						
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
						
						MAX(fin_exercice), MAX(ajustement)
						
					FROM compta.#V_HISTORIQUE_ECRITURES_X# 
					WHERE 
						(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
							[VIEW.ECRITURES_SELECT_BUDG]
							AND ([VIEW.DATA_FIELD] &lt;&gt; 0 OR [VIEW.DATA_FIELD_B] &lt;&gt; 0)

					GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
						HAVING SUM([VIEW.DATA_FIELD]) &lt;&gt; 0
					)
					
					UNION ALL
					
					(SELECT 
						[VIEW.TAB1_RESUME_FIELDS],
						0, '',  0, '',  0, '',  0, '',  0, '',  0, '',  
						-9999999, 'Total', 'Total',
						9, 0,
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM2] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM0] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable = [VIEW.AM1] THEN [VIEW.DATA_FIELD] ELSE 0 END),
						
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] THEN [VIEW.DATA_FIELD] ELSE 0 END), 
						
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
								
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END), 
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0F] THEN [VIEW.DATA_FIELD] ELSE 0 END) -
						sum(CASE WHEN v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] THEN [VIEW.DATA_FIELD_B] ELSE 0 END),
						
						MAX(fin_exercice), MAX(ajustement)
						
					FROM compta.#V_HISTORIQUE_ECRITURES_X# 
					WHERE 
						(v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X0D] AND [VIEW.X0FF] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X1D] AND [VIEW.X1F] 
							OR v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.X2D] AND [VIEW.X2F]) 
							[VIEW.ECRITURES_SELECT_BUDG]


					)


					ORDER BY 2, 5, 7, 9, 11, 13, 15 ">
				<FIELDS>
					<FIELD name="TABD"/>
					<FIELD name="TABDL"/>
					<FIELD name="TABDLL"/>
					<FIELD name="OID1"/>
					<FIELD name="COD1"/>
					<FIELD name="OID2"/>
					<FIELD name="COD2"/>
					<FIELD name="OID3"/>
					<FIELD name="COD3"/>
					<FIELD name="OID4"/>
					<FIELD name="COD4"/>
					<FIELD name="OID5"/>
					<FIELD name="COD5"/>
					<FIELD name="OID6"/>
					<FIELD name="COD6"/>
					<FIELD name="OID"/>
					<FIELD name="COD"/>
					<FIELD name="TXT"/>
					<FIELD name="LVL"/>
					<FIELD name="PAD"/>
					<FIELD name="SOLM2"/>
					<FIELD name="SOLM1"/>
					<FIELD name="SOLM"/>
					<FIELD name="VARM"/>
					<FIELD name="SOLX2"/>
					<FIELD name="SOLX1"/>
					<FIELD name="SOLX"/>
					<FIELD name="VARX"/>
					<FIELD name="SOLB"/>
					<FIELD name="VARB"/>
					<FIELD name="SOLBT"/>
					<FIELD name="VARBT"/>
					<FIELD name="Q13"/>
					<FIELD name="QAJ"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL>
				<select>
					<![CDATA[
						SELECT 'M2', texte_court 
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'M1', texte_court 
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'M0', texte_court 
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
						UNION
						SELECT 'AM2', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'AM1', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'AM0', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
					]]>
				</select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			
			<SQL enabled="[TYPEPERIODE!=X::false]">
				<select>
					<![CDATA[
						SELECT 'X2', to_char(exercice_comptable,'FM0000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'X1', to_char(exercice_comptable,'FM0000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'X0', to_char(exercice_comptable,'FM0000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]						
						UNION
						SELECT 'X2D', to_char(exercice_mois_comptable_1,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'X2F', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'X1D', to_char(exercice_mois_comptable_1,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'X1F', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'X0D', to_char(exercice_mois_comptable_1,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]	
						UNION
						SELECT 'X0F', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]	
						UNION
						SELECT 'X0FF', to_char(MAX(p_calendrier_mois_2.mois),'FM000000')
							FROM base.p_calendrier_mois
							JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.exercice_comptable = p_calendrier_mois_2.exercice_comptable
							WHERE p_calendrier_mois.mois = [MOIS]	
						UNION
						SELECT 'TOTALP', 
							'Exercice ' || 
							MIN(p_calendrier_mois.annee) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.exercice_comptable = p_calendrier_mois_2.exercice_comptable
						WHERE p_calendrier_mois.mois = [MOIS] AND
							p_calendrier_mois_2.mois <= [MOIS]
						UNION
						SELECT 'TOTALP1', 
							'Exercice ' || 
							MIN(p_calendrier_mois.annee-1) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.exercice_comptable = p_calendrier_mois_2.exercice_comptable
						WHERE p_calendrier_mois.mois = [MOIS] AND
							p_calendrier_mois_2.mois <= [MOIS]
						UNION
						SELECT 'TOTALP2', 
							'Exercice ' || 
							MIN(p_calendrier_mois.annee-2) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.exercice_comptable = p_calendrier_mois_2.exercice_comptable
						WHERE p_calendrier_mois.mois = [MOIS] AND
							p_calendrier_mois_2.mois <= [MOIS]
						UNION
						SELECT 'TOTAL', 
							'Exercice ' || 
							MIN(p_calendrier_mois.annee) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.exercice_comptable = p_calendrier_mois_2.exercice_comptable
						WHERE p_calendrier_mois.mois = [MOIS] 
					]]>
				</select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL enabled="[TYPEPERIODE!=A::false]" >
				<select>
					<![CDATA[
						SELECT 'X2', to_char(annee,'FM0000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'X1', to_char(annee,'FM0000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'X0', to_char(annee,'FM0000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
						UNION
						SELECT 'X2D', to_char(annee * 100 + 1,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'X2F', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 200
						UNION
						SELECT 'X1D', to_char(annee * 100 + 1,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'X1F', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS] - 100
						UNION
						SELECT 'X0D', to_char(annee * 100 + 1,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
						UNION
						SELECT 'X0F', to_char(mois,'FM000000')
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
						UNION
						SELECT 'X0FF', to_char(MAX(p_calendrier_mois_2.mois),'FM000000')
							FROM base.p_calendrier_mois
							JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.annee = p_calendrier_mois_2.annee
							WHERE p_calendrier_mois.mois = [MOIS]
						UNION
						SELECT 'TOTALP', 
							'Année ' || 
							MIN(p_calendrier_mois.annee) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.annee = p_calendrier_mois_2.annee
						WHERE p_calendrier_mois.mois = [MOIS] AND
							p_calendrier_mois_2.mois <= [MOIS]
						UNION
						SELECT 'TOTALP1', 
							'Année ' || 
							MIN(p_calendrier_mois.annee-1) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.annee = p_calendrier_mois_2.annee
						WHERE p_calendrier_mois.mois = [MOIS] AND
							p_calendrier_mois_2.mois <= [MOIS]
						UNION
						SELECT 'TOTALP2', 
							'Année ' || 
							MIN(p_calendrier_mois.annee-2) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.annee = p_calendrier_mois_2.annee
						WHERE p_calendrier_mois.mois = [MOIS] AND
							p_calendrier_mois_2.mois <= [MOIS]
						UNION
						SELECT 'TOTAL', 
							'Année ' || 
							MIN(p_calendrier_mois.annee) || ' (' || 
							(MIN(Array[p_calendrier_mois_2.mois::text, split_part(p_calendrier_mois_2.texte_court,' ',1)]))[2] || ' à ' || 
							(MAX(Array[p_calendrier_mois.mois::text, split_part(p_calendrier_mois.texte_court,' ',1)]))[2] || ')'
						FROM base.p_calendrier_mois
						JOIN base.p_calendrier_mois p_calendrier_mois_2 ON p_calendrier_mois.annee = p_calendrier_mois_2.annee
						WHERE p_calendrier_mois.mois = [MOIS] 
					]]>
				</select>
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<CALCFIELDS>
	</CALCFIELDS>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Liste des écritures" shortLabel="Ecritures" view="COMPTA000025.XML" componentName="ECRITURES_VIEWLINK" component2Name="COMPTA_VIEWLINK">
				<ARG name="MOIS" value="if (COLUMN.NAME == 'SOLM2') {return VIEW.AM2}
										if (COLUMN.NAME == 'SOLM1') {return VIEW.AM1}
										if (COLUMN.NAME == 'SOLM') {return VIEW.AM0}
										if (COLUMN.NAME == 'SOLX2') {return VIEW.X2D}
										if (COLUMN.NAME == 'SOLX1') {return VIEW.X1D}
										if (COLUMN.NAME == 'SOLX') {return VIEW.X0D}
										return VIEW.X0D;
				"/>
				<ARG name="TOMOIS" value="if (COLUMN.NAME == 'SOLM2') {return VIEW.AM2}
										if (COLUMN.NAME == 'SOLM1') {return VIEW.AM1}
										if (COLUMN.NAME == 'SOLM') {return VIEW.AM0}
										if (COLUMN.NAME == 'SOLX2') {return VIEW.X2F}
										if (COLUMN.NAME == 'SOLX1') {return VIEW.X1F}
										if (COLUMN.NAME == 'SOLX') {return VIEW.X0F}
										return VIEW.X0F;
				"/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition mensuelle" label="Répartition mensuelle" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<CHARTx title="Evolution mensuelle" type="lineChart" sortField="TXT" sortSeq="A" condition="Number(ROW.COD) &gt;= 100" maxItems="5" maxItemsSortOn="SOLX" maxItemsSortSeq="D" serieIsCategory="true">
				<CATEGORY field="TXT" type="Char"/> 
				<SERIE field="SOLM01" displayName="VIEW.M1" displayNameCalc="true"/>
				<SERIE field="SOLM02" displayName="VIEW.M2" displayNameCalc="true"/>
				<SERIE field="SOLM04" displayName="VIEW.M3" displayNameCalc="true"/>
				<SERIE field="SOLM04" displayName="VIEW.M4" displayNameCalc="true"/>
				<SERIE field="SOLM05" displayName="VIEW.M5" displayNameCalc="true"/>
				<SERIE field="SOLM06" displayName="VIEW.M6" displayNameCalc="true"/>
				<SERIE field="SOLM07" displayName="VIEW.M7" displayNameCalc="true"/>
				<SERIE field="SOLM08" displayName="VIEW.M8" displayNameCalc="true"/>
				<SERIE field="SOLM09" displayName="VIEW.M9" displayNameCalc="true"/>
				<SERIE field="SOLM10" displayName="VIEW.M10" displayNameCalc="true"/>
				<SERIE field="SOLM11" displayName="VIEW.M11" displayNameCalc="true"/>
				<SERIE field="SOLM12" displayName="VIEW.M12" displayNameCalc="true"/>
			</CHARTx>
			<DATAGRID title="" key="" total="true" headerHeight="60" variableRowHeight="true" sortable="= SELECT.ARBRE1 == '-1' &amp;&amp; SELECT.ARBRE2 == '-1' &amp;&amp; SELECT.ARBRE3 == '-1' &amp;&amp; SELECT.ARBRE4 == '-1' &amp;&amp; SELECT.ARBRE5 == '-1'" totalRowInRows="= ROW.OID == '-9999999'">
				<ROWSTYLE name="fontSize" value="10"/>
				<ROWSTYLE name="backgroundColor" value="0xFFD393" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="borderStyle" value="solid" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="borderThickness" value="2" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="rowHeight" value="36" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="borderSides" value="top bottom" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="backgroundColor" value="0xFFD393" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB == '1'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB == '1'"/>
				<ROWSTYLE name="borderStyle" value="solid" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB == '1'"/>
				<ROWSTYLE name="borderThickness" value="2" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB == '1'"/>
				<ROWSTYLE name="rowHeight" value="36" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB == '1'"/>
				<ROWSTYLE name="borderSides" value="top bottom" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB == '1'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '2'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '3'"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.LVL == '4'"/>
				<ROWSTYLE name="rowHeight" value="24" condition="ROW.LVL == '2' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="rowHeight" value="24" condition="ROW.LVL == '3'"/>
				<ROWSTYLE name="fontSize" value="11" condition="ROW.LVL == '1' &amp;&amp; VIEW.QTAB != '1'"/>
				<ROWSTYLE name="fontSize" value="11" condition="ROW.LVL == '2'"/>
				<COLUMN dataField="LVL" type="Number" headerText="lvl" width="40" visible="false"/>
				<COLUMN dataField="PAD" type="Number" headerText="pad" width="40" visible="false"/>
				<COLUMN dataField="OID1" type="Char" visible="false"/>
				<COLUMN dataField="OID2" type="Char" visible="false"/>
				<COLUMN dataField="OID3" type="Char" visible="false"/>
				<COLUMN dataField="OID4" type="Char" visible="false"/>
				<COLUMN dataField="OID5" type="Char" visible="false"/>
				<COLUMN dataField="OID6" type="Char" visible="false"/>
				<COLUMN dataField="COD1" type="Char" visible="false"/>
				<COLUMN dataField="COD2" type="Char" visible="false"/>
				<COLUMN dataField="COD3" type="Char" visible="false"/>
				<COLUMN dataField="COD4" type="Char" visible="false"/>
				<COLUMN dataField="COD5" type="Char" visible="false"/>
				<COLUMN dataField="COD6" type="Char" visible="false"/>
				<COLUMN dataField="OID" type="Char" visible="false"/>
				<COLUMN dataField="COD" type="Char" width="120" visible="true" headerText="Code" totalFunction="text" totalComplement="">
					<CELLSTYLE name="paddingLeft" value="10" condition="ROW.PAD == '1'"/>
					<CELLSTYLE name="paddingLeft" value="20" condition="ROW.PAD == '2'"/>
					<CELLSTYLE name="paddingLeft" value="30" condition="ROW.PAD == '3'"/>
					<CELLSTYLE name="paddingLeft" value="40" condition="ROW.PAD == '4'"/>
					<CELLSTYLE name="paddingLeft" value="50" condition="ROW.PAD == '5'"/>
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="150" visible="true" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" condition="ROW.QAJ == '1' || ROW.QAJ == '2'"/>
					<CELLSTYLE name="paddingLeft" value="10" condition="ROW.PAD == '1'"/>
					<CELLSTYLE name="paddingLeft" value="20" condition="ROW.PAD == '2'"/>
					<CELLSTYLE name="paddingLeft" value="30" condition="ROW.PAD == '3'"/>
					<CELLSTYLE name="paddingLeft" value="40" condition="ROW.PAD == '4'"/>
					<CELLSTYLE name="paddingLeft" value="50" condition="ROW.PAD == '5'"/>
				</COLUMN>
				<COLUMN dataField="SOLM2" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QSOLDE == '-1'" 
					width="80" fixed="false" headerText="VIEW.M2" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM1" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QSOLDE == '-1'" 
					width="80" headerText="VIEW.M1" headerTextCalc="true" align="right" selectable="true" fixed="false" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QSOLDE == '-1'" 
					width="80" fixed="false" headerText="VIEW.M0" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="VARM" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QSOLDE == '-1'" 
					width="80" fixed="false" headerText="'Var ' + VIEW.M0 + '/' + VIEW.M1" headerTextCalc="true" align="right" totalFunction="" totalComplement="">
				</COLUMN>
				<COLUMN dataField="SOLX2" type="Number" outputFormat="#" width="100" fixed="false" headerText="VIEW.TOTALP2 + ' Total période'" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLX1" type="Number" outputFormat="#" width="100" fixed="false" headerText="VIEW.TOTALP1 + ' Total période'" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLX" type="Number" outputFormat="#" width="100" fixed="false" headerText="VIEW.TOTALP + ' Total période'" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="VARX" type="Number" outputFormat="#" width="100" fixed="false" headerText="'Var ' + VIEW.X0 + '/' + VIEW.X1" headerTextCalc="true" align="right" totalFunction="" totalComplement="">
				</COLUMN>
				<COLUMN dataField="VARXP" type="Number" outputFormat="#%" width="100" fixed="false" headerText="'% var ' + VIEW.X0 + '/' + VIEW.X1" headerTextCalc="true" align="right" totalFunction="" totalComplement="" calc="true">
					<CALC dataField="VARX"/>
					<CALC dataField="SOLX1" operator="/"/>
					<CALC dataField="*constant" value="100" operator="*"/>
				</COLUMN>
				
				<COLUMN dataField="SOLB" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QBUDGET == 'P' || SELECT.QBUDGET == 'PT' "
					width="100" fixed="false" headerText="VIEW.TOTALP + ' Budget'" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="VARB" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QBUDGET == 'P' || SELECT.QBUDGET == 'PT' "
					width="100" fixed="false" headerText="VIEW.TOTALP + ' Ecart Budget'" headerTextCalc="true" align="right" totalFunction="" totalComplement="">
				</COLUMN>
				<COLUMN dataField="VARBP" type="Number" outputFormat="#%" 
					visibleCondition="SELECT.QBUDGET == 'P' || SELECT.QBUDGET == 'PT' "
					width="100" fixed="false" headerText="VIEW.TOTALP + '       % Budget'" headerTextCalc="true" align="right" totalFunction="" totalComplement="" calc="true">
					<CALC dataField="SOLX"/>
					<CALC dataField="SOLB" operator="/"/>
					<CALC dataField="*constant" value="100" operator="*"/>
				</COLUMN>
				
				<COLUMN dataField="SOLBT" type="Number" outputFormat="#" 
					visibleCondition="SELECT.QBUDGET == 'T' || SELECT.QBUDGET == 'PT' "
					width="100" fixed="false" headerText="VIEW.TOTAL + ' Budget Total'" headerTextCalc="true" align="right" selectable="true" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="VARBTP" type="Number" outputFormat="#%" 
					visibleCondition="SELECT.QBUDGET == 'T' || SELECT.QBUDGET == 'PT' "
					width="100" fixed="false" headerText="VIEW.TOTALP + '       % Budget Total'" headerTextCalc="true" align="right" totalFunction="" totalComplement="" calc="true">
					<CALC dataField="SOLX"/>
					<CALC dataField="SOLBT" operator="/"/>
					<CALC dataField="*constant" value="100" operator="*"/>
				</COLUMN>
				
				<COLUMN dataField="QAJ" type="Char" visible="false"/>
				<COLUMN dataField="Q13" type="Char" visible="false"/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
