public BigDecimal invoke(MDepreciationWorkfile assetwk,MAssetAcct assetAcct,int A_Current_Period,BigDecimal Accum_Dep){
  String depreciationType=getDepreciationType();
  BigDecimal retValue=null;
  if (CLogMgt.isLevelFinest()) {
    log.fine("Entering: DepreciationType=" + depreciationType + ", assetwk="+ assetwk+ ", assetacct="+ assetAcct+ ", A_Current_Period="+ A_Current_Period+ ", Accum_Dep="+ Accum_Dep);
  }
  if (!canInvoke(assetwk,assetAcct,A_Current_Period,Accum_Dep)) {
    return BigDecimal.ZERO;
  }
  if (depreciationType.equalsIgnoreCase("SL")) {
    retValue=apply_SL(assetwk,assetAcct,A_Current_Period,Accum_Dep);
  }
 else   if (depreciationType.equalsIgnoreCase("ARH_VAR")) {
    retValue=apply_ARH_VAR(assetwk,assetAcct,A_Current_Period,Accum_Dep);
  }
 else   if (depreciationType.equalsIgnoreCase("ARH_AD1")) {
    retValue=apply_ARH_AD1(assetwk,assetAcct,A_Current_Period,Accum_Dep);
  }
 else   if (depreciationType.equalsIgnoreCase("ARH_AD2")) {
    retValue=apply_ARH_AD2(assetwk,assetAcct,A_Current_Period,Accum_Dep);
  }
 else   if (depreciationType.equalsIgnoreCase("ARH_ZERO")) {
    retValue=apply_ARH_ZERO(assetwk,assetAcct,A_Current_Period,Accum_Dep);
  }
 else {
    throw new AssetNotSupportedException(COLUMNNAME_DepreciationType,depreciationType);
  }
  if (retValue == null) {
    retValue=BigDecimal.ZERO;
  }
  retValue=retValue.setScale(getPrecision(),RoundingMode.HALF_UP);
  if (CLogMgt.isLevelFinest())   log.fine("Leaving: retValue=" + retValue);
  return retValue;
}

public BigDecimal invoke ( MDepreciationWorkfile assetwk , MAssetAcct assetAcct , int A_Current_Period , BigDecimal Accum_Dep ) { String depreciationType = getDepreciationType ( ) ; BigDecimal retValue = null ; if ( CLogMgt . isLevelFinest ( ) ) { log . fine ( "Entering: DepreciationType=" + depreciationType + ", assetwk=" + assetwk + ", assetacct=" + assetAcct + ", A_Current_Period=" + A_Current_Period + ", Accum_Dep=" + Accum_Dep ) ; } if ( ! canInvoke ( assetwk , assetAcct , A_Current_Period , Accum_Dep ) ) { return BigDecimal . ZERO ; } if ( depreciationType . equalsIgnoreCase ( "SL" ) ) { retValue = apply_SL ( assetwk , assetAcct , A_Current_Period , Accum_Dep ) ; } else if ( depreciationType . equalsIgnoreCase ( "ARH_VAR" ) ) { retValue = apply_ARH_VAR ( assetwk , assetAcct , A_Current_Period , Accum_Dep ) ; } else if ( depreciationType . equalsIgnoreCase ( "ARH_AD1" ) ) { retValue = apply_ARH_AD1 ( assetwk , assetAcct , A_Current_Period , Accum_Dep ) ; } else if ( depreciationType . equalsIgnoreCase ( "ARH_AD2" ) ) { retValue = apply_ARH_AD2 ( assetwk , assetAcct , A_Current_Period , Accum_Dep ) ; } else if ( depreciationType . equalsIgnoreCase ( "ARH_ZERO" ) ) { retValue = apply_ARH_ZERO ( assetwk , assetAcct , A_Current_Period , Accum_Dep ) ; } else { throw new AssetNotSupportedException ( COLUMNNAME_DepreciationType , depreciationType ) ; } if ( retValue == null ) { retValue = BigDecimal . ZERO ; } retValue = retValue . setScale ( getPrecision ( ) , RoundingMode . HALF_UP ) ; if ( CLogMgt . isLevelFinest ( ) ) log . fine ( "Leaving: retValue=" + retValue ) ; return retValue ; }
calculate the value of depreciation over time
