Commit Graph

332 Commits

Author SHA1 Message Date
Geert Janssens
d07f759ca3 Use alignment-safe buffer handling
Casting a char* to a struct containing a uint32_t is not universally safe
due to alignment constraints on reads on some platforms. Copy our possibly
unaligned source data into an aligned area of memory to avoid SIGBUS on
armhf.
Reported by vorlonofportland in PR#403. This commit the John's optimized
version of Vorlon's proposed fix.
2018-09-01 12:07:42 +02:00
Geert Janssens
4c87dd05ec Fix compiler warning issues
- add -Wno-deprecated-declarations to CXX_FLAGS as well. This was
  reported by vorlonofportland in PR#401 to become necessary for glib 2.58
  as that has deprecated g_type_class_add_private which appears in our
  c++ code.
- change -Wno-deprecated-register into -Wregister. The former appeared to
  be a clang dialect and alias for the latter (see
  https://github.com/Barro/compiler-warnings for an overview of clang
  and gcc warnings). It was moved to global CXX_FLAGS as it can only be
  added for g++.
2018-09-01 12:07:38 +02:00
Geert Janssens
131df82135 Merge branch 'date-bugs' of https://github.com/Bob-IT/gnucash into maint 2018-08-31 22:01:45 +02:00
Geert Janssens
baf933acf2 Bug 796054 - unposting and reposting invoice doubles amounts
Add scrub function to unblock the double post transaction
2018-08-31 20:24:39 +02:00
Geert Janssens
c977c2350a Merge branch 'sort-filter' of https://github.com/Bob-IT/gnucash into maint 2018-08-30 12:18:15 +02:00
John Ralls
704afc6e02 Comment to explain structuring an (env-transfer-foreign). 2018-08-28 15:10:29 -07:00
John Ralls
fe73f52bdb Guard against divide-by-zero errors. 2018-08-28 15:10:29 -07:00
Robert Fewell
2dcb316280 White space removal and change tabs to spaces in qofbook.cpp/h 2018-08-25 11:10:32 +01:00
Robert Fewell
fd750a22eb Cache the number of days read only value
The KVP value for the qof_book_get_num_days_autoreadonly was being
called many times so it makes sense to cache it in the book to avoid
the KVP lookup.
2018-08-25 11:10:24 +01:00
Robert Fewell
a650693d07 New feature for register sort/filter settings move. 2018-08-17 11:31:25 +01:00
Robert Fewell
9423e0913b Remove white space and re-indent gnc-features.c 2018-08-17 11:31:25 +01:00
John Ralls
c08dee67ba Preserve timespec-using functions in Guile bindings.
There's an example of use in text-extras.scm, function
gnc-pricedb-create.

