[grisbi-cvs] grisbi/src affichage.c, 1.162, 1.163 affichage_liste.c, 1.109, 1.110 affichage_liste.h, 1.13, 1.14 fenetre_principale.h, 1.27, 1.28 gsb_data_transaction.c, 1.66, 1.67 gsb_data_transaction.h, 1.30, 1.31 gsb_file_config.c, 1.77, 1.78 gsb_file_load.c, 1.182, 1.183 gsb_file_save.c, 1.132, 1.133 gsb_form_transaction.c, 1.43, 1.44 gsb_reconcile.c, 1.39, 1.40 gsb_transactions_list.c, 1.173, 1.174 gsb_transactions_list.h, 1.35, 1.36 import.c, 1.281, 1.282 structures.h, 1.228, 1.229 traitement_variables.h, 1.17, 1.18 transaction_list.c, 1.42, 1.43 transaction_list.h, 1.8, 1.9

Pierre Biava pbiava at users.sourceforge.net
Wed Jun 17 21:39:53 CEST 2009


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

Modified Files:
	affichage.c affichage_liste.c affichage_liste.h 
	fenetre_principale.h gsb_data_transaction.c 
	gsb_data_transaction.h gsb_file_config.c gsb_file_load.c 
	gsb_file_save.c gsb_form_transaction.c gsb_reconcile.c 
	gsb_transactions_list.c gsb_transactions_list.h import.c 
	structures.h traitement_variables.h transaction_list.c 
	transaction_list.h 
Log Message:
Fixed a bug in the selection of the last transaction giving the balance today and add functionality requested in bug 470

Index: structures.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/structures.h,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -d -r1.228 -r1.229
--- structures.h	14 Jun 2009 19:02:20 -0000	1.228
+++ structures.h	17 Jun 2009 19:39:51 -0000	1.229
@@ -59,6 +59,7 @@
     gint show_transaction_selected_in_form; /* TRUE will show the selected transaction in the form */
     gint show_transaction_gives_balance;    /* TRUE si on visualise l'opération qui donne le solde du jour */
     gint affichage_exercice_automatique;    /* automatic fyear :0 to set according to the date, 2 according to value date */
+    gint automatic_completion_payee;        /* 1 pour autoriser la completion automatique des opérations */
     gboolean limit_completion_to_current_account;   /** Limit payee *
                             completion to
                             current account,

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- gsb_data_transaction.c	14 Jun 2009 19:02:20 -0000	1.66
+++ gsb_data_transaction.c	17 Jun 2009 19:39:51 -0000	1.67
@@ -98,13 +98,10 @@
 
 
 /*START_STATIC*/
-static gint classement_sliste_transaction_par_date ( struct_transaction *transaction_1,
-                        struct_transaction *transaction_2 );
 static void gsb_data_transaction_delete_all_transactions ( void );
 static  void gsb_data_transaction_free ( struct_transaction *transaction);
-static gint gsb_data_transaction_get_last_white_number ( void );
-static struct_transaction *gsb_data_transaction_get_transaction_by_no (
-                        gint transaction_number );
+static gint gsb_data_transaction_get_last_white_number (void);
+static struct_transaction *gsb_data_transaction_get_transaction_by_no ( gint transaction_number );
 static gboolean gsb_data_transaction_save_transaction_pointer ( gpointer transaction );
 /*END_STATIC*/
 
@@ -2542,66 +2539,6 @@
     }
     return FALSE;
 }
