function calculateSettle() {

    $("input[name='incomeDevice']").change(function () {
        calIncomeDeviceSettleTotal();
        calIncomeTotal();
        calIncomeSettleTotal();
        calProfit();
        digitalSelf("incomeDevice", "input[name='incomeDevice']");
    });
    $("input[name='incomeEngineer']").change(function () {
        calIncomeEngineerSettleTotal();
        calIncomeTotal();
        calIncomeSettleTotal();
        calProfit();
        digitalSelf("incomeEngineer", "input[name='incomeEngineer']");
    });
    $("input[name='incomeService']").change(function () {
        calIncomeServiceSettleTotal();
        calIncomeTotal();
        calIncomeSettleTotal();
        calProfit();
        digitalSelf("incomeService", "input[name='incomeService']");
    });


    $("input[name='costPurchaseDevice']").change(function () {
        calCostPurchaseDeviceSettleTotal();
        calCostTotal();
        calCostSettleTotal();
        calProfit();
        digitalSelf("costPurchaseDevice", "input[name='costPurchaseDevice']");
    });
    $("input[name='costPurchaseBuild']").change(function () {
        calCostPurchaseBuildSettleTotal();
        calCostTotal();
        calCostSettleTotal();
        calProfit();
        digitalSelf("costPurchaseBuild", "input[name='costPurchaseBuild']");
    });
    $("input[name='costPurchaseService']").change(function () {
        calCostPurchaseServiceSettleTotal();
        calCostTotal();
        calCostSettleTotal();
        calProfit();
        digitalSelf("costPurchaseService", "input[name='costPurchaseService']");
    });
    $("input[name='costPurchaseOther']").change(function () {
        calCostPurchaseOtherSettleTotal();
        calCostTotal();
        calCostSettleTotal();
        calProfit();
        digitalSelf("costPurchaseOther", "input[name='costPurchaseOther']");
    });
    $("input[name='costProjectManage']").change(function () {
        calCostProjectManageSettleTotal();
        calCostTotal();
        calCostSettleTotal();
        calProfit();
        digitalSelf("costProjectManage", "input[name='costProjectManage']");
    });
    $("input[name='costOther']").change(function () {
        calCostOtherSettleTotal();
        calCostTotal();
        calCostSettleTotal();
        calProfit();
        digitalSelf("costOther", "input[name='costOther']");
    });


    $("input[name='costExpropriation']").change(function () {
        calCostExpropriationSettleTotal();
        calCostManageTotal();
        calCostManageSettleTotal();
        calProfit();
        digitalSelf("costExpropriation", "input[name='costExpropriation']");
    });
    $("input[name='costCompanyManage']").change(function () {
        calCostCompanyManageSettleTotal();
        calCostManageTotal();
        calCostManageSettleTotal();

        calContributionProfit();
        calContributionProfitSettleTotal();
        calContributionProfitProfitMargin();
        calNetProfit();
        calNetProfitSettleTotal();
        calNetProfitProfitMargin();
        digitalSelf("costCompanyManage", "input[name='costCompanyManage']");
    });
    $("input[name='costIncomeTax']").change(function () {
        calCostIncomeTaxSettleTotal();
        calCostManageTotal();
        calCostManageSettleTotal();

        calNetProfit();
        calNetProfitSettleTotal();
        calNetProfitProfitMargin();
        digitalSelf("costIncomeTax", "input[name='costIncomeTax']");
    });


    // $("input[name='grossProfit']").change(function () {
    //     calGrossProfitSettleTotal();
    //     calGrossProfitProfitMargin();
    // });
    // $("input[name='contributionProfit']").change(function () {
    //     calContributionProfitSettleTotal();
    //     calContributionProfitProfitMargin();
    // });
    // $("input[name='netProfit']").change(function () {
    //     calNetProfitSettleTotal();
    //     calNetProfitProfitMargin();
    // });


    $("input[name='saleIncomeCash']").change(function () {
        calSaleIncomeCashSettle();
        calNetCashFlow();
        calNetCashFlowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("saleIncomeCash", "input[name='saleIncomeCash']");
    });
    $("input[name='taxReturn']").change(function () {
        calTaxReturnSettle();
        calNetCashFlow();
        calNetCashFlowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("taxReturn", "input[name='taxReturn']");
    });
    $("input[name='earnestMoneyIncome']").change(function () {
        calEarnestMoneyIncomeSettle();
        calNetCashFlow();
        calNetCashFlowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("earnestMoneyIncome", "input[name='earnestMoneyIncome']");
    });
    $("input[name='purchaseCost']").change(function () {
        calPurchaseCostSettle();
        calNetCashFlow();
        calNetCashFlowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("purchaseCost", "input[name='purchaseCost']");
    });
    $("input[name='taxCost']").change(function () {
        calTaxCostSettle();
        calNetCashFlow();
        calNetCashFlowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("taxCost", "input[name='taxCost']");
    });
    $("input[name='earnestMoneyCost']").change(function () {
        calEarnestMoneyCostSettle();
        calNetCashFlow();
        calNetCashFlowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("earnestMoneyCost", "input[name='earnestMoneyCost']");
    });
    // $("input[name='netCashFlow']").change(function () {
    //     calNetCashFlowSettle();
    //     calNetIncreaseMonetaryFunds();
    //     calCashFlowTotal();
    //     calCashFlowSettleTotal();
    // });
    $("input[name='cashInflowFromInvestingActivities']").change(function () {
        calCashInflowFromInvestingActivitiesSettle();
        calNetCashFromInvestingActivities();
        calNetCashFromInvestingActivitiesSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("cashInflowFromInvestingActivities", "input[name='cashInflowFromInvestingActivities']");
    });
    $("input[name='cashOutflowFromInvestingActivities']").change(function () {
        calCashOutflowFromInvestingActivitiesSettle();
        calNetCashFromInvestingActivities();
        calNetCashFromInvestingActivitiesSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("cashOutflowFromInvestingActivities", "input[name='cashOutflowFromInvestingActivities']");
    });
    // $("input[name='netCashFromInvestingActivities']").change(function () {
    //     calNetCashFromInvestingActivitiesSettle();
    //     calNetIncreaseMonetaryFunds();
    //     calCashFlowTotal();
    //     calCashFlowSettleTotal();
    // });
    $("input[name='financingCapitalInflow']").change(function () {
        calFinancingCapitalInflowSettle();
        calFinancingCapitalCashflow();
        calFinancingCapitalCashflowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("financingCapitalInflow", "input[name='financingCapitalInflow']");
    });
    $("input[name='financingCapitalOutflow']").change(function () {
        calFinancingCapitalOutflowSettle();
        calFinancingCapitalCashflow();
        calFinancingCapitalCashflowSettle();
        calNetIncreaseMonetaryFunds();
        calNetIncreaseMonetaryFundsSettle();
        digitalSelf("financingCapitalOutflow", "input[name='financingCapitalOutflow']");
    });
    // $("input[name='financingCapitalCashflow']").change(function () {
    //     calFinancingCapitalCashflowSettle();
    //     calNetIncreaseMonetaryFunds();
    //     calCashFlowTotal();
    //     calCashFlowSettleTotal();
    // });
    // $("input[name='netIncreaseMonetaryFunds']").change(function () {
    //     calNetIncreaseMonetaryFundsSettle();
    //     calCashFlowTotal();
    //     calCashFlowSettleTotal();
    // });

}

