[grisbi-cvs] [SCM] grisbi branch, master, updated. 658dfd6d9169743a939bcaa5f8fa8c95efd18577

Pierre Biava nobody at users.sourceforge.net
Tue Jun 22 22:47:40 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  658dfd6d9169743a939bcaa5f8fa8c95efd18577 (commit)
       via  d1f281d4a8f05e6a59e69577a21e2e4ee8768419 (commit)
       via  d589e873518d596cb723353d0a11ba9ec15f2003 (commit)
       via  df2dc47be15dbbdd2b87cbb132cd5525f4d508c0 (commit)
       via  70df9667513306bb6445e42002c944a45a39714c (commit)
       via  bfffeea0d2e63b8e83252d8dae981569f0faaffd (commit)
       via  494ceff10d7b89c5bc33a5d1fdc48f653f9c4430 (commit)
      from  de0d4cf961e4e4fd4475b8da51559fb500382a69 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 658dfd6d9169743a939bcaa5f8fa8c95efd18577
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Jun 22 22:40:08 2010 +0200

    Adding deleting payee in the gtk_combofix list

commit d1f281d4a8f05e6a59e69577a21e2e4ee8768419
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jun 21 23:12:13 2010 +0200

    Revert "Revert "Correction of a detection problem  of zlib with mandriva. Back on the translation of Global balances in French""
    
    This reverts commit f3d4a4eb6e4a02f111bec94fec796f33b77b0716.

commit d589e873518d596cb723353d0a11ba9ec15f2003
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jun 21 23:08:35 2010 +0200

    Revert "Correction of a detection problem  of zlib with mandriva. Back on the translation of Global balances in French"
    
    This reverts commit 58ba72dc0d67f4d94c0abc2f0f09113b1f336a35.

commit df2dc47be15dbbdd2b87cbb132cd5525f4d508c0
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jun 21 22:19:39 2010 +0200

    Deleting a compilation warning

commit 70df9667513306bb6445e42002c944a45a39714c
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jun 21 21:57:06 2010 +0200

    Correction of a detection problem  of zlib with mandriva. Back on the translation of Global balances in French

commit bfffeea0d2e63b8e83252d8dae981569f0faaffd
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Jun 20 23:04:30 2010 +0200

    Fixed a bug with importing a check number beginning with 0

commit 494ceff10d7b89c5bc33a5d1fdc48f653f9c4430
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Jun 20 19:49:12 2010 +0200

    Adding function gtk_combofix_append_text () for the payees

-----------------------------------------------------------------------

