<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="COMPTA0000113" label="Rapport hebdomadaire" title="= SELECT.RAPPORT_LABEL + ' - ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_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="PERIODE" label="Période" UI="combo" tree="true" width="200" default="2015-01-01" globalListProvider="DATE_DEBUT">
			</FIELD>
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2015-01-31" globalListProvider="DATE_FIN">
			</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" >
				<select><![CDATA[
					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.exercice_comptable = [VIEW.DX01] AND v_historique_ecritures_1.date_ecriture <= '[VIEW.DF01]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 2 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX02] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD02]' AND '[VIEW.DF02]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 3 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX03] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD03]' AND '[VIEW.DF03]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 4 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX04] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD04]' AND '[VIEW.DF04]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 5 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX05] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD05]' AND '[VIEW.DF05]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 6 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX06] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD06]' AND '[VIEW.DF06]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 7 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX07] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD07]' AND '[VIEW.DF07]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 8 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX08] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD08]' AND '[VIEW.DF08]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 9 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX09] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD09]' AND '[VIEW.DF09]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 10 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX10] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD10]' AND '[VIEW.DF10]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 11 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX11] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD11]' AND '[VIEW.DF11]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 12 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX12] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD12]' AND '[VIEW.DF12]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 13 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX13] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD13]' AND '[VIEW.DF13]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 14 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX14] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD14]' AND '[VIEW.DF14]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 15 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX15] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD15]' AND '[VIEW.DF15]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 16 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX16] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD16]' AND '[VIEW.DF16]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 17 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX17] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD17]' AND '[VIEW.DF17]' [VIEW.ECRITURES_SELECT])   
					UNION ALL
					SELECT 18 as col,   
						[VIEW.RAPPORT_INDICATEURS]
						FROM compta.#V_HISTORIQUE_ECRITURES_X#  
						WHERE (v_historique_ecritures_1.exercice_comptable = [VIEW.DX18] AND v_historique_ecritures_1.date_ecriture BETWEEN '[VIEW.DD18]' AND '[VIEW.DF18]' [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 <> '' THEN t_rapports_rubriques.entete_etendue ELSE t_indicateurs.entete_etendue END,
						CASE WHEN t_rapports_rubriques.output_format <> '' 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] ELSE 0 END),         
						sum(CASE WHEN col <= 2 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),         
						sum(CASE WHEN col <= 3 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),        
						sum(CASE WHEN col <= 4 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 5 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 6 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 7 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 8 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 9 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 10 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 11 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 12 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 13 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 14 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 15 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 16 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 17 THEN indicateurs[t_rapports_rubriques.numero_rubrique] ELSE 0 END),   
						sum(CASE WHEN col <= 18 THEN indicateurs[t_rapports_rubriques.numero_rubrique] 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 <> '' THEN t_rapports_rubriques.entete_etendue ELSE t_indicateurs.entete_etendue END,
							CASE WHEN t_rapports_rubriques.output_format <> '' 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
					
				]]></select>
				<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="SOLM13"/>
					<FIELD name="SOLM14"/>
					<FIELD name="SOLM15"/>
					<FIELD name="SOLM16"/>
					<FIELD name="SOLM17"/>
					<FIELD name="SOLM18"/>
				</FIELDS>
			</SQL>
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
			<SQL optimizer="">
				<select><![CDATA[
					DROP SEQUENCE IF EXISTS w_semaine_seq;
					CREATE TEMP SEQUENCE w_semaine_seq;

					DROP TABLE IF EXISTS w_semaine;
					CREATE TEMP TABLE w_semaine AS
					SELECT *, nextval('w_semaine_seq'::regclass) AS semaine_seq
					FROM
					(
					SELECT p_calendrier_mois.exercice_comptable,
						p_calendrier_mois.exercice_comptable * 100 + p_calendrier_semaine.iso_semaine AS semaine,
						MIN(p_calendrier_semaine.date) AS date_debut,
						MAX(p_calendrier_semaine.date) AS date_fin
					FROM base.p_calendrier
					JOIN base.p_calendrier p_calendrier_semaine ON 
						p_calendrier.iso_annee = p_calendrier_semaine.iso_annee AND
						p_calendrier.iso_semaine = p_calendrier_semaine.iso_semaine
					JOIN base.p_calendrier_mois ON p_calendrier_semaine.mois = p_calendrier_mois.mois
					WHERE p_calendrier.date BETWEEN '[PERIODE]' AND '[TOPERIODE]'
					GROUP BY 1,2
					ORDER BY 4
					) subview;


					INSERT INTO w_semaine
					SELECT 0000, 000000, '00010101'::date, '00010101'::date, semaine_noseq
					FROM
					(
						SELECT 01 AS semaine_noseq
						UNION
						SELECT 02 AS semaine_noseq
						UNION
						SELECT 03 AS semaine_noseq
						UNION
						SELECT 04 AS semaine_noseq
						UNION
						SELECT 05 AS semaine_noseq
						UNION
						SELECT 06 AS semaine_noseq
						UNION
						SELECT 07 AS semaine_noseq
						UNION
						SELECT 08 AS semaine_noseq
						UNION
						SELECT 09 AS semaine_noseq
						UNION
						SELECT 10 AS semaine_noseq
						UNION
						SELECT 11 AS semaine_noseq
						UNION
						SELECT 12 AS semaine_noseq
						UNION
						SELECT 13 AS semaine_noseq
						UNION
						SELECT 14 AS semaine_noseq
						UNION
						SELECT 15 AS semaine_noseq
						UNION
						SELECT 16 AS semaine_noseq
						UNION
						SELECT 17 AS semaine_noseq
						UNION
						SELECT 18 AS semaine_noseq
					) subview
					WHERE semaine_noseq NOT IN (SELECT semaine_seq FROM w_semaine)
					;
					
					SELECT 'DD' || to_char(semaine_seq,'FM00'), date_debut::text
					FROM w_semaine
					UNION
					SELECT 'DF' || to_char(semaine_seq,'FM00'), date_fin::text
					FROM w_semaine
					UNION
					SELECT 'DX' || to_char(semaine_seq,'FM00'), exercice_comptable::text
					FROM w_semaine
					UNION
					SELECT 'DH' || to_char(semaine_seq,'FM00'), date_fin::text
					FROM w_semaine
					ORDER BY 1;
					
				]]></select>
				<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.DH01" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM02" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH02 != '0001-01-01'" headerText="VIEW.DH02" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM03" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH03 != '0001-01-01'" headerText="VIEW.DH03" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM04" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH04 != '0001-01-01'" headerText="VIEW.DH04" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM05" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH05 != '0001-01-01'" headerText="VIEW.DH05" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM06" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH06 != '0001-01-01'" headerText="VIEW.DH06" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM07" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH07 != '0001-01-01'" headerText="VIEW.DH07" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM08" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH08 != '0001-01-01'" headerText="VIEW.DH08" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM09" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH09 != '0001-01-01'" headerText="VIEW.DH09" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM10" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH10 != '0001-01-01'" headerText="VIEW.DH10" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM11" type="Number" outputFormat="= ROW.FMT" width="90" fixed="false" visibleCondition="VIEW.DH11 != '0001-01-01'" headerText="VIEW.DH11" headerTextCalc="true" selectable="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM12" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH12 != '0001-01-01'" fixed="false" headerText="VIEW.DH12" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM13" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH13 != '0001-01-01'" fixed="false" headerText="VIEW.DH13" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM14" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH14 != '0001-01-01'" fixed="false" headerText="VIEW.DH14" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM15" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH15 != '0001-01-01'" fixed="false" headerText="VIEW.DH15" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM16" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH16 != '0001-01-01'" fixed="false" headerText="VIEW.DH16" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM17" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH17 != '0001-01-01'" fixed="false" headerText="VIEW.DH17" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				<COLUMN dataField="SOLM18" type="Number" outputFormat="= ROW.FMT" width="90" visibleCondition="VIEW.DH18 != '0001-01-01'" fixed="false" headerText="VIEW.DH18" selectable="true" headerTextCalc="true" align="right" treeSubTotalFunction="sum" treeSubTotalComplement="" totalFunction="sum" totalComplement=""/>
				
				<COLUMN dataField="QAJ" type="Char" visible="false"/>
				<COLUMN dataField="Q13" type="Char" visible="false"/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
