[grisbi-cvs] grisbi/src balance_estimate_future.c, NONE, 1.1 balance_estimate_future.h, NONE, 1.1 Makefile.am, 1.164, 1.165 balance_estimate_data.c, 1.13, 1.14 balance_estimate_hist.c, 1.17, 1.18 balance_estimate_hist.h, 1.7, 1.8 balance_estimate_tab.c, 1.54, 1.55 comptes_onglet.c, 1.44, 1.45 fenetre_principale.c, 1.129, 1.130 gsb_data_payment.c, 1.15, 1.16 gsb_data_payment.h, 1.6, 1.7 gsb_data_transaction.c, 1.84, 1.85 gsb_file_load.c, 1.213, 1.214 gsb_file_save.c, 1.159, 1.160 gsb_form.c, 1.152, 1.153 gsb_payment_method.c, 1.21, 1.22 gsb_payment_method_config.c, 1.39, 1.40 gsb_scheduler.c, 1.28, 1.29 gsb_transactions_list.c, 1.201, 1.202

Pierre Biava pbiava at users.sourceforge.net
Tue Mar 16 12:48:45 CET 2010


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

Modified Files:
	Makefile.am balance_estimate_data.c balance_estimate_hist.c 
	balance_estimate_hist.h balance_estimate_tab.c 
	comptes_onglet.c fenetre_principale.c gsb_data_payment.c 
	gsb_data_payment.h gsb_data_transaction.c gsb_file_load.c 
	gsb_file_save.c gsb_form.c gsb_payment_method.c 
	gsb_payment_method_config.c gsb_scheduler.c 
	gsb_transactions_list.c 
Added Files:
	balance_estimate_future.c balance_estimate_future.h 
Log Message:
fixed bug 1001 and add files balance_estimate_future.c and balance_estimate_future.h

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- gsb_data_transaction.c	15 Mar 2010 20:29:47 -0000	1.84
+++ gsb_data_transaction.c	16 Mar 2010 11:48:43 -0000	1.85
@@ -1392,7 +1392,9 @@
 }
 
 
-/** get the method_of_payment_content
+/** 
+ * get the method_of_payment_content
+ *
  * \param transaction_number the number of the transaction
  * \return the method_of_payment_content of the transaction
  * */
@@ -1409,8 +1411,10 @@
 }
 
 
-/** set the method_of_payment_content
+/** 
+ * set the method_of_payment_content
  * dupplicate the parameter before storing it in the transaction
+ *
  * \param transaction_number
  * \param no_account
  * \param method_of_payment_content a gchar with the new method_of_payment_content

Index: comptes_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/comptes_onglet.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- comptes_onglet.c	11 Jun 2008 10:22:16 -0000	1.44
+++ comptes_onglet.c	16 Mar 2010 11:48:43 -0000	1.45
@@ -44,13 +44,14 @@
  */
 GtkWidget *creation_onglet_comptes ( void )
 {
-    GtkWidget * box;
+    GtkWidget *page;
 
-    box = gsb_account_property_create_page ();
+    page = gsb_account_property_create_page ();
+    gtk_widget_set_name ( page, "properties_page" );
 
-    gtk_widget_show_all (box);
+    gtk_widget_show_all ( page );
 
-    return ( box );
+    return ( page );
 }
 
 

Index: gsb_data_payment.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_payment.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gsb_data_payment.h	16 Nov 2008 20:34:25 -0000	1.6
+++ gsb_data_payment.h	16 Mar 2010 11:48:43 -0000	1.7
@@ -13,7 +13,8 @@
 gint gsb_data_payment_create_default  ( gint account_number );
 gint gsb_data_payment_get_account_number ( gint payment_number );
 gint gsb_data_payment_get_automatic_numbering ( gint payment_number );
-gint gsb_data_payment_get_last_number ( gint payment_number );
+const gchar *gsb_data_payment_get_last_number ( gint payment_number );
+gint gsb_data_payment_get_last_number_to_int ( gint payment_number );
 GSList *gsb_data_payment_get_list_for_account ( gint account_number );
 const gchar *gsb_data_payment_get_name ( gint payment_number );
 gint gsb_data_payment_get_number ( gpointer payment_ptr );
@@ -25,6 +26,8 @@
 gint gsb_data_payment_get_similar ( gint origin_payment,
 				    gint target_account_number );
 gint gsb_data_payment_get_transfer_payment_number ( gint account_number );
