[grisbi-cvs] grisbi/src gsb_archive_config.c, 1.27, 1.28 gsb_assistant_archive.c, 1.38, 1.39 gsb_currency_config.c, 1.56, 1.57 gsb_currency_config.h, 1.15, 1.16 gsb_data_budget.c, 1.51, 1.52 gsb_data_category.c, 1.70, 1.71 gsb_data_payee.c, 1.49, 1.50 gsb_data_transaction.c, 1.70, 1.71 gsb_file_config.c, 1.83, 1.84 gsb_file_load.c, 1.189, 1.190 gsb_file_save.c, 1.138, 1.139 import.c, 1.286, 1.287 import.h, 1.41, 1.42 metatree.c, 1.142, 1.143 parametres.c, 1.204, 1.205 parametres.h, 1.31, 1.32 structures.h, 1.232, 1.233 tiers_onglet.c, 1.165, 1.166 traitement_variables.c, 1.176, 1.177

Pierre Biava pbiava at users.sourceforge.net
Sun Aug 30 19:59:50 CEST 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1752/src

Modified Files:
	gsb_archive_config.c gsb_assistant_archive.c 
	gsb_currency_config.c gsb_currency_config.h gsb_data_budget.c 
	gsb_data_category.c gsb_data_payee.c gsb_data_transaction.c 
	gsb_file_config.c gsb_file_load.c gsb_file_save.c import.c 
	import.h metatree.c parametres.c parametres.h structures.h 
	tiers_onglet.c traitement_variables.c 
Log Message:
Correction of the balance of the payees, categories and budget lines to reflect transactions archived. It's an option. Minor changes

Index: structures.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/structures.h,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -d -r1.232 -r1.233
--- structures.h	24 Aug 2009 20:19:47 -0000	1.232
+++ structures.h	30 Aug 2009 17:59:48 -0000	1.233
@@ -67,10 +67,6 @@
     gint compress_file;     /* TRUE if we want to compress the grisbi file */
     gint compress_backup;   /* TRUE if we want to compress the backup */
 
-    /* archive stuff */
-    gint check_for_archival; /* TRUE if we want to check the number of non archived transactions at the opening */
-    gint max_non_archived_transactions_for_check; /* the max number of transaction before grisbi warm at the opening */
-
     gint formulaire_distinct_par_compte;  /* à 1 si le formulaire est différent pour chaque compte */
     gint affiche_nb_ecritures_listes;
     gint largeur_auto_colonnes;
@@ -139,7 +135,8 @@
                             * preview. */
 
     /* variables pour les metatree */
-    gint metatree_sort_transactions;
+    gint metatree_sort_transactions;        /* TRUE = sort transactions by date */
+    gint add_archive_in_total_balance;      /* Add transactions archived in the totals */
 } etat;
 
 struct {
@@ -154,6 +151,10 @@
     /* general part */
     gint r_modifiable;                              /* Changes in reconciled transactions */
 
+    /* archive stuff */
+    gint check_for_archival; /* TRUE if we want to check the number of non archived transactions at the opening */
+    gint max_non_archived_transactions_for_check; /* the max number of transaction before grisbi warm at the opening */
+
 } conf;
 
 /* structure définissant une association entre un tiers

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- gsb_data_transaction.c	13 Aug 2009 19:24:49 -0000	1.70
+++ gsb_data_transaction.c	30 Aug 2009 17:59:47 -0000	1.71
@@ -44,6 +44,7 @@
 #include "./gsb_real.h"
 #include "./utils_str.h"
 #include "./include.h"
+#include "./structures.h"
 #include "./gsb_real.h"
 /*END_INCLUDE*/
 
