Commit Graph

30 Commits

Author SHA1 Message Date
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
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
John Ralls
2f4438ab28 Bug 798335 - No longer possible to change trading account
Strip trading splits only if "Use Trading Accounts" is enabled
for the book so that users who want to manage trading accounts by
hand may do so.
2021-10-14 17:22:32 -07:00
John Ralls
8ab8642e76 Fix leak of trading_splits list in xaccTransClearTradingSplits 2021-09-09 16:32:43 -07:00
Robert Fewell
0f026f6a10 Bug 798221 - Transfer funds between accounts with different currencies crashes Gnucash on macOS
In the scrub function find_account_matching_name_in_list there was a
test for account names being the same for currency but condition was
backwards so was matching on account names being different. There was
also a g_list_free resulting in a double free which was removed.
2021-07-08 09:33:10 +01:00
John Ralls
6aa35ea7fb Better fix for bug 798204, doesn't break trading account selection. 2021-06-12 16:42:10 -07:00
John Ralls
9eeff5dd7e Bug 798204 - Creation of Imbalance Accounts
Search recursively when getting account by name.
2021-06-12 15:21:50 -07:00
Christopher Lam
ceeb1dff7a [scrub.c] g_value_unset 2021-06-05 00:21:21 +08:00
John Ralls
da3c511b6c Remove trading splits instead of trying to adjust them. 2021-05-12 09:00:51 -07:00
John Ralls
4f030aac6e Bug 798093 - Changing the symbol/abbreviation of a security...
after the trading account was created breaks GnuCash.

Revisited. The original changeset looked for a top level trading account
and a namespace account in the transaction currency; if either of those
accounts had been created in a different currency it would duplicate
them.

This commit will accept any such account regardless of commodity. If
more than one exists it will prefer the one in the root currency if
there is one, otherwise it will select the first one found.
2021-05-12 09:00:51 -07:00
John Ralls
18c72baddf Don't bother scrubbing for orphans if there's no transaction currency.
If it found one it would try to create an orphan account with no
currency which will crash later.
2021-05-11 14:43:45 -07:00
Frank H. Ellenberger
6bc8679932 I18N: replace several spourious spaces 2021-02-22 17:56:50 +01: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
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
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
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
John Ralls
a65dd6cc25 Merge Chris Carson's 'refactor-Scrub-c' into maint. 2019-01-04 15:49:42 -08:00
Christopher D. Carson
0e37e059d5 Fix XML load CPU hotspot: Scrub.c xaccTransScrubPostedDate
The refactoring provides roughly 10% reduction in user CPU
use for XML file load by moving an expensive function
to within an if-clause where the result is used.  The diff looks
like a full re-write but only the if statements, indenting,
and commentary changed.
2019-01-01 19:41:16 -06:00
Robert Fewell
5c524c31b2 Add routine to fix Account Color being set to "Not Set"
Previously the account color slot has been populated with "Not Set"
when any field for the account has been edited and saved. This routine
should run once and remove all such entries.
2018-12-24 13:00:07 +00:00
John Ralls
8f22c4bed4 Localize variables, ensure that val_imbalance is set, test txn_curr != commodity once.
Found by clang static analyzer.
2018-11-30 15:08:41 +09:00
John Ralls
73d193606e Fix travis failure.
Linux needs stdint.h for INT64_MAX.
2018-11-11 17:29:06 +09:00
John Ralls
710b122b24 Bug 796940 - Invalid transaction date-posted KVP causes...
date-posted to not be saved.

Check the stored GDate for being in the GncDateTime range as well
as the GDate range before returning it and check trans->date-posted
against INT64_MAX instead of 0 before changing it.
2018-11-11 17:07:34 +09:00
lmat
1f050fd1e5 Transaction members Timespec->time64 2018-01-08 13:01:29 +11:00
lmat
805549ba24 Rename qofinstance function
This function was supposed to be renamed a while back. I had named it
this way for debugging purposes.
2017-12-21 07:39:33 -05:00
lmat
d9eebd332b Renaming functions to get rid of temporary name
_var_ was used to make sure I caught all references, but isn't intended
as a permanent name.
2017-12-21 07:39:33 -05:00
lmat
9d7ec35ce5 Removed qof_instance_set_kvp, qof_instance_get_kvp
And replaced them with versions that take lists of key path elements.
This is in an effort to eliminate the parsing of kvp keys.
2017-12-21 07:39:32 -05:00
Geert Janssens
1238b9d8cd Prevent gcc from searching config.h in the current directory
This will avoid a ninja-build from picking up a config.h generated by the autotools build
(in the root build directory). Picking up the wrong config.h may lead to all kinds of
subtle issues if the autotools run was done with different options than the cmake run.
2017-10-26 14:05:17 +02:00
Geert Janssens
83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00