/**
 * 收入和支出均需调用的利润方法
 */
function calProfit() {
    calGrossProfit();
    calGrossProfitSettleTotal();
    calGrossProfitProfitMargin();
    calContributionProfit();
    calContributionProfitSettleTotal();
    calContributionProfitProfitMargin();
    calNetProfit();
    calNetProfitSettleTotal();
    calNetProfitProfitMargin();
}

/**
 * 收入设备类结算总额(不含税)，有一项没填就置空
 */
function calIncomeDeviceSettleTotal() {
    var incomeDeviceFormerSettleTotal = $("input[name='incomeDeviceFormerSettleTotal']").val();
    var incomeDevice = $("input[name='incomeDevice']").val();

    var incomeDeviceSettleTotal = $("input[name='incomeDeviceSettleTotal']");

    if(incomeDeviceFormerSettleTotal && incomeDevice){
        incomeDeviceSettleTotal.val(f2Fixed(f2(incomeDeviceFormerSettleTotal)+f2(incomeDevice)));
    }else {
        incomeDeviceSettleTotal.val("");
    }
}

/**
 * 收入工程类结算总额(不含税)，有一项没填就置空
 */
function calIncomeEngineerSettleTotal() {
    var incomeEngineerFormerSettleTotal = $("input[name='incomeEngineerFormerSettleTotal']").val();
    var incomeEngineer = $("input[name='incomeEngineer']").val();

    var incomeEngineerSettleTotal = $("input[name='incomeEngineerSettleTotal']");

    if(incomeEngineerFormerSettleTotal && incomeEngineer){
        incomeEngineerSettleTotal.val(f2Fixed(f2(incomeEngineerFormerSettleTotal)+f2(incomeEngineer)));
    }else {
        incomeEngineerSettleTotal.val("");
    }
}

/**
 * 收入服务类结算总额(不含税)，有一项没填就置空
 */
function calIncomeServiceSettleTotal() {
    var incomeServiceFormerSettleTotal = $("input[name='incomeServiceFormerSettleTotal']").val();
    var incomeService = $("input[name='incomeService']").val();

    var incomeServiceSettleTotal = $("input[name='incomeServiceSettleTotal']");

    if(incomeServiceFormerSettleTotal && incomeService){
        incomeServiceSettleTotal.val(f2Fixed(f2(incomeServiceFormerSettleTotal)+f2(incomeService)));
    }else {
        incomeServiceSettleTotal.val("");
    }
}

/**
 * 本月收入结算金额(不含税)，有一项没填就置空
 */
