Skip to content

Commit

Permalink
Bug 798864 - Budget Reporting on select reports are wrong
Browse files Browse the repository at this point in the history
net-income must add income and expense accounts. recalculate the
net-income from budget amounts, instead of calculating from
revenue-total and expense-total which were negated for presentation.

this fixes a test which was testing incorrect amounts
  • Loading branch information
christopherlam committed Apr 17, 2023
1 parent b1cf200 commit bff78f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion gnucash/report/reports/standard/budget-income-statement.scm
Expand Up @@ -428,7 +428,11 @@
(gnc:get-assoc-account-balances-total expense-account-balances))

(net-income
(gnc:collector- revenue-total expense-total))
(gnc:collector-
(gnc:get-assoc-account-balances-total
(get-assoc-account-balances-budget
budget (append revenue-accounts expense-accounts)
period-start period-end gnc:budget-account-get-net))))

(table-env
(list
Expand Down
2 changes: 1 addition & 1 deletion gnucash/report/reports/standard/test/test-budget.scm
Expand Up @@ -179,7 +179,7 @@
sxml))

(test-equal "net loss for budget"
'("Net loss for Budget test budget" "$285.00")
'("Net income for Budget test budget" "$105.00")
((sxpath '(// table // (tr 2) // table // (tr 5) // *text*))
sxml)))))

Expand Down

0 comments on commit bff78f6

Please sign in to comment.