Commit Graph

16597 Commits

Author SHA1 Message Date
Alex Aycinena
5fdf14f8cb Book-Currency Feature Step 3
Add an option to the File->Properties dialog to select a Currency Accounting Method, and to specify the book-currency and a default gains/loss policy if the 'book-currency' method is selected.
Revert some changes made in prior commits. Other than storing and retrieving the
book-currency and policy in book KVPs, the behavior of gnucash has not been
affected by these changes. The changes made are:

     engine/policy.c & .h - define valid policies and their descriptions
         and hints; define functions gnc_get_valid_policy_list and
         gnc_valid_policy
     engine/engine.i - include policy.h; define 'CURRENCY-ACCOUNTING',
         'BOOK-CURRENCY', and 'DEFAULT-GAINS-POLICY' as option names
     engine/test/utest-Split.cpp - revert prior commit that modified test
         function for trading accounts
     engine/test/utest-Transaction.c - revert prior commit that modified test
         function for trading accounts
     libqof/qof/qofbookslots.h - revert prior commit that defined Currency
         Accounting Method; modify definitions of Currency Accounting and Book
         Currency; add definition of default gains policy; keep the previous
         Trading Accounts definition
     libqof/qof/qofbook.cpp & .h - reverted function to determine currency
         accounting method; add function to get book-currency, revert
         previously committed changes to function to determine if book uses
         trading accounts; add function to get gains policy; modify gobject
         properties accordingly
     libqof/qof/test/test-qofbook.c - revert prior modification to test
         function for trading accounts; define tests for book-currency and
         default gains policies
     app-utils/options.scm - define make-currency-accounting-option and
         required support functions
     app-utils/options-util.c & .h - make support functions of
         make-currency-accounting-option available in c code
     app-utils/test/test-options-util.c - include tests for using book-currency
     app-utils/gnc-ui-util.c & .h - define gnc_book_use_book_currency,
         gnc_book_get_book_currency and gnc_book_get_default_gains_policy
         functions
     app-utils/test/test-gnc-ui-util.c - set up tests for new gnc-ui-util
         functions
     app-utils/test/test-app-utils.c - include test-gnc-ui-util.c
     app-utils/test/Makefile.am - include test-gnc-ui-util.c
     app-utils/app-utils.scm - define and export book options for Currency
         Accounting, Book-Currency and Default Gains Policy; export required
         currency-accounting-option support functions
     app-utils/business-prefs.scm - replace the Trading Accounts boolean option
         with a currency-accounting-option and rearrange the order of the
         options
     gnome-utils/dialog-options.c - define functions for set-ui-widget,
         set-ui-value, and get-ui-value for 'currency-accounting' option and
         various other support functions