function calIncomeTotal() {
    var incomeDevice = $("input[name='incomeDevice']").val();
    var incomeEngineer = $("input[name='incomeEngineer']").val();
    var incomeService = $("input[name='incomeService']").val();

    var incomeTotal = $("input[name='incomeTotal']");

    if(incomeDevice && incomeEngineer && incomeService){
        incomeTotal.val(f2Fixed(f2(incomeDevice)+f2(incomeEngineer)+f2(incomeService)));
    }else {
        incomeTotal.val("");
    }
}

/**
 * 收入结算总额(不含税)，有一项没填就置空
 */
function calIncomeSettleTotal() {
    var incomeDeviceSettleTotal = $("input[name='incomeDeviceSettleTotal']").val();
    var incomeEngineerSettleTotal = $("input[name='incomeEngineerSettleTotal']").val();
    var incomeServiceSettleTotal = $("input[name='incomeServiceSettleTotal']").val();

    var incomeSettleTotal = $("input[name='incomeSettleTotal']");

    if(incomeDeviceSettleTotal && incomeEngineerSettleTotal && incomeServiceSettleTotal){
        incomeSettleTotal.val(f2Fixed(f2(incomeDeviceSettleTotal)+f2(incomeEngineerSettleTotal)+f2(incomeServiceSettleTotal)));
    }else {
        incomeSettleTotal.val("");
    }
}

/**
 * 采购成本设备结算总额(不含税)，有一项没填就置空
 */
function calCostPurchaseDeviceSettleTotal() {
    var costPurchaseDeviceFormerSettleTotal = $("input[name='costPurchaseDeviceFormerSettleTotal']").val();
    var costPurchaseDevice = $("input[name='costPurchaseDevice']").val();

    var costPurchaseDeviceSettleTotal = $("input[name='costPurchaseDeviceSettleTotal']");

    if(costPurchaseDeviceFormerSettleTotal && costPurchaseDevice){
        costPurchaseDeviceSettleTotal.val(f2Fixed(f2(costPurchaseDeviceFormerSettleTotal)+f2(costPurchaseDevice)));
    }else {
        costPurchaseDeviceSettleTotal.val("");
    }
}

/**
 * 采购成本施工结算总额(不含税)，有一项没填就置空
 */
function calCostPurchaseBuildSettleTotal() {
    var costPurchaseBuildFormerSettleTotal = $("input[name='costPurchaseBuildFormerSettleTotal']").val();
    var costPurchaseBuild = $("input[name='costPurchaseBuild']").val();

    var costPurchaseBuildSettleTotal = $("input[name='costPurchaseBuildSettleTotal']");

    if(costPurchaseBuildFormerSettleTotal && costPurchaseBuild){
        costPurchaseBuildSettleTotal.val(f2Fixed(f2(costPurchaseBuildFormerSettleTotal)+f2(costPurchaseBuild)));
    }else {
        costPurchaseBuildSettleTotal.val("");
    }
}

/**
 * 采购成本服务结算总额(不含税)，有一项没填就置空
 */
function calCostPurchaseServiceSettleTotal() {
    var costPurchaseServiceFormerSettleTotal = $("input[name='costPurchaseServiceFormerSettleTotal']").val();
    var costPurchaseService = $("input[name='costPurchaseService']").val();

    var costPurchaseServiceSettleTotal = $("input[name='costPurchaseServiceSettleTotal']");

    if(costPurchaseServiceFormerSettleTotal && costPurchaseService){
        costPurchaseServiceSettleTotal.val(f2Fixed(f2(costPurchaseServiceFormerSettleTotal)+f2(costPurchaseService)));
    }else {
        costPurchaseServiceSettleTotal.val("");
    }
}

/**
 * 采购成本其他结算总额(不含税)，有一项没填就置空
 */
function calCostPurchaseOtherSettleTotal() {
    var costPurchaseOtherFormerSettleTotal = $("input[name='costPurchaseOtherFormerSettleTotal']").val();
    var costPurchaseOther = $("input[name='costPurchaseOther']").val();

    var costPurchaseOtherSettleTotal = $("input[name='costPurchaseOtherSettleTotal']");

    if(costPurchaseOtherFormerSettleTotal && costPurchaseOther){
        costPurchaseOtherSettleTotal.val(f2Fixed(f2(costPurchaseOtherFormerSettleTotal)+f2(costPurchaseOther)));
    }else {
        costPurchaseOtherSettleTotal.val("");
    }
}

/**
 * 项目管理成本结算总额(不含税)，有一项没填就置空
 */
function calCostProjectManageSettleTotal() {
    var costProjectManageFormerSettleTotal = $("input[name='costProjectManageFormerSettleTotal']").val();
    var costProjectManage = $("input[name='costProjectManage']").val();

    var costProjectManageSettleTotal = $("input[name='costProjectManageSettleTotal']");

    if(costProjectManageFormerSettleTotal && costProjectManage){
        costProjectManageSettleTotal.val(f2Fixed(f2(costProjectManageFormerSettleTotal)+f2(costProjectManage)));
    }else {
        costProjectManageSettleTotal.val("");
    }
}

