[grisbi-cvs] grisbi/src gsb_debug.c, 1.14, 1.15 gsb_file_load.c, 1.196, 1.197

Pierre Biava pbiava at users.sourceforge.net
Sat Dec 19 08:26:39 CET 2009


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18599/src

Modified Files:
	gsb_debug.c gsb_file_load.c 
Log Message:
I modified the recovery of reconciliation to deal with cases where reconcile number = 0 and minor corrections

Index: gsb_debug.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_debug.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gsb_debug.c	24 Aug 2009 13:40:57 -0000	1.14
+++ gsb_debug.c	19 Dec 2009 07:26:37 -0000	1.15
@@ -269,6 +269,7 @@
 {
     GtkWidget * vbox, * label, * button;
     GtkWidget *scrolled_window;
+    gchar *tmp_str;
 
     scrolled_window = gtk_scrolled_window_new (FALSE, FALSE);
     gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
@@ -279,10 +280,14 @@
 					    vbox );
 
     label = gtk_label_new ( NULL );
-    gtk_label_set_markup ( GTK_LABEL(label), make_hint ( _( test -> name ), summary ) );
+    tmp_str = g_strconcat ( make_pango_attribut (
+                        "size=\"larger\" weight=\"bold\"",_( test -> name ) ),
+                        "\n\n", summary, NULL );
+    gtk_label_set_markup ( GTK_LABEL(label), tmp_str );
     gtk_label_set_line_wrap ( GTK_LABEL(label), TRUE );
     gtk_label_set_justify ( GTK_LABEL(label), GTK_JUSTIFY_LEFT );
     gtk_misc_set_alignment (GTK_MISC (label), 0, 1);
+    g_free ( tmp_str );
 
     gtk_box_pack_start ( GTK_BOX(vbox), label, FALSE, FALSE, 0 );
     gtk_container_set_border_width ( GTK_CONTAINER(vbox), 12 );

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -d -r1.196 -r1.197
--- gsb_file_load.c	13 Dec 2009 20:08:31 -0000	1.196
+++ gsb_file_load.c	19 Dec 2009 07:26:37 -0000	1.197
@@ -7711,9 +7711,7 @@
 
             /* ok first we work only with reconciled transactions */
             if ( gsb_data_transaction_get_marked_transaction (
-                            transaction_number) == OPERATION_RAPPROCHEE &&
-                (reconcile_number = gsb_data_transaction_get_reconcile_number (
-                        transaction_number)) > 0 )
+                            transaction_number) == OPERATION_RAPPROCHEE )
             {
                 gint account_number;
                 gint reconcile_account;
@@ -7721,10 +7719,27 @@
                 const GDate *date_transaction;
                 gboolean trouve = FALSE;
 
-                reconcile_account = gsb_data_reconcile_get_account ( reconcile_number );
-
                 account_number = gsb_data_transaction_get_account_number (
-                                    transaction_number );
+                        transaction_number );
+
+                reconcile_number = gsb_data_transaction_get_reconcile_number (
+                        transaction_number);
+                if ( reconcile_number == 0 )
+                {
+                    if ( gsb_data_reconcile_get_account_last_number ( account_number ) == 0 )
+                    {
+                        reconcile_number = gsb_data_reconcile_new (NULL);
+                        gsb_data_reconcile_set_account ( reconcile_number, -1 );
+                        gsb_data_reconcile_set_name ( reconcile_number,
+                                  gsb_data_account_get_name ( account_number ) );
+                        gsb_data_reconcile_set_init_balance ( reconcile_number,
+                                              null_real );
+                        gsb_data_reconcile_set_final_balance ( reconcile_number,
+                                               null_real );
+                    }
+                }
+
+                reconcile_account = gsb_data_reconcile_get_account ( reconcile_number );
 
                 /* ok, we set the account number (faster to not check and directly
                  * write it... even if already done) */



More information about the cvs mailing list