Changes:
diff --git a/src/csv_parse.c b/src/csv_parse.c
index 160ffb7..81b7f30 100644
--- a/src/csv_parse.c
+++ b/src/csv_parse.c
@@ -344,7 +344,9 @@ gboolean csv_import_parse_notes ( struct struct_ope_importation * ope, gchar * s
 gboolean csv_import_parse_voucher ( struct struct_ope_importation * ope, gchar * string )
 {
     g_return_val_if_fail ( string, FALSE );
-    ope -> cheque = my_strtod ( string, NULL );
+    if ( ope -> cheque )
+        g_free ( ope -> cheque );
+    ope -> cheque = my_strdup ( string );
     return TRUE;
 }
 
diff --git a/src/dialog.c b/src/dialog.c
index e4a8d92..72ae82e 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -165,7 +165,7 @@ G_MODULE_EXPORT void dialogue_error ( gchar *text )
  * \param text Text to display in window
  * \param hint Text to display in window as hint (bold, larger)
  */
-G_MODULE_EXPORT void dialogue_error_hint ( gchar *text, gchar *hint )
+G_MODULE_EXPORT void dialogue_error_hint ( const gchar *text, gchar *hint )
 {
     dialogue_special ( GTK_MESSAGE_ERROR, make_hint (hint, text) );
 }
diff --git a/src/dialog.h b/src/dialog.h
index 5757073..2df6d72 100644
--- a/src/dialog.h
+++ b/src/dialog.h
@@ -20,7 +20,7 @@ void dialogue ( gchar *texte_dialogue );
 void dialogue_conditional_hint ( gchar *hint, gchar *text, gchar *var );
 G_MODULE_EXPORT void dialogue_error ( gchar *text );
 void dialogue_error_brain_damage ();
-G_MODULE_EXPORT void dialogue_error_hint ( gchar *text, gchar *hint );
+G_MODULE_EXPORT void dialogue_error_hint ( const gchar *text, gchar *hint );
 void dialogue_error_memory ();
 void dialogue_hint ( gchar *text, gchar *hint );
 const gchar *dialogue_hint_with_entry ( gchar *text, gchar *hint, gchar *entry_description );
diff --git a/src/gsb_data_payee.c b/src/gsb_data_payee.c
index d3753c0..f379724 100644
--- a/src/gsb_data_payee.c
+++ b/src/gsb_data_payee.c
@@ -31,16 +31,18 @@
 
 /*START_INCLUDE*/
 #include "gsb_data_payee.h"
+#include "gsb_data_form.h"
 #include "gsb_data_report.h"
 #include "gsb_data_scheduled.h"
 #include "gsb_data_transaction.h"
+#include "gsb_form_widget.h"
+#include "gtk_combofix.h"
 #include "tiers_onglet.h"
 #include "gsb_real.h"
 #include "utils_str.h"
 #include "meta_payee.h"
 #include "include.h"
 #include "structures.h"
-#include "gsb_real.h"
 #include "erreur.h"
 /*END_INCLUDE*/
 
@@ -357,7 +359,9 @@ gint gsb_data_payee_get_number_by_name ( const gchar *name,
 	if (create)
 	{
 	    payee_number = gsb_data_payee_new (name);
-	    gsb_payee_update_combofix ();
+	    gtk_combofix_append_text ( GTK_COMBOFIX (
+                        gsb_form_widget_get_widget ( TRANSACTION_FORM_BUDGET ) ), name );
+;
 	}
     }
     return payee_number;
@@ -419,20 +423,28 @@ gboolean gsb_data_payee_set_name ( gint no_payee,
 				   const gchar *name )
 {
     struct_payee *payee;
+    GtkWidget *combofix;
 
     payee = gsb_data_payee_get_structure ( no_payee );
 
     if (!payee)
 	return FALSE;
 
+    combofix = gsb_form_widget_get_widget ( TRANSACTION_FORM_BUDGET );
+
     /* we free the last name */
     if ( payee -> payee_name )
-	g_free (payee -> payee_name);
+    {
+        if ( combofix )
+            gtk_combofix_remove_text ( GTK_COMBOFIX ( combofix ), payee -> payee_name );
+	    g_free ( payee -> payee_name );
+    }
     
     /* and copy the new one or set NULL */
     payee -> payee_name = my_strdup (name);
 
-    gsb_payee_update_combofix ();
+    if ( combofix )
+        gtk_combofix_append_text ( GTK_COMBOFIX ( combofix ), name );
 
     return TRUE;
 }
diff --git a/src/gsb_data_transaction.c b/src/gsb_data_transaction.c
index 079f8f6..f7a31fa 100644
--- a/src/gsb_data_transaction.c
+++ b/src/gsb_data_transaction.c
@@ -2572,7 +2572,7 @@ gint gsb_data_transaction_get_white_line ( gint transaction_number )
  * \return the number of the transaction if one is found, FALSE if none found, so can use it
  * */
 gint gsb_data_transaction_check_content_payment ( gint payment_number,
-                        gint number )
+                        gchar *number )
 {
     GSList *tmp_list;
 
@@ -2593,8 +2593,9 @@ gint gsb_data_transaction_check_content_payment ( gint payment_number,
 
 	if ( transaction -> method_of_payment_number == payment_number
 	     &&
-	     utils_str_atoi (transaction -> method_of_payment_content) == number )
+	     g_ascii_strcasecmp (transaction -> method_of_payment_content, number ) == 0 )
 	    return transaction -> transaction_number;
+
 	tmp_list = tmp_list -> next;
     }
     return FALSE;