/**
 * 其他结算总额(不含税)，有一项没填就置空
 */
function calCostOtherSettleTotal() {
    var costOtherFormerSettleTotal = $("input[name='costOtherFormerSettleTotal']").val();
    var costOther = $("input[name='costOther']").val();

    var costOtherSettleTotal = $("input[name='costOtherSettleTotal']");

    if(costOtherFormerSettleTotal){
        costOtherSettleTotal.val(f2Fixed(f2(costOtherFormerSettleTotal)+f2(costOther)));
    }else {
        costOtherSettleTotal.val("");
    }
}

/**
 * 本月成本结算金额(不含税)，有一项没填就置空
 */
function calCostTotal() {
    var costPurchaseDevice = $("input[name='costPurchaseDevice']").val();
    var costPurchaseBuild = $("input[name='costPurchaseBuild']").val();
    var costPurchaseService = $("input[name='costPurchaseService']").val();
    var costPurchaseOther = $("input[name='costPurchaseOther']").val();
    var costProjectManage = $("input[name='costProjectManage']").val();
    var costOther = $("input[name='costOther']").val();

    var costTotal = $("input[name='costTotal']");

    if(costPurchaseDevice && costPurchaseBuild && costPurchaseService && costPurchaseOther && costProjectManage){
        costTotal.val(f2Fixed(f2(costPurchaseDevice)+f2(costPurchaseBuild)+f2(costPurchaseService)+f2(costPurchaseOther)+f2(costProjectManage)+f2(costOther)));
    }else {
        costTotal.val("");
    }
}

/**
 * 成本决算总额(不含税)，有一项没填就置空
 */
function calCostSettleTotal() {
    var costPurchaseDeviceSettleTotal = $("input[name='costPurchaseDeviceSettleTotal']").val();
    var costPurchaseBuildSettleTotal = $("input[name='costPurchaseBuildSettleTotal']").val();
    var costPurchaseServiceSettleTotal = $("input[name='costPurchaseServiceSettleTotal']").val();
    var costPurchaseOtherSettleTotal = $("input[name='costPurchaseOtherSettleTotal']").val();
    var costProjectManageSettleTotal = $("input[name='costProjectManageSettleTotal']").val();
    var costOtherSettleTotal = $("input[name='costOtherSettleTotal']").val();

    var costSettleTotal = $("input[name='costSettleTotal']");

    if(costPurchaseDeviceSettleTotal && costPurchaseBuildSettleTotal && costPurchaseServiceSettleTotal &&
        costPurchaseOtherSettleTotal && costProjectManageSettleTotal && costOtherSettleTotal){
        costSettleTotal.val(f2Fixed(f2(costPurchaseDeviceSettleTotal)+f2(costPurchaseBuildSettleTotal)+f2(costPurchaseServiceSettleTotal)+
            f2(costPurchaseOtherSettleTotal)+f2(costProjectManageSettleTotal)+f2(costOtherSettleTotal)));
    }else {
        costSettleTotal.val("");
    }
}

/**
 * 财务费用总额(不含税)，有一项没填就置空
 */
function calCostExpropriationSettleTotal() {
    var costExpropriationFormerSettleTotal = $("input[name='costExpropriationFormerSettleTotal']").val();
    var costExpropriation = $("input[name='costExpropriation']").val();

    var costExpropriationSettleTotal = $("input[name='costExpropriationSettleTotal']");

    if(costExpropriationFormerSettleTotal && costExpropriation){
        costExpropriationSettleTotal.val(f2Fixed(f2(costExpropriationFormerSettleTotal)+f2(costExpropriation)));
    }else {
        costExpropriationSettleTotal.val("");
    }
}

/**
 * 公司管理费用总额(不含税)，有一项没填就置空
 */
function calCostCompanyManageSettleTotal() {
    var costCompanyManageFormerSettleTotal = $("input[name='costCompanyManageFormerSettleTotal']").val();
    var costCompanyManage = $("input[name='costCompanyManage']").val();

    var costCompanyManageSettleTotal = $("input[name='costCompanyManageSettleTotal']");

    if(costCompanyManageFormerSettleTotal && costCompanyManage){
        costCompanyManageSettleTotal.val(f2Fixed(f2(costCompanyManageFormerSettleTotal)+f2(costCompanyManage)));
    }else {
        costCompanyManageSettleTotal.val("");
    }
}

/**
 * 所得税费用总额(不含税)，有一项没填就置空
 */
function calCostIncomeTaxSettleTotal() {
    var costIncomeTaxFormerSettleTotal = $("input[name='costIncomeTaxFormerSettleTotal']").val();
    var costIncomeTax = $("input[name='costIncomeTax']").val();

    var costIncomeTaxSettleTotal = $("input[name='costIncomeTaxSettleTotal']");

    if(costIncomeTaxFormerSettleTotal && costIncomeTax){
        costIncomeTaxSettleTotal.val(f2Fixed(f2(costIncomeTaxFormerSettleTotal)+f2(costIncomeTax)));
    }else {
        costIncomeTaxSettleTotal.val("");
    }
}

