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().
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
There is some inconsistency with the wording of the invoice menu
entries when say a bill is displayed, like 'Jump to Invoice' when it
would be 'Jump to Bill'. Whilst looking at this, further places where
this could be a problem was highlighted so this commit changes entries
to 'Business item'.
Change the Import Map Editor to look for the KVP slot
"ofx/associated-income-account" so it can be listed. The account
reference stored is a GUID so add a function to retrieve that so the
existing gnc_account_delete_map_entry function can be used to remove it.
Fix double delete in qof_instance_kvp_remove_guid and remove vestigial glist support.
In the KvpValue::Type::FRAME case if the guid matches, it does both:
delete inst->kvp_data->set_path({path}, nullptr);
delete v;
Where earlier the v was set to be:
auto v = inst->kvp_data->get_slot({path});
The second delete is a duplicate of the first and should be removed.
The collection_compare_cb function set the user_data pointer to point to a local variable
of the function. That pointer is then used in the (only) calling function
qof_collection_compare to make decisions. This is undefined. It is likely not an actual
problem because the stack depth of the qof_collection_foreach followed by
collection_compare_cb is deeper than the qof_collection_get_data call (and others
in between if any) that the stack data user data stays uncorrupted.
But, it is undefined behavior, and could cause really subtle bugs if these there are code
changes that have deeper stack between the setting and using.
Also, using this local variable is not necessary, the qof_collection_compare function
already sets up a variable local to its scope for this that the collection_compare_cb can
use directly.
This commit removes the local (to collection_compare_cb) variable and uses the one setup
in qof_collection_compare.
The full coverage test for qofid.cpp passed before and after this change.