Commit Graph

713 Commits

Author SHA1 Message Date
Geert Janssens
e79e82edcf CMake - remove parameter repetition in else() and endif() statements
This follows Professional CMake's recommended practises
2020-02-05 11:38:14 +01:00
Alex Aycinena
f1667e7ba8 Update US Income Tax information for more 2019 changes 2020-02-02 13:58:00 -08:00
Geert Janssens
0131780b30 Add guile function to extract a lot's guid
Useful for debugging lot issues in reports.
2020-01-29 18:55:35 +08:00
Geert Janssens
4537c1de36 Bug 794916 - Fails to find environment file at startup when installation prefix is '/opt'
Update on this bug. Before doing the binreloc dance on various
paths check if the calculated dynamic prefix is still the same
as the compile time PREFIX. If so, just stick with the compile
time path names as this means the application wasn't relocated
anyway. Only if the dynamic prefix is different, try to
recalculate the requested paths relative to the dynamic
prefix.
Together with the configure time fix to detect /etc/opt is
outside of the /opt prefix, this eliminates the need for further
special case handling of the sysconfig directory so that
special case handling is removed.
2020-01-22 22:40:11 +01:00
gnucash-dev
24b46b1c36 Update US Income Tax information for 2019. 2020-01-20 17:28:49 -08: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
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
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
Daniel Dittmann
31c0fed1dc test_gnc_setlocale: use trailing whitespaces 2020-01-02 14:02:04 +01:00
Daniel Dittmann
5c478713d6 test_gnc_setlocale: add missing whitespaces to diagnostic message 2019-12-30 00:38:09 +01:00
John Ralls
d51b4d7f08 Bug 797532 - Crash/Coredump Lots
Replace the asserts in cap-gains.c with g_return_val_if_fail. There's
nothing about cap-gains.c that justifies crashing the program.
2019-12-28 13:36:11 -08:00
Geert Janssens
cd8698321d Bug 797482 - Can't edit date when using Edit Payment function 2019-12-27 18:38:55 +01:00
Christopher Lam
8fb73c7ed1 [gnc-lot.h] amend description for gnc_lot_get_earliest_split
this function doesn't necessarily point to the lot opening split.
2019-12-24 16:43:55 +07:00
Christopher Lam
5ebbb74435 [new-owner-report] invoice->payments displays lot links
Change of algorithm to display invoice->payments.

Previously: invoice->lot->splitlist; filtered to payments; retrieve
splits->parent->xaccPaymentAcctSplitList This would find payment
splits in originating currency.

But this fails for lot-link txns whose PaymentAcctSplitList is null.

New algorithm:

- invoice->lot->split-list, each lot-split analysed

- TXN-TYPE-PAYMENT lot-splits will query TransferAcct and each will be
rendered in the originating currency, if they haven't been encountered
before in this invoice.

- TXN-TYPE-LINK lot-splits are rendered as a generic 'Offset
Documents' link to lot-link splits. This helps link invoice to the
link transaction to locate the corresponding credit-note. It is not
possible to link to the corresponding credit-note because a
link-transaction can group many invoices to many credit-notes.

Also:

Increase right-hand-side links from 3 to 4 columns. I think it's quite
useful to add 'Credit Note' 'Invoice' 'Payment' as a separate
column.
2019-12-24 10:55:26 +07:00
Robert Fewell
803d4c511e Bug 797489 - No option to use account codes in Budget View - Part1
In the budget view there is no option to add the account code column
which some uses use for sorting their accounts. This commit introduces
a feature flag to be used in version 4.0 but if set in 3.8 will hide
the new account code column so the view is not disrupted.
2019-12-11 15:16:48 +00:00
Christopher Lam
2cd69e8d85 [budgets.c] handle both natural & reversed signs budgets
introduce new API
* gnc_using_unreversed_budgets - queries book's unreversed feature
* gnc_reverse_budget_balance - check if book unreversal status matches
  2nd argument. if so, return account's reversal status. else, return
  FALSE.

* gnome-budget-view can now show both natural and reversed budgets
* gnome-plugin-page-budget will now read&write both natural and
  reversed budgets.
2019-12-05 17:26:46 +08:00
Christopher Lam
ded336f987 [gnc-features] enable reading of unreversed budgets 2019-12-05 17:26:46 +08:00
Christopher Lam
c06191a656 Transaction.c: avoid slow g_list_nth_data 2019-12-05 13:06:11 +08:00
Frank H. Ellenberger
91183a2af5 drop emacs_trailer from xml files.
Modern versions of emacs know, how to behave on xml files.
2019-11-25 00:42:40 +01:00
Christopher Lam
fbc7c9027e [scm/utilities] even more efficient list-flatten functions
because:

* list? is O(N), because it needs to test for an improper
list. improper lists are lists whose last pair's cdr cell is not
'(). null? and pair? are both O(1).

* avoids reverse which is also O(N): guile has unlimited stack
therefore we can do non-tail-call loop first to pass as parameter to
the tail-call loop. this removes the need for prepend-and-reverse.
2019-11-19 19:28:27 +08:00
Christopher Lam
de09259f13 Bug 797500 - valgrind errors - new/delete vs malloc/free
Mismatched new/g_free()
Change to new/guid_free() which calls delete
2019-11-17 09:55:51 +08:00
John Ralls
9189bcbe41 Bug 797078 - "Automatic decimal point" Should Not Cause 2 Different Behaviors
It's documented only for automatically inserting the decimal point
so remove the code that affects number display.
2019-11-10 12:33:20 -08:00
Christopher Lam
d56a47f17a [c-interface] gnc:backtrace-if-exception returns #f if error
previous would return *unspecified* when error was captured.
old code seems to expect #f to signal error
2019-11-03 10:44:50 +08:00
Christopher Lam
2df672bdb2 [gncOwner] i18n gncOwnerGetTypeString types 2019-11-02 09:05:22 +08:00
Christopher Lam
644cb4100e [gncOwner] add gncOwnerGetTypeString returns owner-type
* will have several uses
2019-10-28 20:18:47 +08:00
Christopher Lam
b2fcfbd3c6 Bug 797326 - Enhancement: budget's Estimate tool should ignore Closing Entries
Addendum to 8b8c957ed -- if budgeted amounts exclude closing entries,
actual amounts should also exclude closing entries.