+gchar *gsb_data_payment_incremente_last_number ( gint payment_number,
+                    gint increment );
 gboolean gsb_data_payment_init_variables ( void );
 gint gsb_data_payment_new ( const gchar *name );
 gboolean gsb_data_payment_remove ( gint payment_number );
@@ -33,6 +36,8 @@
 gboolean gsb_data_payment_set_automatic_numbering ( gint payment_number,
 						    gint automatic_numbering );
 gboolean gsb_data_payment_set_last_number ( gint payment_number,
+					    const gchar *last_number );
+gboolean gsb_data_payment_set_last_number_from_int ( gint payment_number,
 					    gint last_number );
 gboolean gsb_data_payment_set_name ( gint payment_number,
 				     const gchar *name );

--- NEW FILE: balance_estimate_future.h ---
#ifndef _BALANCE_ESTIMATE_FUTURE_H
#define _BALANCE_ESTIMATE_FUTURE_H

#include <gtk/gtk.h>

/* START_INCLUDE_H */
/* END_INCLUDE_H */


/* START_DECLARATION */
GtkWidget * bet_future_create_page ( void );
/* END_DECLARATION */

#endif /*_BALANCE_ESTIMATE_FUTURE_H*/


Index: gsb_payment_method_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_payment_method_config.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- gsb_payment_method_config.c	13 Feb 2010 17:44:59 -0000	1.39
+++ gsb_payment_method_config.c	16 Mar 2010 11:48:43 -0000	1.40
@@ -48,6 +48,7 @@
 #include "./gsb_data_payment.h"
 #include "./gsb_data_form.h"
 #include "./include.h"
+#include "./erreur.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -274,8 +275,10 @@
 		       GTK_SHRINK | GTK_FILL, 0,
 		       0, 0 );
     payment_last_number_entry = gsb_autofunc_spin_new ( 0,
-						     G_CALLBACK (gsb_payment_method_config_auto_entry_changed), payment_method_treeview,
-						     G_CALLBACK (gsb_data_payment_set_last_number), 0 );
+						G_CALLBACK (gsb_payment_method_config_auto_entry_changed),
+                        payment_method_treeview,
+						G_CALLBACK (gsb_data_payment_set_last_number_from_int),
+                        0 );
     gtk_widget_set_size_request ( payment_last_number_entry, width_entry, -1 );
     gtk_table_attach ( GTK_TABLE ( table ),
 		       payment_last_number_entry, 1, 2, 1, 2,
@@ -417,7 +420,7 @@
 	    GtkTreeIter *parent_iter = NULL;
 	    GtkTreeIter method_iter;
 	    gboolean isdefault;
-	    gchar *number;
+	    const gchar *number;
 
 	    payment_number = gsb_data_payment_get_number (payment_list -> data);
 
@@ -452,7 +455,7 @@
 
 	    /* set the last number */
 	    if ( gsb_data_payment_get_automatic_numbering (payment_number))
-		number = utils_str_itoa (gsb_data_payment_get_last_number (payment_number));
+		number = gsb_data_payment_get_last_number ( payment_number );
 	    else
 		number = g_strdup("");
 
@@ -468,7 +471,6 @@
 				PAYMENT_METHODS_NUMBER_COLUMN, payment_number,
 				PAYMENT_METHODS_ACCOUNT_COLUMN, account_number,
 				-1 );
-	    g_free ( number );
 
 	    payment_list = payment_list -> next;
 	}
@@ -512,7 +514,7 @@
 					   gsb_data_payment_get_name (payment_number),
 					   payment_number );
 	    gsb_autofunc_spin_set_value ( payment_last_number_entry,
-					  gsb_data_payment_get_last_number (payment_number),
+					  gsb_data_payment_get_last_number_to_int ( payment_number ),
 					  payment_number );
 	    gsb_autofunc_checkbutton_set_value ( button_show_entry,
 						 gsb_data_payment_get_show_entry (payment_number),
@@ -824,16 +826,15 @@
 	{
 	    if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button_auto_numbering )))
 	    {
-            gchar* tmpstr;
+            const gchar* tmpstr;
 
             gtk_widget_set_sensitive ( payment_last_number_entry, TRUE );
-            tmpstr = utils_str_itoa ( gsb_data_payment_get_last_number ( payment_number ) );
+            tmpstr = gsb_data_payment_get_last_number ( payment_number );
             gtk_tree_store_set ( GTK_TREE_STORE ( model ),
                             &iter,
                             PAYMENT_METHODS_NUMBERING_COLUMN,
                             tmpstr,
                             -1);
-            g_free ( tmpstr );
 	    }
 	    else
 	    {
@@ -880,14 +881,13 @@
 			     -1 );
 	if (payment_number)
 	{
-        gchar* tmpstr;
+        const gchar* tmpstr;
 
-        tmpstr = utils_str_itoa ( gsb_data_payment_get_last_number ( payment_number ) );
+        tmpstr = gsb_data_payment_get_last_number ( payment_number );
         gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
                         PAYMENT_METHODS_NUMBERING_COLUMN,
                         tmpstr,
                         -1);
