Commit Graph

16926 Commits

Author SHA1 Message Date
John Ralls
3b28d5ce5e Update CMakefile.txt for c->c++ change in backends. 2015-12-03 09:52:52 -08:00
Robert Fewell
0e7c7c3b42 Bug 706021 Add Other Account to CSV Transaction Import
This patch adds the option to specify the other account and memo
when doing a CSV import.
2015-12-02 14:23:24 +01:00
Rob Gowin
4ee5763075 Fix build issues
src/backend/sql/gnc-transaction-sql.cpp:
   Move inclusion of escape.h out of extern "C" block since
   escape.h is now C++ code.

src/backend/xml/gnc-backend-xml.cpp:
   Move inclusion of gnc-pref.s out of extern "C" block since
   gnc-pref.c is still plain C code.
2015-12-02 14:23:17 +01:00
John Ralls
b3cfef7084 Cast around unsigned-signed comparison warning.
From glibc when comparing snprintf() return value to a size_t.
2015-12-01 16:41:50 -08:00
John Ralls
29138bc793 Silence deprecation warnings.
Required because libdbi-0.9 emits them when using libdbi-0.8 API.
2015-12-01 16:40:31 -08:00
John Ralls
039a4336e2 Convert XML Backend to compile as C++. 2015-11-29 17:23:43 -08:00
John Ralls
0178492663 Convert SQL & DBI backends to compile as C++. 2015-11-29 17:23:43 -08:00
RobGowin
1c57e9c61d link gnc-gnome into gncmod-csv-exp 2015-11-23 15:25:43 -06:00
Mike Alexander
fc32f66404 Make indirect_balance_conversion work (and faster)
extract_common_prices was only looking at the first price on the "to" list
and there's no point in getting a to list if the from list is empty.
2015-11-11 22:49:57 -05:00
Mike Alexander
0637f65fa3 Add debugging function price_list_dump. 2015-11-11 22:49:50 -05:00
Mike Alexander
7c744d644b Fix the "lookuo ... any_currency" functions to work right.
They were broken in 3a0ec89c due to a lack of understanding about how
gnc_pricedb_foreach_price works.
2015-11-11 22:49:42 -05:00
Mike Alexander
ed776a73f0 Improve performance of price editor dialog.
Add new functions to get the number of prices and the get a price by
index for a given commodity.  Use these instead of building a list of all
prices several times for each price.
2015-11-11 22:49:25 -05:00
Robert Fewell
601abdf47d Bug 757532 [PATCH] Make start and end rows editable by keyboard 2015-11-10 21:29:58 +01:00
Mike Alexander
310be62ed3 Add some better comments. 2015-11-07 19:09:11 -05:00
Mike Alexander
7fcf6a1301 Make sure commodity-tz-quote-triple->price always returns a value.
Because of misplaced parens it was not returning a value if no price
for the same day was in the price DB.
2015-11-07 19:09:11 -05:00
John Ralls
fdc9a6a199 Replace Math128 with GncInt128, add GncRational to Doxygen docs. 2015-11-07 13:10:01 -08:00
John Ralls
089817a9f6 Templatize the GncInt128 constructors.
Allows single or pair of arbitrary integral types to construct, without
explicitly creating all of the possibilities.
2015-11-07 13:10:01 -08:00
Rob.Gowin
05f08f330d Clean up bitrot to get CuteCash building again.
1. Use guile-2.0 instead of guile-1.8.
2. Set GNC_PLATFORM_POSIX on Unix (for gnc_timezone.cpp).
3. Pass guile include files when compiling cutecash.
4. Link Boost libraries.
5. Add -std=gnu99 to CMAKE_C_FLAGS.
6. Temporarily put -O2 in CMAKE_C_FLAGS since Fedora requires
    optimization for FORTIFY_SOURCE.  (Eventually with CMake
    we will have separate Debug and Release builds.)

