gnucash maint: Bug 756416 - CSV data with Posted information will always have last invoice not posted.
Mike Evans
mikee at code.gnucash.org
Tue Jul 12 10:17:43 EDT 2016
Updated via https://github.com/Gnucash/gnucash/commit/cc1b68a3 (commit)
from https://github.com/Gnucash/gnucash/commit/6ad8ff3b (commit)
commit cc1b68a3296fc1e3eaba814d80dc6bcec41cbc48
Author: Mike Evans <mikee at saxicola.co.uk>
Date: Tue Jul 12 15:08:09 2016 +0100
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.
diff --git a/src/plugins/bi_import/dialog-bi-import.c b/src/plugins/bi_import/dialog-bi-import.c
index c872f30..f266ffc 100644
--- a/src/plugins/bi_import/dialog-bi-import.c
+++ b/src/plugins/bi_import/dialog-bi-import.c
@@ -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);
}
}
Summary of changes:
src/plugins/bi_import/dialog-bi-import.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list