(gnc:account-get-balances-at-dates) is upgraded to
report-utilities. this function is slightly different to its
single-account counterpart because it does not retrieve subaccount
amounts.
I think this (gnc:account-get-balance-at-date) is flawed in sub-acct handling.
Consider account structure:
Assets [USD] - bal=$0
Bank [USD] - bal=$100
Broker [USD] - bal=$200
Cash [USD] - bal=$800
Funds [FUND] - bal=3 FUND @ $1000 each = $3000
- Calling (gnc:account-get-balance-at-date BANK TODAY #f) returns 100
- Calling (gnc:account-get-balance-at-date BROKER TODAY #f) returns 200
- Calling (gnc:account-get-balance-at-date BROKER TODAY #t) returns 1000
this is because although it counts all subaccounts bal $200 + $800 + 3FUND,
it retrieves the parent account commodity USD $1000 only.
It needs to be deprecated.
I think (gnc:account-get-balance-at-date) is flawed. It is actually
unused, so, it should be safe to remove. It needs to be deprecated.
Reports use xaccAccountGetBalanceAsOfDate instead, which does not
retrieve sub-acct balances.
I think this (gnc:account-get-balance-at-date) is flawed in sub-acct handling.
Consider account structure:
Assets [USD] - bal=$0
Bank [USD] - bal=$100
Broker [USD] - bal=$200
Cash [USD] - bal=$800
Funds [FUND] - bal=3 FUND @ $1000 each = $3000
- Calling (gnc:account-get-balance-at-date BANK TODAY #f) returns 100
- Calling (gnc:account-get-balance-at-date BROKER TODAY #f) returns 200
- Calling (gnc:account-get-balance-at-date BROKER TODAY #t) returns 1000
this is because although it counts all subaccounts bal $200 + $800 + 3FUND,
it retrieves the parent account commodity USD $1000 only.
This commit creates an internal
function (gnc:get-commodity-totalavg-prices-internal) which bypasses
a call to (gnc:get-match-commodity-splits-sorted) which creates a
query for the price-commodity.
(get-commoditylist-totalavg-prices) will generate a whole-book
splitlist. This is then filtered to 'interesting' splits only, and
sorted by posted date.
This sorted, filtered list is then filtered to each commodity, and
passed down as argument to (gnc:get-commodity-totalavg-prices) to be
used immediately, rather than calling the expensive function
(gnc:get-match-commodity-splits-sorted) which eventually creates a
query for each commodity.
This report seems to have evolved from a pure asset-liability
chart. It handles income-expense too, so rename to minuend-subtrahend
to be generic.
Also report percentages done.
This will deconstruct process-datelist to not call the utility
(gnc:accounts-get-comm-total-*) functions which are still slow,
because they will cycle through the balancelist for each account. In a
large enough report, the balance list may be thousands of entries
long, and we don't want to cycle through them every time.
This commit will loop all so that the balances are cycled once only.
This will retrieve the cached balances in account-balances, rather
than calling (gnc:account-get-comm-balance-interval)
or (gnc:account-get-comm-balance-at-date) which are very expensive
because they will call xaccAccountGetBalanceAsOfDate which will scan
the account splitlist every time.
This is similar to test-standard-net-linechart but designed to test
date boundaries. Creates book with following entries in bank accounts,
and calculates amounts at each date boundary.
Bank1 Bank2 Bank3
05/05/69 $25
01/01/1970
05/01/70 $25
12/01/70 $10
18/01/70 $15 $50
01/02/1970
18/02/70 $50
01/03/1970
03/03/70 $200
01/04/1970
15/04/1970