-	    g_free ( tmpstr );
 	}
     }
     return FALSE;

Index: gsb_transactions_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- gsb_transactions_list.c	14 Mar 2010 19:42:26 -0000	1.201
+++ gsb_transactions_list.c	16 Mar 2010 11:48:43 -0000	1.202
@@ -285,6 +285,7 @@
     /*   la fenetre des opé est une vbox : la liste en haut, le solde et  */
     /*     des boutons de conf au milieu, le transaction_form en bas */
     win_operations = gtk_vbox_new ( FALSE, 6 );
+    gtk_widget_set_name ( win_operations, "win_operations" );
 
     /* création de la barre d'outils */
     barre_outils = gtk_handle_box_new ();

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- gsb_form.c	8 Mar 2010 21:30:01 -0000	1.152
+++ gsb_form.c	16 Mar 2010 11:48:43 -0000	1.153
@@ -1974,6 +1974,7 @@
 	{
 	    gint payment_number;
 	    gint account_number;
+        gchar* tmp_str;
 
 	    account_number = gsb_form_get_account_number ();
 	    payment_number = gsb_payment_method_get_selected_number (widget);
@@ -1985,9 +1986,9 @@
 
 		if ( !strlen (gtk_entry_get_text ( GTK_ENTRY (widget))))
 		{
-		    gchar* tmpstr = utils_str_itoa (gsb_data_payment_get_last_number (payment_number) + 1);
-		    gtk_entry_set_text ( GTK_ENTRY (widget), tmpstr);
-		    g_free ( tmpstr );
+            tmp_str = gsb_data_payment_incremente_last_number ( payment_number, 1 );
+		    gtk_entry_set_text ( GTK_ENTRY (widget), tmp_str);
+		    g_free ( tmp_str );
 		}
 	    }
 	}
@@ -2348,8 +2349,8 @@
                     {
                         gchar *tmpstr;
 
-                        tmpstr = utils_str_itoa ( gsb_data_payment_get_last_number (
-                                        payment_number ) + nbre_passage );
+                        tmpstr = gsb_data_payment_incremente_last_number ( payment_number,
+                                        nbre_passage );
                         gsb_data_transaction_set_method_of_payment_content (
                                         transaction_number,
                                         tmpstr );
@@ -2960,9 +2961,9 @@
 			/* get the last number to increase next time */
 			if ( is_transaction
 			     &&
-			     gsb_data_payment_get_automatic_numbering (payment_number))
+			     gsb_data_payment_get_automatic_numbering ( payment_number ) )
 			    gsb_data_payment_set_last_number ( payment_number,
-							       utils_str_atoi (gtk_entry_get_text (GTK_ENTRY (widget_tmp))));
+							       gtk_entry_get_text (GTK_ENTRY ( widget_tmp ) ) );
 		    }
 		    else
 			gsb_data_mix_set_method_of_payment_content ( transaction_number, NULL, is_transaction);

Index: gsb_data_payment.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_payment.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gsb_data_payment.c	14 Feb 2010 17:48:50 -0000	1.15
+++ gsb_data_payment.c	16 Mar 2010 11:48:43 -0000	1.16
@@ -35,6 +35,7 @@
 #include "./utils_str.h"
 #include "./gsb_data_account.h"
 #include "./include.h"
+#include "./erreur.h"
 /*END_INCLUDE*/
 
 
@@ -51,7 +52,7 @@
 
     gint show_entry;		/**< when select it in form, need to show an entry (for cheque number for example) or not */
     gint automatic_numbering;	/**< for cheque number for example */
-    gint last_number;		/**< the last number of cheque used */
+    gchar *last_number;		/**< the last number of cheque used */
 } struct_payment;
 
 
