gnucash maint: Bug 798132 - Invoice Importing crashes when importing low quantity values.

Mike Evans mikee at code.gnucash.org
Mon Mar 15 07:06:07 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/7f1335e6 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d7a4d475 (commit)



commit 7f1335e6a2f7e8700f9f984bdd34774be6d7fc4d
Author: Mike Evans <mikee at saxicola.co.uk>
Date:   Mon Mar 15 11:03:38 2021 +0000

    Bug 798132 - Invoice Importing crashes when importing low quantity values.

diff --git a/gnucash/import-export/bi-import/dialog-bi-import.c b/gnucash/import-export/bi-import/dialog-bi-import.c
index d2e0ec03c..03003e153 100644
--- a/gnucash/import-export/bi-import/dialog-bi-import.c
+++ b/gnucash/import-export/bi-import/dialog-bi-import.c
@@ -24,7 +24,6 @@
  * @file dialog-bi-import.c
  * @brief core import functions for invoice import plugin
  * @author Copyright (C) 2009 Sebastian Held <sebastian.held at gmx.de>
- * @author Mike Evans <mikee at saxicola.co.uk>
  * @author Rob Laan <rob.laan at chello.nl>
  */
 
@@ -789,8 +788,6 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
         gncEntrySetAction (entry, action);
         value = gnc_numeric_zero(); 
         gnc_exp_parser_parse (quantity, &value, NULL);
-        // Need to set the denom appropriately else we get stupid rounding errors.
-        value = gnc_numeric_convert (value, denom * 100, GNC_HOW_RND_NEVER);
         gncEntrySetQuantity (entry, value);
         acc = gnc_account_lookup_for_register (gnc_get_current_root_account (),
                                                account);
@@ -800,7 +797,6 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
             gncEntrySetBillAccount (entry, acc);
             value = gnc_numeric_zero();
             gnc_exp_parser_parse (price, &value, NULL);
-            value = gnc_numeric_convert (value, denom * 100, GNC_HOW_RND_NEVER);
             gncEntrySetBillPrice (entry, value);
             gncEntrySetBillTaxable (entry, text2bool (taxable));
             gncEntrySetBillTaxIncluded (entry, text2bool (taxincluded));
@@ -813,14 +809,12 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
             gncEntrySetInvAccount (entry, acc);
             value = gnc_numeric_zero();
             gnc_exp_parser_parse (price, &value, NULL);
-            value = gnc_numeric_convert (value, denom * 100, GNC_HOW_RND_NEVER);
             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);
-            value = gnc_numeric_convert (value, denom * 100, GNC_HOW_RND_NEVER);
             gncEntrySetInvDiscount (entry, value);
             gncEntrySetInvDiscountType (entry, text2disc_type (disc_type));
             gncEntrySetInvDiscountHow (entry, text2disc_how (disc_how));



Summary of changes:
 gnucash/import-export/bi-import/dialog-bi-import.c | 6 ------
 1 file changed, 6 deletions(-)



More information about the gnucash-changes mailing list