[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_100-3-gd08ec5a

Pierre Biava nobody at users.sourceforge.net
Sun Feb 20 18:12:09 CET 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, master has been updated
       via  d08ec5adea8585556a8a0ccf61b19fa64b969cf4 (commit)
      from  d8eb9e3e3188250498df0893f7d37b2bde053a39 (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 d08ec5adea8585556a8a0ccf61b19fa64b969cf4
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 20 10:37:12 2011 +0100

    fixes a bug in the management of cash balances

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

Changes:
diff --git a/src/bet_future.c b/src/bet_future.c
index 4977c1e..3c037f6 100644
--- a/src/bet_future.c
+++ b/src/bet_future.c
@@ -1868,7 +1868,7 @@ dialog_return:
         }
         else if ( bet_transfert_take_data (  transfert, bet_transfert_dialog ) == FALSE )
         {
-            tmp_str = g_strdup ( _("Error: the frequency defined by the user or the amount is "
+            tmp_str = g_strdup ( _("Error:  the category or the budgetary line is "
                                  "not specified or the date is invalid.") );
             dialogue_warning_hint ( tmp_str, _("One field is not filled in") );
             g_free ( tmp_str );
@@ -2292,24 +2292,6 @@ gboolean bet_transfert_take_data (  struct_transfert_data *transfert, GtkWidget
     else
         return FALSE;
 
-    widget = g_object_get_data ( G_OBJECT ( dialog ), "bet_transfert_category_combo" );
-    if ( gsb_form_widget_check_empty( widget ) == FALSE )
-        bet_future_get_category_data ( widget, 1, ( gpointer ) transfert );
-    else
-    {
-        transfert -> category_number = 0;
-        transfert -> sub_category_number = 0;
-    }
-   
-    widget = g_object_get_data ( G_OBJECT ( dialog ), "bet_transfert_budget_combo" );
-    if ( gsb_form_widget_check_empty( widget ) == FALSE )
-        bet_future_get_budget_data ( widget, 1, ( gpointer ) transfert );
-    else
-    {
-        transfert -> budgetary_number = 0;
-        transfert -> sub_budgetary_number = 0;
-    }
-
     widget = g_object_get_data ( G_OBJECT ( dialog ), "bet_transfert_auto_inc" );
     transfert -> auto_inc_month = gtk_toggle_button_get_active (
                         GTK_TOGGLE_BUTTON ( widget ) );
@@ -2317,7 +2299,28 @@ gboolean bet_transfert_take_data (  struct_transfert_data *transfert, GtkWidget
     widget = g_object_get_data ( G_OBJECT ( dialog ), "bet_transfert_replace_data" );
     transfert -> replace_transaction = gtk_toggle_button_get_active (
                         GTK_TOGGLE_BUTTON ( widget ) );
-    
+
+    if ( transfert -> replace_transaction )
+    {
+        gboolean empty = TRUE;
+
+        widget = g_object_get_data ( G_OBJECT ( dialog ), "bet_transfert_category_combo" );
+        if ( gsb_form_widget_check_empty( widget ) == FALSE )
+        {
+            bet_future_get_category_data ( widget, 1, ( gpointer ) transfert );
+            empty = FALSE;
+        }
+       
+        widget = g_object_get_data ( G_OBJECT ( dialog ), "bet_transfert_budget_combo" );
+        if ( gsb_form_widget_check_empty( widget ) == FALSE )
+        {
+            bet_future_get_budget_data ( widget, 1, ( gpointer ) transfert );
+            empty = FALSE;
+        }
+
+        if ( empty )
+            return FALSE;
+    }
     return TRUE;
 }
 
@@ -2415,7 +2418,7 @@ dialog_return:
         }
         else if ( bet_transfert_take_data (  transfert, bet_transfert_dialog ) == FALSE )
         {
-            tmp_str = g_strdup ( _("Error: the frequency defined by the user or the amount is "
+            tmp_str = g_strdup ( _("Error:  the category or the budgetary line is "
                                  "not specified or the date is invalid.") );
             dialogue_warning_hint ( tmp_str, _("One field is not filled in") );
             g_free ( tmp_str );
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 5a3d2b4..96304c7 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -2641,7 +2641,8 @@ gboolean bet_array_refresh_transfert_data ( GtkTreeModel *tab_model,
                         SPP_ESTIMATE_TREE_AMOUNT_COLUMN, str_amount,
                         -1);
 
-        bet_array_list_replace_planned_line_by_transfert ( tab_model, transfert );
+        if (  transfert -> replace_transaction )
+            bet_array_list_replace_planned_line_by_transfert ( tab_model, transfert );
         g_value_unset ( &date_value );
         g_free ( str_date );
         g_free ( str_description );
@@ -2715,8 +2716,8 @@ gboolean bet_array_list_replace_planned_line_by_transfert ( GtkTreeModel *tab_mo
             if ( transfert -> category_number )
             {
                 /* on cherche une opération par sa catégorie */
-                gint tmp_category_number;
-                gint tmp_sub_category_number;
+                gint tmp_category_number = 0;
+                gint tmp_sub_category_number = 0;
 
                 tmp_category_number = gsb_data_scheduled_get_category_number ( scheduled_number );
                 if ( transfert -> sub_category_number )


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list