@@ -293,6 +294,8 @@
     else 
 	payment -> payment_name = NULL;
 
+    payment -> last_number = NULL;
+
     payment_list = g_slist_append ( payment_list, payment );
     payment_buffer = payment;
 
@@ -308,7 +311,10 @@
         return;
     if ( payment -> payment_name )
         g_free ( payment -> payment_name );
+    if ( payment -> last_number )
+        g_free ( payment -> last_number );
     g_free ( payment );
+
     if ( payment_buffer == payment )
 	payment_buffer = NULL;
 }
@@ -642,14 +648,14 @@
  *
  * \return the last_number of the payment or -1 if fail
  * */
-gint gsb_data_payment_get_last_number ( gint payment_number )
+const gchar *gsb_data_payment_get_last_number ( gint payment_number )
 {
     struct_payment *payment;
-
+devel_debug_int (payment_number);
     payment = gsb_data_payment_get_structure ( payment_number );
 
     if (!payment)
-	return -1;
+	    return NULL;
 
     return payment -> last_number;
 }
@@ -664,7 +670,7 @@
  * \return TRUE if ok or FALSE if problem
  * */
 gboolean gsb_data_payment_set_last_number ( gint payment_number,
-					    gint last_number )
+					    const gchar *last_number )
 {
     struct_payment *payment;
 
@@ -673,13 +679,12 @@
     if (!payment)
 	return FALSE;
 
-    payment -> last_number = last_number;
+    payment -> last_number = my_strdup ( last_number );
 
     return TRUE;
 }
 
 
-
 /**
  * create a set of preformated method of payment and associate
  * them to the account given in param
@@ -805,3 +810,94 @@
 	return gsb_data_account_get_default_credit (target_account_number);
 }
 
+
+gchar *gsb_data_payment_incremente_last_number ( gint payment_number,
+                    gint increment )
+{
+    const gchar *last_number;
+    gchar *new_number;
+    gchar *prefix = NULL;
+    gint number;
+    gint i = 0;
+
+    last_number = gsb_data_payment_get_last_number ( payment_number );
+    while ( last_number[i] == '0' )
+    {
+        i++;
+    }
+    if ( i > 0 )
+        prefix = g_strndup ( last_number, i );
+    
+    number = utils_str_atoi ( last_number );
+    number += increment;
+    new_number = utils_str_itoa ( number );
+    if ( prefix && strlen ( prefix ) )
+        new_number = g_strconcat ( prefix, new_number, NULL );
+
+    return new_number;
+}
+
+
+/**
+ * return the last_number of the method of payment to int
+ * this is the last number to set automatically that number + 1
+ * 	in the cheque entry ; nothing to deal with gsb_data_payment_max_number
+ * 	wich give the last payment_number, internal number to count the method of payment
+ *
+ * \param payment_number the number of the method of payment
+ *
+ * \return the int_last_number of the payment or -1 if fail
+ * */
+gint gsb_data_payment_get_last_number_to_int ( gint payment_number )
+{
+    struct_payment *payment;
+
+    payment = gsb_data_payment_get_structure ( payment_number );
+
+    if (!payment)
+	    return -1;
+
+    return utils_str_atoi ( payment -> last_number );
+}
+
+
+/**
+ * set the last_number of the method of payment from an int
+ *
+ * \param payment_number the number of the method of payment
+ * \param last_number the last_number of the method of payment
+ *
+ * \return TRUE if ok or FALSE if problem
+ * */
+gboolean gsb_data_payment_set_last_number_from_int ( gint payment_number,
+					    gint last_number )
+{
+    struct_payment *payment;
+    const gchar *old_number;
+    gchar *new_number;
+    gchar *prefix = NULL;
+    gint i = 0;
+
+    payment = gsb_data_payment_get_structure ( payment_number );
+
+    if (!payment)
+	return FALSE;
+
+    old_number = gsb_data_payment_get_last_number ( payment_number );
+    while ( old_number[i] == '0' )
+    {
+        i++;
+    }
+    if ( i > 0 )
+        prefix = g_strndup ( old_number, i );
+
+    new_number = utils_str_itoa ( last_number );
+    if ( prefix && strlen ( prefix ) )
+        new_number = g_strconcat ( prefix, new_number, NULL );
+
+    payment -> last_number = new_number;
+
+    return TRUE;
+}
+
+

