From c8f1caa95f6d6d9cba215a21d40e12c9164cdc81 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Tue, 5 Apr 2022 23:15:09 +0800 Subject: [PATCH 1/3] Bug 798493 - Invoice Report Quantity & Unit Price fields have limited decimal precision on printed invoices use xaccPrintAmount which formats number nicely. --- gnucash/report/reports/standard/invoice.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnucash/report/reports/standard/invoice.scm b/gnucash/report/reports/standard/invoice.scm index ef42631089..02916ff7f3 100644 --- a/gnucash/report/reports/standard/invoice.scm +++ b/gnucash/report/reports/standard/invoice.scm @@ -447,7 +447,9 @@ for styling the invoice. Please see the exported report for the CSS class names. (addif (quantity-col used-columns) (gnc:make-html-table-cell/markup "number-cell" - (gncEntryGetDocQuantity entry credit-note?))) + (xaccPrintAmount + (gncEntryGetDocQuantity entry credit-note?) + (gnc-default-print-info #f)))) (addif (price-col used-columns) (gnc:make-html-table-cell/markup From ebbf7565c985dd03dd14135c6cd4b5b6770c74ac Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Tue, 5 Apr 2022 23:15:26 +0800 Subject: [PATCH 2/3] Bug 798496 - gncEntry Quantity and Discount are misusing commodity scu --- gnucash/register/ledger-core/gncEntryLedger.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/gnucash/register/ledger-core/gncEntryLedger.c b/gnucash/register/ledger-core/gncEntryLedger.c index bff49b3692..6bcfb8d0c5 100644 --- a/gnucash/register/ledger-core/gncEntryLedger.c +++ b/gnucash/register/ledger-core/gncEntryLedger.c @@ -265,22 +265,6 @@ gnc_entry_ledger_config_cells (GncEntryLedger *ledger) ((ComboCell *) gnc_table_layout_get_cell (ledger->table->layout, ENTRY_ACTN_CELL), FALSE); - /* Use GNC_COMMODITY_MAX_FRACTION for all prices and quantities */ - gnc_price_cell_set_fraction - ((PriceCell *) - gnc_table_layout_get_cell (ledger->table->layout, ENTRY_PRIC_CELL), - GNC_COMMODITY_MAX_FRACTION); - - gnc_price_cell_set_fraction - ((PriceCell *) - gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DISC_CELL), - GNC_COMMODITY_MAX_FRACTION); - - gnc_price_cell_set_fraction - ((PriceCell *) gnc_table_layout_get_cell (ledger->table->layout, - ENTRY_QTY_CELL), - GNC_COMMODITY_MAX_FRACTION); - /* add menu items for the action and payment cells */ gnc_entry_ledger_config_action (ledger); } From aab33954e73567c21e98bb5c610fefa880640049 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 8 Apr 2022 22:34:15 +0800 Subject: [PATCH 3/3] [gnc-numeric.cpp] Reduce logging level of gnc_numeric exception message Exceptions are expected in some use cases. --- libgnucash/engine/gnc-numeric.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgnucash/engine/gnc-numeric.cpp b/libgnucash/engine/gnc-numeric.cpp index 277e01e0f2..3beaddfbb0 100644 --- a/libgnucash/engine/gnc-numeric.cpp +++ b/libgnucash/engine/gnc-numeric.cpp @@ -1090,7 +1090,7 @@ gnc_numeric_to_decimal(gnc_numeric *a, guint8 *max_decimal_places) } catch (const std::exception& err) { - PWARN("%s", err.what()); + PINFO ("%s", err.what()); return FALSE; } }