Commit Graph

16 Commits

Author SHA1 Message Date
Robert Fewell
e535ba5411 Change some functions to use const gnc_commodity for gnc_pricedb 2021-04-23 11:56:15 +01:00
Robert Fewell
e75308e684 Rename a couple of gnc-pricedb functions that have not been used.
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.
2021-04-23 11:56:15 +01:00
Robert Fewell
4a491f7cde Change a couple of docbook definitions in gnc-pricdb.h 2021-04-23 11:56:15 +01:00
Robert Fewell
05507008c5 Add retrieval functions for price before the date given
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.
2021-04-23 11:56:15 +01:00
Dong Lin
75209c024f Update price database for imported transactions
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
2021-03-09 10:39:56 -08:00
Christopher Lam
2ecdd70e24 [gnc-pricedb.c][api] pull out composite pricedb price retriever
* tries direct price retrieval from pricedb.
* if fails, tries intermediate currency.
2020-10-26 23:55:51 +08:00
Robert Fewell
4368e18ac5 Bug 797165 - Crash on price deletion.
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.
2019-04-26 12:09:05 +01:00
John Ralls
fee589b28c Remove Timespec from pricedb.
Includes removing the time64 specialized functions because the regular ones
handle time64 now.
2018-08-13 11:52:42 -07:00
John Ralls
6f89bd62b3 Remove timespec from gnucash/gnome.
With a little API bleed into engine.
2018-08-12 16:12:19 -07:00
Christopher Lam
ca22d5531b Change gnc_pricedb_convert_balance_nearest_price from timespec to time64. 2018-01-20 16:40:45 -08:00
Christopher Lam
465c9e1f21 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch]
gnc_pricedb_lookup_nearest_in_time64
gnc_pricedb_lookup_nearest_in_time_any_currency_t64
2018-01-08 22:56:49 +11:00
Christopher Lam
dda0695285 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch] 2018-01-08 22:56:49 +11:00
lmat
61d4aaaf08 Adding some time64 alternatives 2018-01-08 13:01:29 +11:00
lmat
eb6c741bf9 Account.c to Account.cpp
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.
2017-12-21 07:39:32 -05:00
Robert Fewell
667f175757 This change modifies the way old prices can be removed.
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.
2017-08-20 09:50:31 +01:00
Geert Janssens
83d14e1c1c Restructure the src directory
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.
2017-08-10 18:45:00 +02:00