/**
 * 本月管理成本总额(不含税)，有一项没填就置空
 */
function calCostManageTotal() {
    var costExpropriation = $("input[name='costExpropriation']").val();
    var costCompanyManage = $("input[name='costCompanyManage']").val();
    var costIncomeTax = $("input[name='costIncomeTax']").val();

    var costManageTotal = $("input[name='costManageTotal']");

    if(costExpropriation && costCompanyManage && costIncomeTax){
        costManageTotal.val(f2Fixed(f2(costExpropriation)+f2(costCompanyManage)+f2(costIncomeTax)));
    }else {
        costManageTotal.val("");
    }
}

/**
 * 管理成本总额(不含税)，有一项没填就置空
 */
function calCostManageSettleTotal() {
    var costExpropriationSettleTotal = $("input[name='costExpropriationSettleTotal']").val();
    var costCompanyManageSettleTotal = $("input[name='costCompanyManageSettleTotal']").val();
    var costIncomeTaxSettleTotal = $("input[name='costIncomeTaxSettleTotal']").val();

    var costManageSettleTotal = $("input[name='costManageSettleTotal']");

    if(costExpropriationSettleTotal && costCompanyManageSettleTotal && costIncomeTaxSettleTotal){
        costManageSettleTotal.val(f2Fixed(f2(costExpropriationSettleTotal)+f2(costCompanyManageSettleTotal)+f2(costIncomeTaxSettleTotal)));
    }else {
        costManageSettleTotal.val("");
    }
}

/**
 * 本月项目毛利结算总额，有一项没填就置空
 */
function calGrossProfit() {
    var incomeTotal = $("input[name='incomeTotal']").val();
    var costTotal = $("input[name='costTotal']").val();
    var costExpropriation = $("input[name='costExpropriation']").val();

    var grossProfit = $("input[name='grossProfit']");

    if(incomeTotal && costTotal && costExpropriation){
        grossProfit.val(f2Fixed(f2(incomeTotal)-f2(costTotal)-f2(costExpropriation)));
    }else {
        grossProfit.val("");
    }
}

/**
 * 项目毛利结算总额，有一项没填就置空
 */
function calGrossProfitSettleTotal() {
    var grossProfitFormerSettleTotal = $("input[name='grossProfitFormerSettleTotal']").val();
    var grossProfit = $("input[name='grossProfit']").val();

    var grossProfitSettleTotal = $("input[name='grossProfitSettleTotal']");

    if(grossProfitFormerSettleTotal && grossProfit){
        grossProfitSettleTotal.val(f2Fixed(f2(grossProfitFormerSettleTotal)+f2(grossProfit)));
    }else {
        grossProfitSettleTotal.val("");
    }
}

/**
 * 项目毛利利润率，有一项没填就置空
 */
function calGrossProfitProfitMargin() {
    var grossProfitSettleTotal = $("input[name='grossProfitSettleTotal']").val();
    var incomeSettleTotal = $("input[name='incomeSettleTotal']").val();

    var grossProfitProfitMargin = $("input[name='grossProfitProfitMargin']");

    if(grossProfitSettleTotal && incomeSettleTotal){
        grossProfitProfitMargin.val(f2Fixed(100*(f2(grossProfitSettleTotal)/f2min(incomeSettleTotal))));
    }else {
        grossProfitProfitMargin.val("");
    }
}

/**
 * 本月项目贡献利润，有一项没填就置空
 */
function calContributionProfit() {
    var grossProfit = $("input[name='grossProfit']").val();
    var costCompanyManage = $("input[name='costCompanyManage']").val();

    var contributionProfit = $("input[name='contributionProfit']");

    if(grossProfit && costCompanyManage){
        contributionProfit.val(f2Fixed(f2(grossProfit)-f2(costCompanyManage)));
    }else {
        contributionProfit.val("");
    }
}

/**
 * 项目贡献利润，有一项没填就置空
 */
function calContributionProfitSettleTotal() {
    var contributionProfitFormerSettleTotal = $("input[name='contributionProfitFormerSettleTotal']").val();
    var contributionProfit = $("input[name='contributionProfit']").val();

    var contributionProfitSettleTotal = $("input[name='contributionProfitSettleTotal']");

    if(contributionProfitFormerSettleTotal && contributionProfit){
        contributionProfitSettleTotal.val(f2Fixed(f2(contributionProfitFormerSettleTotal)+f2(contributionProfit)));
    }else {
        contributionProfitSettleTotal.val("");
    }
}

/**
 * 项目贡献利润率，有一项没填就置空
 */
function calContributionProfitProfitMargin() {
    var contributionProfitSettleTotal = $("input[name='contributionProfitSettleTotal']").val();
    var incomeSettleTotal = $("input[name='incomeSettleTotal']").val();

    var contributionProfitProfitMargin = $("input[name='contributionProfitProfitMargin']");

    if(contributionProfitSettleTotal && incomeSettleTotal){
        contributionProfitProfitMargin.val(f2Fixed(100*(f2(contributionProfitSettleTotal)/f2min(incomeSettleTotal))));
    }else {
        contributionProfitProfitMargin.val("");
    }
}

