作者 wwmin

基金计算每年

package com.synthesize_energy.item.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @auth wwmin
* @create 2020-11-19 17:37
**/
@Data
public class FundYearModel {
@ApiModelProperty("可抵扣进项税")
private Double deductionAddedTax;
@ApiModelProperty("应缴增值税")
private Double addedTax ;
@ApiModelProperty("税金及附加")
private Double taxAddAddition;
}
... ...
... ... @@ -1924,10 +1924,18 @@ public class ProjectServiceImpl implements ProjectService {
*/
@Override
public Map<String, Object> no_3_6GetList(String id) {
Map<String, Object> map = new HashMap<>(4);
Synthesize_no_3_6 synthesize_no_3_6 = synthesize_no_3_6Service.getById(id);
Synthesize_no_2_6 synthesize_no_2_6 = synthesize_no_2_6Service.getById(id);// 典型值
Synthesize_no_2_5 synthesize_no_2_5 = synthesize_no_2_5Service.getById(id); // 税收优惠
//电费增值税率
double electricAddedTax = 0.13;//synthesize_no_3_6.getNo64();//0.13
//燃气、水费、供冷、供热等增值税率
double otherAddedTax = 0.09;//后期可调成前台修改值
Double otherIncome = 0.0;
if (!StringUtils.isEmpty(synthesize_no_2_5.getOtherMoney())) {
otherIncome = synthesize_no_2_5.getOtherMoney();
... ... @@ -1936,13 +1944,13 @@ public class ProjectServiceImpl implements ProjectService {
* 年收入 (含税)
* =供电收入+供热收入+供冷收入+热水收入
*/
double annualIncome = (Double.parseDouble(synthesize_no_3_6.getNo1()) + synthesize_no_3_6.getNo2() + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000;
double annualIncome = (Double.parseDouble(synthesize_no_3_6.getNo1()) + electricAddedTax + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000;
/**
* 原值 (收入不含税)=
* 年收入/(1+增值税率)
*/
// double originalValue = annualIncome / (1 + synthesize_no_2_6.getNo64());
double originalValue = Double.parseDouble(synthesize_no_3_6.getNo1()) / 10000 / (1 + synthesize_no_2_6.getNo64()) + (synthesize_no_3_6.getNo2() + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000 / (1 + 0.09);
double originalValue = Double.parseDouble(synthesize_no_3_6.getNo1()) / 10000 / (1 + electricAddedTax) + (synthesize_no_3_6.getNo2() + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000 / (1 + otherAddedTax);
/**
* 年总运成本
* = 光伏单位运维*光伏容量+风电单位运维*风电容量+
... ... @@ -2101,6 +2109,44 @@ public class ProjectServiceImpl implements ProjectService {
return map;
}
/**
* 计算增值税及附加税
* 按年 调用
*/
private static FundYearModel addedTax(int currentYear/*当前年*/, double annualElectricIncome, double annualHeatIncome, double annualColdIncome,
double annualHotWaterIncome/*每年热水收入*/, double totalInvestment/*总投资*/, double annualElectricFee/*用电费*/, double annualFuelGasAndWaterFee/*燃气加水费*/, double beginDeductionAddedTax/*期初可抵扣进项税*/,double electricAddedTax,double otherAddedTax) {
//税金及附加
double taxAndAdditionRate = 0.12;
//销项税
double outputTax = annualElectricIncome / (1 + electricAddedTax) * electricAddedTax + (annualHeatIncome + annualColdIncome + annualHotWaterIncome) / (1 + otherAddedTax) * otherAddedTax;
//当期新增进项税
double currentAddedTax = 0.0;
//建筑安装工程费占比
double buildingInstallRate = 0.3;
//设备费占比
double facilityFeeRate = 0.4;
if (currentYear == 0) {
currentAddedTax = totalInvestment * buildingInstallRate / (1 + otherAddedTax) * otherAddedTax + totalInvestment * facilityFeeRate / (1 + electricAddedTax) * electricAddedTax;
} else {
currentAddedTax = annualElectricFee / (1 + electricAddedTax) * electricAddedTax + annualFuelGasAndWaterFee / (1 + otherAddedTax) * otherAddedTax;
}
//当期可抵扣进项税
double currentDeductionAddedTax = 0.0;
double minAddedTax = Math.min(currentAddedTax + currentAddedTax, outputTax);
//期末可抵扣进项税
double endDeductionAddedTax = beginDeductionAddedTax + currentAddedTax - minAddedTax;
//应缴增值税
double addedTax = outputTax - minAddedTax;
//税金及附加
double taxAndAddition =addedTax * taxAndAdditionRate;
FundYearModel res = new FundYearModel();
res.setDeductionAddedTax(endDeductionAddedTax);
res.setAddedTax(addedTax);
res.setTaxAddAddition(taxAndAddition);
return res;
}
public static double irr(List<Double> values, double guess) {
int maxIterationCount = 1000;
double absoluteAccuracy = 1.0E-007D;
... ...
spring:
profiles:
#开发时使用下面注释
# active: dev
active: dev
# 打包时使用下面注释
active: dev2
# active: dev2
... ...