[grisbi-cvs] grisbi/src gsb_form_transaction.c,1.56,1.56.2.1

Pierre Biava pbiava at users.sourceforge.net
Sat May 22 09:44:04 CEST 2010


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

Modified Files:
      Tag: version_0_6_0_corr
	gsb_form_transaction.c 
Log Message:
Fixed a bug in treatment of transfers between accounts

Index: gsb_form_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_transaction.c,v
retrieving revision 1.56
retrieving revision 1.56.2.1
diff -u -d -r1.56 -r1.56.2.1
--- gsb_form_transaction.c	3 Apr 2010 19:57:41 -0000	1.56
+++ gsb_form_transaction.c	22 May 2010 07:44:02 -0000	1.56.2.1
@@ -429,6 +429,7 @@
 {
     gint contra_transaction_number;
     gint contra_mother_number = 0;
+    gint contra_marked_transaction = 0;
     GtkWidget *contra_payment_button;
 
     g_return_val_if_fail ( account_transfer >= 0, -1 );
@@ -453,9 +454,13 @@
 	    /* if the contra transaction was a child of split, copying/deleting it
 	     * will remove the information of the mother, so we get it here */
 	    contra_mother_number = gsb_data_transaction_get_mother_transaction_number (
-                        contra_transaction_number);
+                        contra_transaction_number );
 
-	    /* check if we change the account targe */
+        /* Copying/deleting remove the marked information, so we get it here */
+        contra_marked_transaction = gsb_data_transaction_get_marked_transaction (
+                        contra_transaction_number );
+        
+	    /* check if we change the account target */
 	    if ( gsb_data_transaction_get_contra_transaction_account (
                         transaction_number) != account_transfer )
 	    {
@@ -481,7 +486,7 @@
      * already set */
 
     if ( new_transaction )
-        contra_transaction_number = gsb_data_transaction_new_transaction (account_transfer);
+        contra_transaction_number = gsb_data_transaction_new_transaction ( account_transfer );
 
     gsb_data_transaction_copy_transaction ( transaction_number,
 					    contra_transaction_number, new_transaction );
@@ -493,6 +498,10 @@
     gsb_data_transaction_set_mother_transaction_number ( contra_transaction_number,
 							 contra_mother_number );
 
+    /* If this is not a new transaction it restores the marked statement */
+    gsb_data_transaction_set_marked_transaction ( contra_transaction_number,
+                        contra_marked_transaction );
+
     /* we have to change the amount by the opposite */
     gsb_data_transaction_set_amount (contra_transaction_number,
 				     gsb_real_opposite (gsb_data_transaction_get_amount (transaction_number)));
@@ -527,7 +536,6 @@
 }
 
 
-
 /**
  * callback called when the user click on the 'change' button in the form
  * show a popup to modify the values



More information about the cvs mailing list