修改还款计划
parent
8030783b7e
commit
1119d20fab
|
@ -515,6 +515,7 @@ function calUnderwrittenPlan(income, cost, prevFundBalance) {
|
|||
*/
|
||||
function updateEachRepaymentPlan() {
|
||||
var total = 0;
|
||||
console.log("total: " + total);
|
||||
//找到每个月的回款计划输入框
|
||||
$(".input-changeable-repayment-plan-budget-plan").each(function (t) {
|
||||
//找到当前月的收入和支出
|
||||
|
@ -549,7 +550,6 @@ function updateEachRepaymentPlan() {
|
|||
*/
|
||||
function calRepaymentPlan(income, cost, prevFundBalance) {
|
||||
var repaymentPlan = 0;
|
||||
|
||||
if(!income || !cost){
|
||||
//数据还不全的时候
|
||||
repaymentPlan = NaN;
|
||||
|
@ -560,10 +560,10 @@ function calRepaymentPlan(income, cost, prevFundBalance) {
|
|||
if (f2(prevFundBalance) >= 0) {
|
||||
repaymentPlan = 0;
|
||||
} else {
|
||||
if (f2(-prevFundBalance) >= f2(income) - f2(cost)) {
|
||||
if (-f2(prevFundBalance) >= f2(income) - f2(cost)) {
|
||||
repaymentPlan = f2(f2(income) - f2(cost));
|
||||
} else {
|
||||
repaymentPlan = f2(-prevFundBalance);
|
||||
repaymentPlan = -f2(prevFundBalance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue