Commit 7dc91c27 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

подправлены функции DDB и DB

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57044 954022d7-b5bf-4e40-9824-e11837661b57
parent 5f900eb6
......@@ -1908,7 +1908,7 @@ cDB.prototype.Calculate = function ( arg ) {
period = period.getValue();
month = month.getValue();
if ( month < 1 || month > 12 || salvage <= 0 || life < 0 || period < 0 || cost < 0 ) {
if ( month < 1 || month > 12 || salvage <= 0 || life < 0 || period < 0 || cost < 0 || cost < salvage ) {
return this.value = new cError( cErrorType.wrong_value_type );
}
var rate = 1 - Math.pow( salvage / cost, 1 / life );
......@@ -2020,7 +2020,7 @@ cDDB.prototype.Calculate = function ( arg ) {
period = period.getValue();
factor = factor.getValue();
if ( cost <= 0 || salvage < 0 || factor <= 0 || life <= 0 || period <= 0 ) {
if ( cost < salvage || cost <= 0 || salvage < 0 || factor <= 0 || life <= 0 || period <= 0 ) {
return this.value = new cError( cErrorType.wrong_value_type );
}
......
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