-
-
-
-/**
- * retourne la dernière opération à ou immédiatement avant la date du jour
- *
- * \param 
- *
- * \return transaction_number;
- * */
-gint gsb_data_transaction_get_last_transaction_before_today_day ( gint no_account )
-{
-    gint transaction_number = 0;
-    gint res;
-    GDate *date_jour = g_date_new ( );
-    GSList *tmp_list;
-    struct_transaction *transaction;
-
-    g_date_set_time_t (date_jour, time (NULL));
-
-    tmp_list = g_slist_sort ( transactions_list,
-                    ( GCompareFunc ) classement_sliste_transaction_par_date ) ;
-    while (tmp_list)
-    {
-        transaction = tmp_list -> data;
-
-        if ( transaction -> account_number == no_account )
-        {
-            res = g_date_compare ( transaction -> date, date_jour );
-            if ( res == 0 )
-                return transaction -> transaction_number;
-            else if ( res == 1 )
-                return transaction_number;
-            else
-                transaction_number = transaction -> transaction_number;
-        }
-        tmp_list = tmp_list -> next;
-    }
-    
-    return transaction_number;
-}
-
-/**
- * Fonction de comparaison de deux opérations par date puis par numéro
- *
- * */
-gint classement_sliste_transaction_par_date ( struct_transaction *transaction_1,
-                        struct_transaction *transaction_2 )
-{
-    gint transaction_number_1;
-    gint transaction_number_2;
-    gint res;
-
-    transaction_number_1 = transaction_1 -> transaction_number;
-    transaction_number_2 = transaction_2 -> transaction_number;
-
-    res = g_date_compare ( gsb_data_transaction_get_date ( transaction_number_1 ),
-                        gsb_data_transaction_get_date ( transaction_number_2 ) );
-    if ( res == 0 )
-        return ( transaction_number_1 < transaction_number_2 ? -1: 1 );
-    else
-        return res;
-}
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */

Index: gsb_transactions_list.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- gsb_transactions_list.h	21 May 2009 21:58:55 -0000	1.35
+++ gsb_transactions_list.h	17 Jun 2009 19:39:51 -0000	1.36
@@ -58,8 +58,6 @@
 GtkWidget *gsb_transactions_list_get_tree_view (void);
 gchar *gsb_transactions_list_grep_cell_content ( gint transaction_number,
                         gint cell_content_number );
-gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
-                        GdkEventKey *ev );
 GtkWidget *gsb_transactions_list_make_gui_list ( void );
 gboolean gsb_transactions_list_restore_archive ( gint archive_number,
                         gboolean show_warning );
