- DB( g_print(" -> affecting %.2f to parent %d, bud=%.2f\n", amount, cat->parent, tmp_budget[cat->parent]) );
- tmp_spent[cat->parent] += amount;
+ Category *pcat = da_cat_get(cat->parent);
+
+ if(pcat)
+ {
+ if( (cat->flags & GF_FORCED) || (cat->flags & GF_BUDGET) || (pcat->flags & GF_FORCED) || (pcat->flags & GF_BUDGET) )
+ {
+ DB( g_print(" + spend %.2f to parent %d\n", amount, cat->parent) );
+ tmp_spent[pcat->key] += amount;
+ }
+
+ }