X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank;a=blobdiff_plain;f=src%2Fhb-category.c;fp=src%2Fhb-category.c;h=80f7e19b62e0540df4239a4046d909220b218b2e;hp=807e93d92d01e3db514282527aca69b2b34922af;hb=d11c8dd3275ed2a4a35598e69c0804dcf9435766;hpb=2ef3e601408ebaeeaf5f40d6967664b012a49979 diff --git a/src/hb-category.c b/src/hb-category.c index 807e93d..80f7e19 100644 --- a/src/hb-category.c +++ b/src/hb-category.c @@ -1,5 +1,5 @@ /* HomeBank -- Free, easy, personal accounting for everyone. - * Copyright (C) 1995-2017 Maxime DOYEN + * Copyright (C) 1995-2018 Maxime DOYEN * * This file is part of HomeBank. * @@ -467,6 +467,9 @@ guint32 *new_key; newcat->imported = imported; newcat->flags |= GF_SUB; + //#1713413 take parent type into account + if(parent->flags & GF_INCOME) + newcat->flags |= GF_INCOME; DB( g_print(" -> insert subcat '%s' id: %d\n", newcat->name, newcat->key) ); @@ -664,6 +667,7 @@ GList *lcat; GList *lst_acc, *lnk_acc; GList *lnk_txn; GList *lpay, *lrul, *list; +guint i, nbsplit; lcat = list = g_hash_table_get_values(GLOBALS->h_cat); while (list != NULL) @@ -686,7 +690,20 @@ GList *lpay, *lrul, *list; { Transaction *txn = lnk_txn->data; - category_fill_usage_count(txn->kcat); + //#1689308 count split as well + if( txn->flags & OF_SPLIT ) + { + nbsplit = da_splits_count(txn->splits); + for(i=0;isplits[i]; + + category_fill_usage_count(split->kcat); + } + } + else + category_fill_usage_count(txn->kcat); + lnk_txn = g_list_next(lnk_txn); } lnk_acc = g_list_next(lnk_acc); @@ -709,7 +726,20 @@ GList *lpay, *lrul, *list; { Archive *entry = list->data; - category_fill_usage_count(entry->kcat); + //#1689308 count split as well + if( entry->flags & OF_SPLIT ) + { + nbsplit = da_splits_count(entry->splits); + for(i=0;isplits[i]; + + category_fill_usage_count(split->kcat); + } + } + else + category_fill_usage_count(entry->kcat); + list = g_list_next(list); }