@@ -67,7 +65,7 @@
 gboolean gsb_transactions_list_set_row_align ( gfloat row_align );
 void gsb_transactions_list_set_visible_rows_number ( gint rows_number );
 void gsb_transactions_list_splitted_to_scheduled ( gint transaction_number,
-						   gint scheduled_number );
+                        gint scheduled_number );
 gboolean gsb_transactions_list_switch_expander ( gint transaction_number );
 gboolean gsb_transactions_list_transaction_visible ( gpointer transaction_ptr,
                         gint account_number,

Index: traitement_variables.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/traitement_variables.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- traitement_variables.h	14 Jun 2009 19:02:20 -0000	1.17
+++ traitement_variables.h	17 Jun 2009 19:39:51 -0000	1.18
@@ -11,9 +11,9 @@
 #define BG_COLOR_2_BLUE     65535
 
 /* couleur du jour */
-#define BG_COLOR_TODAY_RED      0
-#define BG_COLOR_TODAY_GREEN    65535
-#define BG_COLOR_TODAY_BLUE     15000
+#define BG_COLOR_TODAY_RED      55512
+#define BG_COLOR_TODAY_GREEN    55512
+#define BG_COLOR_TODAY_BLUE     55512
 
 /* text color */
 #define TEXT_COLOR_1_RED    0

Index: gsb_form_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_transaction.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- gsb_form_transaction.c	8 May 2009 09:35:10 -0000	1.43
+++ gsb_form_transaction.c	17 Jun 2009 19:39:51 -0000	1.44
@@ -72,7 +72,7 @@
 gboolean gsb_form_transaction_complete_form_by_payee ( const gchar *payee_name )
 {
     gint payee_number;
-    gint transaction_number;
+    gint transaction_number = 0;
     gint account_number;
     GSList *tmp_list;
 
@@ -117,6 +117,7 @@
 	return TRUE;
 
     /* find the last transaction with that payee */
+    if ( etat.automatic_completion_payee )
     transaction_number = gsb_form_transactions_look_for_last_party ( payee_number,
 								     0,
 								     account_number );

Index: affichage_liste.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/affichage_liste.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- affichage_liste.c	14 Jun 2009 19:02:20 -0000	1.109
+++ affichage_liste.c	17 Jun 2009 19:39:50 -0000	1.110
@@ -445,71 +445,72 @@
 {
     GtkWidget *vbox_pref, *hbox, *label, *entry;
 
-    vbox_pref = new_vbox_with_title_and_icon ( _("Form completion"),
-					       "form.png" );
+    vbox_pref = new_vbox_with_title_and_icon ( _("Form completion"), "form.png" );
 
     gtk_box_pack_start ( GTK_BOX ( vbox_pref ),
-			 gsb_automem_checkbutton_new (_("Limit payee completion to current account"),
-						      &etat.limit_completion_to_current_account,
-						      NULL, NULL),
-			 FALSE, FALSE, 0 );
+                        gsb_automem_checkbutton_new (_("Automatic completion of the payees"),
+                        &etat.automatic_completion_payee,
+                        NULL, NULL),
+                        FALSE, FALSE, 0 );
+
+    gtk_box_pack_start ( GTK_BOX ( vbox_pref ),
+                        gsb_automem_checkbutton_new (
+                        _("Limit the filling with payees belonging to the current account"),
+                        &etat.limit_completion_to_current_account,
+                        NULL, NULL),
+                        FALSE, FALSE, 0 );
 
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
-			 gsb_automem_checkbutton_new (_("Mix credit/debit categories"),
-						      &etat.combofix_mixed_sort,
-						      G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
-			 FALSE, FALSE, 0 );
-    gtk_box_pack_start ( GTK_BOX (vbox_pref),
-			 gsb_automem_checkbutton_new (_("Case sensitive completion"),
-						      &etat.combofix_case_sensitive,
-						      G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
-			 FALSE, FALSE, 0 );
+                        gsb_automem_checkbutton_new (_("Mix credit/debit categories"),
+                        &etat.combofix_mixed_sort,
+                        G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
+                        FALSE, FALSE, 0 );
+
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
-			 gsb_automem_checkbutton_new (_("Enter keeps current completion"),
-						      &etat.combofix_enter_select_completion,
-						      G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
-			 FALSE, FALSE, 0 );
+                        gsb_automem_checkbutton_new (_("Case sensitive completion"),
+                        &etat.combofix_case_sensitive,
+                        G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
+                        FALSE, FALSE, 0 );
 
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
-			 gsb_automem_checkbutton_new (_("Don't allow new payee creation"),
-						      &etat.combofix_force_payee,
-						      G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
-			 FALSE, FALSE, 0 );
+                        gsb_automem_checkbutton_new (_("Enter keeps current completion"),
+                        &etat.combofix_enter_select_completion,
+                        G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
+                        FALSE, FALSE, 0 );
 
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
-			 gsb_automem_checkbutton_new (_("Don't allow new category/budget creation"),
-						      &etat.combofix_force_category,
-						      G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
-			 FALSE, FALSE, 0 );
+                        gsb_automem_checkbutton_new (_("Don't allow new payee creation"),
+                        &etat.combofix_force_payee,
+                        G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
+                        FALSE, FALSE, 0 );
 
-    hbox = gtk_hbox_new ( FALSE,
-			  5 );
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
-			 hbox,
-			 FALSE, FALSE, 0 );
+                        gsb_automem_checkbutton_new (_("Don't allow new category/budget creation"),
+                        &etat.combofix_force_category,
+                        G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
+                        FALSE, FALSE, 0 );
 
-    label = gtk_label_new (COLON(_("Maximum items showed in drop down lists (0 for no limit)")));
-    gtk_box_pack_start ( GTK_BOX (hbox),
-			 label,
-			 FALSE, FALSE, 0 );
+    hbox = gtk_hbox_new ( FALSE, 5 );
+    gtk_box_pack_start ( GTK_BOX (vbox_pref), hbox, FALSE, FALSE, 0 );
+
+    label = gtk_label_new (
+                        COLON (_("Maximum items showed in drop down lists (0 for no limit)") ) );
+    gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0 );
 
     entry = gtk_entry_new ();
-    gtk_widget_set_size_request ( entry,
-			   30, -1 );
+    gtk_widget_set_size_request ( entry, 30, -1 );
     gchar* tmpstr = utils_str_itoa (etat.combofix_max_item);
     gtk_entry_set_text ( GTK_ENTRY (entry), tmpstr);
     g_free ( tmpstr );
     g_signal_connect ( G_OBJECT (entry),
-		       "changed",
-		       G_CALLBACK (gsb_transactions_list_display_change_max_items),
-		       NULL );
-    gtk_box_pack_start ( GTK_BOX (hbox),
-			 entry,
-			 FALSE, FALSE, 0 );
+                        "changed",
+                        G_CALLBACK (gsb_transactions_list_display_change_max_items),
+                        NULL );
+    gtk_box_pack_start ( GTK_BOX (hbox), entry, FALSE, FALSE, 0 );
     
     if ( !gsb_data_account_get_accounts_amount () )
     {
-	gtk_widget_set_sensitive ( vbox_pref, FALSE );
+        gtk_widget_set_sensitive ( vbox_pref, FALSE );
     }
 
     return vbox_pref;