/**
 * 本月项目净利润，有一项没填就置空
 */
function calNetProfit() {
    var contributionProfit = $("input[name='contributionProfit']").val();
    var costIncomeTax = $("input[name='costIncomeTax']").val();

    var netProfit = $("input[name='netProfit']");

    if(contributionProfit && costIncomeTax){
        netProfit.val(f2Fixed(f2(contributionProfit)-f2(costIncomeTax)));
    }else {
        netProfit.val("");
    }
}

/**
 * 项目净利润，有一项没填就置空
 */
function calNetProfitSettleTotal() {
    var netProfitFormerSettleTotal = $("input[name='netProfitFormerSettleTotal']").val();
    var netProfit = $("input[name='netProfit']").val();

    var netProfitSettleTotal = $("input[name='netProfitSettleTotal']");

    if(netProfitFormerSettleTotal && netProfit){
        netProfitSettleTotal.val(f2Fixed(f2(netProfitFormerSettleTotal)+f2(netProfit)));
    }else {
        netProfitSettleTotal.val("");
    }
}

/**
 * 项目净利润率，有一项没填就置空
 */
function calNetProfitProfitMargin() {
    var netProfitSettleTotal = $("input[name='netProfitSettleTotal']").val();
    var incomeSettleTotal = $("input[name='incomeSettleTotal']").val();

    var netProfitProfitMargin = $("input[name='netProfitProfitMargin']");

    if(netProfitSettleTotal && incomeSettleTotal){
        netProfitProfitMargin.val(f2Fixed(100*(f2(netProfitSettleTotal)/f2min(incomeSettleTotal))));
    }else {
        netProfitProfitMargin.val("");
    }
}

/**
 * 销售商品、提供劳务收到的现金，有一项没填就置空
 */
function calSaleIncomeCashSettle() {
    var saleIncomeCashFormerSettle = $("input[name='saleIncomeCashFormerSettle']").val();
    var saleIncomeCash = $("input[name='saleIncomeCash']").val();

    var saleIncomeCashSettle = $("input[name='saleIncomeCashSettle']");

    if(saleIncomeCashFormerSettle && saleIncomeCash){
        saleIncomeCashSettle.val(f2Fixed(f2(saleIncomeCashFormerSettle)+f2(saleIncomeCash)));
    }else {
        saleIncomeCashSettle.val("");
    }
}

/**
 * 收到的税费返还，有一项没填就置空
 */
function calTaxReturnSettle() {
    var taxReturnFormerSettle = $("input[name='taxReturnFormerSettle']").val();
    var taxReturn = $("input[name='taxReturn']").val();

    var taxReturnSettle = $("input[name='taxReturnSettle']");

    if(taxReturnFormerSettle && taxReturn){
        taxReturnSettle.val(f2Fixed(f2(taxReturnFormerSettle)+f2(taxReturn)));
    }else {
        taxReturnSettle.val("");
    }
}

/**
 * 收到其他与经营活动有关的现金，有一项没填就置空
 */
function calEarnestMoneyIncomeSettle() {
    var earnestMoneyIncomeFormerSettle = $("input[name='earnestMoneyIncomeFormerSettle']").val();
    var earnestMoneyIncome = $("input[name='earnestMoneyIncome']").val();

    var earnestMoneyIncomeSettle = $("input[name='earnestMoneyIncomeSettle']");

    if(earnestMoneyIncomeFormerSettle && earnestMoneyIncome){
        earnestMoneyIncomeSettle.val(f2Fixed(f2(earnestMoneyIncomeFormerSettle)+f2(earnestMoneyIncome)));
    }else {
        earnestMoneyIncomeSettle.val("");
    }
}

/**
 * 购买商品、接受劳务支付的现金，有一项没填就置空
 */
function calPurchaseCostSettle() {
    var purchaseCostFormerSettle = $("input[name='purchaseCostFormerSettle']").val();
    var purchaseCost = $("input[name='purchaseCost']").val();

    var purchaseCostSettle = $("input[name='purchaseCostSettle']");

    if(purchaseCostFormerSettle && purchaseCost){
        purchaseCostSettle.val(f2Fixed(f2(purchaseCostFormerSettle)+f2(purchaseCost)));
    }else {
        purchaseCostSettle.val("");
    }
}

/**
 * 支付的各项税费，有一项没填就置空
 */
function calTaxCostSettle() {
    var taxCostFormerSettle = $("input[name='taxCostFormerSettle']").val();
    var taxCost = $("input[name='taxCost']").val();

    var taxCostSettle = $("input[name='taxCostSettle']");

    if(taxCostFormerSettle && taxCost){
        taxCostSettle.val(f2Fixed(f2(taxCostFormerSettle)+f2(taxCost)));
    }else {
        taxCostSettle.val("");
    }
}


/**
 * 支付其他与经营活动有关的现金，有一项没填就置空
 */
