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.
| Type | Name | Default | Reason / Plan |
|---|---|---|---|
| Account | |||
| QofInstance | inst | set by create: | OK |
| gint32 | version | 0 | Not suitable for merge. |
| guint32 | version | 0 | Not suitable for merge. |
| Split | |||
| QofEntity | entity | qof_entity_init() | OK |
| QofBook* | book | set be create: | OK |
| Account* | acc | NULL | Resolved |
| GNCLot* | lot | NULL | Resolved |
| Transaction* | parent | NULL | Resolved |
| unsigned char | gains | NULL | Set via xaccSplitSetSharePrice - please report any issues |
| Transaction | |||
| QofInstance | inst | set by create: | OK |
| gint32 | version | 0 | Not suitable for merge. |
| guint32 | version | 0 | Not suitable for merge. |
| Transaction* | orig | NULL | Resolved. |
| Price | |||
| QofInstance | inst | set by create: | OK |
| GncPriceDB* | db | not set | This appears to be handled internally - please report any issues |
| gint32 | version | 0 | Not suitable for merge. |
| guint32 | version | 0 | Not suitable for merge. |
Table 6-4. Struct members (Business) with resolved issues.
| Type | Name | Default | Reason / Plan |
|---|---|---|---|
| gncAddress | |||
| QofBook* | book | set by create: | OK |
| gboolean | dirty | FALSE | internal - OK |
| gncBillTerm | |||
| QofInstance | inst | set by create: | OK |
| GncBillTermType | type | undefined | Resolved. |
| gncCustomer | |||
| QofInstance | inst | set by create: | OK |
| GncTaxTable* | taxtable | undefined | Resolved |
| GncTaxIncluded | taxincluded | undefined | Resolved |
| GncBillTerm* | terms | undefined | Resolved. |
| gncEmployee | |||
| QofInstance | inst | set by create: | OK |
| Account* | ccard_acc | undefined | Resolved. |
| Account* | i_account | undefined | Resolved. |
| GncTaxTable* | i_taxtable | undefined | Resolved |
| Account* | b_account | undefined | Resolved. |
| GncTaxTable* | b_taxtable | undefined | Resolved |
| gboolean | values_dirty | TRUE | internal value, not to be set. |
| gnc_numeric | i_value | undefined | calculated value, not to be set. |
| gnc_numeric | i_value_rounded | undefined | calculated value, not to be set. |
| gnc_numeric | i_tax_value | undefined | calculated value, not to be set. |
| gnc_numeric | i_tax_value_rounded | undefined | calculated value, not to be set. |
| gnc_numeric | b_value | undefined | calculated value, not to be set. |
| gnc_numeric | b_value_rounded | undefined | calculated value, not to be set. |
| gnc_numeric | b_tax_value | undefined | calculated value, not to be set. |
| gnc_numeric | b_tax_value_rounded | undefined | calculated value, not to be set. |
| Timespec | b_taxtable_modtime | undefined | calculated value, not to be set. |
| gncInvoice | |||
| QofInstance | inst | set by create: | OK |
| char* | printname | NULL | internal value. Not set. |
| GncBillTerm* | terms | undefined | Resolved. |
| GList* | entries | undefined | Internal variable, not to be set. |
| GncJob* | job | undefined | Resolved. |
| gnc_numeric | to_charge_amount | gnc_numeric_zero | calculated value, not to be set. |
| Account* | posted_acc | undefined | Resolved. |
| Transaction* | posted_txn | undefined | Resolved. |
| GNCLot* | posted_lot | undefined | Resolved. |