Index: gsb_transactions_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list.c,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -d -r1.173 -r1.174
--- gsb_transactions_list.c	14 Jun 2009 21:41:10 -0000	1.173
+++ gsb_transactions_list.c	17 Jun 2009 19:39:51 -0000	1.174
@@ -44,7 +44,6 @@
 #include "./gsb_form.h"
 #include "./gsb_form_transaction.h"
 #include "./utils_dates.h"
-#include "./fenetre_principale.h"
 #include "./navigation.h"
 #include "./barre_outils.h"
 #include "./menu.h"
@@ -89,6 +88,8 @@
 static GtkWidget *gsb_transactions_list_create_tree_view ( GtkTreeModel *model );
 static void gsb_transactions_list_create_tree_view_columns ( void );
 static gboolean gsb_transactions_list_fill_model ( void );
+static gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
+                        GdkEventKey *ev );
 static gboolean gsb_transactions_list_move_transaction_to_account ( gint transaction_number,
                         gint target_account );
 static void gsb_transactions_list_set_tree_view (GtkWidget *tree_view);

Index: gsb_data_transaction.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- gsb_data_transaction.h	14 Jun 2009 19:02:20 -0000	1.30
+++ gsb_data_transaction.h	17 Jun 2009 19:39:51 -0000	1.31
@@ -49,7 +49,6 @@
 gsb_real gsb_data_transaction_get_exchange_rate ( gint transaction_number );
 gint gsb_data_transaction_get_financial_year_number ( gint transaction_number );
 gint gsb_data_transaction_get_last_number (void);
-gint gsb_data_transaction_get_last_transaction_before_today_day ( gint no_account );
 gint gsb_data_transaction_get_marked_transaction ( gint transaction_number );
 const gchar *gsb_data_transaction_get_method_of_payment_content ( gint transaction_number );
 gint gsb_data_transaction_get_method_of_payment_number ( gint transaction_number );

Index: affichage.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/affichage.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- affichage.c	14 Jun 2009 19:02:19 -0000	1.162
+++ affichage.c	17 Jun 2009 19:39:50 -0000	1.163
@@ -81,14 +81,14 @@
 extern GdkColor archive_background_color;
 extern GdkColor calendar_entry_color;
 extern GdkColor couleur_fond[2];
