Bug #622778 Miscalculation in cashflow reports - Step 02

- functional change within the cash flow calculation:
Instead of using a recursive call to (define (calc-money-in-out-internal ...))
to loop through the list of selected accounts a for-each loop is introduced.

- functional correction:
As the cash flow result data has been turned to global objects with the previous patch,
these objects need to be reset before the call to the cash flow calculator.
This is now added in the document renderer.

- further comments introduced
This is used to help identifying the function change that will be
introduced with the next patch for fixing 622778.

Author:    Carsten Rinke <carsten.rinke@gmx.de>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22970 57a11ea4-9604-0410-9ed3-97b8803252fd
Bug #622778 Miscalculation in cashflow reports - Step 03

Introduce solution and some minor modifications to save some function calls.

Solution:

- Save the current split value
- Calculate the parent total transaction value
- Calculate the ratio of the split to the transaction value
- only consider splits of opposite sign for the flow colletion
- only consider the split value multiplied with the calculated
  ratio of those splits with opposite sign

Author:    Carsten Rinke <carsten.rinke@gmx.de>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22971 57a11ea4-9604-0410-9ed3-97b8803252fd
Bug #682800 Generated balances on Report different than calculated balances on Ledger when using "open subaccounts"

Changes:

Part I
- bring in some more comments to ornament the code in
function (make-split-table)

Part II
In function (make-split-table), while going through the splits
- change the order of adding splits to the result table and
and updating the total collectors
Old oder:
1. add the splits to the result table
2. update the total collectors (for display at the end of the report)
New order:
1. update the total collectors with the values of the current splits
2. add the splits to the result table
Luckily this was implemented as two separate steps anyway, so this
part of the change can be done with copy/paste.

Part III
In function (make-split-table)
- change the call to (add-split-row) to also include the total-collector
- change the call to (add-other-split-rows) to also include the total-collector
In function (add-other-split-rows)
- change the definition of (add-split-row) to also include the total-collector
- change the call to (add-split-row) to also include the total-collector
In function (add-split-row)
- add the parameter "total-collector" to the function definition
- use this new parameter to display the current balance instead
of using the balance value from the split account.

Author:    Carsten Rinke <carsten.rinke@gmx.de>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22972 57a11ea4-9604-0410-9ed3-97b8803252fd