Commit Graph

21829 Commits

Author SHA1 Message Date
Christian Gruber
01c76e2391 Remove unused template of function for_each_slot_prefix()
for_each_slot_prefix() is not used anywhere with two arguments
2020-02-17 23:41:05 +01:00
Christian Gruber
41863be9c7 Avoid copying local instance of AccountTokenCount 2020-02-17 23:41:05 +01:00
Christian Gruber
d07d4b962f Fix tokenize_string()
This fix prevents empty strings as tokens and removes duplicated tokens.
Function tokenize_string() is used for bayesian import matching, where
empty token strings or duplicated tokens lead to wrong results within
probability calculation for matching of a transaction to an account.

Empty token strings can occur if (see function g_strsplit())
* two or more spaces occur directly after another
* the string begins or ends with spaces
2020-02-17 23:41:05 +01:00
Christian Gruber
322f2d99de Rework key prefix matching
Use C string comparison instead of C++ function std::mismatch to increase
performance.
2020-02-10 22:31:29 +01:00
Christian Gruber
a13184978a Fix calculation of token info to find exactly matching tokens only
In get_first_pass_probabilities() function
qof_instance_foreach_slot_prefix() is called with a prefix path
including closing slash after token now. This avoids, that also entries
with token as a substring are included in token info, where key only
starts with token.

Finally function build_token_info() checks, if the key suffix after the
token consists only of the GUID. This avoids, that also entries with the
same prefix and slashes are included in token info.
2020-02-02 18:00:27 +01:00
Christian Gruber
da60560ac4 Change behaviour of KvpFrame::for_each_slot_prefix()
Provided function func is now called with key suffix only instead of
full key (prefix is omitted). This is neccessary for fixing function
build_token_info() in the next commit.
2020-02-02 18:00:27 +01:00
Christian Gruber
9b3085a429 Add test cases to check for exact token matching 2020-02-02 18:00:27 +01:00
Geert Janssens
073e47801d Drop useless ifdefs
The parameter it checks is always defined these days
2020-01-17 18:25:43 +01:00
Geert Janssens
d8a304c2c9 Housekeeping - reduce the number of PACKAGE and VERSION related cmake variables
This starts by setting the gnucash version number in the 'project' call.
This will result in a number of variables set by cmake. The remainder
of this commit is to reuse the auto-generated
PROJECT_NAME, PROJECT_VERSION, PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH and PROJECT_VERSION_TWEAK
instead of all the various instances of PACKAGE, GNUCASH_MAJOR_VERSION
and so on.

One parameter is worth mentioning - GETTEXT_PACKAGE
GnuCash is not using this directly (any more) but it has to be set before
including gi18n-lib.h.
2020-01-17 18:15:27 +01:00
Mike Alexander
aa961846c6 Remove the old XCode project. It is obsolete and CMake can create one 2020-01-17 01:32:42 -05:00
Geert Janssens
e91e84e7ed Bug 797569 - Swedish account templates not accessible
Turned out to be a bug introduced by our port to cmake.
The Windows special casing for Swedish account hierarchies
was never called at all.
This fix includes a fix for a const correctness compiler warning as well.
2020-01-15 16:23:47 +01:00
Christopher Lam
8618c25d50 Bug 797572 - part 2 - swap Debits/Credits, can show informal headers
Previously Credits was rendered before Debits. Change to formal
accounting convention. Can swap to informal headers if set by global
preference.
2020-01-15 19:04:46 +08:00
Christopher Lam
1dac9e1fc2 Bug 797572 - part 1 - don't accumulate Dr/Cr totals unless printed 2020-01-15 18:25:23 +08:00
Christopher Lam
c4ab772d4b Bug 797576 - xaccAccountOrder shouldn't sort account codes as base-36
Thanks to yegor for discovering it is unreliable for sorting. It has
been present since 50646f04
2020-01-15 18:25:16 +08:00
Christopher Lam
3db699786f [core-utils.i] declare prefs as ENUMs 2020-01-15 18:04:35 +08:00
Geert Janssens
08d685f4aa Define SET_ENUM in core-utils.i as well
Will be used to expose our settings related constants to guile
2020-01-15 09:29:27 +01:00
Christopher Lam
5ac7f1beaf Bug 797573 - Incorrect value of securities in the Asset Chart
Algorithms used xaccFooOrder to attempt strict ordering of Foo
objects. Unfortunately the internal definitions of xaccAccountOrder
does not guarantee a strict ordering of accounts.

