[grisbi-cvs] grisbi/src gsb_file_load.c, 1.195, 1.196 gsb_form.c, 1.138, 1.139 gsb_form_transaction.c, 1.51, 1.52

Pierre Biava pbiava at users.sourceforge.net
Sun Dec 13 21:08:34 CET 2009


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

Modified Files:
	gsb_file_load.c gsb_form.c gsb_form_transaction.c 
Log Message:
fixed bug 764

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- gsb_form.c	13 Dec 2009 17:23:44 -0000	1.138
+++ gsb_form.c	13 Dec 2009 20:08:31 -0000	1.139
@@ -840,7 +840,11 @@
 	    if (is_transaction)
         {
             if ( gsb_data_transaction_get_marked_transaction ( transaction_number ) == 3 )
+            {
                 gtk_widget_set_sensitive ( widget, FALSE );
+                gtk_widget_hide ( gsb_form_widget_get_widget (
+                            TRANSACTION_FORM_CHANGE ) );
+            }
         }
 	    break;
 

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -d -r1.195 -r1.196
--- gsb_file_load.c	13 Dec 2009 13:02:16 -0000	1.195
+++ gsb_file_load.c	13 Dec 2009 20:08:31 -0000	1.196
@@ -4783,10 +4783,9 @@
              * from 12.340000 to 12.34 before doing the conversion */
             gchar *tmp_string;
 
-            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i],
-                                         2 );
+            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_transaction_set_amount ( transaction_number,
-                                  gsb_real_import_from_string (tmp_string));
+                                  gsb_real_get_from_string (tmp_string));
             if (tmp_string) g_free (tmp_string);
         }
 
@@ -4803,12 +4802,12 @@
         if ( !strcmp ( attribute_names[i],
                    "Tc" ))
             gsb_data_transaction_set_exchange_rate ( transaction_number,
-                                     gsb_real_import_from_string (attribute_values[i]));
+                                     gsb_real_get_from_string (attribute_values[i]));
 
         if ( !strcmp ( attribute_names[i],
                    "Fc" ))
             gsb_data_transaction_set_exchange_fees ( transaction_number,
-                                     gsb_real_import_from_string (attribute_values[i]));
+                                     gsb_real_get_from_string (attribute_values[i]));
 
         if ( !strcmp ( attribute_names[i],
                    "T" ))
@@ -4955,10 +4954,9 @@
              * from 12.340000 to 12.34 before doing the conversion */
             gchar *tmp_string;
 
-            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i],
-                                         2 );
+            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_scheduled_set_amount ( scheduled_number,
-                                gsb_real_import_from_string (tmp_string));
+                                gsb_real_get_from_string (tmp_string));
             if (tmp_string) g_free (tmp_string);
         }
 
@@ -5314,7 +5312,7 @@
 
         if ( !strcmp ( attribute_names[i],
                    "Change" ))
-            tmp_currency_link.exchange = gsb_real_import_from_string (attribute_values[i]);
+            tmp_currency_link.exchange = gsb_real_get_from_string (attribute_values[i]);
         if ( !strcmp ( attribute_names[i], "Date_dernier_change" ) 
          &&
          strlen ( attribute_values[i] ) )
@@ -5679,10 +5677,9 @@
              * from 12.340000 to 12.34 before doing the conversion */
             gchar *tmp_string;
 
-            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i],
-                                         2 );
+            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_report_amount_comparison_set_first_amount ( amount_comparison_number,
-                                         gsb_real_import_from_string (tmp_string));
+                                         gsb_real_get_from_string (tmp_string));
             if (tmp_string) g_free (tmp_string);
         }
 
@@ -5693,10 +5690,9 @@
              * from 12.340000 to 12.34 before doing the conversion */
             gchar *tmp_string;
 
-            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i],
-                                         2 );
+            tmp_string = utils_str_reduce_exponant_from_string ( attribute_values[i], 2 );
             gsb_data_report_amount_comparison_set_second_amount ( amount_comparison_number,
-                                          gsb_real_import_from_string (tmp_string));
+                                          gsb_real_get_from_string (tmp_string));
             if (tmp_string) g_free (tmp_string);
         }
 
