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
John Ralls
dfc0b28bed
Remove be->price_lookup conditional clauses.
...
No backend implements price_lookup, and the struct member is removed from
master. Even if it had existed these clauses wouldn't actually do anything.
2015-10-24 13:24:13 -07:00
John Ralls
4bfe29aca3
Prevent F::Q from updating PRICE_SOURCE_EDIT_DLG prices.
2015-10-24 13:24:12 -07:00
John Ralls
9a53cc8f58
Remove unnecessary and harmful price rounding.
2015-10-24 13:24:10 -07:00
John Ralls
7298a46999
Implement user-entered-price preference.
...
Add user:price as a source and prefer values with lower PriceSource enum
values over higher ones: In other words a price with a lower PriceSource
value (e.g. user:price-editor) will overwrite one with a higher value (e.g.
user:split-register) and not the other way around.
2015-10-24 13:22:51 -07:00
John Ralls
811a30db4a
Fold separate call of gnc_pricedb_lookup_latest() into lookup_price.
...
Requires a 3-state enum instead of a boolean for the second arg to lookup_price.
2015-10-24 13:22:46 -07:00
John Ralls
70493537e9
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-10-24 13:20:29 -07:00
John Ralls
ab15ca8f84
Extract function lookup_price in dialog_transfer.c
2015-10-24 13:20:28 -07:00
John Ralls
76c1259f1b
Adjust split_register to match transfer dialog checking inverted prices.
2015-10-24 13:20:28 -07:00
John Ralls
348fe45b76
Fix missing initialization of price_value.
2015-10-24 13:20:28 -07:00
John Ralls
a40bc92d34
Change CURRENCY_DENOM to 10000, matching what F::Q returns.
2015-10-24 13:20:27 -07:00
John Ralls
6e14137710
Extract function round_price(), consistently apply it.
2015-10-24 13:20:23 -07:00
John Ralls
f30b38b5c3
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-10-24 13:19:05 -07:00
John Ralls
a8d4eaae5e
Rename _gnc_xfer_dialog_set_exchange_rate and use it consistently.
...
gnc_xfer_dialog_set_price_edit says what we're actually setting.
2015-10-24 13:18:39 -07:00
John Ralls
f79a3af4a2
Provide gnc_numeric_invert() convenience function.
...
Clearer and faster than dividing into 1/1.
2015-10-24 13:15:05 -07:00
John Ralls
be5b9f2b84
Use price_value when referring to a gnc_numeric.
...
Price and prc are for gnc_price*.
For clarity.
2015-10-24 13:15:05 -07:00
John Ralls
9c2813acb6
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-10-24 13:15:04 -07:00
John Ralls
966789374d
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-10-24 13:15:04 -07:00
John Ralls
5e609dac0d
Check for an existing price before adding one in split_reg.
...
To make the behavior the same as in xfer_dialog.
2015-10-24 13:15:04 -07:00
John Ralls
c4082524cb
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-10-24 13:15:04 -07:00
John Ralls
ca447fc047
Fix up whitespace in dialog-transfer.c.
2015-10-24 13:14:49 -07:00
John Ralls
85148cd23b
Refactor gnc_xfer_dialog_response_cb with several extract-functions.
2015-10-24 13:12:39 -07:00
John Ralls
e94622c9e3
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-10-24 13:12:38 -07:00
John Ralls
ab535fb100
Replace the price source and type strings with defines.
2015-10-24 13:12:38 -07:00
John Ralls
e3da1c4247
Revert "Merge branch 'single-price' into maint"
...
This reverts commit bc9285bbfb
, reversing
changes made to e921de8b6f
.
Final step of reverting the single-price changes.
2015-10-23 12:11:51 -07:00
John Ralls
b723578c82
Revert "Fix rename failure for gnc_xfer_dialog_set_exchange_rate."
...
This reverts commit 766cf48f45
, and
is step 3 of reverting the single-price changes from maint.
2015-10-23 11:49:11 -07:00
John Ralls
39d43a31fa
Revert "Fix price-reading crash if the price needs to be inverted."
...
This reverts commit 027080a830
,
and is step 2 in reverting the single-price changes.
2015-10-23 11:44:57 -07:00
John Ralls
9fc0c4667c
Revert "Bug 756339 - Prices table not updated"
...
This reverts commit 0baf078b6f
,
and is step 1 in reverting out the single-price changes and
moving them to master.
2015-10-23 11:43:03 -07:00
John Ralls
9d43a616e1
Fix typo.
2015-10-16 10:28:41 -07:00
John Ralls
9ac2bb8158
Add Business Ledger to Doxygen docs.
2015-10-15 15:58:04 -07:00
John Ralls
eac8aa3491
Document the Register Core CellBlock class.
2015-10-15 15:58:04 -07:00
John Ralls
af45de8a21
Create a new Register2 group in Register and add the Reg2-specific files to it.
...
To provide an easy way to identify the Register2 files.
2015-10-15 15:58:04 -07:00
John Ralls
aacef38d89
Correct UK VAT Account types.
...
VAT accounts are suspense accounts for money owed by or to HMRC, not expenses.
2015-10-13 21:57:03 -07:00
John Ralls
0e229ec48c
Add messages.mo to gitignore.
2015-10-13 17:18:12 -07:00
John Ralls
afad45ea3c
Add all register classes and such to Doxygen documentation.
...
Ensuring that the relevant information from src/doc/design is included.
2015-10-13 17:17:24 -07:00
John Ralls
f94522a567
Doxygen: Silence obsolete parameter warnings and suppress private struct names.
2015-10-13 17:14:51 -07:00
John Ralls
61973a8302
Some extract-function refactors to xaccTransScrubImbalance.
2015-10-11 21:49:53 -07:00
John Ralls
734ecce36d
Delete unused function gnc-_split_reg_handle_exchange_cb.
2015-10-11 15:15:07 -07:00
John Ralls
0baf078b6f
Bug 756339 - Prices table not updated
2015-10-11 09:52:26 -07:00
John Ralls
5c496328d4
Bug 756335 - When importing, date selection causes exit crash
2015-10-10 19:31:45 -07:00
Geert Janssens
fb67e1f265
Bug 646129 - Account selection in reports: 'Select Children' doesn't actually select children if they are collapsed
2015-10-10 16:20:13 +02:00
Stefan Soeffing
58f34f75e1
Bug 627692 - Report options, Account Selection, "select all" => not all accounts selected, only visible ones
...
Expand all accounts first, so that all accounts are visible and get selected.
https://bugzilla.gnome.org/show_bug.cgi?id=627692
2015-10-10 16:19:44 +02:00
Geert Janssens
4ed4aa4b70
Revert "- Report options, Account Selection, "select all" => not all accounts selected, only visible ones"
...
This reverts commit e69689faa2
.
Reversion reason: The bug number got lost somewhere
2015-10-10 16:19:20 +02:00
Stefan Soeffing
e69689faa2
- Report options, Account Selection, "select all" => not all accounts selected, only visible ones
...
Expand all accounts first, so that all accounts are visible and get selected.
https://bugzilla.gnome.org/show_bug.cgi?id=627692
2015-10-10 15:11:25 +02:00
John Ralls
8d9c0d6696
Bug 755781 - Files with copyright but no grant of license.
...
Fix some license mismatches.
2015-10-09 10:56:17 -07:00
Robert Fewell
557ec68667
Bug 754533 No Account Templates Error Patch
...
Add test for zero account list to stop warnings.
2015-10-09 12:01:07 +02:00
John Ralls
42415056d0
Release 2.6.9
2015-10-05 12:57:12 -07:00
John Ralls
027080a830
Fix price-reading crash if the price needs to be inverted.
2015-10-05 12:57:12 -07:00