Commit Graph
16231 Commits
Author SHA1 Message Date
John Ralls 7db7e0cf7a 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-09-15 12:06:29 -07:00
John Ralls 7d8b51e8db Use an enum for internal representation of Price Sources.
Strings are still used for storage and display.
Purpose is to make multiple comparisons and conditional setting more
convenient.
2015-09-15 12:06:29 -07:00
John Ralls d52a0b602c Fix whitespace error. 2015-09-15 12:06:28 -07:00
John Ralls d4968d3bb4 Extract function lookup_price in dialog_transfer.c 2015-09-15 12:06:28 -07:00
John Ralls 157c7e30a5 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-09-15 12:06:28 -07:00
John Ralls 890cfe2186 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-09-15 12:06:28 -07:00
John Ralls 96471379f0 Adjust split_register to match transfer dialog checking inverted prices. 2015-09-15 12:06:28 -07:00
John Ralls d7fb92d03f Fix missing initialization of price_value. 2015-09-15 12:06:28 -07:00
John Ralls 93bb5c0fdd Change CURRENCY_DENOM to 10000, matching what F::Q returns. 2015-09-15 12:06:28 -07:00
John Ralls ffe96b3044 Extract function round_price(), consistently apply it. 2015-09-15 12:06:28 -07:00
John Ralls bfbb508799 Fix swap_amount so that it swaps the account pointers. 2015-09-15 12:06:28 -07:00
John Ralls 86320a4d11 Fix gnc_numeric_invert to correctly handle negative values. 2015-09-15 12:06:28 -07:00
John Ralls c068397633 Flip return values of check_edit() and check_accounts().
It's easier to understand if they return FALSE on fail.
2015-09-15 12:06:28 -07:00
John Ralls e12c89b5ca Move gnc_numeric_invert to be not-inline.
The inline version crashed.
2015-09-15 12:06:27 -07:00
John Ralls 6b5207785a Create a rounding policy for prices in the pricedb.
Currency-currency prices will be priced in the smaller currency so that
the price > 1 and will be rounded to 3 digits after the decimal.
Commodity-currency prices will be priced in the currency and rounded to
the currency's scu * 10000.
This affects only prices stored in the pricedb. Prices in splits will
continue to be computed from value/amount.
2015-09-15 12:06:27 -07:00
John Ralls c7c97be684 Rename _gnc_xfer_dialog_set_exchange_rate and use it consistently.
_gnc_xfer_dialog_set_price_edit says what we're actually setting.
2015-09-15 12:06:27 -07:00
John Ralls 73233a5e2e Provide gnc_numeric_invert() convenience function.
Clearer and faster than dividing into 1/1.
2015-09-15 12:06:27 -07:00
John Ralls 3a51c0d5c1 Use price_value when referring to a gnc_numeric.
Price and prc are for gnc_price*.
For clarity.
2015-09-15 12:06:27 -07:00
John Ralls 06f70bad61 Price-quotes: Modify quotes on same day instead of creating new ones.
We can use only one per day so no point in keeping a bunch of them.
Finance::Quote prices always overwrite user prices.
2015-09-15 12:06:27 -07:00
John Ralls ea48ed882b Edit split-based prices instead of adding.
For split-register and xfer-dialog generated prices if there's an existing
non-FQ price for the day, change it. If there's an F::Q quote for the day,
do nothing. Only add a price if there isn't one for the from/to
combination.
2015-09-15 12:06:27 -07:00
John Ralls 0b03328143 Check for an existing price before adding one in split_reg.
To make the behavior the same as in xfer_dialog.
2015-09-15 12:06:27 -07:00
John Ralls c6a67f4eac In the transfer dialog use the price_edit value for the saved price.
Instead of computing it separately and differently from to_amt and from_amt.
2015-09-15 12:06:27 -07:00
John Ralls 407d61cbb6 Fix up whitespace in dialog-transfer.c. 2015-09-15 12:06:27 -07:00
John Ralls 47f91c0227 Refactor gnc_xfer_dialog_response_cb with several extract-functions. 2015-09-15 12:06:27 -07:00
John Ralls e1b4e45de5 Don't store prices of source invoice.
They're intended to be temporary, for creating splits. They're also already
stored from the transfer dialog.
2015-09-15 12:06:27 -07:00
John Ralls 9a611a2aca Replace the price source and type strings with defines. 2015-09-15 12:06:26 -07:00
John Ralls e921de8b6f Correct the Stock, Bond, Market Index, and Mutual Fund account types.
STOCK and MUTUAL are not compatible with currency.
2015-09-15 12:05:23 -07:00
John Ralls 44d4365046 Bug 754617 - Gnucash should use PKG_PROG_PKG_CONFIG
Actually we already do, making this fragment unnecessary. What's more
Ximian Desktop is long gone so the work-around is redundant as well.
2015-09-12 18:01:36 -07:00
Geert Janssens 10d81d653b Small doxigen improvements to previous commit 2015-09-09 14:03:54 +02:00
Matt de3ca9d7d8 Bug754764Fix
Adds Doxygen Comments to file 'gnc-budget-view.c'.
2015-09-09 12:27:46 +02:00
yomlogs eed42580f4 Bug 724738 - Value in "Display Symbol" field not saved
Updated gnc_ui_commodity_dialog_to_object() to call
gnc_commodity_set_user_symbol() for non-currency commodities.

