zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
commit | author | age
a18bfa 1 package com.changhong.epc.parsing.service.asset.formula;
Z 2
3 import com.changhong.epc.bean.form.Asset;
4 import com.changhong.epc.bean.tenant.asset.FixedAsset;
5
6 /**
7  * 双倍余额递减法
8  */
9 public class DoubleMoney implements Depreciation {
10
11     @Override
12     public FixedAsset count(Asset money) {
13         FixedAsset acc = new FixedAsset();
14         //月折旧率
15         Double depreciationRate = 2.0/(Double.parseDouble(money.getEstimateTime()) / 12) / 12;
16         acc.setDepreciationRate(toNoun(depreciationRate * 100));
17
18         //本期折旧额
19         Double money1 = money.getNetMoney() * (acc.getDepreciationRate() / 100);
20         acc.setCurrentDepreciation(toNoun(money1));
21
22         //累计折旧
23         Double cumulativeDepreciation = money.getCumulativeDepreciation() + acc.getCurrentDepreciation();
24         acc.setCumulativeDepreciation(toNoun(cumulativeDepreciation));
25
26         //净值
27         Double money3 = money.getNetMoney() - acc.getCurrentDepreciation();
28         acc.setNetMoney(toNoun(money3));
29         return acc;
30     }
31 }