[grisbi-cvs] grisbi/src balance_estimate_tab.c, 1.39, 1.40 navigation.c, 1.133, 1.134

Pierre Biava pbiava at users.sourceforge.net
Mon Feb 8 23:01:22 CET 2010


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

Modified Files:
	balance_estimate_tab.c navigation.c 
Log Message:
minor corrections of the modul of estimate balance and  add the reconciled balance in the list of transactions

Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- balance_estimate_tab.c	4 Feb 2010 20:04:51 -0000	1.39
+++ balance_estimate_tab.c	8 Feb 2010 22:01:20 -0000	1.40
@@ -820,7 +820,21 @@
             while ( gtk_tree_model_iter_nth_child ( GTK_TREE_MODEL ( store ),
                         &fils_iter, &iter, i ) )
             {
-                gtk_tree_store_set ( GTK_TREE_STORE ( store ), &fils_iter, 0, valeur, -1 );
+                if ( valeur == 1 )
+                {
+                    gtk_tree_model_get ( GTK_TREE_MODEL ( store ), &fils_iter,
+                                SPP_HISTORICAL_AVERAGE_COLUMN, &tmp_str,
+                                -1 );
+                    gtk_tree_store_set ( GTK_TREE_STORE ( store ), &fils_iter, 0, valeur,
+                                SPP_HISTORICAL_RETAINED_COLUMN, tmp_str,
+                                -1 );
+                }
+                else
+                {
+                    gtk_tree_store_set ( GTK_TREE_STORE ( store ), &fils_iter, 0, valeur,
+                                SPP_HISTORICAL_RETAINED_COLUMN, "",
+                                -1 );
+                }
                 i++;
             }
         }
@@ -2344,7 +2358,9 @@
     amount = gsb_real_get_from_string ( str_amount );
 
     if (amount.mantissa < 0)
-        str_debit = str_value;
+        str_debit = gsb_real_get_string_with_currency ( gsb_real_opposite ( amount ),
+                        gsb_data_account_get_currency (
+                        bet_estimate_get_account_selected ( ) ), TRUE );
     else
         str_credit = str_value;
 
@@ -2389,6 +2405,8 @@
     }
 
     g_free ( str_description );
+    if ( str_debit )
+        g_free ( str_debit );
     g_free ( str_value );
     g_free ( str_amount );
 }

Index: navigation.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/navigation.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- navigation.c	18 Jan 2010 19:13:40 -0000	1.133
+++ navigation.c	8 Feb 2010 22:01:20 -0000	1.134
@@ -1030,16 +1030,25 @@
 void gsb_navigation_update_statement_label ( gint account_number )
 {
     gint reconcile_number;
+    gchar* tmp_str;
+    gchar* tmp_str1;
+    gchar* tmp_str2;
 
-    reconcile_number = gsb_data_reconcile_get_account_last_number (account_number);
-    if (reconcile_number)
+    reconcile_number = gsb_data_reconcile_get_account_last_number ( account_number );
+    if ( reconcile_number )
     {
-        gchar* tmpstr2 = gsb_format_gdate (gsb_data_reconcile_get_final_date (
-                                            reconcile_number));
-        gchar* tmpstr = g_strdup_printf ( _("Last statement: %s"), tmpstr2);
-        gtk_label_set_text ( GTK_LABEL ( label_last_statement ), tmpstr);
-        g_free ( tmpstr );
-        g_free ( tmpstr2 );
+        tmp_str1 = gsb_format_gdate ( gsb_data_reconcile_get_final_date (
+                                            reconcile_number ) );
+        tmp_str2 = gsb_real_get_string_with_currency (
+                        gsb_data_reconcile_get_final_balance ( reconcile_number ),
+                        gsb_data_account_get_currency ( account_number ), TRUE );
+        
+        tmp_str = g_strconcat ( _("Last statement: "), tmp_str1, " - ",
+                               _("Reconciled balance: "), tmp_str2, NULL );
+        gtk_label_set_text ( GTK_LABEL ( label_last_statement ), tmp_str);
+        g_free ( tmp_str );
+        g_free ( tmp_str1 );
+        g_free ( tmp_str2 );
     }
     else
         gtk_label_set_text ( GTK_LABEL ( label_last_statement ),



More information about the cvs mailing list