X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank;a=blobdiff_plain;f=src%2Fui-assist-import.c;fp=src%2Fui-assist-import.c;h=6146ce7ce51085559a46a150ab6a4e51d63d15ba;hp=8d8836d64aa6d85d79f2527f70b7db872379e162;hb=b84403141a4c3a32a594800eb3fcabdc856461f8;hpb=996fa4ab9f6b836001f8ad0eecbfd3821687fea7 diff --git a/src/ui-assist-import.c b/src/ui-assist-import.c index 8d8836d..6146ce7 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-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); }