Corrections for XIRR implementation to achieve more accurate values

Authored by habacker on Nov 25 2018, 10:19 AM.

Description

Corrections for XIRR implementation to achieve more accurate values

In the Investment Report, the XIRR() function is used to calculate
the annual return. The previous implementation contains some errors
that have been corrected with this commit. In addition, if XIRR
cannot calculate the annual return to notify the user of this case,
an empty column is displayed in the investment report.

The basis for this fix is an update of the XIRR implementation from
the KOffice project [1], which brings the calculation up to date and
a further improvement from the libreoffice XIRR implementation [2] to
get more solutions using a two-pass approach. The class CashFlowList
has been moved to separate files to have a cleaner separation.

The obsolete and unused NPV function has been removed.

Tests for XIRR have been extended to check for recognized issues.

[1] https://github.com/KDE/koffice/blob/master/kcells/functions/financial.cpp
[2] https://raw.githubusercontent.com/LibreOffice/core/master/scaddins/source/analysis/financial.cxx

BUG:385993
FIXED-IN:4.8.3, 5.0.3
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D16766

Details

Committed
habackerNov 25 2018, 10:19 AM
Reviewer
tbaumgart
Differential Revision
D16766: Corrections for XIRR implementation to achieve more accurate values
Parents
R261:e3ad0e31ff48: Support price import in exponential format
Branches
Unknown
Tags
Unknown