Commit 716b4295 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fixed: Bug 24254 - Аргумент Redemption при вычислении функции...

fixed: Bug 24254 - Аргумент Redemption при вычислении функции ODDLPRICE/ODDLYIELD может принимать отрицательные значения

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56212 954022d7-b5bf-4e40-9824-e11837661b57
parent 5a83d0a8
...@@ -3743,10 +3743,10 @@ cODDLPRICE.prototype.Calculate = function ( arg ) { ...@@ -3743,10 +3743,10 @@ cODDLPRICE.prototype.Calculate = function ( arg ) {
frequency = frequency.getValue(); frequency = frequency.getValue();
basis = basis.getValue(); basis = basis.getValue();
if ( maturity <= settlement || settlement <= last_interest || if ( maturity <= settlement || settlement <= last_interest || basis < 0 || basis > 4 || yld < 0 || rate < 0 ||
basis < 0 || basis > 4 || yld < 0 || rate < 0 || frequency != 1 && frequency != 2 && frequency != 4 || redemption < 0 ){
frequency != 1 && frequency != 2 && frequency != 4 )
return this.value = new cError( cErrorType.not_numeric ); return this.value = new cError( cErrorType.not_numeric );
}
var settl = Date.prototype.getDateFromExcel( settlement ), var settl = Date.prototype.getDateFromExcel( settlement ),
matur = Date.prototype.getDateFromExcel( maturity ), matur = Date.prototype.getDateFromExcel( maturity ),
...@@ -3882,10 +3882,10 @@ cODDLYIELD.prototype.Calculate = function ( arg ) { ...@@ -3882,10 +3882,10 @@ cODDLYIELD.prototype.Calculate = function ( arg ) {
frequency = frequency.getValue(); frequency = frequency.getValue();
basis = basis.getValue(); basis = basis.getValue();
if ( maturity <= settlement || settlement <= last_interest || if ( maturity <= settlement || settlement <= last_interest || basis < 0 || basis > 4 || pr < 0 || rate < 0 ||
basis < 0 || basis > 4 || pr < 0 || rate < 0 || frequency != 1 && frequency != 2 && frequency != 4 || redemption < 0 ){
frequency != 1 && frequency != 2 && frequency != 4 )
return this.value = new cError( cErrorType.not_numeric ); return this.value = new cError( cErrorType.not_numeric );
}
var settl = Date.prototype.getDateFromExcel( settlement ), var settl = Date.prototype.getDateFromExcel( settlement ),
matur = Date.prototype.getDateFromExcel( maturity ), matur = Date.prototype.getDateFromExcel( maturity ),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment