Commit Graph

2349 Commits

Author SHA1 Message Date
Christopher Lam
c02152b34a [Account.hpp] xaccAccountGetSplits returns a reference to vector 2024-10-27 16:14:17 +08:00
Christopher Lam
10857219ab [Account.cpp] refactor acc->balance_limit getters/setters 2024-10-18 08:35:26 +08:00
Christopher Lam
63deaad249 [Account.cpp] use newer qof_instance_get|set_path_kvp
which do not require GValue dance

small modification of xaccAccountSetLastNum behaviour with
empty-string last_num
2024-10-18 08:35:26 +08:00
Christopher Lam
c0b2b761e9 [qofinstance.cpp] GValue on stack instead of heap 2024-10-18 08:35:26 +08:00
Christopher Lam
a26a6c4a6f [qofinstance.cpp] add overloaded qof_instance_set|get_path_kvp
these overloaded functions to kvp slots do not require GValue
2024-10-18 08:35:25 +08:00
Christopher Lam
ecabcef084 [Account.cpp] small modification xaccAccountSetLastNum
if last-num is empty-string, remove the slot. this makes the behaviour
consistent with other slots.
2024-10-13 08:43:41 +08:00
Christopher Lam
d13f930a8c [Account.cpp] tightening loops, less g_list_free 2024-10-12 09:44:34 -07:00
John Ralls
7f8d5456c7 Bug 798789 - Trading Accounts
Scrubbing during SQL load can't commit the changes from the scrub
because the backend's m_loading member is true so disable scrubbing
during database load and edit/commit all transactions again after
loading is complete.
2024-10-06 14:09:57 -07:00
Yongun Seong
a7804525b0
[gnc-quotes.cpp] fix quote report 2024-10-01 02:35:34 +09:00
Kanstantin K.
d0b210a6df Bugfix 797045 - Correct error message when connection to database failed
This is to fix the defect https://bugs.gnucash.org/show_bug.cgi?id=797045
Error type chaged to ERR_BACKEND_CANT_CONNECT in gnc-backend-dbi.cpp when connection to database failed
2024-09-28 09:36:43 +02:00
John Ralls
6aeca0040e Bug 799419 - Intermittent quote price issue
Track quote source in Finance::Quote return json so that duplicate symbols in
different namespaces can be kept separate.
2024-09-26 17:55:39 -07:00
John Ralls
7b34971c87 Gnc-options-date: Make the accounting period struct tm empty...
If the accounting period start-choice is anything but absolute instead
of matching the accounting period month and day to the present month and
day. The latter is a non-obvious hack that depends on
gnc_accounting_period_fiscal_start() returning the present day if it's
not set.
2024-09-22 16:15:52 -07:00
John Ralls
c584337c3a Bug 799395 - relative date offset quarters occasionally wrong
If the accounting period start month and the present month are the
same the present month would be offset by 3. Don't do that.
2024-09-22 16:12:54 -07:00
John Ralls
9c9ad7c271 Replace GncFQQuoteSource api-key members with a bp::environment one. 2024-09-21 10:04:58 -07:00
John Ralls
a23506c88a Add YH Finance (FINANCEAPI) API Key to Quotes infrastructure.
And add financeapi to known sources.
2024-09-19 13:25:59 -07:00
Christopher Lam
ab641b31f8 [gnc-datetime] improve CSV date parser with ICU and boost
1. Add dateformat "Locale" with ICU; uses current locale for date
   parsing. ICU's locale date parser may parse "3 May 2023" or
   "2024年9月13日" (LC_TIME=zh_TW.utf8) and maybe others.

2. Augment d-m-y m-d-y and y-m-d with boost UK/US/ISO parsers. This allows
   CSV import of dates with months as words as "30 Sep 2023" or
   "May 4, 1978" or "2023-Dec-25". Note boost parser cannot recognise
   2-digit years, therefore "30 Sep 24" is invalid.
2024-09-14 10:13:52 +08:00
Christopher Lam
d935edeea5 [gnc-date.cpp] deprecate gnc_difftime
because it casts time64 to doubles
2024-09-08 21:11:44 +08:00
Christopher Lam
dc84e4d10c [gnc-pricedb.h] remove unused gnc_pricedb_substitute_commodity 2024-08-31 20:46:05 +08:00
Christopher Lam
1718fa0b6e [gnc-pricedb.h] remove unused gnc_pricedb_lookup_at_time64 2024-08-31 20:45:32 +08:00
Christopher Lam
a99491d034 [gnc-commodity.h] callers must free g_list
callers to gnc_commodity_namespace_get_commodity_list and
gnc_commodity_table_get_namespaces_list must free the GList.
2024-08-27 20:00:50 +08:00
John Ralls
514793d7a0 Bug 799389 - Crash when removing an account
Destroying the split vector from front->back crashes halfway through
because the iterators aren't updated as we remove items from the
vector. Iterating in reverse works because the remaining elements
aren't moved as we delete.
2024-08-19 12:59:17 -07:00
Christopher Lam
48f3842eaa [Account.cpp] compare vectors with std::equal in xaccAccountEqual 2024-08-18 19:46:07 +08:00
Christopher Lam
f65f877098 [Scrub.cpp] don't create intermediate GHashTable and GList
use unordered_set instead
2024-07-17 23:53:02 +08:00
John Ralls
5fe7a09e7d Bug 799370 - Transaction Journal view cursor placement after commit to...
transaction change.

