Patch to partially add recursion to budgets
Gregory Alexander
gregalexa at gmail.com
Tue Oct 10 09:43:35 EDT 2006
Alright, I got the patch updated. I like the idea of using the unset
value. I was just unfarmiliar with the value structure holding code.
I will note that there will be minor migration problems from old
versions, since values that are currently 0 will display as 0, and
values that are currently unset will display as blank. This shouldn't
really break anyone, but it might be a little confusing.
On 10/3/06, Chris Shoemaker <c.shoemaker at cox.net> wrote:
> On Mon, Oct 02, 2006 at 08:26:07PM -0500, Gregory Alexander wrote:
> If the error value was the only way to convey "unset" I could see
> adding a code for it, but I'm thinking it's better to handle it
> at the budget-level. E.g.
>
...
>
> and then just "unset" the value if an error code is passed to
> gnc_budget_set_account_period_value():
>
Not that simple, because error values are not the same as blank
values. I still handle errors as errors, but also will display unset
as unset.
> > User interface changes:
> >
> > 1.) Budget values of 0/1 are now displayed when editing as $0.00 (as
> > appropriate) instead of being left blank.
>
> okay, good. Now, zero is a legit budget value.
>
> > 2.) If the user removes all text when editing a budget value entry, it
> > will be initialized to GNC_ERROR_UNSET.
>
> With code above, any error code will do, and will actually _unset_ the value.
Agreed. That code works better.
> > 3.) GNC_ERROR_UNSET is displayed when editing as a blank budget value.
>
> ?? It should be just blank, right?
Isn't that what I said?
> > 4.) cleanup/debug: Other errors display as "error" when editing.
>
> That's a good idea.
I preserved this behavior, while implementing using a "NULL" budget value.
> > 5.) In the existing budget report, entries with a value of
> > GNC_ERROR_UNSET display as "." instead of a currency value. Other
> > errors continue to display as a single "$" (as appropriate.)
>
> I'd prefer that the report display and editor display were more
> similar, like just "" and "error", but I might change my mind if I
> actually saw it.
The problem is that as the tables get larger, and larger portions are
blank, it gets hard to track the columns, especially since we use
"boxless" tables.
> > What I haven't been able to figure out is how to have new budget
> > entries default to GNC_ERROR_UNSET instead of 0. I think changing the
> > default to GNC_ERROR_UNSET would be the correct behavior, although
> > again, this is open to discussion.
>
> Well, I think the default should be "unset" as per above, and I think
> it's just automatic. Nothing's there until it's set.
Yup, works great. However, this is what introduces the weird upgrade behavior.
Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_budget_blank_2
Type: application/octet-stream
Size: 6604 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20061010/6bf31635/attachment.obj
More information about the gnucash-devel
mailing list