To be more consistent change gnc_pricedb_lookup_latest_before_t64 and
gnc_pricedb_lookup_latest_before_any_currency_t64 to be of the form
'_nearest_before_' and add a missing utest.
Add a new function, gnc_pricedb_convert_balance_nearest_before_price_t64
that retrieves the balance using the last price dated before a
specified date like today for the preset value. This uses another new
function gnc_pricedb_get_nearest_before_price to do the retrieval.
When a transaction is added from the ledger, price database is updated properly.
But if the transaction is imported, there is no price db update.
This change adds the proper pricedb update in the import path (qfx/ofx/qif).
Tested with make check
Caused by the introduction of caching used in gnc_pricedb_nth_price,
when prices were deleted, the cached list was never updated and so the
tree model could reference a deleted price and hence crash. This also
affected adding prices as the new prices would not show due to the
cache not being updated. To fix this a function was added to reset the
cache when prices are updated from the model.
Since Account.c is now Account.cpp, the function signatures look a bit
different internally. The tests rely on function signatures in error
messages. Instead of trying to figure out what the exact
function signature might be, I use a substring matching strategy to
ensure that the correct error was issued.
There are now options to specify which commodities to remove prices
from as well as options to leave none or the last one for the week,
month, Quarter, year and a scaled option.
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)
This is the first step in restructuring the code. It will need much
more fine tuning later on.