Unfortunately the deprecation messages issue no warnings.
2018-08-16 10:47:41 -07:00
John Ralls
e9098d08d2 Change ISO date format to remove fractional seconds. 2018-08-13 16:19:39 -07:00
John Ralls
35fabe2690 Remove Timespec from gnc-date. 2018-08-13 16:19:39 -07:00
John Ralls
62b17ca5db Timespec removal, engine odds-and-ends. 2018-08-13 11:52:43 -07:00
John Ralls
358cd979d9 Remove Timespec from the main engine classes (Transaction, Split, & Account. 2018-08-13 11:52:42 -07:00
John Ralls
fee589b28c Remove Timespec from pricedb.
Includes removing the time64 specialized functions because the regular ones
handle time64 now.
2018-08-13 11:52:42 -07:00
John Ralls
92a8cf330a Timespec->time64 in business code. 2018-08-13 11:52:42 -07:00
John Ralls
c8b372e390 Convert GNC_TYPE_TIMESPEC to GNC_TYPE_TIME64, Kvp::Type::Timespec to Kvp::Type::Time64
They have to go together because of using gvalues to hide KVP from most of
GnuCash.
2018-08-12 16:12:19 -07:00
John Ralls
b60aef9d2a Remove timespec2dmy.
It had only two uses and one was in a test. Replace those calls with
gnc_localtime_r.
2018-08-12 16:12:19 -07:00
John Ralls
6f89bd62b3 Remove timespec from gnucash/gnome.
With a little API bleed into engine.
2018-08-12 16:12:19 -07:00
John Ralls
2f861bc2a4 Ensure all C++ class member raw pointers are default-initialized to nullptr. 2018-08-10 12:21:28 -07:00
Christopher Lam
47ba21b8dc [test-extras] export gnc-pricedb-create 2018-08-07 13:26:09 +08:00
John Ralls
78ab26cc2b Fix gncInvoice test failure.
test_suite_gncInvoice sets up the test suite. It's not part of the test
runtime, so stack variables in it have gone out of scope by the time the
tests are actually run. Making invoiceData static makes it permanent so
it exists at runtime.
2018-08-06 14:49:07 -07:00
Geert Janssens
d87fa3a5be Bug 796766 - Credit note creating 'imbalance' with wrong entries
Add fix and regression test.
2018-08-06 13:29:12 +02:00
John Ralls
6d605762dd Delete the last vestiges of timepair. 2018-07-23 12:00:54 -07:00
John Ralls
43af50bd8a Bug 796759 - --add-price-quotes <sql file> leaves a lock on the file.
First, save isn't necessary if the book is dirty, so don't... but that
means that the book has to be marked dirty after a session swap. No more
laziness.

Second, regardless of the outcome of inner_main_add_price_quotes the
session must be destroyed to remove the lock.

A couple of cleanups in QofSessionImpl::save as well: Rewrote the
descriptive comment to reflect how it really works when the backend has
gotten disconnected and removed the superfluous qof_book_set_backend
with the backend that we'd *just gotten from the book*.
2018-07-14 17:09:22 -07:00
John Ralls
756f444ac3 Update bug tracker URL
Change all instances of bugzilla.gnome.org to bugs.gnucash.org, reflecting
our migration to a self-hosted bug tracker.

Inform the Translation Project Coordinator at release that this affects
translatable strings and that all message catalogs have been updated.
2018-07-13 09:49:33 -07:00
Christopher Lam
582265d0c6 [job-report] Prevent Crash if there is no AR account
I think this crash is triggered because the 'account' variable
defaults to the first available AR account. If there's no AR account
it becomes null, and querying null's default book leads to segfault.

I guess I can fix segfault too by fixing gnc_account_get_book.
2018-07-07 12:58:13 -07:00
Geert Janssens
f067e8328e Allow saving to xml over an existing sqlite3 file and the other way around
A type check on the pre-existing file was preventing this. The type check however
only makes sense when opening files, not when overwriting.
2018-07-06 22:00:08 +02:00
Christian Stimming
5f46553f1f Minor KVP performance cleanup
Change some plain string literals to std::string constants, which helps
avoiding typos and also saves some string constructors/destructors
in the KVP lookup. Nevertheless the functions in Account.cpp do not
contribute that much to the overall UI speed, but whatever.
2018-06-24 20:50:46 +02:00
Christian Stimming
92ea3ba8a6 Register speed-up for large files.
The function qof_book_use_split_action_for_num_field gets called quite a
lot in each register display refresh (due to sorting all splits from
Split.x's xaccSplitOrder function), but it always used to use a KVP
lookup, which is rather expensive compared to accessing a gboolean member
variable.

To get rid of this cost, I had to remove the KVP lookup in this
simple-looking function. The pattern is this: A gboolean cache variable is
introduced, along with an isvalid flag. The lookup makes the expensive
KVP lookup once, then caches the value. The GObject property mechanism
offers a callback for when the setter was called, which is used to mark
the cached value as invalid. A parallel setter method (here:
qof_book_set_option) also just marks the cache as invalid. This covers
all setters, and the getters will use the cached value except for their
first invocation.

The NUM_FIELD_SOURCE feature was introduced in 2012 by the very large
commit 7cdd7372 and apparently its costs never were a problem
until the KVP lookup became more costly due to the std::vector
construction and destruction.
2018-06-22 22:54:33 +02:00
John Ralls
a9f0fe2f93 Merge Chris Lam's 'maint-test-all-charts' into maint. 2018-06-17 14:06:38 -07:00
Christian Stimming
1e3a445007 Optimize calls to get_path_kvp so that std::strings are not always created and deleted immediately.
Turns out that the on-the-fly conversion from const char* (the KVP_OPTION_PATH
constants) to std::string with their immediate deletion afterwards is
a quite costly operation. Avoiding this is surprisingly easy: Just keep
local std::string objects at hand, and they don't have to be created
and deleted anymore.

The more optimized solution might be to turn the std::vector<std::string>
into a std::vector<GQuark>, but this commit at least improves the picture for now.
2018-06-17 22:51:16 +02:00
Christopher Lam
02bb981daa [test-extras] upgrade env-transfer-foreign to update pricedb 2018-06-16 14:18:30 +08:00
Robert Fewell
1f14d0f629 In qof_scan_date returns valid date when day and month are 0
If you start typing a date in the register with the enable autoreadonly
option starting with a 0, gdate complains when trying to create a valid
date.
2018-06-09 15:04:27 +01:00
John Ralls
cdcb230a31 Don't look for backend libraries in old autotools subdirs.
Partly addresses Bug 794526
2018-06-07 17:38:04 -07:00
John Ralls
74cbde2d4f normalize date formats the C++ way. 2018-05-28 08:56:01 -07:00
John Ralls
174752e28c Merge Bill Nottingham's 'bad-dates' into maint 2018-05-26 18:10:02 -07:00
John Ralls
aa08689371 Merge Paul Wassi's "Fix Permanent Storage" PR into maint. 2018-05-26 16:35:58 -07:00
John Ralls
5708707f6c Fix misplaced try block that caused unhandled exception if year out of range. 2018-05-25 09:19:12 -07:00
Paul Wassi
396c955fd5 Fix permanent storage of vendor details.
Since the data types did not match for the billterms and taxtable,
those references/guids were not saved to the database.
2018-05-25 01:56:14 +02:00
Geert Janssens
fcabf6bb96 A more detailed revision of gncEntry and gncInvoice related rounding
First change is to ensure gncEntry rounding is consistent. Internally
calculated values in the entry are never rounded. Consumers of
gncEntry's calculated values can request them either rounded or not.

Next use a pragmatical approach for calculating values on invoices based on
the entry values: do the rounding such that we never
create an unbalanced transaction while posting
That means
- round each entry's net value before summing them in net total
- accumulate all tax totals on invoice level per tax account before rounding
  and round before before summing them in a global tax total

Hopefully this will catch a few more rounding issues in this area.

A complete solution can only offered if we allow users to manually correct
tax entries. This requires changes to user interface and data format
so that's not going to happen in gnucash 3.x.
2018-05-24 18:53:15 +02:00
Bill Nottingham
8b1b25aee5 Modify date formatters to strip out certian specifiers.
strptime/strftime supports various modifiers to their parameters.

 'E' and 'O': alternate locale-specific formats
 (used in default format for Persian, Oriya, Azerbaijani)
 '-': padding
 (used in default format for Czech)

GnuCash passes dates as integer y/m/d without using locale-specific
formats, so we need to strip out 'E' and 'O' from the format when
scanning dates or determining separators in gnc-date.

None of '-', 'E', or 'O' are supported by boost (and '-' causes
errors), so strip them out from formatters in gnc-datetime as well.

See https://bugzilla.gnome.org/show_bug.cgi?id=795247.
2018-05-22 23:37:22 -04:00
Geert Janssens
2e8df1984a Improve rounding for invoice entry values
This will probably need more refinement because the multiplications
are still missing rounding methods, but the changes in this commit
will already allow guile code to correctly create entries.
2018-05-19 20:25:13 +02:00
Christopher Lam
13f31e0691 test-extras.scm: (logging-and) is obsolete
Use the much nicer SRFI-64 forms instead.
2018-05-10 22:21:55 +08:00
Christopher Lam
5e0fc04f7b test-extras.scm: remove dead code
These functions are never used through code.
2018-05-10 22:21:55 +08:00
Christopher Lam
c6032ac6ed srfi64-extras.scm: centralize (gnc:test-runner)
This is good enough to be used widely.
2018-05-10 13:19:03 +08:00
Geert Janssens
a9f35ed7ae Lowercase cmake commands
A huge bikeshed fest but it distracted me enough to do it anyway.
2018-05-03 23:18:15 +02:00
Geert Janssens
b761b5a0dc Bug 795377 - Reads and saves Gnucash 2.6.19 XML file, then can't reread it, due to bad date in old file
This commit contains another round of cleanups in the
timespec to time64 conversion. There were a number of
false assumptions that time64 = 0 would be a bad date
in the xml parser. This commit corrects enough of them to
eliminate the bug. Further cleanup is probably advised but
can be done at a later stage.
2018-04-28 12:19:28 +02:00
John Ralls
9c4469d039 Bug 795405 - All Dates in Price Database Off-By-One After 3.0 Upgrade
Also Bug 791825 - Accounting Period dates off by 1.
The DST start/end dates were reversed *and* the DST offset had the wrong
sign in Windows, resulting in the effective timezone always being one to
the west off (i.e. PDT was -9 and PST was -8).
2018-04-27 15:00:28 -07:00
John Ralls
83e993fb80 Add a TimeZoneProvider::dump().
Because gdb can't always see clearly inside m_zone_vector.
2018-04-27 14:16:49 -07:00
John Ralls
f6855bc0f8 Rename zone_vector to m_zone_vector.
To comply with coding spec.
2018-04-27 14:16:49 -07:00
Geert Janssens
d69cdaebf2 Add new test source to distribution list 2018-04-27 09:55:58 +02:00
Geert Janssens
74fd6e046b Add a few unit tests for qofquerycore 2018-04-26 23:06:36 +02:00
Geert Janssens
c71204628d Bug 795031 - 3.0 Crashes on loading when opening 2.6.19 file 2018-04-26 23:06:36 +02:00
Geert Janssens
4aadfbe636 Bug 795040 - GnuCash crashes when searching for a newly created bill 2018-04-26 23:06:35 +02:00
John Ralls
35cd165bec Bug 795134 - Improper handle of unicode character in username
Part 1: gnc-filename-utils didn't manage the encoding differences
between Windows (UTF16) and GLib (UTF-8).
2018-04-22 13:55:36 -07:00
Geert Janssens
451bbd53d9 Fix another date test
This may fix this crasher bug on windows:
https://bugzilla.gnome.org/show_bug.cgi?id=795040
However on linux it only fixes a warning so I can't be sure
until after the next nightly.
2018-04-18 19:07:30 +02:00
John Ralls
40a266fc62 One more catch-by-value error. 2018-04-14 16:03:04 -07:00
John Ralls
01420adb99 Bug 772776 - VERY large queries (over 11000 fields in IN clause) slow...
down GnuCash

Replace with joins or subqueries. Affords a 20% speedup on Windows.
2018-04-14 10:18:01 -07:00
Geert Janssens
dcfc1280bd Base invoice posted status on the presence of a posted transaction rather than a posted account
Bills and invoices that are posted and subsequently unposted again still store their
posted account internally as a convenience to the user (upon reposting the old
account will be offered by default) so it's not a reliable test for the posted state.
The posted transaction on the other hand is guaranteed to only exist when the invoice is
posted. This should fix a slew of small and perhaps larger side effects, such as
a posted bill still appearing as editable, critical warnings when creating new bills/invoices
and so on.
2018-04-14 18:46:26 +02:00
John Ralls
4a97269e4b Correct a g_log_level in test_gnc_pricedb_lookup_day. 2018-04-12 15:17:01 -07:00
John Ralls
85cc574d50 Prevent throw in gnc-pricedb.
If a price lookup is given an invalid time64/timespec (i.e. INT64_MAX)
then just return NULL instead of trying to find the nearest price.
2018-04-12 15:17:01 -07:00
John Ralls
16ba1e39b1 Bug 795080 - Some dates reset to 01/01/1970
An odd corner case: BST apparently came off of DST at 23:00 26 Oct 2014,
so midnight that day was ambiguous about being DST or not; that causes
the local_date_time constructor to throw in spite of the tm.is_dst element
being 0 (meaning pick standard time).

Instead of just failing in that case, try constructing a local_date_time
three hours later then adjust it back three hours. If *that* doesn't work
then throw a std::invalid argument.
2018-04-12 15:17:01 -07:00
John Ralls
c05aeb85ec Merge Bill Nottingham's exception type fix into unstable. 2018-04-09 15:12:56 -07:00
John Ralls
7a0f0d57c8 Bug 782144 - git-master - Save Corrupts Data File / Not Open Data File
After much thrashing this turned out to be caused by a date string
with a 3-digit year and that caused an unexpected boost::bad_cast
exception from boost::posix_time::time_from_string().

To prevent that and anything like it, pre-parse the string with
regular expressions to classify them and split out the timezone
if there is one. If neither (perhaps eventually none) of the
regexes match throw std::invalid_argument. The C function will
catch this and return 0.
2018-04-08 17:37:39 -07:00
Bill Nottingham
434dd9520c Adjust catch syntax to avoid GCC8 warnings. 2018-04-03 22:02:44 -04:00
John Ralls
f084fc67f7 Catch guid_syntax_exception in build_bayes. 2018-03-31 17:11:36 -07:00
Geert Janssens
4053f2ca53 Fix read and write of business counters and counter_formats
These are book options, but not stored under the default options frame (sigh)
So add exception code to properly access them.
2018-03-31 18:27:43 +02:00
Geert Janssens
d6a5cc9feb Merge branch 'imap-editor-fix' of https://github.com/Bob-IT/gnucash into unstable 2018-03-31 17:09:45 +02:00
Christopher Lam
f910d931f7 gncInvoice: complete removal gncInvoiceDateExists 2018-03-31 05:35:49 +08:00
Christopher Lam
b99dee1736 Replace gncInvoiceDateExists to gncInvoiceIsPosted
This commit partially reverts commit 862956a760 which exported
gncInvoiceDateExists. Remove this API and use gncInvoiceIsPosted
instead.
2018-03-31 05:35:49 +08:00
John Ralls
a23f103ebb Bug 794730 - SIGSEGV when entering an exchange rate, Part 2
91f4b19 changed the test for gncInvoiceDateExists from date != 0
to date != INT64_MAX, which isn't backwards compatible, so test
for both. But the submitted file had a posted date of -1 so
gncInvoiceIsPosted returned true anyway. That's not consistent with
the logic in dialog-invoice.c, which checked gncInvoicePostedAcc != NULL,
a better test. The result was that the "Post" button lit up but
gncInvoicePost returned immediately, doing nothing, so change
gncInvoiceIsPosted to use gncInvoicePostedAcc instead.
2018-03-30 11:19:51 -07:00
Robert Fewell
255d7194d8 Fix the gtests for the changes made to ImapInfo structure 2018-03-29 17:57:24 +01:00
Robert Fewell
6c43c3afe0 Fix Imap Editor to reflect the changes in kvp paths
There were several problems that broke the Imap Editor that have been
fixed due to kvp changes. The import-map-bayes entries were being added
to the tree view based on the number token entries squared. Retrieving
import-map entries resulted in an empty list and also deleting entries
from the tree view failed.
2018-03-29 17:32:57 +01:00
fell
9b8901248c Merge branch 'maint' into unstable 2018-03-15 18:12:03 +01:00
fell
fdfa6f528c Merge branch 'maint' into unstable 2018-03-10 11:06:59 +01:00
John Ralls
867fdce4e4 Gcc-4.8 doesn't have std::codecvt.
Use boost::locale::conv::utf_to_utf instead.
2018-03-09 16:28:00 -08:00
John Ralls
c3180ab374 Operator << fix. 2018-03-09 13:07:29 -08:00
John Ralls
5520fae838 Bug 793941 - 2.7.4: test failure on i686: 59 - test-gnc-timezone
Don't test before 1916, that's not a common GnuCash use-case.
2018-03-06 09:56:13 -08:00
John Ralls
36d729652b Speed up GUID equality comparison. 2018-03-06 09:48:38 -08:00
Geert Janssens
e2d69b174e Merge branch 'master' of https://github.com/nielsegberts/gnucash into unstable 2018-03-05 16:54:24 +01:00
Christopher Lam
4f98391a27 test-TR: unit tests
initial attempt
2018-03-01 20:55:17 +08:00
Niels
7ef8e6d489 Fix fall through in Account.cpp
Found with -Wimplicit-fallthrough, but older versions of GCC don't support it. So it will take some effort to add it to the build config.

I think it did not result in a reproducible bug.
2018-02-28 22:23:15 +00:00
John Ralls
765c117aac Optimize GncDateTime string constructor.
Turns out the stream facet parser is really slow. Since we have a
well-constrained universe of input formats we don't really need that
overhead. This got a 33% improvement in loading a large SQLite database.
2018-02-24 11:12:13 -08:00
Andreas Müller
128fce3ed8 Bug 787095 - Gnucash Crashes when opening old XML file 2018-02-22 15:59:12 -08:00
fell
464281644c Merge branch 'maint' into unstable
Should resolve issue mentioned in PR #277
Conflicts:
	libgnucash/app-utils/gnc-sx-instance-model.c: resolved
	po/de.po: changes in maint ignored
2018-02-19 15:25:53 +01:00
John Ralls
f4965ae2ac Move direct check dependencies to the originating CMakeLists.txt.
Removing transitive dependencies from being declared direct.
2018-02-18 22:16:27 -08:00
John Ralls
a5f46a5e45 More Scheme dependency additions. 2018-02-18 15:59:00 -08:00
John Ralls
48bdab38d4 Replace sprintf with Guile's built-in format. 2018-02-17 15:24:44 -08:00
John Ralls
26e51339a6 Rework the Scheme target dependencies.
Should fix Bug 793122 - 2.7.3: ninja build fails
along with the nagging parallel-build problems.
2018-02-16 14:28:46 -08:00
John Ralls
6b49b3ba4c Bug 792763 - deleting a transaction can cause a SIGSEGV
Prevent a NULL transaction from crashing xaccTransCountSplits and
prevent gnc_plugin_business_update_menus from calling it with a
NULL transaction.
2018-02-02 13:05:20 -08:00
Christopher Lam
862956a760 BUGFIX: invoice posted-date is no longer 0 for unposted invoices
This commit fixes business reports caused by 91f4b19039
whereby the posted-date for unposted invoice was changed
from 0 to MAXINT. Now we need to use (gncInvoiceIsPosted)
or (gncInvoiceDateExists) instead.
2018-01-30 19:29:04 +08:00
Geert Janssens
49a936c1fd Rewrite gnc_add_swig_guile_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
ec213360f3 Review which built files are really needed in the dist tarball
Several were only there because they used to be generated via autogen.sh
and hence had to be included because autogen.sh was not supposed to be run
in a tarball based build.
A few others aren't clear so I have left them in for now:
- gnucash.1 (man page)
- gnucash-design.info (because it's unclear what we want to do with that one)

These files should clearly be in the tarball:
- gnucash.pot -> for our translators
- ChangeLog -> can't be generated outside of a git repo
- gnc-vcs-info.h -> can't be generated outside of a git repo
- guile/python bindings -> to avoid a swig dependency when building from tarball
2018-01-29 19:46:44 +01:00
Geert Janssens
4317d8a8f6 Improve handling of generated distributable files
- the two dist_add_... macros now both take a list of file names
as argument so more files can be added at once to the dist tarball.
- dist_add_generated now creates the right target by itself. There's
  no need to pass one any more
- make the swig generated *.py module files explicit output files
- change a couple of custom_targets into custom_commands. The only
  reason they were defined as targets was to ensure they got built
  before the dist tarball. This is now properly handled by the
  dist_add_... macros.
- correctly handle dependency on swig-runtime.h (using OBJECT_DEPENDS
  was not the way to do it according to that property's help page)
2018-01-29 19:46:44 +01:00
Geert Janssens
3dff4e5211 Fix make dist on a clean checkout
cmake with unix makefiles fails to resolve dist dependencies
added from COPY_FROM_BUILD if these dependencies aren't built yet.

This commit replaces the COPY_FROM_BUILD based logic with two new functions
'dist_add_configured' and 'dist_add_generated' to indicate which files should
be included in the dist tarball. The latter also adds a target level dependency
to the dist tarball custom command. Hence the former should
be used for files that get generated during a cmake run while the latter
should be used for files generated as the result of a 'make/ninja-build' run
(like files for which an add_custom_command rule exists).

Note: this commit also temporarily disables the dist target when building
from a tarball (and hence it won't be tested in distcheck either). This
will be handled in a future commit.
2018-01-29 19:46:44 +01:00
Geert Janssens
18feaa16a7 Remove support code to load qof backend in autotools based build environment 2018-01-26 18:26:06 +01:00
Geert Janssens
52b0c06d30 Merge branch 'maint' into unstable
Conflicts:
- gnucash/gnome-utils/gnc-main-window.c
  I have chosen to ignore the changes pulled in from maint. The same change will
  be reimplemented in a followup commit.
- po/ru.po
  Same here. The translation conflicted too much and there's a
  translation update available for unstable I will pull in soon.
2018-01-25 10:24:53 +01:00
Christopher Lam
ca22d5531b Change gnc_pricedb_convert_balance_nearest_price from timespec to time64. 2018-01-20 16:40:45 -08:00
John Ralls
74ddb671e4 Merge Chris Lam's and Aaron Laws's branch 'time64-ftw' into unstable. 2018-01-20 12:40:32 -08:00
John Ralls
91f4b19039 Convert python bindings from timespec to time64. 2018-01-20 12:35:04 -08:00
John Ralls
6ffb77de20 Merge branch Rob Gowin's 'bye_bye_autotools' into unstable. 2018-01-18 12:02:56 -08:00
Geert Janssens
2364c5607f Merge branch 'maint' into unstable
Resolved conflicts:
	gnucash/gnome-search/dialog-search.c
	gnucash/gnome-utils/gnc-splash.c
	gnucash/import-export/aqb/gnc-plugin-aqbanking.c
	gnucash/import-export/import-account-matcher.c
	po/de.po
	src/report/standard-reports/budget-barchart.scm
	src/report/standard-reports/budget.scm

Note the de.po conflict was resolved by dropping all changes
and merging the file again with gnucash.pot (generated after
the merge but before committing).
2018-01-17 18:08:05 +01:00
John Ralls
26fa2acfd5 Use a more appropriate comparison for doubles. 2018-01-16 17:24:29 -08:00
John Ralls
8f96882ead Remove tests checking members of deleted objects.
GLib's scribbling of freed memory is enabled on Arch so attempting to
read the deleted members of inst and book crash instead of reaturning
invalid results. These weren't really useful tests anyway.
2018-01-16 17:24:29 -08:00
John Ralls
8900b19da3 Bug 790845 - 2.7.3: massive test failures on some architectures (reopened).
Fix some test failures caused by erroneous size assumptions.
2018-01-14 16:31:22 -08:00
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
John Ralls
ebbcd30f39 Save Changes Bug 792106 - Wrong dates displayed
The first attempt to fix this, a17bc85a, doesn't work because the
boost::date_time constructor gets enough information in most cases to
generate a date, just not the one we expect. This change looks for '-' in
the fourth position and if it's there assumes iso-extended format, otherwise
it assumes delimiter-less ISO without the 'T', i.e. %Y%m%d%H%M%S.
2018-01-09 14:58:43 -08:00
John Ralls
fcf88262ca Extract function tz_from_string.
Also changes from calculating the Bug 767824 offset to using
boost::date_time::local_time_in() and provides unit tests.
2018-01-09 14:08:42 -08:00
Christopher Lam
465c9e1f21 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch]
gnc_pricedb_lookup_nearest_in_time64
gnc_pricedb_lookup_nearest_in_time_any_currency_t64
2018-01-08 22:56:49 +11:00
Christopher Lam
dda0695285 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch] 2018-01-08 22:56:49 +11:00
Christopher Lam
46c9fcc8f8 TP->T64: libgnucash/engine/test/test-split.scm 2018-01-08 22:56:49 +11:00
Christopher Lam
fefea400ce TP->T64: libgnucash/engine/engine-interface.scm 2018-01-08 22:56:49 +11:00
Christopher Lam
b53aa85660 TP->T64: libgnucash/engine/test/test-extras.scm 2018-01-08 13:01:29 +11:00
lmat
e6ee060121 Adding bill term time64 function 2018-01-08 13:01:29 +11:00
lmat
6dc982c2c6 Some time64 corrections
The build system isn't always catching changed files, so these showed up
later.
2018-01-08 13:01:29 +11:00
lmat
1f050fd1e5 Transaction members Timespec->time64 2018-01-08 13:01:29 +11:00
lmat
9a86dd222b gncInvoice uses time64 2018-01-08 13:01:29 +11:00
lmat
598cb6d861 gncEntry members timespec->time64 2018-01-08 13:01:29 +11:00
lmat
f77369bb96 Removing timspec from some xml parsing
And several other sprawling references that are connected in one
way or another.
2018-01-08 13:01:29 +11:00
lmat
7390396af9 added gnc-dmy2time64* functions 2018-01-08 13:01:29 +11:00
lmat
588fcb6ed2 Transaction getVoidTime uses time64. 2018-01-08 13:01:29 +11:00
Christopher Lam
978ec61f98 Further scheme conversion to gdate to use time64
Add missing time64_to_gdate
2018-01-08 13:01:29 +11:00
lmat
0bf0989aa7 Add time64 functions for gncEntry 2018-01-08 13:01:29 +11:00
lmat
dbd1473730 Adding time64 alternatives 2018-01-08 13:01:29 +11:00
lmat
b5aad8c7bb Renaming time64 function for consistency 2018-01-08 13:01:29 +11:00
lmat
61d4aaaf08 Adding some time64 alternatives 2018-01-08 13:01:29 +11:00
lmat
2f89e4595b timespec->time64 for gnc_budget_get_period... 2018-01-08 13:01:29 +11:00
lmat
7d51089501 Changing scheme conversion to gdate to use time64 2018-01-08 13:01:29 +11:00
lmat
ee56f5df78 Adding some time64 API functions 2018-01-08 13:01:29 +11:00
John Ralls
502001cd7c Fix travis test failure: It seems the boost bug is fixed. 2018-01-07 16:46:25 -08:00
John Ralls
c0fd3b3165 Remove all references to the now-defunct Yahoo! quote retrieval
And make Alphavantage the default.
2018-01-02 10:43:49 -08:00
John Ralls
320c5211b0 Fix extra instance of test-test-extras* in install_manifest.txt
Allows xargs rm < install_manifest.txt to complete without error.
2017-12-31 16:34:48 -08:00
John Ralls
5823f1b2bb Prevent "Save before closing" dialog from appearing at startup.
Caused by simply loading the transaction report, which called
gnc-get-current-book and that it in turn creates a session if one
doesn't already exist.
2017-12-30 13:41:00 -08:00
John Ralls
d06ed7c1a8 Fix -Wsign-compare error. 2017-12-30 13:39:55 -08:00
John Ralls
26b82b56e0 Fix Travis 'dangling else' warning. 2017-12-27 06:32:54 -08:00
John Ralls
bbd2df6a3b Bug 791848 - GC 2.6.x does not handle ISO dates introduced with GC 2.7.
Set a feature to prevent versions older that 2.6.20 from loading a
database from which they cannot read the dates. Ideally we would do this
only if the database is written to, but the current persistence design
includes committing back to the database during the load so the net
effect is that the flag would be set anyway.
2017-12-26 15:18:43 -08:00
John Ralls
91727525b9 Enforce -Werror on C++ files and fix resulting errors. 2017-12-26 15:18:43 -08:00
John Ralls
a6a46d7cdc Test struct tm* returns from gnc_gmtime and gnc_localtime
To ensure that we don't crash for dereffing a nullptr.
2017-12-26 15:10:05 -08:00
John Ralls
a17bc85a02 Enable reading undelimited YYYYMMDDHHMMSS time strings.
For backwards compatibility with 2.4 and 2.6 SQLite3 databases.
2017-12-23 15:40:21 -08:00
Geert Janssens
2f96b19c77 Merge branch 'fix_bayes' of https://github.com/limitedAtonement/gnucash into unstable 2017-12-23 15:10:48 +01:00
John Ralls
19412de221 Fix use of guile function introduced in 2.0.10, not available in Ubuntu14.04.
Also generalize KVP type detection so that signed and unsigned values\nare appropriately converted.
2017-12-22 11:25:19 -08:00
John Ralls
e0300d3a62 Replace the gnc:numeric pair with normal Scheme rationals.
This allows direct conversion between Scheme numbers and gnc_numeric
without the performance or accuracy penalties arising from using doubles
as an intermediary.
2017-12-21 15:33:15 -08:00
John Ralls
7061803596 Remove SIGFIG rounding from price calculation.
Prices shouldn't be rounded except for display.
2017-12-21 15:33:15 -08:00
lmat
a80318ec5f Adding to version info to feature string 2017-12-21 13:19:01 -05:00
lmat
a23438d5fb Correct string cache code
string cache replace was incorrect and covered by gpointer casting.
2017-12-21 07:39:33 -05: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
fbf4843f31 Changed bayes import map design
This commit introduces a new feature flag:
GNC_FEATURE_GUID_FLAT_BAYESIAN. It signifies that the bayes import map
data are stored flat and by guid. Any time bayes import map data are
accessed, they are converted if necessary.
2017-12-21 07:39:33 -05:00