Commit Graph

983 Commits

Author SHA1 Message Date
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
Christopher Lam
6eb2e36c2d minor optimisations, g_list_prepend then g_list_sort separately
if building a g_list incrementally, don't sort on each insertion.
2020-10-01 11:34:21 +08:00
Christopher Lam
e6486e9d95 deprecate xaccAccountCountSplits with include_children = FALSE
whereby xaccAccountCountSplits is called with with_children = FALSE,
test xaccAccountGetSplitList against NULL.
2020-10-01 11:34:21 +08:00
Christopher Lam
1b31c06b29 [Account.cpp] add gnc_account_and_descendants_empty (acc)
and deprecate xaccAccountCountSplits
2020-10-01 11:34:21 +08:00
John Ralls
5e6f9b3460 Fix some return of ptr-to-temporary errors
Flagged by new clang Apple version 12.
2020-09-25 12:31:52 -07:00
John Ralls
44fc52f5c6 Fix unnecessary copy in range-for loop
Flagged by new clang Apple version 12.
2020-09-25 12:31:13 -07:00
John Ralls
1c5561714d Fix ptr-comparison-to-string-literal error
A new error raised in the latest versions of gcc and clang.

The address of string literals is undefined in the C standard so the
compiler raises an error if one tries to test for string equality by
comparing them. A better fix would be to replace QOF_ID strings with an
int-based identifier; an even better one would get rid of QOF_ID
entirely and use the C++ type system.
2020-09-25 12:23:56 -07:00
Robert Fewell
edaa0d7eea Fix some spaces on blank lines is source files 2020-09-18 16:13:35 +01:00
Robert Fewell
416e234232 Bug 797945 - Imap bayes conversion runs many times
When the Imap Editor is loaded, the bayes KVP entries are tested to see
if they are required to be converted to flat entries. This involves a
function that scans every account and if it finds entries that need
changing, the change is made and book property
GNC_FEATURE_GUID_FLAT_BAYESIAN is added so further scans are not made.

As the Imap Editor loops over the account list also, if there are no
bayes KVP changes then the conversion function gets called for every
account in the list. This can also happen to a lesser degree when doing
imports.

To stop this a flag is set once the convert to flat function has been
run so it only runs once and only lasts for the session.
2020-09-18 16:13:26 +01:00
John Ralls
9c8fa5cd2e Bug 797895 - Hang for a long time (9 minutes per account) importing...
a QFX file.
Bug 797945 - Tools -> Import Map Editor causes GnuCash to lock up.

Don't edit and commit the account if it has no BAYES_IMAP slots. Account
committing is extremely expensive.
2020-09-17 14:24:08 -07:00
Robert Fewell
7c1026783b Change the document link KVP symbol to original name
To maintain compatibility with any existing document link entries the
old 'assoc-head' and 'asooc_uri' entries will be used for the gsetting
and KVP entries.
2020-09-13 11:01:37 +01:00
John Ralls
843282f583 Merge John Ralls's 'assoc_title' into maint. 2020-09-11 11:41:42 -07:00
John Ralls
db626de68a Rename all Transaction and Invoice Association identifiers to DocLink.
To better reflect the purpose and for consistency with other software
(e.g. Libre Office).
2020-09-11 11:34:32 -07:00
John Ralls
50bf59d62e Rename Transaction and Invoice Associations to Document Links.
More clearly describes the actions and is more consistent with other
software (e.g. Libre Office).

This commit primarily changes the translatable strings, though it also
removes the Remove menu item because that can be done in the Manage
dialog box.
2020-09-11 11:34:31 -07:00
Robert Fewell
d0309b39d9 Bug 797935 - Strange formal register headers
The headers were made up from two parts, 'Tot' which was translated and
'Debit/Credit' which was not. Traced to some missing brackets around
the returned dflt_acct_debit_str and dflt_acct_credit_str.
2020-09-11 15:23:27 +01:00
Geert Janssens
ad8b602fe2 I18n - Uppercase option name to align with other option names 2020-09-09 22:22:48 +02:00
John Ralls
de0422da25 Merge G4js's missing-sentinels into maint. 2020-09-06 14:39:12 -07:00
Christopher Lam
f6d34f226f [Scrub.c] improve responsiveness of progressbar during scrub
Formerly would update progress bar every 100 splits. With scrub being
slow, it's nicer to update every 10 splits. Also remove
the (percentagefunc)(NULL, 0.0) which seems an error -- it would reset
the progressbar back to zero immediately.
2020-09-06 22:54:16 +08:00
Gaming4JC
cca4524055
Fix warnings: missing sentinel in function calls
When compiling with -Werror, GNUCash fails to build due to various error: missing sentinel in function call.
This patch resolves the issue by passing nullptr instead of C-style casting NULL.
2020-09-06 00:50:54 -04:00
jean
bbdd4f34b6 Bug 797900 - Crash caused by Quitting while Check and Repair All is running
The account tree page didn't have a "finish" function normally used to verify a page can close.
I added one, along with two flags that indicate whether a scrubbing operation is currently ongoing
and whether we should quit when the scrubbing is done.
The result is: If a user attempts to quit while scrubbing isn't done, an alert pops up asking whether the
user wants to abort the scrub. If so, the scrub is aborted (safely) and GC quits.
If not the app does not quit.

