[grisbi-cvs] [SCM] grisbi branch, grisbi-1.0.x, updated. upstream_version_0_9_5-230-gf000ea9

Pierre Biava nobody at users.sourceforge.net
Tue Jan 1 18:00:44 CET 2013


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-1.0.x has been updated
       via  f000ea93cc63032ceb015e509b5be76e2bd44919 (commit)
      from  492dba3b6763a86248f1a0cb2b41bca35d49b035 (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 f000ea93cc63032ceb015e509b5be76e2bd44919
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Jan 1 17:57:52 2013 +0100

    fixed a bug with the transition to the new exercise

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

Changes:
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 2113c37..6508d5a 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -3133,23 +3133,29 @@ void gsb_form_take_datas_from_form ( gint transaction_number,
 		break;
 
 	    case TRANSACTION_FORM_EXERCICE:
-		if (conf.affichage_exercice_automatique && value_date)
+        if ( is_transaction )
         {
-            if ( gsb_form_widget_check_empty ( gsb_form_widget_get_widget (
-             TRANSACTION_FORM_VALUE_DATE) ) )
-                gsb_data_mix_set_financial_year_number ( transaction_number,
-                        gsb_fyear_get_fyear_from_combobox (
-                        element -> element_widget, date ), is_transaction );
+            if ( conf.affichage_exercice_automatique )
+            {
+                if ( gsb_form_widget_check_empty ( gsb_form_widget_get_widget (
+                 TRANSACTION_FORM_VALUE_DATE) ) )
+                    gsb_data_transaction_set_financial_year_number ( transaction_number,
+                            gsb_fyear_get_fyear_from_combobox (
+                            element -> element_widget, date ) );
+                else
+                    gsb_data_transaction_set_financial_year_number ( transaction_number,
+                            gsb_fyear_get_fyear_from_combobox (
+                            element -> element_widget, value_date ) );
+            }
             else
-                gsb_data_mix_set_financial_year_number ( transaction_number,
-                        gsb_fyear_get_fyear_from_combobox (
-                        element -> element_widget, value_date ), is_transaction );
+                gsb_data_transaction_set_financial_year_number ( transaction_number,
+                            gsb_fyear_get_fyear_from_combobox (
+                            element -> element_widget, date ) );
         }
-		else
-		    gsb_data_mix_set_financial_year_number ( transaction_number,
+        else
+            gsb_data_scheduled_set_financial_year_number ( transaction_number,
                         gsb_fyear_get_fyear_from_combobox (
-                        element -> element_widget, date ), is_transaction);
-
+                        element -> element_widget, NULL ) );
             break;
 
 	    case TRANSACTION_FORM_PARTY:
diff --git a/src/gsb_form_widget.c b/src/gsb_form_widget.c
index 4ac2995..c23b69a 100644
--- a/src/gsb_form_widget.c
+++ b/src/gsb_form_widget.c
@@ -755,7 +755,6 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
                         GdkEventFocus *ev,
                         gint *ptr_origin )
 {
-    GtkWidget *fyear_button;
     GtkWidget *widget;
     GtkWidget *tmp_widget;
     gint element_number;
@@ -780,15 +779,6 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
 
     switch ( element_number )
     {
-    case TRANSACTION_FORM_DATE:
-    case TRANSACTION_FORM_VALUE_DATE:
-        /* set the financial year on automatic by default */
-        fyear_button = gsb_form_widget_get_widget (TRANSACTION_FORM_EXERCICE);
-        if ( fyear_button
-         &&
-         gsb_data_account_get_current_transaction_number (account_number) == -1 )
-            gsb_fyear_set_combobox_history ( fyear_button, 0 );
-        break;
     case TRANSACTION_FORM_DEBIT :
         /* on met old_debit = NULl car avec g_free plantage */
         if ( old_debit && strlen ( old_debit ) > 0 )
diff --git a/src/gsb_scheduler.c b/src/gsb_scheduler.c
index 3f40696..c05380a 100644
--- a/src/gsb_scheduler.c
+++ b/src/gsb_scheduler.c
@@ -316,13 +316,12 @@ gint gsb_scheduler_create_transaction_from_scheduled_transaction ( gint schedule
 						    gsb_data_scheduled_get_sub_budgetary_number (scheduled_number));
 
     /* if the financial year is automatic, we set it here */
-
-    if ( gsb_data_scheduled_get_financial_year_number (scheduled_number) == -2 )
-	gsb_data_transaction_set_financial_year_number ( transaction_number,
-							 gsb_data_fyear_get_from_date ( gsb_data_transaction_get_date (transaction_number)));
+    if ( gsb_data_scheduled_get_financial_year_number ( scheduled_number ) == 0 )
+        gsb_data_transaction_set_financial_year_number ( transaction_number,
+    				    gsb_data_fyear_get_from_date ( gsb_data_transaction_get_date ( transaction_number ) ) );
     else
-	gsb_data_transaction_set_financial_year_number ( transaction_number,
-							 gsb_data_scheduled_get_financial_year_number (scheduled_number));
+        gsb_data_transaction_set_financial_year_number ( transaction_number,
+    				    gsb_data_scheduled_get_financial_year_number ( scheduled_number ) );
 
     /* get the category */
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list