Bug 775368 - "Average cost" price source problem

This series of changes modifies the Average Cost report function to
finding the average amount-weighted price of all transactions recording
a "buy" of the report commodity so that the correct amount is now
reported without the need of a capital gains split--though one is still
needed to get the Trial Balance report to balance.

Since book-wide averages are not what most users expect, it also changes
the default pricing option on all reports to "Nearest in Time", which is
what most confused users have selected after asking about it in the
mailing lists. This also fixes
Bug 340991 - Default price source for reports not good.
This commit is contained in:
John Ralls 2016-12-09 10:34:02 -08:00
commit 7b7c780a36
11 changed files with 627 additions and 690 deletions

File diff suppressed because it is too large Load Diff

View File

@ -104,7 +104,7 @@ balance at a given time"))
(gnc:options-add-price-source!
options gnc:pagename-general
optname-price-source "c" 'average-cost)
optname-price-source "c" 'pricedb-nearest)
(if do-intervals?
(add-option

View File

@ -189,7 +189,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -205,7 +205,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -168,7 +168,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -222,7 +222,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -90,7 +90,7 @@
;; optname-from-date optname-to-date "a")
(gnc:options-add-price-source!
options gnc:pagename-general optname-price-source "c" 'average-cost)
options gnc:pagename-general optname-price-source "c" 'pricedb-nearest)
;;(gnc:register-option
;; options

View File

@ -142,7 +142,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -185,7 +185,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -171,7 +171,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option

View File

@ -221,7 +221,7 @@
(gnc:options-add-price-source!
options pagename-commodities
optname-price-source "b" 'average-cost)
optname-price-source "b" 'pricedb-nearest)
(add-option
(gnc:make-simple-boolean-option