<?xml version="1.0" encoding="ISO-8859-15"?>
<COMPONENTS>

	<COMPONENT name="ECRITURES_SELECTIONS" label="Filtre écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = '';
					
					$select = $select . "AND v_historique_ecritures_1.clinique_honoraire = '[CH]' " ;
																	
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice = '1' ";
					}
					if ('[QMOIS]' != '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement IN ('1','2','3') " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' == '1') {
						$select = $select . "AND (v_historique_ecritures_1.fin_exercice = '1' OR v_historique_ecritures_1.ajustement IN ('1','2','3')) " ;
					}
					if ('[QINTER]' == 'I') {
						$select = $select . "AND v_historique_ecritures_1.inter_site = '1' " ;
					}
					if ('[QINTER]' == 'O') {
						$select = $select . "AND v_historique_ecritures_1.inter_site <> '1' " ;
					}
					
					if ('[QCONS]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '1' AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '2' " ;
					}

					$JOURNAL_X = '-1';
					$JOURNAL_X_CODES = '';
					$COMPTE_X = '-1';
					$COMPTE_X_CODES = '';
					$COMPTE_EXTRA_X = '-1';
					$COMPTE_EXTRA_X_CODES = '';
					$TYPE_COMPTA_X = '-1';
					$TYPE_COMPTA_X_CODES = '';
					$TYPE_COMPTA_EXTRA_X = '-1';
					$TYPE_COMPTA_EXTRA_X_CODES = '';
					$COMPTE_BUDGET_X = '-1';
					$COMPTE_BUDGET_X_CODES = '';
					$PARTENAIRE_X = '-1';
					$PARTENAIRE_X_CODES = '';
                    $POLE_X = '[POLE]';
					$POLE_X_CODES = '[POLE_CODES]';
					$SITE_X = '-1';
					$SITE_X_CODES = '';
					$SECTION_ANALYTIQUE_X = '-1';
					if ('[CH]' == 'C' ) {
						$JOURNAL_X = '[JOURNAL_C]';
						$JOURNAL_X_CODES = '[JOURNAL_C_CODES]';
						$COMPTE_X = '[COMPTE_C]';
						$COMPTE_X_CODES = '[COMPTE_C_CODES]';
                        $COMPTE_CONTRE_X = '[COMPTE_CONTRE_C]';
						$COMPTE_CONTRE_X_CODES = '[COMPTE_CONTRE_C_CODES]';
						$COMPTE_EXTRA_X = '[COMPTE_EXTRA_C]';
						$COMPTE_EXTRA_X_CODES = '[COMPTE_EXTRA_C_CODES]';
						$TYPE_COMPTA_X = '[TYPE_COMPTA_C]';
						$TYPE_COMPTA_X_CODES = '[TYPE_COMPTA_C_CODES]';
						$TYPE_COMPTA_EXTRA_X = '[TYPE_COMPTA_EXTRA_C]';
						$TYPE_COMPTA_EXTRA_X_CODES = '[TYPE_COMPTA_EXTRA_C_CODES]';
						$COMPTE_BUDGET_X = '[COMPTE_BUDGET_C]';
						$COMPTE_BUDGET_X_CODES = '[COMPTE_BUDGET_C_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
						$SECTION_ANALYTIQUE_X = '[SECTION_ANALYTIQUE_C]';
						$SECTION_ANALYTIQUE_2_X = '[SECTION_ANALYTIQUE_2_C]';
						$SECTION_ANALYTIQUE_3_X = '[SECTION_ANALYTIQUE_3_C]';
						$SECTION_ANALYTIQUE_4_X = '[SECTION_ANALYTIQUE_4_C]';
						$SECTION_ANALYTIQUE_5_X = '[SECTION_ANALYTIQUE_5_C]';
						$SECTION_ANALYTIQUE_6_X = '[SECTION_ANALYTIQUE_6_C]';
                        $SECTION_ANALYTIQUE_7_X = '[SECTION_ANALYTIQUE_7_C]';
                        $SECTION_ANALYTIQUE_8_X = '[SECTION_ANALYTIQUE_8_C]';
                        $SECTION_ANALYTIQUE_9_X = '[SECTION_ANALYTIQUE_9_C]';
					}
					if ('[CH]' == 'H' ) {
						$JOURNAL_X = '[JOURNAL_H]';
						$JOURNAL_X_CODES = '[JOURNAL_H_CODES]';
						$COMPTE_X = '[COMPTE_H]';
						$COMPTE_X_CODES = '[COMPTE_H_CODES]';
                        $COMPTE_CONTRE_X = '-1';
						$COMPTE_CONTRE_X_CODES = '';
						$COMPTE_EXTRA_X = '[COMPTE_EXTRA_H]';
						$COMPTE_EXTRA_X_CODES = '[COMPTE_EXTRA_H_CODES]';
						$TYPE_COMPTA_X = '[TYPE_COMPTA_H]';
						$TYPE_COMPTA_X_CODES = '[TYPE_COMPTA_H_CODES]';
						$TYPE_COMPTA_EXTRA_X = '[TYPE_COMPTA_EXTRA_H]';
						$TYPE_COMPTA_EXTRA_X_CODES = '[TYPE_COMPTA_EXTRA_H_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
						$SECTION_ANALYTIQUE_X = '-1';
						$SECTION_ANALYTIQUE_2_X = '-1';
						$SECTION_ANALYTIQUE_3_X = '-1';
						$SECTION_ANALYTIQUE_4_X = '-1';
						$SECTION_ANALYTIQUE_5_X = '-1';
						$SECTION_ANALYTIQUE_6_X = '-1';
                        $SECTION_ANALYTIQUE_7_X = '-1';
                        $SECTION_ANALYTIQUE_8_X = '-1';
                        $SECTION_ANALYTIQUE_9_X = '-1';
					}
					
					if ($JOURNAL_X != '-1') {
						$mode = substr($JOURNAL_X,0,2);
						$oid = $JOURNAL_X;
						if ($mode == 'LS') {
							$section_id = 'journal_section_id[' . substr($JOURNAL_X,2,2) . ']';
							$oid = substr($JOURNAL_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $JOURNAL_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($JOURNAL_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($JOURNAL_X,2);}
						if ($JOURNAL_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($JOURNAL_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.journal_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.journal_id = $oid";}
						if ($JOURNAL_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($COMPTE_X != '-1') {
						$mode = substr($COMPTE_X,0,2);
						$oid = $COMPTE_X;
						if ($mode == 'LS') {
							$section_id = 'compte_section_id[' . substr($COMPTE_X,2,2) . ']';
							$oid = substr($COMPTE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_X,2);}
						if ($COMPTE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " (
																v_historique_ecritures_1.compte_signe_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid) OR
																v_historique_ecritures_1.compte_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)
																)";}
						if ($mode == 'SL') {$subselect_select = " (
																v_historique_ecritures_1.compte_signe_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid) AND
																v_historique_ecritures_1.compte_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)
																)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_X == 'SAISIECODE') {$subselect_select = " (
																v_historique_ecritures_1.compte_signe_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes) OR
																v_historique_ecritures_1.compte_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)
																)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
                    if ($COMPTE_CONTRE_X != '-1') {
						$mode = substr($COMPTE_CONTRE_X,0,2);
						$oid = $COMPTE_CONTRE_X;
						if ($mode == 'LS') {
							$section_id = 'compte_contrepartie_section_id[' . substr($COMPTE_CONTRE_X,2,2) . ']';
							$oid = substr($COMPTE_CONTRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_CONTRE_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_CONTRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_CONTRE_X,2);}
						if ($COMPTE_CONTRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_CONTRE_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.compte_contrepartie_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid) ";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.compte_contrepartie_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid) ";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_contrepartie_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (
                                                                v_historique_ecritures_1.compte_contrepartie_classe_1_id = $oid OR 
                                                                v_historique_ecritures_1.compte_contrepartie_classe_2_id = $oid OR
                                                                v_historique_ecritures_1.compte_contrepartie_classe_3_id = $oid OR 
                                                                v_historique_ecritures_1.compte_contrepartie_classe_4_id = $oid OR 
                                                                v_historique_ecritures_1.compte_contrepartie_classe_5_id = $oid
                                                                    )";}
						if ($COMPTE_CONTRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.compte_contrepartie_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes) ";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($COMPTE_EXTRA_X != '-1') {
						$mode = substr($COMPTE_EXTRA_X,0,2);
						$oid = $COMPTE_EXTRA_X;
						if ($mode == 'LS') {
							$section_id = 'compte_extra_section_id[' . substr($COMPTE_EXTRA_X,2,2) . ']';
							$oid = substr($COMPTE_EXTRA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_EXTRA_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_EXTRA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_EXTRA_X,2);}
						if ($COMPTE_EXTRA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_EXTRA_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.compte_extra_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.compte_extra_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_extra_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_EXTRA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.compte_extra_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($COMPTE_BUDGET_X != '-1') {
						$mode = substr($COMPTE_BUDGET_X,0,2);
						$oid = $COMPTE_BUDGET_X;
						if ($mode == 'LS') {
							$section_id = 'compte_budget_section_id[' . substr($COMPTE_BUDGET_X,2,2) . ']';
							$oid = substr($COMPTE_BUDGET_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_BUDGET_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_BUDGET_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_BUDGET_X,2);}
						if ($COMPTE_BUDGET_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_BUDGET_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.compte_budget_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.compte_budget_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_budget_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_BUDGET_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.compte_budget_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($PARTENAIRE_X != '-1') {
						$mode = substr($PARTENAIRE_X,0,2);
						$oid = $PARTENAIRE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($PARTENAIRE_X,2,2) . ']';
							$oid = substr($PARTENAIRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $PARTENAIRE_X != 'SAISIECODE' ) {
							$mode = 'PA';
							$oid = substr($PARTENAIRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($PARTENAIRE_X,2);}
						if ($PARTENAIRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($PARTENAIRE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.partenaire_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'PA') {$subselect_select = " v_historique_ecritures_1.partenaire_id = $oid";}
						if ($PARTENAIRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT oid FROM compta.t_partenaires WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SITE_X != '-1') {
						$mode = substr($SITE_X,0,2);
						$oid = $SITE_X;
						if ($mode == 'LS') {
							$section_id = 'site_section_id[' . substr($SITE_X,2,2) . ']';
							$oid = substr($SITE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'FI' && $SITE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'FI' ) {
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SITE_X,2);}
						if ($SITE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($SITE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
                        if ($mode == 'DT') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
						if ($mode == 'FI') {$subselect_select = " v_historique_ecritures_1.finess_id = $oid";}
						if ($SITE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
                    if ($POLE_X != '-1') {
						$mode = substr($POLE_X,0,2);
						$oid = $POLE_X;
						if ($mode == 'LS') {
							$section_id = 'pole_section_id[' . substr($POLE_X,2,2) . ']';
							$oid = substr($POLE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $POLE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($POLE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($POLE_X,2);}
						if ($POLE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($POLE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.pole_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.pole_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.pole_id = $oid";}
						if ($POLE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.pole_id IN (SELECT oid FROM compta.t_pole WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($TYPE_COMPTA_X != '-1') {
						$mode = substr($TYPE_COMPTA_X,0,2);
						$oid = $TYPE_COMPTA_X;
						if ($mode == 'LS') {
							$section_id = 'type_compta_section_id[' . substr($TYPE_COMPTA_X,2,2) . ']';
							$oid = substr($TYPE_COMPTA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $TYPE_COMPTA_X != 'SAISIECODE' ) {
							$mode = 'TY';
							$oid = substr($TYPE_COMPTA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($TYPE_COMPTA_X,2);}
						if ($TYPE_COMPTA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($TYPE_COMPTA_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.type_compta_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.type_compta_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'TY') {$subselect_select = " v_historique_ecritures_1.type_compta_id = $oid";}
						if ($TYPE_COMPTA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.type_compta_id IN (SELECT oid FROM compta.t_types_compta WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($TYPE_COMPTA_EXTRA_X != '-1') {
						$mode = substr($TYPE_COMPTA_EXTRA_X,0,2);
						$oid = $TYPE_COMPTA_EXTRA_X;
						if ($mode == 'LS') {
							$section_id = 'type_compta_extra_section_id[' . substr($TYPE_COMPTA_EXTRA_X,2,2) . ']';
							$oid = substr($TYPE_COMPTA_EXTRA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $TYPE_COMPTA_EXTRA_X != 'SAISIECODE' ) {
							$mode = 'TY';
							$oid = substr($TYPE_COMPTA_EXTRA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($TYPE_COMPTA_EXTRA_X,2);}
						if ($TYPE_COMPTA_EXTRA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($TYPE_COMPTA_EXTRA_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'TY') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id = $oid";}
						if ($TYPE_COMPTA_EXTRA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id IN (SELECT oid FROM compta.t_types_compta WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_X,0,2);
						$oid = $SECTION_ANALYTIQUE_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_section_id[' . substr($SECTION_ANALYTIQUE_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_2_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_2_X,0,2);
						$oid = $SECTION_ANALYTIQUE_2_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_2_section_id[' . substr($SECTION_ANALYTIQUE_2_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_2_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_2_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_2_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_2_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
												
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_3_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_3_X,0,2);
						$oid = $SECTION_ANALYTIQUE_3_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_3_section_id[' . substr($SECTION_ANALYTIQUE_3_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_3_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_3_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_3_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_3_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_4_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_4_X,0,2);
						$oid = $SECTION_ANALYTIQUE_4_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_4_section_id[' . substr($SECTION_ANALYTIQUE_4_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_4_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_4_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_4_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_4_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_5_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_5_X,0,2);
						$oid = $SECTION_ANALYTIQUE_5_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_5_section_id[' . substr($SECTION_ANALYTIQUE_5_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_5_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_5_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_5_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_5_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_6_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_6_X,0,2);
						$oid = $SECTION_ANALYTIQUE_6_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_6_section_id[' . substr($SECTION_ANALYTIQUE_6_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_6_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_6_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_6_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_6_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
                    
                    if ($SECTION_ANALYTIQUE_7_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_7_X,0,2);
						$oid = $SECTION_ANALYTIQUE_7_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_7_section_id[' . substr($SECTION_ANALYTIQUE_7_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_7_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_7_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_7_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_7_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_7_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_7_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_7_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_7_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
                    if ($SECTION_ANALYTIQUE_8_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_8_X,0,2);
						$oid = $SECTION_ANALYTIQUE_8_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_8_section_id[' . substr($SECTION_ANALYTIQUE_8_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_8_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_8_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_8_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_8_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_8_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_8_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_8_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_8_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
                    if ($SECTION_ANALYTIQUE_9_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_9_X,0,2);
						$oid = $SECTION_ANALYTIQUE_9_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_9_section_id[' . substr($SECTION_ANALYTIQUE_9_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_9_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_9_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_9_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_9_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_9_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_9_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_9_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_9_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
						
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres écritures" collapsible="true" displayText="= var display:String = '';
		
						if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
							if (SELECT.QINTER != '-1') {
								display = display + '  #B#Type écritures#/B# : ';
								display = display + SELECT.QINTER_LABEL;
							}
						}
						else {
							display = display + '  #B#Type écritures#/B# : ';
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles, Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Mensuelles uniquement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Ajustement uniquement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Fin exercice uniquement';
							}
							if (SELECT.QINTER != '-1') {
								display = display + ', ' + SELECT.QINTER_LABEL;
							}
							display = display + '#/B#';
						}
						
						if (SELECT.QCONS == '1') {
							display = display + '  #B#Ecritures centralisées#/B# : Ajoutées';
						}
                        
                        if (SELECT.POLE != '-1') {
                            display = display + '  #B#Pole#/B# : ';
                            if (SELECT.POLE != 'SAISIECODE') {
                                display = display + SELECT.POLE_LABEL;
                            }
                            else {
                                display = display + SELECT.POLE_CODES;
                            }
                        }
	
							if (SELECT.CH == 'C') {
								if (SELECT.SITE_C != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_C != 'SAISIECODE') {
										display = display + SELECT.SITE_C_LABEL;
									}
									else {
										display = display + SELECT.SITE_C_CODES;
									}
								}
								if (SELECT.JOURNAL_C != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_C != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_C_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_C_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_C != '-1') {
									display = display + '  #B#Type comptabilité#/B# : ';
									display = display + SELECT.TYPE_COMPTA_C_LABEL;
								}
								if (SELECT.COMPTE_C != '-1') {
									display = display + '  #B#Compte#/B# : ';
									if (SELECT.COMPTE_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_C_CODES;
									}
								}
                                if (SELECT.COMPTE_CONTRE_C != '-1') {
									display = display + '  #B#Contrepartie#/B# : ';
									if (SELECT.COMPTE_CONTRE_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_CONTRE_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_CONTRE_C_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_EXTRA_C != '-1') {
									display = display + '  #B#Type comptabilité auxiliaire#/B# : ';
									display = display + SELECT.TYPE_COMPTA_EXTRA_C_LABEL;
								}
								if (SELECT.COMPTE_EXTRA_C != '-1') {
									display = display + '  #B#Compte auxiliaire#/B# : ';
									if (SELECT.COMPTE_EXTRA_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_EXTRA_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_EXTRA_C_CODES;
									}
								}
								if (SELECT.COMPTE_BUDGET_C != '-1') {
									display = display + '  #B#Compte budgétaire#/B# : ';
									if (SELECT.COMPTE_BUDGET_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_BUDGET_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_BUDGET_C_CODES;
									}
								}
								if (SELECT.PARTENAIRE_C != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_C != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_C_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_C_CODES;
									}
								}
								if (SELECT.SECTION_ANALYTIQUE_C != '-1') {
									display = display + '  #B#Section analyse#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_C_LABEL;
								}
								
								if (SELECT.SECTION_ANALYTIQUE_2_C != '-1') {
									display = display + '  #B#Section analyse 2#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_2_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_3_C != '-1') {
									display = display + '  #B#Section analyse 3#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_3_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_4_C != '-1') {
									display = display + '  #B#Section analyse 4#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_4_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_5_C != '-1') {
									display = display + '  #B#Section analyse 5#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_5_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_6_C != '-1') {
									display = display + '  #B#Section analyse 6#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_6_C_LABEL;
								}
                                if (SELECT.SECTION_ANALYTIQUE_7_C != '-1') {
									display = display + '  #B#Section analyse 7#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_7_C_LABEL;
								}
                                if (SELECT.SECTION_ANALYTIQUE_8_C != '-1') {
									display = display + '  #B#Section analyse 8#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_8_C_LABEL;
								}
                                if (SELECT.SECTION_ANALYTIQUE_9_C != '-1') {
									display = display + '  #B#Section analyse 9#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_9_C_LABEL;
								}
							}
							else {
								if (SELECT.SITE_H != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_H != 'SAISIECODE') {
										display = display + SELECT.SITE_H_LABEL;
									}
									else {
										display = display + SELECT.SITE_H_CODES;
									}
								}
								if (SELECT.JOURNAL_H != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_H != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_H_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_H_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_H != '-1') {
									display = display + '  #B#Type comptabilité#/B# : ';
									display = display + SELECT.TYPE_COMPTA_H_LABEL;
								}
								if (SELECT.COMPTE_H != '-1') {
									display = display + '  #B#Compte#/B# : ';
									if (SELECT.COMPTE_H != 'SAISIECODE') {
										display = display + SELECT.COMPTE_H_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_H_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_EXTRA_H != '-1') {
									display = display + '  #B#Type comptabilité auxiliaire#/B# : ';
									display = display + SELECT.TYPE_COMPTA_EXTRA_H_LABEL;
								}
								if (SELECT.COMPTE_EXTRA_H != '-1') {
									display = display + '  #B#Compte auxiliaire#/B# : ';
									if (SELECT.COMPTE_EXTRA_H != 'SAISIECODE') {
										display = display + SELECT.COMPTE_EXTRA_H_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_EXTRA_H_CODES;
									}
								}
								if (SELECT.PARTENAIRE_H != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_H != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_H_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_H_CODES;
									}
								}
							
							}
						
						return display;
						">
			<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="QINTER" label="Inter-Site" UI="combo" width="300" tree="false" default="-1" globalListProvider="QINTER"  showIfNotDefault="true" visible="= ENV.COMPTAPROVIDER == 'sagex3'" >
				</FIELD>
			</GROUP>
            <GROUP label="">
				<FIELD name="POLE" label="Pole" UI="combo" width="300" tree="true" default="-1" globalListProvider="POLE"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="POLE_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.POLE == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_C" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="SITE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.SITE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_C" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="JOURNAL_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.JOURNAL_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="PARTENAIRE_C" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="PARTENAIRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.PARTENAIRE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_C" label="Type comptabilité" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_C" label="Compte" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="COMPTE_CONTRE_C" label="Contrepartie" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_CONTRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_CONTRE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_BUDGET_C" label="Compte Budgétaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_BUDGET_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_BUDGET_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_BUDGET_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_EXTRA_C" label="Type auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_EXTRA_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_EXTRA_C" label="Compte auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_EXTRA_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_EXTRA_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_EXTRA_C == 'SAISIECODE' " />
			</GROUP>
			
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_C" label="Section d'analyse" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_2_C" label="Section 2" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_2_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_3_C" label="Section 3" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_3_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_4_C" label="Section 4" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_4_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_5_C" label="Section 5" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_5_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_6_C" label="Section 6" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_6_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
            <GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_7_C" label="Section 7" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_7_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>                                                                                                                                        
			</GROUP>                                                                                                                                            
            <GROUP label="">                                                                                                                                    
				<FIELD name="SECTION_ANALYTIQUE_8_C" label="Section 8" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_8_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>                                                                                                                                        
			</GROUP>                                                                                                                                            
            <GROUP label="">                                                                                                                                    
				<FIELD name="SECTION_ANALYTIQUE_9_C" label="Section 9" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_9_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_H" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
				<FIELD name="SITE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.SITE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_H" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="JOURNAL_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.JOURNAL_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_H" label="Type comptabilité" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_H" label="Compte" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="COMPTE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.COMPTE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_EXTRA_H" label="Type auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_EXTRA_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_EXTRA_H" label="Compte auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_EXTRA_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="COMPTE_EXTRA_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.COMPTE_EXTRA_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="PARTENAIRE_H" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="PARTENAIRE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.PARTENAIRE_H == 'SAISIECODE' " />
			</GROUP>
		</SELECTIONS>

		<QUERIES>
		
			
		</QUERIES>
	
	</COMPONENT>
	
    
    
	<COMPONENT name="ECRITURES_SELECTIONS_GENERALE" label="Filtre écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT_GEN" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = '';
					
					$select = $select . "AND v_historique_ecritures_1.clinique_honoraire = '[CH]' " ;
																	
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice = '1' ";
					}
					if ('[QMOIS]' != '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement IN ('1','2','3') " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' == '1') {
						$select = $select . "AND (v_historique_ecritures_1.fin_exercice = '1' OR v_historique_ecritures_1.ajustement IN ('1','2','3')) " ;
					}
					if ('[QINTER]' == 'I') {
						$select = $select . "AND v_historique_ecritures_1.inter_site = '1' " ;
					}
					if ('[QINTER]' == 'O') {
						$select = $select . "AND v_historique_ecritures_1.inter_site <> '1' " ;
					}
					
					if ('[QCONS]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '1' AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '2' " ;
					}

					$JOURNAL_X = '-1';
					$JOURNAL_X_CODES = '';
					$COMPTE_X = '-1';
					$COMPTE_X_CODES = '';
					$TYPE_COMPTA_X = '-1';
					$TYPE_COMPTA_X_CODES = '';
					$PARTENAIRE_X = '-1';
					$PARTENAIRE_X_CODES = '';
					$SITE_X = '-1';
					$SITE_X_CODES = '';
					if ('[CH]' == 'C' ) {
						$JOURNAL_X = '[JOURNAL_C]';
						$JOURNAL_X_CODES = '[JOURNAL_C_CODES]';
						$COMPTE_X = '[COMPTE_C]';
						$COMPTE_X_CODES = '[COMPTE_C_CODES]';
						$TYPE_COMPTA_X = '[TYPE_COMPTA_C]';
						$TYPE_COMPTA_X_CODES = '[TYPE_COMPTA_C_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
						
					}
					if ('[CH]' == 'H' ) {
						$JOURNAL_X = '[JOURNAL_H]';
						$JOURNAL_X_CODES = '[JOURNAL_H_CODES]';
						$COMPTE_X = '[COMPTE_H]';
						$COMPTE_X_CODES = '[COMPTE_H_CODES]';
						$TYPE_COMPTA_X = '[TYPE_COMPTA_H]';
						$TYPE_COMPTA_X_CODES = '[TYPE_COMPTA_H_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
						
					}
					
					if ($JOURNAL_X != '-1') {
						$mode = substr($JOURNAL_X,0,2);
						$oid = $JOURNAL_X;
						if ($mode == 'LS') {
							$section_id = 'journal_section_id[' . substr($JOURNAL_X,2,2) . ']';
							$oid = substr($JOURNAL_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $JOURNAL_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($JOURNAL_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($JOURNAL_X,2);}
						if ($JOURNAL_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($JOURNAL_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.journal_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.journal_id = $oid";}
						if ($JOURNAL_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($COMPTE_X != '-1') {
						$mode = substr($COMPTE_X,0,2);
						$oid = $COMPTE_X;
						if ($mode == 'LS') {
							$section_id = 'compte_section_id[' . substr($COMPTE_X,2,2) . ']';
							$oid = substr($COMPTE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_X,2);}
						if ($COMPTE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " (
																v_historique_ecritures_1.compte_signe_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid) OR
																v_historique_ecritures_1.compte_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)
																)";}
						if ($mode == 'SL') {$subselect_select = " (
																v_historique_ecritures_1.compte_signe_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid) AND
																v_historique_ecritures_1.compte_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)
																)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_X == 'SAISIECODE') {$subselect_select = " (
																v_historique_ecritures_1.compte_signe_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes) OR
																v_historique_ecritures_1.compte_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)
																)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($PARTENAIRE_X != '-1') {
						$mode = substr($PARTENAIRE_X,0,2);
						$oid = $PARTENAIRE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($PARTENAIRE_X,2,2) . ']';
							$oid = substr($PARTENAIRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $PARTENAIRE_X != 'SAISIECODE' ) {
							$mode = 'PA';
							$oid = substr($PARTENAIRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($PARTENAIRE_X,2);}
						if ($PARTENAIRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($PARTENAIRE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.partenaire_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'PA') {$subselect_select = " v_historique_ecritures_1.partenaire_id = $oid";}
						if ($PARTENAIRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT oid FROM compta.t_partenaires WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SITE_X != '-1') {
						$mode = substr($SITE_X,0,2);
						$oid = $SITE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($SITE_X,2,2) . ']';
							$oid = substr($SITE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $SITE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SITE_X,2);}
						if ($SITE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($SITE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
						if ($SITE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($TYPE_COMPTA_X != '-1') {
						$mode = substr($TYPE_COMPTA_X,0,2);
						$oid = $TYPE_COMPTA_X;
						if ($mode == 'LS') {
							$section_id = 'type_compta_section_id[' . substr($TYPE_COMPTA_X,2,2) . ']';
							$oid = substr($TYPE_COMPTA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $TYPE_COMPTA_X != 'SAISIECODE' ) {
							$mode = 'TY';
							$oid = substr($TYPE_COMPTA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($TYPE_COMPTA_X,2);}
						if ($TYPE_COMPTA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($TYPE_COMPTA_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.type_compta_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.type_compta_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'TY') {$subselect_select = " v_historique_ecritures_1.type_compta_id = $oid";}
						if ($TYPE_COMPTA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.type_compta_id IN (SELECT oid FROM compta.t_types_compta WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
						
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres écritures" collapsible="true" displayText="= var display:String = '';
		
						if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
							if (SELECT.QINTER != '-1') {
								display = display + '  #B#Type écritures#/B# : ';
								display = display + SELECT.QINTER_LABEL;
							}
						}
						else {
							display = display + '  #B#Type écritures#/B# : ';
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles, Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Mensuelles uniquement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Ajustement uniquement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Fin exercice uniquement';
							}
							if (SELECT.QINTER != '-1') {
								display = display + ', ' + SELECT.QINTER_LABEL;
							}
							display = display + '#/B#';
						}
						
						if (SELECT.QCONS == '1') {
							display = display + '  #B#Ecritures centralisées#/B# : Ajoutées';
						}
	
							if (SELECT.CH == 'C') {
								if (SELECT.SITE_C != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_C != 'SAISIECODE') {
										display = display + SELECT.SITE_C_LABEL;
									}
									else {
										display = display + SELECT.SITE_C_CODES;
									}
								}
								if (SELECT.JOURNAL_C != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_C != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_C_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_C_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_C != '-1') {
									display = display + '  #B#Type comptabilité#/B# : ';
									display = display + SELECT.TYPE_COMPTA_C_LABEL;
								}
								if (SELECT.COMPTE_C != '-1') {
									display = display + '  #B#Compte#/B# : ';
									if (SELECT.COMPTE_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_C_CODES;
									}
								}
								
								if (SELECT.PARTENAIRE_C != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_C != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_C_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_C_CODES;
									}
								}
								
							}
							else {
								if (SELECT.SITE_H != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_H != 'SAISIECODE') {
										display = display + SELECT.SITE_H_LABEL;
									}
									else {
										display = display + SELECT.SITE_H_CODES;
									}
								}
								if (SELECT.JOURNAL_H != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_H != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_H_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_H_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_H != '-1') {
									display = display + '  #B#Type comptabilité#/B# : ';
									display = display + SELECT.TYPE_COMPTA_H_LABEL;
								}
								if (SELECT.COMPTE_H != '-1') {
									display = display + '  #B#Compte#/B# : ';
									if (SELECT.COMPTE_H != 'SAISIECODE') {
										display = display + SELECT.COMPTE_H_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_H_CODES;
									}
								}
								
								if (SELECT.PARTENAIRE_H != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_H != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_H_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_H_CODES;
									}
								}
							
							}
						
						return display;
						">
			<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="QINTER" label="Inter-Site" UI="combo" width="300" tree="false" default="-1" globalListProvider="QINTER"  showIfNotDefault="true" visible="= ENV.COMPTAPROVIDER == 'sagex3'" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_C" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="SITE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.SITE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_C" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="JOURNAL_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.JOURNAL_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="PARTENAIRE_C" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="PARTENAIRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.PARTENAIRE_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="PARTENAIRE_H" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="PARTENAIRE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.PARTENAIRE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_C" label="Type comptabilité" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_C" label="Compte" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label=""  >
				<FIELD name="SITE_H" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
				<FIELD name="SITE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.SITE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label=""  >
				<FIELD name="JOURNAL_H" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="JOURNAL_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.JOURNAL_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label=""  > 
				<FIELD name="TYPE_COMPTA_H" label="Type comptabilité" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_H" label="Compte" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="COMPTE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.COMPTE_H == 'SAISIECODE' " />
			</GROUP>
			
		</SELECTIONS>
	
		

		<QUERIES>
		
			
		</QUERIES>
	
				
	</COMPONENT>
	
    <COMPONENT name="ECRITURES_SELECTIONS_AUXILLIAIRE" label="Filtre écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT_AUX" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = '';
					
					$select = $select . "AND v_historique_ecritures_1.clinique_honoraire = '[CH]' " ;
																	
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice = '1' ";
					}
					if ('[QMOIS]' != '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement IN ('1','2','3') " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' == '1') {
						$select = $select . "AND (v_historique_ecritures_1.fin_exercice = '1' OR v_historique_ecritures_1.ajustement IN ('1','2','3')) " ;
					}
					if ('[QINTER]' == 'I') {
						$select = $select . "AND v_historique_ecritures_1.inter_site = '1' " ;
					}
					if ('[QINTER]' == 'O') {
						$select = $select . "AND v_historique_ecritures_1.inter_site <> '1' " ;
					}
					
					if ('[QCONS]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '1' AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '2' " ;
					}

					$JOURNAL_X = '-1';
					$JOURNAL_X_CODES = '';
					$COMPTE_EXTRA_X = '-1';
					$COMPTE_EXTRA_X_CODES = '';
					$TYPE_COMPTA_EXTRA_X = '-1';
					$TYPE_COMPTA_EXTRA_X_CODES = '';
					$PARTENAIRE_X = '-1';
					$PARTENAIRE_X_CODES = '';
					$SITE_X = '-1';
					$SITE_X_CODES = '';
					if ('[CH]' == 'C' ) {
						$JOURNAL_X = '[JOURNAL_C]';
						$JOURNAL_X_CODES = '[JOURNAL_C_CODES]';
						$COMPTE_EXTRA_X = '[COMPTE_EXTRA_C]';
						$COMPTE_EXTRA_X_CODES = '[COMPTE_EXTRA_C_CODES]';
						$TYPE_COMPTA_EXTRA_X = '[TYPE_COMPTA_EXTRA_C]';
						$TYPE_COMPTA_EXTRA_X_CODES = '[TYPE_COMPTA_EXTRA_C_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
					}
					if ('[CH]' == 'H' ) {
						$JOURNAL_X = '[JOURNAL_H]';
						$JOURNAL_X_CODES = '[JOURNAL_H_CODES]';
						$COMPTE_EXTRA_X = '[COMPTE_EXTRA_H]';
						$COMPTE_EXTRA_X_CODES = '[COMPTE_EXTRA_H_CODES]';
						$TYPE_COMPTA_EXTRA_X = '[TYPE_COMPTA_EXTRA_H]';
						$TYPE_COMPTA_EXTRA_X_CODES = '[TYPE_COMPTA_EXTRA_H_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
					}
					
					if ($JOURNAL_X != '-1') {
						$mode = substr($JOURNAL_X,0,2);
						$oid = $JOURNAL_X;
						if ($mode == 'LS') {
							$section_id = 'journal_section_id[' . substr($JOURNAL_X,2,2) . ']';
							$oid = substr($JOURNAL_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $JOURNAL_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($JOURNAL_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($JOURNAL_X,2);}
						if ($JOURNAL_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($JOURNAL_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.journal_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.journal_id = $oid";}
						if ($JOURNAL_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($COMPTE_EXTRA_X != '-1') {
						$mode = substr($COMPTE_EXTRA_X,0,2);
						$oid = $COMPTE_EXTRA_X;
						if ($mode == 'LS') {
							$section_id = 'compte_extra_section_id[' . substr($COMPTE_EXTRA_X,2,2) . ']';
							$oid = substr($COMPTE_EXTRA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_EXTRA_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_EXTRA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_EXTRA_X,2);}
						if ($COMPTE_EXTRA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_EXTRA_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.compte_extra_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.compte_extra_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_extra_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_EXTRA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.compte_extra_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($PARTENAIRE_X != '-1') {
						$mode = substr($PARTENAIRE_X,0,2);
						$oid = $PARTENAIRE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($PARTENAIRE_X,2,2) . ']';
							$oid = substr($PARTENAIRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $PARTENAIRE_X != 'SAISIECODE' ) {
							$mode = 'PA';
							$oid = substr($PARTENAIRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($PARTENAIRE_X,2);}
						if ($PARTENAIRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($PARTENAIRE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.partenaire_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'PA') {$subselect_select = " v_historique_ecritures_1.partenaire_id = $oid";}
						if ($PARTENAIRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT oid FROM compta.t_partenaires WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SITE_X != '-1') {
						$mode = substr($SITE_X,0,2);
						$oid = $SITE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($SITE_X,2,2) . ']';
							$oid = substr($SITE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $SITE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SITE_X,2);}
						if ($SITE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($SITE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
						if ($SITE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($TYPE_COMPTA_EXTRA_X != '-1') {
						$mode = substr($TYPE_COMPTA_EXTRA_X,0,2);
						$oid = $TYPE_COMPTA_EXTRA_X;
						if ($mode == 'LS') {
							$section_id = 'type_compta_extra_section_id[' . substr($TYPE_COMPTA_EXTRA_X,2,2) . ']';
							$oid = substr($TYPE_COMPTA_EXTRA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $TYPE_COMPTA_EXTRA_X != 'SAISIECODE' ) {
							$mode = 'TY';
							$oid = substr($TYPE_COMPTA_EXTRA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($TYPE_COMPTA_EXTRA_X,2);}
						if ($TYPE_COMPTA_EXTRA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($TYPE_COMPTA_EXTRA_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'TY') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id = $oid";}
						if ($TYPE_COMPTA_EXTRA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.type_compta_extra_id IN (SELECT oid FROM compta.t_types_compta WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
						
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres écritures" collapsible="true" displayText="= var display:String = '';
		
						if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
							if (SELECT.QINTER != '-1') {
								display = display + '  #B#Type écritures#/B# : ';
								display = display + SELECT.QINTER_LABEL;
							}
						}
						else {
							display = display + '  #B#Type écritures#/B# : ';
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles, Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Mensuelles uniquement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Ajustement uniquement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Fin exercice uniquement';
							}
							if (SELECT.QINTER != '-1') {
								display = display + ', ' + SELECT.QINTER_LABEL;
							}
							display = display + '#/B#';
						}
						
						if (SELECT.QCONS == '1') {
							display = display + '  #B#Ecritures centralisées#/B# : Ajoutées';
						}
	
							if (SELECT.CH == 'C') {
								if (SELECT.SITE_C != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_C != 'SAISIECODE') {
										display = display + SELECT.SITE_C_LABEL;
									}
									else {
										display = display + SELECT.SITE_C_CODES;
									}
								}
								if (SELECT.JOURNAL_C != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_C != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_C_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_C_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_EXTRA_C != '-1') {
									display = display + '  #B#Type comptabilité auxiliaire#/B# : ';
									display = display + SELECT.TYPE_COMPTA_EXTRA_C_LABEL;
								}
								if (SELECT.COMPTE_EXTRA_C != '-1') {
									display = display + '  #B#Compte auxiliaire#/B# : ';
									if (SELECT.COMPTE_EXTRA_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_EXTRA_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_EXTRA_C_CODES;
									}
								}
								if (SELECT.PARTENAIRE_C != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_C != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_C_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_C_CODES;
									}
								}
								
							}
							else {
								if (SELECT.SITE_H != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_H != 'SAISIECODE') {
										display = display + SELECT.SITE_H_LABEL;
									}
									else {
										display = display + SELECT.SITE_H_CODES;
									}
								}
								if (SELECT.JOURNAL_H != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_H != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_H_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_H_CODES;
									}
								}
								if (SELECT.TYPE_COMPTA_EXTRA_H != '-1') {
									display = display + '  #B#Type comptabilité auxiliaire#/B# : ';
									display = display + SELECT.TYPE_COMPTA_EXTRA_H_LABEL;
								}
								if (SELECT.COMPTE_EXTRA_H != '-1') {
									display = display + '  #B#Compte auxiliaire#/B# : ';
									if (SELECT.COMPTE_EXTRA_H != 'SAISIECODE') {
										display = display + SELECT.COMPTE_EXTRA_H_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_EXTRA_H_CODES;
									}
								}
								if (SELECT.PARTENAIRE_H != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_H != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_H_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_H_CODES;
									}
								}
							
							}
						
						return display;
						">
			<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="QINTER" label="Inter-Site" UI="combo" width="300" tree="false" default="-1" globalListProvider="QINTER"  showIfNotDefault="true" visible="= ENV.COMPTAPROVIDER == 'sagex3'" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_C" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="SITE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.SITE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_C" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="JOURNAL_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.JOURNAL_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="PARTENAIRE_C" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="PARTENAIRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.PARTENAIRE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_EXTRA_C" label="Type auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_EXTRA_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_EXTRA_C" label="Compte auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_EXTRA_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_EXTRA_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_EXTRA_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_H" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
				<FIELD name="SITE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.SITE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_H" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="JOURNAL_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.JOURNAL_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_EXTRA_H" label="Type auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_EXTRA_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_EXTRA_H" label="Compte auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_EXTRA_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="COMPTE_EXTRA_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.COMPTE_EXTRA_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="PARTENAIRE_H" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="PARTENAIRE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.PARTENAIRE_H == 'SAISIECODE' " />
			</GROUP>
		</SELECTIONS>
	
		

		<QUERIES>
		
			
		</QUERIES>
	</COMPONENT>
    
    
    <COMPONENT name="ECRITURES_SELECTIONS_BUDGETAIRE" label="Filtre écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT_BUDG" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = '';
					
					$select = $select . "AND v_historique_ecritures_1.clinique_honoraire = '[CH]' " ;
																	
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice = '1' ";
					}
					if ('[QMOIS]' != '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement IN ('1','2','3') " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' == '1') {
						$select = $select . "AND (v_historique_ecritures_1.fin_exercice = '1' OR v_historique_ecritures_1.ajustement IN ('1','2','3')) " ;
					}
					if ('[QINTER]' == 'I') {
						$select = $select . "AND v_historique_ecritures_1.inter_site = '1' " ;
					}
					if ('[QINTER]' == 'O') {
						$select = $select . "AND v_historique_ecritures_1.inter_site <> '1' " ;
					}
					
					if ('[QCONS]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '1' AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '2' " ;
					}

					$JOURNAL_X = '-1';
					$JOURNAL_X_CODES = '';
					$COMPTE_BUDGET_X = '-1';
					$COMPTE_BUDGET_X_CODES = '';
					$PARTENAIRE_X = '-1';
					$PARTENAIRE_X_CODES = '';
					$SITE_X = '-1';
					$SITE_X_CODES = '';
                    $TYPE_COMPTA_X = 'LI';
					if ('[CH]' == 'C' ) {
						$JOURNAL_X = '[JOURNAL_C]';
						$JOURNAL_X_CODES = '[JOURNAL_C_CODES]';
						$COMPTE_BUDGET_X = '[COMPTE_BUDGET_C]';
						$COMPTE_BUDGET_X_CODES = '[COMPTE_BUDGET_C_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
					}
					if ('[CH]' == 'H' ) {
						$JOURNAL_X = '[JOURNAL_H]';
						$JOURNAL_X_CODES = '[JOURNAL_H_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
					}
					
					if ($JOURNAL_X != '-1') {
						$mode = substr($JOURNAL_X,0,2);
						$oid = $JOURNAL_X;
						if ($mode == 'LS') {
							$section_id = 'journal_section_id[' . substr($JOURNAL_X,2,2) . ']';
							$oid = substr($JOURNAL_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $JOURNAL_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($JOURNAL_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($JOURNAL_X,2);}
						if ($JOURNAL_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($JOURNAL_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.journal_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.journal_id = $oid";}
						if ($JOURNAL_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($COMPTE_BUDGET_X != '-1') {
						$mode = substr($COMPTE_BUDGET_X,0,2);
						$oid = $COMPTE_BUDGET_X;
						if ($mode == 'LS') {
							$section_id = 'compte_budget_section_id[' . substr($COMPTE_BUDGET_X,2,2) . ']';
							$oid = substr($COMPTE_BUDGET_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_BUDGET_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_BUDGET_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_BUDGET_X,2);}
						if ($COMPTE_BUDGET_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_BUDGET_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.compte_budget_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.compte_budget_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_budget_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_BUDGET_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.compte_budget_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($PARTENAIRE_X != '-1') {
						$mode = substr($PARTENAIRE_X,0,2);
						$oid = $PARTENAIRE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($PARTENAIRE_X,2,2) . ']';
							$oid = substr($PARTENAIRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $PARTENAIRE_X != 'SAISIECODE' ) {
							$mode = 'PA';
							$oid = substr($PARTENAIRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($PARTENAIRE_X,2);}
						if ($PARTENAIRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($PARTENAIRE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.partenaire_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'PA') {$subselect_select = " v_historique_ecritures_1.partenaire_id = $oid";}
						if ($PARTENAIRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT oid FROM compta.t_partenaires WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SITE_X != '-1') {
						$mode = substr($SITE_X,0,2);
						$oid = $SITE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($SITE_X,2,2) . ']';
							$oid = substr($SITE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $SITE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SITE_X,2);}
						if ($SITE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($SITE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
						if ($SITE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
                    if ($TYPE_COMPTA_X != '-1') {
						$mode = substr($TYPE_COMPTA_X,0,2);
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.type_compta_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = (SELECT oid FROM compta.t_listes WHERE code='CTITYPEGES'))";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
                    
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres écritures" collapsible="true" displayText="= var display:String = '';
		
						if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
							if (SELECT.QINTER != '-1') {
								display = display + '  #B#Type écritures#/B# : ';
								display = display + SELECT.QINTER_LABEL;
							}
						}
						else {
							display = display + '  #B#Type écritures#/B# : ';
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles, Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Mensuelles uniquement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Ajustement uniquement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Fin exercice uniquement';
							}
							if (SELECT.QINTER != '-1') {
								display = display + ', ' + SELECT.QINTER_LABEL;
							}
							display = display + '#/B#';
						}
						
						if (SELECT.QCONS == '1') {
							display = display + '  #B#Ecritures centralisées#/B# : Ajoutées';
						}
	
							if (SELECT.CH == 'C') {
								if (SELECT.SITE_C != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_C != 'SAISIECODE') {
										display = display + SELECT.SITE_C_LABEL;
									}
									else {
										display = display + SELECT.SITE_C_CODES;
									}
								}
								if (SELECT.JOURNAL_C != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_C != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_C_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_C_CODES;
									}
								}
								if (SELECT.COMPTE_BUDGET_C != '-1') {
									display = display + '  #B#Compte budgétaire#/B# : ';
									if (SELECT.COMPTE_BUDGET_C != 'SAISIECODE') {
										display = display + SELECT.COMPTE_BUDGET_C_LABEL;
									}
									else {
										display = display + SELECT.COMPTE_BUDGET_C_CODES;
									}
								}
								if (SELECT.PARTENAIRE_C != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_C != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_C_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_C_CODES;
									}
								}
                                if (SELECT.TYPE_COMPTA_C != '-1') {
									display = display + '  #B#Type comptabilité#/B# : Gestion';
								}
								
							}
							else {
								if (SELECT.SITE_H != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_H != 'SAISIECODE') {
										display = display + SELECT.SITE_H_LABEL;
									}
									else {
										display = display + SELECT.SITE_H_CODES;
									}
								}
								if (SELECT.JOURNAL_H != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_H != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_H_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_H_CODES;
									}
								}
                                
								if (SELECT.PARTENAIRE_H != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_H != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_H_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_H_CODES;
									}
								}
							
							}
						
						return display;
						">
			<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="QINTER" label="Inter-Site" UI="combo" width="300" tree="false" default="-1" globalListProvider="QINTER"  showIfNotDefault="true" visible="= ENV.COMPTAPROVIDER == 'sagex3'" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_C" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="SITE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.SITE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_C" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="JOURNAL_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.JOURNAL_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="PARTENAIRE_C" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="PARTENAIRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.PARTENAIRE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_BUDGET_C" label="Compte Budgétaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_BUDGET_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="COMPTE_BUDGET_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_BUDGET_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_H" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
				<FIELD name="SITE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.SITE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_H" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="JOURNAL_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.JOURNAL_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="PARTENAIRE_H" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="PARTENAIRE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.PARTENAIRE_H == 'SAISIECODE' " />
			</GROUP>
            
            
		</SELECTIONS>

		<QUERIES>
		
			
		</QUERIES>
	
	</COMPONENT>
    
    <COMPONENT name="ECRITURES_SELECTIONS_ANALYTIQUE" label="Filtre écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT_ANA" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = '';
					
					$select = $select . "AND v_historique_ecritures_1.clinique_honoraire = '[CH]' " ;
																	
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					}
					if ('[QMOIS]' == '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice <> '1' " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.fin_exercice = '1' ";
					}
					if ('[QMOIS]' != '1' & '[Q13]' != '1' & '[QAJ]' == '1') {
						$select = $select . "AND v_historique_ecritures_1.ajustement IN ('1','2','3') " ;
					}
					if ('[QMOIS]' != '1' & '[Q13]' == '1' & '[QAJ]' == '1') {
						$select = $select . "AND (v_historique_ecritures_1.fin_exercice = '1' OR v_historique_ecritures_1.ajustement IN ('1','2','3')) " ;
					}
					if ('[QINTER]' == 'I') {
						$select = $select . "AND v_historique_ecritures_1.inter_site = '1' " ;
					}
					if ('[QINTER]' == 'O') {
						$select = $select . "AND v_historique_ecritures_1.inter_site <> '1' " ;
					}
					
					if ('[QCONS]' != '1') {
						$select = $select . "AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '1' AND v_historique_ecritures_1.ecriture_consolidee IS DISTINCT FROM '2' " ;
					}

					$JOURNAL_X = '-1';
					$JOURNAL_X_CODES = '';
					$PARTENAIRE_X = '-1';
					$PARTENAIRE_X_CODES = '';
					$SITE_X = '-1';
					$SITE_X_CODES = '';
					$SECTION_ANALYTIQUE_X = '-1';
                    $TYPE_COMPTA_X = 'LI';
					if ('[CH]' == 'C' ) {
						$JOURNAL_X = '[JOURNAL_C]';
						$JOURNAL_X_CODES = '[JOURNAL_C_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
						$SECTION_ANALYTIQUE_X = '[SECTION_ANALYTIQUE_C]';
						$SECTION_ANALYTIQUE_2_X = '[SECTION_ANALYTIQUE_2_C]';
						$SECTION_ANALYTIQUE_3_X = '[SECTION_ANALYTIQUE_3_C]';
						$SECTION_ANALYTIQUE_4_X = '[SECTION_ANALYTIQUE_4_C]';
						$SECTION_ANALYTIQUE_5_X = '[SECTION_ANALYTIQUE_5_C]';
						$SECTION_ANALYTIQUE_6_X = '[SECTION_ANALYTIQUE_6_C]';
					}
					if ('[CH]' == 'H' ) {
						$JOURNAL_X = '[JOURNAL_H]';
						$JOURNAL_X_CODES = '[JOURNAL_H_CODES]';
						$PARTENAIRE_X = '[PARTENAIRE_C]';
						$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
						$SITE_X = '[SITE_C]';
						$SITE_X_CODES = '[SITE_C_CODES]';
						$SECTION_ANALYTIQUE_X = '-1';
						$SECTION_ANALYTIQUE_2_X = '-1';
						$SECTION_ANALYTIQUE_3_X = '-1';
						$SECTION_ANALYTIQUE_4_X = '-1';
						$SECTION_ANALYTIQUE_5_X = '-1';
						$SECTION_ANALYTIQUE_6_X = '-1';
					}
					
					if ($JOURNAL_X != '-1') {
						$mode = substr($JOURNAL_X,0,2);
						$oid = $JOURNAL_X;
						if ($mode == 'LS') {
							$section_id = 'journal_section_id[' . substr($JOURNAL_X,2,2) . ']';
							$oid = substr($JOURNAL_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $JOURNAL_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($JOURNAL_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($JOURNAL_X,2);}
						if ($JOURNAL_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($JOURNAL_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.journal_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.journal_id = $oid";}
						if ($JOURNAL_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.journal_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($PARTENAIRE_X != '-1') {
						$mode = substr($PARTENAIRE_X,0,2);
						$oid = $PARTENAIRE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($PARTENAIRE_X,2,2) . ']';
							$oid = substr($PARTENAIRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $PARTENAIRE_X != 'SAISIECODE' ) {
							$mode = 'PA';
							$oid = substr($PARTENAIRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($PARTENAIRE_X,2);}
						if ($PARTENAIRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($PARTENAIRE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.partenaire_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'PA') {$subselect_select = " v_historique_ecritures_1.partenaire_id = $oid";}
						if ($PARTENAIRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT oid FROM compta.t_partenaires WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SITE_X != '-1') {
						$mode = substr($SITE_X,0,2);
						$oid = $SITE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_section_id[' . substr($SITE_X,2,2) . ']';
							$oid = substr($SITE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $SITE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SITE_X,2);}
						if ($SITE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($SITE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
						if ($SITE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
                    if ($TYPE_COMPTA_X != '-1') {
						$mode = substr($TYPE_COMPTA_X,0,2);
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.type_compta_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = (SELECT oid FROM compta.t_listes WHERE code='CTITYPEGES'))";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_X,0,2);
						$oid = $SECTION_ANALYTIQUE_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_section_id[' . substr($SECTION_ANALYTIQUE_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_2_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_2_X,0,2);
						$oid = $SECTION_ANALYTIQUE_2_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_2_section_id[' . substr($SECTION_ANALYTIQUE_2_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_2_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_2_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_2_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_2_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_2_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_3_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_3_X,0,2);
						$oid = $SECTION_ANALYTIQUE_3_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_3_section_id[' . substr($SECTION_ANALYTIQUE_3_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_3_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_3_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_3_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_3_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_3_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_4_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_4_X,0,2);
						$oid = $SECTION_ANALYTIQUE_4_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_4_section_id[' . substr($SECTION_ANALYTIQUE_4_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_4_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_4_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_4_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_4_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_4_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_5_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_5_X,0,2);
						$oid = $SECTION_ANALYTIQUE_5_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_5_section_id[' . substr($SECTION_ANALYTIQUE_5_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_5_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_5_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_5_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_5_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_5_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SECTION_ANALYTIQUE_6_X != '-1') {
						$mode = substr($SECTION_ANALYTIQUE_6_X,0,2);
						$oid = $SECTION_ANALYTIQUE_6_X;
						if ($mode == 'LS') {
							$section_id = 'section_analytique_6_section_id[' . substr($SECTION_ANALYTIQUE_6_X,2,2) . ']';
							$oid = substr($SECTION_ANALYTIQUE_6_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*') {
							$mode = 'SA';
							$oid = substr($SECTION_ANALYTIQUE_6_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SECTION_ANALYTIQUE_6_X,2);}
						if ($mode == 'C*') {$where_codes = sql_codes_list_a(substr($SECTION_ANALYTIQUE_6_X,2), 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SA') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " v_historique_ecritures_1.section_analytique_6_id IN (SELECT oid FROM compta.t_sections_analytiques WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
						
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres écritures" collapsible="true" displayText="= var display:String = '';
		
						if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
							if (SELECT.QINTER != '-1') {
								display = display + '  #B#Type écritures#/B# : ';
								display = display + SELECT.QINTER_LABEL;
							}
						}
						else {
							display = display + '  #B#Type écritures#/B# : ';
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles, Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Mensuelles uniquement';
							}
							if (SELECT.QMOIS == '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Mensuelles et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Fin exercice et Ajustement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 != '1' &amp;&amp; SELECT.QAJ == '1') {
								display = display + 'Ajustement uniquement';
							}
							if (SELECT.QMOIS != '1' &amp;&amp; SELECT.Q13 == '1' &amp;&amp; SELECT.QAJ != '1') {
								display = display + 'Fin exercice uniquement';
							}
							if (SELECT.QINTER != '-1') {
								display = display + ', ' + SELECT.QINTER_LABEL;
							}
							display = display + '#/B#';
						}
						
						if (SELECT.QCONS == '1') {
							display = display + '  #B#Ecritures centralisées#/B# : Ajoutées';
						}
	
							if (SELECT.CH == 'C') {
								if (SELECT.SITE_C != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_C != 'SAISIECODE') {
										display = display + SELECT.SITE_C_LABEL;
									}
									else {
										display = display + SELECT.SITE_C_CODES;
									}
								}
								if (SELECT.JOURNAL_C != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_C != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_C_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_C_CODES;
									}
								}
                                if (SELECT.TYPE_COMPTA_C != '-1') {
									display = display + '  #B#Type comptabilité#/B# : Gestion';
								}
								if (SELECT.PARTENAIRE_C != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_C != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_C_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_C_CODES;
									}
								}
								if (SELECT.SECTION_ANALYTIQUE_C != '-1') {
									display = display + '  #B#Section analyse#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_C_LABEL;
								}
								
								if (SELECT.SECTION_ANALYTIQUE_2_C != '-1') {
									display = display + '  #B#Section analyse 2#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_2_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_3_C != '-1') {
									display = display + '  #B#Section analyse 3#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_3_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_4_C != '-1') {
									display = display + '  #B#Section analyse 4#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_4_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_5_C != '-1') {
									display = display + '  #B#Section analyse 5#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_5_C_LABEL;
								}
								if (SELECT.SECTION_ANALYTIQUE_6_C != '-1') {
									display = display + '  #B#Section analyse 6#/B# : ';
									display = display + SELECT.SECTION_ANALYTIQUE_6_C_LABEL;
								}
							}
							else {
								if (SELECT.SITE_H != '-1') {
									display = display + '  #B#Site#/B# : ';
									if (SELECT.SITE_H != 'SAISIECODE') {
										display = display + SELECT.SITE_H_LABEL;
									}
									else {
										display = display + SELECT.SITE_H_CODES;
									}
								}
								if (SELECT.JOURNAL_H != '-1') {
									display = display + '  #B#Journal#/B# : ';
									if (SELECT.JOURNAL_H != 'SAISIECODE') {
										display = display + SELECT.JOURNAL_H_LABEL;
									}
									else {
										display = display + SELECT.JOURNAL_H_CODES;
									}
								}
								if (SELECT.PARTENAIRE_H != '-1') {
									display = display + '  #B#Partenaire#/B# : ';
									if (SELECT.PARTENAIRE_H != 'SAISIECODE') {
										display = display + SELECT.PARTENAIRE_H_LABEL;
									}
									else {
										display = display + SELECT.PARTENAIRE_H_CODES;
									}
								}
							
							}
						
						return display;
						">
			<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="QINTER" label="Inter-Site" UI="combo" width="300" tree="false" default="-1" globalListProvider="QINTER"  showIfNotDefault="true" visible="= ENV.COMPTAPROVIDER == 'sagex3'" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_C" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="SITE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.SITE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_C" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="JOURNAL_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.JOURNAL_C == 'SAISIECODE' " />
			</GROUP>
            <GROUP label="">
				<FIELD name="PARTENAIRE_C" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
				<FIELD name="PARTENAIRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.PARTENAIRE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_C" label="Section d'analyse" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_2_C" label="Section 2" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_2_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_3_C" label="Section 3" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_3_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_4_C" label="Section 4" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_4_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_5_C" label="Section 5" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_5_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_6_C" label="Section 6" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_6_C"  showIfNotDefault="true" visible="= SELECT.CH == 'C'">
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="SITE_H" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'">
				</FIELD>
				<FIELD name="SITE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.SITE_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_H" label="Journal" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="JOURNAL_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.JOURNAL_H == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="PARTENAIRE_H" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_H"  showIfNotDefault="true" visible="= SELECT.CH == 'H'" >
				</FIELD>
				<FIELD name="PARTENAIRE_H_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'H' &amp;&amp; SELECT.PARTENAIRE_H == 'SAISIECODE' " />
			</GROUP>
		</SELECTIONS>

		<QUERIES>
		
			
		</QUERIES>
	
	</COMPONENT>
    
    
	<COMPONENT name="ECRITURES_SELECTIONS_COMPLEMENTAIRES" label="Filtre complémentaires écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT_COMP" value="[EVAL 
												$select = '';
												
												if ('[FACTURE]' != '') {
													$select = $select . ' AND ' . sql_codes_list_a('[FACTURE]', 'v_historique_ecritures_1.dossier') . ' ';
												}
												
												if ('[MONTANT]' != '') {
													$select = $select . ' AND ' . sql_codes_list_n('[MONTANT]', 'v_historique_ecritures_1.montant_absolu_ecriture') . ' ';
												}
												if ('[SENS]' == 'D') {
													$select = $select . ' AND v_historique_ecritures_1.montant_debit &lt;&gt; 0 ';
												}
												if ('[SENS]' == 'C') {
													$select = $select . ' AND v_historique_ecritures_1.montant_credit &lt;&gt; 0 ';
												}
												if ('[TEXTE]' != '') {
													$select = $select . ' AND ' . sql_codes_list_a('[TEXTE]', 'v_historique_ecritures_1.texte') . ' ';
												}
												if ('[PIECE]' != '') {
													$select = $select . ' AND ' . sql_codes_list_a('[PIECE]', 'v_historique_ecritures_1.piece') . ' ';
												}
												if ('[CLE]' != '') {
													$select = $select . ' AND ' . sql_codes_list_a('[CLE]', 'v_historique_ecritures_1.cle_originale') . ' ';
												}
													
												return $select;
																					
								EVAL]" />
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres complémentaires" collapsible="true" displayText="= var display:String = '';
	

								if (SELECT.FACTURE != '') {
									display = display + '  #B#Facture#/B# : ' + SELECT.FACTURE + ' ';
								}	
							
								if (SELECT.TEXTE != '') {
									display = display + '  #B#Texte#/B# : ' + SELECT.TEXTE + ' ';
								}
								
								if (SELECT.PIECE != '') {
									display = display + '  #B#Pièce#/B# : ' + SELECT.PIECE + ' ';
								}

								if (SELECT.MONTANT != '') {
									display = display + '  #B#Montant#/B# : ' + SELECT.MONTANT + ' ';
								}	
								
								if (SELECT.SENS != '-1') {
									display = display + '  #B#Sens#/B# : ' + SELECT.SENS_LABEL + ' ';
								}
								
								if (SELECT.CLE != '') {
									display = display + '  #B#Clé originale#/B# : ' + SELECT.CLE + ' ';
								}
							
						
						return display;
						">
			<GROUP label="">
				<FIELD name="FACTURE" label="Facture, Dossier" UI="text" width="200" default="" showIfNotDefault="true" />
			</GROUP>
			<GROUP label="">
				<FIELD name="TEXTE" label="Texte" UI="text" width="200" default="" showIfNotDefault="true" />
			</GROUP>
			<GROUP label="">
				<FIELD name="PIECE" label="Pièce" UI="text" width="200" default="" showIfNotDefault="true" />
			</GROUP>
			<GROUP label="">
				<FIELD name="MONTANT" label="Montant" UI="number" width="200" default="" default2="" showIfNotDefault="true" />
				<FIELD name="SENS" label="Sens" UI="combo" width="120" default="-1" globalListProvider="SENS"  showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="CLE" label="Clé originale" UI="text" width="200" default="" showIfNotDefault="true" />
			</GROUP>
		</SELECTIONS>
	
		

		<QUERIES>
		
			
		</QUERIES>
	
				
	</COMPONENT>
	
	
	<COMPONENT name="ECRITURES_FOURNISSEUR_SELECTIONS" label="Filtre écritures" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ECRITURES_SELECT" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = '';
					
					$select = $select . "AND v_historique_ecritures_1.clinique_honoraire = 'C' " ;

					$select = $select . "AND v_historique_ecritures_1.ajustement NOT IN ('1','2','3') " ;
					

					
					$JOURNAL_PAIEMENT_X = '[JOURNAL_PAIEMENT_C]';
					$JOURNAL_PAIEMENT_X_CODES = '[JOURNAL_PAIEMENT_C_CODES]';
					$MODE_PAIEMENT_X = '[MODE_PAIEMENT_C]';
					$MODE_PAIEMENT_X_CODES = '[MODE_PAIEMENT_C_CODES]';
					$COMPTE_EXTRA_X = '[COMPTE_EXTRA_C]';
					$COMPTE_EXTRA_X_CODES = '[COMPTE_EXTRA_C_CODES]';
					$PARTENAIRE_X = '[PARTENAIRE_C]';
					$PARTENAIRE_X_CODES = '[PARTENAIRE_C_CODES]';
					$SITE_X = '[SITE_C]';
					$SITE_X_CODES = '[SITE_C_CODES]';
					
					
					if ($JOURNAL_PAIEMENT_X != '-1') {
						$mode = substr($JOURNAL_PAIEMENT_X,0,2);
						$oid = $JOURNAL_PAIEMENT_X;
						if ($mode == 'LS') {
							$section_id = 'journal_section_id[' . substr($JOURNAL_PAIEMENT_X,2,2) . ']';
							$oid = substr($JOURNAL_PAIEMENT_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $JOURNAL_PAIEMENT_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($JOURNAL_PAIEMENT_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($JOURNAL_PAIEMENT_X,2);}
						if ($JOURNAL_PAIEMENT_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($JOURNAL_PAIEMENT_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.journal_paiement_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.journal_paiement_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.journal_paiement_id = $oid";}
						if ($JOURNAL_PAIEMENT_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.journal_paiement_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($MODE_PAIEMENT_X != '-1') {
						$mode = substr($MODE_PAIEMENT_X,0,2);
						$oid = $MODE_PAIEMENT_X;
						if ($mode == 'LS') {
							$section_id = 'mode_section_id[' . substr($MODE_PAIEMENT_X,2,2) . ']';
							$oid = substr($MODE_PAIEMENT_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $MODE_PAIEMENT_X != 'SAISIECODE' ) {
							$mode = 'JR';
							$oid = substr($MODE_PAIEMENT_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($MODE_PAIEMENT_X,2);}
						if ($MODE_PAIEMENT_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($MODE_PAIEMENT_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.mode_paiement_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.mode_paiement_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'JR') {$subselect_select = " v_historique_ecritures_1.mode_paiement_id = $oid";}
						if ($MODE_PAIEMENT_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.mode_paiement_id IN (SELECT oid FROM compta.t_journaux WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					if ($COMPTE_EXTRA_X != '-1') {
						$mode = substr($COMPTE_EXTRA_X,0,2);
						$oid = $COMPTE_EXTRA_X;
						if ($mode == 'LS') {
							$section_id = 'compte_extra_section_id[' . substr($COMPTE_EXTRA_X,2,2) . ']';
							$oid = substr($COMPTE_EXTRA_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'CL' && $mode != 'LS' && $COMPTE_EXTRA_X != 'SAISIECODE' ) {
							$mode = 'CP';
							$oid = substr($COMPTE_EXTRA_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL' || $mode == 'CL') {$oid = substr($COMPTE_EXTRA_X,2);}
						if ($COMPTE_EXTRA_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($COMPTE_EXTRA_X_CODES, 'numero');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.compte_extra_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.compte_extra_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'CP') {$subselect_select = " v_historique_ecritures_1.compte_extra_id = $oid";}
						if ($mode == 'CL') {$subselect_select = " (v_historique_ecritures_1.classe_1_id = $oid OR v_historique_ecritures_1.classe_2_id = $oid OR
												v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_3_id = $oid OR v_historique_ecritures_1.classe_5_id = $oid)";}
						if ($COMPTE_EXTRA_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.compte_extra_id IN (SELECT oid FROM compta.t_comptes WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($PARTENAIRE_X != '-1') {
						$mode = substr($PARTENAIRE_X,0,2);
						$oid = $PARTENAIRE_X;
						if ($mode == 'LS') {
							$section_id = 'partenaire_sectionn_id[' . substr($PARTENAIRE_X,2,2) . ']';
							$oid = substr($PARTENAIRE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $PARTENAIRE_X != 'SAISIECODE' ) {
							$mode = 'PA';
							$oid = substr($PARTENAIRE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($PARTENAIRE_X,2);}
						if ($PARTENAIRE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($PARTENAIRE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.partenaire_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'PA') {$subselect_select = " v_historique_ecritures_1.partenaire_id = $oid";}
						if ($PARTENAIRE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.partenaire_id IN (SELECT oid FROM compta.t_partenaires WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					if ($SITE_X != '-1') {
						$mode = substr($SITE_X,0,2);
						$oid = $SITE_X;
						if ($mode == 'LS') {
							$section_id = 'site_section_id[' . substr($SITE_X,2,2) . ']';
							$oid = substr($SITE_X,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $SITE_X != 'SAISIECODE' ) {
							$mode = 'SI';
							$oid = substr($SITE_X,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($SITE_X,2);}
						if ($SITE_X == 'SAISIECODE') {$where_codes = sql_codes_list_a($SITE_X_CODES, 'code');}
						
						$subselect_select = '';
						
						if ($mode == 'LI') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " v_historique_ecritures_1.site_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " v_historique_ecritures_1.$section_id = $oid";}
						if ($mode == 'SI') {$subselect_select = " v_historique_ecritures_1.site_id = $oid";}
						if ($SITE_X == 'SAISIECODE') {$subselect_select = " v_historique_ecritures_1.site_id IN (SELECT oid FROM compta.t_sites WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = $select. " AND $subselect_select ";}

					}
					
					
					
						
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres écritures" collapsible="true" displayText="= var display:String = '';
		

						if (SELECT.SITE_C != '-1') {
							display = display + '  #B#Site#/B# : ';
							if (SELECT.SITE_C != 'SAISIECODE') {
								display = display + SELECT.SITE_C_LABEL;
							}
							else {
								display = display + SELECT.SITE_C_CODES;
							}
						}
						if (SELECT.JOURNAL_PAIEMENT_C != '-1') {
							display = display + '  #B#Journal Paiement#/B# : ';
							if (SELECT.JOURNAL_PAIEMENT_C != 'SAISIECODE') {
								display = display + SELECT.JOURNAL_PAIEMENT_C_LABEL;
							}
							else {
								display = display + SELECT.JOURNAL_PAIEMENT_C_CODES;
							}
						}
						if (SELECT.MODE_PAIEMENT_C != '-1') {
							display = display + '  #B#Mode Paiement#/B# : ';
							if (SELECT.MODE_PAIEMENT_C != 'SAISIECODE') {
								display = display + SELECT.MODE_PAIEMENT_C_LABEL;
							}
							else {
								display = display + SELECT.MODE_PAIEMENT_C_CODES;
							}
						}
						
						if (SELECT.COMPTE_EXTRA_C != '-1') {
							display = display + '  #B#Compte auxiliaire#/B# : ';
							if (SELECT.COMPTE_EXTRA_C != 'SAISIECODE') {
								display = display + SELECT.COMPTE_EXTRA_C_LABEL;
							}
							else {
								display = display + SELECT.COMPTE_EXTRA_C_CODES;
							}
						}
						if (SELECT.PARTENAIRE_C != '-1') {
							display = display + '  #B#Partenaire#/B# : ';
							if (SELECT.PARTENAIRE_C != 'SAISIECODE') {
								display = display + SELECT.PARTENAIRE_C_LABEL;
							}
							else {
								display = display + SELECT.PARTENAIRE_C_CODES;
							}
						}
					
							
						
						return display;
						">
			
			<GROUP label="">
				<FIELD name="SITE_C" label="Site" UI="combo" width="300" tree="true" default="-1" globalListProvider="SITE_C"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="SITE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.SITE_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="JOURNAL_PAIEMENT_C" label="Journal de paiement" UI="combo" width="300" tree="true" default="-1" globalListProvider="JOURNAUX_PAIEMENT_C"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="JOURNAL_PAIEMENT_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.JOURNAL_PAIEMENT_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="MODE_PAIEMENT_C" label="Mode de paiement" UI="combo" width="300" tree="true" default="-1" globalListProvider="MODE_PAIEMENT_C"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="MODE_PAIEMENT_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.MODE_PAIEMENT_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_EXTRA_C" label="Compte auxiliaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_EXTRA_C"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="COMPTE_EXTRA_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.COMPTE_EXTRA_C == 'SAISIECODE' " />
			</GROUP>
			<GROUP label="">
				<FIELD name="PARTENAIRE_C" label="Partenaire" UI="combo" width="300" tree="true" default="-1" globalListProvider="PARTENAIRES_C"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="PARTENAIRE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.PARTENAIRE_C == 'SAISIECODE' " />
			</GROUP>

		</SELECTIONS>
	
		

		<QUERIES>
		
			
		</QUERIES>
	
	</COMPONENT>
	
    
	<COMPONENT name="ECRITURES_VIEWLINK"  >

		<ARG name="CH" value="SELECT.CH" />
		<ARG name="MOIS" value="SELECT.MOIS" />
		<ARG name="TOMOIS" value="SELECT.TOMOIS" />
		<ARG name="QMOIS" value="SELECT.QMOIS" />
		<ARG name="Q13" value="SELECT.Q13" />
		<ARG name="QAJ" value="SELECT.QAJ" />
		<ARG name="QCONS" value="SELECT.QCONS" />
		
		<ARG name="INDICATEUR" value="'-1'" />
		
		<ARG name="JOURNAL_C" value="SELECT.JOURNAL_C" />
		<ARG name="JOURNAL_C_CODES" value="SELECT.JOURNAL_C_CODES" />
		<ARG name="TYPE_COMPTA_C" value="SELECT.TYPE_COMPTA_C" />
		<ARG name="COMPTE_C" value="SELECT.COMPTE_C" />
		<ARG name="COMPTE_C_CODES" value="SELECT.COMPTE_C_CODES" />
		<ARG name="TYPE_COMPTA_EXTRA_C" value="SELECT.TYPE_COMPTA_EXTRA_C" />
		<ARG name="COMPTE_EXTRA_C" value="SELECT.COMPTE_EXTRA_C" />
		<ARG name="COMPTE_EXTRA_C_CODES" value="SELECT.COMPTE_EXTRA_C_CODES" />
		<ARG name="SECTION_ANALYTIQUE_C" value="SELECT.SECTION_ANALYTIQUE_C" />
		<ARG name="SECTION_ANALYTIQUE_2_C" value="SELECT.SECTION_ANALYTIQUE_2_C" />
		<ARG name="SECTION_ANALYTIQUE_3_C" value="SELECT.SECTION_ANALYTIQUE_3_C" />
		<ARG name="SECTION_ANALYTIQUE_4_C" value="SELECT.SECTION_ANALYTIQUE_4_C" />
		<ARG name="SECTION_ANALYTIQUE_5_C" value="SELECT.SECTION_ANALYTIQUE_5_C" />
		<ARG name="SECTION_ANALYTIQUE_6_C" value="SELECT.SECTION_ANALYTIQUE_6_C" />
        <ARG name="SECTION_ANALYTIQUE_7_C" value="SELECT.SECTION_ANALYTIQUE_7_C" />
        <ARG name="SECTION_ANALYTIQUE_8_C" value="SELECT.SECTION_ANALYTIQUE_8_C" />
        <ARG name="SECTION_ANALYTIQUE_9_C" value="SELECT.SECTION_ANALYTIQUE_9_C" />
		
		<ARG name="JOURNAL_H" value="SELECT.JOURNAL_H" />
		<ARG name="JOURNAL_H_CODES" value="SELECT.JOURNAL_H_CODES" />
		<ARG name="TYPE_COMPTA_H" value="SELECT.TYPE_COMPTA_H" />
		<ARG name="COMPTE_H" value="SELECT.COMPTE_H" />
		<ARG name="COMPTE_H_CODES" value="SELECT.COMPTE_H_CODES" />
		<ARG name="TYPE_COMPTA_EXTRA_H" value="SELECT.TYPE_COMPTA_EXTRA_H" />
		<ARG name="COMPTE_EXTRA_H" value="SELECT.COMPTE_EXTRA_H" />
		<ARG name="COMPTE_EXTRA_H_CODES" value="SELECT.COMPTE_EXTRA_H_CODES" />
		
	</COMPONENT>
	
    
	<COMPONENT name="COMPTA_VIEWLINK"  >
		
                <!-- <ARG name="SENS" value="	if (COLUMN.NAME == 'DEB') {return 'D'} -->
											<!-- if (COLUMN.NAME == 'CRE') {return 'C'}"/> -->
				
				<ARG name="JOURNAL_C" value="	if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'JRN' &amp;&amp; ROW.LVL == '6') {return 'JR' + ROW.OID6}
													if (SELECT.GROUPBY == 'JRNCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'JRNCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'JRNCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'JRN' &amp;&amp; ROW.OID1 != '0') {return 'JR' + ROW.OID1}
													if (SELECT.ARBRE1 == 'JRNCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'JRNCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'JRNCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'JRN' &amp;&amp; ROW.OID2 != '0') {return 'JR' + ROW.OID2}
													if (SELECT.ARBRE2 == 'JRNCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'JRNCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'JRNCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'JRN' &amp;&amp; ROW.OID3 != '0') {return 'JR' + ROW.OID3}
													if (SELECT.ARBRE3 == 'JRNCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'JRNCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'JRNCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'JRN' &amp;&amp; ROW.OID4 != '0') {return 'JR' + ROW.OID4}
													if (SELECT.ARBRE4 == 'JRNCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'JRNCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'JRNCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'JRN' &amp;&amp; ROW.OID5 != '0') {return 'JR' + ROW.OID5}
													if (SELECT.ARBRE5 == 'JRNCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'JRNCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'JRNCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
													return SELECT.JRN;
												}"/>
				<ARG name="TYPE_COMPTA_C" value="	if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'TYP' &amp;&amp; ROW.LVL == '6') {return 'TY' + ROW.OID6}
													if (SELECT.ARBRE1 == 'TYP' &amp;&amp; ROW.OID1 != '0') {return 'TY' + ROW.OID1}
													if (SELECT.ARBRE2 == 'TYP' &amp;&amp; ROW.OID2 != '0') {return 'TY' + ROW.OID2}
													if (SELECT.ARBRE3 == 'TYP' &amp;&amp; ROW.OID3 != '0') {return 'TY' + ROW.OID3}
													if (SELECT.ARBRE4 == 'TYP' &amp;&amp; ROW.OID4 != '0') {return 'TY' + ROW.OID4}
													if (SELECT.ARBRE5 == 'TYP' &amp;&amp; ROW.OID5 != '0') {return 'TY' + ROW.OID5}
												}"/>
				<ARG name="COMPTE_C" value="	if (SELECT.CH == 'C') {
				
													if (SELECT.GROUPBY == 'CPT' &amp;&amp; ROW.LVL == '6') {return 'CP' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS04' &amp;&amp; ROW.LVL == '6') {return 'LS04' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS05' &amp;&amp; ROW.LVL == '6') {return 'LS05' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS06' &amp;&amp; ROW.LVL == '6') {return 'LS06' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS07' &amp;&amp; ROW.LVL == '6') {return 'LS07' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS08' &amp;&amp; ROW.LVL == '6') {return 'LS08' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS09' &amp;&amp; ROW.LVL == '6') {return 'LS09' + ROW.OID6}
													if (SELECT.ARBRE1 == 'CPT' &amp;&amp; ROW.OID1 != '0') {return 'CP' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS04' &amp;&amp; ROW.OID1 != '0') {return 'LS04' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS05' &amp;&amp; ROW.OID1 != '0') {return 'LS05' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS06' &amp;&amp; ROW.OID1 != '0') {return 'LS06' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS07' &amp;&amp; ROW.OID1 != '0') {return 'LS07' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS08' &amp;&amp; ROW.OID1 != '0') {return 'LS08' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS09' &amp;&amp; ROW.OID1 != '0') {return 'LS09' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CPT' &amp;&amp; ROW.OID2 != '0') {return 'CP' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS04' &amp;&amp; ROW.OID2 != '0') {return 'LS04' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS05' &amp;&amp; ROW.OID2 != '0') {return 'LS05' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS06' &amp;&amp; ROW.OID2 != '0') {return 'LS06' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS07' &amp;&amp; ROW.OID2 != '0') {return 'LS07' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS08' &amp;&amp; ROW.OID2 != '0') {return 'LS08' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS09' &amp;&amp; ROW.OID2 != '0') {return 'LS09' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CPT' &amp;&amp; ROW.OID3 != '0') {return 'CP' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS04' &amp;&amp; ROW.OID3 != '0') {return 'LS04' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS05' &amp;&amp; ROW.OID3 != '0') {return 'LS05' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS06' &amp;&amp; ROW.OID3 != '0') {return 'LS06' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS07' &amp;&amp; ROW.OID3 != '0') {return 'LS07' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS08' &amp;&amp; ROW.OID3 != '0') {return 'LS08' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS09' &amp;&amp; ROW.OID3 != '0') {return 'LS09' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CPT' &amp;&amp; ROW.OID4 != '0') {return 'CP' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS04' &amp;&amp; ROW.OID4 != '0') {return 'LS04' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS05' &amp;&amp; ROW.OID4 != '0') {return 'LS05' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS06' &amp;&amp; ROW.OID4 != '0') {return 'LS06' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS07' &amp;&amp; ROW.OID4 != '0') {return 'LS07' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS08' &amp;&amp; ROW.OID4 != '0') {return 'LS08' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS09' &amp;&amp; ROW.OID4 != '0') {return 'LS09' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CPT' &amp;&amp; ROW.OID5 != '0') {return 'CP' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS04' &amp;&amp; ROW.OID5 != '0') {return 'LS04' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS05' &amp;&amp; ROW.OID5 != '0') {return 'LS05' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS06' &amp;&amp; ROW.OID5 != '0') {return 'LS06' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS07' &amp;&amp; ROW.OID5 != '0') {return 'LS07' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS08' &amp;&amp; ROW.OID5 != '0') {return 'LS08' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS09' &amp;&amp; ROW.OID5 != '0') {return 'LS09' + ROW.OID5}

													
													if (SELECT.ARBRE1 == 'CL3' &amp;&amp; ROW.OID1 != '0') {return 'CL' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CL3' &amp;&amp; ROW.OID2 != '0') {return 'CL' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CL3' &amp;&amp; ROW.OID3 != '0') {return 'CL' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CL3' &amp;&amp; ROW.OID4 != '0') {return 'CL' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CL3' &amp;&amp; ROW.OID5 != '0') {return 'CL' + ROW.OID5}
													if (SELECT.GROUPBY == 'CL3' &amp;&amp; ROW.LVL == '6') {return 'CL' + ROW.OID}
													
													if (SELECT.ARBRE1 == 'CL2' &amp;&amp; ROW.OID1 != '0') {return 'CL' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CL2' &amp;&amp; ROW.OID2 != '0') {return 'CL' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CL2' &amp;&amp; ROW.OID3 != '0') {return 'CL' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CL2' &amp;&amp; ROW.OID4 != '0') {return 'CL' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CL2' &amp;&amp; ROW.OID5 != '0') {return 'CL' + ROW.OID5}
													if (SELECT.GROUPBY == 'CL2' &amp;&amp; ROW.LVL == '6') {return 'CL' + ROW.OID}
													
													if (SELECT.ARBRE1 == 'CL1' &amp;&amp; ROW.OID1 != '0') {return 'CL' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CL1' &amp;&amp; ROW.OID2 != '0') {return 'CL' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CL1' &amp;&amp; ROW.OID3 != '0') {return 'CL' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CL1' &amp;&amp; ROW.OID4 != '0') {return 'CL' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CL1' &amp;&amp; ROW.OID5 != '0') {return 'CL' + ROW.OID5}
													if (SELECT.GROUPBY == 'CL1' &amp;&amp; ROW.LVL == '6') {return 'CL' + ROW.OID}
													
													return SELECT.COMPTE;
												}"/>
				<ARG name="COMPTE_EXTRA_C" value="	if (SELECT.CH == 'C') {
				
													if (SELECT.GROUPBY == 'CPX' &amp;&amp; ROW.LVL == '6') {return 'CP' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPXCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPXCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPXCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'CPX' &amp;&amp; ROW.OID1 != '0') {return 'CP' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPXCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPXCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPXCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CPX' &amp;&amp; ROW.OID2 != '0') {return 'CP' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPXCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPXCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPXCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CPX' &amp;&amp; ROW.OID3 != '0') {return 'CP' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPXCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPXCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPXCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CPX' &amp;&amp; ROW.OID4 != '0') {return 'CP' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPXCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPXCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPXCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CPX' &amp;&amp; ROW.OID5 != '0') {return 'CP' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPXCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPXCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPXCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}

													
												}"/>
				<ARG name="SECTION_ANALYTIQUE_C" value="if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'ANA' &amp;&amp; ROW.LVL == '6') {return 'SA' + ROW.OID}
													if (SELECT.ARBRE1 == 'ANA' &amp;&amp; ROW.COD1 != '') {return 'SA' + ROW.OID1}
													if (SELECT.ARBRE2 == 'ANA' &amp;&amp; ROW.COD2 != '') {return 'SA' + ROW.OID2}
													if (SELECT.ARBRE3 == 'ANA' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE4 == 'ANA' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE5 == 'ANA' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
												}"/>
				<ARG name="SECTION_ANALYTIQUE_2_C" value="if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'AN2' &amp;&amp; ROW.LVL == '6') {return 'SA' + ROW.OID}
													if (SELECT.ARBRE1 == 'AN2' &amp;&amp; ROW.COD1 != '') {return 'SA' + ROW.OID1}
													if (SELECT.ARBRE2 == 'AN2' &amp;&amp; ROW.COD2 != '') {return 'SA' + ROW.OID2}
													if (SELECT.ARBRE3 == 'AN2' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE4 == 'AN2' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE5 == 'AN2' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
												}"/>
				<ARG name="SECTION_ANALYTIQUE_3_C" value="if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'AN3' &amp;&amp; ROW.LVL == '6') {return 'SA' + ROW.OID}
													if (SELECT.ARBRE1 == 'AN3' &amp;&amp; ROW.COD1 != '') {return 'SA' + ROW.OID1}
													if (SELECT.ARBRE3 == 'AN3' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE3 == 'AN3' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE4 == 'AN3' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE5 == 'AN3' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
												}"/>
				<ARG name="SECTION_ANALYTIQUE_4_C" value="if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'AN4' &amp;&amp; ROW.LVL == '6') {return 'SA' + ROW.OID}
													if (SELECT.ARBRE1 == 'AN4' &amp;&amp; ROW.COD1 != '') {return 'SA' + ROW.OID1}
													if (SELECT.ARBRE4 == 'AN4' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE3 == 'AN4' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE4 == 'AN4' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE5 == 'AN4' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
												}"/>
				<ARG name="SECTION_ANALYTIQUE_5_C" value="if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'AN5' &amp;&amp; ROW.LVL == '6') {return 'SA' + ROW.OID}
													if (SELECT.ARBRE1 == 'AN5' &amp;&amp; ROW.COD1 != '') {return 'SA' + ROW.OID1}
													if (SELECT.ARBRE5 == 'AN5' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
													if (SELECT.ARBRE3 == 'AN5' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE4 == 'AN5' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE5 == 'AN5' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
												}"/>
				<ARG name="SECTION_ANALYTIQUE_6_C" value="if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'AN6' &amp;&amp; ROW.LVL == '6') {return 'SA' + ROW.OID}
													if (SELECT.ARBRE1 == 'AN6' &amp;&amp; ROW.COD1 != '') {return 'SA' + ROW.OID1}
													if (SELECT.ARBRE6 == 'AN6' &amp;&amp; ROW.COD6 != '') {return 'SA' + ROW.OID6}
													if (SELECT.ARBRE3 == 'AN6' &amp;&amp; ROW.COD3 != '') {return 'SA' + ROW.OID3}
													if (SELECT.ARBRE4 == 'AN6' &amp;&amp; ROW.COD4 != '') {return 'SA' + ROW.OID4}
													if (SELECT.ARBRE5 == 'AN6' &amp;&amp; ROW.COD5 != '') {return 'SA' + ROW.OID5}
												}"/>
				<ARG name="SITE_C" value="	if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'SIT' &amp;&amp; ROW.LVL == '6') {return 'SI' + ROW.OID6}
													if (SELECT.GROUPBY == 'SITCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'SITCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'SITCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'SIT' &amp;&amp; ROW.OID1 != '0') {return 'SI' + ROW.OID1}
													if (SELECT.ARBRE1 == 'SITCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'SITCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'SITCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'SIT' &amp;&amp; ROW.OID2 != '0') {return 'SI' + ROW.OID2}
													if (SELECT.ARBRE2 == 'SITCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'SITCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'SITCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'SIT' &amp;&amp; ROW.OID3 != '0') {return 'SI' + ROW.OID3}
													if (SELECT.ARBRE3 == 'SITCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'SITCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'SITCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'SIT' &amp;&amp; ROW.OID4 != '0') {return 'SI' + ROW.OID4}
													if (SELECT.ARBRE4 == 'SITCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'SITCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'SITCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'SIT' &amp;&amp; ROW.OID5 != '0') {return 'SI' + ROW.OID5}
													if (SELECT.ARBRE5 == 'SITCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'SITCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'SITCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
												}"/>
				<ARG name="PARTENAIRE_C" value="	if (SELECT.CH == 'C') {
													if (SELECT.GROUPBY == 'PAR' &amp;&amp; ROW.LVL == '6') {return 'PA' + ROW.OID6}
													if (SELECT.GROUPBY == 'PARCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'PARCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'PARCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'PAR' &amp;&amp; ROW.OID1 != '0') {return 'PA' + ROW.OID1}
													if (SELECT.ARBRE1 == 'PARCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'PARCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'PARCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'PAR' &amp;&amp; ROW.OID2 != '0') {return 'PA' + ROW.OID2}
													if (SELECT.ARBRE2 == 'PARCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'PARCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'PARCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'PAR' &amp;&amp; ROW.OID3 != '0') {return 'PA' + ROW.OID3}
													if (SELECT.ARBRE3 == 'PARCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'PARCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'PARCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'PAR' &amp;&amp; ROW.OID4 != '0') {return 'PA' + ROW.OID4}
													if (SELECT.ARBRE4 == 'PARCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'PARCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'PARCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'PAR' &amp;&amp; ROW.OID5 != '0') {return 'PA' + ROW.OID5}
													if (SELECT.ARBRE5 == 'PARCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'PARCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'PARCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
												
												}"/>
				<ARG name="JOURNAL_H" value="	if (SELECT.CH == 'H') {
													if (SELECT.GROUPBY == 'JRN' &amp;&amp; ROW.LVL == '6') {return 'JR' + ROW.OID6}
													if (SELECT.GROUPBY == 'JRNCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'JRNCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'JRNCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'JRN' &amp;&amp; ROW.OID1 != '0') {return 'JR' + ROW.OID1}
													if (SELECT.ARBRE1 == 'JRNCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'JRNCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'JRNCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'JRN' &amp;&amp; ROW.OID2 != '0') {return 'JR' + ROW.OID2}
													if (SELECT.ARBRE2 == 'JRNCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'JRNCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'JRNCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'JRN' &amp;&amp; ROW.OID3 != '0') {return 'JR' + ROW.OID3}
													if (SELECT.ARBRE3 == 'JRNCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'JRNCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'JRNCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'JRN' &amp;&amp; ROW.OID4 != '0') {return 'JR' + ROW.OID4}
													if (SELECT.ARBRE4 == 'JRNCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'JRNCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'JRNCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'JRN' &amp;&amp; ROW.OID5 != '0') {return 'JR' + ROW.OID5}
													if (SELECT.ARBRE5 == 'JRNCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'JRNCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'JRNCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
												}"/>
				<ARG name="TYPE_COMPTA_H" value="	if (SELECT.CH == 'H') {
													if (SELECT.GROUPBY == 'TYP' &amp;&amp; ROW.LVL == '6') {return 'TY' + ROW.OID6}
													if (SELECT.ARBRE1 == 'TYP' &amp;&amp; ROW.OID1 != '0') {return 'TY' + ROW.OID1}
													if (SELECT.ARBRE2 == 'TYP' &amp;&amp; ROW.OID2 != '0') {return 'TY' + ROW.OID2}
													if (SELECT.ARBRE3 == 'TYP' &amp;&amp; ROW.OID3 != '0') {return 'TY' + ROW.OID3}
													if (SELECT.ARBRE4 == 'TYP' &amp;&amp; ROW.OID4 != '0') {return 'TY' + ROW.OID4}
													if (SELECT.ARBRE5 == 'TYP' &amp;&amp; ROW.OID5 != '0') {return 'TY' + ROW.OID5}
												}"/>
				<ARG name="COMPTE_H" value="	if (SELECT.CH == 'H') {
													
													if (SELECT.GROUPBY == 'CPT' &amp;&amp; ROW.LVL == '6') {return 'CP' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPTCLS09' &amp;&amp; ROW.LVL == '6') {return 'LS09' + ROW.OID6}
													if (SELECT.ARBRE1 == 'CPT' &amp;&amp; ROW.OID1 != '0') {return 'CP' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPTCLS09' &amp;&amp; ROW.OID1 != '0') {return 'LS09' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CPT' &amp;&amp; ROW.OID2 != '0') {return 'CP' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPTCLS09' &amp;&amp; ROW.OID2 != '0') {return 'LS09' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CPT' &amp;&amp; ROW.OID3 != '0') {return 'CP' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPTCLS09' &amp;&amp; ROW.OID3 != '0') {return 'LS09' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CPT' &amp;&amp; ROW.OID4 != '0') {return 'CP' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPTCLS09' &amp;&amp; ROW.OID4 != '0') {return 'LS09' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CPT' &amp;&amp; ROW.OID5 != '0') {return 'CP' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPTCLS09' &amp;&amp; ROW.OID5 != '0') {return 'LS09' + ROW.OID5}

													
													if (SELECT.ARBRE1 == 'CL3' &amp;&amp; ROW.OID1 != '0') {return 'CL' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CL3' &amp;&amp; ROW.OID2 != '0') {return 'CL' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CL3' &amp;&amp; ROW.OID3 != '0') {return 'CL' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CL3' &amp;&amp; ROW.OID4 != '0') {return 'CL' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CL3' &amp;&amp; ROW.OID5 != '0') {return 'CL' + ROW.OID5}
													if (SELECT.GROUPBY == 'CL3' &amp;&amp; ROW.LVL == '6') {return 'CL' + ROW.OID}
													
													if (SELECT.ARBRE1 == 'CL2' &amp;&amp; ROW.OID1 != '0') {return 'CL' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CL2' &amp;&amp; ROW.OID2 != '0') {return 'CL' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CL2' &amp;&amp; ROW.OID3 != '0') {return 'CL' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CL2' &amp;&amp; ROW.OID4 != '0') {return 'CL' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CL2' &amp;&amp; ROW.OID5 != '0') {return 'CL' + ROW.OID5}
													if (SELECT.GROUPBY == 'CL2' &amp;&amp; ROW.LVL == '6') {return 'CL' + ROW.OID}
													
													if (SELECT.ARBRE1 == 'CL1' &amp;&amp; ROW.OID1 != '0') {return 'CL' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CL1' &amp;&amp; ROW.OID2 != '0') {return 'CL' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CL1' &amp;&amp; ROW.OID3 != '0') {return 'CL' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CL1' &amp;&amp; ROW.OID4 != '0') {return 'CL' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CL1' &amp;&amp; ROW.OID5 != '0') {return 'CL' + ROW.OID5}
													if (SELECT.GROUPBY == 'CL1' &amp;&amp; ROW.LVL == '6') {return 'CL' + ROW.OID}
													

												}"/>
				<ARG name="COMPTE_EXTRA_H" value="	if (SELECT.CH == 'H') {
													if (SELECT.GROUPBY == 'CPX' &amp;&amp; ROW.LVL == '6') {return 'CP' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPXCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPXCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'CPXCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'CPX' &amp;&amp; ROW.OID1 != '0') {return 'CP' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPXCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPXCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'CPXCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'CPX' &amp;&amp; ROW.OID2 != '0') {return 'CP' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPXCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPXCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'CPXCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'CPX' &amp;&amp; ROW.OID3 != '0') {return 'CP' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPXCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPXCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'CPXCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'CPX' &amp;&amp; ROW.OID4 != '0') {return 'CP' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPXCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPXCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'CPXCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'CPX' &amp;&amp; ROW.OID5 != '0') {return 'CP' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPXCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPXCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'CPXCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
												}"/>
				<ARG name="SITE_H" value="	if (SELECT.CH == 'H') {
													if (SELECT.GROUPBY == 'SIT' &amp;&amp; ROW.LVL == '6') {return 'SI' + ROW.OID6}
													if (SELECT.GROUPBY == 'SITCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'SITCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'SITCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'SIT' &amp;&amp; ROW.OID1 != '0') {return 'SI' + ROW.OID1}
													if (SELECT.ARBRE1 == 'SITCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'SITCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'SITCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'SIT' &amp;&amp; ROW.OID2 != '0') {return 'SI' + ROW.OID2}
													if (SELECT.ARBRE2 == 'SITCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'SITCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'SITCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'SIT' &amp;&amp; ROW.OID3 != '0') {return 'SI' + ROW.OID3}
													if (SELECT.ARBRE3 == 'SITCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'SITCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'SITCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'SIT' &amp;&amp; ROW.OID4 != '0') {return 'SI' + ROW.OID4}
													if (SELECT.ARBRE4 == 'SITCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'SITCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'SITCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'SIT' &amp;&amp; ROW.OID5 != '0') {return 'SI' + ROW.OID5}
													if (SELECT.ARBRE5 == 'SITCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'SITCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'SITCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
												}"/>
				<ARG name="PARTENAIRE_H" value="	if (SELECT.CH == 'H') {
													if (SELECT.GROUPBY == 'PAR' &amp;&amp; ROW.LVL == '6') {return 'PA' + ROW.OID6}
													if (SELECT.GROUPBY == 'PARCLS01' &amp;&amp; ROW.LVL == '6') {return 'LS01' + ROW.OID6}
													if (SELECT.GROUPBY == 'PARCLS02' &amp;&amp; ROW.LVL == '6') {return 'LS02' + ROW.OID6}
													if (SELECT.GROUPBY == 'PARCLS03' &amp;&amp; ROW.LVL == '6') {return 'LS03' + ROW.OID6}
													if (SELECT.ARBRE1 == 'PAR' &amp;&amp; ROW.OID1 != '0') {return 'PA' + ROW.OID1}
													if (SELECT.ARBRE1 == 'PARCLS01' &amp;&amp; ROW.OID1 != '0') {return 'LS01' + ROW.OID1}
													if (SELECT.ARBRE1 == 'PARCLS02' &amp;&amp; ROW.OID1 != '0') {return 'LS02' + ROW.OID1}
													if (SELECT.ARBRE1 == 'PARCLS03' &amp;&amp; ROW.OID1 != '0') {return 'LS03' + ROW.OID1}
													if (SELECT.ARBRE2 == 'PAR' &amp;&amp; ROW.OID2 != '0') {return 'PA' + ROW.OID2}
													if (SELECT.ARBRE2 == 'PARCLS01' &amp;&amp; ROW.OID2 != '0') {return 'LS01' + ROW.OID2}
													if (SELECT.ARBRE2 == 'PARCLS02' &amp;&amp; ROW.OID2 != '0') {return 'LS02' + ROW.OID2}
													if (SELECT.ARBRE2 == 'PARCLS03' &amp;&amp; ROW.OID2 != '0') {return 'LS03' + ROW.OID2}
													if (SELECT.ARBRE3 == 'PAR' &amp;&amp; ROW.OID3 != '0') {return 'PA' + ROW.OID3}
													if (SELECT.ARBRE3 == 'PARCLS01' &amp;&amp; ROW.OID3 != '0') {return 'LS01' + ROW.OID3}
													if (SELECT.ARBRE3 == 'PARCLS02' &amp;&amp; ROW.OID3 != '0') {return 'LS02' + ROW.OID3}
													if (SELECT.ARBRE3 == 'PARCLS03' &amp;&amp; ROW.OID3 != '0') {return 'LS03' + ROW.OID3}
													if (SELECT.ARBRE4 == 'PAR' &amp;&amp; ROW.OID4 != '0') {return 'PA' + ROW.OID4}
													if (SELECT.ARBRE4 == 'PARCLS01' &amp;&amp; ROW.OID4 != '0') {return 'LS01' + ROW.OID4}
													if (SELECT.ARBRE4 == 'PARCLS02' &amp;&amp; ROW.OID4 != '0') {return 'LS02' + ROW.OID4}
													if (SELECT.ARBRE4 == 'PARCLS03' &amp;&amp; ROW.OID4 != '0') {return 'LS03' + ROW.OID4}
													if (SELECT.ARBRE5 == 'PAR' &amp;&amp; ROW.OID5 != '0') {return 'PA' + ROW.OID5}
													if (SELECT.ARBRE5 == 'PARCLS01' &amp;&amp; ROW.OID5 != '0') {return 'LS01' + ROW.OID5}
													if (SELECT.ARBRE5 == 'PARCLS02' &amp;&amp; ROW.OID5 != '0') {return 'LS02' + ROW.OID5}
													if (SELECT.ARBRE5 == 'PARCLS03' &amp;&amp; ROW.OID5 != '0') {return 'LS03' + ROW.OID5}
												}"/>
				<ARG name="FACTURE" value="if (SELECT.GROUPBY == 'FAC' &amp;&amp; ROW.LVL == '6') {return ROW.COD}"/>
		
	</COMPONENT>
	
	<COMPONENT name="MULTICRITERES_PROPERTIES" label="Propriétés diverses multi_criteres" >
	
		<VIEWPROPERTIES>
			
			<PROPERTY name="GROUPBY_OID_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_id("[GROUPBY]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_COD_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_code("[GROUPBY]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_TXT_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_texte("[GROUPBY]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_2_OID_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_id("[GROUPBY_2]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_2_COD_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_code("[GROUPBY_2]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_2_TXT_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_texte("[GROUPBY_2]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_3_OID_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_id("[GROUPBY_3]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_3_COD_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_code("[GROUPBY_3]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_3_TXT_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_texte("[GROUPBY_3]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="COLUMNBY_OID_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_id("[COLUMNBY]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="COLUMNBY_COD_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_code("[COLUMNBY]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="COLUMNBY_TXT_FIELD" value="" >
				<value>
					<![CDATA[
						[EVAL 
							return COMPTA_standard_field_texte("[COLUMNBY]", "");
						EVAL]
					]]>
				</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$field_id = COMPTA_standard_field_id('[GROUPBY]', "MOI");
						$field_code = COMPTA_standard_field_code('[GROUPBY]', "MOI");

						return "$field_id::bigint, $field_code::text";
						
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="QTAB" value="" >
					<value><![CDATA[
						[EVAL 
						if ('[GROUPBY_TAB]' == 'TAB') {
							return '1';
						}
						if ('[GROUPBY_TAB]' == 'AUTO' && '[ARBRE2]' != '-1') {
							return '1';
						}
						return '0';
						EVAL]
					]]>
					</value>
			</PROPERTY>

			<PROPERTY name="ARBRE1_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$field_id = COMPTA_standard_field_id('[ARBRE1]');
						$field_code = COMPTA_standard_field_code('[ARBRE1]');

						return "$field_id::bigint, $field_code::text";
						
						EVAL]
					]]>
					</value>
			</PROPERTY>
					
			<PROPERTY name="TAB1_RESUME_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						return " -9999999, ' Résumé', 'Résumé' " ;
						EVAL]
					]]>
					</value>
			</PROPERTY>
						
			<PROPERTY name="TAB1_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$qtab = false;
						if ('[GROUPBY_TAB]' == 'TAB') {
							$qtab = true;
						}
						if ('[GROUPBY_TAB]' == 'AUTO' && '[ARBRE2]' != '-1') {
							$qtab = true;
						}

						if ($qtab == true) {
							
							$field_id = COMPTA_standard_field_id('[ARBRE1]','*TAB');
							$field_code = COMPTA_standard_field_code('[ARBRE1]','*TAB');
							$field_texte = COMPTA_standard_field_texte('[ARBRE1]','*TAB');

							return "$field_id::bigint, substr($field_code::text || ' ' || $field_texte , 1 , 15), $field_code::text || ' ' || $field_texte";
						}
						else {
							return "-9999999, ' Résumé', 'Résumé' " ;
						}
						
						EVAL]
					]]>
					</value>
			</PROPERTY>

					
			<PROPERTY name="ARBRE2_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$field_id = COMPTA_standard_field_id('[ARBRE2]');
						$field_code = COMPTA_standard_field_code('[ARBRE2]');

						return "$field_id::bigint, $field_code::text";
						
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE3_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$field_id = COMPTA_standard_field_id('[ARBRE3]');
						$field_code = COMPTA_standard_field_code('[ARBRE3]');

						return "$field_id::bigint, $field_code::text";
						
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE4_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$field_id = COMPTA_standard_field_id('[ARBRE4]');
						$field_code = COMPTA_standard_field_code('[ARBRE4]');

						return "$field_id::bigint, $field_code::text";
						
						EVAL]
					]]>
					</value>
			</PROPERTY>
				
			<PROPERTY name="ARBRE5_FIELDS" value="" >
					<value><![CDATA[
						[EVAL 
						
						$field_id = COMPTA_standard_field_id('[ARBRE5]');
						$field_code = COMPTA_standard_field_code('[ARBRE5]');

						return "$field_id::bigint, $field_code::text";
						
						EVAL]
					]]>
					</value>
			</PROPERTY>
		
					
			<PROPERTY name="TEXT_FIELDS" >
						<value><![CDATA[
							[EVAL 
							
							$field_texte = COMPTA_standard_field_texte('[GROUPBY]', "MOI");

							return "$field_texte::text";
							
							EVAL]
						]]>
						</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE1TEXT_FIELDS" >
						<value><![CDATA[
							[EVAL 
							
							$field_texte = COMPTA_standard_field_texte('[ARBRE1]');

							return "$field_texte::text";
							
							EVAL]
						]]>
						</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE2TEXT_FIELDS" >
						<value><![CDATA[
							[EVAL 
							
							$field_texte = COMPTA_standard_field_texte('[ARBRE2]');

							return "$field_texte::text";
							
							EVAL]
						]]>
						</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE3TEXT_FIELDS" >
						<value><![CDATA[
							[EVAL 
							
							$field_texte = COMPTA_standard_field_texte('[ARBRE3]');

							return "$field_texte::text";
							
							EVAL]
						]]>
						</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE4TEXT_FIELDS" >
						<value><![CDATA[
							[EVAL 
							
							$field_texte = COMPTA_standard_field_texte('[ARBRE4]');

							return "$field_texte::text";
							
							EVAL]
						]]>
						</value>
			</PROPERTY>
			
			<PROPERTY name="ARBRE5TEXT_FIELDS" >
						<value><![CDATA[
							[EVAL 
							
							$field_texte = COMPTA_standard_field_texte('[ARBRE5]');

							return "$field_texte::text";
							
							EVAL]
						]]>
						</value>
			</PROPERTY>
					
					
					
				
			<PROPERTY name="GROUP0BY_FIELDS" >
					<value><![CDATA[
							[EVAL 
							return "0::bigint, ''";
							EVAL]
						]]>
					</value>
			</PROPERTY>
			
		</VIEWPROPERTIES>
	</COMPONENT>
	
	
	
		
	<COMPONENT name="ANALYTIQUE_SHS_SELECTIONS" label="Filtre analytiques" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="ANALYTIQUE_SHS_SELECT" value="[EVAL 
					$select = '';
					
					if ('[ETAPE]' == '0') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_avant_repartition &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_avant_repartition &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '1') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_1 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_1 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '2') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_2 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_2 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '3') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_3 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_3 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '4') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_4 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_4 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '5') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_5 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_5 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '6') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_6 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_6 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '7') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_7 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_7 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '8') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_8 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_8 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == '9') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_9 &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_9 &lt;&gt; 0 
						)';
					}
					if ('[ETAPE]' == 'P') {
						$select = $select . ' AND (
							v_repartitions_analytiques_shs_1.montant_prevision_apres_repartition &lt;&gt; 0 OR
							v_repartitions_analytiques_shs_1.montant_realisation_apres_repartition &lt;&gt; 0 
						)';
					}					
					

					if ('[COMPTE_C]' != '-1') {
						if (substr('[COMPTE_C]',0,2) == 'LI') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.compte_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[COMPTE_C]',2) . ')';
						}
						if (substr('[COMPTE_C]',0,2) == 'SL') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.compte_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[COMPTE_C]',2) . ')';
						}
						if (substr('[COMPTE_C]',0,2) == 'LS') {$select = $select . ' AND compte_section_id[' . substr('[COMPTE_C]', 2, 2) . '] = ' . substr('[COMPTE_C]',4);}
						if ('[COMPTE_C]' == 'SAISIECODE') {
							$select = $select . &quot; AND v_repartitions_analytiques_shs_1.compte_id IN (SELECT oid FROM compta.t_comptes WHERE &quot; . sql_codes_list_a('[COMPTE_C_CODES]', 'numero') . &quot;)&quot;; 
						}
						if (substr('[COMPTE_C]',0,2) == 'CP') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.compte_id = ' . substr('[COMPTE_C]',2); 
						}
						if (substr('[COMPTE_C]',0,2) == 'CL') {
							$select = $select . ' AND (';
							$select = $select . ' v_repartitions_analytiques_shs_1.classe_1_id = ' . substr('[COMPTE_C]',2); 
							$select = $select . ' OR ';
							$select = $select . ' v_repartitions_analytiques_shs_1.classe_2_id = ' . substr('[COMPTE_C]',2); 
							$select = $select . ' OR ';
							$select = $select . ' v_repartitions_analytiques_shs_1.classe_3_id = ' . substr('[COMPTE_C]',2); 
							$select = $select . ' OR ';
							$select = $select . ' v_repartitions_analytiques_shs_1.classe_4_id = ' . substr('[COMPTE_C]',2); 
							$select = $select . ' OR ';
							$select = $select . ' v_repartitions_analytiques_shs_1.classe_5_id = ' . substr('[COMPTE_C]',2); 
							$select = $select . ' )';
						}
						
						$select = $select . ' ';
					}
					
					
					
					if ('[TYPE_COMPTA_C]' != '-1') {
						$select = $select . ' AND ';
						if (substr('[TYPE_COMPTA_C]',0,2) == 'LI') {
							$select = $select . ' v_repartitions_analytiques_shs_1.type_compta_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[TYPE_COMPTA_C]',2) . ')';
						}
						if (substr('[TYPE_COMPTA_C]',0,2) == 'SL') {
							$select = $select . ' v_repartitions_analytiques_shs_1.type_compta_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[TYPE_COMPTA_C]',2) . ')';
						}
						if (substr('[TYPE_COMPTA_C]',0,2) == 'TY') {
							$select = $select . ' v_repartitions_analytiques_shs_1.type_compta_id = ' . substr('[TYPE_COMPTA_C]',2); 
						}
						$select = $select . ' ';
					}
					
					
					
					if ('[SECTION_ANALYTIQUE_C]' != '-1') {
						if (substr('[SECTION_ANALYTIQUE_C]',0,2) == 'LI') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[SECTION_ANALYTIQUE_C]',2) . ')';
						}
						if (substr('[SECTION_ANALYTIQUE_C]',0,2) == 'SL') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[SECTION_ANALYTIQUE_C]',2) . ')';
						}
						if (substr('[SECTION_ANALYTIQUE_C]',0,2) == 'LS') {$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_section_id[' . substr('[SECTION_ANALYTIQUE_C]', 2, 2) . '] = ' . substr('[SECTION_ANALYTIQUE_C]', 4);}
						
						if (substr('[SECTION_ANALYTIQUE_C]',0,2) == 'SA') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_id = ' . substr('[SECTION_ANALYTIQUE_C]',2); 
						}
						
						$select = $select . ' ';
					}
					
					if ('[SECTION_ANALYTIQUE_ORIGINE_REA_C]' != '-1') {
						if (substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',0,2) == 'LI') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_origine_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',2) . ')';
						}
						if (substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',0,2) == 'SL') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_origine_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = ' . substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',2) . ')';
						}
						if (substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',0,2) == 'LS') {$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]', 2, 2) . '] = ' . substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]', 4);}
						
						if (substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',0,2) == 'SA') {
							$select = $select . ' AND v_repartitions_analytiques_shs_1.section_analytique_origine_id = ' . substr('[SECTION_ANALYTIQUE_ORIGINE_REA_C]',2); 
						}
						
						$select = $select . ' ';
					}
						
					return $select;
																					
				EVAL]" />
							

		</VIEWPROPERTIES>
		
		<SELECTIONS label="Filtres Comptabilité analytique" collapsible="true" displayText="= var display:String = '';
		

						
						if (SELECT.TYPE_COMPTA_C != '-1') {
							display = display + '  #B#Type comptabilité#/B# : ';
							display = display + SELECT.TYPE_COMPTA_C_LABEL;
						}
						if (SELECT.COMPTE_C != '-1') {
							display = display + '  #B#Compte#/B# : ';
							if (SELECT.COMPTE_C != 'SAISIECODE') {
								display = display + SELECT.COMPTE_C_LABEL;
							}
							else {
								display = display + SELECT.COMPTE_C_CODES;
							}
						}
						
						
						if (SELECT.SECTION_ANALYTIQUE_C != '-1') {
							display = display + '  #B#Section analyse#/B# : ';
							display = display + SELECT.SECTION_ANALYTIQUE_C_LABEL;
						}
						
						if (SELECT.SECTION_ANALYTIQUE_ORIGINE_REA_C != '-1') {
							display = display + '  #B#Section analyse origine#/B# : ';
							display = display + SELECT.SECTION_ANALYTIQUE_ORIGINE_REA_C_LABEL;
						}

							
						
						return display;
						">
			
			
			<GROUP label="">
				<FIELD name="TYPE_COMPTA_C" label="Type comptabilité" UI="combo" width="300" tree="true" default="-1" globalListProvider="TYPES_COMPTA_C"  showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COMPTE_C" label="Compte" UI="combo" width="300" tree="true" default="-1" globalListProvider="COMPTES_C"  showIfNotDefault="true" >
				</FIELD>
				<FIELD name="COMPTE_C_CODES" label="Codes" UI="text" width="150" default="" showIfNotDefault="true" visible="= SELECT.CH == 'C' &amp;&amp; SELECT.COMPTE_C == 'SAISIECODE' " />
			</GROUP>
			
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_C" label="Section d'analyse" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_C"  showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			
			<GROUP label="">
				<FIELD name="SECTION_ANALYTIQUE_ORIGINE_REA_C" label="Section d'origine" UI="combo" width="300" tree="true" default="-1" globalListProvider="SECTIONS_ANALYTIQUES_C"  showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			
			
		</SELECTIONS>
	
		

		<QUERIES>
		
			
		</QUERIES>
	
				
	</COMPONENT>
	
	
	<COMPONENT name="MULTICRITERES_ANALYTIQUE_PROPERTIES" label="Propriétés diverses multi_criteres" >
	
		<VIEWPROPERTIES>
			<PROPERTY name="GROUPBY_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[GROUPBY]',3,3) == 'CLS') {
                        $field = substr('[GROUPBY]', 0, 6);
                        $section = substr('[GROUPBY]', 6);
                    } else {
                        $field = '[GROUPBY]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
						break;
					case 'AORCLS':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
						break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="QTAB" value="[EVAL 
					$groupby = '';
					$qtab = '0';
					if ('[GROUPBY_TAB]' == 'TAB') {
						$qtab = '1';
					}
					if ('[GROUPBY_TAB]' == 'AUTO' &amp;&amp; '[ARBRE2]' != '-1') {
						$qtab = '1';
					}

					return $qtab;
					EVAL]" />
					
		<PROPERTY name="ARBRE1_FIELDS" value="[EVAL 
					
					if (substr('[ARBRE1]',3,3) == 'CLS') {
                        $field = substr('[ARBRE1]', 0, 6);
                        $section = substr('[ARBRE1]', 6);
                    } else {
                        $field = '[ARBRE1]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
						break;
					case 'AORCLS':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
						break;
					default:
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_oid, v_repartitions_analytiques_shs_1.no_code';
					}
					

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="TAB1_RESUME_FIELDS" value="[EVAL 
					return &quot; -9999999, ' Résumé', 'Résumé'  &quot; ;
		EVAL]" />
					
		<PROPERTY name="TAB1_FIELDS" value="[EVAL 
					$groupby = '';
					$qtab = false;
					if ('[GROUPBY_TAB]' == 'TAB') {
						$qtab = true;
					}
					if ('[GROUPBY_TAB]' == 'AUTO' &amp;&amp; '[ARBRE2]' != '-1') {
						$qtab = true;
					}

					if ($qtab == true) {
                        if (substr('[ARBRE1]',3,3) == 'CLS') {
                            $field = substr('[ARBRE1]', 0, 6);
                            $section = substr('[ARBRE1]', 6);
                        } else {
                            $field = '[ARBRE1]';
                        }
                        switch ($field) {
						case 'MOI':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
							break;
						case 'CL1':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
							break;
						case 'CL2':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
							break;
						case 'CL3':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
							break;
						case 'CPT':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
							break;
						case 'CPTCLS':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
							break;
						case 'TYP':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
							break;
						case 'ANA':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
							break;
						case 'ANACLS':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
							break;
						case 'AOR':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
							break;
						case 'AORCLS':
							$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
							break;
						default:
							$groupby = $groupby . &quot; -9999999, 'Résumé', 'Résumé' &quot; ;
						}
					}
					else {
						$groupby = $groupby . &quot; -9999999, ' Résumé', 'Résumé' &quot; ;
					}

					return $groupby;
					EVAL]" />
				
		<PROPERTY name="ARBRE2_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[ARBRE2]',3,3) == 'CLS') {
                        $field = substr('[ARBRE2]', 0, 6);
                        $section = substr('[ARBRE2]', 6);
                    } else {
                        $field = '[ARBRE2]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
						break;
					case 'AORCLS':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
						break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_oid, v_repartitions_analytiques_shs_1.no_code::text';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="ARBRE3_FIELDS" value="[EVAL 
					$groupby = '';
					if (substr('[ARBRE3]',3,3) == 'CLS') {
                        $field = substr('[ARBRE3]', 0, 6);
                        $section = substr('[ARBRE3]', 6);
                    } else {
                        $field = '[ARBRE3]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
						break;
					case 'AORCLS':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
						break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_oid, v_repartitions_analytiques_shs_1.no_code::text';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="ARBRE4_FIELDS" value="[EVAL 
					$groupby = '';
					if (substr('[ARBRE4]',3,3) == 'CLS') {
                        $field = substr('[ARBRE4]', 0, 6);
                        $section = substr('[ARBRE4]', 6);
                    } else {
                        $field = '[ARBRE4]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
						break;
					case 'AORCLS':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
						break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_oid, v_repartitions_analytiques_shs_1.no_code::text';
					}

					return $groupby;
					EVAL]" />
				
		<PROPERTY name="ARBRE5_FIELDS" value="[EVAL 
					$groupby = '';
					if (substr('[ARBRE5]',3,3) == 'CLS') {
                        $field = substr('[ARBRE5]', 0, 6);
                        $section = substr('[ARBRE5]', 6);
                    } else {
                        $field = '[ARBRE5]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::bigint, v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id, v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id, v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id, v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id, v_repartitions_analytiques_shs_1.compte_numero';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . '], v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id, v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id, v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id, v_repartitions_analytiques_shs_1.section_analytique_origine_code';
						break;
					case 'AORCLS':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . '], v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
						break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_oid, v_repartitions_analytiques_shs_1.no_code::text';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="TEXT_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[GROUPBY]',3,3) == 'CLS') {
                        $field = substr('[GROUPBY]', 0, 6);
                        $section = substr('[GROUPBY]', 6);
                    } else {
                        $field = '[GROUPBY]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="ARBRE1TEXT_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[ARBRE1]',3,3) == 'CLS') {
                        $field = substr('[ARBRE1]', 0, 6);
                        $section = substr('[ARBRE1]', 6);
                    } else {
                        $field = '[ARBRE1]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_texte';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="ARBRE2TEXT_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[ARBRE2]',3,3) == 'CLS') {
                        $field = substr('[ARBRE2]', 0, 6);
                        $section = substr('[ARBRE2]', 6);
                    } else {
                        $field = '[ARBRE2]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_texte';
					}

					return $groupby;
					EVAL]" />
					
			<PROPERTY name="ARBRE3TEXT_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[ARBRE3]',3,3) == 'CLS') {
                        $field = substr('[ARBRE3]', 0, 6);
                        $section = substr('[ARBRE3]', 6);
                    } else {
                        $field = '[ARBRE3]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_texte';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="ARBRE4TEXT_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[ARBRE4]',3,3) == 'CLS') {
                        $field = substr('[ARBRE4]', 0, 6);
                        $section = substr('[ARBRE4]', 6);
                    } else {
                        $field = '[ARBRE4]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_texte';
					}

					return $groupby;
					EVAL]" />
					
		<PROPERTY name="ARBRE5TEXT_FIELDS" value="[EVAL 
					$groupby = '';
                    if (substr('[ARBRE5]',3,3) == 'CLS') {
                        $field = substr('[ARBRE5]', 0, 6);
                        $section = substr('[ARBRE5]', 6);
                    } else {
                        $field = '[ARBRE5]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.no_texte';
					}

					return $groupby;
					EVAL]" />
											
		
				
			<PROPERTY name="GROUP0BY_FIELDS" value="[EVAL 
					$groupby = 'v_repartitions_analytiques_shs_1.no_oid, v_repartitions_analytiques_shs_1.no_code';
					return $groupby;
					EVAL]" />
					
					
			<PROPERTY name="COLUMN_OID_FIELD" value="[EVAL 
					$groupby = '';
                    if (substr('[COLUMNBY]',3,3) == 'CLS') {
                        $field = substr('[COLUMNBY]', 0, 6);
                        $section = substr('[COLUMNBY]', 6);
                    } else {
                        $field = '[COLUMNBY]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_id';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_id';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_id';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_id';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_id[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_id';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_id[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_id';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_id[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_id';
					}

					return $groupby;
					EVAL]" />
					
			<PROPERTY name="COLUMN_CODE_FIELD" value="[EVAL 
					$groupby = '';
                    if (substr('[COLUMNBY]',3,3) == 'CLS') {
                        $field = substr('[COLUMNBY]', 0, 6);
                        $section = substr('[COLUMNBY]', 6);
                    } else {
                        $field = '[COLUMNBY]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_code';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_code';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_code';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_code';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_code[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_code';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_code';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_code[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_code';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_code[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_code';
					}

					return $groupby;
					EVAL]" />
					
					
			<PROPERTY name="COLUMN_TEXT_FIELD" value="[EVAL 
					$groupby = '';
					if (substr('[COLUMNBY]',3,3) == 'CLS') {
                        $field = substr('[COLUMNBY]', 0, 6);
                        $section = substr('[COLUMNBY]', 6);
                    } else {
                        $field = '[COLUMNBY]';
                    }
					switch ($field) {
					case 'MOI':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.mois_comptable::text';
					    break;
					case 'CL1':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_1_texte';
					    break;
					case 'CL2':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_2_texte';
					    break;
					case 'CL3':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.classe_3_texte';
					    break;
					case 'CPT':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_texte';
					    break;
					case 'CPTCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.compte_section_texte[' . $section . ']';
					    break;
					case 'TYP':
						$groupby = $groupby . 'v_repartitions_analytiques_shs_1.type_compta_texte';
					    break;
					case 'ANA':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					    break;
					case 'ANACLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_section_texte[' . $section . ']';
					    break;
					case 'AOR':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_texte';
					    break;
					case 'AORCLS':
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_origine_section_texte[' . $section . ']';
					    break;
					default:
					    $groupby = $groupby . 'v_repartitions_analytiques_shs_1.section_analytique_texte';
					}

					return $groupby;
					EVAL]" />
					
				
			
		</VIEWPROPERTIES>
	</COMPONENT>
	
	
	<COMPONENT name="PROPERTIES_COUT_PATIENT" label="Propriétés diverses cout patient" >
	
		<VIEWPROPERTIES>
		
			<PROPERTY name="CURRENT_DEFAULTVIEW" value="v_couts_patient_shs_1" />
			<PROPERTY name="CURRENT_VIEW2" value="v_couts_patient_shs_1" />
			
			
			
			<PROPERTY name="GROUPBY_OID_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_id("[GROUPBY]", "CSC");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_COD_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_code("[GROUPBY]", "CSC");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_TXT_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_texte("[GROUPBY]", "CSC");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="COLUMNBY_OID_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_id("[COLUMNBY]", "CSC");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="COLUMNBY_COD_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_code("[COLUMNBY]", "CSC");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="COLUMNBY_TXT_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_texte("[COLUMNBY]", "CSC");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_2_OID_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_id("[GROUPBY_2]", "");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_2_COD_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_code("[GROUPBY_2]", "");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			<PROPERTY name="GROUPBY_2_TXT_FIELD" value="" >
					<value><![CDATA[
						[EVAL 
						return COMPTA_cout_patient_shs_field_texte("[GROUPBY_2]", "");
						EVAL]
					]]>
					</value>
			</PROPERTY>
			
			
		</VIEWPROPERTIES>
	</COMPONENT>
	
	
	<COMPONENT name="FILTRES_COUT_PATIENT" label="Filtre cout patient" >
	
		<VIEWPROPERTIES>
		
		<PROPERTY name="COUT_PATIENT_SELECT" value="" >
				
				<value><![CDATA[
					[EVAL 
					$select = "";

					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].service_facturation", 't_services_facturation_cout_patient_shs', '[COUT_PATIENT_SERVICE]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].activite", 't_activites_cout_patient_shs', '[COUT_PATIENT_ACTIVITE]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].etage", 't_etages_cout_patient_shs', '[COUT_PATIENT_ETAGE]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].medecin_administratif", 't_medecins_administratif_cout_patient_shs', '[COUT_PATIENT_MEDECIN]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].element_cout", 't_elements_cout_patient_shs', '[COUT_PATIENT_ELEMENT]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].unite_oeuvre", 't_unites_oeuvre_shs', '[COUT_PATIENT_UNITE]');
					
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].ghm", 't_ghm_cout_patient_shs', '[COUT_PATIENT_GHM]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].ghm5", 't_ghm_cout_patient_shs', '[COUT_PATIENT_GHM5]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].ghm_severite", 't_ghm_cout_patient_shs', '[COUT_PATIENT_GHM_SEVERITE]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].pole_oap", 't_ghm_cout_patient_shs', '[COUT_PATIENT_POLE_OAP]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].ligne_oap", 't_ghm_cout_patient_shs', '[COUT_PATIENT_LIGNE_OAP]');
					$select = $select . COMPTA_standard_field_select("[VIEW.CURRENT_DEFAULTVIEW].ghs", 't_ghs_cout_patient_shs', '[COUT_PATIENT_GHS]');
					
					return $select;
																					
				EVAL]
				]]>
				</value>
				
				</PROPERTY>
							

		</VIEWPROPERTIES>

		<SELECTIONS label="Filtres coût patient" collapsible="true" displayText="= var display:String = '';
						
						if (SELECT.COUT_PATIENT_ELEMENT != '-1') {
							display = display + '  #B#Elément de coût#/B# : ' + SELECT.COUT_PATIENT_ELEMENT_LABEL;
						}
						if (SELECT.COUT_PATIENT_UNITE != '-1') {
							display = display + '  #B#Unité oeuvre#/B# : ' + SELECT.COUT_PATIENT_UNITE_LABEL;
						}
						
						if (SELECT.COUT_PATIENT_GHM != '-1') {
							display = display + '  #B#GHM#/B# : ' + SELECT.COUT_PATIENT_GHM_LABEL;
						}
						if (SELECT.COUT_PATIENT_GHM5 != '-1') {
							display = display + '  #B#GHM#/B# : ' + SELECT.COUT_PATIENT_GHM5_LABEL + '*';
						}
						if (SELECT.COUT_PATIENT_GHM_SEVERITE != '-1') {
							display = display + '  #B#Sévérité GHM#/B# : ' + SELECT.COUT_PATIENT_GHM_SEVERITE_LABEL;
						}
						if (SELECT.COUT_PATIENT_POLE_OAP != '-1') {
							display = display + '  #B#Pole OAP#/B# : ' + SELECT.COUT_PATIENT_POLE_OAP_LABEL;
						}
						if (SELECT.COUT_PATIENT_LIGNE_OAP != '-1') {
							display = display + '  #B#Ligne OAP#/B# : ' + SELECT.COUT_PATIENT_LIGNE_OAP_LABEL;
						}
						if (SELECT.COUT_PATIENT_GHS != '-1') {
							display = display + '  #B#GHS#/B# : ' + SELECT.COUT_PATIENT_GHS_LABEL;
						}
						
						if (SELECT.COUT_PATIENT_SERVICE != '-1') {
							display = display + '  #B#Service#/B# : ' + SELECT.COUT_PATIENT_SERVICE_LABEL;
						}
						if (SELECT.COUT_PATIENT_ACTIVITE != '-1') {
							display = display + '  #B#Activité#/B# : ' + SELECT.COUT_PATIENT_ACTIVITE_LABEL;
						}
						if (SELECT.COUT_PATIENT_ETAGE != '-1') {
							display = display + '  #B#Etage#/B# : ' + SELECT.COUT_PATIENT_ETAGE_LABEL;
						}
						if (SELECT.COUT_PATIENT_MEDECIN != '-1') {
							display = display + '  #B#Médecin#/B# : ' + SELECT.COUT_PATIENT_MEDECIN_LABEL;
						}
						
						
						return display;
						">
						
			<GROUP label="">
				<FIELD name="COUT_PATIENT_ELEMENT" label="Elément de cout" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_ELEMENTS" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COUT_PATIENT_UNITE" label="Unité d'oeuvre" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_UNITES" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			
			<GROUP label="">
				<FIELD name="COUT_PATIENT_GHM" label="GHM" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_GHM" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="Racine GHM, Sévérité">
				<FIELD name="COUT_PATIENT_GHM5" label="" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_GHM5" showIfNotDefault="true" >
				</FIELD>
				<FIELD name="COUT_PATIENT_GHM_SEVERITE" label="" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_GHM_SEVERITES" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="OAP (Pole ou ligne produit)">
				<FIELD name="COUT_PATIENT_POLE_OAP" label="" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_POLES_OAP" showIfNotDefault="true" >
				</FIELD>
				<FIELD name="COUT_PATIENT_LIGNE_OAP" label="" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_LIGNES_OAP" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COUT_PATIENT_GHS" label="GHS" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_GHS" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			
			<GROUP label="">
				<FIELD name="COUT_PATIENT_SERVICE" label="Service" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_SERVICES" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COUT_PATIENT_ACTIVITE" label="Activité" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_ACTIVITES" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COUT_PATIENT_ETAGE" label="Etage" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_ETAGES" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			<GROUP label="">
				<FIELD name="COUT_PATIENT_MEDECIN" label="Médecin" UI="combo" width="300" tree="true" default="-1" globalListProvider="COUT_PATIENT_SHS_MEDECINS" showIfNotDefault="true" >
				</FIELD>
			</GROUP>
			
			
		</SELECTIONS>
	
		

		<QUERIES>
		
			
		</QUERIES>
	
				
	</COMPONENT>
	
	
	
	<COMPONENT name="STANDARD_FUNCTIONS" label="Fonctions standards" >

			<value><![CDATA[

                // <?php
                
				function COMPTA_standard_prefixe($GROUPBY, $DEFAULT="") {
					if (substr($GROUPBY,3,3) == 'CLS') {
						$GROUPBY = substr($GROUPBY,0,6);
					}
					$field = '';
					$field_id = '';
					$field_code = '';
					$field_texte = '';
					switch ($GROUPBY) {
					case '*TAB':
						$field = "*TAB";
						break;
					case 'MOI':
						$field = "v_historique_ecritures_1.mois_comptable";
						break;
					case 'MOA':
						$field = "v_historique_ecritures_1.annee_comptable";
						break;
					case 'MOX':
						$field = "v_historique_ecritures_1.exercice_comptable";
						break;
                    case 'MON':
						$field = "v_historique_ecritures_1.numero_mois_comptable";
						break;
					case 'JRN':
						$field = "v_historique_ecritures_1.journal";
						break;
					case 'JRNCLS':
						$field = "v_historique_ecritures_1.journal_section";
						break;
					case 'JPA':
						$field = "v_historique_ecritures_1.journal_paiement";
						break;
					case 'JPACLS':
						$field = "v_historique_ecritures_1.journal_paiement_section";
						break;
					case 'MPA':
						$field = "v_historique_ecritures_1.mode_paiement";
						break;
					case 'MPACLS':
						$field = "v_historique_ecritures_1.mode_paiement_section";
						break;
					case 'CL1':
						$field = "v_historique_ecritures_1.classe_1";
						break;
					case 'CL2':
						$field = "v_historique_ecritures_1.classe_2";
						break;
					case 'CL3':
						$field = "v_historique_ecritures_1.classe_3";
						break;
					case 'CPT':
						$field = "v_historique_ecritures_1.compte";
						break;
					case 'CPTCLS':
						$field = "v_historique_ecritures_1.compte_section";
						break;
                    case 'CPC':
						$field = "v_historique_ecritures_1.compte_contrepartie";
						break;
					case 'CPCCLS':
						$field = "v_historique_ecritures_1.compte_contrepartie_section";
						break;
					case 'CPX':
						$field = "v_historique_ecritures_1.compte_extra";
						break;
					case 'CPXCLS':
						$field = "v_historique_ecritures_1.compte_extra_section";
						break;
					case 'CPB':
						$field = "v_historique_ecritures_1.compte_budget";
						break;
					case 'CPBCLS':
						$field = "v_historique_ecritures_1.compte_budget_section";
						break;
					case 'SIT':
						$field = "v_historique_ecritures_1.site";
						break;
					case 'SITCLS':
						$field = "v_historique_ecritures_1.site_section";
						break;
                    case 'POL':
						$field = "v_historique_ecritures_1.pole";
						break;
					case 'POLCLS':
						$field = "v_historique_ecritures_1.pole_section";
						break;
					case 'PAR':
						$field = "v_historique_ecritures_1.partenaire";
						break;
					case 'PARCLS':
						$field = "v_historique_ecritures_1.partenaire_section";
						break;
					case 'TYP':
						$field = "v_historique_ecritures_1.type_compta";
						break;
					case 'TYX':
						$field = "v_historique_ecritures_1.type_compta_extra";
						break;
					case 'ANA':
						$field = "v_historique_ecritures_1.section_analytique";
						break;
					case 'ANACLS':
						$field = "v_historique_ecritures_1.section_analytique_section";
						break;
					case 'AN2':
						$field = "section_analytique_2";
						break;
					case 'AN2CLS':
						$field = "section_analytique_section_2";
						break;
					case 'AN3':
						$field = "section_analytique_3";
						break;
					case 'AN3CLS':
						$field = "section_analytique_section_3";
						break;
					case 'AN4':
						$field = "section_analytique_4";
						break;
					case 'AN4CLS':
						$field = "section_analytique_section_4";
						break;
					case 'AN5':
						$field = "section_analytique_5";
						break;
					case 'AN5CLS':
						$field = "section_analytique_section_5";
						break;
					case 'AN6':
						$field = "section_analytique_6";
						break;
					case 'AN6CLS':
						$field = "section_analytique_section_6";
						break;
                    case 'AN7':
						$field = "section_analytique_7";
						break;
					case 'AN7CLS':
						$field = "section_analytique_section_7";
						break;
                    case 'AN8':
						$field = "section_analytique_8";
						break;
					case 'AN8CLS':
						$field = "section_analytique_section_8";
						break;
                    case 'AN9':
						$field = "section_analytique_9";
						break;
					case 'AN9CLS':
						$field = "section_analytique_section_9";
						break;
					case 'DTE':
						$field = "v_historique_ecritures_1.date_ecriture";
						break;
					case 'FAC':
						$field = "v_historique_ecritures_1.dossier";
						break;
					default:
						$field = $DEFAULT;
					}
					return $field;
				}
				
				function COMPTA_standard_field_id($GROUPBY, $DEFAULT="") {
				
					$prefixe = COMPTA_standard_prefixe($GROUPBY, $DEFAULT="");
					
					if (substr($GROUPBY, 3, 3) == 'CLS' && $prefixe != $DEFAULT) {
						$section = substr($GROUPBY, 6);
						$field = "$prefixe" . "_id[" . $section . "]";
					}
                    else {
                        switch ($prefixe) {
                            case "":
                                $field = "0";
                                break;
                            case "*TAB":
                                $field = "-9999999";
                                break;
                            case "v_historique_ecritures_1.mois_comptable":
                                $field = "v_historique_ecritures_1.mois_comptable";
                                break;
                            case "v_historique_ecritures_1.annee_comptable":
                                $field = "to_number(substr(to_char(v_historique_ecritures_1.mois_comptable,'FM999999'),1,4),'FM9999')";
                                break;
                            case "v_historique_ecritures_1.exercice_comptable":
                                $field = "v_historique_ecritures_1.exercice_comptable";
                                break;
                            case "v_historique_ecritures_1.date_ecriture":
                                $field = "base.cti_to_ascii(v_historique_ecritures_1.date_ecriture)";
                                break;
                            case "v_historique_ecritures_1.dossier":
                                $field = "base.cti_to_ascii(v_historique_ecritures_1.dossier)";
                                break;
                            default:
                                $field = "$prefixe" . "_id";
                        }
                    }
					return $field;
				}
				function COMPTA_standard_field_code($GROUPBY, $DEFAULT="") {
					$prefixe = COMPTA_standard_prefixe($GROUPBY, $DEFAULT="");
					
					if (substr($GROUPBY, 3, 3) == 'CLS' && $prefixe != $DEFAULT) {
						$section = substr($GROUPBY, 6);
						$field = "$prefixe" . "_code[" . $section . "]";
					}
                    else {
                        switch ($prefixe) {
                            case "":
                                $field = "''";
                                break;
                            case "*TAB":
                                $field = "' Résumé'";
                                break;
                            case "v_historique_ecritures_1.mois_comptable":
                                $field = "v_historique_ecritures_1.mois_comptable";
                                break;
                            case "v_historique_ecritures_1.annee_comptable":
                                $field = "substr(to_char(v_historique_ecritures_1.mois_comptable,'FM999999'),1,4)";
                                break;
                            case "v_historique_ecritures_1.exercice_comptable":
                                $field = "v_historique_ecritures_1.exercice_comptable";
                                break;
                            case "v_historique_ecritures_1.date_ecriture":
                                $field = "v_historique_ecritures_1.mois_comptable";
                                break;
                            case "v_historique_ecritures_1.dossier":
                                $field = "v_historique_ecritures_1.dossier";
                                break;
                            case "v_historique_ecritures_1.compte":
                                $field = "v_historique_ecritures_1.compte_numero";
                                break;
                            case "v_historique_ecritures_1.compte_extra":
                                $field = "v_historique_ecritures_1.compte_extra_numero";
                                break;
                            case "v_historique_ecritures_1.compte_budget":
                                $field = "v_historique_ecritures_1.compte_budget_numero";
                                break;
                            default:
                                $field = "$prefixe" . "_code";
                        }
                    }
					return $field;
				}
				function COMPTA_standard_field_texte($GROUPBY, $DEFAULT="") {
					$prefixe = COMPTA_standard_prefixe($GROUPBY, $DEFAULT="");
					
					if (substr($GROUPBY, 3, 3) == 'CLS' && $prefixe != $DEFAULT) {
						$section = substr($GROUPBY, 6);
						$field = "$prefixe" . "_texte[" . $section . "]";
					}
                    else {
                        switch ($prefixe) {
                            case "":
                                $field = "''";
                                break;
                            case "*TAB":
                                $field = "'Résumé'";
                                break;
                            case "v_historique_ecritures_1.mois_comptable":
                                $field = "v_historique_ecritures_1.mois_comptable";
                                break;
                            case "v_historique_ecritures_1.annee_comptable":
                                $field = "substr(to_char(v_historique_ecritures_1.mois_comptable,'FM999999'),1,4)";
                                break;
                            case "v_historique_ecritures_1.exercice_comptable":
                                $field = "v_historique_ecritures_1.exercice_comptable";
                                break;
                            case "v_historique_ecritures_1.date_ecriture":
                                $field = "v_historique_ecritures_1.mois_comptable";
                                break;
                            case "v_historique_ecritures_1.dossier":
                                $field = "v_historique_ecritures_1.dossier";
                                break;
                            default:
                                $field = "$prefixe" . "_texte";
                        }
                    }
					return $field;
				}
				
				
				function COMPTA_cout_patient_prefixe($GROUPBY, $DEFAULT="") {
					if (substr($GROUPBY,3,3) == 'CLS') {
						$GROUPBY = substr($GROUPBY,0,6);
					}
					$field = '';
					$field_id = '';
					$field_code = '';
					$field_texte = '';
					switch ($GROUPBY) {
					case '*TAB':
						$field = "*TAB";
						break;
					case 'MOI':
						$field = "mois_comptable";
						break;
					case 'EXE':
						$field = "exercice_comptable";
						break;
					case 'CSF':
						$field = "service_facturation";
						break;
					case 'CSFCLS':
						$field = "service_facturation_section";
						break;
					case 'CSG':
						$field = "ghm";
						break;
					case 'CSGCLS':
						$field = "ghm_section";
						break;
					case 'CSG5':
						$field = "ghm5";
						break;
					case 'CSGSEV':
						$field = "ghm_severite";
						break;
					case 'CSGPOA':
						$field = "pole_oap";
						break;
					case 'CSGLOA':
						$field = "ligne_oap";
						break;
					case 'CSH':
						$field = "ghs";
						break;
					case 'CSHCLS':
						$field = "ghs_section";
						break;
					case 'CSA':
						$field = "activite";
						break;
					case 'CSACLS':
						$field = "activite_section";
						break;
					case 'CSE':
						$field = "etage";
						break;
					case 'CSECLS':
						$field = "etage_section";
						break;
					case 'CSM':
						$field = "medecin_administratif";
						break;
					case 'CSMCLS':
						$field = "medecin_administratif_section";
						break;
					case 'CSC':
						$field = "element_cout";
						break;
					case 'CSCCLS':
						$field = "element_cout_section";
						break;
					case 'CSU':
						$field = "unite_oeuvre";
						break;
					case 'CSUCLS':
						$field = "unite_oeuvre_section";
						break;
						
					default:
						$field = $DEFAULT;
					}
					return $field;
				}
				
				function COMPTA_cout_patient_shs_field_id($GROUPBY, $DEFAULT="") {
				
					$prefixe = COMPTA_cout_patient_prefixe($GROUPBY, $DEFAULT="");
					
					if (substr($GROUPBY, 3, 3) == 'CLS' && $prefixe != $DEFAULT) {
						$section = substr($GROUPBY, 6);
						$field = "$prefixe" . "_id[" . $section . "]";
					}
                    else {
                        switch ($prefixe) {
                            case "":
                                $field = "0";
                                break;
                            case "*TAB":
                                $field = "-9999999";
                                break;
                            default:
                                $field = "v_couts_patient_shs_1.$prefixe" . "_id";
                        }
                    }
					return $field;
				}
				function COMPTA_cout_patient_shs_field_code($GROUPBY, $DEFAULT="") {
					$prefixe = COMPTA_cout_patient_prefixe($GROUPBY, $DEFAULT="");
					
					if (substr($GROUPBY, 3, 3) == 'CLS' && $prefixe != $DEFAULT) {
						$section = substr($GROUPBY, 6);
						$field = "$prefixe" . "_code[" . $section . "]";
					}
                    else {
                        switch ($prefixe) {
                            case "":
                                $field = "''";
                                break;
                            case "*TAB":
                                $field = "' Résumé'";
                                break;
                            default:
                                $field = "v_couts_patient_shs_1.$prefixe" . "_code";
                        }
					}
					return $field;
				}
				function COMPTA_cout_patient_shs_field_texte($GROUPBY, $DEFAULT="") {
					$prefixe = COMPTA_cout_patient_prefixe($GROUPBY, $DEFAULT="");
					
					if (substr($GROUPBY, 3, 3) == 'CLS' && $prefixe != $DEFAULT) {
						$section = substr($GROUPBY, 6);
						$field = "$prefixe" . "_texte[" . $section . "]";
					}
                    else {
                        switch ($prefixe) {
                            case "":
                                $field = "''";
                                break;
                            case "*TAB":
                                $field = "'Résumé'";
                                break;
                            default:
                                $field = "v_couts_patient_shs_1.$prefixe" . "_texte";
                        }
                    }
					return $field;
				}
				
				function COMPTA_standard_field_select($field_prefixe, $table_name, $selected_value, $field2_prefixe="") {
					$select = "";

					if ($selected_value != '-1') {
						$mode = substr($selected_value,0,2);
						$oid = $selected_value;
						if ($mode == 'LS') {
							$section = substr($selected_value,2,2);
							$oid = substr($selected_value,4);
						}
						if ($mode != 'LI' && $mode != 'SL' && $mode != 'LS' && $mode != 'C*' ) {
							if ($mode != 'D2') {
								$mode = 'DT';
							}
							$oid = substr($selected_value,2);
						}
						if ($mode == 'LI' || $mode == 'SL') {$oid = substr($selected_value,2);}
						if ($mode == 'C*') {
							if ($table_name != "t_ages") {
								$where_codes = sql_codes_list_a(substr($selected_value,2), 'code');
							}
							else {
								$where_codes = sql_codes_list_n(substr($selected_value,2), "to_number(code,'000')");
							}
						}
						
						$subselect_select = '';
						
						$field_id = $field_prefixe . "_id";
						$field2_id = $field2_prefixe . "_id";
						$field_section_id = $field_prefixe . "_section_id[" . $section . "]";
						
						if ($mode == 'LI') {$subselect_select = " $field_id IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'SL') {$subselect_select = " $field_id NOT IN (SELECT to_id FROM compta.t_listes_contenu WHERE liste_id = $oid)";}
						if ($mode == 'LS') {$subselect_select = " $field_section_id = $oid";}
						if ($mode == 'DT') {$subselect_select = " $field_id = $oid";}
						if ($mode == 'D2') {$subselect_select = " $field2_id = $oid";}
						if ($mode == 'C*') {$subselect_select = " $field_id IN (SELECT oid FROM compta.$table_name WHERE $where_codes)";}
						
						if ($subselect_select != '') {$select = " AND $subselect_select ";}
					}
					
					return $select;
				}
                
                // ?>
			]]>
			</value>

	</COMPONENT>
	
	
</COMPONENTS>

			