diff --git a/src/gsb_data_transaction.h b/src/gsb_data_transaction.h
index c47d6b6..4413f4d 100644
--- a/src/gsb_data_transaction.h
+++ b/src/gsb_data_transaction.h
@@ -19,7 +19,7 @@ enum operation_etat_rapprochement {
 /* START_DECLARATION */
 gboolean gsb_data_transaction_add_archived_to_list ( gint transaction_number );
 gint gsb_data_transaction_check_content_payment ( gint payment_number,
-                        gint number );
+                        gchar *number );
 gboolean gsb_data_transaction_copy_transaction ( gint source_transaction_number,
                         gint target_transaction_number,
                         gboolean reset_mark );
diff --git a/src/gsb_form.c b/src/gsb_form.c
index ad4b3d3..26ff881 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -2848,8 +2848,8 @@ gboolean gsb_form_validate_form_transaction ( gint transaction_number,
 		gint tmp_transaction_number;
 		
 		tmp_transaction_number = gsb_data_transaction_check_content_payment (
-                                    payment, utils_str_atoi (
-                                    gtk_entry_get_text ( GTK_ENTRY ( widget ) ) ) );
+                                    payment,
+                                    gtk_entry_get_text ( GTK_ENTRY ( widget ) ) );
 
 		if ( tmp_transaction_number
          &&
@@ -2991,7 +2991,6 @@ void gsb_form_take_datas_from_form ( gint transaction_number,
                         gsb_data_payee_get_number_by_name (
                         gtk_combofix_get_text ( GTK_COMBOFIX ( element -> element_widget ) ),
                         TRUE ), is_transaction );
-		    gsb_payee_update_combofix ();
 		}
 		break;
 
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index 2d8c29d..1dc4991 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -55,6 +55,9 @@ struct _GtkComboFixPrivate
     /* 0 to show all the items */
     gint max_items;
     gint visible_items;
+
+    /* old entry */
+    gchar *old_entry;
 };
 
 
@@ -62,10 +65,9 @@ struct _GtkComboFixPrivate
 
 /* common */
 static void gtk_combofix_class_init ( GtkComboFixClass *klass );
+static void gtk_combofix_dispose ( GObject *combofix );
+static void gtk_combofix_finalize ( GObject *combofix );
 static void gtk_combofix_init ( GtkComboFix *combofix );
-static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
-                        GSList *list,
-                        gint list_number );
 static void gtk_combofix_dialog ( gchar *text, gchar *hint );
 
 /* entry */
