scheduled transactions

Thu, 01 Feb 2001 09:03:49 -0700

```Joshua Sled wrote:
[...]
>  * For each element of the frequency enum, we must have some set of
>  * anchors from which to compute the new date.
>  *
>  * daily       : N/A
>  * weekly      : { 0==sun, .., 6==sat }
>  * biweekly    : start day of month
>  * semi_monthly: first, second days of month
>  * bi-monthly  : day of month
>  * monthly     : day of month
>  * quarterly   : start month,day in year \
>  * semi_yearly : first month,day in year  } [watch out for leap day]
>  * yearly      : day of year             /
>  **/

I think you're getting there.  However, I really think that some way should be
provided for the [ab]user to specify his/her own frequency -- one I can think
of right off hand that someone might want would be "every 90 days" -- again,
this differs from "quarterly" as it will "drift" 5 or 6 days a year, and can
even have five "event days" in one year -- the problem is that this will take
an "anchor" (day, month, year) and a period.  And as I think of it, I can
easily come up with one that can only be described as a "series of one-time
events" -- they _can_ be predicted well in advance (often two or three years),
but vary slightly from year to year as to the exact "when" -- an example of
that would be "start of semester".

A point also just dawned on me:  "biweekly" needs a "day, month, year" anchor
point -- if it starts on 2-Mar-2001, the next will be 16-Mar-2001, the next
will be 30-Mar-2001, the next will be 13-Apr-2001 (not 2-Apr-2001!).

I was about to say that "since we're not trying to write a calendar, I don't
think we need to deal with think we have to deal with things like 'first
Thursday in the month' or 'third Wednesday'", but now that I think of it, I
happen to have an expense that's liked to "first Thursdays" (though at the
moment it doesn't find its way into Gnucash) -- I always purchase dinner at a
certain restaurant where a meeting is held that evening.  (I used to also have
one that was "Wednesday before first Thursday", which would sometimes fall on
the last day of the previous month -- but that sort of strangeness is rare
enough that I'd be willing to have to enter a series of "one-time" events.)

One bit of simplification, though:  "daily", "weekly", and "biweekly" can all
just be special cases of "defined period", with a "period" of 1, 7, and 14,
respectively.

And there's one other related tidbit here:  should we have an ending date?
I know, for instance, that I have one monthly bill that is due the 12th of
each month that will have its last payment in May, 2004.  (An alternative
might be to have the ability to say how many times it will occur.  When one
signs up for a loan, typically, there will be N payments.)

Hmmm... a "one-time" event is really a "defined period" with start-date ==
stop-date and a period of 1.

Clark

```