资金利息算法更改,还待完善
parent
4ed32b4e2c
commit
140410a393
|
@ -478,6 +478,48 @@ function calRepaymentPlan(income, cost, prevFundBalance) {
|
||||||
* 更新每一行【即每个月】的资金利息
|
* 更新每一行【即每个月】的资金利息
|
||||||
*/
|
*/
|
||||||
function updateEachCapitalInterest() {
|
function updateEachCapitalInterest() {
|
||||||
|
//找到年利率
|
||||||
|
var underwrittenPlanTaxRate = f2($(".input-underwritten-plan-statistic-tax-rate-budget-plan").val());
|
||||||
|
var total = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//找到每个月的资金利息输入框
|
||||||
|
$(".input-changeable-capital-interest-budget-plan").each(function (index,element) {
|
||||||
|
|
||||||
|
//找到本月之前的所有的垫资和回款
|
||||||
|
var underwrittenPlan = summationByClass($(this),".input-changeable-underwritten-plan-budget-plan", index);
|
||||||
|
var repaymentPlan= summationByClass($(this),".input-changeable-repayment-plan-budget-plan", index);
|
||||||
|
|
||||||
|
var capitalInterest = f2((underwrittenPlan-repaymentPlan)*underwrittenPlanTaxRate/100/12);
|
||||||
|
total += capitalInterest;
|
||||||
|
|
||||||
|
$(this).val(capitalInterest);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//总资金利息=所有月累加
|
||||||
|
$(".input-total-capital-interest-budget-plan").val(f2(total));
|
||||||
|
//下方小表的资金利息
|
||||||
|
$(".input-underwritten-plan-statistic-capital-interest-budget-plan").val(f2(total));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从输入框开始找到我上面的所有的包含className的输入框的值的和
|
||||||
|
*/
|
||||||
|
function summationByClass(input, className, myIndex) {
|
||||||
|
var total = 0;
|
||||||
|
var trs = input.parent().parent().parent().find("tr");
|
||||||
|
trs.each(function (index, element) {
|
||||||
|
//myIndex从0开始,刨除表头和总计两行
|
||||||
|
if(index-2<=myIndex){
|
||||||
|
total += f2($(this).find(className).val());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*function updateEachCapitalInterest() {
|
||||||
var underwrittenPlanTaxRate = f2($(".input-underwritten-plan-statistic-tax-rate-budget-plan").val());
|
var underwrittenPlanTaxRate = f2($(".input-underwritten-plan-statistic-tax-rate-budget-plan").val());
|
||||||
var total = 0;
|
var total = 0;
|
||||||
//找到每个月的资金利息输入框
|
//找到每个月的资金利息输入框
|
||||||
|
@ -495,7 +537,7 @@ function updateEachCapitalInterest() {
|
||||||
$(".input-total-capital-interest-budget-plan").val(f2(total));
|
$(".input-total-capital-interest-budget-plan").val(f2(total));
|
||||||
//下方小表的资金利息
|
//下方小表的资金利息
|
||||||
$(".input-underwritten-plan-statistic-capital-interest-budget-plan").val(f2(total));
|
$(".input-underwritten-plan-statistic-capital-interest-budget-plan").val(f2(total));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新资金相关信息
|
* 更新资金相关信息
|
||||||
|
|
Loading…
Reference in New Issue