mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-05-07 Christian Stimming <stimming@tuhh.de>
* src/scm/commodity-utilities.scm: Always use the absolute value when building a weighted average. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4127 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2001-05-07 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/scm/commodity-utilities.scm: Always use the absolute value
|
||||
when building a weighted average.
|
||||
|
||||
2001-05-06 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/scm/report/price-scatter.scm: add options for marker shape
|
||||
|
||||
@@ -220,8 +220,11 @@
|
||||
(gnc:split-get-parent a)))
|
||||
(account-comm (gnc:account-get-commodity
|
||||
(gnc:split-get-account a)))
|
||||
(share-amount (gnc:split-get-share-amount a))
|
||||
(value-amount (gnc:split-get-value a))
|
||||
;; Always use the absolute value here.
|
||||
(share-amount (gnc:numeric-abs
|
||||
(gnc:split-get-share-amount a)))
|
||||
(value-amount (gnc:numeric-abs
|
||||
(gnc:split-get-value a)))
|
||||
(tmp (assoc transaction-comm sumlist))
|
||||
(comm-list (if (not tmp)
|
||||
(assoc account-comm sumlist)
|
||||
@@ -240,16 +243,14 @@
|
||||
(set! sumlist (cons comm-list sumlist)))
|
||||
;; yes, check for second commodity.
|
||||
(let*
|
||||
;; Put the amounts in the right place.
|
||||
((foreignlist
|
||||
;; this will adjust the signs appropriately
|
||||
(if (gnc:commodity-equiv? transaction-comm
|
||||
(car comm-list))
|
||||
(list account-comm
|
||||
(gnc:numeric-neg share-amount)
|
||||
(gnc:numeric-neg value-amount))
|
||||
share-amount value-amount)
|
||||
(list transaction-comm
|
||||
value-amount
|
||||
share-amount)))
|
||||
value-amount share-amount)))
|
||||
;; second commodity already existing in comm-list?
|
||||
(pair (assoc (car foreignlist) (cadr comm-list))))
|
||||
;; if not, create a new entry in comm-list.
|
||||
|
||||
Reference in New Issue
Block a user