Bug 99308 - Amordegrc using obsolete values for degressive amortisation
Summary: Amordegrc using obsolete values for degressive amortisation
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2016-04-14 19:58 UTC by Richard PALO
Modified: 2023-08-24 18:46 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard PALO 2016-04-14 19:58:55 UTC
Quite by chance I can across in the file analsishelper.cxx
line 994-1001

if( fUsePer < 3.0 )
        fAmorCoeff = 1.0;
    else if( fUsePer < 5.0 )
        fAmorCoeff = 1.5;
    else if( fUsePer <= 6.0 )
        fAmorCoeff = 2.0;
    else
        fAmorCoeff = 2.5;

these appear to be old values from 1997-2000... perhaps should be updated
(although with the exceptions that may prove complicated).

Minimally the values should probably be 1.0; 1.25; 1.75 and 2.25
but here are the references:

art 120 @ http://bofip.impots.gouv.fr/bofip/4699-PGP.html   
plus exceptions scattered in http://bofip.impots.gouv.fr/bofip/4744-PGP.html
Comment 1 Buovjaga 2016-05-02 15:07:30 UTC
I believe you, so I'll set to NEW.
Comment 2 QA Administrators 2017-05-22 13:38:59 UTC Comment hidden (obsolete)
Comment 3 Richard PALO 2017-05-22 14:01:40 UTC
FWIW, I just recently put a postit on my screen to come back to this
(guess I just thought *too* hard if you did as well:-).
I hope to come up with some time this summer to create some tests and
address the issues noted here.
Unless of course there is some young soul looking for a challenge sooner, where I would be happy to help as well...
cheers
Comment 4 QA Administrators 2018-05-23 02:36:38 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2020-05-23 03:44:08 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2022-05-24 03:33:54 UTC Comment hidden (obsolete)
Comment 7 BogdanB 2023-05-29 05:33:46 UTC
The same now in
/core/scaddins/source/analysis/analysishelper.cxx 

double GetAmordegrc( sal_Int32 nNullDate, double fCost, sal_Int32 nDate, sal_Int32 nFirstPer,
954      double fRestVal, double fPer, double fRate, sal_Int32 nBase )
955  {
956      sal_uInt32  nPer = sal_uInt32( fPer );
957      double      fUsePer = 1.0 / fRate;
958      double      fAmorCoeff;
959  
960      if( fUsePer < 3.0 )
961          fAmorCoeff = 1.0;
962      else if( fUsePer < 5.0 )
963          fAmorCoeff = 1.5;
964      else if( fUsePer <= 6.0 )
965          fAmorCoeff = 2.0;
966      else
967          fAmorCoeff = 2.5;
Comment 8 Eike Rathke 2023-08-24 18:46:03 UTC
Came across this by chance.. changing some constants that exist for old Excel interoperability (as all the Analysis plugin functions are) most likely is not the way to go. Existing documents suddenly would calculate amortisation differently. Furthermore, changing them to a French standard (if I understood that document at all) would be even more unexpected.

If at all, then a new function taking coefficients as arguments would be the way to go.