Bug #347274: Fix r17675 to calculate correct differences

In the patch committed in r17675 the proposed calculation of differences
was wrong for income and liabilities. This patch should fix this issue.
When back-porting, please make sure to apply this one too.

Patch by C.Ernst.
BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17678 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2008-11-02 20:51:12 +00:00
parent a9a95bb9d4
commit 187d04a3d3

View File

@ -144,6 +144,7 @@
(while (< period num-periods)
(let* (
(comm (xaccAccountGetCommodity acct))
(reverse-balance? (gnc-reverse-balance acct))
;; budgeted amount
(bgt-unset? (not (gnc-budget-is-account-period-value-set
@ -154,8 +155,11 @@
(gnc:make-gnc-monetary comm bgt-numeric-val)))
;; actual amount
(act-numeric-val (gnc-budget-get-account-period-actual-value
(act-numeric-abs (gnc-budget-get-account-period-actual-value
budget acct period))
(act-numeric-val (if reverse-balance?
(gnc-numeric-neg act-numeric-abs)
act-numeric-abs))
(act-val (gnc:make-gnc-monetary comm act-numeric-val))
;; difference (budget to actual)
@ -164,13 +168,8 @@
(bitwise-ior GNC-DENOM-LCD GNC-RND-NEVER)))
(dif-val (if bgt-unset? "."
(gnc:make-gnc-monetary comm dif-numeric-val)))
(reverse-balance? (gnc-reverse-balance acct))
)
(cond (reverse-balance? (set! act-val
(gnc:monetary-neg act-val))))
(if show-budget?
(begin
(gnc:html-table-set-cell!