[grisbi-cvs] grisbi/src gsb_file.c,1.40,1.41 import.c,1.260,1.261

Pierre Biava pbiava at users.sourceforge.net
Tue Feb 17 21:56:59 CET 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8756/src

Modified Files:
	gsb_file.c import.c 
Log Message:
correction import of files for bug 417

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -d -r1.260 -r1.261
--- import.c	6 Jan 2009 15:21:01 -0000	1.260
+++ import.c	17 Feb 2009 20:56:57 -0000	1.261
@@ -1906,8 +1906,18 @@
 
 	    /* invert the amount of the transaction if asked */
 	    if (imported_account -> invert_transaction_amount)
-		gsb_data_transaction_set_amount ( transaction_number,
-						  gsb_real_opposite (gsb_data_transaction_get_amount (transaction_number)));
+        {
+            if ( gsb_data_transaction_get_sign ( 
+                        transaction_number ) == GSB_PAYMENT_DEBIT )
+                gsb_data_transaction_set_sign ( transaction_number, 
+                        GSB_PAYMENT_CREDIT );
+            else
+                gsb_data_transaction_set_sign ( transaction_number, 
+                        GSB_PAYMENT_DEBIT );
+            gsb_data_transaction_set_amount ( transaction_number,
+                        gsb_real_opposite (gsb_data_transaction_get_amount (
+                        transaction_number)));
+        }
 
 	    /* we need to add the transaction now to the tree model here
 	     * to avoid to write again all the account */
@@ -2142,8 +2152,6 @@
 	else
 	    action_derniere_ventilation = 1;
 
-
-
 	if ( ope_import -> bouton
 	     &&
 	     gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( ope_import -> bouton )))
@@ -2208,6 +2216,11 @@
     /* récupération du montant */
     gsb_data_transaction_set_amount ( transaction_number,
 				      imported_transaction -> montant );
+    /* added by pbiava on the 02/17/2009 fix bug 417 */
+    if ( (imported_transaction -> montant).mantissa >= 0)
+        gsb_data_transaction_set_sign ( transaction_number, GSB_PAYMENT_CREDIT );
+    else
+        gsb_data_transaction_set_sign ( transaction_number, GSB_PAYMENT_DEBIT );
 
     /* 	  récupération de la devise */
     gsb_data_transaction_set_currency_number ( transaction_number,

Index: gsb_file.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- gsb_file.c	7 Feb 2009 20:19:14 -0000	1.40
+++ gsb_file.c	17 Feb 2009 20:56:57 -0000	1.41
@@ -35,6 +35,7 @@
 #include "./utils.h"
 #include "./fenetre_principale.h"
 #include "./dialog.h"
+#include "./utils_files.h"
 #include "./utils_file_selection.h"
 #include "./gsb_assistant_account.h"
 #include "./gsb_assistant_file.h"
@@ -310,6 +311,10 @@
 void gsb_file_set_backup_path ( const gchar *path )
 {
     backup_path = my_strdup (path);
+    if ( ! g_file_test ( path, G_FILE_TEST_EXISTS ) )
+    {
+        utils_files_create_XDG_dir ( );
+    }
 }
 
 



More information about the cvs mailing list