Also remove unused split<? comparator.
2020-01-15 06:32:38 +08:00
Frank H. Ellenberger
d61453d3cf L12N:sv_AX Add Windows' name "Swedish_Åland Islands"
Patch from Bug 725296, but in theory it had better fit in Bug 797569.
2020-01-14 21:21:48 +01:00
Geert Janssens
826c826cc1 Bug 797569 - Swedish account templates not accessible
If environment variable LANG is set to 'Swedish_Sweden' (to work around a gettext bug
affecting Swedish locales) the wrong unix locale was substituted previnting
gnucash from finding the associated account hierarchy templates.
2020-01-13 22:25:36 +01:00
Christopher Lam
ead5c94787 Bug 797548 - multicolumn income statement: some closing entries are not ignored when within reporting period
Remove closing-entries substring/regex filter.

We will rely on the closing flag created with the Tools>Close Book
tool. This means very *old* closing entries will need to be re-done
via Tools>Close Book using the same date as the old closing entries.
2020-01-12 22:04:47 +08:00
Christopher Lam
fd24b01689 [new-aging] reuse string 2020-01-12 21:19:42 +08:00
Christopher Lam
6aff6e15f0 [new-aging] reinstate sort-by choices
- offer choices for sorting owners in each APAR list
- may be useful for ordering customer aging debts
- this means we remove the default owner->name sorting
2020-01-12 21:19:12 +08:00
Christopher Lam
e3b926bdfa [new-owner-report] reuse string 2020-01-12 13:32:38 +08:00
Christopher Lam
0787b4e24f [new-owner-report] splits->desc will show 1 memo per line 2020-01-12 13:32:38 +08:00
Christopher Lam
d9b585c396 [category-barchart] simplify report definitions
instead of list-accessors, use (ice-9 match) to assign names to list
items. remove ugly 'tip-and-rev' hack.

also remove hidden option 'reverse-balance?' and pass it as an
argument to the renderer.
2020-01-12 13:32:24 +08:00
Christopher Lam
baba7f0deb [income-gst-statement] no need to reverse report amounts
this report handles reversal of income amounts and shouldn't
re-reverse according to originating split's account type.

also friendly-fn should be #f instead of (lambda (a) "") because the
former is handled specifically in trep-engine's add-subheading to
display a blank cell.
2020-01-11 21:52:15 +08:00
Robert Fewell
c8eb3b3738 Bug 797550 - Crash when changing register tab position
Check for a valid GNC_MAIN_WINDOW being passed to
gnc_main_window_update_tab_position before trying to update tabs
2020-01-09 14:59:53 +00:00
Robert Fewell
5bfef54d6d Change some spacing in source files account-quickfill.* 2020-01-09 14:49:25 +00:00
Robert Fewell
936e2bf371 Bug 797546 - Autocomplete not updated when account names changed
If an account name is changed, the autocomplete list store was updated
but the hash table was not so this change checks for the name change
and updates the hash table. Also fixed was changing the account from /
to a placeholder account which will show or hide the account.
2020-01-09 14:47:43 +00:00
Frank H. Ellenberger
3c6ad3ae82 L12N:hu Remove region code from account templates directory
There is no region specific file, but the language is also used in other
regions: https://hu.wikipedia.org/wiki/Magyar_nyelv
2020-01-07 13:47:50 +01:00
Christopher Lam
a3ebd93acd [new-owner-report] fix LHS and RHS description
INV/PMT txns both derive DESCRIPTION from invoice-posting / payment
txn's ASSET/LIABILITY splits->memos

This seems to produce consistent results in all circumstances.

If a payment txn is modified so that it is funded from >1
asset/liability split, it will concat unique transfer splits memos.

eg. payment transaction

Asset:USDBank -$100 memo "100 USD"
Asset:GBPBank -$100 memo "70 GBP"
A/Payable     +$200 memo "orig-memo"

The Payment Description will be "100 USD, 70 GBP"
2020-01-06 23:46:53 +08:00
Christopher Lam
741eb48016 [trep-engine] upgrade to include 'balance brought forward'
This fairly complex-looking change is actually simple.

default-calculated-cells is redefined so that the running-balance
column has a custom subheading renderer. The subheading renderer was
formerly used solely for the account->friendly-debit/credit-string
renderer, and is now upgraded to handle hard-coded symbols.

If the friendly-heading-fn is a symbol 'bal-bf, it'll print the
split->account->balance at begindate.

Other columns may also be upgraded for novel subheading renderers. No
forward/backward compatibility issues are expected at all. This change
looks complex because the begindate is not available to
make-split-table and has to be passed on as an argument to be
available for use, and the subheading-renderer will test whether to
display the friendly-fn-renderer at a later stage than previously.
2020-01-06 22:34:26 +08:00
Frank H. Ellenberger
0f4265d910 Unify menu separator to "->"
Other meanings of previous " -> " are now:
" -> " conversion
" .. " a range

