package com.changhong.epc.parsing.service.asset.formula; import com.changhong.epc.bean.form.Asset; import com.changhong.epc.bean.tenant.asset.FixedAsset; /** * 双倍余额递减法 */ public class DoubleMoney implements Depreciation { @Override public FixedAsset count(Asset money) { FixedAsset acc = new FixedAsset(); //月折旧率 Double depreciationRate = 2.0/(Double.parseDouble(money.getEstimateTime()) / 12) / 12; acc.setDepreciationRate(toNoun(depreciationRate * 100)); //本期折旧额 Double money1 = money.getNetMoney() * (acc.getDepreciationRate() / 100); acc.setCurrentDepreciation(toNoun(money1)); //累计折旧 Double cumulativeDepreciation = money.getCumulativeDepreciation() + acc.getCurrentDepreciation(); acc.setCumulativeDepreciation(toNoun(cumulativeDepreciation)); //净值 Double money3 = money.getNetMoney() - acc.getCurrentDepreciation(); acc.setNetMoney(toNoun(money3)); return acc; } }