Index: fenetre_principale.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/fenetre_principale.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- fenetre_principale.c	13 Mar 2010 21:06:58 -0000	1.129
+++ fenetre_principale.c	16 Mar 2010 11:48:43 -0000	1.130
@@ -26,6 +26,7 @@
 /*START_INCLUDE*/
 #include "fenetre_principale.h"
 #include "./balance_estimate_data.h"
+#include "./balance_estimate_future.h"
 #include "./balance_estimate_hist.h"
 #include "./balance_estimate_tab.h"
 #include "./navigation.h"
@@ -242,11 +243,16 @@
     gtk_notebook_append_page ( GTK_NOTEBOOK ( account_page ),
                         bet_array_create_page ( ),
                         gtk_label_new (SPACIFY(_("Forecast"))) );
+
     gtk_notebook_append_page ( GTK_NOTEBOOK ( account_page ),
                         bet_historical_create_page ( ),
                         gtk_label_new (SPACIFY(_("Historical data"))) );
 
+    gtk_notebook_append_page ( GTK_NOTEBOOK ( account_page ),
+                        bet_future_create_page ( ),
+                        gtk_label_new (SPACIFY(_("Future data"))) );
 #endif /* ENABLE_BALANCE_ESTIMATE */
+
     gtk_notebook_append_page ( GTK_NOTEBOOK ( account_page ),
                         creation_onglet_comptes (),
                         gtk_label_new (SPACIFY(_("Properties"))) );
