From f1c1bf87baf99d08e94dff868f084087be861f3e Mon Sep 17 00:00:00 2001 From: Phil Longstaff Date: Sun, 27 Jul 2008 15:04:17 +0000 Subject: [PATCH] 1) "bill" in entry should be an invoice reference, not bill terms reference 2) Fix handling of NULL bill terms reference git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gda-dev2@17419 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-core/sql/gnc-bill-term-sql.c | 2 +- src/business/business-core/sql/gnc-entry-sql.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/business/business-core/sql/gnc-bill-term-sql.c b/src/business/business-core/sql/gnc-bill-term-sql.c index 1a1c4aa8a6..fd1fbeab66 100644 --- a/src/business/business-core/sql/gnc-bill-term-sql.c +++ b/src/business/business-core/sql/gnc-bill-term-sql.c @@ -199,7 +199,7 @@ load_billterm_guid( const GncSqlBackend* be, GncSqlRow* row, g_return_if_fail( table_row != NULL ); val = gnc_sql_row_get_value_at_col_name( row, table_row->col_name ); - if( val == NULL ) { + if( val == NULL || !G_VALUE_HOLDS_STRING( val ) || g_value_get_string( val ) == NULL ) { pGuid = NULL; } else { string_to_guid( g_value_get_string( val ), &guid ); diff --git a/src/business/business-core/sql/gnc-entry-sql.c b/src/business/business-core/sql/gnc-entry-sql.c index ced35710b4..21fa5e0d34 100644 --- a/src/business/business-core/sql/gnc-entry-sql.c +++ b/src/business/business-core/sql/gnc-entry-sql.c @@ -83,7 +83,7 @@ static GncSqlColumnTableEntry col_table[] = (QofAccessFunc)gncEntryGetInvTaxTable, (QofSetterFunc)gncEntrySetInvTaxTable }, { "b_acct", CT_ACCOUNTREF, 0, 0, NULL, ENTRY_BACCT }, { "b_price", CT_NUMERIC, 0, 0, NULL, ENTRY_BPRICE }, - { "bill", CT_BILLTERMREF, 0, 0, NULL, NULL, + { "bill", CT_INVOICEREF, 0, 0, NULL, NULL, (QofAccessFunc)gncEntryGetBill, (QofSetterFunc)gncEntrySetBill }, { "b_taxable", CT_BOOLEAN, 0, 0, NULL, ENTRY_BILL_TAXABLE }, { "b_taxincluded", CT_BOOLEAN, 0, 0, NULL, ENTRY_BILL_TAX_INC },