@@ -6117,11 +6113,12 @@
      * from 12.340000 to 12.34 before doing the conversion */
     gchar *tmp_string;
 
-    tmp_string = utils_str_reduce_exponant_from_string ( text,
-                                     2 );
+    tmp_string = utils_str_reduce_exponant_from_string ( text, 2 );
     gsb_data_account_set_init_balance ( account_number,
-                        gsb_real_import_from_string (tmp_string));
-    if (tmp_string) g_free (tmp_string);
+                        gsb_real_get_from_string ( tmp_string ));
+
+    if (tmp_string) 
+        g_free (tmp_string);
     return;
     }
 
@@ -6132,11 +6129,11 @@
      * from 12.340000 to 12.34 before doing the conversion */
     gchar *tmp_string;
 
-    tmp_string = utils_str_reduce_exponant_from_string ( text,
-                                     2 );
+    tmp_string = utils_str_reduce_exponant_from_string ( text, 2 );
     gsb_data_account_set_mini_balance_wanted ( account_number,
-                               gsb_real_import_from_string (tmp_string));
-    if (tmp_string) g_free (tmp_string);
+                               gsb_real_get_from_string (tmp_string));
+    if (tmp_string) 
+        g_free (tmp_string);
     return;
     }
 
@@ -6147,10 +6144,9 @@
      * from 12.340000 to 12.34 before doing the conversion */
     gchar *tmp_string;
 
-    tmp_string = utils_str_reduce_exponant_from_string ( text,
-                                     2 );
+    tmp_string = utils_str_reduce_exponant_from_string ( text, 2 );
     gsb_data_account_set_mini_balance_authorized ( account_number,
-                                   gsb_real_import_from_string (tmp_string));
+                                   gsb_real_get_from_string (tmp_string));
     if (tmp_string) g_free (tmp_string);
     return;
     }
@@ -6183,11 +6179,9 @@
      * from 12.340000 to 12.34 before doing the conversion */
     gchar *tmp_string;
 
-    tmp_string = utils_str_reduce_exponant_from_string ( text,
-                                     2 );
-
+    tmp_string = utils_str_reduce_exponant_from_string ( text, 2 );
     if (buffer_reconcile_conversion)
-        buffer_reconcile_conversion -> final_balance = gsb_real_import_from_string (tmp_string);
+        buffer_reconcile_conversion -> final_balance = gsb_real_get_from_string (tmp_string);
     if (tmp_string) 
         g_free (tmp_string);
     return;

Index: gsb_form_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_transaction.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- gsb_form_transaction.c	7 Nov 2009 19:13:59 -0000	1.51
+++ gsb_form_transaction.c	13 Dec 2009 20:08:31 -0000	1.52
@@ -595,12 +595,36 @@
     link_number = gsb_data_currency_link_search ( account_currency_number,
                         currency_number );
     if ( link_number == 0 )
-        gsb_currency_exchange_dialog ( account_currency_number,
+    {
+        gint transaction_number;
+
+        transaction_number = GPOINTER_TO_INT (g_object_get_data (
+                        G_OBJECT ( gsb_form_get_form_widget ( ) ),
+                        "transaction_number_in_form" ));
+
+        if ( gsb_data_transaction_get_marked_transaction ( transaction_number ) == 3 )
+        {
+            gtk_widget_set_sensitive ( widget, FALSE );
+            gtk_widget_hide ( gsb_form_widget_get_widget (
+                        TRANSACTION_FORM_CHANGE ) );
+        }
+        else if ( transaction_number == -1 )
+            gsb_currency_exchange_dialog ( account_currency_number,
                         currency_number,
                         0,
                         null_real,
                         null_real,
                         TRUE );
+        else
+        {
+            gsb_currency_exchange_dialog ( account_currency_number,
+                        currency_number,
+                        gsb_data_transaction_get_change_between ( transaction_number ),
+                        gsb_data_transaction_get_exchange_rate ( transaction_number ),
+                        gsb_data_transaction_get_exchange_fees ( transaction_number ),
+                        TRUE );
+        }
+    }
 }
 /* Local Variables: */
 /* c-basic-offset: 4 */



More information about the cvs mailing list