Don't write <gnc:template-transactions> section unless there is data to write [1.6/1.7 interop-issue brought up on #gnucash].

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4907 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled committed 2001-07-06 08:29:36 +00:00
1 parent f17c578f5d
commit 1e36965ded
2 files changed
+22 -6

No files matched your search

+21 -6
View File
@@ -564,12 +564,27 @@ write_transactions(FILE *out, GNCBook *book)
static void
write_template_transaction_data( FILE *out, GNCBook *book )
{
fprintf( out, "<%s>\n", TEMPLATE_TRANSACTION_TAG );
write_account_group( out, gnc_book_get_template_group(book) );
xaccGroupForEachTransaction( gnc_book_get_template_group(book),
xml_add_trn_data,
(gpointer)out );
fprintf( out, "</%s>\n", TEMPLATE_TRANSACTION_TAG );
AccountGroup *ag;
GList *gl;
gboolean hasTemplateTransactionData = FALSE;
ag = gnc_book_get_template_group(book);
gl = xaccGroupGetSubAccounts( ag );
while ( !hasTemplateTransactionData &&
(gl != NULL) ) {
hasTemplateTransactionData |=
(xaccAccountGetSplitList( (Account*)gl->data ) != NULL);
gl = gl->next;
}
if ( hasTemplateTransactionData ) {
fprintf( out, "<%s>\n", TEMPLATE_TRANSACTION_TAG );
write_account_group( out, gnc_book_get_template_group(book) );
xaccGroupForEachTransaction( ag,
xml_add_trn_data,
(gpointer)out );
fprintf( out, "</%s>\n", TEMPLATE_TRANSACTION_TAG );
}
}
static void
+1
View File
@@ -288,6 +288,7 @@ sxsincelast_populate( sxSinceLastData *sxsld )
if ( sxList == NULL ) {
DEBUG( "No scheduled transactions to populate." );
return;
}
do {