Commit Graph

1072 Commits

Author SHA1 Message Date
Christopher Lam
c20a588e0f Don't use g_list_append unnecessarily 2021-02-10 07:09:02 +08:00
John Ralls
ba0e412815 Bug 798112 - An error occurred while processing mysql ...
A "Feature" of MYSQL is that it allows C-style backslash escapes
in string constants and replaces them with the actual character
(e.g. \n is converted to 0x0a). This causes round trip problems
if the escape is one of the allowed ones and a MYSQL error if it
isn't.

Disable the feature so that MYSQL follows the SQL standard.
2021-02-07 13:53:00 -08:00
John Ralls
fe4f9ed64a [test-backend-dbi] Fix copying hidden property.
So that it actually copies it to the *other* root account.
2021-02-07 13:50:29 -08:00
Micha Lenk
9386b276e5 Make prototypes static for autoclear unit test
With the explicit prototypes not marked as static unit test builds on Debian
Buster (using buster-backports) fail with

error: testing::internal::ParamGenerator<TestCase*> gtest_InstantiationAutoClearTestAutoClearTest_EvalGenerator_() was declared extern and later static [-fpermissive]

According to the comment preceding the declaration the only intent of the
explicit prototype (in newer versions of googletest implicitly defined by the
GTEST macros) seems to be to silence a warning which would cause a build
failure on Ubuntu 18.04 when using -Werror.

Builds on Debian unstable seem to build just fine without this explicit
declaration, hence I consider it safe to just drop it. However, builds on
Ubuntu 18.04 then fail (see above).

Making the prototypes as static should make both build environments happy.
2021-02-07 13:50:29 -08:00
John Ralls
12ad4fadae Bug 798101 - Do not #undef __STRICT_ANSI__
Remove defines and undefines for Windows, they were needed with
MinGW classic but are not with MinGW-w64.
2021-01-30 17:38:37 -08:00
John Ralls
0f8d9f6d7c Bug 798093 - Changing the symbol/abbreviation of a security after...
the trading account was created breaks GnuCash.

Introduces a new function, gnc_account_lookup_by_type_and_commodity
that does that, though it also looks at name for the one special case
of finding/creating the Namespace placeholder account. Adds a parameter
checkname to xaccScrubUtilityGetOrMakeAccount to flag whether to look
for the name.

Namespaces aside this makes it possible for the user to rename trading
accounts or securities independent of each other.
2021-01-27 17:44:21 -08:00
John Ralls
bcbebe62b1 Make xaccScrubUtilityGetOrMakeAccount static and remove ScrubP.h
It being the only declaration in ScrubP.h
2021-01-27 17:44:21 -08:00
John Ralls
b66eab2583 Bug 798100 - Equity totals calculating incorrectly
Prevents creation of non-currency opening balance accounts.
2021-01-24 16:53:02 -08:00
Frank H. Ellenberger
84cc64daed I18N: Remove annoying stars from translator comments 2021-01-22 10:19:54 +01:00
John Ralls
ffa2f606e3 Fix use-after-free in test_xaccTransEqual. 2021-01-17 11:51:12 -08:00
Sebastian Ovide
49ce463aaa
sorting sources
I've did a small bash script that retrieve the sources from gnc-fq-dump and try to find one source that has the specific stock. At that point I've noticed that the sources returned by Finance::Quote have always a different order. Just wondering if it is done in that way intentionally (?)
2021-01-10 15:09:51 +00:00
Allan Nordhøy
383b0b2f19 Replace 'Non Bayesian' with grammatically more correct 'non-Bayesian'. 2021-01-03 07:01:14 +01:00
Christopher Lam
ca606e7694 [c-interface.scm] deprecate gnc:last-captured-error 2021-01-03 06:28:31 +08:00
Christopher Lam
f1c1fca023 [account.cpp][API] deprecate xaccAccountCountSplits 2020-12-28 09:48:06 +08:00
John Ralls
c8c58bf349 Add test_autoclear_SOURCES to the dist list for inclusion in the tarball. 2020-12-26 17:23:28 -08:00
John Ralls
ae66da9632 Fix test-gnc-timezone failure caused by latest zoneinfo release.
See the comment for details.
2020-12-26 13:46:09 -08:00
Christopher Lam
455ae59a56 [app-utils] fix dependency chain 2020-12-24 22:51:08 +08:00
Christopher Lam
0510ecfe85 [c-interface] internal defines must be declared first
An internal (define) cannot be after a statement such
as (issue-deprecation-warning). This rule was strict in guile-2.2 but
relaxed in guile-3.0, hence, the mixed results in CI.
2020-12-24 22:08:44 +08:00
Christopher Lam
bf671d4fc7 [c-interface] Deprecate gnc:make-string-database
It's only used by date-utilities.scm

