mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
If an object is loaded with a reference to an invoice, order, tax table or bill term which
has not been loaded yet, print a warning message into the trace file. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18308 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
ca6a78b89d
commit
f110ce2c68
@ -208,7 +208,6 @@ load_billterm_guid( const GncSqlBackend* be, GncSqlRow* row,
|
||||
{
|
||||
const GValue* val;
|
||||
GUID guid;
|
||||
const GUID* pGuid;
|
||||
GncBillTerm* term = NULL;
|
||||
|
||||
g_return_if_fail( be != NULL );
|
||||
@ -217,20 +216,19 @@ 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 || !G_VALUE_HOLDS_STRING( val ) || g_value_get_string( val ) == NULL ) {
|
||||
pGuid = NULL;
|
||||
} else {
|
||||
if( val != NULL && G_VALUE_HOLDS_STRING( val ) && g_value_get_string( val ) != NULL ) {
|
||||
string_to_guid( g_value_get_string( val ), &guid );
|
||||
pGuid = &guid;
|
||||
}
|
||||
if( pGuid != NULL ) {
|
||||
term = gncBillTermLookup( be->primary_book, pGuid );
|
||||
}
|
||||
term = gncBillTermLookup( be->primary_book, &guid );
|
||||
if( term != NULL ) {
|
||||
if( table_row->gobj_param_name != NULL ) {
|
||||
g_object_set( pObject, table_row->gobj_param_name, term, NULL );
|
||||
} else {
|
||||
(*setter)( pObject, (const gpointer)term );
|
||||
}
|
||||
} else {
|
||||
PWARN( "Billterm ref '%s' not found", g_value_get_string( val ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GncSqlColumnTypeHandler billterm_guid_handler
|
||||
|
@ -253,7 +253,6 @@ load_invoice_guid( const GncSqlBackend* be, GncSqlRow* row,
|
||||
{
|
||||
const GValue* val;
|
||||
GUID guid;
|
||||
const GUID* pGuid;
|
||||
GncInvoice* invoice = NULL;
|
||||
|
||||
g_return_if_fail( be != NULL );
|
||||
@ -262,20 +261,19 @@ load_invoice_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 || !G_VALUE_HOLDS_STRING( val ) || g_value_get_string( val ) == NULL ) {
|
||||
pGuid = NULL;
|
||||
} else {
|
||||
if( val != NULL && G_VALUE_HOLDS_STRING( val ) && g_value_get_string( val ) != NULL ) {
|
||||
string_to_guid( g_value_get_string( val ), &guid );
|
||||
pGuid = &guid;
|
||||
}
|
||||
if( pGuid != NULL ) {
|
||||
invoice = gncInvoiceLookup( be->primary_book, pGuid );
|
||||
}
|
||||
invoice = gncInvoiceLookup( be->primary_book, &guid );
|
||||
if( invoice != NULL ) {
|
||||
if( table_row->gobj_param_name != NULL ) {
|
||||
g_object_set( pObject, table_row->gobj_param_name, invoice, NULL );
|
||||
} else {
|
||||
(*setter)( pObject, (const gpointer)invoice );
|
||||
}
|
||||
} else {
|
||||
PWARN( "Invoice ref '%s' not found", g_value_get_string( val ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GncSqlColumnTypeHandler invoice_guid_handler
|
||||
|
@ -198,7 +198,6 @@ load_order_guid( const GncSqlBackend* be, GncSqlRow* row,
|
||||
{
|
||||
const GValue* val;
|
||||
GUID guid;
|
||||
const GUID* pGuid;
|
||||
GncOrder* order = NULL;
|
||||
|
||||
g_return_if_fail( be != NULL );
|
||||
@ -207,20 +206,19 @@ load_order_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 || !G_VALUE_HOLDS_STRING( val ) || g_value_get_string( val ) == NULL ) {
|
||||
pGuid = NULL;
|
||||
} else {
|
||||
if( val != NULL && G_VALUE_HOLDS_STRING( val ) && g_value_get_string( val ) != NULL ) {
|
||||
string_to_guid( g_value_get_string( val ), &guid );
|
||||
pGuid = &guid;
|
||||
}
|
||||
if( pGuid != NULL ) {
|
||||
order = gncOrderLookup( be->primary_book, pGuid );
|
||||
}
|
||||
order = gncOrderLookup( be->primary_book, &guid );
|
||||
if( order != NULL ) {
|
||||
if( table_row->gobj_param_name != NULL ) {
|
||||
g_object_set( pObject, table_row->gobj_param_name, order, NULL );
|
||||
} else {
|
||||
(*setter)( pObject, (const gpointer)order );
|
||||
}
|
||||
} else {
|
||||
PWARN( "Order ref '%s' not found", g_value_get_string( val ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GncSqlColumnTypeHandler order_guid_handler
|
||||
|
@ -393,7 +393,6 @@ load_taxtable_guid( const GncSqlBackend* be, GncSqlRow* row,
|
||||
{
|
||||
const GValue* val;
|
||||
GUID guid;
|
||||
const GUID* pGuid;
|
||||
GncTaxTable* taxtable = NULL;
|
||||
|
||||
g_return_if_fail( be != NULL );
|
||||
@ -402,20 +401,19 @@ load_taxtable_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 || !G_VALUE_HOLDS_STRING( val ) || g_value_get_string( val ) == NULL ) {
|
||||
pGuid = NULL;
|
||||
} else {
|
||||
if( val != NULL && G_VALUE_HOLDS_STRING( val ) && g_value_get_string( val ) != NULL ) {
|
||||
string_to_guid( g_value_get_string( val ), &guid );
|
||||
pGuid = &guid;
|
||||
}
|
||||
if( pGuid != NULL ) {
|
||||
taxtable = gncTaxTableLookup( be->primary_book, pGuid );
|
||||
}
|
||||
taxtable = gncTaxTableLookup( be->primary_book, &guid );
|
||||
if( taxtable != NULL ) {
|
||||
if( table_row->gobj_param_name != NULL ) {
|
||||
g_object_set( pObject, table_row->gobj_param_name, taxtable, NULL );
|
||||
} else {
|
||||
(*setter)( pObject, (const gpointer)taxtable );
|
||||
}
|
||||
} else {
|
||||
PWARN( "Taxtable ref '%s' not found", g_value_get_string( val ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GncSqlColumnTypeHandler taxtable_guid_handler
|
||||
|
Loading…
Reference in New Issue
Block a user