6.6. Design improvements

qof_book_merge needs a method to add references to entire QOF objects into other QOF objects as variables. e.g. Account and GncAddress objects are often referenced by other objects. qof_class definitions exist under GNC_ID types and merge will be extended to get and retrieve such object references.

Each GNC_ID is defined in QOF anyway - propose a check on the mergeType before the comparison.

Use the unknown type to reproduce the links that already exist in the import book for objects that contain the unknown type. i.e. Set get_fcn and set_fcn for object parameters that take or return objects that are already registered with QofObject/QofClass. Then when that parameter is compared, the GNC_ID... will fail to match any of the QOF_TYPE... fundamental data types - this is the unknown type. Store the QofEntity of that type within the rule for the 'parent' object.

Later, run a secondary loop to match up the child QofEntity with the qof_book_mergeResult of the actual object, use that to modulate the qof_book_mergeResult of the parent object.

e.g.

{ INVOICE_ACC, 	GNC_ID_ACCOUNT, 	(QofAccessFunc)gncInvoiceGetPostedAcc, 	NULL },
	

This parameter could use (QofSetterFunc)gncInvoiceSetPostedAcc - which takes an Account object - not a fundamental QOF_TYPE.

In the rule that is dealing with the Invoice QofEntity, use the QofObject and QofClass definitions to obtain the parameter of the INVOICE_ACC account. qof_class_is_registered, QofInstance -> QofEntity.

Table 6-3. Struct members (Engine) with resolved issues.

TypeNameDefaultReason / Plan
Account
QofInstanceinstset by create:OK
gint32version0Not suitable for merge.
guint32version0Not suitable for merge.
Split
QofEntityentityqof_entity_init()OK
QofBook*bookset be create:OK
Account*accNULLResolved
GNCLot*lotNULLResolved
Transaction*parentNULLResolved
unsigned chargainsNULLSet via xaccSplitSetSharePrice - please report any issues
Transaction
QofInstanceinstset by create:OK
gint32version0Not suitable for merge.
guint32version0Not suitable for merge.
Transaction*origNULLResolved.
Price
QofInstanceinstset by create:OK
GncPriceDB*dbnot setThis appears to be handled internally - please report any issues
gint32version0Not suitable for merge.
guint32version0Not suitable for merge.

Table 6-4. Struct members (Business) with resolved issues.

TypeNameDefaultReason / Plan
gncAddress
QofBook*bookset by create:OK
gbooleandirtyFALSEinternal - OK
gncBillTerm
QofInstanceinstset by create:OK
GncBillTermTypetypeundefinedResolved.
gncCustomer
QofInstanceinstset by create:OK
GncTaxTable*taxtableundefinedResolved
GncTaxIncludedtaxincludedundefinedResolved
GncBillTerm*termsundefinedResolved.
gncEmployee
QofInstanceinstset by create:OK
Account*ccard_accundefinedResolved.
Account*i_accountundefinedResolved.
GncTaxTable*i_taxtableundefinedResolved
Account*b_accountundefinedResolved.
GncTaxTable*b_taxtableundefinedResolved
gbooleanvalues_dirtyTRUEinternal value, not to be set.
gnc_numerici_valueundefinedcalculated value, not to be set.
gnc_numerici_value_roundedundefinedcalculated value, not to be set.
gnc_numerici_tax_valueundefinedcalculated value, not to be set.
gnc_numerici_tax_value_roundedundefinedcalculated value, not to be set.
gnc_numericb_valueundefinedcalculated value, not to be set.
gnc_numericb_value_roundedundefinedcalculated value, not to be set.
gnc_numericb_tax_valueundefinedcalculated value, not to be set.
gnc_numericb_tax_value_roundedundefinedcalculated value, not to be set.
Timespecb_taxtable_modtimeundefinedcalculated value, not to be set.
gncInvoice
QofInstanceinstset by create:OK
char*printnameNULLinternal value. Not set.
GncBillTerm*termsundefinedResolved.
GList*entriesundefinedInternal variable, not to be set.
GncJob*jobundefinedResolved.
gnc_numericto_charge_amountgnc_numeric_zerocalculated value, not to be set.
Account*posted_accundefinedResolved.
Transaction*posted_txnundefinedResolved.
GNCLot*posted_lotundefinedResolved.