@@ -86,17 +88,6 @@ static gboolean gtk_combofix_button_release_event ( GtkWidget *popup,
 static gboolean gtk_combofix_button_press ( GtkWidget *popup,
                         GdkEventButton *ev,
                         GtkComboFix *combofix );
-static void gtk_combofix_dispose ( GObject *combofix );
-static gboolean gtk_combofix_fill_iter_child ( GtkTreeStore *store,
-                        GtkTreeIter *iter_parent,
-                        const gchar *string,
-                        const gchar *real_string,
-                        gint list_number );
-static gboolean gtk_combofix_fill_iter_parent ( GtkTreeStore *store,
-                        GtkTreeIter *iter_parent,
-                        const gchar *string,
-                        gint list_number );
-static void gtk_combofix_finalize ( GObject *combofix );
 static gboolean  gtk_combofix_focus_out ( GtkWidget *entry,
                         GdkEvent *ev,
                         GtkComboFix *combofix );
@@ -106,23 +97,41 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
 static gboolean gtk_combofix_button_press_event ( GtkWidget *tree_view,
                         GdkEventButton *ev,
                         GtkComboFix *combofix );
-static gboolean gtk_combofix_choose_selection ( GtkComboFix *combofix );
 static gboolean gtk_combofix_move_selection ( GtkComboFix *combofix,
                         gint direction );
 static gint gtk_combofix_get_rows_number_by_page ( GtkComboFix *combofix );
 static gboolean gtk_combofix_move_selection_one_step ( GtkComboFix *combofix,
                         GtkTreeIter *iter,
                         gint direction );
-static gint gtk_combofix_default_sort_func ( GtkTreeModel *model_sort,
-                        GtkTreeIter *iter_1,
-                        GtkTreeIter *iter_2,
-                        GtkComboFix *combofix );
 static gboolean gtk_combofix_separator_func ( GtkTreeModel *model,
                         GtkTreeIter *iter,
                         GtkComboFix *combofix );
 static gboolean gtk_combofix_popup_key_press_event ( GtkWidget *popup,
                         GdkEventKey *ev,
                         GtkComboFix *combofix );
+
+/* model */
+static gboolean gtk_combofix_choose_selection ( GtkComboFix *combofix );
+static gint gtk_combofix_default_sort_func ( GtkTreeModel *model_sort,
+                        GtkTreeIter *iter_1,
+                        GtkTreeIter *iter_2,
+                        GtkComboFix *combofix );
+static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
+                        GSList *list,
+                        gint list_number );
+static gboolean gtk_combofix_fill_iter_child ( GtkTreeStore *store,
+                        GtkTreeIter *iter_parent,
+                        const gchar *string,
+                        const gchar *real_string,
+                        gint list_number );
+static gboolean gtk_combofix_fill_iter_parent ( GtkTreeStore *store,
+                        GtkTreeIter *iter_parent,
+                        const gchar *string,
+                        gint list_number );
+static gboolean gtk_combofix_search_for_text (GtkTreeModel *model,
+                        GtkTreePath *path,
+                        GtkTreeIter *iter,
+                        gpointer *data);
 static gboolean gtk_combofix_select_item ( GtkComboFix *combofix,
                         const gchar *item );
 
@@ -207,6 +216,8 @@ void gtk_combofix_set_text ( GtkComboFix *combofix, const gchar *text )
     g_return_if_fail ( combofix );
     g_return_if_fail ( GTK_IS_COMBOFIX ( combofix ) );
 
+    //~ g_print ("gtk_combofix_set_text -> %s\n", text );
+
     g_signal_handlers_block_by_func ( G_OBJECT ( combofix -> entry ),
                         G_CALLBACK ( gtk_combofix_entry_insert ),
                         combofix );
@@ -387,6 +398,7 @@ gboolean gtk_combofix_set_list ( GtkComboFix *combofix, GSList *list )
     gint list_number = 0;
     gint length;
     GtkTreeIter iter;
+    g_print ("gtk_combofix_set_list payees\n" );
 
     g_return_val_if_fail (combofix, FALSE );
     g_return_val_if_fail (GTK_IS_COMBOFIX (combofix), FALSE);
@@ -420,6 +432,123 @@ gboolean gtk_combofix_set_list ( GtkComboFix *combofix, GSList *list )
 }
 
 