Tested that cutecash builds and launches on OS X, Fedora 23 and Ubuntu 14.04.3.
2015-11-07 15:01:05 -06:00
Robert Fewell
d711b64f10 Bug 754533 Change finish page text for Search and General Journal register exports
Additionally, correct an error with add_account_name function.
2015-11-04 20:50:02 +01:00
Mike Alexander
3a0ec89c06 Optimize pricedb so it works better with really big price lists.
Opening my accounts file took over 10 minutes before this change, most of
it spent populating the account balances in account tree, and most of that
spent in g_sort_list.  Expanding or collapsing subtrees in the account tree
also took several seconds.  This change reduces the use of g_sort_list and
reduces the length of lists sorted when it is used.  Opening the file is
now only a few seconds slower than before the PriceDB changes.
2015-11-03 18:09:55 -05:00
Mike Alexander
f2fa80bffb Update XCode project for C++ file name changes. 2015-11-03 18:09:43 -05:00
Mike Alexander
60ae86d178 Check for a duplicate price in add_price before adding it to the list instead of after. 2015-11-03 18:08:49 -05:00
Mike Alexander
c7f87f253b Don't leak the list returned by pricedb_get_prices_internal. 2015-11-03 17:46:12 -05:00
Robert Fewell
d0fee72900 Bug 706021 New CSV Import Account Mappings.
This patch allows the saving of account name mappings
so these can be reused in later imports.
2015-11-03 11:16:18 +01:00
Robert Fewell
1ef201c7d1 Bug 706021 Rename and Move Imap functions.
This patch renames the Imap functions in Account.c and
adds them to the .h file to make accessible. Also added
a delete function to the non Baysian functions along with
a test.
2015-11-03 11:16:17 +01:00
Geert Janssens
ad2c36e545 Fix compiler warning 2015-11-03 11:16:16 +01:00
Geert Janssens
e0ca934438 Set num_accounts upfront for ordinary register exports 2015-11-02 12:30:19 +01:00
Geert Janssens
f41a214956 Avoid code duplication 2015-11-02 12:29:35 +01:00
Geert Janssens
1a6fb37570 Rephrase some comments (to help an outsider to better understand what's happening) 2015-11-02 12:28:26 +01:00
Robert Fewell
50350c40a7 Bug 754533 Add CSV Register Export
Allow you to do a CSV export of the active Register View
2015-11-01 11:30:03 +01:00
John Ralls
f82717496a Merge branch 'big-prices' 2015-10-29 15:37:18 -07:00
John Ralls
e391cce1af Replace unnecessary indirection in calling gnc_pricedb_convert_balance... 2015-10-29 15:35:35 -07:00
John Ralls
8877f862d3 Replace tortured attempt to implement indirect amount-value conversion. 2015-10-29 15:01:26 -07:00
John Ralls
7adc5e4451 Handle reversed prices from gnc_pricedb_lookup*.
In several cases replaces attempting to check both directions directly. This
had produced incorrect results because an older forward price would be preferred
over a reverse price.
2015-10-29 14:13:37 -07:00
John Ralls
edefc9e57c Provide new function gnc_price_invert.
To invert a price when it's currency is what we want to use as a commodity.
Generalizes the source-type PRICE_SOURCE_INVOICE to PRICE_SOURCE_TEMPORARY
for all cases like this where we don't want to save the price.
2015-10-27 17:30:23 -07:00
John Ralls
62c7693860 Rewrite GNCPriceDB queries to check for prices in both directions.
Currency exchange rates can be recorded in either direction depending upon
which one provides the larger fraction. Queries therefore need to check
both directions when creating the date-ordered list for selecting latest,
nearest in time, or latest before.
2015-10-27 17:30:23 -07:00
John Ralls
dde310bf71 Tests for GNCPriceDB. They fail until the next commit. 2015-10-27 17:30:23 -07:00
John Ralls
6525db7639 Doxygenate GncPriceDB and document explicitly which functions are bidirectional.
Meaning which functions check prices in both commodities for the rate
with the other.
2015-10-27 17:30:23 -07:00
John Ralls
4644f28403 Remove the preference for storing prices relative to the base currency.
It interferes with the preference for storing the price in the direction
in which the price is >1 for preserving sigfigs.
2015-10-27 17:30:23 -07:00
John Ralls
8d856843c3 Recognize and handle reversed price quotes from gnc-fq-helper.
Gnc-fq-helper will flip currency price quotes if the one requested is < 1
or not available, which might mean that it's not representable in 4 digits
to the right of the decimal.
2015-10-27 17:30:23 -07:00
John Ralls
ac09496c73 Invert the F::Q price if there's already one in the other direction.
We don't want to create prices in both directions on the same day.
2015-10-27 17:30:22 -07:00
John Ralls
923b01e269 Handle currencies with one-directional quotes and quotes < 1 in F::Q.
Some currencies quotes are one-directional, so check both directions if
necessary. Quotes with values < 1 often have too few significant digits,
so in that case use the other direction if available.
2015-10-27 17:30:22 -07:00
John Ralls
ac34d316a5 Merge branch 'maint' 2015-10-27 17:28:45 -07:00
John Ralls
ce838d3cfc Rename GNOME_COMPILE_WARNINGS to just COMPILE_WARNINGS.
Poaching someone else's macro name is a really dumb idea, because aclocal
looks in our macros directory only if it can't find the macro in the system
directories. Our config code doesn't work with Gnome's macro, it exports
WARN_CFLAGS rather than modifying CFLAGS directly the way ours does.
2015-10-27 17:25:48 -07:00
John Ralls
f3de156e65 Revert "Use gnc_pricedb_has_prices instead of testing the return value of get_prices."
This reverts commit ae35dbb464.
because the return value was actually used later on.
2015-10-27 14:08:59 -07:00
John Ralls
5537a7ed35 Implement gnc_numeric_invert via GncRational::invert. 2015-10-24 15:58:16 -07:00
John Ralls
50e3bf21db Merge branch 'maint' 2015-10-24 14:55:56 -07:00
John Ralls
f5cf2ba542 Merge branch 'single-price' into maint 2015-10-24 14:52:49 -07:00
John Ralls
362b9e3d7c Fix leaking QofBook in most of the engine unit tests.
The problem is that QofBook is not a well-formed GObject and doesn't clean
itself up properly when its ref count goes to zero. qof_book_destroy() must
be explicitly called on it. An interesting side effect is that QofObject
keeps a list of all of the books ever opened and not properly destroyed and
registering a class (in this case GNCPriceDB) tries to create that class's
instance in all of those leaked books. Since they already have one, the
instantiation code raises a critical error and the test program fails.
2015-10-24 14:15:23 -07:00
John Ralls
ae35dbb464 Use gnc_pricedb_has_prices instead of testing the return value of get_prices. 2015-10-24 13:24:13 -07:00