This removes the date-utilities -> c-interface dependency.
2020-12-23 23:58:09 +08:00
John Ralls
c2ba88d91d Add MAKE_LINKS to app-utils and qif-import scheme targets.
Needed to successfully build on Windows.
2020-12-13 16:57:48 -08:00
John Ralls
2ff3bf5877 Echo into CMakeLists.txt rename of gmock-qofqury to fake-qofquery. 2020-12-13 11:52:32 -08:00
Christopher Lam
dcf90b98c0 [options.scm] use srfi-1
because list-index (used in options.scm) wants srfi-1 version rather
than the one in guile-core. the guile-core one crashes when editing options.
2020-12-09 21:54:26 +08:00
Christopher Lam
5bd65a6b22 [modularise] (gnucash locale) 2020-12-09 06:40:07 +08:00
Christopher Lam
59ec912928 [modularise] (gnucash app-utils) 2020-12-09 06:40:07 +08:00
Christopher Lam
0630c214f0 [options.scm] move gnc:options-fancy-date to business-options.scm
it needs gnc:fancy-date-info which is defined in business-options
2020-12-08 22:50:15 +08:00
Christopher Lam
51e3a65762 [options.scm] typo ref -> list-ref 2020-12-04 21:33:31 +08:00
Christopher Lam
a2ef6ed6a5 Use proper format syntax 2020-12-04 18:37:35 +08:00
Christopher Lam
854c117820 [trep-engine] move currency options into their own section
tidier, also includes backward compatibility with saved-reports
2020-12-02 18:46:25 +08:00
John Ralls
7a8a0f40b1 Fix missing space in warning message. 2020-11-29 10:59:25 -08:00
Christopher Lam
d11bdb3e3a Bug 798015 - cash flow numerical-overflow
error is caused by pricedb containing an invalid gnc_numeric
price. multiplication of (invalid) price with amount causes a report
crash.

Fix: if invalid price, return zero for amount converted to report
currency.
2020-11-22 23:35:46 +08:00
Christopher Lam
72982de588 Revert "[date-utilities] Convert reldate list into srfi-9 records"
This reverts commit 3be7935965.
2020-11-22 21:56:42 +08:00
Christopher Lam
8b5dd55dc4 Revert "[c-interface] deprecate gnc:make-string-database"
This reverts commit b67bf4b761.
2020-11-22 21:56:35 +08:00
Christopher Lam
b67bf4b761 [c-interface] deprecate gnc:make-string-database 2020-11-22 21:21:58 +08:00
Christopher Lam
3be7935965 [date-utilities] Convert reldate list into srfi-9 records 2020-11-22 21:14:13 +08:00
Ralf Habacker
63580d91ba Add feature GNC_FEATURE_EQUITY_TYPE_OPENING_BALANCE
When the above function is activated, the slot 'equity type' is used and
set in relation to opening balances and the checkbox for marking the
opening balance in the accounts dialog can be changed.
2020-11-16 08:51:51 +01:00
Ralf Habacker
f8dcd23023 Add support for the opening balance accounts flag
Up to now, opening balance accounts have been identified by means of
fixed names and their translations, which in some cases is not
appropriate.

With this commit, therefore, opening balance accounts can now be
identified by a special slot, which should solve the above problem.

in gnc_find_or_create_equity_account(), when querying the
EQUITY_OPENING_BALANCE type, the system now first searches for an
account with an existing 'equity-type' slot having the value
'opening-balance' and returns it as an opening balance account if
one exists. If no corresponding account is found, the search is
continued as before. An account found in the process is automatically
given the status of an opening balance account (it is given an
'equity-type' slot with value 'opening-balance') to simplify the
future search.

The opening balance status of an account is visualized in the account
settings dialog with a check box. If a Gnucash file does not yet contain
an opening balance account, one can be selected in the account settings
dialog.

https://bugs.gnucash.org/show_bug.cgi?id=797836
2020-11-16 08:51:51 +01:00
John Ralls
e09a26ba3a Merge Christian Gruber's 'test_import_backend' into maint. 2020-11-08 14:27:26 -08:00
John Ralls
26fa239f89 Merge Christian Klein's 'auto-clear-tests' into maint. 2020-11-08 13:44:41 -08:00
Cristian Klein
69789b2b93 [auto-tests] Stick to CodingStandard for member variables 2020-11-08 09:58:57 +01:00
Cristian Klein
f26215feae [auto-tests] Fix misspelling 2020-11-08 09:58:17 +01:00
John Ralls
2290fa7c22 Fix exception when converting to decimal values that reduce to N/1.
Before this the loop wouldn't terminate until the denominator had been
reduced to 0 and trying to create a GncRational with a 0 denominator
throws.
2020-11-07 16:22:18 -08:00
John Ralls
d03dc07b8d Remove redundant and incorrectly named constant. 2020-11-07 13:20:22 -08:00
John Ralls
3bcf57e7f2 Fix timezone transition times.
This is responsible for test failures on DST transition days.

See the comments in gnc-timezone.cpp for an explanation of why this is
correct. The rubric was tested on macOS, Arch Linux, Debian Unstable,
Fedora 33, and Ubuntu 18.04 to confirm universal applicability.
2020-11-07 11:02:54 -08:00
Robert Fewell
65b7b8c4a2 Section help on windows not working
Key and group names are case sensitive and in the gnucash-help.hhmap
file the section name is [MAP] so change gnc-help-utils.c to match
2020-11-06 13:05:42 +00:00
Cristian Klein
e5378b2048 [auto-clear] Make test more future-proof with GoogleTest 2020-10-30 09:42:05 +01:00
Cristian Klein
982cf86deb [auto-clear] Fix test with googletest 1.8 2020-10-30 09:42:05 +01:00
Cristian Klein
9d4c0b05db [auto-clear] Improve #include style 2020-10-30 09:42:05 +01:00
Cristian Klein
1cf7defee8 [auto-clear] Address feedback 2020-10-30 09:42:05 +01:00
Cristian Klein
9bf550d38f [auto-clear] Include test for ambiguous cases 2020-10-30 09:42:05 +01:00
Cristian Klein
5cd777b673 [auto-clear] Fix test: Add xaccAccountBeginEdit / xaccAccountCommitEdit 2020-10-30 09:42:05 +01:00