function calEarnestMoneyCostSettle() {
    var earnestMoneyCostFormerSettle = $("input[name='earnestMoneyCostFormerSettle']").val();
    var earnestMoneyCost = $("input[name='earnestMoneyCost']").val();

    var earnestMoneyCostSettle = $("input[name='earnestMoneyCostSettle']");

    if(earnestMoneyCostFormerSettle && earnestMoneyCost){
        earnestMoneyCostSettle.val(f2Fixed(f2(earnestMoneyCostFormerSettle)+f2(earnestMoneyCost)));
    }else {
        earnestMoneyCostSettle.val("");
    }
}

/**
 * 经营活动产生的现金流量净额，有一项没填就置空
 */
function calNetCashFlowSettle() {
    var netCashFlowFormerSettle = $("input[name='netCashFlowFormerSettle']").val();
    var netCashFlow = $("input[name='netCashFlow']").val();

    var netCashFlowSettle = $("input[name='netCashFlowSettle']");

    if(netCashFlowFormerSettle && netCashFlow){
        netCashFlowSettle.val(f2Fixed(f2(netCashFlowFormerSettle)+f2(netCashFlow)));
    }else {
        netCashFlowSettle.val("");
    }
}

/**
 * 投资活动现金流入，有一项没填就置空
 */
function calCashInflowFromInvestingActivitiesSettle() {
    var cashInflowFromInvestingActivitiesFormerSettle = $("input[name='cashInflowFromInvestingActivitiesFormerSettle']").val();
    var cashInflowFromInvestingActivities = $("input[name='cashInflowFromInvestingActivities']").val();

    var cashInflowFromInvestingActivitiesSettle = $("input[name='cashInflowFromInvestingActivitiesSettle']");

    if(cashInflowFromInvestingActivitiesFormerSettle && cashInflowFromInvestingActivities){
        cashInflowFromInvestingActivitiesSettle.val(f2Fixed(f2(cashInflowFromInvestingActivitiesFormerSettle)+f2(cashInflowFromInvestingActivities)));
    }else {
        cashInflowFromInvestingActivitiesSettle.val("");
    }
}

/**
 * 投资活动现金流出，有一项没填就置空
 */
function calCashOutflowFromInvestingActivitiesSettle() {
    var cashOutflowFromInvestingActivitiesFormerSettle = $("input[name='cashOutflowFromInvestingActivitiesFormerSettle']").val();
    var cashOutflowFromInvestingActivities = $("input[name='cashOutflowFromInvestingActivities']").val();

    var cashOutflowFromInvestingActivitiesSettle = $("input[name='cashOutflowFromInvestingActivitiesSettle']");

    if(cashOutflowFromInvestingActivitiesFormerSettle && cashOutflowFromInvestingActivities){
        cashOutflowFromInvestingActivitiesSettle.val(f2Fixed(f2(cashOutflowFromInvestingActivitiesFormerSettle)+f2(cashOutflowFromInvestingActivities)));
    }else {
        cashOutflowFromInvestingActivitiesSettle.val("");
    }
}

/**
 * 投资活动产生的现金流量净额，有一项没填就置空
 */
function calNetCashFromInvestingActivitiesSettle() {
    var netCashFromInvestingActivitiesFormerSettle = $("input[name='netCashFromInvestingActivitiesFormerSettle']").val();
    var netCashFromInvestingActivities = $("input[name='netCashFromInvestingActivities']").val();

    var netCashFromInvestingActivitiesSettle = $("input[name='netCashFromInvestingActivitiesSettle']");

    if(netCashFromInvestingActivitiesFormerSettle && netCashFromInvestingActivities){
        netCashFromInvestingActivitiesSettle.val(f2Fixed(f2(netCashFromInvestingActivitiesFormerSettle)+f2(netCashFromInvestingActivities)));
    }else {
        netCashFromInvestingActivitiesSettle.val("");
    }
}

/**
 * 融资资金流入，有一项没填就置空
 */
function calFinancingCapitalInflowSettle() {
    var financingCapitalInflowFormerSettle = $("input[name='financingCapitalInflowFormerSettle']").val();
    var financingCapitalInflow = $("input[name='financingCapitalInflow']").val();

    var financingCapitalInflowSettle = $("input[name='financingCapitalInflowSettle']");

    if(financingCapitalInflowFormerSettle && financingCapitalInflow){
        financingCapitalInflowSettle.val(f2Fixed(f2(financingCapitalInflowFormerSettle)+f2(financingCapitalInflow)));
    }else {
        financingCapitalInflowSettle.val("");
    }
}

/**
 * 还款资金流出，有一项没填就置空
 */
function calFinancingCapitalOutflowSettle() {
    var financingCapitalOutflowFormerSettle = $("input[name='financingCapitalOutflowFormerSettle']").val();
    var financingCapitalOutflow = $("input[name='financingCapitalOutflow']").val();

    var financingCapitalOutflowSettle = $("input[name='financingCapitalOutflowSettle']");

    if(financingCapitalOutflowFormerSettle && financingCapitalOutflow){
        financingCapitalOutflowSettle.val(f2Fixed(f2(financingCapitalOutflowFormerSettle)+f2(financingCapitalOutflow)));
    }else {
        financingCapitalOutflowSettle.val("");
    }
}

