Gnucash Lots?

Derek Atkins warlord@MIT.EDU
13 May 2002 12:13:23 -0400


linas@linas.org (Linas Vepstas) writes:

> On Tue, May 07, 2002 at 01:13:59PM -0400, Derek Atkins was heard to remark:
> > I could use it as soon as yesterday ;)
> 
> I roughed in a very minimal API; there is not backend support yet.
> I made lots a 'first class' thing in the engine, they seem fundamental 
> to me ... 

I'm not 100% convinced that a lot is a "fundamental" object as opposed
to just an abtraction as a way to think about a set of transactions
that related to each other.  However I have no objection to Lots being
first-class entities in the engine.

I think the UI issues are more fundamental that the engine issues.
In particular:

 . how does the UI represent lots to the user?
 . how does the UI allow transactions to cross multiple lots?
 . how is this latter part done "easily" (i.e. easy for the user?)

Here's my scenario: You've invoiced a customer a few times (because
you've had a number of work orders for them).  Each posted invoice is
going to have its own transaction (does this imply each invoice is its
own lot?  I would think so).  The customer pays you a sum of money to
pay for their whole outstanding balance at once (or, worse, only part
of their outstanding balance).  What is the UI that processes this
payment?  In particular, how do you present "lots" to the user in an
easy to understand manner such that the payment transaction can have
multiple splits to clear out the various lots?

I consider this challenging because, simplistically, a user wants to
just say "This customer paid $X on date Y" and have everything else
happen magically (perhaps with some configuration that says something
like FIFO).  Obviously there needs to be a more advanced dialog for
users that really want to specify their lots.

> Please review what's there, let me know what other API routines are
> needed.   e.g. do you need a date-posted field?  if so, can I return the
> date of the transacton of the earliest split in the lot?  etc ...

I've only looked at gnc-lot*.h so far.  Looks fine to me.  I don't
think we need a date-posted field, however a function that looks like
this would be useful:

        Transaction * gnc_lot_get_initial_txn (GncLot *);

Note that there is already a "Due Date" in a Transaction (stored in
the kvp).  See xaccTransGetDateDueTS().

> src/doc/lots.txt
> src/engine/gnc-lot.h
> 
> Let me know which backend should get done first.

XML, please (it's the only backend I support for the business modules,
at the moment).

Thanks,

> ---linas

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available