Commit Graph
30606 Commits
Author SHA1 Message Date
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
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
Christopher Lam 9414fdf546 [ScrubBusiness.c] don't reassign splits when restarting for loop
this plugs GList* leak upon restart
2026-10-02 05:51:40 +08:00
John Ralls 56ccad9a66 Bug 799821 - £ symbol across whole UI shows as £
Windows: Get UTF16 localization strings and convert them thus bypassing
the code page problem entirely.
2026-09-29 15:32:35 -07:00
John Ralls 55ed9d2e03 NEWS: fix typo 2026-09-27 16:19:33 -07:00
John Ralls 0e302675ff Release GnuCash 5.17 5.17 2026-09-26 12:58:12 -07:00
John Ralls 83a193dd8d Bug 797872 - Multiple check printing results in nothing sent to print queue after first check 2026-09-26 12:20:34 -07:00
John Ralls 7755418cb8 Merge Chris Lam's 'acc-templated-split-iterator' into stable. 2026-09-26 11:19:33 -07:00
John Ralls d8f0e151a7 engine.i: Fix typo. 2026-09-26 09:04:12 -07:00
Christopher Lam 5ed56e2b3d [engine.i] use gnc_account_foreach_split_between_dates
avoids calling callback on splits before start_date
2026-09-26 23:18:59 +08:00
Christopher Lam 5888a04a8e [account.cpp] use gnc_account_foreach_split_between_dates 2026-09-26 23:18:59 +08:00
Christopher Lam 3bbf74a730 [account.hpp] introduce gnc_account_foreach_split_between_dates
A templated account->splits iterator, will target splits from
start_date to end_date, inclusive of date boundaries. Also optionally
include descendants.
2026-09-26 23:18:59 +08:00
John Ralls 3cf1352cbb Merge Noah Noerr's 'python-guard-price-set-source-string' into stable. 2026-09-25 16:10:42 -07:00
Noerr 0dc41c1212 [bindings/python] Deprecate set_source_string; remove it from the Guile bindings
gnc_price_set_source_string maps a source string to the PriceSource enum and
silently leaves the source unchanged for anything it doesn't recognize -- a
silent no-op a naive Python or Guile script can hit. Steer callers to
set_source() with a PriceSource member (added in #2317) instead.

Python bindings:
- Deprecate GncPrice.set_source_string(): it now emits a DeprecationWarning
  pointing at set_source(PriceSource.<...>). It still works during the
  deprecation period and still guards -- if the string is not recognized (the
  round-tripped source no longer equals the input) it raises ValueError rather
  than silently doing nothing.
- Fix the deprecated() decorator in deprecation.py: it referenced the undefined
  DeprecationWarnig and inspect.current_frame(), so it raised instead of
  warning (the one existing @deprecated use was latently broken).

Guile bindings:
- mark gnc-price-set-source-string deprecated in engine.i.
  (Python and Guile use separate SWIG interface files, so Python is
  handled separately). The only in-tree Guile caller is the QIF importer, updated to
  gnc-price-set-source with PRICE-SOURCE-USER-PRICE; the redundant
  set-source-string in test-engine-extras.scm's fixture helper is dropped.

Tests (test_price_and_wrapping.py):
- TestSetSourceStringGuard covers the guard (still raises on an unrecognized
  string) and the new DeprecationWarning.

Removing set_source_string from the Python bindings is a follow-up.
2026-09-25 16:05:19 -07:00
John Ralls fbcb9f5e75 Merge Noah Noerr's 'bug799796-price-example-getvalue' into stable. 2026-09-25 14:38:24 -07:00
Noerr 89448ffd34 [bindings/python] Fix and modernize the price example scripts (Bug 799796)
PR #2187 made GncPrice.get_value() return a GncNumeric wrapper and clone() a
fully wrapped GncPrice. The price example scripts still used the pre-5.15 raw
_gnc_numeric idiom and broke -- reported as Bug 799796 (cloned prices silently
kept the original value).

Example scripts (bindings/python/example_scripts/):

* quotes_historic.py -- reworked to the modern idiom; it now actually runs on
  5.x (it had further latent breakage beyond the reported one):
  - Construct each price directly with GncPrice(book) + setters instead of
    cloning an existing price, so the script no longer needs a pre-existing
    price in the book. Look the pricing currency (USD) up from the commodity
    table rather than deriving it from a split.
  - Build the value with the double->GncNumeric constructor at GnuCash's
    standard price precision -- the pricing currency's SCU * COMMODITY_DENOM_MULT
    rounded HALF_UP (gnc-pricedb.h "Price policy") -- dropping the
    Fraction.from_float().limit_denominator(100000) dance and its import.
  - Set the source with the PriceSource enum -- set_source(PriceSource.FINANCE_QUOTE)
    (the enum added in #2317). The original set_source("Finance::Quotes::Historic")
    passed a string to what has been an enum setter since 2.6, which raises
    TypeError on modern bindings.
  - Open with Session(url), which defaults to SESSION_NORMAL_OPEN. The old
    Session(url, True, False, False) passed the deprecated ignore_lock=True,
    silently bypassing the book's lock file.

* priceDB_test.py, price_database_example.py -- num/denom are methods now, so
  read v.num() / v.denom().

Prevent silent recurrence (gnucash_core.py):
The write path failed *silently*, which is how this slipped through review and
CI. num/denom are read-only accessor methods, so assigning to them merely
shadows the method and changes nothing. Add a GncNumeric.__setattr__ that raises
AttributeError on assignment to num/denom, pointing at the correct idiom
GncNumeric(num, denom).

Test (bindings/python/tests/test_numeric.py):
New test_num_denom_read_only covering the guard. It needs no backend, so it runs
in the existing python-bindings CTest on all platforms.

The wiki page Stocks/get_prices, which the reporter copied from, is being
updated separately.
2026-09-24 22:08:37 -07:00
John Ralls 973a64ceda Correct the summary and description for the chart-tooltip-position preference schema.
Thanks to Simon Arlott for noticing and reporting it.
2026-09-24 15:58:38 -07:00
John Ralls 5b687ae193 Merge Noah Noerr's 'python-pricesource-enum' into stable. 2026-09-24 13:26:12 -07:00
Noerr f21fec06be [bindings/python] Add a PriceSource enum for gnc_price_set_source()
Setting a price's source from Python meant reaching into gnucash_core_c for the
raw PRICE_SOURCE_* constants. Add a PriceSource(IntEnum) alongside SessionOpenMode,
with values sourced from the C enum (via gnucash_core_c) so they can't drift, so a
script can write price.set_source(PriceSource.FINANCE_QUOTE) with a plain top-level
import.

Add test_price_and_wrapping.TestPriceSourceEnum:
 - test_values_match_c_enum asserts the Python enum covers the C PRICE_SOURCE_*
   value set exactly, so adding, removing, or renumbering a C value fails CI until
   PriceSource is updated to match. (Member names are a Python-side choice --
   FINANCE_QUOTE spells out FQ -- so the check is on values.)
 - test_set_source_accepts_enum confirms a member flows through set_source() and
   round-trips.
2026-09-24 00:41:54 -07:00
Christopher Lam c8317b15a0 [test-scm-utilities.scm] addendum last commit "quote" now sanitized 2026-09-24 09:28:36 +08:00
Christopher Lam 0cbce35a47 [engine.i] delegate gnc:html-string-sanitize to g_markup_escape_text 2026-09-24 08:25:18 +08:00
John Ralls cb304edfa6 Bug 799813 - gnucash-cli issue for price updates using Postgressql back-end
Reorder the CLI quotes get startup sequence to load GncQuotes before
loading the session so that preconfigured quote sources don't null
out other supported sources.

Make the SQL backend create a new source when an unknown one is found in
the commodities table like the XML backend does.

Thanks to  Ganesh Suriyanarayanan for diagnosing the problem and
proposing a solution.
2026-09-22 15:52:16 -07:00
John Ralls f488cf356a Qif Import: Fix segment order when parsing YDM dates. 2026-09-21 12:45:05 -07:00
John Ralls 3c9cfbb916 Merge Roy Hansen's 'improve/natural-sort-id-columns' into stable. 2026-09-19 17:08:55 -07:00
John Ralls 1e5f5d184d Merge Huang Zhaoquan's 'bug-799803' into stable. 2026-09-19 15:47:38 -07:00
John Ralls 6bf9adf09b msgmerge the 5.17 gnucash.pot to prepare for next release. 2026-09-19 15:35:45 -07:00