Budgets and inconsistent handling of account sign reversal.

Jeff Kletsky gnucash at allycomm.com
Mon Feb 22 15:05:39 EST 2010


On 2/22/2010 8:16 AM, Derek Atkins wrote:
> GnuCash does not handle data format schema updates well.  :-(
>    

oooof...

Should I be scrambling to get in a place to properly store the default 
budget, probably on the book, even though we're past string freeze, so 
that there aren't data model changes once 2.4 comes out?

It's on my "to do list" to be able to have a user set a default budget, 
but that has UI impact that will likely need new strings.

As far as I can tell, src/engine/budget.c deterministically, but not 
easily controllably, selects the "current" budget:

static void just_get_one(QofInstance *ent, gpointer data)
{
     GncBudget **bgt = (GncBudget**)data;
     if (bgt && !*bgt) *bgt = GNC_BUDGET(ent);
}

gnc_budget_get_default (QofBook *book)
{
     QofCollection *col;
     GncBudget *bgt = NULL;

     g_return_val_if_fail(book, NULL);
     col = qof_book_get_collection(book, GNC_ID_BUDGET);
     if (qof_collection_count(col) > 0) {
         qof_collection_foreach(col, just_get_one, &bgt);
     }
     return bgt;
}




More information about the gnucash-devel mailing list