Other fixes:
1. "File>Save" typo
2. Remove $ from sort order tooltips as it is
 a. not relevant,
 b. untranslatable for languages used in different regions.
2020-01-05 14:18:06 +01:00
John Ralls
589f1c451f Fix misspelling. 2020-01-04 18:12:29 -08:00
John Ralls
df92200c8e Restrict gnucash.pot comment collection to ones beginning with Translators.
On recommendation of the Translation Project's Benno Schulenberg.

Required re-annotating some comments. Also removed several comments
about leaving a line break to prevent inserting it into gnucash.pot.
That didn't actually work: they were inserted anyway.
2020-01-04 15:57:02 -08:00
John Ralls
c9998a8ad8 Merge Dave Dittman's missing whitespace into maint 2020-01-03 13:54:59 -08:00
John Ralls
b5fdcfcb5b Bug 797481 - crash on close of unsaved tabs by pressing [X]
Use g_object_weak_ref() to null GncItemEdit::sheet to prevent
a use-after-free crash.

Note that this is a band-aid fix. To fix correctly GncItemEdit and probably
most of the rest of the register must be rewritten with modern GObject
macros and resource management.
2020-01-03 13:18:39 -08:00
Frank H. Ellenberger
d409d009fb Amend PR #629: Menu separator in text is "->" [I18N] 2020-01-03 09:16:31 +01:00
John Ralls
b31f552822 Bug 797549 - Reconcile window shows S_tatement Date rather than...
Statement Date.

Obsolete insertion of _ for Gtk mnemonic when used in gnc-split-reg.c
line 609. That's now handled by the GtkBuilder file.
2020-01-02 16:35:18 -08:00
Jannick
68a24dc7d2 reports: bug fixes in translation strings
* gnucash/report/report-gnome/gnc-plugin-page-report.c:
- replace 'report' by 'report configuration' where appropriate (they are
  two different animals).
- correct the menu path to 'Reports > Saved Report Configuration'
2020-01-02 15:11:03 +01:00
Daniel Dittmann
31c0fed1dc test_gnc_setlocale: use trailing whitespaces 2020-01-02 14:02:04 +01:00
Frank H. Ellenberger
9e8886efb6 Merge PR #623 into maint 2020-01-02 13:16:22 +01:00
Daniel Dittmann
1c6f3fc957 create a more consistent aqbanking online_id
The online_id will generated based on bankcode and accountnumber. The
accountnumber may have leading zeros which shall be ignored to make the
creation reliable. In my case the accountnumber of the accountinfo has
no
leading zeros, but the accountnumber of the imported transactions has
leading
zeros. In the result the generated online_id was different and the
widget
to assign the transactions to a account appears always.
2020-01-02 13:15:25 +01:00
Frank H. Ellenberger
7acc2706c6 Merge PR #626 into maint 2020-01-02 12:21:03 +01:00
milotype
b384800d8d L12N:hr: update croatian translation with pot file 3.8
5409 translated messages.
2020-01-02 12:19:05 +01:00
Frank H. Ellenberger
bccd9c707e Merge branch 'pr627' into maint 2020-01-02 11:31:23 +01:00
Christopher Lam
3d05f78caf [new-owner-report] add double-header
also create a num-cols function which returns an appropriate number of
cols for various report sections.
2020-01-02 17:17:21 +07:00
Christopher Lam
0397aca144 [html-table][API] html-table can have multirow-col-headers
NEW API:

gnc:html-table-multirow-col-headers and
gnc:html-table-set-multirow-col-headers!

gnc:html-table col-headers have been augmented to support list of th
rows.

* BACKWARD COMPATIBILITY is offered. old use of single-row headers API
gnc:html-table-col-headers and gnc:html-table-set-col-headers! should
be unchanged; will get/set a single row of th elements.

* NEW functions gnc:html-table-multirow-col-headers and
gnc:html-table-set-multirow-col-headers! will get/set an arbitrary
number of rows of th elements.

* using old API gnc:html-table-col-headers on a table, whose multiple
row headers have been set, will lead to a warning and return the first
row only.
2020-01-02 17:17:21 +07:00
Christopher Lam
f3499686ba [new-owner-report] style monetary sale/tax cols with number-cell 2020-01-02 17:17:21 +07:00
Frank H. Ellenberger
795fe9aa95 L12N:pl: Merge a fresh template
3521 przetłumaczonych komunikatów, 1465 tłumaczeń budzi wątpliwości, 414
nie przetłumaczonych komunikatów.
2020-01-02 08:46:15 +01:00