QOF and child objects

Neil Williams linux at codehelp.co.uk
Tue May 3 11:08:30 EDT 2005


On Tuesday 03 May 2005 2:20 pm, Derek Atkins wrote:
> Neil,
>
> [snip -- man, you type a LOT!  I don't think you need to be quite
>  so verbose!  ;) -derek ]

:-) I'll try!

I've just succeeded in outputting a recursive export from GNC_ID_INVOICE - all 
invoices, all billterms, all transactions and all accounts related to the 
invoices. I've got a smaller function that will recurse through a single 
invoice and export all it's children and their children to the third level.

I've got a problem with GncOwner though:

When you ask QOF for the GUID of the owner using the standard QOF_PARAM_GUID, 
you get the GUID of the customer etc. through gncOwnerGetGUID.

The problem is that QOF doesn't know it's a customer at that time and I can't 
get an unknown type, I need to be able to get a genuine QOF object from the 
invoice and use that object to tell me what kind of owner is needed. So 
gncOwnerGetGUID is causing me grief.

(This is after quite a bit of new code added to make GncOwner and GncBillTerm 
usable objects in the first place.)

Is it OK to replace:
{ QOF_PARAM_GUID, QOF_TYPE_GUID,   (QofAccessFunc)gncOwnerGetGUID, NULL },
with
{ QOF_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_instance_get_guid, NULL },
in GncOwner.c?

(Now that I've got a QofInstance in GncOwner)

That's the only change that has to replace what already exists - is it likely 
to break anything else, like any of the Find procedures for Customers or 
Invoices etc?

The rest of the changes can be internal to the object and not affect existing 
functions.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050503/e3649947/attachment.bin


More information about the gnucash-devel mailing list