/* 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.
*
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) );
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)
{
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;i<nbsplit;i++)
+ {
+ Split *split = txn->splits[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);
{
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;i<nbsplit;i++)
+ {
+ Split *split = entry->splits[i];
+
+ category_fill_usage_count(split->kcat);
+ }
+ }
+ else
+ category_fill_usage_count(entry->kcat);
+
list = g_list_next(list);
}