I have to say, I'm not sure this is the right way to do this. In my view, the right way would be:
- Disable the "quit" menu when scrubbing is happening (for some reason gnc_suspend_gui_refresh() does
not cause the quit menu to be grayed) so there's no chance of quitting while scrubbing is ongoing
- If needed, add an abort scrubbing button to the main window. Not sure whether that's desirable or not.

Let me know what you think: is what I have what we need, or would the above be better.
2020-08-27 16:59:55 -07:00
Geert Janssens
56210de9a2 Rename report option for consistency
In English each word in option and menu names starts with a capital letter.
Also eliminates a redundant translatable string.
2020-08-18 15:28:51 +02:00
John Ralls
6d44d0675e Reduce random transactions and iterations on test-lots.cpp.
No point in generating 320 transactions or running the test 10 times
for a simple does-it-crash test. Do it once with 32 transactions so
it takes less than one second instead of 16.
2020-08-16 16:05:15 -07:00
Christopher Lam
00efc1696a [Transaction.c] sanity check xaccTransGetAPARAcctSplitList
prevent segfault if trans is NULL
2020-08-16 17:55:57 +08:00
jean
a9f79cf79c Add a flag to the account structure to defer balance computation 2020-08-01 21:10:19 -07:00
Ralf Habacker
4df6493bc2 Fix API doc of gnc_account_lookup_by_code()
Taken from PR #762, but it is separate issue and rest of the PR needs
some discussion.
2020-08-01 07:25:20 +02:00
John Ralls
a93f3c198d Warn against using xaccTransGetSplit for iteration.
Instead of encouraging it.
2020-07-20 13:07:05 -07:00
Christopher Lam
d546a617ad ensure averaging-multipler returns exact numbers rather than floats 2020-07-19 17:46:01 +08:00
jean
705f0dbf9e Bug 797854 - Global Register Preference to prompt for interest payment is not being honored.
A new per-account preference is added to let the user decide whether the interest transaction dialog should be
opened automatically before the reconcile. This preference is only enabled for certain types of accounts and
the code that decides that was moved to Account.h as is it now used in two separate place.
2020-07-13 22:42:11 -07:00
Christopher Lam
428c8c501c [guile-3] change _ to G_
In guile-3 _ is a reserved symbol. Change to G_ by guile gettext
convention.
2020-07-12 19:03:26 +08:00
John Ralls
edd7efd951 Bug 797853 - Crash on 'Save As' in MacOS Mojave and Gnucash 4
Check and handle null books throughout GnuCash. Tests are left alone
because they should fail if there's no book.
2020-07-10 15:54:17 -07:00
Christopher Lam
ebb462d06d [account.cpp] prevent crash in gnc_account_get_currency_or_parent
if the *account argument is NULL, it is not reasonable to have a
g_assert crash. Passing NULL account returns NULL commodity instead.
2020-07-09 22:19:29 +08:00
John Ralls
0e0c27f80f Bug 797850 - Account register credit/debit column headings untranslated
Plus make the former globals static.
2020-07-07 12:33:38 -07:00
John Ralls
b0b238958e Merge Christoph Holtermann's 'python-sessionOpenMode' into master. 2020-07-06 12:45:07 -07:00
John Ralls
4ee573e23a Link with libm.so on those platforms that require it. 2020-07-06 12:30:37 -07:00
c-holtermann
22f91c407e use same order in comment as in definition of SessionOpenMode enum 2020-07-04 22:26:35 +02:00
c-holtermann
e23bf0bc1c fix SessionOpenMode explanation for SESSION_NEW_OVERWRITE 2020-07-04 22:16:13 +02:00
Christopher Lam
851bc7f8d9 deprecations: clarify functions deprecated in 4.x. 2020-06-22 19:53:29 +08:00
c-holtermann
7c8e0a28fc better display for doxygen, typo and consistent naming 2020-06-21 16:24:53 +02:00
John Ralls
d308028353 Merge branch 'maint' 2020-06-20 15:36:58 -07:00
John Ralls
50329df082 Bug 797811 - GnuCash crashes with segfault when saving to mysql...
when database already exists.

Crashed because of dereferencing GncSqlBackend::m_conn when it's nullptr
after the DB create failed. Protect all such dereferences.
2020-06-19 15:08:58 -07:00
goodvibes2
60da4bd7bf gnc-fq-dump: Err msg if AlphaVantage API Key is needed but missing
AlphaVantage API Key is needed for all currency quotes
and stock quotes with source 'alphavantage' or 'vanguard' or
multi sources that include 'alphavantage'
2020-06-12 15:11:53 +10:00