+/**
+* append a new line in a combofix
+*
+* \param combofix text
+*
+* \return
+* */
+void gtk_combofix_append_text ( GtkComboFix *combofix, const gchar *text )
+{
+    GtkComboFixPrivate *priv = combofix -> priv;
+    gchar **tab_char;
+    gint empty;
+    gpointer pointers[3] = { ( gpointer ) text, NULL, GINT_TO_POINTER ( priv -> case_sensitive ) };
+
+    g_return_if_fail ( combofix );
+    g_return_if_fail ( GTK_IS_COMBOFIX ( combofix ) );
+
+    //~ g_print ("gtk_combofix_append_text = %s\n", text );
+
+    empty = GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( combofix -> entry ), "empty" ) );
+    if ( empty || priv -> force )
+        return;
+
+    if ( priv -> old_entry && strcmp ( text, priv -> old_entry ) == 0 )
+        return;
+
+    gtk_tree_model_foreach ( GTK_TREE_MODEL ( priv -> store ),
+                        (GtkTreeModelForeachFunc) gtk_combofix_search_for_text,
+                        pointers );
+
+    if ( pointers[1] && GINT_TO_POINTER ( pointers[1] ) )
+        return;
+
+    tab_char = g_strsplit ( text, " : ", 2 );
+    if (tab_char[0])
+    {
+        GtkTreeIter iter_parent;
+
+        gtk_combofix_fill_iter_parent ( priv -> store, &iter_parent, text, 0 );
+
+        if ( tab_char[1] )
+        {
+            gchar* tmpstr;
+
+            tmpstr = g_strconcat ( "\t", text, NULL );
+            gtk_combofix_fill_iter_child ( priv -> store, &iter_parent, tab_char[1], text, 0 );
+
+            g_free ( tmpstr );
+        }
+    }
+
+    if ( priv -> old_entry && strlen ( priv -> old_entry ) )
+        g_free ( priv -> old_entry );
+    priv -> old_entry = g_strdup ( text );
+}
+
+
+/**
+* remove a line in a combofix
+*
+* \param combofix text
+*
+* \return
+* */
+void gtk_combofix_remove_text ( GtkComboFix *combofix, const gchar *text )
+{
+    GtkComboFixPrivate *priv = combofix -> priv;
+    GtkTreeIter iter;
+    gboolean case_sensitive = priv -> case_sensitive;
+    gboolean valid;
+
+    valid = gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( priv -> store ), &iter);
+
+    while ( valid )
+    {
+        gchar *tmp_str;
+        gboolean separator;
+
+        gtk_tree_model_get ( GTK_TREE_MODEL ( priv -> store ), &iter,
+                    COMBOFIX_COL_REAL_STRING, &tmp_str,
+                    COMBOFIX_COL_SEPARATOR, &separator,
+                    -1 );
+
+        if ( separator )
+        {
+            valid = gtk_tree_model_iter_next ( GTK_TREE_MODEL ( priv -> store ), &iter );
+            continue;
+        }
+        if ( case_sensitive && !strcmp ( text, tmp_str ) )
+        {
+            g_free ( tmp_str );
+            break;
+        }
+        else if ( !g_utf8_collate ( g_utf8_casefold ( text, -1 ),
+                                    g_utf8_casefold ( tmp_str, -1 ) ) )
+        {
+            g_free ( tmp_str );
+            break;
+        }
+
+        g_free ( tmp_str );
+
+        valid = gtk_tree_model_iter_next ( GTK_TREE_MODEL ( priv -> store ), &iter );
+    }
+    
+    if ( valid )
+        gtk_tree_store_remove ( priv -> store, &iter );
+}
+
+
+/**
+* 
+*
+* \param combofix text
+*
+* \return
+* */
 void gtk_combofix_set_selection_callback ( GtkComboFix *combofix,
 						GCallback func,
 					    gpointer data )
@@ -656,8 +785,8 @@ static void gtk_combofix_finalize ( GObject *combofix )
 * with the list given in param
 * carreful : the list is not cleared, so if needed, must do it before
 *
-* \param combofix
-* \param list 		a g_slist of strings
+* \param                combofix
+* \param list           a g_slist of strings
 * \param list_number 	the number of the list for a complex, 0 else
 *
 * \return TRUE ok, FALSE pb
@@ -829,7 +958,9 @@ static gboolean gtk_combofix_entry_changed ( GtkComboFix *combofix, gboolean ins
     GtkComboFixPrivate *priv = combofix -> priv;
 
     entry_string = gtk_entry_get_text ( GTK_ENTRY ( combofix -> entry ) );
-g_print ("gtk_combofix_entry_changed = %s\n", entry_string );
+
+    //~ g_print ("gtk_combofix_entry_changed = %s\n", entry_string );
+
     if ( strlen ( entry_string ) )
     {
         completed_string = gtk_combofix_update_visible_rows ( combofix,
@@ -1315,6 +1446,7 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
                 gtk_editable_select_region ( GTK_EDITABLE (combofix -> entry), 0, 0 );
             }
         }
+        gtk_combofix_append_text ( combofix, gtk_entry_get_text ( GTK_ENTRY ( combofix -> entry ) ) );
         /* le traitement de ENTER est fait dans le formulaire */
         return FALSE;
 	    break;
@@ -1895,6 +2027,46 @@ void gtk_combofix_dialog ( gchar *text, gchar *hint )
 }
 
 
