scheduled loan payment setup question

John W. Eaton jwe@bevo.che.wisc.edu
Mon, 23 Dec 2002 12:37:46 -0600


Hi,

I'm new to gnucash, so I hope this is not something that has been
asked many times.

I'm using the current CVS version of gnucash and I'd like to be able
to set up a scheduled transaction for a loan payment in which I'm
paying additional principal.

I tried setting it up with the loan and mortgage dialog, but I could
not seem to make that work correctly (probably because I don't
understand what the dialog is trying to do).  I didn't understand
where I would add an additional amount to the payment that would be
credited to the principal, even though there is a selection for
"remainder to:" with options of "principal", "interest", or "escrow".

So, is it possible to add additional principal payments and start the
payment of a loan from an arbitrary point?  (This is a loan I've
already been paying extra on, so I don't think the ppmt and ipmt
functions help.)

If not, then what I think I want to do is create a function to compute
the current interest due given the interest rate for the loan and the
current principal.  This function would simply have to look up the
balance given an account name and then return

  balance * interest / 12

Something like

  (define compute-interest (account-name i)
    (/ (* (lookup-balance account-name) i) 12.0))

but I don't know what functions are available in gnucash.  Is there a
list somewhere?  I've been looking through the sources, but that's a
slow process.

Given this function, then I imagine that I can create a scheduled
payment that moves X from a bank account and splits it between the
loan liability account and an interest expense account using something
like

  bank account debit:       X
  interest account credit:  compute-interest ("loan account" : 0.05)
  loan account credit:      X - compute-interest ("loan account" : 0.05)

It seems that this should work unless the order of operations is not
specified and it is possible for the third operation in the list above
to actually be completed before the second, in which case the
compute-interest function will not return the same value both times it
is called for this transaction (can that happen?).

Any pointers would be much appreciated.

Thanks,

jwe

-- 
www.octave.org        | Unfortunately we were hopelessly optimistic in 1954
www.che.wisc.edu/~jwe | about the problems of debugging FORTRAN programs.
                      |                                       -- J. Backus