Commit Graph

1053 Commits

Author SHA1 Message Date
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
Cristian Klein
2faecb2074 [auto-clear] Avoid testing ambigous auto-clear 2020-10-30 09:42:05 +01:00
Cristian Klein
a1806a2f94 [auto-clear] Fix model 2020-10-30 09:42:05 +01:00
Cristian Klein
51715e454c [auto-clear] Add tests 2020-10-30 09:42:05 +01:00
McLayn
cebe6022c8 fix CZK partname to nominative singular 2020-10-30 00:40:02 +01:00
Christopher Lam
e833c8e1aa [utest-gnc-pricedb.c] test: gnc_pricedb_get_[latest|nearest]_price 2020-10-26 23:56:33 +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
Christopher Lam
4d63eb922f [gnc-pricedb.c] copy convert_amount to convert_price 2020-10-23 09:49:27 +08:00
Christopher Lam
26e7eada37 [gnc-pricedb.c] refactor amount converters, use common code 2020-10-23 09:49:27 +08:00
Christopher Lam
78c8b03c5e [window-autoclear.c] cleanup, optimize, prevent UI lag
abort:
1. if too many splits lead to >1,000,000 reachable amounts
2. if the end_balance is the same as cleared_balance

also:
- g_free lists properly
- move knapsack algorithm to gnc-ui-balances.c
- show newly cleared splits in a new register: "Cleared Transactions"
- remove unneeded #includes
2020-10-23 09:11:29 +08:00
Robert Fewell
3c5066feb4 Change source files option-util.* for spaces and tabs 2020-10-22 14:30:46 +01:00
Robert Fewell
c11f4db96e Bug 345924 - Report options 'Reset Button' always flags changes
If a report is loaded with default settings and the 'Reset button' is
pressed the 'OK/Apply' buttons will be enabled which should not happen
as there are no changes to be made.

Fixed by resetting the changed flag on options load and then comparing
the current value to the default one when the 'Reset button' pressed.
2020-10-22 14:26:50 +01:00
Robert Fewell
8e5e3480ad Bug 797984 - Infinite loop while Check&Repair AR and AP accounts
If using the Check&Repair option from the Chart of Accounts on 'Account
Receivable or Payable' add has a voided transaction will cause an
infinite loop.

This occurs from checking the transaction split amount is zero in
gncScrubBusinessSplit and trying to delete it. As the transaction is
read only as a result of being voided this fails so add a further
condition for the 'else if' statement to include !is_void.
2020-10-20 14:45:44 +01:00
Robert Fewell
122cd682f6 Add some additional places where Check&Repair can be aborted 2020-10-20 14:43:39 +01:00
Robert Fewell
6ee537e1a7 Allow the Check&Repair routine to be cancellable from CoA
Add a callback for a keypress event when on the Accounts page that
checks for the Escape key and presents a dialog to confirm whether to
abort the Check&Repair. A similar dialog is used if you decide to quit
Gnucash while the Check&Repair is still running.
2020-10-20 14:42:32 +01:00
John Ralls
94a68dca7c Bug 797983 - v4.2 report numbers change over gnucash restarts;...
Price Database dropping user:price-editor entries.

A wider problem: QofInstance was unmarking itself dirty as long as the
backend raised an error and unconditionally marking itself non-infant.

This matters because the SQL backend depends on infant status to decide
whether to do an insert or update query; either will fail if the infant
status is wrong.

The price editor dialog clones a price having only its commodity set and
GncSqlPriceBackend declines to save if the currency isn't set. Since the
instance marked itself non-infant even though it wasn't saved subsequent
commits tried to use an update query and since the price wasn't in the
table that inevitably failed.

Requiring that QofBackend::commit should doing the marking-clean
required implementing it in the backends where it wasn't already.
2020-10-18 16:09:41 -07:00
Bill Nottingham
06110e2abd Fix warning about misleading indentation from recent gcc.
Patch by <law@redhat.com>
2020-10-15 08:38:00 +08:00
Geert Janssens
e8c321d954 Drop as dependency from gnc-module 2020-10-10 12:32:58 +02:00
Christopher Lam
39a6704169 [options.scm] rename new-owner-report "Links" to "Transaction Links" 2020-10-07 19:11:12 +08:00
Christian Gruber
6394b6491b fixup! Simplify type checking for GObject mockups 2020-10-05 22:48:52 +02:00