@@ -301,21 +307,36 @@
                         guint page_number,
                         gpointer null )
 {
-    switch ( page_number )
-    {
-    case 0:
-        gsb_form_set_expander_visible ( TRUE, TRUE );
-        break;
+    const gchar *name;
 
-    case 1:
-    case 2:
+    name = gtk_widget_get_name ( gtk_notebook_get_nth_page ( notebook, page_number ) );
+
+    if ( g_utf8_collate ( name, "win_operations" ) == 0 )
+        gsb_form_set_expander_visible ( TRUE, TRUE );
 #ifdef ENABLE_BALANCE_ESTIMATE
+    else if ( g_utf8_collate ( name, "bet_array_page" ) == 0 )
+    {
+        gsb_form_set_expander_visible ( FALSE, FALSE );
         if ( bet_data_get_maj ( ) )
             bet_array_update_estimate_tab ( );
-#endif /* ENABLE_BALANCE_ESTIMATE */
-    case 3:
+    }
+    else if ( g_utf8_collate ( name, "bet_historical_page" ) == 0 )
+    {
+        gsb_form_set_expander_visible ( FALSE, FALSE );
+        if ( bet_data_get_maj ( ) )
+            bet_array_update_estimate_tab ( );
+    }
+    else if ( g_utf8_collate ( name, "bet_future_page" ) == 0 )
+    {
+        //~ gsb_form_set_expander_visible ( TRUE, TRUE );
         gsb_form_set_expander_visible (FALSE, FALSE );
-        break;
+        if ( bet_data_get_maj ( ) )
+            bet_array_update_estimate_tab ( );
+    }
+#endif /* ENABLE_BALANCE_ESTIMATE */
+    else if ( g_utf8_collate ( name, "properties_page" ) == 0 )
+    {
+        gsb_form_set_expander_visible ( FALSE, FALSE );
     }
 
     return ( FALSE );

Index: Makefile.am
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/Makefile.am,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- Makefile.am	23 Feb 2010 21:36:45 -0000	1.164
+++ Makefile.am	16 Mar 2010 11:48:42 -0000	1.165
@@ -147,6 +147,7 @@
 	utils_str.c		\
 	balance_estimate_config.c \
         balance_estimate_data.c \
+        balance_estimate_future.c \
         balance_estimate_hist.c \
 	balance_estimate_tab.c
 
@@ -158,6 +159,7 @@
 	barre_outils.h		\
         balance_estimate_config.h \
         balance_estimate_data.h \
+        balance_estimate_future.h \
         balance_estimate_hist.h \
         balance_estimate_tab.h  \
 	categories_onglet.h	\
@@ -305,7 +307,7 @@
 	gsb_real_cunit.h	\
 	utils_dates_cunit.h
 
-grisbi_SOURCES = $(sources) $(sources_config) $(grisbi_INCLUDES)
+grisbi_SOURCES = $(sources) $(sources_config) $(grisbi_INCLUDES)  
 
 if HAVE_CUNIT
 grisbi_SOURCES += $(cunit_sources)

Index: gsb_payment_method.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_payment_method.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gsb_payment_method.c	13 Jan 2010 20:42:31 -0000	1.21
+++ gsb_payment_method.c	16 Mar 2010 11:48:43 -0000	1.22
@@ -164,8 +164,7 @@
 
                     gsb_form_entry_get_focus (cheque_entry);
                     
-                    tmpstr = utils_str_itoa ( gsb_data_payment_get_last_number (
-                                payment_number ) + 1);
+                    tmpstr = gsb_data_payment_incremente_last_number ( payment_number, 1 );
                     gtk_entry_set_text ( GTK_ENTRY (cheque_entry), tmpstr);
                     g_free ( tmpstr );
                     gtk_widget_show (cheque_entry);
@@ -413,8 +412,7 @@
 				gchar* tmpstr;
 
                 gsb_form_entry_get_focus (cheque_entry);
-                tmpstr = utils_str_itoa (gsb_data_payment_get_last_number (
-                            payment_number) + 1);
+                tmpstr = gsb_data_payment_incremente_last_number ( payment_number, 1 );
                 gtk_entry_set_text ( GTK_ENTRY (cheque_entry), tmpstr);
                 g_free ( tmpstr );
             }

Index: balance_estimate_hist.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_hist.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- balance_estimate_hist.h	13 Mar 2010 21:06:58 -0000	1.7
+++ balance_estimate_hist.h	16 Mar 2010 11:48:42 -0000	1.8
@@ -1,26 +1,3 @@
-/* ************************************************************************** */
-/*                                                                            */
-/*     Copyright (C) 2007 Dominique Parisot                                   */
-/*          zionly at free.org                                                   */
-/*          2008-2010 Pierre Biava (grisbi at pierre.biava.name)                 */
-/*          http://www.grisbi.org                                             */
-/*                                                                            */
-/*  This program is free software; you can redistribute it and/or modify      */
-/*  it under the terms of the GNU General Public License as published by      */
-/*  the Free Software Foundation; either version 2 of the License, or         */
-/*  (at your option) any later version.                                       */
-/*                                                                            */
-/*  This program is distributed in the hope that it will be useful,           */
-/*  but WITHOUT ANY WARRANTY; without even the implied warranty of            */
-/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
-/*  GNU General Public License for more details.                              */
-/*                                                                            */
-/*  You should have received a copy of the GNU General Public License         */
-/*  along with this program; if not, write to the Free Software               */
-/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-/*                                                                            */
-/* ************************************************************************** */
-
 #ifndef _BALANCE_ESTIMATE_HIST_H
 #define _BALANCE_ESTIMATE_HIST_H
 

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -d -r1.213 -r1.214
--- gsb_file_load.c	13 Mar 2010 21:06:58 -0000	1.213
+++ gsb_file_load.c	16 Mar 2010 11:48:43 -0000	1.214
@@ -1875,7 +1875,7 @@
                         "Current_number" ))
     {
         gsb_data_payment_set_last_number ( payment_number,
-                        utils_str_atoi (attribute_values[i]));
+                         attribute_values[i] );
         i++;
         continue;
     }
@@ -4941,7 +4941,7 @@
         if ( !strcmp ( attribute_names[i],
                    "No_en_cours" ))
             gsb_data_payment_set_last_number ( payment_number,
-                                   utils_str_atoi (attribute_values[i]));
+                                    attribute_values[i] );
 
         i++;
         }

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -d -r1.159 -r1.160
--- gsb_file_save.c	13 Mar 2010 21:06:58 -0000	1.159
+++ gsb_file_save.c	16 Mar 2010 11:48:43 -0000	1.160
@@ -1146,7 +1146,9 @@
 	payment_number = gsb_data_payment_get_number (list_tmp -> data);
 
 	/* now we can fill the file content */