@@ -2551,7 +2552,11 @@
 {
     GSList *list_tmp;
 
-    list_tmp = g_slist_copy ( transactions_list );
+    if ( etat.add_archive_in_total_balance )
+        list_tmp = g_slist_copy ( complete_transactions_list );
+    else
+        list_tmp = g_slist_copy ( transactions_list );
+
     list_tmp = g_slist_sort (list_tmp, 
                         (GCompareFunc) classement_sliste_transactions_par_date );
     return list_tmp;

Index: gsb_data_payee.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_payee.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- gsb_data_payee.c	10 Jun 2009 20:14:55 -0000	1.49
+++ gsb_data_payee.c	30 Aug 2009 17:59:47 -0000	1.50
@@ -39,6 +39,7 @@
 #include "./utils_str.h"
 #include "./meta_payee.h"
 #include "./include.h"
+#include "./structures.h"
 #include "./gsb_real.h"
 #include "./erreur.h"
 /*END_INCLUDE*/
@@ -669,7 +670,10 @@
 
     gsb_data_payee_reset_counters ();
 
-    list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
+    if ( etat.add_archive_in_total_balance )
+        list_tmp_transactions = gsb_data_transaction_get_complete_transactions_list ();
+    else
+        list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
 
     while ( list_tmp_transactions )
     {

Index: gsb_assistant_archive.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_archive.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- gsb_assistant_archive.c	29 Aug 2009 08:36:41 -0000	1.38
+++ gsb_assistant_archive.c	30 Aug 2009 17:59:47 -0000	1.39
@@ -133,7 +133,7 @@
 				     "You can still export them into a separate archive file if necessary.\n\n" 
 				     "Press Cancel if you don't want make an archive now\n"),
 				   g_slist_length (gsb_data_transaction_get_transactions_list ()),
-				   etat.max_non_archived_transactions_for_check );
+				   conf.max_non_archived_transactions_for_check );
     else
 	/* come by menu action */
 	tmpstr = my_strdup (_("This assistant will guide you through the process of archiving transactions "

Index: parametres.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.c,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -d -r1.204 -r1.205
--- parametres.c	29 Aug 2009 08:36:41 -0000	1.204
+++ parametres.c	30 Aug 2009 17:59:48 -0000	1.205
@@ -63,8 +63,6 @@
 
 /*START_STATIC*/
 static GtkWidget * create_preferences_tree ( );
-static gboolean gsb_config_metatree_sort_transactions ( GtkWidget *checkbutton,
-                        gpointer null );
 static  GtkWidget *gsb_config_scheduler_page ( void );
 static gboolean gsb_config_scheduler_switch_balances_with_scheduled ( void );
 static gboolean gsb_gui_messages_toggled ( GtkCellRendererToggle *cell, gchar *path_str,

Index: traitement_variables.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/traitement_variables.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- traitement_variables.c	24 Aug 2009 11:54:22 -0000	1.176
+++ traitement_variables.c	30 Aug 2009 17:59:48 -0000	1.177
@@ -319,10 +319,6 @@
     etat.combofix_force_payee = FALSE;
     etat.combofix_force_category = FALSE;
     
-    /* archive stuff */
-    etat.check_for_archival = TRUE;
-    etat.max_non_archived_transactions_for_check = 3000;
-
     /* defaut value for width of columns */
     for ( i = 0 ; i < CUSTOM_MODEL_VISIBLE_COLUMNS ; i++ )
     transaction_col_width[i] = transaction_col_width_init[i];
@@ -348,6 +344,8 @@
     text_color[1] = default_text_color[1];
     calendar_entry_color = default_calendar_entry_color;
 
+    etat.add_archive_in_total_balance = TRUE;   /* add the archived transactions by default */
+
     /* remove the timeout if necessary */
     if (id_timeout)
     {

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- gsb_file_save.c	24 Aug 2009 19:30:04 -0000	1.138
+++ gsb_file_save.c	30 Aug 2009 17:59:48 -0000	1.139
@@ -692,7 +692,8 @@
 					   "\t\tAutomatic_amount_separator=\"%d\"\n"
 					   "\t\tCSV_separator=\"%s\"\n"
 					   "\t\tCSV_skipped_lines=\"%s\"\n"
-					   "\t\tMetatree_sort_transactions=\"%d\" />\n",
+					   "\t\tMetatree_sort_transactions=\"%d\"\n"
+					   "\t\tAdd_archive_in_total_balance=\"%d\" />\n",
 	my_safe_null_str(VERSION_FICHIER),
 	my_safe_null_str(VERSION),
 	etat.crypt_file,
@@ -729,7 +730,8 @@
 	etat.automatic_separator,
 	my_safe_null_str(etat.csv_separator),
 	my_safe_null_str(skipped_lines_string),
-    etat.metatree_sort_transactions );
+    etat.metatree_sort_transactions,
+    etat.add_archive_in_total_balance );
 
     g_free (transactions_view);
     g_free (scheduler_column_width_write);

Index: parametres.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- parametres.h	23 Aug 2009 16:45:05 -0000	1.31
+++ parametres.h	30 Aug 2009 17:59:48 -0000	1.32
@@ -37,6 +37,8 @@
 /*START_DECLARATION*/
 gboolean gsb_config_backup_dir_chosen ( GtkWidget *button,
                         GtkWidget *dialog );
+gboolean gsb_config_metatree_sort_transactions ( GtkWidget *checkbutton,
+                        gpointer null );
 gboolean gsb_gui_encryption_toggled ( GtkWidget * checkbox, gpointer data );
 gboolean gsb_preferences_menu_open ( GtkWidget *menu_item,
                         gpointer page_ptr );

Index: gsb_data_budget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_budget.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- gsb_data_budget.c	8 Aug 2009 18:28:01 -0000	1.51
+++ gsb_data_budget.c	30 Aug 2009 17:59:47 -0000	1.52
@@ -37,6 +37,7 @@
 #include "./gsb_real.h"
 #include "./utils_str.h"
 #include "./include.h"
+#include "./structures.h"
 #include "./gsb_real.h"
 #include "./erreur.h"
 /*END_INCLUDE*/
@@ -1248,7 +1249,10 @@
 
     gsb_data_budget_reset_counters ();
 
-    list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
+    if ( etat.add_archive_in_total_balance )
+        list_tmp_transactions = gsb_data_transaction_get_complete_transactions_list ();
+    else
+        list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
 
     while ( list_tmp_transactions )
     {

Index: gsb_currency_config.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency_config.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gsb_currency_config.h	29 Aug 2009 20:26:02 -0000	1.15
+++ gsb_currency_config.h	30 Aug 2009 17:59:47 -0000	1.16
@@ -53,18 +53,18 @@
 
 /* START_DECLARATION */
 gboolean gsb_currency_config_add_currency ( GtkWidget *button,
-					    GtkTreeModel *currency_tree_model );
+                        GtkTreeModel *currency_tree_model );
 gboolean gsb_currency_config_add_currency_set_combobox ( GtkWidget * button,
-							 GtkWidget * combobox );
+                        GtkWidget * combobox );
 GtkWidget *gsb_currency_config_create_box_popup ( GCallback select_callback );
 gint gsb_currency_config_create_currency ( const gchar *currency_name,
-					   const gchar *currency_code,
-					   const gchar *currency_isocode,
-					   gint floating_point );
+                        const gchar *currency_code,
+                        const gchar *currency_isocode,
+                        gint floating_point );
 gint gsb_currency_config_create_currency_from_iso4217list ( gchar *currency_name );
 GtkWidget *gsb_currency_config_create_page ( void );
 GtkWidget *gsb_currency_config_create_totals_page ( void );
 gboolean gsb_currency_config_select_default ( GtkTreeModel * tree_model, GtkTreePath * path,
-					      GtkTreeIter * iter, GtkTreeView * tree_view );
+                        GtkTreeIter * iter, GtkTreeView * tree_view );
 /* END_DECLARATION */
 #endif

