GNUCash child accounts distributed from parent account

James Nylen jnylen+gnucash at gmail.com
Mon Mar 11 17:22:21 EDT 2013


Ais,

You'll probably want to compile GnuCash with the Python API enabled.  The
following are steps that worked for me (on Linux Mint 14, should be similar
enough):

sudo apt-get install libglib2.0-dev guile-1.8-dev slib # NOT guile 2.0
- it doesn't work with slib!
sudo apt-get install libgconf2-dev libxml2-dev
sudo apt-get install libdbi-dev libdbd-mysql # libdbd-sqlite3 libdbd-pgsql
sudo apt-get install libgtk2.0-dev libgnomeui-dev libglade2-dev
sudo apt-get install libgoffice-0.8-dev
sudo apt-get install libgtkhtml3.14-dev./configure --enable-python-bindings
make
sudo checkinstall
sudo ldconfig # otherwise, python can't load the gnucash module

Then, to prevent apt-get from updating the package later, do this: echo
'gnucash hold' | sudo dpkg --set-selections

I don't think you can do what you're after without using the Python API,
but with it, you certainly can.  I use the API to automate adding new
transactions from my bank every 4 hours.  My script is here:
https://github.com/nylen/gnucash-django/blob/master/gnucash_scripts/import_qif_file.py


On Thu, Feb 28, 2013 at 2:31 AM, Ais Suministrado <
suministrado.ais at gmail.com> wrote:

> Hi! I would like to ask if there is a way that an amount transferred to a
> parent account would automatically distributed to its child accounts. Where
> the distribution of the amount to its child accounts has different ratio or
> percent it will be distributed but also been set beforehand.
>
> For example, I moved 1000 to the parent account that has 5 child accounts.
> Child A always gets a constant value of 300. The rest of the amount, 700,
> are distributed in Child B, Child C, Child D, Child E but based on
> hierarchy. Child B gets 40%, Child C gets 30%, Child D gets 20%, & Child E
> gets 10% of the 700. Also, the child accounts will stop getting a
> transferred amount when it reached a certain amount. Like if Child B
> reached 3000, on the next transfer, Child B gets 0%, Child C gets 43.33%,
> Child D gets 33.33%, Child E gets 23.33% of the difference of Child A & the
> transferred account.
>
> Again, that is just an example. There can be more or less than 1000 as the
> value transferred, more or less than one child getting a constant value &
> more or less than 5 child accounts.
>
> I need to have something like this so that I can have savings set for
> emergencies or investments & other items that I plan to save up to buy,
> etc.
>
> Is this possible to incorporate in GNUCash? Would it be possible to ask
> how? Can somebody please point me out where I can start searching for
> something like this? My main OS is a GNU/Linux distro, specifically Linux
> Mint 13 XFCE 64bit. I code for a living so I don't mind programming a
> script for this.
>
> Thanks and best regards,
>
> Ais
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>


More information about the gnucash-user mailing list