-	new_string = g_markup_printf_escaped ( "\t<Payment Number=\"%d\" Name=\"%s\" Sign=\"%d\" Show_entry=\"%d\" Automatic_number=\"%d\" Current_number=\"%d\" Account=\"%d\" />\n",
+	new_string = g_markup_printf_escaped ( 
+                           "\t<Payment Number=\"%d\" Name=\"%s\" Sign=\"%d\" Show_entry=\"%d\""
+                           "Automatic_number=\"%d\" Current_number=\"%s\" Account=\"%d\" />\n",
 					       payment_number,
                            my_safe_null_str(gsb_data_payment_get_name (payment_number)),
 					       gsb_data_payment_get_sign (payment_number),

Index: gsb_scheduler.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_scheduler.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- gsb_scheduler.c	9 Jan 2010 20:57:38 -0000	1.28
+++ gsb_scheduler.c	16 Mar 2010 11:48:43 -0000	1.29
@@ -298,25 +298,25 @@
 	{
 	    if (gsb_data_payment_get_automatic_numbering (payment_number))
 	    {
-		gint number;
 		gchar* tmpstr;
 
-		number = gsb_data_payment_get_last_number (payment_number) + 1;
-		tmpstr = utils_str_itoa (number);
+		tmpstr = gsb_data_payment_incremente_last_number ( payment_number, 1 );
 		gsb_data_transaction_set_method_of_payment_content ( transaction_number,
 								     tmpstr);
-		g_free ( tmpstr );
-		gsb_data_payment_set_last_number ( payment_number, number );
+		gsb_data_payment_set_last_number ( payment_number, tmpstr );
+        g_free ( tmpstr );
 	    }
 	    else
 		gsb_data_transaction_set_method_of_payment_content ( transaction_number,
-								     gsb_data_scheduled_get_method_of_payment_content (scheduled_number) );
+								     gsb_data_scheduled_get_method_of_payment_content (
+                                     scheduled_number ) );
 	}
     }
     else
     {
 	gsb_data_transaction_set_method_of_payment_content ( transaction_number,
-							     gsb_data_scheduled_get_method_of_payment_content (scheduled_number) );
+							     gsb_data_scheduled_get_method_of_payment_content (
+                                 scheduled_number ) );
     }
     gsb_data_transaction_set_automatic_transaction ( transaction_number,
 						     gsb_data_scheduled_get_automatic_scheduled (scheduled_number));

Index: balance_estimate_data.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_data.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- balance_estimate_data.c	13 Mar 2010 21:06:58 -0000	1.13
+++ balance_estimate_data.c	16 Mar 2010 11:48:42 -0000	1.14
@@ -918,15 +918,19 @@
         gtk_widget_show ( page );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 2 );
         gtk_widget_show ( page );
+        page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 3 );
+        gtk_widget_show ( page );
         bet_array_update_estimate_tab ( );
         break;
     case GSB_TYPE_LIABILITIES:
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 1 );
         gtk_widget_show ( page );
-        if ( current_page == 2 )
+        if ( current_page == 2 || current_page == 3 )
             gtk_notebook_set_current_page ( GTK_NOTEBOOK ( notebook ), 1 );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 2 );
         gtk_widget_hide ( page );
+        page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 3 );
+        gtk_widget_hide ( page );
         bet_array_update_estimate_tab ( );
         break;
     case GSB_TYPE_ASSET:
@@ -936,6 +940,8 @@
         gtk_widget_hide ( page );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 2 );
         gtk_widget_hide ( page );
+        page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( notebook ), 3 );
+        gtk_widget_hide ( page );
         break;
     }
 }

Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- balance_estimate_tab.c	15 Mar 2010 20:29:47 -0000	1.54
+++ balance_estimate_tab.c	16 Mar 2010 11:48:42 -0000	1.55
@@ -446,7 +446,7 @@
     devel_debug (NULL);
     notebook = g_object_get_data ( G_OBJECT ( notebook_general ), "account_notebook");
     page = gtk_vbox_new ( FALSE, 5 );
-    g_object_set_data ( G_OBJECT ( notebook ), "bet_account_duration", page );
+    gtk_widget_set_name ( page, "bet_array_page" );
 
     /* create the title */
     align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);

--- NEW FILE: balance_estimate_future.c ---
/* ************************************************************************** */
/*                                                                            */
/*     Copyright (C) 2007 Dominique Parisot                                   */
/*          zionly at free.org                                                   */
/*          2008-2010 Pierre Biava (grisbi at pierre.biava.name)                 */
/*          http://www.grisbi.org                                             */
/*                                                                            */
/*  This program is free software; you can redistribute it and/or modify      */
/*  it under the terms of the GNU General Public License as published by      */
/*  the Free Software Foundation; either version 2 of the License, or         */
/*  (at your option) any later version.                                       */
/*                                                                            */
/*  This program is distributed in the hope that it will be useful,           */
/*  but WITHOUT ANY WARRANTY; without even the implied warranty of            */
/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
/*  GNU General Public License for more details.                              */
/*                                                                            */
/*  You should have received a copy of the GNU General Public License         */
/*  along with this program; if not, write to the Free Software               */
/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
/*                                                                            */
/* ************************************************************************** */