Index: gsb_archive_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_archive_config.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- gsb_archive_config.c	29 Aug 2009 08:36:41 -0000	1.27
+++ gsb_archive_config.c	30 Aug 2009 17:59:47 -0000	1.28
@@ -241,7 +241,7 @@
 						    _("Automatic check"));
 
     button = gsb_automem_checkbutton_new ( _("Check at opening if creating archive is needed."),
-					   &etat.check_for_archival,
+					   &conf.check_for_archival,
 					   NULL, NULL );
     gtk_box_pack_start ( GTK_BOX (check_paddingbox),
 			 button,
@@ -259,7 +259,7 @@
 			 label,
 			 FALSE, FALSE,
 			 0 );
-    entry = gsb_automem_spin_button_new (&etat.max_non_archived_transactions_for_check,
+    entry = gsb_automem_spin_button_new (&conf.max_non_archived_transactions_for_check,
 					 NULL, NULL );
     gtk_widget_set_size_request ( entry,
 			   100, -1 );

Index: gsb_data_category.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_category.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- gsb_data_category.c	27 Jun 2009 19:17:53 -0000	1.70
+++ gsb_data_category.c	30 Aug 2009 17:59:47 -0000	1.71
@@ -38,6 +38,7 @@
 #include "./utils_str.h"
 #include "./include.h"
 #include "./erreur.h"
+#include "./structures.h"
 #include "./gsb_real.h"
 /*END_INCLUDE*/
 
@@ -670,8 +671,8 @@
     if (tab_char[0])
     {
 	category_number = gsb_data_category_get_number_by_name ( tab_char[0],
-								 TRUE,
-								 gsb_data_mix_get_amount (transaction_number, is_transaction).mantissa <0 );
+                        TRUE,
+                        gsb_data_mix_get_amount (transaction_number, is_transaction).mantissa <0 );
 	gsb_data_mix_set_category_number ( transaction_number,
 					   category_number,
 					   is_transaction );
@@ -1340,18 +1341,23 @@
     devel_debug ( NULL );
     gsb_data_category_reset_counters ();
 
-    list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
+    if ( etat.add_archive_in_total_balance )
+        list_tmp_transactions = gsb_data_transaction_get_complete_transactions_list ();
+    else
+        list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
 
     while ( list_tmp_transactions )
     {
-	gint transaction_number_tmp;
-	transaction_number_tmp = gsb_data_transaction_get_transaction_number (list_tmp_transactions -> data);
+    gint transaction_number_tmp;
+    transaction_number_tmp = gsb_data_transaction_get_transaction_number (
+                        list_tmp_transactions -> data );
 
-	gsb_data_category_add_transaction_to_category ( transaction_number_tmp,
-							gsb_data_transaction_get_category_number ( transaction_number_tmp ),
-							gsb_data_transaction_get_sub_category_number ( transaction_number_tmp ) );
+    gsb_data_category_add_transaction_to_category ( transaction_number_tmp,
+                        gsb_data_transaction_get_category_number ( transaction_number_tmp ),
+                        gsb_data_transaction_get_sub_category_number (
+                        transaction_number_tmp ) );
 
-	list_tmp_transactions = list_tmp_transactions -> next;
+    list_tmp_transactions = list_tmp_transactions -> next;
     }
 }
 