Amend documentation, modify budget test to add a closing entry which
will be ignored.
2019-10-25 18:27:47 +08:00
John Ralls
1dc22e53c5 Fix test_xaccTransEqual.
Needed to make the noclosing_balances equal to get the balance-equality test to pass.
2019-10-23 20:09:40 +08:00
Christopher Lam
198570d8c8 Bug 797390 - xaccAccountRecomputeBalance also tallies no-closing balances
Add a few API, enough for fixing bug 797326 easily.
2019-10-23 20:09:40 +08:00
John Ralls
9661a77f3c Bug 797459 - Installation (for 3.7) Readme Version number shows 2.2.x
Remove the version line and update the number of developers: The
AUTHORS file shows more than 200, not counting patches.
2019-10-15 10:55:18 -07:00
John Ralls
badda88224 Clear, not empty.
Found by gcc when setting C++17 on master.
2019-10-05 11:44:09 -07:00
Christopher Lam
c6195d6e7a [test-budget] centralize gnc:create-budget-and-transactions
it will be reused by test-stress-options
2019-10-03 08:23:29 +08:00
Christopher Lam
22cdd237f1 [test-portfolios] initial commit
1.1.1980 seed $10,000
1.2.1980 buy 1 AAPL @ $100
1.3.1980 buy 1 AAPL @ $200
1.5.1980 sell 1 AAPL @ $400, FIFO capgain = $300, less $10 fee
1.10.1980 1:10 stock split 1 to 10 AAPL, price now $40
1.11.1980 1:10 stock split 10 to 100 AAPL, price now $4
1.12.1980 3:1 stock split 100 to 33 AAPL, price now $12;
          cash-in-lieu for 1/3 AAPL = $4

tests both portfolio.scm and advanced-portfolio.csm
tests report output using average/fifo/lifo

pending: DRP etc
2019-09-24 23:07:47 +08:00
Christopher Lam
9832fa397a [window-report] show backtrace when report crashes
* exposes a SCM string last-captured-error containing last backtrace
* when rendering report-crash window, include it
2019-09-23 17:55:25 +08:00
Christopher Lam
a259ba4a3e [utilities] move gnc:html-string-sanitize to utilities.scm 2019-09-22 22:48:07 +08:00
Christopher Lam
24393b6f5c [utilities] fix comment use official gnu mail archive 2019-09-21 19:33:21 +08:00
Christopher Lam
0511ce723e [API] gnc:list-flatten flattens lists recursively
and is a schemey algorithm rather than a report algorithm, so, belongs
centrally.
2019-09-21 11:18:26 +08:00
Christopher Lam
3208879e64 [app-utils] upgrade Tax/Tax Number option to all locales
Previously de_DE locale will add a *global* 'Tax/Tax Number'
option. This is immediately translated.

This change will upgrade it to be present in all locales, and can be
queried by any report.
2019-09-20 14:57:57 +08:00
John Ralls
c23f3f05e3 Fix deprecated G_TYPE_INSTANCE_GET_PRIVATE and G_INLINE_FUNC
with the function/declaration that they substituted.
Note that this doesn't use the recommended new GObject creation macros
because the class names in libgnucash/engine don't follow the gnome
naming convention.
2019-09-12 15:25:42 -07:00
Christopher Lam
70cb3a0b97 [utilities] compact sort-and-delete-duplicates
This is still readable IMHO. kons is the result constructor, and adds
item to result iff different from previous add.
2019-09-11 20:30:13 +08:00
Frank H. Ellenberger
fa4fc551af Remove obsolete "disambiguation prefix" translator comments
https://lists.gnucash.org/pipermail/gnucash-devel/2019-September/044199.html

Continuation of commit d30fe7a
2019-09-10 00:13:01 +02:00
John Ralls
e6e2258a74 Bug 797356 - ninja check fails with GCC-9 2019-09-09 14:44:10 -07:00
Frank H. Ellenberger
bbcf19ae6a [I18N] use msgctxt for Reconciled flags
Final step for [Bug 797349] "A"ssociate header badly translated
2019-09-06 05:59:55 +02:00
Robert Fewell
2bcb9bb1a5 Test for Invoices XML dates not being INT64_MAX
To prevent errors being logged to the trace file when invoices are
saved test for the date values not being INT64_MAX which is an unset
date.
2019-08-29 11:28:18 +01:00
Robert Fewell
d677e3c5df Do not log an error when no default tax tables set 2019-08-29 11:27:10 +01:00
John Ralls
f00777ca07 Add scm-srfi64-extras and scm-qif-import as check dependencies
Fixes make check when make all hasn't been run.
2019-08-27 11:50:25 -07:00
Craig
04aab7cea3 Correctly parse decimals between 0 and -1.
The negative sign was being lost because stoll("-0") is 0.
Also permits parsing decimals between -1 and 1 without the leading 0.
2019-08-25 15:50:29 -07:00
Geert Janssens
7dc59950a5 Bug 797353 - Add copyright and release info in appdata file
This also means the appdata file now requires preprocessing to set this info
automatically.
2019-08-24 17:32:16 +02:00