Commit Graph
30632 Commits
Author SHA1 Message Date
John Ralls fec5643cd2 Merge Ryan Duguid's 'codex/rest-transaction-serialisation-20261017' into stable. 2026-10-19 15:57:58 -07:00
Ryan Duguid 9b9cec4223 Use SetDatePostedSecs in the REST example transaction setters
SetDatePostedTS no longer exists in the Python bindings. SetDatePostedSecs
accepts the datetime parsed from the request.
2026-10-19 18:04:29 +11:00
Ryan Duguid e319713a12 Handle missing void time in REST transaction serialisation 2026-10-19 18:04:28 +11:00
Ryan Duguid 64334caa90 Fix transaction listing serializer arguments 2026-10-19 18:04:27 +11:00
Christopher Lam 874207e1cc [sixtp-dom-generators.cpp] don't heap allocate 0.5KiB for date
32 bytes on stack is more than adequate for YYYY-MM-DD
and it's ASCII, no need to utf8 sanitize
2026-10-18 20:07:55 +08:00
Christopher Lam 53d34ccdb3 Bug 799820 - Stock Assistant incorrectly records Capital Loss
Because the set_value() called for every "changed" event with a
negative amount, and m_debit_side was being toggled repeatedly. Set
m_debit_side according to the sign of amount cf the field dr/cr side.
2026-10-18 08:22:11 +08:00
John Ralls c16226116d Merge Brent McBride's 'fix-investment-lots-report-crash' into stable. 2026-10-17 12:40:20 -07:00
Christopher Lam ce59253b2b Bug 799833 - RFE - Add Options preference to Aging Report to hide inactive Vendors & Customers 2026-10-17 10:36:38 +08:00
Brent McBride a3524983a0 Bug 799832 - Investment Lots report crashes on a lot with a sale but no purchase
A lot that has a share-reducing (sale) split but no purchase split left
the lot's latest-bought-split-date null, which crashed the report with
"Wrong type (expecting exact integer): ()" when it computed the holding
period via gnc:date-year-delta -> gnc-localtime.

Guard the two year-delta call sites against a null bought date, and treat
a negative holding period (a purchase dated after its sale) as having no
meaningful CAGR. Skip the gains-mismatch warning for lots with no
purchase, whose basis is undefined; such lots are already flagged by the
negative-balance warning.