Index: metatree.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/metatree.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- metatree.c	24 Aug 2009 13:46:54 -0000	1.142
+++ metatree.c	30 Aug 2009 17:59:48 -0000	1.143
@@ -1104,8 +1104,6 @@
     gint no_division, no_sub_division;
     MetatreeInterface * iface;
 
-    devel_debug (NULL);
-
     /* Get model and metatree interface */
     model = gtk_tree_view_get_model(treeview);
 
@@ -1126,6 +1124,8 @@
 			     -1 );
     if ( etat.metatree_sort_transactions )
         list_tmp_transactions = gsb_data_transaction_get_transactions_list_by_date ();
+    else if ( etat.add_archive_in_total_balance )
+        list_tmp_transactions = gsb_data_transaction_get_complete_transactions_list ();
     else
         list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
 

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -d -r1.286 -r1.287
--- import.c	29 Aug 2009 20:26:02 -0000	1.286
+++ import.c	30 Aug 2009 17:59:48 -0000	1.287
@@ -38,8 +38,8 @@
 #include "./gsb_automem.h"
 #include "./utils_buttons.h"
 #include "./gsb_combo_box.h"
+#include "./gsb_currency_config.h"
 #include "./gsb_currency.h"
-#include "gsb_currency_config.h"
 #include "./gsb_data_account.h"
 #include "./gsb_data_category.h"
 #include "./gsb_data_currency.h"
@@ -93,7 +93,7 @@
                         GtkTreeModel *store );
 static void confirmation_enregistrement_ope_import ( struct struct_compte_importation *imported_account );
 static void cree_liens_virements_ope_import ( void );
-static GtkWidget * cree_ligne_recapitulatif ( struct struct_compte_importation * compte );
+static GtkWidget *cree_ligne_recapitulatif ( struct struct_compte_importation * compte );
 static gint gsb_import_add_currency ( struct struct_compte_importation * compte );
 static void gsb_import_add_imported_transactions ( struct struct_compte_importation *imported_account,
                         gint account_number );
@@ -127,9 +127,9 @@
 static gboolean import_account_action_activated ( GtkWidget * radio, gint action );
 static gboolean import_active_toggled ( GtkCellRendererToggle * cell, gchar *path_str,
                         gpointer model );
