formulas or scripts for periodic savings

Josh Sled jsled at
Fri May 6 11:38:25 EDT 2005

On Fri, 2005-05-06 at 10:59 +0200, adrian15 wrote:
> I want to automatise the last 180 E. That's it. I want to schedule a 
> function that puts (Earnings of the month - Expenses of the month) from 
> Normal account to Patrimony account.
> ===============
> I've looked around the gnu online documentation and I haven't found 
> anything about scripts or functions in Gnucash... so is there any way of 
> doing what I'm looking for? Any work-around?

Scheduled transactions are documented in the main help, and they support
formula, which are -- unfortunately -- only really documented in the
mailing list archives, and not well at that. 

If you can express the amounts of the splits in the transaction as a
simple expression (optionally with "variables"), then the
scheduled-transaction subsystem will prompt you for the value of those
variables when the transaction comes-due.  So, for instance, if you
wanted to have the formula...

    earnings - expenses

... then gnucash would prompt you for the values of both "earnings" and
"expenses" when it needs to create the transaction.

It was unclear from your example where the 10% and 20% came into the
computation -- those seemed like your own personal restrictions, not
really enforced (or enforceable) by gnucash.  But if you wanted to have
a template transaction with formulae like...

    account 1 credit: (earnings * 0.10) + (earnings * 0.20) + (earnings * 0.70)
    account 2 debit:  (earnings * 0.10)
    account 3 debit:  (earnings * 0.20)
    account 4 debit:  (earnings * 0.70)

...then gnucash would only prompt for the single value "earnings" and
compute the full transaction from that.

What it _cannot_ do, however, is sum or obtain the values from existing
accounts ... so it would not be able to compute "all expenses in the
last month".


-- - `a=jsled;; echo ${a}@${b}`

More information about the gnucash-user mailing list