gnucash maint: Bug 734183 - Set value to zero before calling gnc_exp_parser_parse.

Mike Evans mikee at code.gnucash.org
Tue Jun 2 05:40:22 EDT 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/240e36f7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/f1609376 (commit)



commit 240e36f73b2d0ab48aa97d4b69a7adc879dbcf2c
Author: Mike Evans <mikee at saxicola.co.uk>
Date:   Tue Jun 2 10:33:35 2015 +0100

    Bug 734183 - Set value to zero before calling gnc_exp_parser_parse.

diff --git a/src/plugins/bi_import/dialog-bi-import.c b/src/plugins/bi_import/dialog-bi-import.c
index 3c2a8b0..ec11ace 100644
--- a/src/plugins/bi_import/dialog-bi-import.c
+++ b/src/plugins/bi_import/dialog-bi-import.c
@@ -709,7 +709,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
         gncEntrySetDateEntered (entry, today);
         gncEntrySetDescription (entry, desc);
         gncEntrySetAction (entry, action);
-
+        value = gnc_numeric_zero();
         gnc_exp_parser_parse (quantity, &value, NULL);
         gncEntrySetQuantity (entry, value);
         acc = gnc_account_lookup_for_register (gnc_get_current_root_account (),
@@ -718,6 +718,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
         if (g_ascii_strcasecmp (type, "BILL") == 0)
         {
             gncEntrySetBillAccount (entry, acc);
+            value = gnc_numeric_zero();
             gnc_exp_parser_parse (price, &value, NULL);
             gncEntrySetBillPrice (entry, value);
             gncEntrySetBillTaxable (entry, text2bool (taxable));
@@ -730,11 +731,13 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
         {
             gncEntrySetNotes (entry, notes);
             gncEntrySetInvAccount (entry, acc);
+            value = gnc_numeric_zero();
             gnc_exp_parser_parse (price, &value, NULL);
             gncEntrySetInvPrice (entry, value);
             gncEntrySetInvTaxable (entry, text2bool (taxable));
             gncEntrySetInvTaxIncluded (entry, text2bool (taxincluded));
             gncEntrySetInvTaxTable (entry, gncTaxTableLookupByName (book, tax_table));
+            value = gnc_numeric_zero();
             gnc_exp_parser_parse (discount, &value, NULL);
             gncEntrySetInvDiscount (entry, value);
             gncEntrySetInvDiscountType (entry, text2disc_type (disc_type));



Summary of changes:
 src/plugins/bi_import/dialog-bi-import.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list