-static GtkWidget * import_create_file_selection_page ( GtkWidget * assistant );
-static GtkWidget * import_create_final_page ( GtkWidget * assistant );
-static GtkWidget * import_create_resume_page ( GtkWidget * assistant );
+static GtkWidget *import_create_file_selection_page ( GtkWidget * assistant );
+static GtkWidget *import_create_final_page ( GtkWidget * assistant );
+static GtkWidget *import_create_resume_page ( GtkWidget * assistant );
 static gboolean import_enter_file_selection_page ( GtkWidget * assistant );
 static gboolean import_enter_resume_page ( GtkWidget * assistant );
 static void import_preview_maybe_sensitive_next ( GtkWidget * assistant, GtkTreeModel * model );

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -d -r1.189 -r1.190
--- gsb_file_load.c	24 Aug 2009 20:19:46 -0000	1.189
+++ gsb_file_load.c	30 Aug 2009 17:59:47 -0000	1.190
@@ -71,8 +71,8 @@
 #include "./gsb_scheduler_list.h"
 #include "./include.h"
 #include "./gsb_calendar.h"
-#include "./erreur.h"
 #include "./structures.h"
+#include "./erreur.h"
 #include "./gsb_plugins.h"
 #include "./gsb_real.h"
 #include "./gsb_currency_config.h"
@@ -990,6 +990,11 @@
     {
         etat.metatree_sort_transactions = utils_str_atoi( attribute_values[i]);
     }
+    else if ( !strcmp ( attribute_names[i],
+                        "Add_archive_in_total_balance" ))
+    {
+        etat.add_archive_in_total_balance = utils_str_atoi( attribute_values[i]);
+    }
 
     i++;
     }
@@ -7875,8 +7880,8 @@
         /*
          * untill 0.6, no archive, so by default we let grisbi check at opening and set
          * the transactions limit to 3000 */
-        etat.check_for_archival = TRUE;
-        etat.max_non_archived_transactions_for_check = 3000;
+        conf.check_for_archival = TRUE;
+        conf.max_non_archived_transactions_for_check = 3000;
 
         /**
          * new in 0.6, there is no name for saving file but a directory
@@ -7939,10 +7944,10 @@
     /* check now if a lot of transactions,
      * if yes, we propose to file the transactions
      * by default take the 3000 transactions as limit */
-    if ( etat.check_for_archival
+    if ( conf.check_for_archival
      &&
      g_slist_length (gsb_data_transaction_get_transactions_list ()) > 
-     etat.max_non_archived_transactions_for_check )
+     conf.max_non_archived_transactions_for_check )
     gsb_assistant_archive_run (TRUE);
 
     /* if we opened an archive, we say it here */

Index: import.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- import.h	3 Apr 2009 19:42:11 -0000	1.41
+++ import.h	30 Aug 2009 17:59:48 -0000	1.42
@@ -120,7 +120,7 @@
 gboolean gsb_import_by_rule ( gint rule );
 void gsb_import_register_account ( struct struct_compte_importation * account );
 void gsb_import_register_account_error ( struct struct_compte_importation * account );
-GSList * import_selected_files ( GtkWidget * assistant );
+GSList *import_selected_files ( GtkWidget * assistant );
 void importer_fichier ( void );
 GtkWidget *onglet_importation (void);
 void register_import_format ( struct import_format * format );

Index: gsb_currency_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency_config.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- gsb_currency_config.c	29 Aug 2009 20:26:02 -0000	1.56
+++ gsb_currency_config.c	30 Aug 2009 17:59:47 -0000	1.57
@@ -31,6 +31,8 @@
 #include "gsb_currency_config.h"
 #include "./dialog.h"
 #include "./gsb_autofunc.h"
+#include "./gsb_automem.h"
+#include "./parametres.h"
 #include "./gsb_currency.h"
 #include "./gsb_data_account.h"
 #include "./gsb_data_currency.h"
