gnucash stable: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Sat Sep 6 18:56:20 EDT 2025
Updated via https://github.com/Gnucash/gnucash/commit/58f3390d (commit)
via https://github.com/Gnucash/gnucash/commit/8363cac1 (commit)
via https://github.com/Gnucash/gnucash/commit/02cb1b4d (commit)
via https://github.com/Gnucash/gnucash/commit/8ca65ef2 (commit)
via https://github.com/Gnucash/gnucash/commit/048dfa12 (commit)
via https://github.com/Gnucash/gnucash/commit/c09cdd15 (commit)
via https://github.com/Gnucash/gnucash/commit/0e041af5 (commit)
via https://github.com/Gnucash/gnucash/commit/28aaf380 (commit)
from https://github.com/Gnucash/gnucash/commit/ea179831 (commit)
commit 58f3390dbc3541d9d48d2066b4811e0c9a680f5b
Merge: 8363cac1ae 048dfa1232
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 6 15:51:15 2025 -0700
Merge Sherlock's 'Bug 343711' into stable.
commit 8363cac1ae198c68ebc5ce5f985a83f600281233
Merge: 02cb1b4d50 c09cdd1529
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 6 15:46:35 2025 -0700
Merge Sherlock's 'Bug 799656' into stable.
commit 02cb1b4d50e9256413ee2e6ff2fd2e28ca63dde4
Merge: 8ca65ef2ac 0e041af555
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 6 15:45:01 2025 -0700
Merge Sherlock's 'Bug 799652' into stable.
commit 8ca65ef2ace5e2546f4366e09aec2095a8d35d2b
Merge: ea179831a0 28aaf38002
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 6 15:42:19 2025 -0700
Merge Sherlock's 'Bug 799654' into stable.
commit 048dfa1232a84ba364154e33f3d6d3c2cc4722c3
Author: Sherlock <119709043+agwekixj at users.noreply.github.com>
Date: Thu Sep 4 19:23:48 2025 -0700
Bug 343711 - Splits to Imbalance-USD do not disappear when zero-valued.
To mitigate potential impact, the Imbalance split is only removed when the split transitions to zero value during the commit of the transaction and the split's memo and action have no value.
diff --git a/libgnucash/engine/Scrub.cpp b/libgnucash/engine/Scrub.cpp
index 34f9221a90..f819ef41af 100644
--- a/libgnucash/engine/Scrub.cpp
+++ b/libgnucash/engine/Scrub.cpp
@@ -594,9 +594,6 @@ add_balance_split (Transaction *trans, gnc_numeric imbalance,
LEAVE("");
return;
}
- account = xaccSplitGetAccount(balance_split);
-
- xaccTransBeginEdit (trans);
old_value = xaccSplitGetValue (balance_split);
@@ -607,8 +604,25 @@ add_balance_split (Transaction *trans, gnc_numeric imbalance,
gnc_commodity_get_fraction(currency),
GNC_HOW_RND_ROUND_HALF_UP);
- xaccSplitSetValue (balance_split, new_value);
+ if (gnc_numeric_zero_p (new_value))
+ {
+ const char *p;
+ p = xaccSplitGetMemo (balance_split);
+ if (!p || !*p)
+ {
+ p = xaccSplitGetAction (balance_split);
+ if (!p || !*p)
+ {
+ xaccSplitDestroy (balance_split);
+ return;
+ }
+ }
+ }
+ xaccTransBeginEdit (trans);
+ xaccSplitSetValue (balance_split, new_value);
+
+ account = xaccSplitGetAccount(balance_split);
commodity = xaccAccountGetCommodity (account);
if (gnc_commodity_equiv (currency, commodity))
{
diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp
index 8ec6d59399..b9b177b6b0 100644
--- a/libgnucash/engine/test/utest-Split.cpp
+++ b/libgnucash/engine/test/utest-Split.cpp
@@ -667,7 +667,7 @@ test_xaccSplitRollbackEdit (Fixture *fixture, gconstpointer pData)
fixture->split->orig_parent = NULL;
xaccSplitRollbackEdit (fixture->split);
- test_signal_assert_hits (sig1, 1);
+ test_signal_assert_hits (sig1, 2);
test_signal_assert_hits (sig2, 0);
test_signal_assert_hits (sig3, 0);
g_assert_true (fixture->split->acc == NULL);
@@ -684,9 +684,9 @@ test_xaccSplitRollbackEdit (Fixture *fixture, gconstpointer pData)
g_assert_true (fixture->split->acc == acc);
g_assert_true (fixture->split->parent == txn1);
g_assert_true (fixture->split->orig_parent == txn1);
- test_signal_assert_hits (sig1, 1);
+ test_signal_assert_hits (sig1, 2);
test_signal_assert_hits (sig2, 1);
- test_signal_assert_hits (sig3, 1);
+ test_signal_assert_hits (sig3, 2);
g_assert_true (fixture->split->parent == fixture->split->orig_parent);
g_assert_true (fixture->split->parent == txn1);
commit c09cdd1529784825d0c1d7a9ee9daec0928c14ab
Author: Sherlock <119709043+agwekixj at users.noreply.github.com>
Date: Tue Sep 2 13:59:37 2025 -0700
Bug 799656 - Invoice and bills still display prices as fractional amounts with "Force Prices to display as decimals"
gncEntryLedgerModel.c:get_pric_entry() is changed to coerce the forced-decimal amount in to the price's display cell.
gncEntryLedger.c:gnc_entry_ledger_compute_value() is changed to pull the price from the ledger (instead of the cell).
diff --git a/gnucash/register/ledger-core/gncEntryLedger.c b/gnucash/register/ledger-core/gncEntryLedger.c
index a799183fde..bff05a0eb4 100644
--- a/gnucash/register/ledger-core/gncEntryLedger.c
+++ b/gnucash/register/ledger-core/gncEntryLedger.c
@@ -713,9 +713,14 @@ gnc_entry_ledger_compute_value (GncEntryLedger *ledger,
GList *taxes = NULL;
int denom = 100;
gnc_numeric value_unrounded, taxes_unrounded;
+ GncEntry *entry;
gnc_entry_ledger_get_numeric (ledger, ENTRY_QTY_CELL, &qty);
- gnc_entry_ledger_get_numeric (ledger, ENTRY_PRIC_CELL, &price);
+ entry = gnc_entry_ledger_get_current_entry (ledger);
+ if (ledger->is_cust_doc)
+ price = gncEntryGetInvPrice (entry);
+ else
+ price = gncEntryGetBillPrice (entry);
gnc_entry_ledger_get_numeric (ledger, ENTRY_DISC_CELL, &discount);
disc_type = gnc_entry_ledger_get_type (ledger, ENTRY_DISTYPE_CELL);
diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index c1e3ea7a00..198f566702 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -281,6 +281,8 @@ static const char * get_pric_entry (VirtualLocation virt_loc,
GncEntryLedger *ledger = user_data;
GncEntry *entry;
gnc_numeric price;
+ gnc_commodity *curr;
+ GNCPrintAmountInfo print_info;
entry = gnc_entry_ledger_get_entry (ledger, virt_loc.vcell_loc);
if (ledger->is_cust_doc)
@@ -291,7 +293,10 @@ static const char * get_pric_entry (VirtualLocation virt_loc,
if (gnc_numeric_zero_p (price))
return NULL;
- return xaccPrintAmount (price, gnc_default_print_info (FALSE));
+ curr = gncInvoiceGetCurrency (ledger->invoice);
+ print_info = gnc_default_price_print_info (curr);
+
+ return xaccPrintAmount (price, print_info);
}
static const char * get_qty_entry (VirtualLocation virt_loc,
commit 0e041af555bbfd6c3f843d876e985f3c65085c63
Author: Sherlock <119709043+agwekixj at users.noreply.github.com>
Date: Tue Sep 2 11:49:50 2025 -0700
Bug 799652 - Invoice price decimal places
Bug 799652 - Invoice price decimal places
The "+ 2 places" should only be applied when force decimal is enabled.
Update gnc-ui-util.cpp
Update test-balsheet-pnl.scm
Update test-ifrs-cost-basis.scm
Update test-invoice.scm
diff --git a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
index e65f41da16..13eae24751 100644
--- a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
@@ -331,7 +331,7 @@
'("#200.00" "$340.00" "30. FUNDS" "$14,424.52" "$106,709.00" "$106,709.00")
(sxml->table-row-col sxml 1 3 6))
(test-equal "show-rates enabled"
- '("1. FUNDS" "$480 + 85/104" "#1.00" "$1.7000")
+ '("1. FUNDS" "$480 + 85/104" "#1.00" "$1.70")
(sxml->table-row-col sxml 2 #f #f)))
;;make-multilevel
@@ -467,7 +467,7 @@
(list "-#600.00" "-$1,020.00" "-$250.00" "-$250.00")
(sxml->table-row-col sxml 1 2 6))
(test-equal "show-rates enabled"
- (list "#1.00" "$1.7000")
+ (list "#1.00" "$1.70")
(sxml->table-row-col sxml 2 #f #f)))
;;make-multilevel
@@ -523,8 +523,8 @@
"$6,870.00" "$0.00" "$100.00" "$4,000.00" "$2,000.00" "$2,000.00"
"10. FUNDS " "$130.00" "$130.00" "#100.00 " "$100,000.00" "$113,100.00"
"$9,500.00" "$9,500.00" "$500.00" "$9,000.00" "$9,500.00" "$103,600.00"
- "$0.00" "$0.00" "$103,600.00" "$113,100.00" "#1.00 $1.3000"
- "1. FUNDS $200.0000")
+ "$0.00" "$0.00" "$103,600.00" "$113,100.00" "#1.00 $1.30"
+ "1. FUNDS $200.00")
(sxml->table-row-col sxml 1 #f 2))
(test-equal "bal-1/1/71"
'("01/01/71" "$116,006.33" "$116,006.33" "$4,709.00" "$2,000.00"
@@ -532,7 +532,7 @@
"30. FUNDS " "$297.03" "$297.03" "#200.00 " "$100,000.00" "$116,006.33"
"$9,500.00" "$9,500.00" "$500.00" "$9,000.00" "$9,500.00" "$103,600.00"
"$2,906.33" "$0.00" "$106,506.33" "$116,006.33" "#1.00 $1 + 49/101"
- "1. FUNDS $300.0100")
+ "1. FUNDS $300.01")
(sxml->table-row-col sxml 1 #f 3))
(test-equal "bal-1/1/72"
'("01/01/72" "$117,437.00" "$117,437.00" "$4,709.00" "$2,000.00"
@@ -564,7 +564,7 @@
"$1,190.00" "$1,190.00" "#700.00 " "$100,000.00" "$122,743.52"
"$9,500.00" "$9,500.00" "$500.00" "$9,000.00" "$9,500.00"
"$103,600.00" "$8,373.52" "$1,270.00" "$113,243.52" "$122,743.52"
- "#1.00 $1.7000" "1. FUNDS $480 + 85/104")
+ "#1.00 $1.70" "1. FUNDS $480 + 85/104")
(sxml->table-row-col sxml 1 #f 2)))))
(define (multicol-pnl-tests)
@@ -602,15 +602,15 @@
"multicol-pnl-halfyear")))
(test-equal "pnl-1/80"
'("01/01/80" " to 01/31/80" "$1,100.00" "$250.00" "$850.00" "#500.00 "
- "$1,100.00" "#1.00 $1.7000")
+ "$1,100.00" "#1.00 $1.70")
(sxml->table-row-col sxml 1 #f 2))
(test-equal "pnl-2/80"
'("02/01/80" " to 02/29/80" "$170.00" "$0.00" "$170.00" "#100.00 "
- "$170.00" "#1.00 $1.7000")
+ "$170.00" "#1.00 $1.70")
(sxml->table-row-col sxml 1 #f 3))
(test-equal "pnl-3/80"
'("03/01/80" " to 03/31/80" "$0.00" "$0.00" "$0.00" "#0.00 "
- "$0.00" "#1.00 $1.7000")
+ "$0.00" "#1.00 $1.70")
(sxml->table-row-col sxml 1 #f 4)))
(set-option! multi-bs-options "General" "Period order is most recent first" #t)
@@ -624,26 +624,26 @@
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"multicol pnl weighted-average")))
(test-equal "weighted average exchange-rate"
- '("#1.00 $1.4990" "1. FUNDS $235 + 3/7")
+ '("#1.00 $1.499" "1. FUNDS $235 + 3/7")
(sxml->table-row-col sxml 1 -2 -1)))
(set-option! multi-bs-options "Commodities" "Price Source" 'average-cost)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"multicol pnl average-cost")))
(test-equal "average-cost exchange-rate"
- '("#1.00 $1.4550" "1. FUNDS $203 + 1/3")
+ '("#1.00 $1.455" "1. FUNDS $203 + 1/3")
(sxml->table-row-col sxml 1 -2 -1)))
(set-option! multi-bs-options "Commodities" "Price Source" 'pricedb-nearest)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"multicol pnl pricedb-nearest")))
(test-equal "pricedb-nearest exchange-rate"
- '("#1.00 $1.7000" "1. FUNDS $480 + 85/104")
+ '("#1.00 $1.70" "1. FUNDS $480 + 85/104")
(sxml->table-row-col sxml 1 -2 -1)))
(set-option! multi-bs-options "Commodities" "Price Source" 'pricedb-latest)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"multicol pnl pricedb-latest")))
(test-equal "pricedb-latest exchange-rate"
- '("#1.00 $1.7000" "1. FUNDS $480 + 85/104")
+ '("#1.00 $1.70" "1. FUNDS $480 + 85/104")
(sxml->table-row-col sxml 1 -2 -1)))))
diff --git a/gnucash/report/reports/standard/test/test-ifrs-cost-basis.scm b/gnucash/report/reports/standard/test/test-ifrs-cost-basis.scm
index 34cbf5e50f..c34b830ea1 100644
--- a/gnucash/report/reports/standard/test/test-ifrs-cost-basis.scm
+++ b/gnucash/report/reports/standard/test/test-ifrs-cost-basis.scm
@@ -262,98 +262,97 @@
(let ((sxml (options->sxml uuid options "latest")))
(test-equal "BUY 100 SPY"
'("07/01/19" "Buy SPY" "100. SPY" "100. SPY" "Open Long" "CAD"
- "C$1.0000" "C$20,000.00" "C$9.95" "C$20,000.00" "C$9.95"
+ "C$1.00" "C$20,000.00" "C$9.95" "C$20,000.00" "C$9.95"
"C$20,009.95" "C$0.00" "C$0.00" "C$0.00")
(sxml->table-row-col sxml 1 1 #f))
(test-equal "BUY 50 SPY"
- '("12/11/19" "Buy SPY" "50. SPY" "150. SPY" "Buy" "CAD" "C$1.0000"
+ '("12/11/19" "Buy SPY" "50. SPY" "150. SPY" "Buy" "CAD" "C$1.00"
"C$16,000.00" "C$9.95" "C$16,000.00" "C$9.95" "C$36,019.90"
"C$200.10" "C$0.00" "C$0.00" "C$0.00")
(sxml->table-row-col sxml 1 2 #f))
(test-equal "Sell 75 SPY"
- '("03/18/20" "Sell SPY" "-75. SPY" "75. SPY" "Sell" "CAD" "C$1.0000"
+ '("03/18/20" "Sell SPY" "-75. SPY" "75. SPY" "Sell" "CAD" "C$1.00"
"C$12,000.00" "C$9.95" "C$12,000.00" "C$9.95" "C$18,009.95"
"C$240.13" "C$18,009.95" "C$11,990.05" "-C$6,019.90"
"-C$6,009.95" "-C$6,009.95" "-C$6,009.95" "-C$6,019.90" "-C$6,019.90")
(sxml->table-row-col sxml 1 3 #f))
(test-equal "BUY 250 SPY"
- '("04/01/20" "Buy SPY" "250. SPY" "325. SPY" "Buy" "CAD" "C$1.0000"
+ '("04/01/20" "Buy SPY" "250. SPY" "325. SPY" "Buy" "CAD" "C$1.00"
"C$42,000.00" "C$9.95" "C$42,000.00" "C$9.95" "C$60,019.90"
"C$240.13" "-C$6,009.95" "-C$6,019.90" "-C$6,019.90")
(sxml->table-row-col sxml 1 4 #f))
(test-equal "Return Capital $2500"
'("04/16/20" "Return of Capital" "0. SPY" "325. SPY" "Return of capital"
- "CAD" "C$1.0000" "-C$2,500.00" "-C$2,500.00" "C$57,519.90"
+ "CAD" "C$1.00" "-C$2,500.00" "-C$2,500.00" "C$57,519.90"
"C$184.68" "-C$6,009.95" "-C$6,019.90" "-C$6,019.90")
(sxml->table-row-col sxml 1 5 #f))
(test-equal "BUY 125 SPY"
- '("05/02/20" "Buy spy" "125. SPY" "450. SPY" "Buy" "CAD" "C$1.0000"
+ '("05/02/20" "Buy spy" "125. SPY" "450. SPY" "Buy" "CAD" "C$1.00"
"C$47,500.00" "C$0.00" "C$47,500.00" "C$0.00" "C$105,019.90"
"C$176.98" "-C$6,009.95" "-C$6,019.90" "-C$6,019.90")
(sxml->table-row-col sxml 1 6 #f))
(test-equal "2:1 split"
' ("05/11/20" "stock split" "450. SPY" "900. SPY" "Stock split"
- "CAD" "C$1.0000" "C$105,019.90" "C$233.38" "-C$6,009.95"
+ "CAD" "C$1.00" "C$105,019.90" "C$233.38" "-C$6,009.95"
"-C$6,019.90" "-C$6,019.90")
(sxml->table-row-col sxml 1 7 #f))
(test-equal "sell 135 SPY"
- '("05/21/20" "Sell SPY" "-135. SPY" "765. SPY" "Sell" "CAD" "C$1.0000"
+ '("05/21/20" "Sell SPY" "-135. SPY" "765. SPY" "Sell" "CAD" "C$1.00"
"C$21,500.00" "C$9.95" "C$21,500.00" "C$9.95" "C$89,266.92"
"C$116.69" "C$15,752.98" "C$21,490.05" "C$5,737.06"
"C$5,747.02" "C$5,747.02" "-C$262.94" "-C$282.84" "-C$282.84")
(sxml->table-row-col sxml 1 8 #f))
(test-equal "BUY 150 SPY"
- '("06/03/20" "Buy spy" "150. SPY" "915. SPY" "Buy" "CAD" "C$1.0000"
+ '("06/03/20" "Buy spy" "150. SPY" "915. SPY" "Buy" "CAD" "C$1.00"
"C$21,000.00" "C$0.00" "C$21,000.00" "C$0.00" "C$110,266.92"
"C$116.69" "-C$262.94" "-C$282.84" "-C$282.84")
(sxml->table-row-col sxml 1 9 #f))
(test-equal "sell 915 SPY close long"
'("06/10/20" "Sell SPY" "-915. SPY" "0. SPY" "Sell" "CAD"
- "C$1.0000" "C$128,100.00" "C$9.95" "C$128,100.00" "C$9.95"
+ "C$1.00" "C$128,100.00" "C$9.95" "C$128,100.00" "C$9.95"
"C$0.00" "C$120.51" "C$110,266.92" "C$128,090.05" "C$17,823.14"
"C$17,833.08" "C$17,833.08" "C$17,570.15" "C$17,540.30" "C$17,540.30")
(sxml->table-row-col sxml 1 10 #f))
(test-equal "short-sell 85 SPY"
'("06/10/20" "Sell SPY Short" "-85. SPY" "-85. SPY" "Open Short"
- "CAD" "C$1.0000" "-C$11,900.00" "C$9.95" "-C$11,900.00" "C$9.95"
+ "CAD" "C$1.00" "-C$11,900.00" "C$9.95" "-C$11,900.00" "C$9.95"
"-C$11,890.05" "C$17,570.15" "C$17,540.30" "C$17,540.30")
(sxml->table-row-col sxml 1 11 #f))
(test-equal "short-sell 65 SPY"
'("06/15/20" "Sell SPY Short" "-65. SPY" "-150. SPY" "Short Sell"
- "CAD" "C$1.0000" "-C$11,050.00" "C$9.95" "-C$11,050.00" "C$9.95"
+ "CAD" "C$1.00" "-C$11,050.00" "C$9.95" "-C$11,050.00" "C$9.95"
"-C$22,930.10" "C$139.88" "C$17,570.15" "C$17,540.30" "C$17,540.30")
(sxml->table-row-col sxml 1 12 #f))
(test-equal "buy 50 SPY short"
'("06/18/20" "Buy SPY Close Short" "50. SPY" "-100. SPY" "Cover Buy"
- "CAD" "C$1.0000" "-C$5,000.00" "C$9.95" "-C$5,000.00" "C$9.95"
+ "CAD" "C$1.00" "-C$5,000.00" "C$9.95" "-C$5,000.00" "C$9.95"
"-C$15,286.73" "C$152.87" "-C$7,643.37" "-C$5,009.95" "C$2,633.42"
"C$2,643.37" "C$2,643.37" "C$20,213.52" "C$20,173.72" "C$20,173.72")
(sxml->table-row-col sxml 1 13 #f))
(test-equal "BUY 100 SPY close short"
'("06/20/20" "Buy SPY Close Short" "100. SPY" "0. SPY" "Cover Buy"
- "CAD" "C$1.0000" "-C$8,000.00" "C$4.98" "-C$8,000.00" "C$4.98"
+ "CAD" "C$1.00" "-C$8,000.00" "C$4.98" "-C$8,000.00" "C$4.98"
"C$0.00" "C$152.87" "-C$15,286.73" "-C$8,004.98" "C$7,281.75"
"C$7,286.73" "C$7,286.73" "C$27,500.25" "C$27,455.47" "C$27,455.47")
(sxml->table-row-col sxml 1 14 #f))
(test-equal "BUY 100 SPY"
'("06/21/20" "Buy SPY" "100. SPY" "100. SPY" "Open Long" "CAD"
- "C$1.0000" "C$8,000.00" "C$4.98" "C$8,000.00" "C$4.98"
+ "C$1.00" "C$8,000.00" "C$4.98" "C$8,000.00" "C$4.98"
"C$8,004.98" "C$27,500.25" "C$27,455.47" "C$27,455.47")
(sxml->table-row-col sxml 1 15 #f))))
(gnc-clear-current-session)))
-
diff --git a/gnucash/report/reports/standard/test/test-invoice.scm b/gnucash/report/reports/standard/test/test-invoice.scm
index 470f425f56..ba9451506c 100644
--- a/gnucash/report/reports/standard/test/test-invoice.scm
+++ b/gnucash/report/reports/standard/test/test-invoice.scm
@@ -97,7 +97,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-1 simple entry details are correct"
- '("entry-1-desc" "entry-1-action" "2.00" "$3.0000" "0.00 %" "T" "$0.00" "$6.00")
+ '("entry-1-desc" "entry-1-action" "2.00" "$3.00" "0.00 %" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-1 cust-name is correct"
'("cust-1-name")
@@ -130,7 +130,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-2 simple entry details are correct"
- '("entry-inv-2-desc" "entry-inv-2-action" "2.00" "$3.0000" "0.00 %" "T" "$0.00" "$6.00")
+ '("entry-inv-2-desc" "entry-inv-2-action" "2.00" "$3.00" "0.00 %" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-2 cust-name is correct"
'("cust-1-name")
@@ -156,7 +156,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-3 simple entry details are correct"
- '("entry-inv-3-desc" "entry-inv-3-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
+ '("entry-inv-3-desc" "entry-inv-3-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-3 vend-name is correct"
'("vend-1-name")
@@ -174,7 +174,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-4 simple entry details are correct"
- '("entry-inv-4-desc" "entry-inv-4-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
+ '("entry-inv-4-desc" "entry-inv-4-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-4 vend-name is correct"
'("emp-1-name")
@@ -192,7 +192,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-5 simple entry details are correct"
- '("entry-5-desc" "entry-5-action" "2.00" "$3.0000" "0.00 %" "T" "$0.00" "$6.00")
+ '("entry-5-desc" "entry-5-action" "2.00" "$3.00" "0.00 %" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-5 cust-name is correct"
'("cust-1-name")
@@ -206,7 +206,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-6 simple entry details are correct"
- '("entry-inv-6-desc" "entry-inv-6-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
+ '("entry-inv-6-desc" "entry-inv-6-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-6 vend-name is correct"
'("vend-1-name")
@@ -224,7 +224,7 @@
'("$6.00" "$6.00" "$6.00" "$6.00")
(sxml-get-row-col "entries-table" sxml #f -1))
(test-equal "inv-7 simple entry details are correct"
- '("entry-inv-7-desc" "entry-inv-7-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
+ '("entry-inv-7-desc" "entry-inv-7-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
(cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
(test-equal "inv-7 vend-name is correct"
'("emp-1-name")
diff --git a/gnucash/report/reports/standard/test/test-portfolios.scm b/gnucash/report/reports/standard/test/test-portfolios.scm
index 1c0fe108c2..6da3c05520 100644
--- a/gnucash/report/reports/standard/test/test-portfolios.scm
+++ b/gnucash/report/reports/standard/test/test-portfolios.scm
@@ -85,7 +85,7 @@
(options (gnc:make-report-options advanced-uuid)))
(let ((sxml (options->sxml advanced-uuid options "basic average")))
(test-equal "advanced: average basis"
- '("AAPL" "AAPL" "NASDAQ" "42.00" "$6.0000" "$484.88" "$252.00" "$800.00"
+ '("AAPL" "AAPL" "NASDAQ" "42.00" "$6.00" "$484.88" "$252.00" "$800.00"
"$543.00" "$227.88" "-$232.88" "-$5.00" "-0.63%" "$4.00"
"$10.00" "-$1.00" "-0.13%")
(sxml->table-row-col sxml 1 1 #f)))
@@ -93,7 +93,7 @@
(set-option! options "General" "Basis calculation method" 'fifo-basis)
(let ((sxml (options->sxml advanced-uuid options "basic fifo")))
(test-equal "advanced: fifo basis"
- '("AAPL" "AAPL" "NASDAQ" "42.00" "$6.0000" "$543.94" "$252.00" "$800.00"
+ '("AAPL" "AAPL" "NASDAQ" "42.00" "$6.00" "$543.94" "$252.00" "$800.00"
"$543.00" "$286.94" "-$291.94" "-$5.00" "-0.63%" "$4.00" "$10.00"
"-$1.00" "-0.13%")
(sxml->table-row-col sxml 1 1 #f)))
@@ -101,7 +101,7 @@
(set-option! options "General" "Basis calculation method" 'filo-basis)
(let ((sxml (options->sxml advanced-uuid options "basic filo")))
(test-equal "advanced: filo basis"
- '("AAPL" "AAPL" "NASDAQ" "42.00" "$6.0000" "$400.00" "$252.00" "$800.00"
+ '("AAPL" "AAPL" "NASDAQ" "42.00" "$6.00" "$400.00" "$252.00" "$800.00"
"$543.00" "$143.00" "-$148.00" "-$5.00" "-0.63%" "$4.00" "$10.00"
"-$1.00" "-0.13%")
(sxml->table-row-col sxml 1 1 #f))))
diff --git a/libgnucash/app-utils/gnc-ui-util.cpp b/libgnucash/app-utils/gnc-ui-util.cpp
index d3e53528b3..48ecf1aadf 100644
--- a/libgnucash/app-utils/gnc-ui-util.cpp
+++ b/libgnucash/app-utils/gnc-ui-util.cpp
@@ -1031,8 +1031,10 @@ gnc_price_print_info (const gnc_commodity *curr, gboolean use_symbol)
if (info.commodity)
{
int frac = gnc_commodity_get_fraction (curr);
- guint8 decplaces = 2;
+ guint8 decplaces = 0;
while (frac != 1 && (frac % 10) == 0 && (frac /= 10)) ++decplaces;
+ if (force)
+ decplaces += 2;
info.max_decimal_places = decplaces;
info.min_decimal_places = decplaces;
}
commit 28aaf38002c05577d261d4586cf572c95e4096fe
Author: Sherlock <119709043+agwekixj at users.noreply.github.com>
Date: Thu Aug 28 18:29:42 2025 -0700
Bug 799654 - Zombie entries in the recently accessed file list.
diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c
index 88102313b7..e53b1cf7de 100644
--- a/gnucash/gnome-utils/gnc-plugin-file-history.c
+++ b/gnucash/gnome-utils/gnc-plugin-file-history.c
@@ -407,8 +407,6 @@ gnc_history_update_action (GncMainWindow *window,
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
gchar *action_name;
gint limit;
- gboolean add_item = FALSE;
- gint pos;
ENTER("window %p, index %d, filename %s", window, index,
filename ? filename : "(null)");
@@ -418,9 +416,12 @@ gnc_history_update_action (GncMainWindow *window,
gsm->search_action_label = NULL;
gsm->search_action_name = action_name;
- if (!gnc_menubar_model_find_item (gnc_main_window_get_menu_model(window), gsm)) // could not find action_name
+ if (gnc_menubar_model_find_item (gnc_main_window_get_menu_model(window), gsm))
+ {
+ g_menu_remove (G_MENU(gsm->model), gsm->index);
+ }
+ else // could not find action_name
{
- add_item = TRUE;
gsm->search_action_name = "FilePlaceholder6"; // placeholder
if (!gnc_menubar_model_find_item (gnc_main_window_get_menu_model(window), gsm))
@@ -430,16 +431,12 @@ gnc_history_update_action (GncMainWindow *window,
g_free (action_name);
return;
}
- else
- pos = gsm->index + index;
+ gsm->index += index;
}
- else
- pos = gsm->index;
- limit = gnc_prefs_get_int (GNC_PREFS_GROUP_HISTORY,
- GNC_PREF_HISTORY_MAXFILES);
+ limit = gnc_prefs_get_int (GNC_PREFS_GROUP_HISTORY, GNC_PREF_HISTORY_MAXFILES);
- if (filename && (strlen(filename) > 0) && (index < limit))
+ if (filename && *filename && index < limit)
{
GMenuItem *item;
gchar *label_name = gnc_history_generate_label (index, filename);
@@ -448,13 +445,8 @@ gnc_history_update_action (GncMainWindow *window,
action_name, NULL);
item = g_menu_item_new (label_name, full_action_name);
-
g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TOOLTIP, "s", tooltip);
-
- if (!add_item)
- g_menu_remove (G_MENU(gsm->model), pos);
-
- g_menu_insert_item (G_MENU(gsm->model), pos, item);
+ g_menu_insert_item (G_MENU(gsm->model), gsm->index, item);
g_free (full_action_name);
g_free (label_name);
Summary of changes:
gnucash/gnome-utils/gnc-plugin-file-history.c | 26 +++++++-----------
gnucash/register/ledger-core/gncEntryLedger.c | 7 ++++-
gnucash/register/ledger-core/gncEntryLedgerModel.c | 7 ++++-
.../reports/standard/test/test-balsheet-pnl.scm | 26 +++++++++---------
.../reports/standard/test/test-ifrs-cost-basis.scm | 31 +++++++++++-----------
.../report/reports/standard/test/test-invoice.scm | 14 +++++-----
.../reports/standard/test/test-portfolios.scm | 6 ++---
libgnucash/app-utils/gnc-ui-util.cpp | 4 ++-
libgnucash/engine/Scrub.cpp | 22 ++++++++++++---
libgnucash/engine/test/utest-Split.cpp | 6 ++---
10 files changed, 83 insertions(+), 66 deletions(-)
More information about the gnucash-changes
mailing list