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 YearSum implements Depreciation { @Override public FixedAsset count(Asset money) { FixedAsset acc = new FixedAsset(); Double sum = (1.0 + Double.parseDouble(money.getEstimateTime())) * Double.parseDouble(money.getEstimateTime()) / 2; //月折旧率 Double depreciationRate = Double.parseDouble(money.getSurplusTime()) / sum; acc.setDepreciationRate(toNoun(depreciationRate * 100)); //本期折旧额 Double money1 = (money.getOriginalMoney() - Double.parseDouble(money.getEstimateValue())) * (acc.getDepreciationRate()/100); acc.setCurrentDepreciation(toNoun(money1)); if(money1 < 0){ acc.setCurrentDepreciation(toNoun(money.getOriginalMoney() - money.getCumulativeDepreciation())); } //累计折旧 Double cumulativeDepreciation = money.getCumulativeDepreciation() + acc.getCurrentDepreciation(); acc.setCumulativeDepreciation(toNoun(cumulativeDepreciation)); //净值 Double moneya = money.getNetMoney() - acc.getCurrentDepreciation(); acc.setNetMoney(toNoun(moneya)); return acc; } }