@@ -51,24 +53,24 @@
 
 /*START_STATIC*/
 static void gsb_currency_append_currency_to_list ( GtkListStore *model,
-					    gint currency_number );
+                        gint currency_number );
 static GtkWidget *gsb_currency_config_create_list ();
 static gboolean gsb_currency_config_entry_changed ( GtkWidget *entry,
-					     GtkWidget *tree_view );
+                        GtkWidget *tree_view );
 static void gsb_currency_config_fill_popup_list ( GtkTreeView * tree_view,
-					   gboolean include_obsolete );
+                        gboolean include_obsolete );
 static gboolean gsb_currency_config_fill_tree ( GtkTreeModel *model );
 static gint gsb_currency_config_get_selected ( GtkTreeView *tree_view );
 static GtkWidget * gsb_currency_config_new_combobox ( gint * value, GCallback hook );
 static void gsb_currency_config_remove_currency ( GtkWidget *button,
-					   GtkWidget *tree_view );
+                        GtkWidget *tree_view );
 static void gsb_currency_config_remove_selected_from_view ( GtkTreeView * tree_view );
 static gboolean gsb_currency_config_select_currency ( GtkTreeSelection *selection,
-					       gpointer null );
+                        gpointer null );
 static gboolean gsb_currency_config_select_currency_popup ( GtkTreeSelection *selection, GtkTreeModel *model );
 static gboolean gsb_currency_config_set_int_from_combobox ( GtkWidget *combobox, gint * dummy);
 static gboolean gsb_currency_config_update_list ( GtkWidget * checkbox,
-					   GtkTreeView * tree_view );
+                        GtkTreeView * tree_view );
 /*END_STATIC*/
 
 /*START_EXTERN*/
@@ -809,9 +811,9 @@
  */
 GtkWidget *gsb_currency_config_create_totals_page ( void )
 {
-        GtkWidget *table, *label;
+    GtkWidget *table, *label, *check_button;
 
-    table = gtk_table_new ( 2, 2, FALSE );
+    table = gtk_table_new ( 4, 2, FALSE );
     gtk_table_set_col_spacings ( GTK_TABLE ( table ), 5 );
     gtk_table_set_row_spacings ( GTK_TABLE ( table ), 5 );
 
@@ -819,31 +821,38 @@
     gtk_misc_set_alignment (GTK_MISC (label), 0, 1);
     gtk_label_set_justify ( GTK_LABEL (label), GTK_JUSTIFY_LEFT );
     gtk_table_attach ( GTK_TABLE ( table ), label,
-		       0, 1, 0, 1, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+                        0, 1, 0, 1, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
     combo_devise_totaux_tiers = gsb_currency_config_new_combobox ( &no_devise_totaux_tiers,
-						   payee_fill_tree );
+                        payee_fill_tree );
     gtk_table_attach ( GTK_TABLE ( table ), combo_devise_totaux_tiers,
-		       1, 2, 0, 1, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+                        1, 2, 0, 1, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
 
     label = gtk_label_new (COLON(_("Currency for categories tree")));
     gtk_misc_set_alignment (GTK_MISC (label), 0, 1);
     gtk_label_set_justify ( GTK_LABEL (label), GTK_JUSTIFY_LEFT );
     gtk_table_attach ( GTK_TABLE ( table ), label,
-		       0, 1, 1, 2, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+                        0, 1, 1, 2, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
     combo_devise_totaux_categ = gsb_currency_config_new_combobox ( &no_devise_totaux_categ,
-					       remplit_arbre_categ );
+                        remplit_arbre_categ );
     gtk_table_attach ( GTK_TABLE ( table ), combo_devise_totaux_categ,
-		       1, 2, 1, 2, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+                        1, 2, 1, 2, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
 
     label = gtk_label_new (COLON(_("Currency for budgetary lines tree")));
     gtk_misc_set_alignment (GTK_MISC (label), 0, 1);
     gtk_label_set_justify ( GTK_LABEL (label), GTK_JUSTIFY_LEFT );
     gtk_table_attach ( GTK_TABLE ( table ), label,
-		       0, 1, 2, 3, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+                        0, 1, 2, 3, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
     combo_devise_totaux_ib = gsb_currency_config_new_combobox ( &no_devise_totaux_ib,
-					       remplit_arbre_imputation );
+                        remplit_arbre_imputation );
     gtk_table_attach ( GTK_TABLE ( table ), combo_devise_totaux_ib,
-		       1, 2, 2, 3, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+                        1, 2, 2, 3, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+
+    check_button = gsb_automem_checkbutton_new (
+                        _("Add transactions archived in the totals"),
+                        &(etat.add_archive_in_total_balance),
+                        G_CALLBACK ( gsb_config_metatree_sort_transactions ), NULL);
+    gtk_table_attach ( GTK_TABLE ( table ), check_button,
+                        0, 1, 3, 4, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
 
     return ( table );
 }

Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -d -r1.165 -r1.166
--- tiers_onglet.c	29 Aug 2009 08:36:41 -0000	1.165
+++ tiers_onglet.c	30 Aug 2009 17:59:48 -0000	1.166
@@ -31,9 +31,6 @@
 #include "include.h"
 #include "dialog.h"
 
-
-
-
 /*START_INCLUDE*/
 #include "tiers_onglet.h"
 #include "./dialog.h"
@@ -326,14 +323,6 @@
 				  SPACIFY(_("Edit selected payee")));
     gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_DELETE, _("Remove unused payees"),
-					   G_CALLBACK(payee_remove_unused),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  SPACIFY(_("Remove orphan payees")));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
     button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
 						GTK_STOCK_SELECT_COLOR,
 						_("View"),
@@ -351,6 +340,14 @@
 				  SPACIFY(_("Manage the payees")));
     gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					   GTK_STOCK_DELETE, _("Remove unused payees"),
+					   G_CALLBACK(payee_remove_unused),
+					   NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
+				  SPACIFY(_("Remove orphan payees")));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
     gtk_widget_show_all ( handlebox );
 
     metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL(payee_tree_model),