-extern GdkColor couleur_jour;
 extern GdkColor couleur_grise;
+extern GdkColor couleur_jour;
 extern GdkColor couleur_selection;
 extern GdkColor default_archive_background_color;
 extern GdkColor default_calendar_entry_color;
 extern GdkColor default_couleur_fond[2];
-extern GdkColor default_couleur_jour;
 extern GdkColor default_couleur_grise;
+extern GdkColor default_couleur_jour;
 extern GdkColor default_couleur_selection;
 extern GdkColor default_split_background;
 extern GdkColor default_text_color[2];

Index: gsb_reconcile.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_reconcile.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- gsb_reconcile.c	14 Jun 2009 21:41:10 -0000	1.39
+++ gsb_reconcile.c	17 Jun 2009 19:39:51 -0000	1.40
@@ -49,7 +49,6 @@
 #include "./gsb_transactions_list.h"
 #include "./gsb_data_transaction.h"
 #include "./include.h"
-#include "./erreur.h"
 #include "./gsb_real.h"
 /*END_INCLUDE*/
 

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.281
retrieving revision 1.282
diff -u -d -r1.281 -r1.282
--- import.c	13 Jun 2009 15:10:43 -0000	1.281
+++ import.c	17 Jun 2009 19:39:51 -0000	1.282
@@ -2236,7 +2236,7 @@
     gint payee_number = 0;
     gint fyear = 0;
     gint last_transaction_number;
-    gint category_number;
+    gint div_number;
 
     /* we create the new transaction */
     transaction_number = gsb_data_transaction_new_transaction ( account_number );
@@ -2356,26 +2356,24 @@
         last_transaction_number = gsb_form_transactions_look_for_last_party (
                                     payee_number, transaction_number,
                                     account_number );
