static void remove_guids (Split *sa, Split *sb) { KvpFrame *ksub; /* Find and remove the matching guid's */ ksub = (KvpFrame*)gnc_kvp_bag_find_by_guid (sa->inst.kvp_data, "lot-split", "peer_guid", qof_instance_get_guid(sb)); if (ksub) { gnc_kvp_bag_remove_frame (sa->inst.kvp_data, "lot-split", ksub); kvp_frame_delete (ksub); } /* Now do it in the other direction */ ksub = (KvpFrame*)gnc_kvp_bag_find_by_guid (sb->inst.kvp_data, "lot-split", "peer_guid", qof_instance_get_guid(sa)); if (ksub) { gnc_kvp_bag_remove_frame (sb->inst.kvp_data, "lot-split", ksub); kvp_frame_delete (ksub); } /* Finally, merge b's lot-splits, if any, into a's */ /* This is an important step, if it got busted into many pieces. */ gnc_kvp_bag_merge (sa->inst.kvp_data, "lot-split", sb->inst.kvp_data, "lot-split"); }
static xmlNodePtr vendor_dom_tree_create (GncVendor* vendor) { xmlNodePtr ret; GncBillTerm* term; GncTaxTable* taxtable; ret = xmlNewNode (NULL, BAD_CAST gnc_vendor_string); xmlSetProp (ret, BAD_CAST "version", BAD_CAST vendor_version_string); xmlAddChild (ret, guid_to_dom_tree (vendor_guid_string, qof_instance_get_guid (QOF_INSTANCE (vendor)))); xmlAddChild (ret, text_to_dom_tree (vendor_name_string, gncVendorGetName (vendor))); xmlAddChild (ret, text_to_dom_tree (vendor_id_string, gncVendorGetID (vendor))); xmlAddChild (ret, gnc_address_to_dom_tree (vendor_addr_string, gncVendorGetAddr (vendor))); maybe_add_string (ret, vendor_notes_string, gncVendorGetNotes (vendor)); term = gncVendorGetTerms (vendor); if (term) xmlAddChild (ret, guid_to_dom_tree (vendor_terms_string, qof_instance_get_guid (QOF_INSTANCE (term)))); xmlAddChild (ret, text_to_dom_tree (vendor_taxincluded_string, gncTaxIncludedTypeToString ( gncVendorGetTaxIncluded (vendor)))); xmlAddChild (ret, int_to_dom_tree (vendor_active_string, gncVendorGetActive (vendor))); xmlAddChild (ret, commodity_ref_to_dom_tree (vendor_currency_string, gncVendorGetCurrency (vendor))); xmlAddChild (ret, int_to_dom_tree (vendor_taxtableoverride_string, gncVendorGetTaxTableOverride (vendor))); taxtable = gncVendorGetTaxTable (vendor); if (taxtable) xmlAddChild (ret, guid_to_dom_tree (vendor_taxtable_string, qof_instance_get_guid (QOF_INSTANCE (taxtable)))); /* xmlAddChild won't do anything with a NULL, so tests are superfluous. */ xmlAddChild (ret, qof_instance_slots_to_dom_tree (vendor_slots_string, QOF_INSTANCE (vendor))); return ret; }
/* for each entry, check the tax tables. If the tax tables are * grandchildren, then fix them to point to the most senior child */ static void taxtable_scrub_entries (QofInstance * entry_p, gpointer ht_p) { GHashTable *ht = static_cast<decltype(ht)>(ht_p); GncEntry *entry = GNC_ENTRY(entry_p); GncTaxTable *table, *new_tt; gint32 count; table = gncEntryGetInvTaxTable(entry); if (table) { if (taxtable_is_grandchild(table)) { gchar guidstr[GUID_ENCODING_LENGTH+1]; guid_to_string_buff(qof_instance_get_guid(QOF_INSTANCE(entry)),guidstr); PINFO("Fixing i-taxtable on entry %s\n",guidstr); new_tt = taxtable_find_senior(table); gncEntryBeginEdit(entry); gncEntrySetInvTaxTable(entry, new_tt); gncEntryCommitEdit(entry); table = new_tt; } if (table) { count = GPOINTER_TO_INT(g_hash_table_lookup(ht, table)); count++; g_hash_table_insert(ht, table, GINT_TO_POINTER(count)); } } table = gncEntryGetBillTaxTable(entry); if (table) { if (taxtable_is_grandchild(table)) { gchar guidstr[GUID_ENCODING_LENGTH+1]; guid_to_string_buff(qof_instance_get_guid(QOF_INSTANCE(entry)),guidstr); PINFO("Fixing b-taxtable on entry %s\n",guidstr); new_tt = taxtable_find_senior(table); gncEntryBeginEdit(entry); gncEntrySetBillTaxTable(entry, new_tt); gncEntryCommitEdit(entry); table = new_tt; } if (table) { count = GPOINTER_TO_INT(g_hash_table_lookup(ht, table)); count++; g_hash_table_insert(ht, table, GINT_TO_POINTER(count)); } } }
static xmlNodePtr employee_dom_tree_create (GncEmployee *employee) { xmlNodePtr ret, kvpnode; gnc_numeric num; Account* ccard_acc; ret = xmlNewNode(NULL, BAD_CAST gnc_employee_string); xmlSetProp(ret, BAD_CAST "version", BAD_CAST employee_version_string); xmlAddChild(ret, guid_to_dom_tree(employee_guid_string, qof_instance_get_guid(QOF_INSTANCE (employee)))); xmlAddChild(ret, text_to_dom_tree(employee_username_string, gncEmployeeGetUsername (employee))); xmlAddChild(ret, text_to_dom_tree(employee_id_string, gncEmployeeGetID (employee))); xmlAddChild(ret, gnc_address_to_dom_tree(employee_addr_string, gncEmployeeGetAddr (employee))); maybe_add_string (ret, employee_language_string, gncEmployeeGetLanguage (employee)); maybe_add_string (ret, employee_acl_string, gncEmployeeGetAcl (employee)); xmlAddChild(ret, int_to_dom_tree(employee_active_string, gncEmployeeGetActive (employee))); num = gncEmployeeGetWorkday (employee); xmlAddChild(ret, gnc_numeric_to_dom_tree (employee_workday_string, &num)); num = gncEmployeeGetRate (employee); xmlAddChild(ret, gnc_numeric_to_dom_tree (employee_rate_string, &num)); xmlAddChild (ret, commodity_ref_to_dom_tree(employee_currency_string, gncEmployeeGetCurrency (employee))); ccard_acc = gncEmployeeGetCCard (employee); if (ccard_acc) xmlAddChild(ret, guid_to_dom_tree(employee_ccard_string, qof_instance_get_guid(QOF_INSTANCE(ccard_acc)))); kvpnode = kvp_frame_to_dom_tree (employee_slots_string, qof_instance_get_slots (QOF_INSTANCE(employee))); if (kvpnode) xmlAddChild (ret, kvpnode); return ret; }
static void maybe_add_guid (xmlNodePtr ptr, const char *tag, GncTaxTable *table) { if (table) xmlAddChild (ptr, guid_to_dom_tree (tag, qof_instance_get_guid(QOF_INSTANCE(table)))); }
static xmlNodePtr job_dom_tree_create (GncJob *job) { xmlNodePtr ret; ret = xmlNewNode(NULL, BAD_CAST gnc_job_string); xmlSetProp(ret, BAD_CAST "version", BAD_CAST job_version_string); xmlAddChild(ret, guid_to_dom_tree(job_guid_string, qof_instance_get_guid (QOF_INSTANCE (job)))); xmlAddChild(ret, text_to_dom_tree(job_id_string, gncJobGetID (job))); xmlAddChild(ret, text_to_dom_tree(job_name_string, gncJobGetName (job))); maybe_add_string (ret, job_reference_string, gncJobGetReference (job)); xmlAddChild(ret, gnc_owner_to_dom_tree (job_owner_string, gncJobGetOwner (job))); xmlAddChild(ret, int_to_dom_tree(job_active_string, gncJobGetActive (job))); return ret; }
static /*@ null @*/ Transaction* load_single_tx( GncSqlBackend* be, GncSqlRow* row ) { const GncGUID* guid; GncGUID tx_guid; Transaction* pTx; g_return_val_if_fail( be != NULL, NULL ); g_return_val_if_fail( row != NULL, NULL ); guid = gnc_sql_load_guid( be, row ); if ( guid == NULL ) return NULL; tx_guid = *guid; // Don't overwrite the transaction if it's already been loaded (and possibly modified). pTx = xaccTransLookup( &tx_guid, be->book ); if ( pTx != NULL ) { return NULL; } pTx = xaccMallocTransaction( be->book ); xaccTransBeginEdit( pTx ); gnc_sql_load_object( be, row, GNC_ID_TRANS, pTx, tx_col_table ); if (pTx != xaccTransLookup( &tx_guid, be->book )) { PERR("A malformed transaction with id %s was found in the dataset.", guid_to_string(qof_instance_get_guid(pTx))); qof_backend_set_error( &be->be, ERR_BACKEND_DATA_CORRUPT); pTx = NULL; } return pTx; }
static void load_taxtable_entries( GncSqlBackend* be, GncTaxTable* tt ) { GncSqlResult* result; gchar guid_buf[GUID_ENCODING_LENGTH+1]; GValue value; gchar* buf; GncSqlStatement* stmt; GError* error = NULL; g_return_if_fail( be != NULL ); g_return_if_fail( tt != NULL ); guid_to_string_buff( qof_instance_get_guid( QOF_INSTANCE(tt) ), guid_buf ); memset( &value, 0, sizeof( GValue ) ); g_value_init( &value, G_TYPE_STRING ); g_value_set_string( &value, guid_buf ); buf = g_strdup_printf( "SELECT * FROM %s WHERE taxtable='%s'", TTENTRIES_TABLE_NAME, guid_buf ); stmt = gnc_sql_connection_create_statement_from_sql( be->conn, buf ); g_free( buf ); result = gnc_sql_execute_select_statement( be, stmt ); gnc_sql_statement_dispose( stmt ); if ( result != NULL ) { GncSqlRow* row; row = gnc_sql_result_get_first_row( result ); while ( row != NULL ) { load_single_ttentry( be, row, tt ); row = gnc_sql_result_get_next_row( result ); } gnc_sql_result_dispose( result ); } }
/* for each invoice, check the bill terms. If the bill terms are * grandchildren, then fix them to point to the most senior child */ static void billterm_scrub_invoices (QofInstance * invoice_p, gpointer ht_p) { GHashTable *ht = ht_p; GncInvoice *invoice = GNC_INVOICE(invoice_p); GncBillTerm *term, *new_bt; gint32 count; term = gncInvoiceGetTerms(invoice); if (term) { if (billterm_is_grandchild(term)) { gchar guidstr[GUID_ENCODING_LENGTH+1]; guid_to_string_buff(qof_instance_get_guid(QOF_INSTANCE(invoice)),guidstr); PWARN("Fixing i-billterm on invoice %s\n", guidstr); new_bt = billterm_find_senior(term); gncInvoiceBeginEdit(invoice); gncInvoiceSetTerms(invoice, new_bt); gncInvoiceCommitEdit(invoice); term = new_bt; } if (term) { count = GPOINTER_TO_INT(g_hash_table_lookup(ht, term)); count++; g_hash_table_insert(ht, term, GINT_TO_POINTER(count)); } } }
static void qof_instance_coll_copy(QofInstance *original, gpointer user_data) { QofInstanceCopyData *qecd; QofBook *book; QofInstance *inst; const GncGUID *g; g_return_if_fail(original != NULL); g_return_if_fail(user_data != NULL); qecd = (QofInstanceCopyData*)user_data; book = qof_session_get_book(qecd->new_session); if (!qof_object_compliance(original->e_type, TRUE)) { return; } inst = (QofInstance*)qof_object_new_instance(original->e_type, book); qecd->to = inst; qecd->from = original; g = qof_instance_get_guid(original); qof_instance_set_guid(qecd->to, g); qof_begin_edit(inst); g_slist_foreach(qecd->param_list, qof_instance_foreach_copy, qecd); qof_commit_edit(inst); }
static void col_ref_cb (QofInstance* ref_ent, gpointer user_data) { QofInstanceReference *ref; QofInstanceCopyData *qecd; QofInstance *ent; const GncGUID *cm_guid; char cm_sa[GUID_ENCODING_LENGTH + 1]; gchar *cm_string; g_return_if_fail(user_data); qecd = (QofInstanceCopyData*)user_data; ent = qecd->from; g_return_if_fail(ent); ref = g_new0(QofInstanceReference, 1); ref->type = ent->e_type; ref->ref_guid = g_new(GncGUID, 1); ref->ent_guid = qof_instance_get_guid(ent); ref->param = qof_class_get_parameter(ent->e_type, qecd->param->param_name); cm_guid = qof_entity_get_guid(ref_ent); guid_to_string_buff(cm_guid, cm_sa); cm_string = g_strdup(cm_sa); if (TRUE == string_to_guid(cm_string, ref->ref_guid)) { g_free(cm_string); qof_session_update_reference_list(qecd->new_session, ref); } }
void gncBillTermDestroy (GncBillTerm *term) { if (!term) return; DEBUG("destroying bill term %s (%p)", guid_to_string(qof_instance_get_guid(&term->inst)), term); qof_instance_set_destroying(term, TRUE); qof_instance_set_dirty (&term->inst); gncBillTermCommitEdit (term); }
static QofSession* create_session(void) { QofSession* session = qof_session_new(); QofBook* book = qof_session_get_book( session ); Account* root = gnc_book_get_root_account( book ); Account* acct1; Account* acct2; KvpFrame* frame; Transaction* tx; Split* spl1; Split* spl2; Timespec ts; struct timeval tv; gnc_commodity_table* table; gnc_commodity* currency; table = gnc_commodity_table_get_table( book ); currency = gnc_commodity_table_lookup( table, GNC_COMMODITY_NS_CURRENCY, "CAD" ); acct1 = xaccMallocAccount( book ); xaccAccountSetType( acct1, ACCT_TYPE_BANK ); xaccAccountSetName( acct1, "Bank 1" ); xaccAccountSetCommodity( acct1, currency ); frame = qof_instance_get_slots( QOF_INSTANCE(acct1) ); kvp_frame_set_gint64( frame, "int64-val", 100 ); kvp_frame_set_double( frame, "double-val", 3.14159 ); kvp_frame_set_numeric( frame, "numeric-val", gnc_numeric_zero() ); time( &(tv.tv_sec) ); tv.tv_usec = 0; ts.tv_sec = tv.tv_sec; ts.tv_nsec = 1000 * tv.tv_usec; kvp_frame_set_timespec( frame, "timespec-val", ts ); kvp_frame_set_string( frame, "string-val", "abcdefghijklmnop" ); kvp_frame_set_guid( frame, "guid-val", qof_instance_get_guid( QOF_INSTANCE(acct1) ) ); gnc_account_append_child( root, acct1 ); acct2 = xaccMallocAccount( book ); xaccAccountSetType( acct2, ACCT_TYPE_BANK ); xaccAccountSetName( acct2, "Bank 1" ); tx = xaccMallocTransaction( book ); xaccTransBeginEdit( tx ); xaccTransSetCurrency( tx, currency ); spl1 = xaccMallocSplit( book ); xaccTransAppendSplit( tx, spl1 ); spl2 = xaccMallocSplit( book ); xaccTransAppendSplit( tx, spl2 ); xaccTransCommitEdit( tx ); return session; }
/* ================================================================= */ bool GncSqlInvoiceBackend::commit (GncSqlBackend* be, QofInstance* inst) { const GncGUID* guid; GncInvoice* invoice; E_DB_OPERATION op; gboolean is_infant; gboolean is_ok = TRUE; g_return_val_if_fail (inst != NULL, FALSE); g_return_val_if_fail (GNC_IS_INVOICE (inst), FALSE); g_return_val_if_fail (be != NULL, FALSE); invoice = GNC_INVOICE (inst); is_infant = qof_instance_get_infant (inst); if (qof_instance_get_destroying (inst)) { op = OP_DB_DELETE; } else if (be->pristine() || is_infant) { op = OP_DB_INSERT; } else { op = OP_DB_UPDATE; } if (op != OP_DB_DELETE) { // Ensure the commodity is in the db is_ok = gnc_sql_save_commodity (be, gncInvoiceGetCurrency (invoice)); } if (is_ok) { is_ok = gnc_sql_do_db_operation (be, op, TABLE_NAME, GNC_ID_INVOICE, inst, col_table); } if (is_ok) { // Now, commit or delete any slots guid = qof_instance_get_guid (inst); if (!qof_instance_get_destroying (inst)) { is_ok = gnc_sql_slots_save (be, guid, is_infant, inst); } else { is_ok = gnc_sql_slots_delete (be, guid); } } return is_ok; }
/* ================================================================= */ static gboolean save_employee (GncSqlBackend* be, QofInstance* inst) { GncEmployee* emp; const GncGUID* guid; E_DB_OPERATION op; gboolean is_infant; gboolean is_ok = TRUE; g_return_val_if_fail (inst != NULL, FALSE); g_return_val_if_fail (GNC_IS_EMPLOYEE (inst), FALSE); g_return_val_if_fail (be != NULL, FALSE); emp = GNC_EMPLOYEE (inst); is_infant = qof_instance_get_infant (inst); if (qof_instance_get_destroying (inst)) { op = OP_DB_DELETE; } else if (be->is_pristine_db || is_infant) { op = OP_DB_INSERT; } else { op = OP_DB_UPDATE; } if (op != OP_DB_DELETE) { // Ensure the commodity is in the db is_ok = gnc_sql_save_commodity (be, gncEmployeeGetCurrency (emp)); } if (is_ok) { is_ok = gnc_sql_do_db_operation (be, op, TABLE_NAME, GNC_ID_EMPLOYEE, emp, col_table); } if (is_ok) { // Now, commit or delete any slots guid = qof_instance_get_guid (inst); if (!qof_instance_get_destroying (inst)) { is_ok = gnc_sql_slots_save (be, guid, is_infant, inst); } else { is_ok = gnc_sql_slots_delete (be, guid); } } return is_ok; }
void gncBillTermDestroy (GncBillTerm *term) { gchar guidstr[GUID_ENCODING_LENGTH+1]; if (!term) return; guid_to_string_buff(qof_instance_get_guid(&term->inst),guidstr); DEBUG("destroying bill term %s (%p)", guidstr, term); qof_instance_set_destroying(term, TRUE); qof_instance_set_dirty (&term->inst); gncBillTermCommitEdit (term); }
/* ================================================================= */ bool GncSqlSchedXactionBackend::commit (GncSqlBackend* sql_be, QofInstance* inst) { SchedXaction* pSx; const GncGUID* guid; E_DB_OPERATION op; gboolean is_infant; gboolean is_ok; g_return_val_if_fail (sql_be != NULL, FALSE); g_return_val_if_fail (inst != NULL, FALSE); g_return_val_if_fail (GNC_IS_SX (inst), FALSE); pSx = GNC_SX (inst); is_infant = qof_instance_get_infant (inst); if (qof_instance_get_destroying (inst)) { op = OP_DB_DELETE; } else if (sql_be->pristine() || is_infant) { op = OP_DB_INSERT; } else { op = OP_DB_UPDATE; } is_ok = sql_be->do_db_operation(op, SCHEDXACTION_TABLE, GNC_SX_ID, pSx, col_table); guid = qof_instance_get_guid (inst); if (op == OP_DB_INSERT || op == OP_DB_UPDATE) { gnc_sql_recurrence_save_list (sql_be, guid, gnc_sx_get_schedule (pSx)); } else { gnc_sql_recurrence_delete (sql_be, guid); } if (is_ok) { // Now, commit any slots if (op == OP_DB_INSERT || op == OP_DB_UPDATE) { is_ok = gnc_sql_slots_save (sql_be, guid, is_infant, inst); } else { is_ok = gnc_sql_slots_delete (sql_be, guid); } } return is_ok; }
/* ================================================================= */ bool GncSqlVendorBackend::commit (GncSqlBackend* sql_be, QofInstance* inst) { GncVendor* v; const GncGUID* guid; E_DB_OPERATION op; gboolean is_infant; gboolean is_ok = TRUE; g_return_val_if_fail (inst != NULL, FALSE); g_return_val_if_fail (GNC_IS_VENDOR (inst), FALSE); g_return_val_if_fail (sql_be != NULL, FALSE); v = GNC_VENDOR (inst); is_infant = qof_instance_get_infant (inst); if (qof_instance_get_destroying (inst)) { op = OP_DB_DELETE; } else if (sql_be->pristine() || is_infant) { op = OP_DB_INSERT; } else { op = OP_DB_UPDATE; } if (op != OP_DB_DELETE) { // Ensure the commodity is in the db is_ok = sql_be->save_commodity (gncVendorGetCurrency(v)); } if (is_ok) { is_ok = sql_be->do_db_operation(op, TABLE_NAME, GNC_ID_VENDOR, v, col_table); } if (is_ok) { // Now, commit or delete any slots guid = qof_instance_get_guid (inst); if (!qof_instance_get_destroying (inst)) { is_ok = gnc_sql_slots_save (sql_be, guid, is_infant, inst); } else { is_ok = gnc_sql_slots_delete (sql_be, guid); } } return is_ok; }
bool GncSqlTaxTableBackend::commit (GncSqlBackend* sql_be, QofInstance* inst) { GncTaxTable* tt; const GncGUID* guid; E_DB_OPERATION op; gboolean is_infant; gboolean is_ok; g_return_val_if_fail (inst != NULL, FALSE); g_return_val_if_fail (GNC_IS_TAXTABLE (inst), FALSE); g_return_val_if_fail (sql_be != NULL, FALSE); tt = GNC_TAXTABLE (inst); is_infant = qof_instance_get_infant (inst); if (qof_instance_get_destroying (inst)) { op = OP_DB_DELETE; } else if (sql_be->pristine() || is_infant) { op = OP_DB_INSERT; } else { op = OP_DB_UPDATE; } is_ok = sql_be->do_db_operation(op, TT_TABLE_NAME, GNC_ID_TAXTABLE, tt, tt_col_table); if (is_ok) { // Now, commit or delete any slots and tax table entries guid = qof_instance_get_guid (inst); if (!qof_instance_get_destroying (inst)) { is_ok = gnc_sql_slots_save (sql_be, guid, is_infant, inst); if (is_ok) { is_ok = save_tt_entries (sql_be, guid, gncTaxTableGetEntries (tt)); } } else { is_ok = gnc_sql_slots_delete (sql_be, guid); if (is_ok) { is_ok = delete_all_tt_entries (sql_be, guid); } } } return is_ok; }
static void billterm_scrub_vendor (QofInstance * vendor_p, gpointer ht_p) { GHashTable *ht = ht_p; GncVendor *vendor = GNC_VENDOR(vendor_p); GncBillTerm *term; gint32 count; term = gncVendorGetTerms(vendor); if (term) { count = GPOINTER_TO_INT(g_hash_table_lookup(ht, term)); count++; g_hash_table_insert(ht, term, GINT_TO_POINTER(count)); if (billterm_is_grandchild(term)) PWARN("vendor %s has grandchild billterm %s\n", guid_to_string(qof_instance_get_guid(QOF_INSTANCE(vendor))), guid_to_string(qof_instance_get_guid(QOF_INSTANCE(term)))); } }
static void billterm_scrub_cust (QofInstance * cust_p, gpointer ht_p) { GHashTable *ht = ht_p; GncCustomer *cust = GNC_CUSTOMER(cust_p); GncBillTerm *term; gint32 count; term = gncCustomerGetTerms(cust); if (term) { count = GPOINTER_TO_INT(g_hash_table_lookup(ht, term)); count++; g_hash_table_insert(ht, term, GINT_TO_POINTER(count)); if (billterm_is_grandchild(term)) PWARN("customer %s has grandchild billterm %s\n", guid_to_string(qof_instance_get_guid(QOF_INSTANCE(cust))), guid_to_string(qof_instance_get_guid(QOF_INSTANCE(term)))); } }
const GncGUID * gncOwnerGetGUID (const GncOwner *owner) { if (!owner) return NULL; switch (owner->type) { case GNC_OWNER_NONE: case GNC_OWNER_UNDEFINED: default: return NULL; case GNC_OWNER_CUSTOMER: return qof_instance_get_guid (QOF_INSTANCE(owner->owner.customer)); case GNC_OWNER_JOB: return qof_instance_get_guid (QOF_INSTANCE(owner->owner.job)); case GNC_OWNER_VENDOR: return qof_instance_get_guid (QOF_INSTANCE(owner->owner.vendor)); case GNC_OWNER_EMPLOYEE: return qof_instance_get_guid (QOF_INSTANCE(owner->owner.employee)); } }
static void compare_single_tx( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; Transaction* tx_1 = GNC_TRANS(inst); Transaction* tx_2 = xaccTransLookup( qof_instance_get_guid(inst), info->book_2 ); if (!xaccTransEqual( tx_1, tx_2, TRUE, TRUE, TRUE, FALSE )) { info->result = FALSE; } }
static void compare_single_employee( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncEmployee* emp_1 = GNC_EMPLOYEE(inst); GncEmployee* emp_2 = gncEmployeeLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncEmployeeEqual( emp_1, emp_2 )) { info->result = FALSE; } }
static void compare_single_invoice( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncInvoice* inv_1 = GNC_INVOICE(inst); GncInvoice* inv_2 = gncInvoiceLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncInvoiceEqual( inv_1, inv_2 )) { info->result = FALSE; } }
static void compare_single_customer( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncCustomer* cust_1 = GNC_CUSTOMER(inst); GncCustomer* cust_2 = gncCustomerLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncCustomerEqual( cust_1, cust_2 )) { info->result = FALSE; } }
static void compare_single_taxtable( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncTaxTable* tt_1 = GNC_TAXTABLE(inst); GncTaxTable* tt_2 = gncTaxTableLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncTaxTableEqual( tt_1, tt_2 )) { info->result = FALSE; } }
static void compare_single_billterm( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncBillTerm* bt_1 = GNC_BILLTERM(inst); GncBillTerm* bt_2 = gncBillTermLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncBillTermEqual( bt_1, bt_2 )) { info->result = FALSE; } }
static void compare_single_vendor( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncVendor* vendor_1 = GNC_VENDOR(inst); GncVendor* vendor_2 = gncVendorLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncVendorEqual( vendor_1, vendor_2 )) { info->result = FALSE; } }
static void compare_single_job( QofInstance* inst, gpointer user_data ) { CompareInfoStruct* info = (CompareInfoStruct*)user_data; GncJob* job_1 = GNC_JOB(inst); GncJob* job_2 = gncJobLookup( info->book_2, qof_instance_get_guid(inst) ); if (!gncJobEqual( job_1, job_2 )) { info->result = FALSE; } }