X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank;a=blobdiff_plain;f=src%2Fui-assist-import.c;h=9915c24aa3bcc0e81102b680a64fce206c5004f2;hp=8d8836d64aa6d85d79f2527f70b7db872379e162;hb=cd13d9691c46c2b2d6d459e9e6a76bed1c21b7a6;hpb=996fa4ab9f6b836001f8ad0eecbfd3821687fea7 diff --git a/src/ui-assist-import.c b/src/ui-assist-import.c index 8d8836d..9915c24 100644 --- a/src/ui-assist-import.c +++ b/src/ui-assist-import.c @@ -1,5 +1,5 @@ /* HomeBank -- Free, easy, personal accounting for everyone. - * Copyright (C) 1995-2016 Maxime DOYEN + * Copyright (C) 1995-2018 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,17 +768,25 @@ 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); + + transaction_add(item); } /* Make iter point to the next row in the list store */