[grisbi-cvs] grisbi/src gsb_data_transaction.c, 1.75, 1.76 gsb_data_transaction.h, 1.34, 1.35 transaction_list.c, 1.50, 1.51

Pierre Biava pbiava at users.sourceforge.net
Sat Nov 28 20:58:15 CET 2009


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

Modified Files:
	gsb_data_transaction.c gsb_data_transaction.h 
	transaction_list.c 
Log Message:
fixed bug 756

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- gsb_data_transaction.c	22 Nov 2009 08:32:00 -0000	1.75
+++ gsb_data_transaction.c	28 Nov 2009 19:58:12 -0000	1.76
@@ -630,7 +630,27 @@
 }
 
 
+/**
+ * get the value GDate of the transaction or the date if not exist
+ *
+ * \param transaction_number the number of the transaction
+ *
+ * \return the GDate of the transaction
+ * */
+const GDate *gsb_data_transaction_get_value_date_or_date ( gint transaction_number )
+{
+    struct_transaction *transaction;
 
+    transaction = gsb_data_transaction_get_transaction_by_no ( transaction_number);
+
+    if ( !transaction )
+	return NULL;
+
+    if ( transaction -> value_date )
+        return transaction -> value_date;
+    else
+        return transaction -> date;
+}
 
 
 /**

Index: gsb_data_transaction.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- gsb_data_transaction.h	26 Oct 2009 22:38:21 -0000	1.34
+++ gsb_data_transaction.h	28 Nov 2009 19:58:12 -0000	1.35
@@ -64,6 +64,7 @@
 GSList *gsb_data_transaction_get_transactions_list ( void );
 GSList *gsb_data_transaction_get_transactions_list_by_date ( void );
 const GDate *gsb_data_transaction_get_value_date ( gint transaction_number );
+const GDate *gsb_data_transaction_get_value_date_or_date ( gint transaction_number );
 const gchar *gsb_data_transaction_get_voucher ( gint transaction_number );
 gint gsb_data_transaction_get_white_line ( gint transaction_number );
 gboolean gsb_data_transaction_init_variables ( void );

Index: transaction_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/transaction_list.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- transaction_list.c	2 Oct 2009 21:35:04 -0000	1.50
+++ transaction_list.c	28 Nov 2009 19:58:12 -0000	1.51
@@ -1983,12 +1983,15 @@
     gint i, j;
     gint res;
     gint transaction_number;
+    gint element_sort;
     CustomList *custom_list;
 
     custom_list = transaction_model_get_model ();
     g_return_if_fail ( custom_list != NULL );
 
     date_jour = gdate_today ( );
+    element_sort = gsb_data_account_get_element_sort ( account_number,
+							     custom_list -> sort_col);
 
     for (i= custom_list -> num_visibles_rows -1; i >= 0  ; i--)
     {
@@ -2002,8 +2005,14 @@
                         record -> transaction_pointer);
             if ( transaction_number > 0 )
             {
-                res = g_date_compare ( date_jour,
+                if ( element_sort == 2 )
+                    res = g_date_compare ( date_jour,
+                        gsb_data_transaction_get_value_date_or_date (
+                         transaction_number ) );
+                else
+                    res = g_date_compare ( date_jour,
                         gsb_data_transaction_get_date ( transaction_number ) );
+
                 if ( res >= 0 )
                 {
                     /* colorize the record */



More information about the cvs mailing list