2015-06-27 16:06:56 -07:00
John Ralls
06d5d0a20a Change the Glib version test for C-standard to a compile check.
The actual problem occurred in only a couple of Glib releases before
being reverted.
2015-06-18 15:02:30 -07:00
John Ralls
9343ebe9e4 Merge branch 'maint' 2015-06-09 14:51:21 -07:00
John Ralls
9914a046d7 src/app-utils/gfec.a requires _XOPEN_EXTENDED, defined by -std=gnu99. 2015-06-07 11:59:05 -07:00
Mike Evans
240e36f73b Bug 734183 - Set value to zero before calling gnc_exp_parser_parse. 2015-06-02 10:33:35 +01:00
John Ralls
fefec86f64 Remove stray quote that ate all the CFLAGS. 2015-05-31 17:45:07 -07:00
Geert Janssens
f160937681 Bug 746163 - Custom register colors (table rows) not recognized from .gtkrc-2.0.gnucash file
Change the preference label and description to avoid confusion.
Translators: this patch introduces two updated strings.
2015-05-31 10:08:03 +02:00
Joe Hansen
073c7a69ad Updated Danish translation
Copied from the translation project
2015-05-29 22:46:57 +02:00
John Ralls
80034b39bc Refine forcing C11 to handle case where AC_PROG_CC_C99 doesn't set -std= 2015-05-25 11:06:50 -07:00
John Ralls
b9de55c871 Change gtkmacintegration-gtk2 include directory back to gtkmacintegration.
As of gtk-mac-integration-2.0.8.
2015-05-24 18:05:04 -07:00
John Ralls
54bf84af0e Force -std=c11 when compiling against GLib-2.44 or greater.
Required for new G_DECLARE_INTERFACE macro.
2015-05-24 18:02:24 -07:00
John Ralls
8232927204 Fix compile failures on latest version of MinGW. 2015-05-22 20:59:06 -07:00
John Ralls
847e2c2717 Ensure BOOST_CPPFLAGS are included for boost test.
Necessary on Windows due to non-standard installation paths for dependencies.
2015-05-22 13:26:38 -07:00
Geert Janssens
79139c8869 Fix hidden panes in lot viewer 2015-05-16 10:44:59 +02:00
John Ralls
8a77e139ce Better check for C++11 compile error in custom_time_zone.hpp
It turns out that F20's boost-1.53 already has this fixed, so set the
boost version to 1.53 and test for the actual problem.
2015-05-11 16:55:15 -07:00
John Ralls
d0fc57a5a7 Change minimum boost version to 1.55
There was a C++11 compilation bust in
date_time/local_time/custom_time_zone.hpp, which was fixed in that
version. Since we also require C++11, that makes it the minimum
necessary.
2015-05-11 12:32:24 -07:00
John Ralls
e68c7eb959 Fix narrowing error with 32-bit time_t. 2015-05-10 16:52:35 -07:00
John Ralls
03d2ff1d44 Fix errant deletion of -I. 2015-05-08 15:24:20 -07:00
Geert Janssens
5a4a8ac5d6 Bug 746873 - Gnucash asks sql passwords before wallet password
Work around a bug in libsecret. Under certain conditions
libsecret will silently fail to find a password even though
it is stored. The workaround uses another interface call
to force unlocking the secret store which works around the bug.
This workaround should be removed once a fix for
https://bugzilla.gnome.org/show_bug.cgi?id=748625
will be commonly available.
2015-05-08 21:44:00 +02:00
Geert Janssens
f604348d9b Bug 746873 - Gnucash asks sql passwords before wallet password
If libsecret is available use it to search for both
libsecret based passwords as gnome-keyring based ones.
This catches the situation where a password was stored
earlier using gnome-keyring, while the user is now trying
to retrieve it on a system that only has libsecret available.
This used to fail because gnucash depended on gnome-keyring
to be present in that situation.
2015-05-08 21:29:34 +02:00
Mike Alexander
0017aa6edc Support version 3 tzfile format which is almost the same as version 2.
See ftp://ftp.iana.org/tz/code/tzfile.5.txt.
2015-05-07 03:15:28 -04:00
Mike Alexander
541c779a13 Use the correct size for time offsets when parsing a tzfile.
A version 1 tzfile alwasy has 4 byte offsets and a version 2 has
8 byte offsets in the second half of the file.
2015-05-07 03:15:21 -04:00
John Ralls
d4c537a9a5 Merge branch 'boost-date'
Fix a couple more bugs which manifest on Fedora.
2015-05-04 15:54:45 -07:00
John Ralls
577aa3fe02 Catch out-of-range exception at beginning and end of TZFile on Fedora. 2015-05-04 15:54:07 -07:00
John Ralls
0b55c746c8 Link libgtest to test-kvp-value on Fedora. 2015-05-04 15:54:07 -07:00
John Ralls
42cca36445 Merge branch 'boost-date'
Some fixes plus GncDate::format().
2015-05-04 15:06:54 -07:00
John Ralls
90f0d9952c Set gmock_root to gmock_src_path if the latter is detected.
Otherwise configure thinks gmock isn't installed.
2015-05-04 15:05:53 -07:00
John Ralls
725622f613 Ensure we compile C for at least C99. 2015-05-04 15:05:53 -07:00
John Ralls
ccbfeb3799 Reimplement qof_date print functions with GncDate::format() 2015-05-04 15:05:52 -07:00
John Ralls
269bb510fb Implement GncDate::format()
Analog of GncDateTime::format().
2015-05-04 15:05:52 -07:00
John Ralls
2b84dfae8d Remove some noisy comments.
That duplicate the Doxygen comments in the header.
2015-05-04 15:05:52 -07:00
John Ralls
e1e4391b03 Remove unused gnc_timezone function. 2015-05-04 15:05:52 -07:00
John Ralls
f4451ff57d Remove gnc_gdate_range_check.
Since GncDate and GncDateTime will have the same limits it's not
necessary.
2015-05-04 15:05:52 -07:00
Benjamin Melançon
7c42908b13 Update README to refer to Git rather than SVN 2015-05-03 16:13:20 -07:00
John Ralls
9ea1dd0fac Merge branch 'boost-date'
First merge, which replaces GDateTime with GncDateTime. GncDateTime is
implemented as a PImpl to a wrapper class for boost::date_time. A skeleton
implementation of GncDate is included. More work on that will go into the
next merge.
2015-05-02 17:40:33 -07:00
John Ralls
280589a33e Adjust some tests for 64-bit.
The libc time functions are apparently not too smart about applying
timezones to date-times, using the current TZ info rather than the
one that applies to the date.

Formatting is a bit variable as well when localization is applied,
so test with the locale format when appropriate.
2015-05-02 17:39:05 -07:00
John Ralls
25be764cb0 Replace boost::posix_date::from_time_t().
It silently converts a 64-bit time_t to 32-bits.
2015-05-02 17:39:05 -07:00
John Ralls
b215d62925 Replace 'using make_week_num' with a macro; gcc-4.8 can't do that kind of alias. 2015-04-30 16:09:40 -07:00
John Ralls
9fafb61283 Restore #include strptime.h, needed on MinGW. 2015-04-30 16:08:24 -07:00
John Ralls
48a5473bbb Add BOOST_LDFLAGS so that libboost_date_time can be found in MinGW. 2015-04-30 16:06:28 -07:00
John Ralls
9fbc447f74 Some gcc don't like having a struct ymd and a ymd() member function. 2015-04-30 12:23:25 -07:00
John Ralls
f87f9ca02d gnc_date_today from GncDate. 2015-04-28 17:54:05 -07:00
John Ralls
bcedeff3ba Fix the string constructor to apply the timezone correctly. 2015-04-28 17:53:35 -07:00
John Ralls
ac515d6ce2 Stop testing fractional seconds.
We don't use them in real code, so the new implementation isn't going to
support them.
2015-04-28 17:52:56 -07:00
John Ralls
a8028ec7f2 Remove aliases and boost::date_time construction functions from gnc-date. 2015-04-28 17:05:35 -07:00
John Ralls
f46e9f023c Print functions to GncDateTime. 2015-04-28 17:04:09 -07:00
John Ralls
db6b7d368e gnc_time to GncDateTime. 2015-04-28 17:03:20 -07:00
John Ralls
671a6ac75e Remove extraneous try block. 2015-04-28 16:44:59 -07:00
John Ralls
d2f80a9407 gnc_mktime and gnc_timegm with GncDateTime. 2015-04-28 16:28:51 -07:00
John Ralls
2dde36d015 Do locality and gmtime with GncDateTime. 2015-04-28 15:22:15 -07:00