diff --git a/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java b/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java index 6ba4cd3..8eef146 100644 --- a/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java +++ b/src/main/java/cn/palmte/work/controller/backend/ProjectFinalController.java @@ -1,6 +1,6 @@ package cn.palmte.work.controller.backend; -import cn.palmte.work.bean.*; +import cn.palmte.work.bean.FinalBean; import cn.palmte.work.model.Project; import cn.palmte.work.model.ProjectBudgetPlanDetail; import cn.palmte.work.model.ProjectSettleIncome; @@ -8,7 +8,11 @@ import cn.palmte.work.model.ProjectSettleIncomeRepository; import cn.palmte.work.service.*; import cn.palmte.work.utils.FreeMarkerUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.datetime.DateFormatter; +import org.springframework.format.number.NumberStyleFormatter; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -98,4 +102,9 @@ public class ProjectFinalController extends BaseController{ return "redirect:/project/list"; } + @InitBinder + public void initBinder(WebDataBinder webDataBinder) { + webDataBinder.addCustomFormatter(new DateFormatter("yyyy-MM-dd")); + webDataBinder.addCustomFormatter(new NumberStyleFormatter()); + } } diff --git a/src/main/java/cn/palmte/work/controller/backend/ProjectSettleController.java b/src/main/java/cn/palmte/work/controller/backend/ProjectSettleController.java index dbb8c4e..88e6b37 100644 --- a/src/main/java/cn/palmte/work/controller/backend/ProjectSettleController.java +++ b/src/main/java/cn/palmte/work/controller/backend/ProjectSettleController.java @@ -1,6 +1,9 @@ package cn.palmte.work.controller.backend; -import cn.palmte.work.bean.*; +import cn.palmte.work.bean.BudgetSettleBean; +import cn.palmte.work.bean.EstimateSettleBean; +import cn.palmte.work.bean.FormerBean; +import cn.palmte.work.bean.SettleBean; import cn.palmte.work.model.*; import cn.palmte.work.service.ProjectBudgetService; import cn.palmte.work.service.ProjectEstimateService; @@ -9,7 +12,11 @@ import cn.palmte.work.service.ProjectSettleService; import cn.palmte.work.utils.DateKit; import cn.palmte.work.utils.FreeMarkerUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.datetime.DateFormatter; +import org.springframework.format.number.NumberStyleFormatter; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import top.jfunc.common.utils.CollectionUtil; @@ -135,4 +142,10 @@ public class ProjectSettleController extends BaseController{ projectSettleService.saveAndApprove(project, settleBean, budgetBean, estimateBean, time); return "redirect:/project/list"; } + + @InitBinder + public void initBinder(WebDataBinder webDataBinder) { + webDataBinder.addCustomFormatter(new DateFormatter("yyyy-MM-dd")); + webDataBinder.addCustomFormatter(new NumberStyleFormatter()); + } } diff --git a/src/main/resources/static/assets/js/project_final.js b/src/main/resources/static/assets/js/project_final.js index 4bdf666..11c4846 100644 --- a/src/main/resources/static/assets/js/project_final.js +++ b/src/main/resources/static/assets/js/project_final.js @@ -4,16 +4,19 @@ function calculateFinal() { calIncomeFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("incomeDeviceFinalTotal", "input[name='incomeDeviceFinalTotal']"); }); $("input[name='incomeEngineerFinalTotal']").change(function () { calIncomeFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("incomeEngineerFinalTotal", "input[name='incomeEngineerFinalTotal']"); }); $("input[name='incomeServiceFinalTotal']").change(function () { calIncomeFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("incomeServiceFinalTotal", "input[name='incomeServiceFinalTotal']"); }); @@ -21,31 +24,37 @@ function calculateFinal() { calCostFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseDeviceFinalTotal", "input[name='costPurchaseDeviceFinalTotal']"); }); $("input[name='costPurchaseBuildFinalTotal']").change(function () { calCostFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseBuildFinalTotal", "input[name='costPurchaseBuildFinalTotal']"); }); $("input[name='costPurchaseServiceFinalTotal']").change(function () { calCostFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseServiceFinalTotal", "input[name='costPurchaseServiceFinalTotal']"); }); $("input[name='costPurchaseOtherFinalTotal']").change(function () { calCostFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseOtherFinalTotal", "input[name='costPurchaseOtherFinalTotal']"); }); $("input[name='costProjectManageFinalTotal']").change(function () { calCostFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costProjectManageFinalTotal", "input[name='costProjectManageFinalTotal']"); }); $("input[name='costOtherFinalTotal']").change(function () { calCostFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costOtherFinalTotal", "input[name='costOtherFinalTotal']"); }); @@ -53,16 +62,19 @@ function calculateFinal() { calManageFinalTotal(); calGrossProfitFinalTotal(); calGrossProfitProfitMargin(); + digitalSelf("costExpropriationFinalTotal", "input[name='costExpropriationFinalTotal']"); }); $("input[name='costCompanyManageFinalTotal']").change(function () { calManageFinalTotal(); calContributionMarginFinalTotal(); calContributionMarginProfitMargin(); + digitalSelf("costCompanyManageFinalTotal", "input[name='costCompanyManageFinalTotal']"); }); $("input[name='costIncomeTaxFinalTotal']").change(function () { calManageFinalTotal(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costIncomeTaxFinalTotal", "input[name='costIncomeTaxFinalTotal']"); }); @@ -70,31 +82,37 @@ function calculateFinal() { //calCashFluxFinalTotal(); calNetCashFlow(); calNetIncreaseMonetaryFunds(); + digitalSelf("saleIncomeCash", "input[name='saleIncomeCash']"); }); $("input[name='taxReturn']").change(function () { //calCashFluxFinalTotal(); calNetCashFlow(); calNetIncreaseMonetaryFunds(); + digitalSelf("taxReturn", "input[name='taxReturn']"); }); $("input[name='earnestMoneyIncome']").change(function () { //calCashFluxFinalTotal(); calNetCashFlow(); calNetIncreaseMonetaryFunds(); + digitalSelf("earnestMoneyIncome", "input[name='earnestMoneyIncome']"); }); $("input[name='purchaseCost']").change(function () { calCashFluxFinalTotal(); calNetCashFlow(); calNetIncreaseMonetaryFunds(); + digitalSelf("purchaseCost", "input[name='purchaseCost']"); }); $("input[name='taxCost']").change(function () { // calCashFluxFinalTotal(); calNetCashFlow(); calNetIncreaseMonetaryFunds(); + digitalSelf("taxCost", "input[name='taxCost']"); }); $("input[name='earnestMoneyCost']").change(function () { //calCashFluxFinalTotal(); calNetCashFlow(); calNetIncreaseMonetaryFunds(); + digitalSelf("earnestMoneyCost", "input[name='earnestMoneyCost']"); }); $("input[name='netCashFlow']").change(function () { // calCashFluxFinalTotal(); @@ -103,11 +121,13 @@ function calculateFinal() { // calCashFluxFinalTotal(); calNetCashFromInvestingActivities(); calNetIncreaseMonetaryFunds(); - }) + digitalSelf("cashInflowFromInvestingActivities", "input[name='cashInflowFromInvestingActivities']"); + }); $("input[name='cashOutflowFromInvestingActivities']").change(function () { //calCashFluxFinalTotal(); calNetCashFromInvestingActivities(); calNetIncreaseMonetaryFunds(); + digitalSelf("cashOutflowFromInvestingActivities", "input[name='cashOutflowFromInvestingActivities']"); }); $("input[name='netCashFromInvestingActivities']").change(function () { // calCashFluxFinalTotal(); @@ -116,11 +136,13 @@ function calculateFinal() { //calCashFluxFinalTotal(); calFinancingCapitalCashflow(); calNetIncreaseMonetaryFunds(); + digitalSelf("financingCapitalInflow", "input[name='financingCapitalInflow']"); }); $("input[name='financingCapitalOutflow']").change(function () { //calCashFluxFinalTotal(); calFinancingCapitalCashflow(); calNetIncreaseMonetaryFunds(); + digitalSelf("financingCapitalOutflow", "input[name='financingCapitalOutflow']"); }); $("input[name='financingCapitalCashflow']").change(function () { //calCashFluxFinalTotal(); @@ -148,8 +170,8 @@ function calNetCashFlow() { if (saleIncomeCash && taxReturn && earnestMoneyIncome && purchaseCost && taxCost && earnestMoneyCost) { - netCashFlow.val(f2(parseFloat(saleIncomeCash) + parseFloat(taxReturn) + parseFloat(earnestMoneyIncome) - - parseFloat(purchaseCost) - parseFloat(taxCost) - parseFloat(earnestMoneyCost))); + netCashFlow.val(f2Fixed(f2(saleIncomeCash) + f2(taxReturn) + f2(earnestMoneyIncome) + - f2(purchaseCost) - f2(taxCost) - f2(earnestMoneyCost))); } else { netCashFlow.val(""); } @@ -165,7 +187,7 @@ function calNetCashFromInvestingActivities() { var netCashFromInvestingActivities = $("input[name='netCashFromInvestingActivities']"); if (cashInflowFromInvestingActivities && cashOutflowFromInvestingActivities) { - netCashFromInvestingActivities.val(f2(parseFloat(cashInflowFromInvestingActivities) - parseFloat(cashOutflowFromInvestingActivities))); + netCashFromInvestingActivities.val(f2Fixed(f2(cashInflowFromInvestingActivities) - f2(cashOutflowFromInvestingActivities))); } else { netCashFromInvestingActivities.val(""); } @@ -181,7 +203,7 @@ function calFinancingCapitalCashflow() { var financingCapitalCashflow = $("input[name='financingCapitalCashflow']"); if (financingCapitalInflow && financingCapitalOutflow) { - financingCapitalCashflow.val(f2(parseFloat(financingCapitalInflow) - parseFloat(financingCapitalOutflow))); + financingCapitalCashflow.val(f2Fixed(f2(financingCapitalInflow) - f2(financingCapitalOutflow))); } else { financingCapitalCashflow.val(""); } @@ -195,7 +217,7 @@ function calNetIncreaseMonetaryFunds() { var netIncreaseMonetaryFunds = $("input[name='netIncreaseMonetaryFunds']"); if (netCashFlow && netCashFromInvestingActivities && financingCapitalCashflow) { - netIncreaseMonetaryFunds.val(f2(parseFloat(netCashFlow) + parseFloat(netCashFromInvestingActivities) + parseFloat(financingCapitalCashflow))); + netIncreaseMonetaryFunds.val(f2Fixed(f2(netCashFlow) + f2(netCashFromInvestingActivities) + f2(financingCapitalCashflow))); } else { netIncreaseMonetaryFunds.val(""); } @@ -212,7 +234,7 @@ function calIncomeFinalTotal() { var incomeFinalTotal = $("input[name='incomeFinalTotal']"); if (incomeDeviceFinalTotal && incomeEngineerFinalTotal && incomeServiceFinalTotal) { - incomeFinalTotal.val(f2(parseFloat(incomeDeviceFinalTotal) + parseFloat(incomeEngineerFinalTotal) + parseFloat(incomeServiceFinalTotal))); + incomeFinalTotal.val(f2Fixed(f2(incomeDeviceFinalTotal) + f2(incomeEngineerFinalTotal) + f2(incomeServiceFinalTotal))); } else { incomeFinalTotal.val(""); } @@ -233,8 +255,8 @@ function calCostFinalTotal() { if (costPurchaseDeviceFinalTotal && costPurchaseBuildFinalTotal && costPurchaseServiceFinalTotal && costPurchaseOtherFinalTotal && costProjectManageFinalTotal && costOtherFinalTotal) { - costFinalTotal.val(f2(parseFloat(costPurchaseDeviceFinalTotal) + parseFloat(costPurchaseBuildFinalTotal) + parseFloat(costPurchaseServiceFinalTotal) + - parseFloat(costPurchaseOtherFinalTotal) + parseFloat(costProjectManageFinalTotal) + parseFloat(costOtherFinalTotal))); + costFinalTotal.val(f2Fixed(f2(costPurchaseDeviceFinalTotal) + f2(costPurchaseBuildFinalTotal) + f2(costPurchaseServiceFinalTotal) + + f2(costPurchaseOtherFinalTotal) + f2(costProjectManageFinalTotal) + f2(costOtherFinalTotal))); } else { costFinalTotal.val(""); } @@ -252,7 +274,7 @@ function calManageFinalTotal() { var manageFinalTotal = $("input[name='manageFinalTotal']"); if (costExpropriationFinalTotal && costCompanyManageFinalTotal && costIncomeTaxFinalTotal) { - manageFinalTotal.val(f2(parseFloat(costExpropriationFinalTotal) + parseFloat(costCompanyManageFinalTotal) + parseFloat(costIncomeTaxFinalTotal))); + manageFinalTotal.val(f2Fixed(f2(costExpropriationFinalTotal) + f2(costCompanyManageFinalTotal) + f2(costIncomeTaxFinalTotal))); } else { manageFinalTotal.val(""); } @@ -284,11 +306,11 @@ function calCashFluxFinalTotal() { netCashFlow && cashInflowFromInvestingActivities && cashOutflowFromInvestingActivities && netCashFromInvestingActivities && financingCapitalInflow && financingCapitalOutflow && financingCapitalCashflow && netIncreaseMonetaryFunds) { - cashFluxFinalTotal.val(f2(parseFloat(saleIncomeCash) + parseFloat(taxReturn) + parseFloat(earnestMoneyIncome) + - parseFloat(purchaseCost) + parseFloat(taxCost) + parseFloat(earnestMoneyCost) + - parseFloat(netCashFlow) + parseFloat(cashInflowFromInvestingActivities) + parseFloat(cashOutflowFromInvestingActivities) + - parseFloat(netCashFromInvestingActivities) + parseFloat(financingCapitalInflow) + parseFloat(financingCapitalOutflow) + - parseFloat(financingCapitalCashflow) + parseFloat(netIncreaseMonetaryFunds))); + cashFluxFinalTotal.val(f2Fixed(f2(saleIncomeCash) + f2(taxReturn) + f2(earnestMoneyIncome) + + f2(purchaseCost) + f2(taxCost) + f2(earnestMoneyCost) + + f2(netCashFlow) + f2(cashInflowFromInvestingActivities) + f2(cashOutflowFromInvestingActivities) + + f2(netCashFromInvestingActivities) + f2(financingCapitalInflow) + f2(financingCapitalOutflow) + + f2(financingCapitalCashflow) + f2(netIncreaseMonetaryFunds))); } else { cashFluxFinalTotal.val(""); } @@ -305,7 +327,7 @@ function calGrossProfitFinalTotal() { var grossProfitFinalTotal = $("input[name='grossProfitFinalTotal']"); if (incomeFinalTotal && costFinalTotal && costExpropriationFinalTotal) { - grossProfitFinalTotal.val(f2(parseFloat(incomeFinalTotal) - parseFloat(costFinalTotal) - parseFloat(costExpropriationFinalTotal))); + grossProfitFinalTotal.val(f2Fixed(f2(incomeFinalTotal) - f2(costFinalTotal) - f2(costExpropriationFinalTotal))); } else { grossProfitFinalTotal.val(""); } @@ -320,7 +342,7 @@ function calGrossProfitProfitMargin() { var grossProfitProfitMargin = $("input[name='grossProfitProfitMargin']"); if (grossProfitFinalTotal && incomeFinalTotal) { - grossProfitProfitMargin.val(f2(100 * parseFloat(grossProfitFinalTotal) / parseFloat(incomeFinalTotal))); + grossProfitProfitMargin.val(f2Fixed(100 * f2(grossProfitFinalTotal) / f2(incomeFinalTotal))); } else { grossProfitProfitMargin.val(""); } @@ -337,7 +359,7 @@ function calContributionMarginFinalTotal() { var contributionMarginFinalTotal = $("input[name='contributionMarginFinalTotal']"); if (grossProfitFinalTotal && costCompanyManageFinalTotal) { - contributionMarginFinalTotal.val(f2(parseFloat(grossProfitFinalTotal) - parseFloat(costCompanyManageFinalTotal))); + contributionMarginFinalTotal.val(f2Fixed(f2(grossProfitFinalTotal) - f2(costCompanyManageFinalTotal))); } else { contributionMarginFinalTotal.val(""); } @@ -352,7 +374,7 @@ function calContributionMarginProfitMargin() { var contributionMarginProfitMargin = $("input[name='contributionMarginProfitMargin']"); if (contributionMarginFinalTotal && incomeFinalTotal) { - contributionMarginProfitMargin.val(f2(100 * parseFloat(contributionMarginFinalTotal) / parseFloat(incomeFinalTotal))); + contributionMarginProfitMargin.val(f2Fixed(100 * f2(contributionMarginFinalTotal) / f2(incomeFinalTotal))); } else { contributionMarginProfitMargin.val(""); } @@ -369,7 +391,7 @@ function calNetMarginFinalTotal() { var netMarginFinalTotal = $("input[name='netMarginFinalTotal']"); if (contributionMarginFinalTotal && costIncomeTaxFinalTotal) { - netMarginFinalTotal.val(f2(parseFloat(contributionMarginFinalTotal) - parseFloat(costIncomeTaxFinalTotal))); + netMarginFinalTotal.val(f2Fixed(f2(contributionMarginFinalTotal) - f2(costIncomeTaxFinalTotal))); } else { netMarginFinalTotal.val(""); } @@ -384,23 +406,12 @@ function calNetMarginProfitMargin() { var netMarginProfitMargin = $("input[name='netMarginProfitMargin']"); if (netMarginFinalTotal && incomeFinalTotal) { - netMarginProfitMargin.val(f2(100 * parseFloat(netMarginFinalTotal) / parseFloat(incomeFinalTotal))); + netMarginProfitMargin.val(f2Fixed(100 * f2(netMarginFinalTotal) / f2(incomeFinalTotal))); } else { netMarginProfitMargin.val(""); } } -function f2(x) { - if(!x){ - return 0; - } - var f = parseFloat(x); - if (isNaN(f)) { - return 0; - } - return Math.round(x*100)/100; -} - diff --git a/src/main/resources/static/assets/js/project_settle.js b/src/main/resources/static/assets/js/project_settle.js index a3023a5..e568638 100644 --- a/src/main/resources/static/assets/js/project_settle.js +++ b/src/main/resources/static/assets/js/project_settle.js @@ -5,18 +5,21 @@ function calculateSettle() { 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']"); }); @@ -25,36 +28,42 @@ function calculateSettle() { 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']"); }); @@ -63,6 +72,7 @@ function calculateSettle() { calCostManageTotal(); calCostManageSettleTotal(); calProfit(); + digitalSelf("costExpropriation", "input[name='costExpropriation']"); }); $("input[name='costCompanyManage']").change(function () { calCostCompanyManageSettleTotal(); @@ -75,6 +85,7 @@ function calculateSettle() { calNetProfit(); calNetProfitSettleTotal(); calNetProfitProfitMargin(); + digitalSelf("costCompanyManage", "input[name='costCompanyManage']"); }); $("input[name='costIncomeTax']").change(function () { calCostIncomeTaxSettleTotal(); @@ -84,6 +95,7 @@ function calculateSettle() { calNetProfit(); calNetProfitSettleTotal(); calNetProfitProfitMargin(); + digitalSelf("costIncomeTax", "input[name='costIncomeTax']"); }); @@ -107,6 +119,7 @@ function calculateSettle() { calNetCashFlowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("saleIncomeCash", "input[name='saleIncomeCash']"); }); $("input[name='taxReturn']").change(function () { calTaxReturnSettle(); @@ -114,6 +127,7 @@ function calculateSettle() { calNetCashFlowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("taxReturn", "input[name='taxReturn']"); }); $("input[name='earnestMoneyIncome']").change(function () { calEarnestMoneyIncomeSettle(); @@ -121,6 +135,7 @@ function calculateSettle() { calNetCashFlowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("earnestMoneyIncome", "input[name='earnestMoneyIncome']"); }); $("input[name='purchaseCost']").change(function () { calPurchaseCostSettle(); @@ -128,6 +143,7 @@ function calculateSettle() { calNetCashFlowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("purchaseCost", "input[name='purchaseCost']"); }); $("input[name='taxCost']").change(function () { calTaxCostSettle(); @@ -135,6 +151,7 @@ function calculateSettle() { calNetCashFlowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("taxCost", "input[name='taxCost']"); }); $("input[name='earnestMoneyCost']").change(function () { calEarnestMoneyCostSettle(); @@ -142,6 +159,7 @@ function calculateSettle() { calNetCashFlowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("earnestMoneyCost", "input[name='earnestMoneyCost']"); }); // $("input[name='netCashFlow']").change(function () { // calNetCashFlowSettle(); @@ -155,6 +173,7 @@ function calculateSettle() { calNetCashFromInvestingActivitiesSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("cashInflowFromInvestingActivities", "input[name='cashInflowFromInvestingActivities']"); }); $("input[name='cashOutflowFromInvestingActivities']").change(function () { calCashOutflowFromInvestingActivitiesSettle(); @@ -162,6 +181,7 @@ function calculateSettle() { calNetCashFromInvestingActivitiesSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("cashOutflowFromInvestingActivities", "input[name='cashOutflowFromInvestingActivities']"); }); // $("input[name='netCashFromInvestingActivities']").change(function () { // calNetCashFromInvestingActivitiesSettle(); @@ -175,6 +195,7 @@ function calculateSettle() { calFinancingCapitalCashflowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("financingCapitalInflow", "input[name='financingCapitalInflow']"); }); $("input[name='financingCapitalOutflow']").change(function () { calFinancingCapitalOutflowSettle(); @@ -182,6 +203,7 @@ function calculateSettle() { calFinancingCapitalCashflowSettle(); calNetIncreaseMonetaryFunds(); calNetIncreaseMonetaryFundsSettle(); + digitalSelf("financingCapitalOutflow", "input[name='financingCapitalOutflow']"); }); // $("input[name='financingCapitalCashflow']").change(function () { // calFinancingCapitalCashflowSettle(); @@ -222,7 +244,7 @@ function calIncomeDeviceSettleTotal() { var incomeDeviceSettleTotal = $("input[name='incomeDeviceSettleTotal']"); if(incomeDeviceFormerSettleTotal && incomeDevice){ - incomeDeviceSettleTotal.val(f2(parseFloat(incomeDeviceFormerSettleTotal)+parseFloat(incomeDevice))); + incomeDeviceSettleTotal.val(f2Fixed(f2(incomeDeviceFormerSettleTotal)+f2(incomeDevice))); }else { incomeDeviceSettleTotal.val(""); } @@ -238,7 +260,7 @@ function calIncomeEngineerSettleTotal() { var incomeEngineerSettleTotal = $("input[name='incomeEngineerSettleTotal']"); if(incomeEngineerFormerSettleTotal && incomeEngineer){ - incomeEngineerSettleTotal.val(f2(parseFloat(incomeEngineerFormerSettleTotal)+parseFloat(incomeEngineer))); + incomeEngineerSettleTotal.val(f2Fixed(f2(incomeEngineerFormerSettleTotal)+f2(incomeEngineer))); }else { incomeEngineerSettleTotal.val(""); } @@ -254,7 +276,7 @@ function calIncomeServiceSettleTotal() { var incomeServiceSettleTotal = $("input[name='incomeServiceSettleTotal']"); if(incomeServiceFormerSettleTotal && incomeService){ - incomeServiceSettleTotal.val(f2(parseFloat(incomeServiceFormerSettleTotal)+parseFloat(incomeService))); + incomeServiceSettleTotal.val(f2Fixed(f2(incomeServiceFormerSettleTotal)+f2(incomeService))); }else { incomeServiceSettleTotal.val(""); } @@ -271,7 +293,7 @@ function calIncomeTotal() { var incomeTotal = $("input[name='incomeTotal']"); if(incomeDevice && incomeEngineer && incomeService){ - incomeTotal.val(f2(parseFloat(incomeDevice)+parseFloat(incomeEngineer)+parseFloat(incomeService))); + incomeTotal.val(f2Fixed(f2(incomeDevice)+f2(incomeEngineer)+f2(incomeService))); }else { incomeTotal.val(""); } @@ -288,7 +310,7 @@ function calIncomeSettleTotal() { var incomeSettleTotal = $("input[name='incomeSettleTotal']"); if(incomeDeviceSettleTotal && incomeEngineerSettleTotal && incomeServiceSettleTotal){ - incomeSettleTotal.val(f2(parseFloat(incomeDeviceSettleTotal)+parseFloat(incomeEngineerSettleTotal)+parseFloat(incomeServiceSettleTotal))); + incomeSettleTotal.val(f2Fixed(f2(incomeDeviceSettleTotal)+f2(incomeEngineerSettleTotal)+f2(incomeServiceSettleTotal))); }else { incomeSettleTotal.val(""); } @@ -304,7 +326,7 @@ function calCostPurchaseDeviceSettleTotal() { var costPurchaseDeviceSettleTotal = $("input[name='costPurchaseDeviceSettleTotal']"); if(costPurchaseDeviceFormerSettleTotal && costPurchaseDevice){ - costPurchaseDeviceSettleTotal.val(f2(parseFloat(costPurchaseDeviceFormerSettleTotal)+parseFloat(costPurchaseDevice))); + costPurchaseDeviceSettleTotal.val(f2Fixed(f2(costPurchaseDeviceFormerSettleTotal)+f2(costPurchaseDevice))); }else { costPurchaseDeviceSettleTotal.val(""); } @@ -320,7 +342,7 @@ function calCostPurchaseBuildSettleTotal() { var costPurchaseBuildSettleTotal = $("input[name='costPurchaseBuildSettleTotal']"); if(costPurchaseBuildFormerSettleTotal && costPurchaseBuild){ - costPurchaseBuildSettleTotal.val(f2(parseFloat(costPurchaseBuildFormerSettleTotal)+parseFloat(costPurchaseBuild))); + costPurchaseBuildSettleTotal.val(f2Fixed(f2(costPurchaseBuildFormerSettleTotal)+f2(costPurchaseBuild))); }else { costPurchaseBuildSettleTotal.val(""); } @@ -336,7 +358,7 @@ function calCostPurchaseServiceSettleTotal() { var costPurchaseServiceSettleTotal = $("input[name='costPurchaseServiceSettleTotal']"); if(costPurchaseServiceFormerSettleTotal && costPurchaseService){ - costPurchaseServiceSettleTotal.val(f2(parseFloat(costPurchaseServiceFormerSettleTotal)+parseFloat(costPurchaseService))); + costPurchaseServiceSettleTotal.val(f2Fixed(f2(costPurchaseServiceFormerSettleTotal)+f2(costPurchaseService))); }else { costPurchaseServiceSettleTotal.val(""); } @@ -352,7 +374,7 @@ function calCostPurchaseOtherSettleTotal() { var costPurchaseOtherSettleTotal = $("input[name='costPurchaseOtherSettleTotal']"); if(costPurchaseOtherFormerSettleTotal && costPurchaseOther){ - costPurchaseOtherSettleTotal.val(f2(parseFloat(costPurchaseOtherFormerSettleTotal)+parseFloat(costPurchaseOther))); + costPurchaseOtherSettleTotal.val(f2Fixed(f2(costPurchaseOtherFormerSettleTotal)+f2(costPurchaseOther))); }else { costPurchaseOtherSettleTotal.val(""); } @@ -368,7 +390,7 @@ function calCostProjectManageSettleTotal() { var costProjectManageSettleTotal = $("input[name='costProjectManageSettleTotal']"); if(costProjectManageFormerSettleTotal && costProjectManage){ - costProjectManageSettleTotal.val(f2(parseFloat(costProjectManageFormerSettleTotal)+parseFloat(costProjectManage))); + costProjectManageSettleTotal.val(f2Fixed(f2(costProjectManageFormerSettleTotal)+f2(costProjectManage))); }else { costProjectManageSettleTotal.val(""); } @@ -384,7 +406,7 @@ function calCostOtherSettleTotal() { var costOtherSettleTotal = $("input[name='costOtherSettleTotal']"); if(costOtherFormerSettleTotal && costOther){ - costOtherSettleTotal.val(f2(parseFloat(costOtherFormerSettleTotal)+parseFloat(costOther))); + costOtherSettleTotal.val(f2Fixed(f2(costOtherFormerSettleTotal)+f2(costOther))); }else { costOtherSettleTotal.val(""); } @@ -404,7 +426,7 @@ function calCostTotal() { var costTotal = $("input[name='costTotal']"); if(costPurchaseDevice && costPurchaseBuild && costPurchaseService && costPurchaseOther && costProjectManage && costOther){ - costTotal.val(f2(parseFloat(costPurchaseDevice)+parseFloat(costPurchaseBuild)+parseFloat(costPurchaseService)+parseFloat(costPurchaseOther)+parseFloat(costProjectManage)+parseFloat(costOther))); + costTotal.val(f2Fixed(f2(costPurchaseDevice)+f2(costPurchaseBuild)+f2(costPurchaseService)+f2(costPurchaseOther)+f2(costProjectManage)+f2(costOther))); }else { costTotal.val(""); } @@ -425,8 +447,8 @@ function calCostSettleTotal() { if(costPurchaseDeviceSettleTotal && costPurchaseBuildSettleTotal && costPurchaseServiceSettleTotal && costPurchaseOtherSettleTotal && costProjectManageSettleTotal && costOtherSettleTotal){ - costSettleTotal.val(f2(parseFloat(costPurchaseDeviceSettleTotal)+parseFloat(costPurchaseBuildSettleTotal)+parseFloat(costPurchaseServiceSettleTotal)+ - parseFloat(costPurchaseOtherSettleTotal)+parseFloat(costProjectManageSettleTotal)+parseFloat(costOtherSettleTotal))); + costSettleTotal.val(f2Fixed(f2(costPurchaseDeviceSettleTotal)+f2(costPurchaseBuildSettleTotal)+f2(costPurchaseServiceSettleTotal)+ + f2(costPurchaseOtherSettleTotal)+f2(costProjectManageSettleTotal)+f2(costOtherSettleTotal))); }else { costSettleTotal.val(""); } @@ -442,7 +464,7 @@ function calCostExpropriationSettleTotal() { var costExpropriationSettleTotal = $("input[name='costExpropriationSettleTotal']"); if(costExpropriationFormerSettleTotal && costExpropriation){ - costExpropriationSettleTotal.val(f2(parseFloat(costExpropriationFormerSettleTotal)+parseFloat(costExpropriation))); + costExpropriationSettleTotal.val(f2Fixed(f2(costExpropriationFormerSettleTotal)+f2(costExpropriation))); }else { costExpropriationSettleTotal.val(""); } @@ -458,7 +480,7 @@ function calCostCompanyManageSettleTotal() { var costCompanyManageSettleTotal = $("input[name='costCompanyManageSettleTotal']"); if(costCompanyManageFormerSettleTotal && costCompanyManage){ - costCompanyManageSettleTotal.val(f2(parseFloat(costCompanyManageFormerSettleTotal)+parseFloat(costCompanyManage))); + costCompanyManageSettleTotal.val(f2Fixed(f2(costCompanyManageFormerSettleTotal)+f2(costCompanyManage))); }else { costCompanyManageSettleTotal.val(""); } @@ -474,7 +496,7 @@ function calCostIncomeTaxSettleTotal() { var costIncomeTaxSettleTotal = $("input[name='costIncomeTaxSettleTotal']"); if(costIncomeTaxFormerSettleTotal && costIncomeTax){ - costIncomeTaxSettleTotal.val(f2(parseFloat(costIncomeTaxFormerSettleTotal)+parseFloat(costIncomeTax))); + costIncomeTaxSettleTotal.val(f2Fixed(f2(costIncomeTaxFormerSettleTotal)+f2(costIncomeTax))); }else { costIncomeTaxSettleTotal.val(""); } @@ -491,7 +513,7 @@ function calCostManageTotal() { var costManageTotal = $("input[name='costManageTotal']"); if(costExpropriation && costCompanyManage && costIncomeTax){ - costManageTotal.val(f2(parseFloat(costExpropriation)+parseFloat(costCompanyManage)+parseFloat(costIncomeTax))); + costManageTotal.val(f2Fixed(f2(costExpropriation)+f2(costCompanyManage)+f2(costIncomeTax))); }else { costManageTotal.val(""); } @@ -508,7 +530,7 @@ function calCostManageSettleTotal() { var costManageSettleTotal = $("input[name='costManageSettleTotal']"); if(costExpropriationSettleTotal && costCompanyManageSettleTotal && costIncomeTaxSettleTotal){ - costManageSettleTotal.val(f2(parseFloat(costExpropriationSettleTotal)+parseFloat(costCompanyManageSettleTotal)+parseFloat(costIncomeTaxSettleTotal))); + costManageSettleTotal.val(f2Fixed(f2(costExpropriationSettleTotal)+f2(costCompanyManageSettleTotal)+f2(costIncomeTaxSettleTotal))); }else { costManageSettleTotal.val(""); } @@ -525,7 +547,7 @@ function calGrossProfit() { var grossProfit = $("input[name='grossProfit']"); if(incomeTotal && costTotal && costExpropriation){ - grossProfit.val(f2(parseFloat(incomeTotal)-parseFloat(costTotal)-parseFloat(costExpropriation))); + grossProfit.val(f2Fixed(f2(incomeTotal)-f2(costTotal)-f2(costExpropriation))); }else { grossProfit.val(""); } @@ -541,7 +563,7 @@ function calGrossProfitSettleTotal() { var grossProfitSettleTotal = $("input[name='grossProfitSettleTotal']"); if(grossProfitFormerSettleTotal && grossProfit){ - grossProfitSettleTotal.val(f2(parseFloat(grossProfitFormerSettleTotal)+parseFloat(grossProfit))); + grossProfitSettleTotal.val(f2Fixed(f2(grossProfitFormerSettleTotal)+f2(grossProfit))); }else { grossProfitSettleTotal.val(""); } @@ -557,7 +579,7 @@ function calGrossProfitProfitMargin() { var grossProfitProfitMargin = $("input[name='grossProfitProfitMargin']"); if(grossProfitSettleTotal && incomeSettleTotal){ - grossProfitProfitMargin.val(f2(100*(parseFloat(grossProfitSettleTotal)/parseFloat(incomeSettleTotal)))); + grossProfitProfitMargin.val(f2Fixed(100*(f2(grossProfitSettleTotal)/f2(incomeSettleTotal)))); }else { grossProfitProfitMargin.val(""); } @@ -573,7 +595,7 @@ function calContributionProfit() { var contributionProfit = $("input[name='contributionProfit']"); if(grossProfit && costCompanyManage){ - contributionProfit.val(f2(parseFloat(grossProfit)-parseFloat(costCompanyManage))); + contributionProfit.val(f2Fixed(f2(grossProfit)-f2(costCompanyManage))); }else { contributionProfit.val(""); } @@ -589,7 +611,7 @@ function calContributionProfitSettleTotal() { var contributionProfitSettleTotal = $("input[name='contributionProfitSettleTotal']"); if(contributionProfitFormerSettleTotal && contributionProfit){ - contributionProfitSettleTotal.val(f2(parseFloat(contributionProfitFormerSettleTotal)+parseFloat(contributionProfit))); + contributionProfitSettleTotal.val(f2Fixed(f2(contributionProfitFormerSettleTotal)+f2(contributionProfit))); }else { contributionProfitSettleTotal.val(""); } @@ -605,7 +627,7 @@ function calContributionProfitProfitMargin() { var contributionProfitProfitMargin = $("input[name='contributionProfitProfitMargin']"); if(contributionProfitSettleTotal && incomeSettleTotal){ - contributionProfitProfitMargin.val(f2(100*(parseFloat(contributionProfitSettleTotal)/parseFloat(incomeSettleTotal)))); + contributionProfitProfitMargin.val(f2Fixed(100*(f2(contributionProfitSettleTotal)/f2(incomeSettleTotal)))); }else { contributionProfitProfitMargin.val(""); } @@ -621,7 +643,7 @@ function calNetProfit() { var netProfit = $("input[name='netProfit']"); if(contributionProfit && costIncomeTax){ - netProfit.val(f2(parseFloat(contributionProfit)-parseFloat(costIncomeTax))); + netProfit.val(f2Fixed(f2(contributionProfit)-f2(costIncomeTax))); }else { netProfit.val(""); } @@ -637,7 +659,7 @@ function calNetProfitSettleTotal() { var netProfitSettleTotal = $("input[name='netProfitSettleTotal']"); if(netProfitFormerSettleTotal && netProfit){ - netProfitSettleTotal.val(f2(parseFloat(netProfitFormerSettleTotal)+parseFloat(netProfit))); + netProfitSettleTotal.val(f2Fixed(f2(netProfitFormerSettleTotal)+f2(netProfit))); }else { netProfitSettleTotal.val(""); } @@ -653,7 +675,7 @@ function calNetProfitProfitMargin() { var netProfitProfitMargin = $("input[name='netProfitProfitMargin']"); if(netProfitSettleTotal && incomeSettleTotal){ - netProfitProfitMargin.val(f2(100*(parseFloat(netProfitSettleTotal)/parseFloat(incomeSettleTotal)))); + netProfitProfitMargin.val(f2Fixed(100*(f2(netProfitSettleTotal)/f2(incomeSettleTotal)))); }else { netProfitProfitMargin.val(""); } @@ -669,7 +691,7 @@ function calSaleIncomeCashSettle() { var saleIncomeCashSettle = $("input[name='saleIncomeCashSettle']"); if(saleIncomeCashFormerSettle && saleIncomeCash){ - saleIncomeCashSettle.val(f2(parseFloat(saleIncomeCashFormerSettle)+parseFloat(saleIncomeCash))); + saleIncomeCashSettle.val(f2Fixed(f2(saleIncomeCashFormerSettle)+f2(saleIncomeCash))); }else { saleIncomeCashSettle.val(""); } @@ -685,7 +707,7 @@ function calTaxReturnSettle() { var taxReturnSettle = $("input[name='taxReturnSettle']"); if(taxReturnFormerSettle && taxReturn){ - taxReturnSettle.val(f2(parseFloat(taxReturnFormerSettle)+parseFloat(taxReturn))); + taxReturnSettle.val(f2Fixed(f2(taxReturnFormerSettle)+f2(taxReturn))); }else { taxReturnSettle.val(""); } @@ -701,7 +723,7 @@ function calEarnestMoneyIncomeSettle() { var earnestMoneyIncomeSettle = $("input[name='earnestMoneyIncomeSettle']"); if(earnestMoneyIncomeFormerSettle && earnestMoneyIncome){ - earnestMoneyIncomeSettle.val(f2(parseFloat(earnestMoneyIncomeFormerSettle)+parseFloat(earnestMoneyIncome))); + earnestMoneyIncomeSettle.val(f2Fixed(f2(earnestMoneyIncomeFormerSettle)+f2(earnestMoneyIncome))); }else { earnestMoneyIncomeSettle.val(""); } @@ -717,7 +739,7 @@ function calPurchaseCostSettle() { var purchaseCostSettle = $("input[name='purchaseCostSettle']"); if(purchaseCostFormerSettle && purchaseCost){ - purchaseCostSettle.val(f2(parseFloat(purchaseCostFormerSettle)+parseFloat(purchaseCost))); + purchaseCostSettle.val(f2Fixed(f2(purchaseCostFormerSettle)+f2(purchaseCost))); }else { purchaseCostSettle.val(""); } @@ -733,7 +755,7 @@ function calTaxCostSettle() { var taxCostSettle = $("input[name='taxCostSettle']"); if(taxCostFormerSettle && taxCost){ - taxCostSettle.val(f2(parseFloat(taxCostFormerSettle)+parseFloat(taxCost))); + taxCostSettle.val(f2Fixed(f2(taxCostFormerSettle)+f2(taxCost))); }else { taxCostSettle.val(""); } @@ -750,7 +772,7 @@ function calEarnestMoneyCostSettle() { var earnestMoneyCostSettle = $("input[name='earnestMoneyCostSettle']"); if(earnestMoneyCostFormerSettle && earnestMoneyCost){ - earnestMoneyCostSettle.val(f2(parseFloat(earnestMoneyCostFormerSettle)+parseFloat(earnestMoneyCost))); + earnestMoneyCostSettle.val(f2Fixed(f2(earnestMoneyCostFormerSettle)+f2(earnestMoneyCost))); }else { earnestMoneyCostSettle.val(""); } @@ -766,7 +788,7 @@ function calNetCashFlowSettle() { var netCashFlowSettle = $("input[name='netCashFlowSettle']"); if(netCashFlowFormerSettle && netCashFlow){ - netCashFlowSettle.val(f2(parseFloat(netCashFlowFormerSettle)+parseFloat(netCashFlow))); + netCashFlowSettle.val(f2Fixed(f2(netCashFlowFormerSettle)+f2(netCashFlow))); }else { netCashFlowSettle.val(""); } @@ -782,7 +804,7 @@ function calCashInflowFromInvestingActivitiesSettle() { var cashInflowFromInvestingActivitiesSettle = $("input[name='cashInflowFromInvestingActivitiesSettle']"); if(cashInflowFromInvestingActivitiesFormerSettle && cashInflowFromInvestingActivities){ - cashInflowFromInvestingActivitiesSettle.val(f2(parseFloat(cashInflowFromInvestingActivitiesFormerSettle)+parseFloat(cashInflowFromInvestingActivities))); + cashInflowFromInvestingActivitiesSettle.val(f2Fixed(f2(cashInflowFromInvestingActivitiesFormerSettle)+f2(cashInflowFromInvestingActivities))); }else { cashInflowFromInvestingActivitiesSettle.val(""); } @@ -798,7 +820,7 @@ function calCashOutflowFromInvestingActivitiesSettle() { var cashOutflowFromInvestingActivitiesSettle = $("input[name='cashOutflowFromInvestingActivitiesSettle']"); if(cashOutflowFromInvestingActivitiesFormerSettle && cashOutflowFromInvestingActivities){ - cashOutflowFromInvestingActivitiesSettle.val(f2(parseFloat(cashOutflowFromInvestingActivitiesFormerSettle)+parseFloat(cashOutflowFromInvestingActivities))); + cashOutflowFromInvestingActivitiesSettle.val(f2Fixed(f2(cashOutflowFromInvestingActivitiesFormerSettle)+f2(cashOutflowFromInvestingActivities))); }else { cashOutflowFromInvestingActivitiesSettle.val(""); } @@ -814,7 +836,7 @@ function calNetCashFromInvestingActivitiesSettle() { var netCashFromInvestingActivitiesSettle = $("input[name='netCashFromInvestingActivitiesSettle']"); if(netCashFromInvestingActivitiesFormerSettle && netCashFromInvestingActivities){ - netCashFromInvestingActivitiesSettle.val(f2(parseFloat(netCashFromInvestingActivitiesFormerSettle)+parseFloat(netCashFromInvestingActivities))); + netCashFromInvestingActivitiesSettle.val(f2Fixed(f2(netCashFromInvestingActivitiesFormerSettle)+f2(netCashFromInvestingActivities))); }else { netCashFromInvestingActivitiesSettle.val(""); } @@ -830,7 +852,7 @@ function calFinancingCapitalInflowSettle() { var financingCapitalInflowSettle = $("input[name='financingCapitalInflowSettle']"); if(financingCapitalInflowFormerSettle && financingCapitalInflow){ - financingCapitalInflowSettle.val(f2(parseFloat(financingCapitalInflowFormerSettle)+parseFloat(financingCapitalInflow))); + financingCapitalInflowSettle.val(f2Fixed(f2(financingCapitalInflowFormerSettle)+f2(financingCapitalInflow))); }else { financingCapitalInflowSettle.val(""); } @@ -846,7 +868,7 @@ function calFinancingCapitalOutflowSettle() { var financingCapitalOutflowSettle = $("input[name='financingCapitalOutflowSettle']"); if(financingCapitalOutflowFormerSettle && financingCapitalOutflow){ - financingCapitalOutflowSettle.val(f2(parseFloat(financingCapitalOutflowFormerSettle)+parseFloat(financingCapitalOutflow))); + financingCapitalOutflowSettle.val(f2Fixed(f2(financingCapitalOutflowFormerSettle)+f2(financingCapitalOutflow))); }else { financingCapitalOutflowSettle.val(""); } @@ -862,7 +884,7 @@ function calFinancingCapitalCashflowSettle() { var financingCapitalCashflowSettle = $("input[name='financingCapitalCashflowSettle']"); if(financingCapitalCashflowFormerSettle && financingCapitalCashflow){ - financingCapitalCashflowSettle.val(f2(parseFloat(financingCapitalCashflowFormerSettle)+parseFloat(financingCapitalCashflow))); + financingCapitalCashflowSettle.val(f2Fixed(f2(financingCapitalCashflowFormerSettle)+f2(financingCapitalCashflow))); }else { financingCapitalCashflowSettle.val(""); } @@ -878,7 +900,7 @@ function calNetIncreaseMonetaryFundsSettle() { var netIncreaseMonetaryFundsSettle = $("input[name='netIncreaseMonetaryFundsSettle']"); if(netIncreaseMonetaryFundsFormerSettle && netIncreaseMonetaryFunds){ - netIncreaseMonetaryFundsSettle.val(f2(parseFloat(netIncreaseMonetaryFundsFormerSettle)+parseFloat(netIncreaseMonetaryFunds))); + netIncreaseMonetaryFundsSettle.val(f2Fixed(f2(netIncreaseMonetaryFundsFormerSettle)+f2(netIncreaseMonetaryFunds))); }else { netIncreaseMonetaryFundsSettle.val(""); } @@ -899,8 +921,8 @@ function calNetCashFlow() { if(saleIncomeCash && taxReturn && earnestMoneyIncome && purchaseCost && taxCost && earnestMoneyCost) { - netCashFlow.val(f2(parseFloat(saleIncomeCash)+parseFloat(taxReturn)+parseFloat(earnestMoneyIncome)- - parseFloat(purchaseCost)-parseFloat(taxCost)-parseFloat(earnestMoneyCost))); + netCashFlow.val(f2Fixed(f2(saleIncomeCash)+f2(taxReturn)+f2(earnestMoneyIncome)- + f2(purchaseCost)-f2(taxCost)-f2(earnestMoneyCost))); }else { netCashFlow.val(""); } @@ -916,7 +938,7 @@ function calNetCashFromInvestingActivities() { var netCashFromInvestingActivities = $("input[name='netCashFromInvestingActivities']"); if(cashInflowFromInvestingActivities && cashOutflowFromInvestingActivities){ - netCashFromInvestingActivities.val(f2(parseFloat(cashInflowFromInvestingActivities)-parseFloat(cashOutflowFromInvestingActivities))); + netCashFromInvestingActivities.val(f2Fixed(f2(cashInflowFromInvestingActivities)-f2(cashOutflowFromInvestingActivities))); }else { netCashFromInvestingActivities.val(""); } @@ -932,7 +954,7 @@ function calFinancingCapitalCashflow() { var financingCapitalCashflow = $("input[name='financingCapitalCashflow']"); if(financingCapitalInflow && financingCapitalOutflow){ - financingCapitalCashflow.val(f2(parseFloat(financingCapitalInflow)-parseFloat(financingCapitalOutflow))); + financingCapitalCashflow.val(f2Fixed(f2(financingCapitalInflow)-f2(financingCapitalOutflow))); }else { financingCapitalCashflow.val(""); } @@ -949,23 +971,12 @@ function calNetIncreaseMonetaryFunds() { var netIncreaseMonetaryFunds = $("input[name='netIncreaseMonetaryFunds']"); if(netCashFlow && netCashFromInvestingActivities && financingCapitalCashflow){ - netIncreaseMonetaryFunds.val(f2(parseFloat(netCashFlow)+parseFloat(netCashFromInvestingActivities)+parseFloat(financingCapitalCashflow))); + netIncreaseMonetaryFunds.val(f2Fixed(f2(netCashFlow)+f2(netCashFromInvestingActivities)+f2(financingCapitalCashflow))); }else { netIncreaseMonetaryFunds.val(""); } } -function f2(x) { - if(!x){ - return 0; - } - var f = parseFloat(x); - if (isNaN(f)) { - return 0; - } - return Math.round(x*100)/100; -} - diff --git a/src/main/resources/templates/admin/project_approve.ftl b/src/main/resources/templates/admin/project_approve.ftl index e82c6b6..56c91e9 100644 --- a/src/main/resources/templates/admin/project_approve.ftl +++ b/src/main/resources/templates/admin/project_approve.ftl @@ -283,26 +283,26 @@ 收入 设备类 - - + + 收入 工程类 - - + + 收入 服务类 - - + + 合计 - - + + @@ -320,50 +320,50 @@ 成本 采购成本 设备 - - + + 成本 采购成本 施工 - - + + 成本 采购成本 服务 - - + + 成本 采购成本 其他 - - + + 成本 项目管理成本 项目管理成本 - - + + 成本 其他 ${project.otherName!} - - + + 合计 - - + + @@ -378,12 +378,12 @@ 财务费用 资金占用成本 - + 公司管理费用 - + @@ -397,19 +397,19 @@ 项目毛利(元) - + 项目毛利率(%) - + 项目贡献利润(元) - + 项目贡献利润率(%) - + @@ -444,26 +444,26 @@ 收入 设备类 - - + + 收入 工程类 - - + + 收入 服务类 - - + + 合计 - - + + @@ -483,50 +483,50 @@ 成本 采购成本 设备 - - + + 成本 采购成本 施工 - - + + 成本 采购成本 服务 - - + + 成本 采购成本 其他 - - + + 成本 项目管理成本 项目管理成本 - - + + 成本 其他 ${project.otherName!} - - + + 合计 - - + + @@ -542,12 +542,12 @@ 财务费用 资金占用成本 - + 公司管理费用 - + @@ -561,19 +561,19 @@ 项目毛利(元) - + 项目毛利率(%) - + 项目贡献利润(元) - + 项目贡献利润率(%) - + @@ -588,7 +588,7 @@ 销售商品、提供劳务收到的现金 - + 收到的税费返还 @@ -596,11 +596,11 @@ 收到其他与经营活动有关的现金 - + 购买商品、接受劳务支付的现金 - + 支付的各项税费 @@ -608,11 +608,11 @@ 支付其他与经营活动有关的现金 - + 经营活动产生的现金流量净额 - + 投资活动现金流入 @@ -628,19 +628,19 @@ 融资资金流入 - + 还款资金流出 - + 筹资活动产生的现金流量净额 - + 货币资金净增加额 - + @@ -684,38 +684,38 @@ 收入 设备类 - - - - - + + + + + 收入 工程类 - - - - - + + + + + 收入 服务类 - - - - - + + + + + 合计 - - - - - + + + + + @@ -736,71 +736,71 @@ 成本 采购成本 设备 - - - - - + + + + + 成本 采购成本 施工 - - - - - + + + + + 成本 采购成本 服务 - - - - - + + + + + 成本 采购成本 其他 - - - - - + + + + + 成本 项目管理成本 项目管理成本 - - - - - + + + + + 成本 其他 ${project.otherName!} - - - - - + + + + + 合计 - - - - - + + + + + @@ -819,38 +819,38 @@ 财务费用 资金占用成本 - - - - - + + + + + 公司管理费用 - - - - - + + + + + 所得税费用 / / - - - + + + 合计 - - - - - + + + + + @@ -869,30 +869,30 @@ 项目毛利 - - - - - - + + + + + + 项目贡献利润 - - - - - - + + + + + + 项目净利润 / - /<#----> - - - - + /<#----> + + + + @@ -909,109 +909,109 @@ 销售商品、提供劳务收到的现金 - - - - + + + + 收到的税费返还 / - - - + + + 收到其他与经营活动有关的现金 - - - - + + + + 购买商品、接受劳务支付的现金 - - - - + + + + 支付的各项税费 / - - - + + + 支付其他与经营活动有关的现金 - - - - + + + + 经营活动产生的现金流量净额 - - - - + + + + 投资活动现金流入 / - - - + + + 投资活动现金流出 / - - - + + + 投资活动产生的现金流量净额 / - - - + + + 融资资金流入 - - - - + + + + 还款资金流出 - - - - + + + + 筹资活动产生的现金流量净额 - - - - + + + + 货币资金净增加额 - - - - + + + + <#-- 合计 - - - - + + + --> @@ -1046,34 +1046,34 @@ 收入 设备类 - - - - + + + + 收入 工程类 - - - - + + + + 收入 服务类 - - - - + + + + 合计 - - - - + + + + @@ -1093,64 +1093,64 @@ 成本 采购成本 设备 - - - - + + + + 成本 采购成本 施工 - - - - + + + + 成本 采购成本 服务 - - - - + + + + 成本 采购成本 其他 - - - - + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 成本 其他 ${project.otherName!} - - - - + + + + 合计 - - - - + + + + @@ -1168,34 +1168,34 @@ 财务费用 资金占用成本 - - - - + + + + 公司管理费用 - - - - + + + + 所得税费用 / / - - + + 合计 - - - - + + + + @@ -1213,27 +1213,27 @@ 项目毛利 - - - - - + + + + + 项目贡献利润 - - - - - + + + + + 项目净利润 / - <#---->/ - - - + <#---->/ + + + @@ -1249,93 +1249,93 @@ 销售商品、提供劳务收到的现金 - - - + + + 收到的税费返还 / - - + + 收到其他与经营活动有关的现金 - - - + + + 购买商品、接受劳务支付的现金 - - - + + + 支付的各项税费 / - - + + 支付其他与经营活动有关的现金 - - - + + + 经营活动产生的现金流量净额 - - - + + + 投资活动现金流入 / - - + + 投资活动现金流出 / - - + + 投资活动产生的现金流量净额 / - - + + 融资资金流入 - - - + + + 还款资金流出 - - - + + + 筹资活动产生的现金流量净额 - - - + + + 货币资金净增加额 - - - + + + <#-- 合计 - - - + + + --> @@ -1424,13 +1424,13 @@ - - - - - - - - <#---->${projectBudgetPlanDetailTotal.month} - - - - - - - - - - - - @@ -1742,49 +1742,49 @@ <#---->${projectBudgetPlanDetail.month!} - - - - - - - - - - - - diff --git a/src/main/resources/templates/admin/project_final_add.ftl b/src/main/resources/templates/admin/project_final_add.ftl index 8e38f46..92caaa4 100644 --- a/src/main/resources/templates/admin/project_final_add.ftl +++ b/src/main/resources/templates/admin/project_final_add.ftl @@ -48,34 +48,34 @@ 收入 设备类 - - - - + + + + 收入 工程类 - - - - + + + + 收入 服务类 - - - - + + + + 合计 - - - - + + + + @@ -95,65 +95,65 @@ 成本 采购成本 设备 - - - - + + + + 成本 采购成本 施工 - - - - + + + + 成本 采购成本 服务 - - - - + + + + 成本 采购成本 其他 - - - - + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 成本 其他 - - - - + + + + 合计 - - - - + + + + @@ -171,34 +171,34 @@ 财务费用 资金占用成本 - - - - + + + + 公司管理费用 - - - - + + + + 所得税费用 / / - - + + 合计 - - - - + + + + @@ -216,27 +216,27 @@ 项目毛利 - - - - - + + + + + 项目贡献利润 - - - - - + + + + + 项目净利润 / - - - - + + + + @@ -252,93 +252,93 @@ 销售商品、提供劳务收到的现金 - - - + + + 收到的税费返还 / - - + + 收到其他与经营活动有关的现金 - - - + + + 购买商品、接受劳务支付的现金 - - - + + + 支付的各项税费 / - - + + 支付其他与经营活动有关的现金 - - - + + + 经营活动产生的现金流量净额 - - - + + + 投资活动现金流入 / - - + + 投资活动现金流出 / - - + + 投资活动产生的现金流量净额 / - - + + 融资资金流入 - - - + + + 还款资金流出 - - - + + + 筹资活动产生的现金流量净额 - - - + + + 货币资金净增加额 - - - + + + <#-- 合计 - - - + + + --> diff --git a/src/main/resources/templates/admin/project_final_edit.ftl b/src/main/resources/templates/admin/project_final_edit.ftl index 3228136..1ddf0ca 100644 --- a/src/main/resources/templates/admin/project_final_edit.ftl +++ b/src/main/resources/templates/admin/project_final_edit.ftl @@ -48,34 +48,34 @@ 收入 设备类 - - - - + + + + 收入 工程类 - - - - + + + + 收入 服务类 - - - - + + + + 合计 - - - - + + + + @@ -95,65 +95,65 @@ 成本 采购成本 设备 - - - - + + + + 成本 采购成本 施工 - - - - + + + + 成本 采购成本 服务 - - - - + + + + 成本 采购成本 其他 - - - - + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 成本 其他 - - - - + + + + 合计 - - - - + + + + @@ -171,34 +171,34 @@ 财务费用 资金占用成本 - - - - + + + + 公司管理费用 - - - - + + + + 所得税费用 / / - - + + 合计 - - - - + + + + @@ -216,27 +216,27 @@ 项目毛利 - - - - - + + + + + 项目贡献利润 - - - - - + + + + + 项目净利润 / - /<#----> - - - + /<#----> + + + @@ -252,93 +252,93 @@ 销售商品、提供劳务收到的现金 - - - + + + 收到的税费返还 / - - + + 收到其他与经营活动有关的现金 - - - + + + 购买商品、接受劳务支付的现金 - - - + + + 支付的各项税费 / - - + + 支付其他与经营活动有关的现金 - - - + + + 经营活动产生的现金流量净额 - - - + + + 投资活动现金流入 / - - + + 投资活动现金流出 / - - + + 投资活动产生的现金流量净额 / - - + + 融资资金流入 - - - + + + 还款资金流出 - - - + + + 筹资活动产生的现金流量净额 - - - + + + 货币资金净增加额 - - - + + + <#-- 合计 - - - + + + --> diff --git a/src/main/resources/templates/admin/project_settle_add.ftl b/src/main/resources/templates/admin/project_settle_add.ftl index be6601d..39c3611 100644 --- a/src/main/resources/templates/admin/project_settle_add.ftl +++ b/src/main/resources/templates/admin/project_settle_add.ftl @@ -60,38 +60,38 @@ 收入 设备类 - - - - - + + + + + 收入 工程类 - - - - - + + + + + 收入 服务类 - - - - - + + + + + 合计 - - - - - + + + + + @@ -112,74 +112,74 @@ 成本 采购成本 设备 - - - - - + + + + + 成本 采购成本 施工 - - - - - + + + + + 成本 采购成本 服务 - - - - - + + + + + 成本 采购成本 其他 - - - - - + + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 人力成本:${Utils.format(salary,'0')} 元 - + 成本 其他 - - - - - + + + + + 合计 - - - - - + + + + + @@ -198,38 +198,38 @@ 财务费用 资金占用成本 - - - - - + + + + + 公司管理费用 - - - - - + + + + + 所得税费用 / / - - - + + + 合计 - - - - - + + + + + @@ -248,30 +248,30 @@ 项目毛利 - - - - - - + + + + + + 项目贡献利润 - - - - - - + + + + + + 项目净利润 / / - - - - + + + + @@ -288,101 +288,101 @@ 销售商品、提供劳务收到的现金 - - - - + + + + 收到的税费返还 / - - - + + + 收到其他与经营活动有关的现金 - - - - + + + + 购买商品、接受劳务支付的现金 - - - - + + + + 支付的各项税费 / - - - + + + 支付其他与经营活动有关的现金 - - - - + + + + 经营活动产生的现金流量净额 - - - - + + + + 投资活动现金流入 / - - - + + + 投资活动现金流出 / - - - + + + 投资活动产生的现金流量净额 / - - - + + + 融资资金流入 - - - - + + + + 还款资金流出 - - - - + + + + 筹资活动产生的现金流量净额 - - - - + + + + 货币资金净增加额 - - - - + + + + diff --git a/src/main/resources/templates/admin/project_settle_edit.ftl b/src/main/resources/templates/admin/project_settle_edit.ftl index 1c639b2..c305e76 100644 --- a/src/main/resources/templates/admin/project_settle_edit.ftl +++ b/src/main/resources/templates/admin/project_settle_edit.ftl @@ -59,38 +59,38 @@ 收入 设备类 - - - - - + + + + + 收入 工程类 - - - - - + + + + + 收入 服务类 - - - - - + + + + + 合计 - - - - - + + + + + @@ -111,73 +111,73 @@ 成本 采购成本 设备 - - - - - + + + + + 成本 采购成本 施工 - - - - - + + + + + 成本 采购成本 服务 - - - - - + + + + + 成本 采购成本 其他 - - - - - + + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 人力成本:${Utils.format(salary,'0')} 元 - + 成本 其他 - - - - - + + + + + 合计 - - - - - + + + + + @@ -196,38 +196,38 @@ 财务费用 资金占用成本 - - - - - + + + + + 公司管理费用 - - - - - + + + + + 所得税费用 / / - - - + + + 合计 - - - - - + + + + + @@ -246,30 +246,30 @@ 项目毛利 - - - - - - value="${Utils.format(100 * currentBean.grossProfit,'0')}"<#else>value="${Utils.format(100 * currentBean.grossProfit / currentBean.getIncomeTotalTaxExclude(),'0')}" readonly title="项目毛利利润率"> + + + + + + value="${Utils.format(100 * currentBean.grossProfit,'0')}"<#else>value="${Utils.format(100 * currentBean.grossProfit / currentBean.getIncomeTotalTaxExclude(),'0')}" readonly title="项目毛利利润率"> 项目贡献利润 - - - - - - value="${Utils.format(100 * currentBean.grossProfit,'0')}"<#else>value="${Utils.format(100 * currentBean.grossProfit / currentBean.getIncomeTotalTaxExclude(),'0')}" readonly title="项目贡献利润利润率"> + + + + + + value="${Utils.format(100 * currentBean.grossProfit,'0')}"<#else>value="${Utils.format(100 * currentBean.grossProfit / currentBean.getIncomeTotalTaxExclude(),'0')}" readonly title="项目贡献利润利润率"> 项目净利润 / / - - - - value="${Utils.format(100 * currentBean.grossProfit,'0')}"<#else>value="${Utils.format(100 * currentBean.grossProfit / currentBean.getIncomeTotalTaxExclude(),'0')}" readonly title="项目净利润利润率"> + + + + value="${Utils.format(100 * currentBean.grossProfit,'0')}"<#else>value="${Utils.format(100 * currentBean.grossProfit / currentBean.getIncomeTotalTaxExclude(),'0')}" readonly title="项目净利润利润率"> @@ -286,101 +286,101 @@ 销售商品、提供劳务收到的现金 - - - - + + + + 收到的税费返还 / - - - + + + 收到其他与经营活动有关的现金 - - - - + + + + 购买商品、接受劳务支付的现金 - - - - + + + + 支付的各项税费 / - - - + + + 支付其他与经营活动有关的现金 - - - - + + + + 经营活动产生的现金流量净额 - - - - + + + + 投资活动现金流入 / - - - + + + 投资活动现金流出 / - - - + + + 投资活动产生的现金流量净额 / - - - + + + 融资资金流入 - - - - + + + + 还款资金流出 - - - - + + + + 筹资活动产生的现金流量净额 - - - - + + + + 货币资金净增加额 - - - - + + + +