]> Dogcows Code - chaz/homebank/blobdiff - src/ui-assist-import.c
import homebank-5.1.3
[chaz/homebank] / src / ui-assist-import.c
index 8d8836d64aa6d85d79f2527f70b7db872379e162..6146ce7ce51085559a46a150ab6a4e51d63d15ba 100644 (file)
@@ -1,5 +1,5 @@
 /*     HomeBank -- Free, easy, personal accounting for everyone.
- *     Copyright (C) 1995-2016 Maxime DOYEN
+ *     Copyright (C) 1995-2017 Maxime DOYEN
  *
  *     This file is part of HomeBank.
  *
@@ -707,11 +707,14 @@ GList *lxxx, *list;
                        //only persist user selected to new account
                        if( item->imp_key == 0)
                        {
-                               //DB( g_print(" -> persist acc %x '%s'\n", item, item->name) );
+                               DB( g_print(" -> persist acc %x '%s' k=%d, ik=%d\n", item, item->name, item->key, item->imp_key) );
                                item->imported = FALSE;
                                g_free(item->imp_name);
                                item->imp_name = NULL;
                        }
+                       //else
+                       //DB( g_print(" -> keep exist acc %x '%s' k=%d, ik=%d\n", item, item->name, item->key, item->imp_key) );
+                       
                }
                list = g_list_next(list);
        }
@@ -765,16 +768,24 @@ GList *lxxx, *list;
                Account *acc;
                        
                        //DB(g_print("import %d to acc: %d\n", data->total, item->account)      );
+
                        //todo: here also test imp_key on account and change the key into the transaction
                        acc = da_acc_get(item->kacc);
-                       if( acc != NULL)
+                       if( (acc != NULL) && (acc->imp_key > 0) )
                        {
-                               if( acc->imp_key > 0)
+                               item->kacc = acc->imp_key;
+                       }
+
+                       //#1653957 change also kxferacc
+                       if( item->paymode == PAYMODE_INTXFER )
+                       {
+                               acc = da_acc_get(item->kxferacc);
+                               if( (acc != NULL) && (acc->imp_key > 0) )
                                {
-                                       item->kacc = acc->imp_key;
+                                       item->kxferacc = acc->imp_key;
                                }
                        }
-
+                       
                        transaction_add(item, NULL, 0);
                }
 
This page took 0.021674 seconds and 4 git commands to generate.