/**
 * 筹资活动产生的现金流量净额，有一项没填就置空
 */
function calFinancingCapitalCashflowSettle() {
    var financingCapitalCashflowFormerSettle = $("input[name='financingCapitalCashflowFormerSettle']").val();
    var financingCapitalCashflow = $("input[name='financingCapitalCashflow']").val();

    var financingCapitalCashflowSettle = $("input[name='financingCapitalCashflowSettle']");

    if(financingCapitalCashflowFormerSettle && financingCapitalCashflow){
        financingCapitalCashflowSettle.val(f2Fixed(f2(financingCapitalCashflowFormerSettle)+f2(financingCapitalCashflow)));
    }else {
        financingCapitalCashflowSettle.val("");
    }
}

/**
 * 货币资金净增加额，有一项没填就置空
 */
function calNetIncreaseMonetaryFundsSettle() {
    var netIncreaseMonetaryFundsFormerSettle = $("input[name='netIncreaseMonetaryFundsFormerSettle']").val();
    var netIncreaseMonetaryFunds = $("input[name='netIncreaseMonetaryFunds']").val();

    var netIncreaseMonetaryFundsSettle = $("input[name='netIncreaseMonetaryFundsSettle']");

    if(netIncreaseMonetaryFundsFormerSettle && netIncreaseMonetaryFunds){
        netIncreaseMonetaryFundsSettle.val(f2Fixed(f2(netIncreaseMonetaryFundsFormerSettle)+f2(netIncreaseMonetaryFunds)));
    }else {
        netIncreaseMonetaryFundsSettle.val("");
    }
}

/**
 * 本月经营活动产生的现金流量净额，有一项没填就置空
 */
function calNetCashFlow() {
    var saleIncomeCash = $("input[name='saleIncomeCash']").val();
    var taxReturn = $("input[name='taxReturn']").val();
    var earnestMoneyIncome = $("input[name='earnestMoneyIncome']").val();
    var purchaseCost = $("input[name='purchaseCost']").val();
    var taxCost = $("input[name='taxCost']").val();
    var earnestMoneyCost = $("input[name='earnestMoneyCost']").val();

    var netCashFlow = $("input[name='netCashFlow']");

    if(saleIncomeCash && taxReturn && earnestMoneyIncome &&
        purchaseCost && taxCost && earnestMoneyCost) {
        netCashFlow.val(f2Fixed(f2(saleIncomeCash)+f2(taxReturn)+f2(earnestMoneyIncome)-
            f2(purchaseCost)-f2(taxCost)-f2(earnestMoneyCost)));
    }else {
        netCashFlow.val("");
    }
}

/**
 * 本月投资活动产生的现金流量净额，有一项没填就置空
 */
function calNetCashFromInvestingActivities() {
    var cashInflowFromInvestingActivities = $("input[name='cashInflowFromInvestingActivities']").val();
    var cashOutflowFromInvestingActivities = $("input[name='cashOutflowFromInvestingActivities']").val();

    var netCashFromInvestingActivities = $("input[name='netCashFromInvestingActivities']");

    if(cashInflowFromInvestingActivities && cashOutflowFromInvestingActivities){
        netCashFromInvestingActivities.val(f2Fixed(f2(cashInflowFromInvestingActivities)-f2(cashOutflowFromInvestingActivities)));
    }else {
        netCashFromInvestingActivities.val("");
    }
}

/**
 * 本月筹资活动产生的现金流量净额，有一项没填就置空
 */
function calFinancingCapitalCashflow() {
    var financingCapitalInflow = $("input[name='financingCapitalInflow']").val();
    var financingCapitalOutflow = $("input[name='financingCapitalOutflow']").val();

    var financingCapitalCashflow = $("input[name='financingCapitalCashflow']");

    if(financingCapitalInflow && financingCapitalOutflow){
        financingCapitalCashflow.val(f2Fixed(f2(financingCapitalInflow)-f2(financingCapitalOutflow)));
    }else {
        financingCapitalCashflow.val("");
    }
}

/**
 * 本月货币资金净增加额，有一项没填就置空
 */
function calNetIncreaseMonetaryFunds() {
    var netCashFlow = $("input[name='netCashFlow']").val();
    var netCashFromInvestingActivities = $("input[name='netCashFromInvestingActivities']").val();
    var financingCapitalCashflow = $("input[name='financingCapitalCashflow']").val();

    var netIncreaseMonetaryFunds = $("input[name='netIncreaseMonetaryFunds']");

    if(netCashFlow && netCashFromInvestingActivities && financingCapitalCashflow){
        netIncreaseMonetaryFunds.val(f2Fixed(f2(netCashFlow)+f2(netCashFromInvestingActivities)+f2(financingCapitalCashflow)));
    }else {
        netIncreaseMonetaryFunds.val("");
    }
}