-        category_number = gsb_data_transaction_get_category_number (
+        div_number = gsb_data_transaction_get_category_number (
                                     last_transaction_number );
-        if ( category_number != -1 )
-            gsb_data_transaction_set_category_number ( transaction_number,
-                                category_number );
-        category_number = gsb_data_transaction_get_sub_category_number (
+        if ( div_number != -1 )
+            gsb_data_transaction_set_category_number ( transaction_number, div_number );
+
+        div_number = gsb_data_transaction_get_sub_category_number (
                                 last_transaction_number );
-        if ( category_number != -1 )
-            gsb_data_transaction_set_sub_category_number ( transaction_number,
-                                category_number );
-        category_number = gsb_data_transaction_get_budgetary_number (
-                                    last_transaction_number );
-        if ( category_number != -1 )
-            gsb_data_transaction_set_budgetary_number ( transaction_number,
-                                category_number );
-        category_number = gsb_data_transaction_get_sub_budgetary_number (
+        if ( div_number != -1 )
+            gsb_data_transaction_set_sub_category_number ( transaction_number, div_number );
+
+        div_number = gsb_data_transaction_get_budgetary_number ( last_transaction_number );
+        if ( div_number != -1 )
+            gsb_data_transaction_set_budgetary_number ( transaction_number, div_number );
+
+        div_number = gsb_data_transaction_get_sub_budgetary_number (
                                 last_transaction_number );
-        if ( category_number != -1 )
-            gsb_data_transaction_set_sub_budgetary_number ( transaction_number,
-                                category_number );
+        if ( div_number != -1 )
+            gsb_data_transaction_set_sub_budgetary_number ( transaction_number, div_number );
     }
 	else
 	{

Index: fenetre_principale.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/fenetre_principale.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- fenetre_principale.h	11 Jun 2009 20:51:55 -0000	1.27
+++ fenetre_principale.h	17 Jun 2009 19:39:51 -0000	1.28
@@ -23,8 +23,8 @@
 
 /* START_DECLARATION */
 GtkWidget * create_main_widget ( void );
-void gsb_gui_headings_update_title ( gchar * title );
 void gsb_gui_headings_update_suffix ( gchar * suffix );
+void gsb_gui_headings_update_title ( gchar * title );
 void gsb_gui_notebook_change_page ( GsbGeneralNotebookPages page );
 void gsb_gui_sensitive_headings ( gboolean sensitive );
 gboolean gsb_gui_update_show_headings ();

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- gsb_file_load.c	14 Jun 2009 19:02:20 -0000	1.182
+++ gsb_file_load.c	17 Jun 2009 19:39:51 -0000	1.183
@@ -154,8 +154,8 @@
 extern GdkColor archive_background_color;
 extern GdkColor calendar_entry_color;
 extern GdkColor couleur_fond[2];
-extern GdkColor couleur_jour;
 extern GdkColor couleur_grise;
+extern GdkColor couleur_jour;
 extern GdkColor couleur_selection;
 extern gint display_one_line;
 extern gint display_three_lines;

Index: transaction_list.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/transaction_list.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- transaction_list.h	14 Jun 2009 19:02:20 -0000	1.8
+++ transaction_list.h	17 Jun 2009 19:39:51 -0000	1.9
@@ -21,9 +21,9 @@
 void transaction_list_set_color_jour ( gint account_number );
 gboolean transaction_list_show_toggle_mark ( gboolean show );
 gboolean transaction_list_update_cell ( gint cell_col,
-					gint cell_line );
+                        gint cell_line );
 gboolean transaction_list_update_column ( gint column,
-					  GValue *value );
+                        GValue *value );
 gboolean transaction_list_update_element ( gint element_number );
 gboolean transaction_list_update_transaction ( gint transaction_number );
 /* END_DECLARATION */

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- gsb_file_save.c	14 Jun 2009 19:02:20 -0000	1.132
+++ gsb_file_save.c	17 Jun 2009 19:39:51 -0000	1.133
@@ -123,6 +123,7 @@
                         gulong *length_calculated,
                         gchar **file_content,
                         gint archive_number );
+static const gchar *my_safe_null_str ( const gchar *string );
 /*END_STATIC*/
 
 
@@ -135,8 +136,8 @@
 extern GdkColor calendar_entry_color;
 extern gchar *copy_old_filename;
 extern GdkColor couleur_fond[2];
-extern GdkColor couleur_jour;
 extern GdkColor couleur_grise;
+extern GdkColor couleur_jour;
 extern GdkColor couleur_selection;
 extern gint display_one_line;
 extern gint display_three_lines;

Index: transaction_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/transaction_list.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- transaction_list.c	14 Jun 2009 19:02:20 -0000	1.42
+++ transaction_list.c	17 Jun 2009 19:39:51 -0000	1.43
@@ -2044,22 +2044,19 @@
  * */
 void transaction_list_set_color_jour ( gint account_number )
 {
-    gint i;
-    gint number_jour;
+    GDate *date_jour = g_date_new ( );
+    gint i, j;
+    gint res;
     gint transaction_number;
     CustomList *custom_list;
-
     devel_debug (NULL);
 
-    number_jour = gsb_data_transaction_get_last_transaction_before_today_day (
-                        account_number );
-    if ( number_jour <= 1 )
-        return;
-
     custom_list = transaction_model_get_model ();
     g_return_if_fail ( custom_list != NULL );
 
-    for (i=0 ; i < custom_list -> num_visibles_rows ; i++)
+    g_date_set_time_t (date_jour, time (NULL));
+
+    for (i= custom_list -> num_visibles_rows -1; i >= 0  ; i--)
     {
         CustomRecord *record;
 
@@ -2069,11 +2066,24 @@
         {
             transaction_number = gsb_data_transaction_get_transaction_number (
                         record -> transaction_pointer);
-            if ( number_jour == transaction_number )
+            if ( transaction_number > 0 )
             {
-                /* set the color of the row */
-                record -> row_bg = &couleur_jour;
-            }            
+                res = g_date_compare ( date_jour,
+                        gsb_data_transaction_get_date ( transaction_number ) );
+                if ( res >= 0 )
+                {
+                    /* colorize the record */
+                    for (j=0 ; j < custom_list -> nb_rows_by_transaction ; j++)
+                    {
+                        record -> row_bg = &couleur_jour;
+                        i--;
+                        record = custom_list -> visibles_rows[i];
+                    }
+                    /* on se positionne sur la première ligne */
+                    record = custom_list -> visibles_rows[0];
+                    break;
+                }
+            }
         }
     }
 }

