Bug 756416 - CSV data with Posted information will always have last invoice not posted.

When importing the last line of the CSV the gtk_tree_model_get() never happens
and the following compare uses the previous value of new_id, which is now = id,
so the last invoice is never posted.

Set new_id = Null before gtk_tree_model_get() to ensure processing the last line.
This commit is contained in:
Mike Evans
2016-07-12 15:08:09 +01:00
parent 6ad8ff3b4e
commit cc1b68a329

View File

@@ -760,10 +760,10 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
gncInvoiceAddEntry (invoice, entry);
}
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter);
// handle auto posting of invoices
new_id = NULL;
if (valid)
gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, ID, &new_id, -1);
if (g_strcmp0 (id, new_id) != 0)
@@ -790,6 +790,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
memo_posted,
text2bool (accumulatesplits),
auto_pay);
DEBUG("Invoice %s posted",id);
}
}