Commit Graph

753 Commits

Author SHA1 Message Date
John Ralls
6a3fabc30d Fix test failure for timezones west of the prime meridian.
The previous fix didn't calculate the comparison time correctly and
ended up in the wrong day because the GMT time is before the local time.

In the course of checking the corner-case timezones (Midway and
Kiritimati) I found an error in the GncDateTime calculation of the
neutral time, so fixed that too.
2020-05-02 15:35:13 -07:00
John Ralls
b4177bc60a Fix transaction post_date being set to midnight local.
Reported for Invoices on gnucash-user. Checked all other uses of
xaccTransSetPostDateSecs(), fixed the ones that weren't passing an
already normalized time64. For Invoices change the post_date to also be
normalized so that it stays the same as the transaction post_date. That
also protects it from the displayed date changing depending on timezone.

The python binding invoice post_time test had to be changed to match.
2020-04-30 12:09:22 -07:00
jean
e0e7cf7dfb Fix 3 problems with the scheduled transactions calculations
This fixes 3 bugs:
- Set a monthly recurrence on the 10th with a start date on the 20th of this month.
The editor correctly shows the next occurrence to be on the 10th of the following month.
The schedule transaction summary dialog incorrectly shows the next occurrence to be on the 10th of this month
(before the start date!)
- Set a monthly recurrence on the 19th, with a start date on the 20th of this month. The editor's
calendar marks incorrectly show the next occurrence to be on the 19th of this month (before the start date).
- Set a monthly recurrence on the 18th, with a start date on the 20th and an end date on the 17 of the following
month. The calendar should show no mark, but fails to erase the marks that were present.
2020-04-25 14:39:41 -07:00
Christopher Lam
8023065030 [fin.scm] return #f instead of -1 if n is out of range 2020-04-21 11:39:40 +08:00
Christopher Lam
96a6e1b0d5 Merge branch 'patch-1' of git://github.com/thetedmunds/gnucash into maint 2020-04-21 11:39:28 +08:00
Christopher Lam
6de712b501 [gnc-exp-parser] don't crash when gnc:fn returns non-number
if gnc:fn returns anything other than a number, abort rather than
crash
2020-04-15 04:54:05 +08:00
thetedmunds
d6c5b115d8
Adding lines missing from fix for Bug 797196
Adding definition of gnc:amort_balance() that got lost in the original pull-request for Bug 797196.
2020-04-14 07:45:54 -07:00
John Ralls
06033c19cd Fix typo. Really fixes 797674. 2020-04-12 13:40:49 -07:00
John Ralls
c91fb77fae Bug 797674 - 3.9: test-gnc-path-util failed on Debian amd64 2020-04-11 14:23:27 -07:00
John Ralls
fdfaca5575 Merge Christoph Holtermann's 'python-session-instance-constructor' into maint. 2020-04-06 12:05:21 -07:00
c-holtermann
ab843c0b7a include gnucash_core of python bindings in python swig app-utils 2020-04-06 07:03:40 +02:00
John Ralls
640171c211 Merge Jean Laroche's '797318_MRO' into maint. 2020-04-05 14:38:46 -07:00
John Ralls
8ccc1579d9 Bug 797666 - libgnucash/engine/test/test-recurrence.c: In function 'check_valid': 'result' may be used uninitialized 2020-04-05 12:06:02 -07:00
jean
4a8350ece2 797318 - Amounts ending in zero displayed as fractions 2020-04-04 14:43:03 -07:00
Christopher Lam
f05128b2c2 Bug 797583 - gnc:book-add-quotes crashes when there are no quotes
When Get Quotes being run on empty book, the gnc:book-add-quotes
function expects book->commodity->fq-call-data to return #f
2020-03-28 09:21:46 +08:00
Christopher Lam
ed2437e427 Bug 797656 - Immediate crash when retrieving quotes
gettext needs to be imported
2020-03-28 09:17:36 +08:00
John Ralls
33902a6793 Improve test building with the Xcode generator.
Add CONFIGURATIONS keyword to unadorned tests, enables tests with
multi-config generators.
Add CONFIGURATION generator expression to libgtest.a and libgmock.a
build directory specs when building with Xcode so that it can
find them when building tests.
2020-03-23 17:52:26 -07:00
jean
66fce05308 Move the weekend adjust code in its own function 2020-03-22 12:34:57 -07:00
jean
268695f19c Make test-recurrence handle wadj 2020-03-22 12:34:57 -07:00
jean
7a61eca4fe Bug 685102 - Scheduled Transactions don't always respect weekends for first occurrence 2020-03-22 12:34:57 -07:00
goodvibes2
39c9aa4de3 Remove bad paths from CMakeLists.txt files 2020-03-22 17:57:27 +11:00
Christopher Lam
9865a99663 [account.cpp] refactor GetBalanceAsOfDate
much more compact loop.
2020-03-15 07:01:55 +08:00
Christopher Lam
8def3ba26e [account.cpp] refactor xaccAccountGetPresentBalance
instead of starting from account->splits tail then backtrack, reuse
existing code.
2020-03-15 06:58:50 +08:00
Christopher Lam
50674ef632 [gnc-ui-balances] add and expose gnc_ui_account_get_reconciled_balance_as_of_date 2020-03-15 06:40:03 +08:00
Christopher Lam
a8f03cf1c8 [account] add and expose xaccAccountGetReconciledBalanceAsOfDate 2020-03-15 06:40:03 +08:00
John Ralls
d744b79bef Remove disabled code copied from utest-Account.c into utest-Budget.c. 2020-03-14 11:08:27 -07:00
John Ralls
8b61644978 Add more tests for neutral time. 2020-03-14 10:15:32 -07:00
Frank H. Ellenberger
82987e13f3 gnc-fq-dump: fix warning on argv
Scalar value @ARGV[0] better written as $ARGV[0] at gnc-fq-dump line
160.
2020-03-13 21:22:19 +01:00
Frank H. Ellenberger
56fa959ec0 Apply @PERL@ -w substitution on gnc-fq-dump, too 2020-03-13 20:53:15 +01:00
Mike Alexander
9e35aea588 Fix a typo in commit 4318f7a: gnc.scm, not gcc:scm 2020-03-08 18:11:51 -04:00
Mike Alexander
4318f7a3c7 Revert "completion redefine gnc:debug" and fix some bugs in it
This change made it impossible to turn debug output on or off on the
fly by calling qof-log-set-level from Scheme code.  The optimization
achieved isn't all that great either since the arguements to
gnc:debug are still evaluated when debugging is off and this is
where a lot of the overhead is. Even without this change the call to
strify is avoided.

Also fixed the parameters of qof-log-check:
    "gmc" => "gnc.scm"
    G-LOG-LEVEL-DEBUG => QOF-LOG-DEBUG

This reverts commit b3a4cd6277.
2020-03-07 23:44:16 -05:00
John Ralls
95857a8b99 Merge Christian Gruber's 'fix_bug_797587' into maint. 2020-02-28 21:29:58 -07:00
Geert Janssens
feee495f2e Bug 797624 - Wrong Decimal for Vietnam currencies 2020-02-25 16:40:50 +01:00
Christian Gruber
7509b542da Simplify function build_bayes()
Inline function parse_bayes_imap_info() into build_bayes() and remove
temp_guid.
2020-02-17 23:41:05 +01:00
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
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
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
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
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