Index: gsb_file_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_config.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- gsb_file_config.c	14 Jun 2009 19:02:20 -0000	1.77
+++ gsb_file_config.c	17 Jun 2009 19:39:51 -0000	1.78
@@ -50,10 +50,10 @@
 static gchar *gsb_config_get_old_conf_name ( void );
 static void gsb_file_config_clean_config ( void );
 static void gsb_file_config_get_xml_text_element ( GMarkupParseContext *context,
-					     const gchar *text,
-					     gsize text_len,  
-					     gpointer user_data,
-					     GError **error);
+                        const gchar *text,
+                        gsize text_len,  
+                        gpointer user_data,
+                        GError **error);
 static gboolean gsb_file_config_load_last_xml_config ( gchar *filename );
 static  void gsb_file_config_remove_old_config_file ( gchar *filename );
 /*END_STATIC*/
@@ -95,6 +95,8 @@
     gboolean result;
     gchar *filename;
     gint i;
+    gint int_ret;
+    GError* err = NULL;
     
     gsb_file_config_clean_config ();
 
@@ -323,6 +325,16 @@
                         "Display",
                         "Show automatic financial year",
                         NULL );
+    
+    int_ret = g_key_file_get_integer ( config,
+                        "Display",
+                        "Automatic completion payee",
+                        &err );
+    if ( err == NULL )
+        etat.automatic_completion_payee = int_ret;
+    else
+        err = NULL;
+        
 
     etat.limit_completion_to_current_account = g_key_file_get_integer ( config,
                         "Display",
@@ -639,6 +651,11 @@
 
     g_key_file_set_integer ( config,
                         "Display",
+                        "Automatic completion payee",
+                        etat.automatic_completion_payee );
+
+    g_key_file_set_integer ( config,
+                        "Display",
                         "Limit payee completion",
                         etat.limit_completion_to_current_account );
 
@@ -1174,6 +1191,7 @@
     etat.formulaire_toujours_affiche = 0;       /* le formulaire ne s'affiche que lors de l'edition d'1 opé */
     etat.affichage_exercice_automatique = 0;        /* l'exercice est choisi en fonction de la date */
     etat.get_fyear_by_value_date = 0;        /* By default use transaction-date */
+    etat.automatic_completion_payee = 1;        /* by default automatic completion */
     etat.limit_completion_to_current_account = 0;        /* By default, do full search */
 
     etat.display_grisbi_title = GSB_ACCOUNTS_FILE;  /* show Accounts file title par défaut */

Index: affichage_liste.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/affichage_liste.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- affichage_liste.h	27 Oct 2008 23:16:51 -0000	1.13
+++ affichage_liste.h	17 Jun 2009 19:39:50 -0000	1.14
@@ -7,7 +7,7 @@
 
 /* START_DECLARATION */
 gboolean display_mode_check_line ( gint line_in_transaction,
-				   gint visibles_lines );
+                        gint visibles_lines );
 GtkWidget *onglet_affichage_operations ( void );
 GtkWidget *onglet_diverse_form_and_lists ( void );
 GtkWidget *onglet_form_completion ( void );



More information about the cvs mailing list