Add regression tests covering a sale-without-purchase lot and a
buy-after-sell lot.
2026-10-14 17:49:02 -07:00
Christopher Lam 9e39744aac [qoflog.cpp] plug GKeyFile leak on error
also prevent std::string copies
2026-10-14 07:50:11 +08:00
John Ralls 5d35e6993e [category-barchart] Mark two user-facing strings for translation. 2026-10-12 08:35:46 -07:00
John Ralls b183b507f2 Merge Noah Noerr's 'price-set-source-string-warn' into stable. 2026-10-09 16:20:24 -07:00
John Ralls 24e7b3ae75 Merge Noah Noerr's 'keychain-log-real-error' into stable. 2026-10-09 16:00:10 -07:00
John Ralls 8dc4e0ec0d Merge Koos's 'cleanup-strings' into stable. 2026-10-09 14:41:06 -07:00
Ceaus 250b52e5ae Text fixes. 2026-10-09 18:42:39 +02:00
Christopher Lam 54ee116f20 [gtest-ui-util.cpp] add test suite for gnc-ui-util.cpp 2026-10-09 07:48:56 +08:00
Christopher Lam 1f364bd9bd [gnc-ui-util.cpp] fix numeric_to_words (gnc_numeric)
no more infinite loop in some cases, no fudge, exact arithmetic
2026-10-09 07:48:52 +08:00
Christopher Lam 887dfcaad6 [gnc-ui-util.cpp] remove number_to_words (double,int64_t) 2026-10-09 07:29:01 +08:00
Ceaus 419692b9eb Corrected text from Tip Of The Day with the actual menu entry. 2026-10-05 18:45:26 +02:00
Ceaus 070e2ec2c6 Missing full stop end of sentence. 2026-10-04 14:01:26 +02:00
Christopher Lam 53cc9e661e [gnc-currency-edit.cpp] signals should be unblocked after blocking
gnc_currency_edit_clear_display seems unused however
2026-10-04 15:59:08 +08:00
Ceaus 2001ef38a8 Textual improvement. 2026-10-04 06:08:37 +02:00
John Ralls f6a134b6d8 Merge Brent McBride's 'fix-lot-scrub-orphaned-gains' into stable 2026-10-03 17:44:01 -07:00
John Ralls 80c4377b04 Merge latest translations from Weblate. 2026-10-03 17:35:07 -07:00
Pedro Albuquerque 7665776fd9 Translation update by Pedro Albuquerque <pmra@protonmail.com> using Weblate
po/pt.po: 100.0% (5749 of 5749 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Portuguese)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/pt/
2026-10-03 10:51:44 +02:00
Ceaus d3c0042d47 Translation update by Ceaus <github@pohw.nl> using Weblate
po/nl.po: 98.2% (5647 of 5749 strings; 81 fuzzy)
32 failing checks (0.5%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/
2026-10-03 06:51:22 +00:00
Brent McBride 22e9ff9a49 Use xaccAccountGetSplitsSize in cap-gains regression test
Per review: faster than g_list_length(xaccAccountGetSplitList()) and
avoids leaking the returned list.
2026-10-02 20:57:00 -07:00
Brent McBride 5a4115d370 Resolve both gains splits in xaccSplitDetermineGainStatus
Rework xaccSplitDetermineGainStatus() to resolve the gain status of
both ends of a marker/source pair in a single call, and to use the
xaccSplitGetGainsSourceSplit() accessor instead of a raw KVP lookup.

When the function resolves one split it now also resolves its partner
(the source for a marker, the marker for a source) if that partner is
still UNKNOWN. This makes gain-status resolution order-independent:
whichever split xaccSplitComputeCapGains() reaches first, the other is
already resolved, so the marker->source switch-over no longer finds an
unresolved source and never re-creates an orphaned gains split.

This supersedes the one-line switch-over patch in cap-gains.cpp, which
is reverted.
2026-10-02 15:15:00 -07:00
Ceaus 1e2e95731d Translation update by Ceaus <github@pohw.nl> using Weblate
po/nl.po: 97.8% (5627 of 5749 strings; 98 fuzzy)
27 failing checks (0.4%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/
2026-10-02 21:53:00 +02:00
Ceaus 4243044681 Translation update by Ceaus <github@pohw.nl> using Weblate
po/es_NI.po: 13.1% (754 of 5749 strings; 3097 fuzzy)
976 failing checks (16.9%)
Translation: GnuCash/Program (Spanish (Nicaragua))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/es_NI/
2026-10-02 21:53:00 +02:00
Ceaus 02d3eb4de0 Translation update by Ceaus <github@pohw.nl> using Weblate
po/nl.po: 97.8% (5627 of 5749 strings; 98 fuzzy)
27 failing checks (0.4%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/
2026-10-02 21:53:00 +02:00
Yegor Derevenets 026af550ac Translation update by Yegor Derevenets <yegor.derevenets@gmail.com> using Weblate
po/ru.po: 96.9% (5575 of 5749 strings; 120 fuzzy)
124 failing checks (2.1%)
Translation: GnuCash/Program (Russian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ru/
2026-10-02 21:53:00 +02:00
Yegor Derevenets 525cbdb344 Translation update by Yegor Derevenets <yegor.derevenets@gmail.com> using Weblate
po/ru.po: 96.9% (5575 of 5749 strings; 120 fuzzy)
125 failing checks (2.1%)
Translation: GnuCash/Program (Russian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ru/
2026-10-02 21:53:00 +02:00
Ceaus 53e6bf7398 Translation update by Ceaus <github@pohw.nl> using Weblate
po/nl.po: 97.6% (5613 of 5749 strings; 112 fuzzy)
32 failing checks (0.5%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/
2026-10-02 21:53:00 +02:00
Yegor Derevenets 5fff02f95b Translation update by Yegor Derevenets <yegor.derevenets@gmail.com> using Weblate
po/ru.po: 96.9% (5574 of 5749 strings; 121 fuzzy)
115 failing checks (2.0%)
Translation: GnuCash/Program (Russian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ru/

Co-authored-by: Yegor Derevenets <yegor.derevenets@gmail.com>
2026-10-02 21:52:59 +02:00
zugu 346fb35a3b Translation update by zugu <ye-seola@proton.me> using Weblate
po/ko.po: 98.4% (5658 of 5749 strings; 51 fuzzy)
12 failing checks (0.2%)
Translation: GnuCash/Program (Korean)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ko/

Co-authored-by: zugu <ye-seola@proton.me>
2026-10-02 21:52:59 +02:00
Ceaus a675c94836 Translation update by Ceaus <github@pohw.nl> using Weblate
po/glossary/nl.po: 55.6% (118 of 212 strings; 94 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/nl/

Translation update  by Ceaus <github@pohw.nl> using Weblate

po/nl.po: 97.5% (5608 of 5749 strings; 112 fuzzy)
32 failing checks (0.5%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/

Translation update  by Ceaus <github@pohw.nl> using Weblate

po/nl.po: 97.4% (5603 of 5749 strings; 112 fuzzy)
31 failing checks (0.5%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/

Co-authored-by: Ceaus <github@pohw.nl>
2026-10-02 21:52:59 +02:00
Alois Levermann b04529601f Translation update by Alois Levermann <alois@levermann.xyz> using Weblate
po/glossary/de.po: 56.6% (120 of 212 strings; 92 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (German)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/de/

Translation update  by Alois Levermann <alois@levermann.xyz> using Weblate

po/de.po: 98.3% (5656 of 5749 strings; 54 fuzzy)
52 failing checks (0.9%)
Translation: GnuCash/Program (German)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/de/

Co-authored-by: Alois Levermann <alois@levermann.xyz>
2026-10-02 21:52:59 +02:00
Szia Tomi 9990b7624f Translation update by Szia Tomi <sziatomi01@gmail.com> using Weblate
po/hu.po: 91.9% (5284 of 5749 strings; 103 fuzzy)
1 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.8% (5281 of 5749 strings; 104 fuzzy)
1 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.7% (5277 of 5749 strings; 107 fuzzy)
1 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.5% (5263 of 5749 strings; 116 fuzzy)
1 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.3% (5251 of 5749 strings; 120 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.1% (5242 of 5749 strings; 127 fuzzy)
4 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.1% (5239 of 5749 strings; 130 fuzzy)
5 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/glossary/hu.po: 55.6% (118 of 212 strings; 94 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 91.0% (5234 of 5749 strings; 132 fuzzy)
5 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 90.9% (5227 of 5749 strings; 135 fuzzy)
5 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 90.7% (5220 of 5749 strings; 139 fuzzy)
5 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 90.6% (5213 of 5749 strings; 142 fuzzy)
7 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 90.6% (5211 of 5749 strings; 142 fuzzy)
7 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 90.4% (5200 of 5749 strings; 142 fuzzy)
7 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Co-authored-by: Szia Tomi <sziatomi01@gmail.com>
2026-10-02 21:52:59 +02:00
Arve Eriksson 2e422fdf88 Translation update by Arve Eriksson <arve.eriksson@startmail.com> using Weblate
po/sv.po: 100.0% (5749 of 5749 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Swedish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sv/

Translation update  by Arve Eriksson <arve.eriksson@startmail.com> using Weblate

po/sv.po: 99.3% (5711 of 5749 strings; 23 fuzzy)
5 failing checks (0.1%)
Translation: GnuCash/Program (Swedish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sv/

Translation update  by Arve Eriksson <arve.eriksson@startmail.com> using Weblate

po/glossary/sv.po: 100.0% (212 of 212 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Swedish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/sv/

Co-authored-by: Arve Eriksson <arve.eriksson@startmail.com>
2026-10-02 21:52:59 +02:00
Jonathan Santos Fernandes aa6f973574 Translation update by Jonathan Santos Fernandes <jonathansantosfernandes@gmail.com> using Weblate
po/pt_BR.po: 95.9% (5516 of 5749 strings; 189 fuzzy)
29 failing checks (0.5%)
Translation: GnuCash/Program (Portuguese (Brazil))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/pt_BR/

Co-authored-by: Jonathan Santos Fernandes <jonathansantosfernandes@gmail.com>
2026-10-02 21:52:59 +02:00
Pedro Albuquerque a9260f0c64 Translation update by Pedro Albuquerque <pmra@protonmail.com> using Weblate
po/glossary/pt.po: 100.0% (212 of 212 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Portuguese)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/pt/

Translation update  by Pedro Albuquerque <pmra@protonmail.com> using Weblate

po/pt.po: 100.0% (5749 of 5749 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Portuguese)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/pt/

Co-authored-by: Pedro Albuquerque <pmra@protonmail.com>
2026-10-02 21:52:59 +02:00
Simon Arlott 053c8f055b Translation update by Simon Arlott <nomis@users.noreply.hosted.weblate.org> using Weblate
po/en_NZ.po: 100.0% (5749 of 5749 strings; 0 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (English (New Zealand))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/en_NZ/

Translation update  by Simon Arlott <nomis@users.noreply.hosted.weblate.org> using Weblate

po/en_AU.po: 100.0% (5749 of 5749 strings; 0 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (English (Australia))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/en_AU/

Translation update  by Simon Arlott <nomis@users.noreply.hosted.weblate.org> using Weblate

po/en_GB.po: 100.0% (5749 of 5749 strings; 0 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (English (United Kingdom))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/en_GB/

Co-authored-by: Simon Arlott <nomis@users.noreply.hosted.weblate.org>
2026-10-02 21:52:59 +02:00
Zhaoquan Huang 73e5df0a98 Translation update by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate
po/zh_CN.po: 98.8% (5683 of 5749 strings; 37 fuzzy)
23 failing checks (0.4%)
Translation: GnuCash/Program (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/glossary/zh_CN.po: 85.8% (182 of 212 strings; 30 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/glossary/zh_CN.po: 83.4% (177 of 212 strings; 35 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/glossary/zh_CN.po: 77.3% (164 of 212 strings; 48 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/zh_CN.po: 98.8% (5683 of 5749 strings; 37 fuzzy)
23 failing checks (0.4%)
Translation: GnuCash/Program (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/zh_CN.po: 98.8% (5683 of 5749 strings; 37 fuzzy)
23 failing checks (0.4%)
Translation: GnuCash/Program (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/glossary/zh_CN.po: 74.0% (157 of 212 strings; 55 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/glossary/zh_CN.po: 73.1% (155 of 212 strings; 57 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/zh_CN.po: 98.5% (5668 of 5749 strings; 44 fuzzy)
29 failing checks (0.5%)
Translation: GnuCash/Program (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/

Translation update  by Zhaoquan Huang <zhaoquan2008@hotmail.com> using Weblate

po/glossary/zh_CN.po: 72.1% (153 of 212 strings; 59 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Chinese (Simplified Han script))
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/zh_Hans/

Co-authored-by: Zhaoquan Huang <zhaoquan2008@hotmail.com>
2026-10-02 21:52:59 +02:00
John Ralls 7ebac3fde8 Merge Koos Pol's 'typo-fix' into stable. 2026-10-02 12:50:21 -07:00
Ceaus ece3f7fa65 Fixed typo. 2026-10-02 20:16:56 +02:00
Ceaus 24f524b960 Uppercase/Lowercase consistency. 2026-10-02 20:00:53 +02:00
Brent McBride 1e27fd17dc Add regression test for cap-gains marker/source switch-over
Builds a FIFO lot (buy + sell) with a pre-existing Realized Gain/Loss
transaction and the gains-split/gains-source KVP links, then simulates
a just-loaded state where the gains marker reaches
xaccSplitComputeCapGains() before its source is resolved (the order
that reproduces on MySQL and is masked on SQLite). Asserts the existing
gains split is reused rather than duplicated into an orphan.

Fails (2 != 1) without the switch-over resolve fix, passes with it.
2026-10-02 10:40:54 -07:00
Ceaus d11841ade7 Fixed some typo's. 2026-10-02 18:41:00 +02:00
Brent McBride 872612a26b Fix mass re-orphaning of cap-gains splits during lot scrub
xaccSplitComputeCapGains() performs a marker->source switch-over when a
gains marker split is processed before its source. The switch-over did
not resolve the source's in-memory gain status, so the source was left
with gains==UNKNOWN and gains_split==nullptr even though its forward
gains-split KVP was intact. The subsequent lookup read nullptr and the
code created a brand-new gains transaction routed to Orphaned Gains,
duplicating hundreds of already-settled gains splits on SQL books whose
history contains a stock split.

Resolve the source's gain status immediately after the switch-over so
its existing gains split is reused instead of being re-created.

This latent bug (original cap-gains code, ~2003) was exposed by the
5.17 adjusted_amount work (1e654412ab, b1efe0763c) which recomputes
already-booked gains in stock-split accounts. It is order-sensitive,
which is why it reproduces on MySQL but not SQLite.
2026-10-02 00:30:39 -07:00