[grisbi-cvs] [SCM] grisbi branch, grisbi-0.8.x, updated. upstream_version_0_8_4-6-g7b3223e

Pierre Biava nobody at users.sourceforge.net
Mon Apr 4 22:45:28 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, grisbi-0.8.x has been updated
       via  7b3223e25116920826a0bee72ae9398dc06c9caa (commit)
      from  175195364d43c8f5164b798634d187f2bbba1a6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7b3223e25116920826a0bee72ae9398dc06c9caa
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Apr 4 22:29:39 2011 +0200

    fixed a bug in creation of payees and creation of a sub-budgetary line

-----------------------------------------------------------------------

Changes:
diff --git a/src/gsb_data_budget.c b/src/gsb_data_budget.c
index 1a91a13..27b9797 100644
--- a/src/gsb_data_budget.c
+++ b/src/gsb_data_budget.c
@@ -721,16 +721,18 @@ gint gsb_data_budget_get_sub_budget_number_by_name ( gint budget_number,
 
     if ( list_tmp )
     {
-	struct_sub_budget *sub_budget;
+        struct_sub_budget *sub_budget;
 
-	sub_budget = list_tmp -> data;
-	sub_budget_number = sub_budget -> sub_budget_number;
+        sub_budget = list_tmp -> data;
+        sub_budget_number = sub_budget -> sub_budget_number;
     }
     else
     {
-	if (create)
-	    sub_budget_number = gsb_data_budget_new_sub_budget ( budget_number,
-								 name);
+        if ( create )
+        {
+            sub_budget_number = gsb_data_budget_new_sub_budget ( budget_number, name );
+            gsb_budget_update_combofix ( FALSE );
+        }
     }
     return sub_budget_number;
 }
@@ -1528,53 +1530,51 @@ void gsb_data_budget_set_budget_from_string ( gint transaction_number,
      * but the 2 parts are exactly the same, exept the call to the functions */
     if (is_transaction)
     {
-	if (!string || strlen ( string ) == 0 )
-	{
-	    gsb_data_transaction_set_budgetary_number ( transaction_number, 0 );
-	    gsb_data_transaction_set_sub_budgetary_number ( transaction_number, 0 );
-	    return;
-	}
+        if (!string || strlen ( string ) == 0 )
+        {
+            gsb_data_transaction_set_budgetary_number ( transaction_number, 0 );
+            gsb_data_transaction_set_sub_budgetary_number ( transaction_number, 0 );
+            return;
+        }
+
+        tab_char = g_strsplit ( string, " : ", 2 );
 
-	tab_char = g_strsplit ( string,
-				" : ",
-				2 );
-
-	/* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
-	budget_number = gsb_data_budget_get_number_by_name ( g_strstrip (tab_char[0]),
-							     TRUE,
-							     gsb_data_transaction_get_amount (transaction_number).mantissa <0 );
-	gsb_data_transaction_set_budgetary_number ( transaction_number,
-						    budget_number );
-    if ( tab_char[1] )
-        gsb_data_transaction_set_sub_budgetary_number ( transaction_number,
-							gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
-													g_strstrip (tab_char[1]),
-													TRUE ));
+        /* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
+        budget_number = gsb_data_budget_get_number_by_name ( g_strstrip ( tab_char[0] ),
+                                TRUE,
+                                gsb_data_transaction_get_amount ( transaction_number ).mantissa < 0 );
+        gsb_data_transaction_set_budgetary_number ( transaction_number, budget_number );
+
+        if ( tab_char[1] )
+            gsb_data_transaction_set_sub_budgetary_number ( transaction_number,
+                                gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
+                                                        g_strstrip (tab_char[1]),
+                                                        TRUE ));
     }
     else
     {
-	if (!string)
-	{
-	    gsb_data_scheduled_set_budgetary_number ( transaction_number, 0 );
-	    gsb_data_scheduled_set_sub_budgetary_number ( transaction_number, 0 );
-	    return;
-	}
+        if (!string)
+        {
+            gsb_data_scheduled_set_budgetary_number ( transaction_number, 0 );
+            gsb_data_scheduled_set_sub_budgetary_number ( transaction_number, 0 );
+            return;
+        }
 
-	tab_char = g_strsplit ( string,
-				" : ",
-				2 );
-
-	/* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
-	budget_number = gsb_data_budget_get_number_by_name ( tab_char[0],
-							     TRUE,
-							     gsb_data_scheduled_get_amount (transaction_number).mantissa <0 );
-	gsb_data_scheduled_set_budgetary_number ( transaction_number,
-						    budget_number );
-    if ( tab_char[1] )
-        gsb_data_scheduled_set_sub_budgetary_number ( transaction_number,
-						      gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
-												      tab_char[1],
-												      TRUE ));
+        tab_char = g_strsplit ( string,
+                    " : ",
+                    2 );
+
+        /* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
+        budget_number = gsb_data_budget_get_number_by_name ( tab_char[0],
+                                     TRUE,
+                                     gsb_data_scheduled_get_amount (transaction_number).mantissa <0 );
+        gsb_data_scheduled_set_budgetary_number ( transaction_number,
+                                budget_number );
+        if ( tab_char[1] )
+            gsb_data_scheduled_set_sub_budgetary_number ( transaction_number,
+                                  gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
+                                                          tab_char[1],
+                                                          TRUE ));
     }
     g_strfreev (tab_char);
 }
diff --git a/src/gsb_data_payee.c b/src/gsb_data_payee.c
index 00e7d9e..1f814b4 100644
--- a/src/gsb_data_payee.c
+++ b/src/gsb_data_payee.c
@@ -354,31 +354,28 @@ gint gsb_data_payee_set_new_number ( gint no_payee,
  * \return the number of the payee or 0 if problem
  * */
 gint gsb_data_payee_get_number_by_name ( const gchar *name,
-					 gboolean create )
+                        gboolean create )
 {
     GSList *list_tmp;
     gint payee_number = 0;
 
     list_tmp = g_slist_find_custom ( payee_list,
-				     name,
-				     (GCompareFunc) gsb_data_payee_get_pointer_from_name_in_glist );
+                        name,
+                        (GCompareFunc) gsb_data_payee_get_pointer_from_name_in_glist );
     
     if ( list_tmp )
     {
-	struct_payee *payee;
-	
-	payee = list_tmp -> data;
-	payee_number = payee -> payee_number;
+        struct_payee *payee;
+        
+        payee = list_tmp -> data;
+        payee_number = payee -> payee_number;
     }
     else
     {
-	if (create)
-	{
-	    payee_number = gsb_data_payee_new (name);
-	    gtk_combofix_append_text ( GTK_COMBOFIX (
-                        gsb_form_widget_get_widget ( TRANSACTION_FORM_PARTY ) ), name );
-;
-	}
+        if (create)
+        {
+            payee_number = gsb_data_payee_new ( name );
+        }
     }
     return payee_number;
 }


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list