This also reverts commit 60ccca017 and fixes Bug 799347 in a different
way that avoids the problems found during the investigation of 799370
and reported on gnucash-user.
2024-07-15 12:23:40 -07:00
Christopher Lam
88d8f63853 [Account.cpp] overload gnc_account_foreach_descendant takes std::function
and separate account_foreach_descendant_sorted
2024-07-12 17:54:17 +08:00
Christopher Lam
5f17334395 [transaction.cpp] use std::swap instead of SWAP macro 2024-07-09 20:09:24 +08:00
John Ralls
60ccca017f Bug 799347 - Edit account to make it sub account under other account
Send QOF_EVENT_REMOVE on the child before actually removing it from
the children vector so that the stored indexes are valid long enough
to clear them.
2024-07-01 21:31:55 -07:00
John Ralls
ad7a51a6ef Merge Chris Lam's 'acc-children-vector' into stable. 2024-06-27 13:21:49 -07:00
Robert Fewell
8bd7deb3dc Reapply filter when number of sub-accounts change
When viewing a register that displays sub-accounts, if the number of
sub-accounts is changed, the query is rebuilt from the remaining
sub-accounts but when a filter is being used it is not applied after.

Fixed by checking the original query for a filter and if so applying
that after query rebuilt.
2024-06-27 10:03:22 +01:00
Christopher Lam
a6463f9814 [utest-Account] add more balance limit tests 2024-06-24 11:09:47 +08:00
Christopher Lam
b7fde90411 [Account.cpp] xaccAccountStagedTransactionTraversal copies SplitsVec
because create_transactions_for_instance which calls
xaccAccountStagedTransactionTraversal will modify the splits
2024-06-18 20:29:14 +08:00
Christopher Lam
cd097d19ec [Account.cpp] don't copy SplitsVec 2024-06-18 08:24:17 +08:00
Christopher Lam
119e257146 [Transaction|Split.cpp] Remove Reg2 unused functions 2024-06-17 21:53:26 +08:00
Christopher Lam
47791734bb [SX-ttinfo.cpp] tidier, using c++ stl and algo 2024-06-12 23:17:32 +08:00
Christopher Lam
ddc7958801 [~qofchoice.cpp] remove, not useful
because the options GLists are populated, but are never actually
queried. The QOF_TYPE_CHOICE definition is moved to qofclass.h
2024-06-10 01:33:06 +08:00
Geert Janssens
bd6e79b4d6 Rework version-info rules to allow building from github downloaded zip archives 2024-06-08 18:06:45 +02:00
Christopher Lam
d1807b6c15 [engine.i] move gnc_accounts_and_all_descendants to engine.i 2024-06-07 18:10:40 +08:00
Christopher Lam
6cac9d0ebb [Account.cpp] priv->children is a vector<Account*> 2024-06-07 18:10:40 +08:00
Daniel Harding
c4d44ea024 Bug 799324 - Invalid free in gvalue_from_kvp_value()
As of ddc3f28899, gvalue_from_kvp_value()
takes a GValue pointer from the caller, which in some cases points to
memory on the stack.  If that is the case and the code also hits the
default case in the switch statement, the unconditional g_slice_free()
call will attempt to free stack memory, causing the program to abort.

Fix by requiring the caller to always pass in a valid GValue pointer,
making the caller responsible for freeing it if necessary.  This also
means that it is no longer necessary for gvalue_from_kvp_value() to
return a value, so make it a void function.
2024-06-02 14:39:11 -07:00
Christopher Lam
6c7abb487d [SX-ttinfo.hpp] convert to c++ header 2024-06-01 12:03:34 +08:00
Christopher Lam
7dc2e2e6f9 [SchedXaction.cpp] use c++ algo 2024-06-01 11:45:41 +08:00
Christopher Lam
55592efe25 [SchedXAction.cpp] convert to c++ 2024-06-01 11:45:41 +08:00
Christopher Lam
109497d471 [SX-ttinfo.cpp] convert to c++ 2024-05-31 22:24:48 +08:00
Christopher Lam
5b1bb1186f [SX-book.cpp] convert to c++ 2024-05-31 22:06:55 +08:00
Christopher Lam
e80249ce2b [Account.cpp] gnc_account_remove_split shortcuts removing last split
this speeds up book shutdown which empties the account splits in
reverse chrono order.
2024-05-27 07:03:42 +08:00
Geert Janssens
e8e179fd8f Drop remainder of files in libgnucash/doc
Relevant diagrams have been added in the wiki as png files.
The html files with financial calculations are copyrighted
by someone outside of the gnucash project. I'd rather not
add that info to the wiki. Similar information should be
easy to find on the internet.
2024-05-23 15:10:05 +02:00
Geert Janssens
387b4988e5 Move doxygen target and related files to toplevel.
Note: this also means the target directory changes from
      libgnucash/docs/html
      to
      [toplevel]/doxygen/html
2024-05-23 15:10:05 +02:00
Geert Janssens
c816d2b34f Doxygen - minor cleanup of gnc-lot.h 2024-05-23 15:10:05 +02:00
Geert Janssens
e8d72ad53f Doxygen - merge separate txt files into respective header files 2024-05-23 15:10:05 +02:00
Geert Janssens
6cd8e4e458 Doxygen - drop obvious cases of deprecated code 2024-05-23 15:10:05 +02:00