Extending the TTInfo/TTSplitInfo data types?

Josh Sled jsled@asynchronous.org
Tue, 20 Nov 2001 21:30:51 -0800


On Sun, Nov 18, 2001 at 06:53:43PM -0500, Derek Atkins wrote:

| What's implemented for TTInfo/TTSplitInfo is half of what I need for
| Purchase/Sales Order information...  Is it reasonable to try to extend
| the template transaction interface so I can use it?  

I think so; there's some argument that says that the Template Transactions
are a generally useful thing for GnuCash outside of the SX application
which they came about in... something I've been thinking about, actually,
is creating a "Create Transaction from Template" ... it doesn't have
to be recurring/scheduled, but simply defines a cookie-cutter for the
book entries.

| Right now the TT
| interface is fairly rigid.

In what way?

| Josh, do you have a preference how I add to the TT objects?  In
| particular I need to add the following fields to what currently exist:

| 	date

Well, I obviously don't want/need the date to be in the template
transaction, but as it's the responsibilty of the caller to DTRT with
the fields of the TTinfo structure, that'd be fine...

| 	type / typeID

What's a 'type'?  How does this intersect with dave_p's recent
[unannounced? -- I haven't cvs-updated in a couple of weeks] typed-GUID
work?

| 	qty / price / tax

It seems like 'tax' is a split, a the qty/price stuff mimcs
stocks/commodities ... hopefully you can extend the TTinfo stuff to
take advantage of that ... which would be nice because the SX template
transactions should also include the ability to create template
Stock-account transactions at some point.

See my reply to your design doc for more thoughts about this.

| 	discount
| 	invoiced?
| 	invoice-ptr

I get a bit worried when I see this ... I guess these are things that
related to new first-class [business] engine objects, but I worry about
what the interface will look like down the road:

<example_fragment file="SX-TTinfo.h">
/* These apply to account transactions */
gnc_ttsplitinfo_set_credit_formula(...);
gnc_ttsplitinfo_set_debit_formula(...);
...

/* These apply to Invoiceable Items */
gnc_ttsplitinfo_set_invoice_status( bool );
gnc_ttsplitinfo_set_invoice_ptr( GUID invoicePtr );

/* These apply to Foo items */
gnc_ttsplitinfo_set_foo_this( ... );
gnc_ttsplitinfo_set_foo_that( ... );

/* These apply to Bar items */
...
</example_fragment>

I'm just worried it becomes fragmented-interface hell to support ea. kind
of object in the system.

...jsled