+/**
+* vérifie si la chaine text existe déjà
+*
+* \param
+*
+* \return TRUE si trouvé FALSE autrement
+* */
+gboolean gtk_combofix_search_for_text (GtkTreeModel *model,
+                        GtkTreePath *path,
+                        GtkTreeIter *iter,
+                        gpointer *data )
+{
+    gchar *tmp_str;
+    gboolean case_sensitive;
+    gboolean separator;
+    gint return_value;
+
+    gtk_tree_model_get ( GTK_TREE_MODEL( model ), iter,
+			            COMBOFIX_COL_REAL_STRING, &tmp_str,
+                        COMBOFIX_COL_SEPARATOR, &separator,
+			            -1 );
+
+    if ( separator )
+    {
+        g_free ( tmp_str );
+        return FALSE;
+    }
+
+    case_sensitive = GPOINTER_TO_INT ( data[2] );
+    if ( case_sensitive )
+        return_value = !strcmp ( ( gchar *) data[0], tmp_str );
+    else
+        return_value = !g_utf8_collate ( g_utf8_casefold ( ( gchar *) data[0], -1 ),
+                                         g_utf8_casefold ( tmp_str, -1 ) );
+    if ( return_value )
+        data[1] = GINT_TO_POINTER ( 1 );
+
+    return return_value;
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gtk_combofix.h b/src/gtk_combofix.h
index 75880d9..8e07efe 100644
--- a/src/gtk_combofix.h
+++ b/src/gtk_combofix.h
@@ -68,6 +68,8 @@ gboolean gtk_combofix_show_popup ( GtkComboFix *combofix );
 gboolean gtk_combofix_hide_popup ( GtkComboFix *combofix );
 
 /* list of items */
+void gtk_combofix_append_text ( GtkComboFix *combofix, const gchar *text );
+void gtk_combofix_remove_text ( GtkComboFix *combofix, const gchar *text );
 gboolean gtk_combofix_set_list ( GtkComboFix *combofix, GSList *list );
 void gtk_combofix_set_max_items ( GtkComboFix *combofix, gint max_items );
 void gtk_combofix_set_mixed_sort ( GtkComboFix *combofix, gboolean mixed_sort );
diff --git a/src/import.c b/src/import.c
index 76e2c2f..21f03f0 100644
--- a/src/import.c
+++ b/src/import.c
@@ -2032,12 +2032,11 @@ gboolean gsb_import_define_action ( struct struct_compte_importation *imported_a
         }
 
         /* if no id, check the cheque */
-        tmpstr = utils_str_itoa (imported_transaction -> cheque);
         if ( imported_transaction -> action != IMPORT_TRANSACTION_LEAVE_TRANSACTION
          &&
          imported_transaction -> cheque
          &&
-         gsb_data_transaction_find_by_payment_content ( tmpstr,
+         gsb_data_transaction_find_by_payment_content ( imported_transaction -> cheque,
                                 account_number ) )
         {
             /* found the cheque, forget that transaction */
@@ -2588,8 +2587,6 @@ gint gsb_import_create_transaction ( struct struct_ope_importation *imported_tra
 
     if (origine && g_ascii_strcasecmp (origine, "OFX") == 0 )
     {
-    gchar *buffer;
-    
     switch ( imported_transaction -> type_de_transaction )
     {
         case OFX_CHECK:
@@ -2599,11 +2596,8 @@ gint gsb_import_create_transaction ( struct struct_ope_importation *imported_tra
         gsb_data_transaction_set_method_of_payment_number (transaction_number, 
                         payment_number);
         /* we get the check number */
-        buffer = g_malloc0 ( 12*sizeof (gchar) );
-        g_ascii_formatd ( buffer,12,"%.0f", imported_transaction -> cheque);
         gsb_data_transaction_set_method_of_payment_content (
-                transaction_number, buffer );
-        g_free ( buffer );
+                transaction_number, imported_transaction -> cheque );
 
         break;
         //~ case OFX_INT:
@@ -2725,25 +2719,24 @@ gint gsb_import_create_transaction ( struct struct_ope_importation *imported_tra
     gsb_data_transaction_set_method_of_payment_number ( transaction_number,
                         payment_number );
 
-    tmpstr = utils_str_itoa ( imported_transaction -> cheque );
     if ( gsb_data_payment_get_automatic_numbering (payment_number))
         /* we are on the default payment_number, save just the cheque number */
         gsb_data_transaction_set_method_of_payment_content ( transaction_number,
-                        tmpstr );
+                        imported_transaction -> cheque );
     else
     {
         /* we are on a automatic numbering payment, we will save the cheque only
          * if it's not used before, else we show an warning message */
-        if (gsb_data_transaction_check_content_payment (payment_number, imported_transaction -> cheque))
+        if ( gsb_data_transaction_check_content_payment ( payment_number, imported_transaction -> cheque ) )
         {
-        gchar* tmpstr = g_strdup_printf ( _("Warning : the cheque number %ld is already used.\nWe skip it"),
+        gchar* tmpstr = g_strdup_printf ( _("Warning : the cheque number %s is already used.\nWe skip it"),
                         imported_transaction -> cheque );
         dialogue_warning ( tmpstr );
         g_free ( tmpstr );
         }
         else
         gsb_data_transaction_set_method_of_payment_content ( transaction_number,
-                        utils_str_itoa ( imported_transaction -> cheque ) );
+                        imported_transaction -> cheque );
     }
     g_free ( tmpstr );
     }
diff --git a/src/import.h b/src/import.h
index 1ec2fc8..6665ff0 100644
--- a/src/import.h
+++ b/src/import.h
@@ -73,7 +73,7 @@ struct struct_ope_importation
     
     gchar *tiers;
     gchar *notes;
-    gulong cheque;
+    gchar *cheque;
 
     gchar *categ;
 	gchar *budget;
diff --git a/src/plugins/ofx/ofx.c b/src/plugins/ofx/ofx.c
index 7c248cb..f3796df 100644
--- a/src/plugins/ofx/ofx.c
+++ b/src/plugins/ofx/ofx.c
@@ -411,7 +411,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data)
 	ope_import -> notes = latin2utf8 ( data.memo );
 
     if ( data.check_number_valid )
-	ope_import -> cheque = utils_str_atoi ( data.check_number );
+	ope_import -> cheque = latin2utf8 ( data.check_number );
 
     if ( data.amount_valid )
 	ope_import -> montant = gsb_real_double_to_real (data.amount);
diff --git a/src/plugins/ofx/ofx.h b/src/plugins/ofx/ofx.h
index 3901b04..f5593f5 100644
--- a/src/plugins/ofx/ofx.h
+++ b/src/plugins/ofx/ofx.h
@@ -30,9 +30,6 @@ G_MODULE_EXPORT extern GSList * ofx_plugin_run ( GtkWidget * assistant,
 #endif
 
 #ifndef OFX_ERROR
-#ifdef _MSC_VER
-#undef ERROR
-#endif // _MSC_VER
 #define OFX_ERROR   ERROR
 #endif
 
diff --git a/src/qif.c b/src/qif.c
index dba1f21..5831240 100644
--- a/src/qif.c
+++ b/src/qif.c
@@ -365,8 +365,7 @@ gboolean recuperation_donnees_qif ( GtkWidget *assistant, struct imported_file *
 
 		    /* récupération du chèque */
 		    if ( tmp_str[0] == 'N' )
-			imported_transaction -> cheque = my_strtod ( tmp_str + 1,
-								     NULL ); 
+			imported_transaction -> cheque = my_strdup ( tmp_str + 1 ); 
 
 		    /* récupération du tiers */
 		    if ( tmp_str[0] == 'P' )


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list