gnucash maint: Bug 798598 - Selecting a line in a Vendor Credit Note changes display of Subtotal cell to 0.00

Christopher Lam clam at code.gnucash.org
Sat Aug 27 10:26:47 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/4e980567 (commit)
	from  https://github.com/Gnucash/gnucash/commit/5fab901a (commit)



commit 4e98056782a116a755510ebf47a666abcd70e1b0
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Aug 27 22:22:35 2022 +0800

    Bug 798598 - Selecting a line in a Vendor Credit Note changes display of Subtotal cell to 0.00
    
    Because some more ledger types don't have discounts.

diff --git a/gnucash/register/ledger-core/gncEntryLedger.c b/gnucash/register/ledger-core/gncEntryLedger.c
index 6bcfb8d0c..11266c2e4 100644
--- a/gnucash/register/ledger-core/gncEntryLedger.c
+++ b/gnucash/register/ledger-core/gncEntryLedger.c
@@ -720,11 +720,16 @@ gnc_entry_ledger_compute_value (GncEntryLedger *ledger,
     disc_type = gnc_entry_ledger_get_type (ledger, ENTRY_DISTYPE_CELL);
     disc_how = gnc_entry_ledger_get_type (ledger, ENTRY_DISHOW_CELL);
 
-    /* Bills and exp-vouchers don't have discounts */
+    /* Some ledger types (see full list in gnc_entry_ledger_set_cells)
+       don't have discounts */
     if (ledger->type == GNCENTRY_BILL_ENTRY ||
-            ledger->type == GNCENTRY_BILL_VIEWER ||
-            ledger->type == GNCENTRY_EXPVOUCHER_ENTRY ||
-            ledger->type == GNCENTRY_EXPVOUCHER_VIEWER)
+        ledger->type == GNCENTRY_BILL_VIEWER ||
+        ledger->type == GNCENTRY_VEND_CREDIT_NOTE_ENTRY ||
+        ledger->type == GNCENTRY_VEND_CREDIT_NOTE_VIEWER ||
+        ledger->type == GNCENTRY_EXPVOUCHER_ENTRY ||
+        ledger->type == GNCENTRY_EXPVOUCHER_VIEWER ||
+        ledger->type == GNCENTRY_EMPL_CREDIT_NOTE_ENTRY ||
+        ledger->type == GNCENTRY_EMPL_CREDIT_NOTE_VIEWER)
     {
         g_assert (gnc_numeric_zero_p (discount));
         disc_type = GNC_AMT_TYPE_VALUE;



Summary of changes:
 gnucash/register/ledger-core/gncEntryLedger.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list