+static void repbudget_compute_cat_spent(guint32 key, gdouble amount, gdouble *tmp_spent, gdouble *tmp_budget)
+{
+Category *cat;
+
+ cat = da_cat_get(key);
+ if(cat)
+ {
+ DB( g_print(" -> affecting %.2f to cat %d sub=%d, bud=%.2f\n", amount, cat->key, (cat->flags & GF_SUB), tmp_budget[cat->key]) );
+ if( (cat->flags & GF_FORCED) || (cat->flags & GF_BUDGET) )
+ tmp_spent[cat->key] += amount;
+ //#1814213 only count subcat with budget
+ //if( (cat->flags & GF_SUB) )
+ if( (cat->flags & GF_FORCED) || ((cat->flags & GF_SUB) && (cat->flags & GF_BUDGET)) )
+ {
+ DB( g_print(" -> affecting %.2f to parent %d, bud=%.2f\n", amount, cat->parent, tmp_budget[cat->parent]) );
+ tmp_spent[cat->parent] += amount;
+ }
+ }
+}
+
+