@@ -477,15 +474,18 @@
 
     while ( payee_list_tmp )
     {
-	gint payee_number;
-
-	payee_number = gsb_data_payee_get_no_payee (payee_list_tmp -> data);
+        gint payee_number;
 
-	gtk_tree_store_append (GTK_TREE_STORE (payee_tree_model), &iter_payee, NULL);
-	fill_division_row ( GTK_TREE_MODEL(payee_tree_model), payee_interface,
-			    &iter_payee, payee_number );
+        payee_number = gsb_data_payee_get_no_payee (payee_list_tmp -> data);
 
-	payee_list_tmp = payee_list_tmp -> next;
+        /* no display the payee without transactions (archived) */
+        if ( gsb_data_payee_get_nb_transactions ( payee_number ) )
+        {
+            gtk_tree_store_append (GTK_TREE_STORE (payee_tree_model), &iter_payee, NULL);
+            fill_division_row ( GTK_TREE_MODEL(payee_tree_model), payee_interface,
+                        &iter_payee, payee_number );
+        }
+        payee_list_tmp = payee_list_tmp -> next;
     }
 
     /* Reattach the model */

Index: gsb_file_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_config.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- gsb_file_config.c	24 Aug 2009 20:19:46 -0000	1.83
+++ gsb_file_config.c	30 Aug 2009 17:59:47 -0000	1.84
@@ -284,12 +284,12 @@
     else
         nom_fichier_comptes = NULL;
 
-    etat.check_for_archival = g_key_file_get_integer ( config, 
+    conf.check_for_archival = g_key_file_get_integer ( config, 
                         "IO",
                         "Check_archival_at_opening",
                         NULL );
 
-    etat.max_non_archived_transactions_for_check = g_key_file_get_integer ( config, 
+    conf.max_non_archived_transactions_for_check = g_key_file_get_integer ( config, 
                         "IO",
                         "Max_transactions_before_warn_archival",
                         NULL );
@@ -628,12 +628,12 @@
     g_key_file_set_integer ( config, 
                         "IO",
                         "Check_archival_at_opening",
-                        etat.check_for_archival );
+                        conf.check_for_archival );
 
     g_key_file_set_integer ( config, 
                         "IO",
                         "Max_transactions_before_warn_archival",
-                        etat.max_non_archived_transactions_for_check );
+                        conf.max_non_archived_transactions_for_check );
 
     /* save scheduled section */
     g_key_file_set_integer ( config,
@@ -1241,6 +1241,10 @@
     etat.compress_file = 0;
     etat.compress_backup = 0;
 
+    /* archive data */
+    conf.check_for_archival = TRUE;
+    conf.max_non_archived_transactions_for_check = 3000;
+
     etat.largeur_auto_colonnes = 0;
     etat.retient_affichage_par_compte = 0;
 



More information about the cvs mailing list