Commit Graph

23112 Commits

Author SHA1 Message Date
Christopher Lam
b0ab79bed7 [taxtxf] set export-string for export-type='csv 2020-08-15 10:54:29 +08:00
Christopher Lam
0891e117c9 [trep-engine] set export-string or export-error for export-type 'csv 2020-08-15 10:53:42 +08:00
Christopher Lam
f645095242 [report-core] don't barf when output-file is #false 2020-08-15 10:53:40 +08:00
Christopher Lam
8b2707254f [html-document] add export-string|error fields in html-document 2020-08-15 10:53:24 +08:00
Christopher Lam
d1976fc7fe [gnc-plugin-page-report.c] set dialog parent properly 2020-08-14 22:23:00 +08:00
Christopher Lam
79476ba6dc don't crash if objects are built with invalid fieldnames
(gnc:define-report
 'version 3
 'name "Test Report Template4"
 'invalid-field-name 'x
 'report-guid "xxx")

gnc:define-report and other constructors will not crash when fieldname
is invalid.
2020-08-14 20:12:56 +08:00
Geert Janssens
237626f0db Dutch translation update
4721 translated messages, 562 fuzzy translations, 268 untranslated messages.
2020-08-12 18:22:30 +02:00
Geert Janssens
d843405df5 Apply most recent pot file to nl.po 2020-08-12 18:17:48 +02:00
Geert Janssens
00eba91a3b Tweak a few strings to reuse translations 2020-08-12 18:16:45 +02:00
Christopher Lam
9d28edb332 [gnucash-commands.cpp] fix guile error handling
* id is an SCM object which is never NULL, but may be #f to signal error.
2020-08-09 13:56:50 +08:00
Christopher Lam
be96f3bf68 [report-core] better documentation and handle ambiguous reportnames
* add comments describing args and return val
* rename vars to better describe them
* exported gnc:cmdline-template-export and gnc:cmdline-get-report-id
  handle ambiguous reportnames by returning #f
2020-08-09 13:54:15 +08:00
John Ralls
59f3376e75 gnc:cmdline-check-report should return #t if everything passes. 2020-08-08 16:15:31 -07:00
John Ralls
e8da10ba2e Use scm_from_locale_string for converting command-line input.
Because Windows generally can't enter UTF8 on the command line.
2020-08-08 15:01:33 -07:00
John Ralls
ff318255ad Bug 797880 - [gnucash-cli] encoding and font differing from...
manually exported reports (Win10, German locale).

Don't use Guile for output.
2020-08-08 13:44:26 -07:00
Frank H. Ellenberger
986908ea4a I18N: Fix a typo in the glossary 2020-08-08 18:20:50 +02:00
Christopher Lam
02e59cc977 [price-quotes.scm] ensure missing-alphavantage message can show on console 2020-08-08 12:19:27 +08:00
Christopher Lam
883705fdf8 [report-core] handle export properly
export code was tested using a custom saved-report, needing to call
the parent template export code. this could not work when a parent
template export code was called. enable path to call parent or custom
export-code.
2020-08-08 11:40:42 +08:00
Christopher Lam
0a64081b98 [taxtxf.scm] compact, allow error to console
taxtxf error handling is designed for gui. add code to call
gnc:gui-error which can also dump error to console if gui is not available.
2020-08-08 11:39:55 +08:00
Christopher Lam
f9286ac8f4 [budget.scm] fix report crash on books with unreversed budgets
there was bug in budget.scm whereby budget report would crash with
unreversed-budget featured book. the 'note' argument was missing when
calling disp-cols.
2020-08-05 23:30:11 +08:00
Christopher Lam
7df7e383c2 Merge branch 'maint-show-report-with-datafile' into maint #755 2020-08-05 18:41:05 +08:00
Christopher Lam
e75150c5c6 [gnucash-cli] -R show should accept & try load datafile
* file_to_load argument, if present, would be a candidate for loading.
* if loading fails, show report details anyway.
2020-08-05 18:40:48 +08:00
John Ralls
24e288ae47 Refactor gnc_gen_trans_list_create_matches
Extracting functions query_imported_transaction_accounts and perform_matching
and eliminating the early creation and passing of several local
variables.
2020-08-04 09:50:15 -07:00
John Ralls
67fb257641 Bug 797839 - Auto-complete prevents entering non-ASCII transaction descriptions
Try #2. Passing the wrong kind of string length to table_modify_update.
2020-08-03 13:15:19 -07:00
Christopher Lam
f35a26882d Addendnum to ad20f859c -- _ must be exported 2020-08-03 23:26:29 +08:00
Christopher Lam
ad20f859cc [core-utils] define _ for guile-2.2 2020-08-03 07:11:27 +08:00
John Ralls
2054e2022e Restore call to resolve_conflicts().
Lost in merging Bug 797730 PR.
2020-08-02 14:16:50 -07:00
John Ralls
1015c6aafd Add new python example file to POTFILES.in. 2020-08-02 14:15:20 -07:00
John Ralls
0f9a9e3c5e Merge Hong Xu's 'potential_matches' into maint. 2020-08-02 13:56:31 -07:00
Hong Xu
161a5d60c0 Variable name correction: "import_trans_account" --> split_account
I'm getting this error:

    /home/user/src/gnucash/gnucash/import-export/import-main-matcher.c: In
    function ‘gnc_gen_trans_list_show_all’:
    /home/user/src/gnucash/gnucash/import-export/import-main-matcher.c:1716:28:
    error: ‘import_trans_account’ may be used uninitialized in this
    function [-Werror=maybe-uninitialized]
             per_account_list = g_hash_table_lookup (lists_per_accounts,
    import_trans_account);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/user/src/gnucash/gnucash/import-export/import-main-matcher.c:1676:14:
    note: ‘import_trans_account’ was declared here
         Account *import_trans_account;

Looks like the variable name was incorrect.
2020-08-02 12:21:32 -07:00
John Ralls
103a053e89 Merge Jean Laroche's '797730_matcher_match_many_to_one' into maint. 2020-08-02 11:58:50 -07:00
John Ralls
efc34b247f Merge Jean Laroche's 'improve_ofx_import_speed' into maint. 2020-08-02 11:20:50 -07:00
John Ralls
ea2d89fac2 Merge Hong Xu's 'export-account' into maint. 2020-08-02 11:07:15 -07:00
Christopher Lam
0c2e17daf1 [job-report] clarify deprecation warning. 2020-08-02 20:08:12 +08:00
jean
a9f79cf79c Add a flag to the account structure to defer balance computation 2020-08-01 21:10:19 -07:00
jean
1f592ce191 Fix FOO and move deletion where it should be 2020-08-01 21:10:19 -07:00
jean
2be2ff8af4 To further increase the import speed, it's necessary to prevent any account commit to happen
until the very end of the import (OK or Cancel), because account commits trigger very lengthy balance
computations. For this, I call xaccAccountBeginEdit on all the accounts involved in the import,
keeping a list of them so BeginEdit is called only once. At the end of the import, commit is called
on all the accounts in the list. Note that when the user selects a target account for an imported
transaction, xaccAccountBeginEdit is called on the target account, and it is added to the list.

Another area of improvement is avoiding re-checking all register transactions to verify whether
a given imported transaction has already been matched. Instead, a hash table of split online IDs
is computed once (per account), and verified for each incoming transactions.

Finally, the list of register transactions that are potential matches for the imported ones is
further pruned ahead of time to only keep transactions that do not have an online ID. This avoid
the repeated checks that were previously happening in the match-score loop.

With this, importing 6000 transactions into a 6000 split account becomes fairly fast (a few seconds
on my slowish machine).

There are still slow areas: If you select all 6000 imported transactions and assign a destination
account to all of them, the process is impossibly sluggish because of repeated path operations
(selections, freeing) in the tree view.
If you do not specify a target account for any of the 6000 imported transactions, an "imbalance"
account is used, but the xaccAccountBeginEdit mechanism isn't applied to it by the new code, so
each imported transaction will trigger a commit, and therefore a slow balance recomputation.

Remove use of xaccTransGetSplit
2020-08-01 21:10:19 -07:00
jean
0da826f311 Instead of saving the imported transaction into the treeview, which takes more time
I now save them into a temporary list. A single query is done for all imported transactions
and the resulting register splits are put into a hash table of lists with accounts
as key, which will speed things up when multiple accounts are found.
My tests of large imports on large accounts seems to ate that most of the time is spent
verifying whether the imported transactions has already been imported, then computing
the balance repeatedly for each imported transaction (!)  when the user clicks OK to
add all the transactions to the account. So there's still room for improvement here!
2020-08-01 21:10:19 -07:00
jean
8551521476 Speeds up the import of ofx files by only doing one query at the end.
The previous ofx import code performed one query for each imported transactions, which
was quite slow. The change consists of gathering all ofx transactions before doing the
query. The query must be wider to search for all matching accounts (in case the imported
transactions come from different accounts) and an enlarge date range (according to the
earliest and latest imported transaction). The rest of the code is identical to what was
done before. The final query is performed just before the matching dialog is displayed.
2020-08-01 21:10:18 -07:00
Hong Xu
e0e77ca39d Add Python example export_account_totals.py
This example exports acount totals of all accounts into a CSV file.

This has been asked before: https://money.stackexchange.com/questions/111786/exporting-account-totals-in-gnucash
2020-08-01 14:47:33 -07:00
Christopher Lam
12ab85fa6c [advanced-portfolio] use G_ for guile-3.0 2020-08-01 13:55:29 +08:00
Christopher Lam
6f1960313f [advanced-portfolio] restore to original 4.0 state
and remove tests which cannot be run anymore
2020-08-01 13:55:29 +08: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
c4d9ca7bc6 Bug 797889 - editing amounts in dr / cr behaving oddly
Rearranged gnc_price_cell_modify_verify to remove code duplication.

Also added removal of any thousands separators as if they were left
in the wrong place gnc_basic_cell_set_value_internal would raise
an error dialog and fail to accept the value.
2020-07-31 15:28:04 -07:00
Christopher Lam
5a8d049483 Bug 797883 - [Transaction Report] non-localized string 2020-07-31 19:46:50 +08:00
Robert Fewell
a4b8b7a21a Realign the UI source files so they are consistent. 2020-07-31 11:38:55 +01:00
Robert Fewell
8650ffadd6 Fix some text alignment for duplicate transaction dialog 2020-07-31 11:21:04 +01:00
Christopher Lam
f71af6669a Bug 797878 - Pie chart displays fractions and long decimal representations
ensure amounts rendering is rounded to report-currency SCU
2020-07-30 18:09:48 +08:00
jean
7c462836f1 Bug 797730 - Transaction matching can match multiple imported transactions to the same existing one
This is a simple solution to the conflict problem. It does not guarantee an optimal match (i.e. a match with
the best combined match score) but it removes conflicts and finds an acceptable solution. The idea is simple:
- Start with the first imported transaction,
- Find all other imported transations that conflict with it (i.e., want to match the same register transaction).
- Of all these conflicting transactions, find the one with the best match to the register transaction
and set it as the winner: it keeps its match, and all other transactions go to their next favorite match.
- If any conflict happened, start back from the top as new conflicts can arise when imported transactions
lose their top match and go to their second best one (if any).

This loop is guaranteed to terminate because every time we go to the top, we remove at least one match
from the sum of all matches.

A bit of cleanup, a few questions are unresolved

Bug 797730 - Transaction matching can match multiple imported transactions to the same existing one

This is a simple solution to the conflict problem. It does not guarantee an optimal match (i.e. a match with
the best combined match score) but it removes conflicts and finds an acceptable solution. The idea is simple:
- Start with the first imported transaction,
- Find all other imported transations that conflict with it (i.e., want to match the same register transaction).
- Of all these conflicting transactions, find the one with the best match to the register transaction
and set it as the winner: it keeps its match, and all other transactions go to their next favorite match.
- If any conflict happened, start back from the top as new conflicts can arise when imported transactions
lose their top match and go to their second best one (if any).

This loop is guaranteed to terminate because every time we go to the top, we remove at least one match
from the sum of all matches.
2020-07-29 21:32:50 -07:00
Christian Stimming
b36a012512 Fix broken month in aqbanking<6 import
The used GWEN_Time_GetBrokenDownDate returns month in interval [0..11].
2020-07-29 22:03:39 +02:00
Christian Stimming
d6ceec681e [I18n] Minor update in German translation 2020-07-28 22:42:44 +02:00