https://bugzilla.gnome.org/show_bug.cgi?id=724738
2015-08-27 16:09:27 +02:00
Alex Aycinena 18073f6163 Remove e-mail form AUTHORS and DOCUMENTERS 2015-08-19 11:13:22 -07:00
John Ralls 8b66590631 Sort the source list from gnc-fq-check. 2015-08-17 10:12:22 +01:00
Alex Aycinena e47cc8ff13 Correct wording on AUTHORS and DOCUMENTERS 2015-08-10 12:01:01 -07:00
Mike Alexander 054e6f7a22 Avoid passing invalid arguments to functions to get rid of some non-fatal asserts. 2015-08-10 03:16:45 -04:00
John Ralls 05fdefa306 Add note at the top to disuade users from contacting authors directly for support. 2015-08-10 07:58:55 +01:00
John Ralls 20242c5a3d Put the quotes back around the date string in gnc-fq-helper. 2015-08-02 08:38:12 -07:00
John Ralls 18196171ad Bug 753146 - free(): invalid pointer on duplicate transaction
when Use Split Action Field for Number is set.
2015-08-01 16:26:53 -07:00
Mechtilde b41c86da31 More new German translation 2015-08-01 12:24:01 -07:00
Mechtilde 9d16d969ea New German translations - after sending the others to Frank 2015-08-01 12:24:00 -07:00
Mechtilde 373b1e8b4e some more German translations 2015-08-01 12:24:00 -07:00
Mechtilde 226b1b29f1 even more German translation 2015-08-01 12:24:00 -07:00
Mechtilde 2a775024a3 added more German translation 2015-08-01 12:24:00 -07:00
Mechtilde 1bf8326f54 add translation for reports 2015-08-01 12:24:00 -07:00
John Ralls 567f61fe3c Add make_testfile suggestion to test-templates README. 2015-07-30 09:56:37 -07:00
Mike Evans 9333344ee0 Fix apparent typo preventing build. 2015-07-30 13:01:02 +01:00
John Ralls a4b0519303 Fix up and improve the Doxygen documentation in unittest-support.h. 2015-07-28 12:44:25 -07:00
John Ralls 2663dc96e2 Improve the test-templates README and update the templates to current practice. 2015-07-28 11:45:34 -07:00
Geert Janssens 124a2479ef Bug 752035 - Transaction Report Filter By not Always Working
Make sure the internal split function get_corr_account_split
behaves consistently on multi-split transactions. The transaction
report depends on this.

Add test case to catch potential regressions

Simplify filter test function in transaction report.
2015-07-28 17:13:06 +02:00
John Ralls 3ccaec6e38 Make backend sync errors survive to the session.
The backends were using qof_backend_get_error() to test for sync errors.
This function clears the error, so the tests resulted in the error being
cleared before the session could see it and so it thought that the sync
had succeeded.

Replace those uses of qof_backend_get_error() with a new function
qof_backend_check_error() that doesn't clear the error.
2015-07-27 16:04:38 -07:00