<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="COMPTA000032" label="Rapport mensuel" title="= SELECT.RAPPORT_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_COMPTA000032.HTML">
	<VIEWPROPERTIES>
		<PROPERTY name="ECRITURES_SELECT" value="[EVAL 
												$select = '';
																								
												if ('[QMOIS]' == '1' &amp; '[Q13]' != '1' &amp; '[QAJ]' != '1') {
													$select = $select . &quot;AND v_historique_ecritures_1.fin_exercice IS DISTINCT FROM '1' AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') &quot; ;
												}
												if ('[QMOIS]' == '1' &amp; '[Q13]' == '1' &amp; '[QAJ]' != '1') {
													$select = $select . &quot;AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') &quot; ;
												}
												if ('[QMOIS]' == '1' &amp; '[Q13]' != '1' &amp; '[QAJ]' == '1') {
													$select = $select . &quot;AND v_historique_ecritures_1.fin_exercice IS DISTINCT FROM '1' &quot; ;
												}
												if ('[QMOIS]' != '1' &amp; '[Q13]' == '1' &amp; '[QAJ]' != '1') {
													$select = $select . &quot;AND v_historique_ecritures_1.fin_exercice = '1' &quot;;
												}
												if ('[QMOIS]' != '1' &amp; '[Q13]' != '1' &amp; '[QAJ]' == '1') {
													$select = $select . &quot;AND v_historique_ecritures_1.ajustement IN ('1','2','3') &quot; ;
												}
												if ('[QMOIS]' != '1' &amp; '[Q13]' == '1' &amp; '[QAJ]' == '1') {
													$select = $select . &quot;AND (v_historique_ecritures_1.fin_exercice = '1' OR v_historique_ecritures_1.ajustement IN ('1','2','3')) &quot; ;
												}
												if ('[QCONS]' != '1') {
													$select = $select . &quot;AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '1' AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '2' &quot; ;
												}
												
												$siteX = '[SITE]';
												$siteCodesX = '[SITE_CODES]';
												
												if ($siteX != '-1') {
													$mode = substr($siteX,0,2);
													$oid = $siteX;
													if ($mode == 'LS') {
														$section_id = 'site_section_id[' . substr($siteX,2,2) . ']';
														$oid = substr($siteX,4);
													}
													if ($mode != 'LI' &amp;&amp; $mode != 'SL' &amp;&amp; $mode != 'LS' &amp;&amp; $siteX != 'SAISIECODE' ) {
														$mode = 'SI';
														$oid = substr($siteX,2);
													}
													if ($mode == 'LI' || $mode == 'SL') {$oid = substr($siteX,2);}
													if ($siteX == 'SAISIECODE') {$where_codes = sql_codes_list_a($siteCodesX, 'code');}
													
													$subselect_select = '';
													
													if ($mode == 'LI') {$subselect_select = &quot; v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)&quot;;}
													if ($mode == 'SL') {$subselect_select = &quot; v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)&quot;;}
													if ($mode == 'LS') {$subselect_select = &quot; v_historique_ecritures_1.$section_id = $oid&quot;;}
													if ($mode == 'SI') {$subselect_select = &quot; v_historique_ecritures_1.site_id = $oid&quot;;}
													if ($siteX == 'SAISIECODE') {$subselect_select = &quot; v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)&quot;;}
													
													if ($subselect_select != '') {$select = $select. &quot; AND $subselect_select &quot;;}

												}
												
												return $select;
									EVAL]"/>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="= var display:String = '';
	
						if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
						}
						else {
							display += '  #B#Type écritures#/B# : ';
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display += 'Mensuelles, Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ != '1') {
								display += 'Mensuelles uniquement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display += 'Mensuelles et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display += 'Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display += 'Ajustement uniquement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
								display += 'Fin exercice uniquement';
							}
							if (SELECT.QCONS == '1') {
								display += '  #B#Ecritures centralisées#/B# : Ajoutées';
							}
							display += '#/B#';
						}
						
						if (SELECT.SITE != '-1') {
							display += '  #B#Site#/B# : ';
							if (SELECT.SITE != 'SAISIECODE') {
								display += SELECT.SITE_LABEL;
							}
							else {
								display += SELECT.SITE_CODES;
							}
						}
						
					
					return display;
					">
		<GROUP label="Période">
			<FIELD name="MOIS" label="" UI="combo" width="150" default="*FIRST" globalListProvider="MOIS">
			</FIELD>
			<FIELD name="TYPEPERIODE" label="" UI="combo" width="150" default="X">
				<OPTION data="X" label="Exercice"/>
				<OPTION data="A" label="Année civile"/>
			</FIELD>
		</GROUP>
		<GROUP label="Périodicité">
			<FIELD name="PERIODICITE" label="" UI="combo" width="250" default="MONTH" visible="= SELECT.TYPEPERIODE == 'A'">
				<OPTION label="Mensuelle" data="MONTH" />
				<OPTION label="Trimestrielle" data="QUARTER" />
			</FIELD>
		</GROUP>
		<GROUP label="Rapport">
			<FIELD name="RAPPORT" label="" UI="combo" width="300" default="0" globalListProvider="RAPPORTS">
			</FIELD>
		</GROUP>
		<GROUP label="Types écritures">
			<FIELD name="QMOIS" label="Mensuelles" UI="check" selectedValue="1" unselectedValue="0" default="1" showIfNotDefault="true"/>
			<FIELD name="Q13" label="Fin exercice" UI="check" selectedValue="1" unselectedValue="0" default="1" showIfNotDefault="true"/>
			<FIELD name="QAJ" label="Ajustement" UI="check" selectedValue="1" unselectedValue="0" default="0" showIfNotDefault="true"/>
			<FIELD name="QCONS" label="Centralisées" UI="check" selectedValue="1" unselectedValue="0" default="0" showIfNotDefault="true"/>
		</GROUP>
		<GROUP label="">
			<FIELD name="SITE" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE"  showIfNotDefault="true" />
			<FIELD name="SITE_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.SITE == 'SAISIECODE' " />
		</GROUP>
	</SELECTIONS>
	<QUERIES>
		<QUERY>
			<SQL optimizer="V_HISTORIQUE_ECRITURES_X" cacheEnabled="true" select="
						DROP TABLE IF EXISTS w_rapport;        
						CREATE TEMP TABLE w_rapport AS       

						SELECT 1 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD1] AND [VIEW.AM1] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 2 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD2] AND [VIEW.AM2] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 3 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD3] AND [VIEW.AM3] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 4 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD4] AND [VIEW.AM4] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 5 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD5] AND [VIEW.AM5] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 6 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD6] AND [VIEW.AM6] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS][VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 7 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD7] AND [VIEW.AM7] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 8 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD8] AND [VIEW.AM8] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 9 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD9] AND [VIEW.AM9] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 10 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD10] AND [VIEW.AM10] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 11 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD11] AND [VIEW.AM11] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   
						UNION ALL
						SELECT 12 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD12] AND [VIEW.AM12] AND v_historique_ecritures_1.mois_comptable &lt;= [MOIS] [VIEW.ECRITURES_SELECT])   

						UNION
						SELECT 13 as col,   
							[VIEW.RAPPORT_INDICATEURS]
							FROM compta.#V_HISTORIQUE_ECRITURES_X#  
							WHERE (v_historique_ecritures_1.mois_comptable BETWEEN [VIEW.AD1] AND [MOIS] [VIEW.ECRITURES_SELECT])   
						;        

						SELECT t_rapports_rubriques.numero_rubrique, 
							CASE WHEN t_indicateurs.table_name = 'v_historique_ecritures_1' THEN t_rapports_rubriques.indicateur_id ELSE -1 END,
							CASE WHEN t_indicateurs.column_name LIKE '''H''' THEN 'H' ELSE 'C' END,        
							CASE WHEN t_rapports_rubriques.entete_etendue &lt;&gt; '' THEN t_rapports_rubriques.entete_etendue ELSE t_indicateurs.entete_etendue END,
							CASE WHEN t_rapports_rubriques.output_format &lt;&gt; '' THEN t_rapports_rubriques.output_format ELSE t_indicateurs.output_format END,
							row_height, padding, font_size, font_weight, border_thickness, color, background_color,               

							sum(CASE WHEN col = 1 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),         
							sum(CASE WHEN col = 2 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),         
							sum(CASE WHEN col = 3 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),        
							sum(CASE WHEN col = 4 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 5 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 6 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 7 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 8 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 9 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 10 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 11 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 12 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END),   
							sum(CASE WHEN col = 13 THEN indicateurs[t_rapports_rubriques.numero_rubrique]::integer ELSE 0 END)   
							     

						FROM compta.t_rapports_rubriques, compta.t_indicateurs, w_rapport
						WHERE 
							t_rapports_rubriques.rapport_id = [RAPPORT]
							AND t_rapports_rubriques.indicateur_id = t_indicateurs.oid
							
						GROUP BY t_rapports_rubriques.numero_rubrique, 
								CASE WHEN t_indicateurs.table_name = 'v_historique_ecritures_1' THEN t_rapports_rubriques.indicateur_id ELSE -1 END, 
								CASE WHEN t_indicateurs.column_name LIKE '''H''' THEN 'H' ELSE 'C' END,     
								CASE WHEN t_rapports_rubriques.entete_etendue &lt;&gt; '' THEN t_rapports_rubriques.entete_etendue ELSE t_indicateurs.entete_etendue END,
								CASE WHEN t_rapports_rubriques.output_format &lt;&gt; '' THEN t_rapports_rubriques.output_format ELSE t_indicateurs.output_format END,
								row_height, padding, font_size, font_weight, border_thickness, color, background_color

						ORDER BY 1
					 ">
				<FIELDS>
					<FIELD name="OID"/>
					<FIELD name="IID"/>
					<FIELD name="ICH"/>
					<FIELD name="TXT"/>
					<FIELD name="FMT"/>
					<FIELD name="ROWHEI"/>
					<FIELD name="PAD"/>
					<FIELD name="FNTSIZ"/>
					<FIELD name="FNTWEI"/>
					<FIELD name="BRDTHI"/>
					<FIELD name="FNTCOL"/>
					<FIELD name="BAKCOL"/>
					<FIELD name="SOLM01"/>
					<FIELD name="SOLM02"/>
					<FIELD name="SOLM03"/>
					<FIELD name="SOLM04"/>
					<FIELD name="SOLM05"/>
					<FIELD name="SOLM06"/>
					<FIELD name="SOLM07"/>
					<FIELD name="SOLM08"/>
					<FIELD name="SOLM09"/>
					<FIELD name="SOLM10"/>
					<FIELD name="SOLM11"/>
					<FIELD name="SOLM12"/>
					<FIELD name="SOLX"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL enabled="[TYPEPERIODE!=X::false]" select="
							SELECT 'M' || p_mois_comptables_2.mois - p_mois_comptables.exercice_mois_comptable_1 + 1 - CASE WHEN p_mois_comptables_2.mois - p_mois_comptables.exercice_mois_comptable_1 > 12 THEN 88 ELSE 0 END, 
							p_mois_comptables_2.texte_court 
							FROM base.p_calendrier_mois p_mois_comptables, base.p_calendrier_mois p_mois_comptables_2 
							WHERE p_mois_comptables.mois = [MOIS] AND
								 p_mois_comptables_2.mois &gt;= p_mois_comptables.exercice_mois_comptable_1 AND 
								 p_mois_comptables_2.mois &lt;= p_mois_comptables.exercice_mois_comptable_1 + 99
						UNION
						SELECT 'TOTAL',	'Exercice ' || exercice_comptable 
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL enabled="[TYPEPERIODE!=X::false]" select="
							SELECT 'AM' || p_mois_comptables_2.mois - p_mois_comptables.exercice_mois_comptable_1 + 1 - CASE WHEN p_mois_comptables_2.mois - p_mois_comptables.exercice_mois_comptable_1 > 12 THEN 88 ELSE 0 END, 
							p_mois_comptables_2.mois
							FROM base.p_calendrier_mois p_mois_comptables, base.p_calendrier_mois p_mois_comptables_2 
							WHERE p_mois_comptables.mois = [MOIS] AND
								 p_mois_comptables_2.mois &gt;= p_mois_comptables.exercice_mois_comptable_1 AND 
								 p_mois_comptables_2.mois &lt;= p_mois_comptables.exercice_mois_comptable_1 + 99
							UNION
							SELECT 'AD' || p_mois_comptables_2.mois - p_mois_comptables.exercice_mois_comptable_1 + 1 - CASE WHEN p_mois_comptables_2.mois - p_mois_comptables.exercice_mois_comptable_1 > 12 THEN 88 ELSE 0 END, 
							p_mois_comptables_2.mois
							FROM base.p_calendrier_mois p_mois_comptables, base.p_calendrier_mois p_mois_comptables_2 
							WHERE p_mois_comptables.mois = [MOIS] AND
								 p_mois_comptables_2.mois &gt;= p_mois_comptables.exercice_mois_comptable_1 AND 
								 p_mois_comptables_2.mois &lt;= p_mois_comptables.exercice_mois_comptable_1 + 99
							 
							 ">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL enabled="[TYPEPERIODE!=A::false]" select="SELECT 'M' ||  (mois - (annee * 100)), texte_court 
							FROM base.p_calendrier_mois
							WHERE annee = [MOIS] / 100
						UNION
						SELECT 'TOTAL', 'Année ' || annee 
							FROM base.p_calendrier_mois
							WHERE mois = [MOIS]
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL enabled="[TYPEPERIODE!=A::false]" select="
							SELECT 'AM' ||  (mois - (annee * 100)), mois 
							FROM base.p_calendrier_mois
							WHERE annee = [MOIS] / 100
							UNION
							SELECT 'AD' ||  (mois - (annee * 100)), 
								CASE 
								WHEN '[DATA]' IN ('SCX', 'SDX') THEN annee*100+1 
								WHEN '[PERIODICITE]' = 'QUARTER' AND NUMERO_MOIS BETWEEN 1 AND 3 THEN annee*100+1 
								WHEN '[PERIODICITE]' = 'QUARTER' AND NUMERO_MOIS BETWEEN 4 AND 6 THEN annee*100+4 
								WHEN '[PERIODICITE]' = 'QUARTER' AND NUMERO_MOIS BETWEEN 7 AND 9 THEN annee*100+7 
								WHEN '[PERIODICITE]' = 'QUARTER' AND NUMERO_MOIS BETWEEN 10 AND 12 THEN annee*100+10 
								ELSE mois END
							FROM base.p_calendrier_mois
							WHERE annee = [MOIS] / 100
						">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL enabled="[TYPEPERIODE!=12::false]" select="SELECT 'M' ||  CASE WHEN mois - [MOIS] + 100 &lt;= 12 THEN mois - [MOIS] + 100 ELSE mois - [MOIS] + 12 END,	texte_court 
							FROM base.p_calendrier_mois
							WHERE mois &gt; [MOIS] - 100 AND mois &lt;= [MOIS]
						UNION
						SELECT  'TOTAL', p_calendrier_mois.texte_court || ' - ' || p_calendrier_mois_2.texte_court
							FROM base.p_calendrier_mois, base.p_calendrier_mois p_calendrier_mois_2 
							WHERE (p_calendrier_mois.mois = [MOIS] - 99 and p_calendrier_mois_2.mois = [MOIS])
							   OR (p_calendrier_mois.mois = [MOIS] - 11 and p_calendrier_mois_2.mois = [MOIS])
							">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL enabled="[TYPEPERIODE!=12::false]" select="
							SELECT 'AM' ||  CASE WHEN mois - [MOIS] + 100 &lt;= 12 THEN mois - [MOIS] + 100 ELSE mois - [MOIS] + 12 END, mois 
							FROM base.p_calendrier_mois
							WHERE mois &gt; [MOIS] - 100 AND mois &lt;= [MOIS]
							UNION
							SELECT 'AD' ||  CASE WHEN mois - [MOIS] + 100 &lt;= 12 THEN mois - [MOIS] + 100 ELSE mois - [MOIS] + 12 END, mois 
							FROM base.p_calendrier_mois
							WHERE mois &gt; [MOIS] - 100 AND mois &lt;= [MOIS]
							">
				<FIELDS>
					<FIELD name="name"/>
					<FIELD name="value"/>
				</FIELDS>
			</SQL>
			<SQL select="select 'RAPPORT_INDICATEURS', compta.get_rapport_indicateurs([RAPPORT]) ">
				<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">
				<ARG name="MOIS" value="if (COLUMN.NAME == 'SOLM01') {return VIEW.AM1}
										if (COLUMN.NAME == 'SOLM02') {return VIEW.AM2}
										if (COLUMN.NAME == 'SOLM03') {return VIEW.AM3}
										if (COLUMN.NAME == 'SOLM04') {return VIEW.AM4}
										if (COLUMN.NAME == 'SOLM05') {return VIEW.AM5}
										if (COLUMN.NAME == 'SOLM06') {return VIEW.AM6}
										if (COLUMN.NAME == 'SOLM07') {return VIEW.AM7}
										if (COLUMN.NAME == 'SOLM08') {return VIEW.AM8}
										if (COLUMN.NAME == 'SOLM09') {return VIEW.AM9}
										if (COLUMN.NAME == 'SOLM10') {return VIEW.AM10}
										if (COLUMN.NAME == 'SOLM11') {return VIEW.AM11}
										if (COLUMN.NAME == 'SOLM12') {return VIEW.AM12}
										return VIEW.AM1;
				"/>
				<ARG name="TOMOIS" value="if (COLUMN.NAME == 'SOLM01') {return VIEW.AM1}
										if (COLUMN.NAME == 'SOLM02') {return VIEW.AM2}
										if (COLUMN.NAME == 'SOLM03') {return VIEW.AM3}
										if (COLUMN.NAME == 'SOLM04') {return VIEW.AM4}
										if (COLUMN.NAME == 'SOLM05') {return VIEW.AM5}
										if (COLUMN.NAME == 'SOLM06') {return VIEW.AM6}
										if (COLUMN.NAME == 'SOLM07') {return VIEW.AM7}
										if (COLUMN.NAME == 'SOLM08') {return VIEW.AM8}
										if (COLUMN.NAME == 'SOLM09') {return VIEW.AM9}
										if (COLUMN.NAME == 'SOLM10') {return VIEW.AM10}
										if (COLUMN.NAME == 'SOLM11') {return VIEW.AM11}
										if (COLUMN.NAME == 'SOLM12') {return VIEW.AM12}
										return SELECT.MOIS;
								"/>
				<ARG name="CH" value="return ROW.ICH
								"/>
				<ARG name="INDICATEUR" value="return ROW.IID
								"/>
				<ARG name="JOURNAL_C" value="'-1'"/>
				<ARG name="JOURNAL_C_CODES" value=""/>
				<ARG name="TYPE_COMPTA_C" value="'-1'"/>
				<ARG name="COMPTE_C" value="'-1'"/>
				<ARG name="COMPTE_C_CODES" value=""/>
				<ARG name="COMPTE_EXTRA_C" value="'-1'"/>
				<ARG name="COMPTE_EXTRA_C_CODES" value=""/>
				<ARG name="SECTION_ANALYTIQUE_C" value="'-1'"/>
				<ARG name="JOURNAL_H" value="'-1'"/>
				<ARG name="JOURNAL_H_CODES" value=""/>
				<ARG name="TYPE_COMPTA_H" value="'-1'"/>
				<ARG name="COMPTE_H" value="'-1'"/>
				<ARG name="COMPTE_H_CODES" value=""/>
				<ARG name="COMPTE_EXTRA_H" value="'-1'"/>
				<ARG name="COMPTE_EXTRA_H_CODES" value=""/>
				<ARG name="FACTURE" value=""/>
				<ARG name="TEXTE" value=""/>
				<ARG name="MONTANT" value=""/>
				<ARG name="SENS" value=""/>
				<ARG name="CLE" value=""/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Répartition mensuelle" label="Répartition mensuelle">
			<DATAGRID title="" total="false" headerHeight="36" variableRowHeight="true" sortable="false">
				<ROWSTYLE name="fontSize" value="10"/>
				<ROWSTYLE name="fontSize" value="= ROW.FNTSIZ.toString()" condition="Number(ROW.FNTSIZ) &gt;= 8"/>
				<ROWSTYLE name="fontWeight" value="bold" condition="ROW.FNTWEI == 'bold'"/>
				<ROWSTYLE name="rowHeight" value="= ROW.ROWHEI.toString()" condition="Number(ROW.ROWHEI) &gt; 0"/>
				<ROWSTYLE name="borderSides" value="top bottom" condition="Number(ROW.BRDTHI) &gt; 0"/>
				<ROWSTYLE name="borderStyle" value="solid" condition="Number(ROW.BRDTHI) &gt; 0"/>
				<ROWSTYLE name="borderThickness" value="= ROW.BRDTHI.toString()" condition="Number(ROW.BRDTHI) == 2"/>
				<ROWSTYLE name="color" value="= ROW.FNTCOL.toString()" condition="ROW.FNTCOL != '' "/>
				<ROWSTYLE name="backgroundColor" value="= ROW.BAKCOL.toString()" condition="ROW.BAKCOL != '' "/>
				<COLUMN dataField="SEP" type="Char" visible="false"/>
				<COLUMN dataField="OID" type="Char" visible="false"/>
				<COLUMN dataField="IID" type="Char" visible="false"/>
				<COLUMN dataField="ICH" type="Char" visible="false"/>
				<COLUMN dataField="FMT" type="Char" visible="false"/>
				<COLUMN dataField="ROWHEI" type="Char" visible="false"/>
				<COLUMN dataField="PAD" type="Char" visible="false"/>
				<COLUMN dataField="FNTSIZ" type="Char" visible="false"/>
				<COLUMN dataField="FNTWEI" type="Char" visible="false"/>
				<COLUMN dataField="BRDTHI" type="Char" visible="false"/>
				<COLUMN dataField="FNTCOL" type="Char" visible="false"/>
				<COLUMN dataField="BAKCOL" type="Char" visible="false"/>
				<COLUMN dataField="TXT" type="Char" minWidth="150" visible="true" headerText="Indicateur" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLEx name="cellIndicator" value="circle, 5, right top, 0xFF6600" condition="ROW.QAJ == '1' || ROW.QAJ == '2'"/>
					<CELLSTYLE name="paddingLeft" value="= ROW.PAD" condition="Number(ROW.PAD) &gt; 0"/>
				</COLUMN>
				<COLUMN dataField="SOLM01" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M1"  headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM02" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M2"  headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM03" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M3"  headerTextCalc="true" selectable="true" visible="true"
					align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM04" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M4"  headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM05" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M5"  headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM06" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M6"  headerTextCalc="true" selectable="true" visible="true"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM07" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M7"  headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM08" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M8"  headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM09" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M9"  headerTextCalc="true" selectable="true" visible="true"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM10" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M10" headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM11" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M11" headerTextCalc="true" selectable="true" visibleCondition="SELECT.TYPEPERIODE != 'A' || SELECT.PERIODICITE != 'QUARTER'"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM12" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" headerText="VIEW.M12" headerTextCalc="true" selectable="true" visible="true"
					 align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLX" type="Number" outputFormat="= ROW.FMT" width="90" fixed="true" headerText="VIEW.TOTAL"  headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement="">
				</COLUMN>
				<COLUMN dataField="QAJ" type="Char" visible="false"/>
				<COLUMN dataField="Q13" type="Char" visible="false"/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
