Commit Graph

997 Commits

Author SHA1 Message Date
Richard Cohen
0798bce2a6 [-Wunused-value] - remove
borrowed/jenny/jenny.c: In function ‘next_builder’:
borrowed/jenny/jenny.c:1164:5: warning: statement with no effect [-Wunused-value]
 1164 |     for (i; i<n-1; ++i) {            /* reset all less significant positions */
      |     ^~~
borrowed/jenny/jenny.c:1172:5: warning: statement with no effect [-Wunused-value]
 1172 |     for (i; i<n-1; ++i) {            /* reset all less significant positions */
      |     ^~~
borrowed/jenny/jenny.c: In function ‘confirm’:
borrowed/jenny/jenny.c:1797:7: warning: statement with no effect [-Wunused-value]
 1797 |       for (i; i<n-1; ++i) {          /* reset all less significant positions */
      |       ^~~
borrowed/jenny/jenny.c:1805:7: warning: statement with no effect [-Wunused-value]
 1805 |       for (i; i<n-1; ++i) {          /* reset all less significant positions */
      |       ^~~

libgnucash/backend/xml/io-gncxml-v2.cpp: In function ‘gboolean qof_session_load_from_xml_file_v2_full(GncXmlBackend*, QofBook*, sixtp_push_handler, gpointer, QofBookFileType)’:
libgnucash/backend/xml/io-gncxml-v2.cpp:806:40: warning: value computed is not used [-Wunused-value]
  806 |                 g_thread_join (thread) != nullptr;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

libgnucash/engine/Account.cpp: In function ‘void xaccFreeAccount(Account*)’:
libgnucash/engine/Account.cpp:1428:17: warning: statement has no effect [-Wunused-value]
 1428 |     priv->color == nullptr;
      |     ~~~~~~~~~~~~^~~~~~~~~~
libgnucash/engine/Account.cpp:1429:22: warning: statement has no effect [-Wunused-value]
 1429 |     priv->sort_order == nullptr;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~
libgnucash/engine/Account.cpp:1430:17: warning: statement has no effect [-Wunused-value]
 1430 |     priv->notes == nullptr;
      |     ~~~~~~~~~~~~^~~~~~~~~~
libgnucash/engine/Account.cpp:1431:18: warning: statement has no effect [-Wunused-value]
 1431 |     priv->filter == nullptr;
      |     ~~~~~~~~~~~~~^~~~~~~~~~

libgnucash/engine/gnc-int128.cpp: In function ‘void decimal_from_binary(uint64_t*, uint64_t, uint64_t)’:
libgnucash/engine/gnc-int128.cpp:898:36: warning: right operand of comma operator has no effect [-Wunused-value]
  898 |     d[3] = (hi >> 32) & bin_mask, 0;
      |                                    ^
2023-02-16 09:19:19 +00:00
Richard Cohen
1c6679720b Use some unused variables 2023-02-06 14:20:31 +00:00
Richard Cohen
78ec20515b Remove some unused variables - and the initialization
- checked that any side effects were irrelevant
2023-02-06 14:20:28 +00:00
Richard Cohen
c819b03a17 Remove some unused variables - leave the side effect 2023-02-06 14:19:29 +00:00
Richard Cohen
ea2d3be217 Remove some unused variables with obviously no side effects 2023-02-06 14:19:22 +00:00
Robert Fewell
45a07463fb Change max timeout to 20 seconds for default invoice report 2023-02-05 10:21:56 +00:00
Geert Janssens
60209a766f Merge branch 'csv_import' 2023-02-04 19:13:16 +01:00
Geert Janssens
2d8bb6f62f Bug 796955 - Import CSV - Single-line two-currency transactions can't be imported
Behaviour is as follows:
If
  single line provides a price
And
  at some point in the import process we get into a
  situation where the base account and transfer
  account have a different commodity
Then
  transfer_acct amount = base_acct amount * price

If on the other hand base_acct and transfer_acct turn
out to have the same commodity, price is ignored.
2023-02-04 18:56:02 +01:00
Geert Janssens
99506d331a Reduce GncImportMatchMap to just the account
There is no added value in storing the book and account together
The book is easily retrieved from the account (as was
illustrated in the gnc_account_imap_new function).

I looked through the commit history to understand why this struct
was originally created and a long time ago it also had
a reference to a kvp frame.
2023-02-04 16:53:20 +01:00
Geert Janssens
51706f289c Minor corrections in comments 2023-02-04 16:43:46 +01:00
John Ralls
7bb14b9caa Merge Richard Cohen's 'use-reference-for-loop' into master 2023-02-02 14:32:14 -08:00
Robert Fewell
07f3f536cc Allow to select saved report on print invoice button
This change was inspired by mildred's #PR1247 and uses the new
GncReportCombo to allow selection of 'Saved Invoice reports' when the
invoice print button is used or when printing multiple invoices.

This change presents a dialog with the default for the report combo set
to the properties setting. This dialog has a timeout which is
adjustable under properties and will stop if a key is pressed or combo
popped so that a different report template can be selected and used.
There is also an 'OK' button that stops the time out and prints and a
'Cancel' button which cancels the print.
2023-02-02 14:05:53 +00:00
Robert Fewell
019214f1c2 Bug753307 - Custom Report be selectable as default Report for Printing
This commit changes the preference in Business->'Report for Printing'
to be saved as a book property and allow the selection of any Invoice
Report to be used as the default.
2023-02-01 16:29:11 +00:00
Richard Cohen
d8f45f2443 Use const references for for-loops to avoid unnecessary copies
Found by clazy - clazy-range-loop-reference
2023-01-31 14:44:57 +00:00
Christopher Lam
119356752f Merge branch 'maint' 2023-01-30 09:56:13 +08:00
Geert Janssens
894f8241e1 Revisit invoice payment in multi-currency context
- Show proper amount in dialog when applying or editing an existing transaction as payment
- Be more careful not to waste the existing payment split
- If the user changed the payment amount while starting from an existing transaction
  unreconcile the changed payment split
- Avoid needlessly changing transaction currency (only do so if the user chose
  a new transfer account and the old currency is neither the new transfer account's
  currency nor the post account's currency)
2023-01-29 23:09:06 +01:00
luzpaz
67ab9e90d2 Fix some typos 2023-01-26 13:48:58 +01:00
Christopher Lam
17820ec261 Merge branch 'maint' 2023-01-26 18:40:44 +08:00
John Ralls
f4c6d65395 Merge Bob Fewell's 'nofree' into maint. 2023-01-24 13:25:02 -08:00
John Ralls
f6919e60a7 Merge Richard Cohen's 'cleanup' into master. 2023-01-24 12:05:47 -08:00
John Ralls
46f9fb01c9 Simplify gnc_commodity equality and compare functions.
gnc_commodity_compare is used for sorting and so needs to have a less-than
return value. The only place it's used presents nothing to the UI; a GncGUID
ordering is fast and stable.

GnuCash allows only one commodity per book for any namespace/mnemonic pair, so
the exhaustive string comparisons are superflous. While the current engine
design allows only one instance of any object, meaning that a pointer comparison
is sufficient to determine equality, that may not be true in the future, but the
GncGUID is guaranteed to sufficiently identify a single commodity. Note that
gnc_commodity_equiv is used to enforce that single-commodity rule and so cannot
use GncGUID comparison.
2023-01-24 10:46:01 -08:00
Richard Cohen
6927535a0a Remove unused test function get_object_is_initialized in qofobject.cpp 2023-01-24 13:36:37 +00:00
Richard Cohen
e83c91050c Remove unneeded dummy.cpp 2023-01-24 13:36:02 +00:00
Richard Cohen
d6ac56ce5f Re-enable -Waddress - gncInvoiceLookup etc. are now inline functions, not macros
- Remove outdated comments
2023-01-24 13:35:22 +00:00
Richard Cohen
3360a6d13b Remove extra semicolons
Courtesy of gcc -pedantic
2023-01-24 13:22:18 +00:00
John Ralls
046e4a156e Silence Clang deprecation warnings about sprintf. 2023-01-23 12:54:25 -08:00
John Ralls
dd2497416c Merge Richard Cohen's 'internal-extern-c' into master. 2023-01-23 11:27:05 -08:00
John Ralls
60c06debce [c++options] Don't crash when find_option returns nullopt. 2023-01-23 11:22:35 -08:00
Richard Cohen
1cec0cb3f3 Use internal extern "C" { ... } for C++
- removes warnings compiling swig engine
...
[ 10%] Generating swig-engine.cpp
.../libgnucash/engine/engine-helpers.h:31: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gnc-date.h:83: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/qofquery.h:90: Warning 302: Identifier 'QofQuery' redefined (ignored),
.../libgnucash/engine/gnc-option.hpp:55: Warning 302: previous definition of 'QofQuery'.
.../libgnucash/engine/gnc-commodity.h:56: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncBusiness.h:40: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncEntry.h:37: Warning 313: Unrecognized extern type "C++".
2023-01-23 18:40:01 +00:00
Richard Cohen
19bbde7000 Fix some typos 2023-01-23 15:01:46 +00:00
John Ralls
9a1a90d8d0 Merge branch 'maint' 2023-01-22 10:49:29 -08:00
richardcohen
f3cc223f5f Fix some bad code formatting 2023-01-22 10:39:48 -08:00
Christopher Lam
fd007a0af1 Merge branch 'maint' 2023-01-13 07:45:31 +08:00
Robert Fewell
6df866f876 Add tests for the reconcile account functions 2023-01-12 14:38:08 +00:00
Robert Fewell
fd37ee997d Fix getting xaccAccountGetReconcilePostponeBalance
Change the G_VALUE from a INT64 to BOXED.
2023-01-12 14:38:08 +00:00
John Ralls
fb9947b7b6 Rename GncDateTime's ymd to gnc_ymd to avoid a name conflict with Carbon. 2023-01-09 14:36:06 -08:00
Christopher Lam
c65b36490a Merge branch 'master-progress' 2023-01-06 16:33:46 +08:00
Frank H. Ellenberger
506a1b3c5e Merge branch 'maint' 2023-01-06 01:31:13 +01:00
John Ralls
b922cfd78d Bug 798679 - Unicode normalization should be used for comparison but not stored.
Change to NFC normalization for all comparisons because the Unicode
meaning of compatible might collide with the user's intent.
2023-01-04 13:19:36 -08:00
John Ralls
31d79e3004 Merge Bob Fewell's 'bug798673' into master. 2022-12-30 16:00:12 -08:00
Christopher Lam
259881f940 [gnc-optiondb] add some more renamed options
following ab13b01f8c Replace ... with … in all translatable strings.
2022-12-24 22:14:35 +08:00
John Ralls
ab13b01f8c Replace ... with … in all translatable strings.
Also a few other places like translator comments and report options.

Replaces https://github.com/Gnucash/gnucash/pull/1033.
2022-12-23 12:43:54 -08:00
John Ralls
b8c0673526 Merge branch 'maint' 2022-12-19 12:11:32 -08:00
Robert Fewell
3be25ff0a9 Add some tests for the account functions 2022-12-16 15:16:58 +00:00
Robert Fewell
a15c6f81b3 Allow the balances of sub accounts to be used in limits 2022-12-16 15:16:53 +00:00
John Ralls
73a134730f Bug 798680 - Not able to match a reverse transaction of a...
previously matched transaction.

Cloned transactions and copied splits shouldn't keep the online-id
slot.
2022-12-13 13:13:13 -08:00
Robert Fewell
518ecfe041 Add some functions that would allow adding a balance limit to accounts 2022-12-10 13:37:41 +00:00
Christopher Lam
bfc325f63c Merge branch 'maint' 2022-11-27 16:12:46 +08:00
Marco Scardovi
6fe2028bca
Fix test
Signed-off-by: Marco Scardovi <mscardovi@icloud.com>
2022-11-24 23:20:07 +01:00
Robert Fewell
59d95a4ce6 Bug 798545 - Crash when updating document link on vendor bill
There were two issues here, the first one was that the copied doclink
was pointing to the original doclink which lead to a double-free. The
second is the setting of the doclink on the copied invoice needs to be
done with gncInvoiceSetDocLink otherwise on closure the doclink value
will disappear.
2022-11-24 11:16:01 +00:00
Christopher Lam
3d8a28898d [gnc-budget] gnc_budget_get_account_period_note returns a const
to harmonize with all other char getters
2022-11-19 10:35:49 +08:00
Christopher Lam
2ee0c98200 [gnc-budget] use operator[] instead of find() and insert()
- avoid hashing Account* twice. one call to operator[] is sufficient.
- don't need use std::move with better constructors
- sanity check - can't have a budget with num_periods = 0
- remove unused headers
2022-11-19 10:35:43 +08:00
Christopher Lam
3e5fcc8709 Merge branch 'maint' 2022-11-15 22:20:54 +08:00
Christopher Lam
6f80c548e6 [gtest-qofevent.cpp] comprehensive tests for qofevent 2022-11-05 09:25:24 +08:00
Christopher Lam
05ffd3d4eb [budget-feature] move unset_feature call to gnc_budget_gui_delete_budget
because gnc_budget_gui_delete_budget is a more general function to
delete a budget.
2022-10-31 12:03:58 +08:00
Christopher Lam
b87aa004f9 [test-qofbook] add tests for unknown features
tests that gnc_features_test_unknown returns a suitable error message
2022-10-31 10:40:12 +08:00
John Ralls
b9077bccd3 Bug 798640 - Segfault when running saved report 2022-10-29 17:45:35 -07:00
Christopher Lam
fc94b41c81 Merge branch 'maint' 2022-10-29 21:53:57 +08:00
Christopher Lam
4716af24e4 Merge branch 'maint' 2022-10-29 21:16:34 +08:00
Christopher Lam
f2354d6b2a [test-qofbook.c] add test for gnc_features_set_unused 2022-10-29 21:01:08 +08:00
Christopher Lam
1516bb18b0 [gnc-features.cpp] backport gnc_features_set_unused from master 2022-10-29 21:01:01 +08:00
Christopher Lam
a078921a33 [qofbook.cpp] backport qof_book_unset_feature from master 2022-10-29 21:00:54 +08:00
John Ralls
cf088f2a70 Merge John Ralls's 'Bug798614' into maint. 2022-10-28 15:27:28 -07:00
Christopher Lam
093aa81ed1 [qofbook.cpp] deprecate qof_book_get_features 2022-10-28 21:57:15 +08:00
Christopher Lam
8192deff37 [gnc-features.cpp] convert to cpp
- don't need to create/destroy GHashTable for each feature query
- plugs leak: g_hash_table_unref (features_used) not always called properly
- to check 1 feature, don't need to traverse whole GHashTable
2022-10-28 20:50:35 +08:00
Christopher Lam
6f6d2fef48 [test-qofbook] basic features test
sets a feature and tests it's set. it's impossible to design a book
with unknown features using the API.
2022-10-27 20:10:49 +08:00
Geert Janssens
e97fc3e408 Drop price-quotes.scm, gnc-fq-helper.in and gnc-fq-check.in - no longer used 2022-10-02 11:50:26 -07:00
Geert Janssens
a6771754d5 GncQuotes - start implementation of fetch/fetch_all 2022-10-02 11:50:25 -07:00
John Ralls
b0ae402c23 Limit instantiation of GncInt128 constructors to integral values.
Instead of using static_assert. This prevents the compiler from even
trying and avoids weird compilation errors when testing types for
instantiating other templates.
2022-10-02 10:15:15 -07:00
John Ralls
3c75d212ab Fix build on Apple Silicon or maybe Apple-clang-14.0
The compiler complains that there's no matching
gnc_register_number_range_option for GncOptionDB*, which without this
commit is true because the explicit templates are for GncOptionDBPtr&.
Note that the original template definition is for GncOptionDB* and
that the header-defined inlines that take GncOptionDBPtr& call the
GncOptionDB* version.
2022-10-02 10:15:01 -07:00
John Ralls
8cb8f5067d Remove non-ISO4217 currency codes from gnc-euro table.
They're not reachable because they don't have commodities associated with them.
2022-09-30 15:12:19 -07:00
John Ralls
d8417c3cfa Move gnc-euro.[ch] to engine and unit test it. 2022-09-30 15:12:12 -07:00
John Ralls
2774f8f88c Bug 798614 - Croatia to join the Euro
Add HRK to the conversion array.
2022-09-30 13:51:28 -07:00
John Ralls
3949821da6 Merge branch 'maint' 2022-09-25 11:50:10 -07:00
John Ralls
2505955ab9 Fix test failure from Bug 798616 fix. 2022-09-20 09:09:34 -07:00
John Ralls
7c350c3ae5 Bug 798616 - Can't register amount greater than 9,000,000,000
Because when loading the value the split in the xml backend doesn't yet
have a parent so the code tried to convert to GNC_COMMODITY_MAX_FRACTION
and if the numerator was larger than 10^10 that would overflow.

To fix it this changes the "don't know" response to get_currency_denom
and get_commodity_denom to GNC_DENOM_AUTO which will normally leave
the denominator alone.
2022-09-19 18:17:58 -07:00
Christopher Lam
161b07b241 Merge branch 'maint' 2022-09-09 21:23:40 +08:00
Frank H. Ellenberger
47fa8b281e Merge PR #1425 into maint 2022-09-07 03:16:05 +02:00
John Ralls
a807d3e6b7 Create function gnc_tm_get_today_neutral.
To complement gnc_tm_get_today_begin and gnc_tm_get_today_end.
2022-09-06 14:35:11 -07:00
luz paz
ba94730a23 Fix various typos
Found via `codespell`
2022-09-06 10:44:29 -04:00
John Ralls
95361ad060 [options] Move gnc-options test to engine/test/CMakeLists.txt. 2022-08-29 17:05:33 -07:00
John Ralls
4ae17d12c7 [options] Move options from app-utils to engine.
Options is required for book options that are stored as part of the data
 file and so belongs in engine.
2022-08-25 22:09:56 -07:00
Christopher Lam
0b5a4cd298 Merge branch 'maint' 2022-08-03 20:38:08 +08:00
Christopher Lam
d1aefc851d [sx-book] free sx_list before g_object_unreffing sxes 2022-08-01 23:43:08 +08:00
John Ralls
688832b5f8 Bug 798585 - segfault running sample script
The root cause of which is that on recent releases of GLib (recent
meaning 2.66 in the current Debian stable!) g_type_instance_get_private
looks in the wrong place for the private data. When running the script
in question it returned NULL and since the code didn't check for a valid
pointer, it crashed.

So this change replaces all calls to g_type_instance_get_private with
the function [type_prefix]_get_instance_private() added in glib-2.36
except for two register2 files that have been removed from master; those
are ignored to avoid unnecessary merge conflicts.
2022-07-30 16:50:51 -07:00
Christopher Lam
7880f9b16f [SchedXaction.c] free list of recurrences 2022-07-29 12:23:09 +08:00
Christopher Lam
f1adb5da34 Merge branch 'TXN_TYPE-is-dynamic' xaccTransGetTxnType into maint #1201 2022-07-18 09:24:32 +08:00
Christopher Lam
ec3e996f92 tests xaccTransGetTxnType heuristics
tests TXN_TYPE_NONE in utest-Transaction.c

testing TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, and TXN_TYPE_LINK will
require valid posted invoices, so, are best tested in utest-Invoice.c
2022-07-18 09:24:05 +08:00
Christopher Lam
fd12d3900c [Transaction.c] use heuristics to determine txn->txn_type 2022-07-18 09:24:05 +08:00
Robert Fewell
ce4768c357 Bug 798565 - Import map editor entry deletion
When a top level bayesian entry is deleted, the book is not marked
dirty and so the save button is not highlighted. Deleting individual
entries did mark book dirty.

Fixed in gnc_account_delete_all_bayes_maps by wrapping the deletion
with xaccAccountBeginEdit/CommitEdit block.
2022-07-17 12:51:38 +01:00
John Ralls
3fd8bd9ddf Merge branch 'maint' 2022-07-16 17:15:20 -07:00
Christopher Lam
aa43c198c6 [Transaction.c] don't set TxnType kvp if it is the same as before
will avoid dirtying the transaction.
2022-07-08 18:15:09 +08:00
John Ralls
9f6d495ca1 Fix use-after-free crash in utest-Invoice. 2022-07-08 18:12:26 +08:00
John Ralls
1e6c679e71 Merge branch 'maint' 2022-06-14 12:53:16 -07:00
John Ralls
903cbdcad3 Bug 798547 - Calculated Due Date is short 1 day when posting on...
day of fall change from Daylight Time to Standard Time.

Really any day where the period crosses the dst->std change, and
since the date dialog returns local midnight for the time that includes
the day of the change.

Convert both the parameter time and the return time to neutral time
to ensure that the interval is handled correctly.
2022-06-02 15:46:59 -07:00
Christopher Lam
670902d5a8 Bug 798535 - Crash when increasing the number of periods in a budget
because in the SQL backend, gnc_budget_commit_edit will update the sql
by reading from vectors with an increased priv->num_periods.
2022-05-18 17:37:05 +08:00
Robert Fewell
27cab58bf2 Correct some text describing some date functions. 2022-05-08 10:09:50 +01:00
Robert Fewell
c000a890ad Bug 798501 - Balance wrong date end of account period
With the accounting period preference settings set to 'Start/End of
previous quarter' and balance sheet report using 'End of accounting
period' the date is wrong, currently is 30/03/2022 when it should be
31/03/2022.

Simplify gnc_gdate_set_quarter_end to get correct last day and
subtract the 3 months befor calling said function.
2022-05-08 10:09:50 +01:00
Christopher Lam
dc620d4b24 Merge branch 'maint' 2022-04-22 13:43:47 +08:00
Christopher Lam
e1d52963ed [account.cpp] restore breadth-first search for 2 functions
gnc_account_lookup_by_name and gnc_account_lookup_by_code were
searching breadth-first and accidentally changed to depth-first in
4.7.

as reported in https://github.com/Gnucash/gnucash/pull/1101#issuecomment-1098146573
2022-04-15 23:35:38 +08:00
John Ralls
95487eb4a0 Merge branch 'maint'
# Conflicts:
#	gnucash/gnome/window-reconcile2.c
#	libgnucash/app-utils/options.scm
#	libgnucash/engine/gnc-numeric.cpp
2022-04-14 18:02:17 -07:00
Christopher Lam
fae7ea02cd [account.cpp] gnc_accounts_and_all_descendants converted from scm
much more efficient than guile algorithm, avoids numerous repeated
GList<->SCM conversions, and traversals of account descendants.
2022-04-14 21:51:14 +08:00
Frank H. Ellenberger
2298590316 Merge PR #1309 into maint 2022-04-12 00:20:11 +02:00
Christopher Lam
736d223198 Merge branch 'maint-progress3' into maint #1312 2022-04-10 12:05:08 +08:00
Christopher Lam
0c4d438a0e [kvp-frame.cpp] expose iterator, skip inexistent frame 2022-04-09 17:45:44 +08:00
Christopher Lam
aab33954e7 [gnc-numeric.cpp] Reduce logging level of gnc_numeric exception message
Exceptions are expected in some use cases.
2022-04-09 07:21:15 +08:00
luz paz
8adedc2248 Fix various typos
Found via `codespell -q 3 -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./borrowed,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,ba,cas,dragable,gae,iff,iif,mut,nd,numer,parm,parms,startd,stoll`
2022-04-08 14:12:50 -04:00
Christopher Lam
6a668df168 [qofutil.h] don't recurse includes 2022-04-08 19:20:40 +08:00
Robert Fewell
83373563c3 Counter formats stored in wrong place.
The Book Options, counter formats were being stored under the 'options'
tree but need to be stored in the 'counter_format' tree similar to the
'counters' tree.
2022-04-07 10:33:11 +01:00
John Ralls
26b009c0f4 Bug 798500 - FTBFS (tests failure) on armhf
Ensure the transition_times are correctly aligned for their sizes
before attempting to copy them into the transitions vector.
2022-04-05 11:45:22 -07:00
Christopher Lam
ee8729dfb6 [account.cpp] char* must be freed 2022-04-02 14:14:50 +08:00
John Ralls
abd1a0b3f1 Merge branch 'c++options' 2022-03-29 15:58:22 -07:00
John Ralls
03cbbd1cd1 Merge branch 'maint' 2022-03-27 06:46:09 -07:00
John Ralls
109efe62b8 Rework default non-currency commodity namespace.
Separate the "All noncurrency" convenience category in the commodity
selector and the default non-commodity namespace proposed by the QIF
importer because they have different functions.

Also remove the namespace guessing code from qif-dialog because with
only one default non-currency namespace there's nothing to guess.
2022-03-24 18:10:32 -07:00
Christopher Lam
5388cc8e2c [kvp-frame.cpp] minor speedups
reserve vector, cache iterator from m_valuemap.find for reuse
immediately afterwards.
2022-03-18 16:29:13 +08:00
Christopher Lam
193a7aae5d Merge branch 'maint' 2022-03-12 15:18:43 +08:00
Christopher Lam
0052e3e483 [gnc-pricedb] add user:stock-transaction price source 2022-03-11 14:31:02 +08:00
John Ralls
c1001e6641 Better wording for tax table changed info message. 2022-03-10 13:44:47 -08:00
John Ralls
d841b322d0 Merge Frank Ellenberger's 'Bug684507' into maint. 2022-03-08 12:39:47 -08:00
John Ralls
ce2b89fd8c [business]Add diagnostic messages to GncEntry and GncInvoice. 2022-03-05 18:18:13 -08:00
John Ralls
9ad24321b4 Remove investment-type namespaces.
Leave it to users to categorize their non-currency commodities. In the
QIF importer default non-classifiable commodities to
GNC_COMMODITY_NS_NONCURRENCY.
2022-03-01 19:58:23 -08:00
Frank H. Ellenberger
c7f842c081 Bug 684507 - commodity namespace should be localized 2022-03-01 19:58:11 -08:00
Christopher Lam
bd4a457040 Merge branch 'maint-lightning-budget' into maint #1248 2022-03-02 07:37:17 +08:00
Christopher Lam
a47413860a Factor out GValue access for setters and getters 2022-03-02 07:36:59 +08:00
Christopher Lam
8f845df934 Factor out make_period_[data|note]_path 2022-03-02 07:36:59 +08:00
Christopher Lam
919f392c7a Use kvp C++ interface rather than GValue 2022-03-02 07:36:59 +08:00
Christopher Lam
6c4c2512db Use C++ STL instead of GLib 2022-03-02 07:36:59 +08:00
Christopher Lam
9088acabd8 [gnc-budget.cpp] convert to c++ 2022-03-02 07:13:24 +08:00
Christopher Lam
c1c198c9ff Merge branch 'maint' 2022-01-19 19:21:32 +08:00
Christopher Lam
f0de54ac7a Merge branch 'maint-798406' into maint #1240 2022-01-19 19:16:14 +08:00
Christopher Lam
8bc080b96d [gnc-budget] store budget kvp data onto memory upon first call.
then each getter will retrieve from memory rather than backend's kvp.
2022-01-17 09:34:46 +08:00
Christopher Lam
ef8d812d3f [utest-Budget] test data retention when modifying budget num_periods 2022-01-17 09:31:28 +08:00
Christopher Lam
87b0a41e9b [Split.c] return price==0 instead of 1, if !split, or amt==0 2022-01-10 19:19:25 +08:00
John Ralls
c1c75e8f81 Revert "Revert "Merge Stefan Bayer's 'SepaInternalTransfer' into maint.""
The original merge was of a PR based on master into maint, bringing
along all of the development changes in master along with it. We don't
want that so the merge was reverted and the PR's two changes
cherry-picked in. That fixed maint, but then the next regular merge of
maint into master naturally included that revert commit undoing the
changes in master. Not so good. Reverting the revert, this commit,
restores the changes, albeit with messed up history.
2022-01-08 15:10:53 -08:00
Christopher Lam
5603acba31 Merge branch 'maint' 2022-01-06 21:32:41 +08:00
Christopher Lam
f7ee644695 Amendment to 73822f97a [1/2] use heuristics to scrub budget signs
Testing income<0 to conclude "none reversal" is likely a more sound
strategy than testing liability>0.
2022-01-04 08:25:02 +08:00
Christopher Lam
c3eaff9bb2 [account.cpp] gnc_account_and_descendants_empty: don't copy children 2021-12-13 21:48:44 +08:00
Kevin M. Buckley
1e22632687 Bug 798382 - Typo corrections in comments 2021-12-12 09:50:48 -08:00
John Ralls
5c7967c4a5 Revert "Merge Stefan Bayer's 'SepaInternalTransfer' into maint."
This reverts commit 17a3f7fef2, reversing
changes made to b8458d0732.
2021-12-03 13:58:07 -08:00
John Ralls
ae7eaad018 Merge Chris Good's 'maintBug797678OfxAppend' into maint. 2021-12-03 13:44:50 -08:00
John Ralls
17a3f7fef2 Merge Stefan Bayer's 'SepaInternalTransfer' into maint. 2021-12-03 13:11:28 -08:00
Christopher Lam
73822f97a9 [1/2][Scrubbudget.c] use heuristics to scrub budget signs
If book has budgets, and GNC_FEATURE_BUDGET_UNREVERSED isn't set,
check and fix budget amount signs. Previously budgets were created
with assumption that sign reversal was set to credit amounts. A
heuristic approach is used:

- if budgeted expense is negative, conclude sign reversal is
"Income and Expense"

- if budgeted liability is positive, conclude sign reversal is
"None"

- otherwise conclude sign reversal is "Credit Accounts"

The above is calibrated to (hopefully) prefer sign reversal of Credit
Accounts.
2021-12-03 17:40:21 +08:00
Christopher Lam
6070aecd69 [2/3][gnc-features.c] add & expose gnc_features_set_unused
same as gnc_features_set_used but removes feature
2021-12-03 17:40:03 +08:00
Christopher Lam
5dab33694f [1/3][qofbook.cpp] add & expose qof_book_unset_feature
same as qof_book_set_feature but removes feature item
2021-12-03 17:39:34 +08:00
Christopher Lam
88ecf8dd17 Merge branch 'maint' 2021-11-23 16:14:53 +08:00
John Ralls
d1fe359e47 gnc_numeric_to_decimal: Change can't round warning to a debug.
Routinely used as a check so a warning isn't appropriate.
2021-11-19 11:44:57 -08:00
John Ralls
cf5da9fffd Resolve merge conflicts. 2021-11-12 19:56:29 -08:00
John Ralls
ff04ad3785 Bug 798346 - crashes when running check & repair
Don't scrub trading accounts for imbalances, see the comment in
the commit for why.
2021-11-08 18:06:29 -08:00
Christopher Lam
984d816a58 Merge branch 'maint' 2021-11-06 21:41:17 +08:00
Christopher Lam
79d8ef0299 Revert b5f5129f7 using gnc_list_length_cmp 2021-11-02 23:34:26 +08:00