rem: gsb_account_set_adjustment_value ( no_compte, -1 );
context: gboolean recuperation_comptes_xml ( xmlNodePtr node_comptes ){    while ( node_comptes )    {	/* on va recuperer ici les generalites des comptes */	if ( !strcmp ( node_comptes -> name,		       "Generalites" ))	{	    xmlNodePtr node_generalites;	    node_generalites = node_comptes -> children;	    while ( node_generalites )	    {		/* recupère l'ordre des comptes */		if ( !strcmp ( node_generalites -> name,			       "Ordre_des_comptes" ))		{		    gchar **pointeur_char;		    gint i;		    pointeur_char = g_strsplit ( xmlNodeGetContent ( node_generalites ),						 "-",						 0 );		    i = 0;		    ordre_comptes = NULL;		    while ( pointeur_char[i] )		    {			ordre_comptes = g_slist_append ( ordre_comptes,							 GINT_TO_POINTER ( my_atoi ( pointeur_char[i] )));			i++;		    }		    g_strfreev ( pointeur_char );		}		/* recupère le compte courant */		if ( !strcmp ( node_generalites -> name,			       "Compte_courant" ))		{		    compte_courant = my_atoi ( xmlNodeGetContent ( node_generalites ));		}		node_generalites = node_generalites -> next;	    }	}	/* on recupère les details de chaque compte */	if ( !strcmp ( node_comptes -> name,		       "Compte" ))	{	    xmlNodePtr node_nom_comptes;	    gint no_compte;	    /* 	    we create the account with the bank default, it will be changed later */	    no_compte = gsb_account_new ( GSB_TYPE_BANK );	    /* on fait le tour dans l'arbre nom, cad : les details, details de type et details des operations */	    node_nom_comptes = node_comptes -> children;	    while ( node_nom_comptes )	    {		/* on recupère les details du compte */		if ( !strcmp ( node_nom_comptes -> name,			       "Details" ))		{		    xmlNodePtr node_detail;		    node_detail = node_nom_comptes -> children;		    while ( node_detail )		    {			if ( node_detail -> type != XML_TEXT_NODE )			{			    if ( !strcmp ( node_detail -> name,					   "Nom" ))				gsb_account_set_name ( no_compte,						       xmlNodeGetContent ( node_detail ) );			    if ( !strcmp ( node_detail -> name,					   "Id_compte" ))			    {				gsb_account_set_id (no_compte,						    xmlNodeGetContent ( node_detail ));				if ( !strlen ( gsb_account_get_id (no_compte)))				    gsb_account_set_id (no_compte,							NULL );			    }			    /* 			    we change here the default number of the account */			    if ( !strcmp ( node_detail -> name,					   "No_de_compte" ))				no_compte = gsb_account_set_account_number ( no_compte,									     my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Titulaire" ))				gsb_account_set_holder_name ( no_compte,							       xmlNodeGetContent ( node_detail ));			    if ( !strcmp ( node_detail -> name,					   "Type_de_compte" ))				gsb_account_set_kind (no_compte,						      my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Devise" ))				gsb_account_set_currency ( no_compte,							   my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Banque" ))				gsb_account_set_bank ( no_compte,						       my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Guichet" ))				gsb_account_set_bank_branch_code ( no_compte,								   xmlNodeGetContent ( node_detail ) );			    if ( !strcmp ( node_detail -> name,					   "No_compte_banque" ))				gsb_account_set_bank_account_number ( no_compte,								      xmlNodeGetContent ( node_detail ));			    if ( !strcmp ( node_detail -> name,					   "Cle_du_compte" ))				gsb_account_set_bank_account_key ( no_compte,								   xmlNodeGetContent ( node_detail ) );			    if ( !strcmp ( node_detail -> name,					   "Solde_initial" ))				gsb_account_set_init_balance (no_compte,							      my_strtod ( xmlNodeGetContent ( node_detail ),							 NULL ));			    if ( !strcmp ( node_detail -> name,					   "Solde_mini_voulu" ))				gsb_account_set_mini_balance_wanted ( no_compte, 								      my_strtod ( xmlNodeGetContent ( node_detail ),										  NULL ));			    if ( !strcmp ( node_detail -> name,					   "Solde_mini_autorise" ))				gsb_account_set_mini_balance_authorized ( no_compte, 									  my_strtod ( xmlNodeGetContent ( node_detail ),										      NULL ));			    if ( !strcmp ( node_detail -> name,					   "Date_dernier_releve" ))			    {				gchar **pointeur_char;				if ( xmlNodeGetContent ( node_detail ) &&				     strlen (xmlNodeGetContent (node_detail)) > 0 )				{				    pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail ), "/", 3 );				    gsb_account_set_current_reconcile_date ( no_compte,									     g_date_new_dmy ( my_atoi ( pointeur_char [0] ),											      my_atoi ( pointeur_char [1] ),											      my_atoi ( pointeur_char [2] )));				    g_strfreev ( pointeur_char );				}			    }			    if ( !strcmp ( node_detail -> name,					   "Solde_dernier_releve" ))				gsb_account_set_reconcile_balance ( no_compte,								    my_strtod ( xmlNodeGetContent ( node_detail ),										NULL ) );			    if ( !strcmp ( node_detail -> name,					   "Dernier_no_de_rapprochement" ))				gsb_account_set_reconcile_last_number ( no_compte,									my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Compte_cloture" ))				gsb_account_set_closed_account ( no_compte,								 my_atoi ( xmlNodeGetContent ( node_detail )) );			    if ( !strcmp ( node_detail -> name,					   "Affichage_r" ))				gsb_account_set_r ( no_compte,						    my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Nb_lignes_ope" ))				gsb_account_set_nb_rows ( no_compte, 							  my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Commentaires" ))				gsb_account_set_comment ( no_compte,							  xmlNodeGetContent ( node_detail ) );			    if ( !strcmp ( node_detail -> name,					   "Adresse_du_titulaire" ))				gsb_account_set_holder_address ( no_compte,								 xmlNodeGetContent ( node_detail ) );			    if ( !strcmp ( node_detail -> name,					   "Type_defaut_debit" ))				gsb_account_set_default_debit ( no_compte,								my_atoi ( xmlNodeGetContent ( node_detail )) );			    if ( !strcmp ( node_detail -> name,					   "Type_defaut_credit" ))				gsb_account_set_default_credit ( no_compte,								 my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Tri_par_type" ))				gsb_account_set_reconcile_sort_type ( no_compte,								      my_atoi ( xmlNodeGetContent ( node_detail )));			    if ( !strcmp ( node_detail -> name,					   "Neutres_inclus" ))				gsb_account_set_split_neutral_payment ( no_compte,									my_atoi ( xmlNodeGetContent ( node_detail )) );			    if ( !strcmp ( node_detail -> name,					   "Ordre_du_tri" ))			    {				gsb_account_set_sort_list ( no_compte,							    NULL );				if ( xmlNodeGetContent ( node_detail ))				{				    gchar **pointeur_char;				    gint i;				    pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail ),								 "/",								 0 );				    i = 0;				    while ( pointeur_char[i] )				    {					gsb_account_set_sort_list ( no_compte,								    g_slist_append ( gsb_account_get_sort_list (no_compte),										     GINT_TO_POINTER ( my_atoi ( pointeur_char[i] ))) );					i++;				    }				    g_strfreev ( pointeur_char );				}			    }			    if ( !strcmp ( node_detail -> name,					   "Classement_croissant" ))				gsb_account_set_sort_type ( no_compte,							    my_atoi ( xmlNodeGetContent ( node_detail )));			    /* récupération de l'agencement du formulaire */			    if ( !strcmp ( node_detail -> name,					   "Nb_colonnes_formulaire" ))			    {				if ( !gsb_account_get_form_organization (no_compte) )				    gsb_account_set_form_organization ( no_compte,									calloc ( 1,								       sizeof ( struct organisation_formulaire )) );				gsb_account_get_form_organization (no_compte) -> nb_colonnes = my_atoi ( xmlNodeGetContent ( node_detail ));			    }			    if ( !strcmp ( node_detail -> name,					   "Nb_lignes_formulaire" ))			    {				if ( !gsb_account_get_form_organization (no_compte) )				    gsb_account_set_form_organization ( no_compte,									calloc ( 1,										 sizeof ( struct organisation_formulaire )) );				gsb_account_get_form_organization (no_compte) -> nb_lignes = my_atoi ( xmlNodeGetContent ( node_detail ));			    }			    if ( !strcmp ( node_detail -> name,					   "Organisation_formulaire" ))			    {				gchar **pointeur_char;				gint i, j;				if ( !gsb_account_get_form_organization (no_compte) )				    gsb_account_set_form_organization ( no_compte,									calloc ( 1,										 sizeof ( struct organisation_formulaire )) );				pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail ),							     "-",							     0 );				for ( i=0 ; i<4 ; i++ )				    for ( j=0 ; j< 6 ; j++ )					gsb_account_get_form_organization (no_compte) -> tab_remplissage_formulaire[i][j] = my_atoi ( pointeur_char[j + i*6]);				g_strfreev ( pointeur_char );			    }			    if ( !strcmp ( node_detail -> name,					   "Largeur_col_formulaire" ))			    {				gchar **pointeur_char;				gint i;				if ( !gsb_account_get_form_organization (no_compte) )				    gsb_account_set_form_organization ( no_compte,									calloc ( 1,										 sizeof ( struct organisation_formulaire )) );				pointeur_char = g_strsplit ( xmlNodeGetContent ( node_detail ),							     "-",							     0 );				for ( i=0 ; i<6 ; i++ )					gsb_account_get_form_organization (no_compte) -> taille_colonne_pourcent[i] = my_atoi ( pointeur_char[i]);				g_strfreev ( pointeur_char );			    }			}			node_detail = node_detail -> next;		    }		}		/* dans certains cas d'import qif, le nom du compte peut être nul */		/* dans ce cas le met à "" */		if ( !gsb_account_get_name (no_compte) )		    gsb_account_set_name ( no_compte,					    g_strdup ( "" ));		/* on recupère ici le detail des types */		if ( !strcmp ( node_nom_comptes -> name,			       "Detail_de_Types" ))		{		    xmlNodePtr node_type;		    node_type = node_nom_comptes -> children;		    gsb_account_set_method_payment_list ( no_compte,							  NULL );		    while ( node_type )		    {			struct struct_type_ope *type;			type = calloc ( 1,					sizeof ( struct struct_type_ope ));			if ( node_type -> type != XML_TEXT_NODE )			{			    type -> no_type = my_atoi ( xmlGetProp ( node_type,								     "No" ));			    type -> nom_type = xmlGetProp ( node_type,							    "Nom" );			    type -> signe_type = my_atoi ( xmlGetProp ( node_type,									"Signe" ));			    type -> affiche_entree = my_atoi ( xmlGetProp ( node_type,									    "Affiche_entree" ));			    type -> numerotation_auto = my_atoi ( xmlGetProp ( node_type,									       "Numerotation_auto" ));			    type -> no_en_cours = my_atoi ( xmlGetProp ( node_type,									 "No_en_cours" ));			    type -> no_compte = no_compte;			    gsb_account_set_method_payment_list ( no_compte,								  g_slist_append ( gsb_account_get_method_payment_list (no_compte),										   type ));			}			node_type = node_type -> next;		    }		}		/* on recupère ici le detail des opes */		if ( !strcmp ( node_nom_comptes -> name,			       "Detail_des_operations" ))		{		    xmlNodePtr node_ope;		    node_ope = node_nom_comptes -> children;		    gsb_account_set_transactions_list ( no_compte,							NULL );		    while ( node_ope )		    {			struct structure_operation *operation;			gchar **pointeur_char;			gchar *pointeur;			operation = calloc ( 1,					     sizeof (struct structure_operation ));			if ( node_ope -> type != XML_TEXT_NODE )			{			    operation -> no_operation = my_atoi ( xmlGetProp ( node_ope, "No" ));			    operation -> id_operation = xmlGetProp ( node_ope,								     "Id" );			    if ( operation -> id_operation &&				 !strlen ( operation -> id_operation ))				operation -> id_operation = NULL;			    pointeur_char = g_strsplit ( xmlGetProp ( node_ope , "D" ), "/", 3 );			    operation -> jour = my_atoi ( pointeur_char[0] );			    operation -> mois = my_atoi ( pointeur_char[1] );			    operation -> annee = my_atoi ( pointeur_char[2] );			    operation -> date = g_date_new_dmy ( operation -> jour,								 operation -> mois,								 operation -> annee );			    g_strfreev ( pointeur_char );			    /* GDC prise en compte de la lecture de la date bancaire */			    pointeur = xmlGetProp ( node_ope,						    "Db" );			    if ( pointeur )			    {				pointeur_char = g_strsplit ( pointeur,							     "/",							     3 );				operation -> jour_bancaire = my_atoi ( pointeur_char[0] );				operation -> mois_bancaire = my_atoi ( pointeur_char[1] );				operation -> annee_bancaire = my_atoi ( pointeur_char[2] );				if ( operation -> jour_bancaire )				    operation -> date_bancaire = g_date_new_dmy ( operation -> jour_bancaire,										  operation -> mois_bancaire,										  operation -> annee_bancaire );				else				    operation -> date_bancaire = NULL;				g_strfreev ( pointeur_char );			    }			    else			    {				operation -> jour_bancaire = 0;				operation -> mois_bancaire = 0;				operation -> annee_bancaire = 0;				operation -> date_bancaire = NULL;			    }			    /* GDCFin */			    operation -> montant = my_strtod ( xmlGetProp ( node_ope,									    "M" ),							       NULL );			    operation -> devise = my_atoi ( xmlGetProp ( node_ope,									 "De" ));			    operation -> une_devise_compte_egale_x_devise_ope = my_atoi ( xmlGetProp ( node_ope,												       "Rdc" ));			    operation -> taux_change = my_strtod ( xmlGetProp ( node_ope,										"Tc" ),								   NULL );			    operation -> frais_change = my_strtod ( xmlGetProp ( node_ope,										 "Fc" ),								    NULL );			    operation -> tiers = my_atoi ( xmlGetProp ( node_ope,									"T" ));			    operation -> categorie = my_atoi ( xmlGetProp ( node_ope,									    "C" ));			    operation -> sous_categorie = my_atoi ( xmlGetProp ( node_ope,										 "Sc" ));			    operation -> operation_ventilee = my_atoi ( xmlGetProp ( node_ope,										     "Ov" ));			    operation -> notes = xmlGetProp ( node_ope,							      "N" );			    if ( !strlen ( operation -> notes ))				operation -> notes = NULL;			    operation -> type_ope = my_atoi ( xmlGetProp ( node_ope,									   "Ty" ));			    operation -> contenu_type = xmlGetProp ( node_ope,								     "Ct" );			    if ( !strlen ( operation -> contenu_type ))				operation -> contenu_type = NULL;			    operation -> pointe = my_atoi ( xmlGetProp ( node_ope,									 "P" ));			    operation -> auto_man = my_atoi ( xmlGetProp ( node_ope,									   "A" ));			    operation -> no_rapprochement = my_atoi ( xmlGetProp ( node_ope,										   "R" ));			    operation -> no_exercice = my_atoi ( xmlGetProp ( node_ope,									      "E" ));			    operation -> imputation = my_atoi ( xmlGetProp ( node_ope,									     "I" ));			    operation -> sous_imputation = my_atoi ( xmlGetProp ( node_ope,										  "Si" ));			    operation -> no_piece_comptable = xmlGetProp ( node_ope,									   "Pc" );			    if ( !strlen ( operation -> no_piece_comptable ))				operation -> no_piece_comptable = NULL;			    operation -> info_banque_guichet = xmlGetProp ( node_ope,									    "Ibg" );			    if ( !strlen ( operation -> info_banque_guichet ))				operation -> info_banque_guichet = NULL;			    operation -> relation_no_operation = my_atoi ( xmlGetProp ( node_ope,											"Ro" ));			    operation -> relation_no_compte = my_atoi ( xmlGetProp ( node_ope,										     "Rc" ));			    operation -> no_operation_ventilee_associee = my_atoi ( xmlGetProp ( node_ope,												 "Va" ));			    /* on met le compte associe */			    operation -> no_compte = no_compte;			    gsb_account_set_transactions_list ( no_compte,								g_slist_append ( gsb_account_get_transactions_list (operation -> no_compte),										 operation) );			}			node_ope = node_ope -> next;		    }		}		node_nom_comptes = node_nom_comptes -> next;	    }	    /* 		    le compte est fini, on peut mettre à jour qques variables */	    if ( gsb_account_get_current_balance (no_compte) < gsb_account_get_mini_balance_wanted (no_compte) )		gsb_account_set_mini_balance_wanted_message ( no_compte,							      0 );	    else		gsb_account_set_mini_balance_wanted_message ( no_compte,							      1 );	    if ( gsb_account_get_current_balance (no_compte) < gsb_account_get_mini_balance_authorized (no_compte) )		gsb_account_set_mini_balance_authorized_message ( no_compte,								  0 );	    else		gsb_account_set_mini_balance_authorized_message ( no_compte,								  1 );	    /*       la selection au depart est en bas de la liste */	    gsb_account_set_adjustment_value ( no_compte,					       -1 );	    gsb_account_set_current_transaction ( no_compte,						  GINT_TO_POINTER (-1) );	}	node_comptes = node_comptes -> next;    }    return TRUE;}