2593 Commits
Author SHA1 Message Date
PRG-112 f5f133e104 Enhancement - New global properties for CHARTS (GC's level)
This one a is quite an improvement on customisation of reports/charts. User can decide now what kind of point style should be used, including size, hover range and such.

On top of that:
- some tooltip improvements were made as well, including configurable one in GC's Properties.
- Price Scatterplot - fixed colors, got rid of a superfluous markers
- global defaults to be tuned in the next batch

Settings available at: GnuCash -> Edit -> Preferences -> Reports
2026-08-31 20:34:24 +02:00
Bruce Schuck 7745f89580 Removed MorningstarUK and MorningstarCH 2026-08-10 12:23:22 -07:00
Christopher Lam a4f69f44a7 [Transaction.cpp] null check before accessing struct member 2026-08-06 22:27:34 +08:00
John Ralls 332db182f2 Document that transaction void-time invalid value is now INT64_MAX. 2026-07-18 16:49:05 -07:00
John Ralls 6e33c23815 Bug 799791 - Unvoid is not available (Bug from the mailing lists)
Use the existence of void timestamp instead of void reason to
determine if a transaction is voided. A user can void a transaction
without providing a reason.
2026-07-18 10:25:17 -07:00
Christopher Lam 36bd906b67 [gnc-euro.cpp] use GncNumeric.convert() instead of gnc_numeric_convert 2026-07-16 17:03:15 +08:00
John Ralls b766c126ee Merge Sherlock's 'stock-splits' into stable. 2026-07-14 14:24:53 -07:00
Sherlock 80211df860 Miscellaneous cleanup 2026-07-14 14:20:09 -07:00
Sherlock 4d6f19a0f9 Bug: Missing account event
An account event should be generated for the original account if a lot is moved to a different account in xaccAccountInsertLot() as it is, if the lot is removed in xaccAccountRemoveLot().
2026-07-14 14:19:24 -07:00
Sherlock b1efe0763c The lot scrubber should exclude stock-split splits. 2026-07-14 14:19:24 -07:00
Sherlock 0aac4438e7 Bug: Gain/Loss displayed in "Splits free" is not correct
The gain/loss displayed for splits in the "Splits free" is historical.  It may or may not be correct.  Instead, the gain should be calculated against the selected lot for appropriate splits.

Implements xaccSplitLotCapGain() to obtain the gain for the selected lot.
2026-07-14 14:19:12 -07:00
John Ralls 453a4fe886 Merge Noah Noerr's 'fix-qofsession-end-releases-lock' into stable. 2026-07-11 11:03:53 -07:00
Noah R f056be140c [backend/dbi] skip the libdbi integrity probe for read-only sessions
session_begin() runs dbi_library_test() (Bug #611936) on every open to
detect a libdbi/-ffast-math miscompilation that mangles 64-bit values.
The probe CREATEs, INSERTs into, SELECTs from and DROPs a temporary
table, so it needs write privileges on the database -- even for
SESSION_READ_ONLY. A least-privilege, read-only database user therefore
cannot open the book at all: the temporary-table create fails and
session_begin returns ERR_SQL_DBI_UNTESTABLE.

The defect the probe guards against is on the write side of libdbi, so it
can be neither triggered nor detected by a read-only session, which never
writes. Skip the probe when the session is opened SESSION_READ_ONLY, at
the two call sites a read-only open reaches (the SQLite session_begin and
the shared MySQL/PostgreSQL session_begin); the third call site is inside
the create branch, which read-only never enters. The write-capable modes
(NORMAL_OPEN, NEW_STORE, NEW_OVERWRITE, BREAK_LOCK) still run the probe
unchanged.

This lets a SELECT-only database user open a book read-only through the API.
2026-07-10 17:52:55 -07:00
Christopher Lam b3e8074890 [gnc-euro.cpp] store euro rates as GncNumeric
this increases euro conversion rounding accuracy
2026-07-10 17:00:48 +04:00
Noah R 5dc53303b5 [engine] qof_session_end: release the lock via the session's backend
qof_session_end() is documented to release the session lock and shut the
backend connection but it does not release the session lock in all scenarios
(BUG). qof_session_end() looked the backend up via qof_book_get_backend().
The book's backend pointer is only set by load() or a data-changing save() (an
empty book's save() early-returns before attaching it); begin() sets only the
session's own m_backend. So a session that creates a store and ends it without
loading or making a real change had a backend on the session but not on the
book: end() found none, skipped session_end(), and never released the lock --
it was only released later at destroy().

Because the fault is in backend-agnostic engine code it affects every backend
that locks at begin(): the SQL/DBI backends leave a stale row in the gnclock
table, and the XML/file backend leaves an abandoned <file>.LCK sentinel (with
no data file, since XML data is only written at save). The store then appears
locked to the next opener.

End the session's own backend (m_backend, always set at begin()) instead. It
already equals the book's backend whenever the latter is set, so the change is
a no-op for loaded/saved sessions and additionally covers the
created-but-not-attached case.

Add regression tests for both backends, each of which begins a create-mode
session, ends it without a data-changing save, and checks the lock is gone:
  - test-backend-dbi-basic.cpp (test_dbi_new_store_end_releases_lock): reopens
    the store and asserts it is not ERR_BACKEND_LOCKED.
  - test-load-backend.cpp (test_new_store_end_releases_lock): asserts the XML
    <file>.LCK lockfile has been removed.
2026-07-09 20:24:45 -07:00
Sherlock 31978c1b4d Only show the “Show stock split adjusted amounts” checkbox when there are stock splits
Added has_stock_split field to Account private.  This flag is set to true when  xaccAccountRecomputeBalance() detects a stock-split split otherwise it is false.  Defined and declared xaccAccountHasStockSplit() for use by the Lot Viewer to whether to display the check box.
2026-07-09 01:17:17 -07:00
Sherlock 28cdb77a0b Improve code reuse 2026-07-09 01:15:59 -07:00
Sherlock 1e654412ab use adjusted_amount in place of amount
impacts gains, lots, and policy
2026-07-09 01:15:59 -07:00
Sherlock b1eb12f558 Determine the adjusted_amount for each split in an account
The algorithm to determine the current adjusted_amount is implemented in xaccAccountRecomputeBalance().

If the balance or new balance is nil, the stock-split split is ignored as it isn't possible to calculate the stock-split ratio.  This means the prior split adjusted amounts will not reflect the true current adjusted amounts.  These are conditions that should be raised appropriately to the user with sufficient details for resolution.
2026-07-09 01:15:59 -07:00
Sherlock 254ec4b4d0 Improve stock-split type detection
Noted split_type field in Split exists but is not used...

Reset split_type field's data type to hold the type of the getter.
Implemented xaccSplitIsStockSplit() abstraction to limit the split type string reference to Split.cpp and propagated it's use.
2026-07-09 01:12:49 -07:00
Sherlock 0d5c74b868 Add adjusted_amount field to split
The adjusted_amount field of a split will hold the stock split adjusted amount.  The adjusted amount is initially the same as the original amount.  When the account balances are recomputed and a stock-split split type is encountered, the ratio of the stock split will be applied to the preceding splits adjusted_amounts.  If there are no stock splits in the split's account, the adjusted amount remains the original amount.
2026-07-09 00:48:41 -07:00
John Ralls dc03a84c33 Merge Christopher Lam's 'qof-ctor-dtor' into stable. 2026-06-23 16:15:03 -07:00
John Ralls 7f4e8c29e0 Merge Noah Noerr's 'online-id-engine-accessors' into stable. 2026-06-23 14:55:41 -07:00
Noah R 3e98c5d8c8 [engine] Add first-class online_id accessors for Split and Account
Promote the OFX/HBCI online_id to named engine accessors:
  xaccSplitGetOnlineID / SetOnlineID / HasOnlineID
  xaccAccountGetOnlineID / SetOnlineID
The getters return an instance-owned const char* (mirroring
xaccTransGetDocLink / xaccTransGetNotes), so the existing
add_methods_with_prefix auto-wrapper exposes them in the Python bindings
with no .i changes and no %newobject.  They write to the same engine KVP
slot ("online_id") the desktop importer uses, so there is no data or
behavior change.

With the accessors in place the gnc_import_*_online_id wrappers in
import-utilities are redundant, so replace every call site (OFX,
AqBanking, and the generic matcher/backend) with them, delete
import-utilities.cpp, and drop the online_id declarations from
import-utilities.h (its importer preference-key macros are retained).

- The engine getters return an instance-owned const char* instead of a
  g_strdup'd copy, so callers no longer free the result; the affected
  locals are retyped const and their g_free()s dropped.
  hash_account_online_ids() g_strdups before inserting, since its hash
  table owns its keys (g_free key-destructor).
- xaccAccountSetOnlineID(acc, "") clears the slot, matching the OFX
  "delete the online_id" intent (the old wrapper stored an empty string).
- Drop the two unused wrappers: gnc_import_set_trans_online_id (marked
  "Not actually used") and gnc_import_trans_has_online_id (no callers).
- Add xaccSplitGet/SetOnlineID to the Split gmock so test-import-backend
  links without import-utilities.
2026-06-21 16:43:03 -07:00
Noah R 222714d764 [engine] Remove the unused Transaction online_id property
The "online-id" GObject property on Transaction (KVP slot "online_id")
was vestigial: GnuCash records the OFX/HBCI import identifier on the
bank/asset Split, not on the Transaction.  Drop the property, its
get/set_property cases, the xaccTransClone special-case that cleared it,
and the corresponding test_trans_kvp_properties coverage.
2026-06-21 16:35:56 -07:00
John Ralls 32a6868f52 Merge Noerr-Noah's 'bug-split-setparent-kvp-slots' into stable. 2026-06-21 15:41:47 -07:00
Noah R ea93d42f58 Bug 799777 - xaccSplitSetParent: keep a reparented split's KVP slots
When an already-committed split is moved to another transaction with
xaccSplitSetParent(), the split was marked dirty *after* the old
transaction was committed.  trans_cleanup_commit() only drops a
moved-out split from the old transaction's split list when the split is
dirty at that commit, so the still-clean split was left dangling in the
old transaction's split list.

On the SQL/DBI backends, destroying the now-vacated old transaction then
deleted the moved split's KVP slots (online_id, cap-gains links, ...) by
the split's own GUID, even though the split now belongs to another
transaction.  The split's native columns survive -- they are rewritten
under the new tx_guid -- but its slots are lost; in some sequences the
save fails outright with "UNIQUE constraint failed: transactions.guid".
The XML backend is unaffected because it re-serializes the whole book.

Mark the split dirty before committing the old transaction so
trans_cleanup_commit() removes it from the old transaction's split list,
as that code already intends.  This is a no-op for split creation (the
overwhelmingly common caller), where the prior parent is NULL.

Add a DBI round-trip regression test (sqlite3, and mysql/pgsql when the
TEST_*_URL variables are set): seed a split carrying an online_id, save
and reload, reparent it onto another transaction, destroy the old
transaction, then save and reload again and assert the online_id
survived.
2026-06-21 15:23:08 -07:00
John Ralls 59f0de826b Merge Vincent Lucarelli's 'finnhub into stable. 2026-06-21 14:50:08 -07:00
Vincent Lucarelli 21d861338e Add new Finance::Quote source Finnhub.io
Free API key (personal/non-professional use) available at https://finnhub.io.
Set FINNHUB_API_KEY environment variable to API key to use this source.
As of June 2026, free tier API limit is 60 API calls/minute.
2026-06-21 14:47:09 -07:00
Christopher Lam 54693abe30 [gnc-commodity.cpp] gnc_quote_source_num_entries speedup
previously was allocating a vector copy, and measuring the distance
manually. return std::list size() which is maintained internally.
2026-06-19 16:30:20 +08:00
Christopher Lam 368b2894b5 [guid.cpp] plug char* guid_to_string leak
it seems unused however
2026-06-16 19:16:49 +08:00
Christopher Lam fab8a3520a eradicate QOF_TYPE_COLLECT
it's unused...
2026-06-15 08:43:39 +08:00
Christopher Lam 56467754f1 [qofid.cpp] use ctor/dtor for QofCollection
which will make it easier to construct in-place in book->hash_of_collections
2026-06-15 08:43:01 +08:00
Robert Fewell 8f10b4f864 Couple of spelling errors in gnc-accounting-period 2026-06-11 11:42:25 +01:00
Christopher Lam 13112ab809 rename gmock-qofbook.h and gmock-Split.h to .hpp 2026-06-10 09:58:19 +08:00
Christopher Lam 63917e0824 [qofbook.cpp] move _QofBook definition from qofbook.h to qofbook-p.hpp
to make it opaque

and change:
- qofbook.h to .hpp
- test-qofbook.c to test-qofbook.cpp
2026-06-10 09:58:19 +08:00
Christopher Lam 8b6d93eb87 [test-qofbook.c] use getters instead of accessing QofBook members 2026-06-10 09:46:39 +08:00
Christopher Lam db6cac5b82 [qofbook.h] add further getters/setters for QofBook 2026-06-10 09:44:16 +08:00
Christopher Lam 908bfc0802 [core-utils] upgrade ctre in CMakeLists to public
so that it's available everywhere including tests
2026-05-28 17:07:57 +08:00
Christopher Lam f36532131b ensure boost::regex is compiled at startup
instead of per-call
2026-05-28 17:07:19 +08:00
John Ralls 2911a0cce3 Bug 797384 - Gnucash doesn't handle commodity prices with big...
numerator/denominator properly

- Use GNC_HOW_DENOM_REDUCE | GNC_HOW_RND_ROUND to preserve precision while
avoiding overflows.

- Rearrange the function's tests to perform only one division or
multiplication instead of unconditionally dividing

- Rename the from_ and to_ variables to p(rice)1 and p2 to reduce
conflation with the input from and to.
2026-05-25 11:32:19 -07:00
galbarm 25e0f2144a Account tree: make numeric columns selectable via GncCellRendererLabel
Implements the approach suggested by jralls in PR #2222: instead of a
context menu action, introduce GncCellRendererLabel - a
GtkCellRendererText subclass that returns a read-only, selectable
GtkEntry when a cell is activated.

All numeric columns (Balance, Total, Cleared, Reconciled, Present,
Future Minimum, and their report/period variants) are affected because
they all go through gnc_tree_view_add_numeric_column.

Usage:
- Click once to select the row (unchanged behaviour)
- Click again on a numeric cell to activate it; the value appears in a
  read-only entry field with the text pre-selected
- Ctrl+C copies the value to the clipboard; Escape or clicking away
  dismisses the field without modifying the model
- Unicode bidi control characters (added by GnuCash for RTL display)
  are stripped before showing the value so the copied text is clean
2026-05-23 13:14:55 +01:00
John Ralls ec4a85a56c Correct the Doxygen doc for qof_instance_get/set_kvp. 2026-05-22 15:47:40 -07:00
Christopher Lam bbb80105ff [gnc-aqbanking-templates.cpp] fix incorrect setter, free GList* 2026-05-22 21:15:29 +08:00
Christopher Lam 55856c63dd [gnc-budget.cpp] null check arguments *before* accessing them 2026-05-22 21:15:27 +08:00
Christopher Lam 384043ac41 [gnc-filepath-utils.cpp] use ctre instead of std::regex 2026-05-17 08:39:17 +08:00
Christopher Lam 96dac7bb38 [gnc-filepath-utils.cpp] null check char* arguments 2026-05-16 18:31:28 +08:00
Bruce Schuck 4ff491b565 Removed AEX from list of commodities.
euronext.com is now using JS based anti-webscraping.
2026-05-10 10:49:32 -07:00
John Ralls d4c6101c6c Return immediately from qof_book_destroy if hash_of_collections is null.
If qof_book_destroy is called on a QofBook* freshly created with
qof_book_new (usually because it was used to create a session that now
must be destroyed) it would try to empty the non-existent hash tables,
crashing.
2026-04-22 11:24:18 -07:00
Sherlock d8cd905e14 Bug 799314 - Add Run command to Schedule Transactions
This patch adds a “Run” command to the “Scheduled Transactions” tab to allow users to select the scheduled transactions to be included in a “Since Last Run…” window.   If there are no instances of a selected transaction triggered by today’s date, the next instance is triggered.
2026-04-21 09:48:48 -07:00