GDA: A few questions

Derek Atkins warlord at MIT.EDU
Mon Dec 11 22:21:36 EST 2006


Quoting Chris Shoemaker <c.shoemaker at cox.net>:

> I'm not disagreeing about Invoices.  AFAICT, Invoices already have the
> design feature that I think SXs should have - they use real accounts,
> transactions, and splits, and just note in the transaction KVP that
> this is an invoice transaction.

Not at all.  An unposted invoice has no Account, Transaction,
or Split objects..  It has references, but it uses a GncEntry
object as the line item entries..  A GncInvoice is like a Transaction,
and a GncEntry is like a Split, but no, it doesn't re-use the
core engine objects.

> Invoices basically reuse the engine objects.  But SXs have:
>
> struct TTInfo_s
> {
>  /* FIXME add notes field */
>  char *description; /* owned by us */
>  char *num;         /* owned  by us */
>  gnc_commodity *common_currency; /* not freed */
>
>  GList *splits; /* list of template splits, owned by us */
> };
>
> which look suspiciously like a Transaction, and
>
> struct TTSplitInfo_s
> {
>  char *action; /* owned by us */
>  /* FIXME: What about the split's KvpFrame */
>  char *memo; /* owned by us */
>  char *credit_formula, *debit_formula; /* owned by us */
>  Account *acc;
> };
>
> which looks suspiciously like a Split.  And then the whole duplicated
> accounts setup.  I'm just saying SXs could use the real engine
> objects, just like Invoices.  The only difference is that the engine
> has to learn that "real" SX transactions aren't _that_ real. :)

Except Invoices don't either, for the same reason that it's causing
trouble that SXes do -- it complicates all the code when EVERYONE has
to be aware that a foo-object is really part of a bar-object.  Much
easier to just have foo object and bar object and then use KVP GUIDs
to link back and forth.

> Just to clarify, as for the GUI, I'm not suggesting that the register
> is a good place to edit or view the SX data structure - just the real
> transactions it would link to.

Except an SX isn't a real transaction, it's a Template Transaction.

> -chris

-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 at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list