/* ./configure --with-balance-estimate */

#include "include.h"
#include <config.h>

#ifdef ENABLE_BALANCE_ESTIMATE

/*START_INCLUDE*/
#include "balance_estimate_future.h"
#include "./balance_estimate_tab.h"
#include "./balance_estimate_config.h"
#include "./balance_estimate_data.h"
#include "./balance_estimate_hist.h"
#include "./utils_dates.h"
#include "./gsb_data_account.h"
#include "./gsb_data_budget.h"
#include "./gsb_calendar_entry.h"
#include "./gsb_data_category.h"
#include "./gsb_data_fyear.h"
#include "./gsb_data_payee.h"
#include "./gsb_data_scheduled.h"
#include "./gsb_data_transaction.h"
#include "./gsb_fyear.h"
#include "./gsb_real.h"
#include "./gsb_scheduler.h"
#include "./gsb_transactions_list_sort.h"
#include "./main.h"
#include "./mouse.h"
#include "./navigation.h"
#include "./include.h"
#include "./structures.h"
#include "./traitement_variables.h"
#include "./erreur.h"
#include "./utils.h"
/*END_INCLUDE*/


/*START_STATIC*/

/*END_STATIC*/

/*START_EXTERN*/
extern gboolean balances_with_scheduled;
extern gchar* bet_duration_array[];
extern GdkColor couleur_fond[0];
extern GdkColor couleur_bet_division;
extern GtkWidget *notebook_general;
extern gsb_real null_real;
extern GtkWidget *window;
/*END_EXTERN*/


/**
 *
 *
 *
 *
 * */
GtkWidget *bet_future_create_page ( void )
{
    GtkWidget *notebook;
    GtkWidget *page;
    //~ GtkWidget *widget = NULL;
    //~ GtkWidget *initial_date = NULL;
    //~ GtkWidget *hbox;
    GtkWidget *align;
    GtkWidget *label;
    //~ GtkWidget *spin_button = NULL;
    //~ GtkWidget *previous = NULL;
    //~ GtkWidget *scrolled_window;
    //~ GtkWidget *tree_view;
    //~ GtkTreeStore *tree_model;
    //~ GtkTreeModel *sortable;
    //~ GtkCellRenderer *cell;
    //~ GtkTreeViewColumn *column;
    //~ gint iduration;

    devel_debug (NULL);
    notebook = g_object_get_data ( G_OBJECT ( notebook_general ), "account_notebook");
    page = gtk_vbox_new ( FALSE, 5 );
    gtk_widget_set_name ( page, "bet_future_page" );

    /* create the title */
    align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
    gtk_box_pack_start ( GTK_BOX ( page ), align, FALSE, FALSE, 5) ;

    label = gtk_label_new ("Future data");
    gtk_container_add ( GTK_CONTAINER ( align ), label );
    g_object_set_data ( G_OBJECT ( notebook ), "bet_future_title", label );


    gtk_widget_show_all ( page );

    return page;
}



/**
 *
 *
 *
 *
 * */
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
#endif /* ENABLE_BALANCE_ESTIMATE */

Index: balance_estimate_hist.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_hist.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- balance_estimate_hist.c	14 Mar 2010 19:42:26 -0000	1.17
+++ balance_estimate_hist.c	16 Mar 2010 11:48:42 -0000	1.18
@@ -138,6 +138,7 @@
     devel_debug (NULL);
     notebook = g_object_get_data ( G_OBJECT ( notebook_general ), "account_notebook");
     page = gtk_vbox_new ( FALSE, 5 );
+    gtk_widget_set_name ( page, "bet_historical_page" );
 
     /* titre de la page */
     align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
@@ -1294,10 +1295,10 @@
 
 
 /**
+ * Cette fonction compare le montant de la colonne montant retenu avec le montant 
+ * de la colonne moyenne
  *
- *
- *
- *
+ * \ return O si egal -1 ou 1 si différent
  * */
 gboolean bet_historical_amount_differ_average ( GtkTreeModel *model,
                         GtkTreeIter *iter )



More information about the cvs mailing list