[Patch] Enhance account renumbering dialog with 'Begin At' entry to increment from

Darryl Rees dardie at gmail.com
Thu Jun 5 01:17:27 EDT 2008


Hi

I'm new to gnucash and double-entry bookkeeping, but expecting a fruitful
relationship :-) Thanks to all developers for spectacularly useful foss
product.

I found the account renumbering dialog a bit restrictive, I've included a
patch which to my mind improves it a lot - I hope somebody can review it.
The changes are as follows:

- Dash between prefix and the incremented part of account number is no
longer obligatory; the dash is still appended to the parent's account code
to create a default prefix, but it can be deleted from the prefix entrybox.

- There is now a 'Begin at' entry for the non-prefix part of the account
code, so for example:
     + You can start numbering from something other than the interval
     + You can avoid subaccounts at the same level from having different
numbers of digits, because the one parent account had more than 9
subaccounts and others had less than 9 subaccounts.

By way of illustration, I wanted to do something like the following:
A000            Assets
    A100        Fixed Assets
        A110    Buildings
        A120    Furniture and Fittings
        A130    Other Fixed Asset
    A200        Current Assets
        A210    Petty Cash
        A230    Bank Account

Which was impossible with the old renumbering dialog, but is now trivially
simple.

A couple of notes:
• I only changed the accounts dialog in account.glade, but glade-3 seems to
have touched a whole lot more of the file. Praps the the original was
created in glade-2, and glade-3 has decided to reformat stuff? Otherwise
I've done something dumb and will expect flamage :-) If this is a problem or
if anyone can suggest how to prevent this (go back and use glade-2?) I can
redo it. On the face of it, it doesn't seem to affect any of the actual
dialogs.
• The strtol conversion of the beginat entry might seem simplistic, but IMO
in practice gives reasonably sane/intuitive outcomes in the case of silly
input. If others prefer I can add a check to ensure beginat is a positive
integer.
• Unrelated to my patch I added a g_free(prefix) to the end of
gnc_account_renumber_response_cb.

Hope the patch is useful. If accepted I will submit a documentation patch to
reflect change in the dialog. I haven't seriously coded since last millenium
so any constructive advice welcome :-(


Darryl Rees
-------------- next part --------------
A non-text attachment was scrubbed...
Name: renumber-dialog.patch
Type: text/x-diff
Size: 287506 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20080605/436c2b46/attachment-0001.bin 


More information about the gnucash-devel mailing list