Functions and Variables en Scheduled Transactions (fwd)

Beth Leonard beth at oasis.slimy.com
Sun Aug 7 02:25:14 EDT 2005


Forgot to CC the list the first time...
--Beth

----- Forwarded message from beth -----

To: Andres Villarreal <avillarrealpouw at gmail.com>
Subject: Re: Functions and Variables en Scheduled Transactions

On Tue, Aug 02, 2005 at 12:31:57PM -0500, Andres Villarreal wrote:
> Please guide me to any existing documentation. I would be happy to help 
> updating the documentation that comes with the package.

On the FAQ at:
http://gnomesupport.org/wiki/index.php/GnuCashFaq#Q:_How_do_I_use_variables_and_formula_in_scheduled_transactions.3F
it will point you to 3 archived mailing list questions/answers:
    *  http://lists.gnucash.org/pipermail/gnucash-user/2005-January/012479.html
    * http://lists.gnucash.org/pipermail/gnucash-user/2005-February/012964.html
    * http://lists.gnucash.org/pipermail/gnucash-user/2005-May/013746.html 

I'll cut & paste the first (and most useful) of those below.
--Beth 
===========================================================
===========================================================
Variables in Scheduled Transactions?
Josh Sled jsled at asynchronous.org
Wed Jan 5 15:00:08 EST 2005

    * Previous message: Variables in Scheduled Transactions?
    * Next message: Business setup tips
    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

On Sat, 2005-01-01 at 14:20, Robert Uhl wrote:
> How does one use variables in scheduled transactions?  I cannot seem
> to
> find anything in the docs except for tantalising references...

Sorry. I never really did write it up well, no.  At the same time,
there's not a whole lot there: basically just enough to barely support
the mortgage/loan druid ... and even that's not done very well.

I've been hoping to revist it and make it more powerful after the gnome2
port... but that's a ways off.

In any case, the documentation is basically as such:

1/ Any text string [not followed by parens] entered in the template 
   transaction will be recognized as a varible, and prompted for when 
   the scheduled transaction is to be created.

2/ Any text string followed by parens, optionally with arguments, will 
   have the string "gnc:" prepended to it and evaluated in the scheme 
   environment.  Arguments are seperated with ':'.  See fin.scm for 
   examples of providing functions.


> Ideally, I'd like to have a variable which decrements each month, in
> order to automatically calculate sum-of-digits depreciation.

There is a magic variable 'i', which stands for the current
instance-count of the scheduled transaction.  1 for the first, 2 for the
second, &c.  It might be 0-based.  In any case, if you know the starting
point, "(42 - i)" should work.

...jsled

-- 
http://asynchronous.org/ - `a=jsled; b=asynchronous.org; echo ${a}@${b}`


----- End forwarded message -----

-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                             Beth Leonard                          +
+       O say, does that star-spangled banner yet wave              +
+       O'er the land of the free and the home of the brave?        +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


More information about the gnucash-user mailing list