diff --git a/src/main/java/cn/palmte/work/bean/BudgetSettleBean.java b/src/main/java/cn/palmte/work/bean/BudgetSettleBean.java index 516c894..86b0747 100644 --- a/src/main/java/cn/palmte/work/bean/BudgetSettleBean.java +++ b/src/main/java/cn/palmte/work/bean/BudgetSettleBean.java @@ -232,7 +232,7 @@ public class BudgetSettleBean { } public BigDecimal getCostOtherBudgetTotal() { - return costOtherBudgetTotal; + return (costOtherBudgetTotal == null)?BigDecimal.ZERO:costOtherBudgetTotal; } public void setCostOtherBudgetTotal(BigDecimal costOtherBudgetTotal) { diff --git a/src/main/java/cn/palmte/work/bean/EstimateSettleBean.java b/src/main/java/cn/palmte/work/bean/EstimateSettleBean.java index 9e3b5ec..20d8c04 100644 --- a/src/main/java/cn/palmte/work/bean/EstimateSettleBean.java +++ b/src/main/java/cn/palmte/work/bean/EstimateSettleBean.java @@ -169,7 +169,7 @@ public class EstimateSettleBean { } public BigDecimal getCostOtherEstimateTotal() { - return costOtherEstimateTotal; + return (costOtherEstimateTotal == null)?BigDecimal.ZERO:costOtherEstimateTotal; } public void setCostOtherEstimateTotal(BigDecimal costOtherEstimateTotal) { diff --git a/src/main/java/cn/palmte/work/bean/FinalBean.java b/src/main/java/cn/palmte/work/bean/FinalBean.java index dd2da66..ac80667 100644 --- a/src/main/java/cn/palmte/work/bean/FinalBean.java +++ b/src/main/java/cn/palmte/work/bean/FinalBean.java @@ -83,7 +83,7 @@ public class FinalBean { BigDecimal costOtherFinalTotal = getCostOtherFinalTotal(); if (null == costPurchaseDeviceFinalTotal || null == costPurchaseBuildFinalTotal || null == costPurchaseServiceFinalTotal - || null == costPurchaseOtherFinalTotal || null == costProjectManageFinalTotal || null == costOtherFinalTotal) { + || null == costPurchaseOtherFinalTotal || null == costProjectManageFinalTotal) { return new BigDecimal(0); } @@ -161,7 +161,7 @@ public class FinalBean { if(null == grossProfitFinalTotal || null == incomeTotal){ return null; } - if (incomeTotal.compareTo(BigDecimal.valueOf(0.01)) < 0) { + if (incomeTotal.compareTo(BigDecimal.valueOf(0.01)) < 0 && incomeTotal.compareTo(BigDecimal.valueOf(-0.01)) > 0) { incomeTotal = BigDecimal.ONE; } return grossProfitFinalTotal.divide(incomeTotal,4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); @@ -202,7 +202,7 @@ public class FinalBean { if(null == contributionMarginFinalTotal || null == incomeTotal){ return null; } - if (incomeTotal.compareTo(BigDecimal.valueOf(0.01)) < 0) { + if (incomeTotal.compareTo(BigDecimal.valueOf(0.01)) < 0 && incomeTotal.compareTo(BigDecimal.valueOf(-0.01)) > 0) { incomeTotal = BigDecimal.ONE; } return contributionMarginFinalTotal.divide(incomeTotal,4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); @@ -242,7 +242,7 @@ public class FinalBean { if(null == netMarginFinalTotal || null == incomeTotal){ return null; } - if (incomeTotal.compareTo(BigDecimal.valueOf(0.01)) < 0) { + if (incomeTotal.compareTo(BigDecimal.valueOf(0.01)) < 0 && incomeTotal.compareTo(BigDecimal.valueOf(-0.01)) > 0) { incomeTotal = BigDecimal.ONE; } return netMarginFinalTotal.divide(incomeTotal,4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); @@ -472,7 +472,7 @@ public class FinalBean { } public BigDecimal getCostOtherFinalTotal() { - return costOtherFinalTotal; + return (costOtherFinalTotal == null)?BigDecimal.ZERO:costOtherFinalTotal; } public void setCostOtherFinalTotal(BigDecimal costOtherFinalTotal) { diff --git a/src/main/java/cn/palmte/work/bean/IncomeCostBean.java b/src/main/java/cn/palmte/work/bean/IncomeCostBean.java index addaf3c..f2affd9 100644 --- a/src/main/java/cn/palmte/work/bean/IncomeCostBean.java +++ b/src/main/java/cn/palmte/work/bean/IncomeCostBean.java @@ -285,6 +285,9 @@ public abstract class IncomeCostBean { } public BigDecimal getCostOtherOtherTaxInclude() { + if (costOtherOtherTaxInclude == null) { + return BigDecimal.ZERO; + } return handleSpecial(costOtherOtherTaxInclude); } @@ -333,6 +336,9 @@ public abstract class IncomeCostBean { } public BigDecimal getCostOtherOtherTaxExclude() { + if (costOtherOtherTaxExclude == null) { + return BigDecimal.ZERO; + } return handleSpecial(costOtherOtherTaxExclude); } diff --git a/src/main/java/cn/palmte/work/bean/SettleBean.java b/src/main/java/cn/palmte/work/bean/SettleBean.java index 9c30c55..a0f8b11 100644 --- a/src/main/java/cn/palmte/work/bean/SettleBean.java +++ b/src/main/java/cn/palmte/work/bean/SettleBean.java @@ -339,6 +339,9 @@ public class SettleBean { } public BigDecimal getCostOther() { + if (costOther == null) { + return BigDecimal.ZERO; + } return handleSpecial(costOther); } diff --git a/src/main/java/cn/palmte/work/bean/SettleMonthBean.java b/src/main/java/cn/palmte/work/bean/SettleMonthBean.java index 378bc8a..3b2da38 100644 --- a/src/main/java/cn/palmte/work/bean/SettleMonthBean.java +++ b/src/main/java/cn/palmte/work/bean/SettleMonthBean.java @@ -484,6 +484,9 @@ public class SettleMonthBean { } public BigDecimal getCostOther() { + if (costOther == null) { + return BigDecimal.ZERO; + } return handleSpecial(costOther); } 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/java/cn/palmte/work/service/ProjectFinalSevice.java b/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java index 455eec5..671c5b1 100644 --- a/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java +++ b/src/main/java/cn/palmte/work/service/ProjectFinalSevice.java @@ -9,7 +9,6 @@ import org.springframework.transaction.annotation.Transactional; import top.jfunc.common.utils.CollectionUtil; import java.math.BigDecimal; -import java.math.RoundingMode; import java.util.ArrayList; import java.util.List; @@ -61,14 +60,14 @@ public class ProjectFinalSevice { @Transactional public void save(Project project, FinalBean finalBean) { clearAndSave(project, finalBean); - projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.FINAL_ACCOUNTS, ApproveStatusEnum.APPROVAL_UNCOMMIT); + projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.FINAL_ACCOUNTS, ApproveStatusEnum.APPROVAL_UNCOMMIT, project.getOtherName()); } @Transactional public void saveAndApprove(Project project, FinalBean finalBean) throws Exception { clearAndSave(project, finalBean); //更新项目和审批状态 - projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.FINAL_ACCOUNTS, ApproveStatusEnum.APPROVAL_PENDING); + projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.FINAL_ACCOUNTS, ApproveStatusEnum.APPROVAL_PENDING, project.getOtherName()); //发起流程 projectInstanceService.startFinalProcessInstance(project.getId(), InterfaceUtil.getAdmin()); } diff --git a/src/main/java/cn/palmte/work/service/ProjectService.java b/src/main/java/cn/palmte/work/service/ProjectService.java index d04fc07..c472021 100644 --- a/src/main/java/cn/palmte/work/service/ProjectService.java +++ b/src/main/java/cn/palmte/work/service/ProjectService.java @@ -215,10 +215,11 @@ public class ProjectService { /** * 更新项目状态和审批状态 */ - public void updateStatusAndApproveStatus(int projectId, StatusEnum statusEnum, ApproveStatusEnum approveStatusEnum) { + public void updateStatusAndApproveStatus(int projectId, StatusEnum statusEnum, ApproveStatusEnum approveStatusEnum, String otherName) { Project one = projectRepository.findOne(projectId); one.setStatus(statusEnum.getStatus()); one.setStatusDesc(statusEnum.getStatusDesc()); + one.setOtherName(otherName); int approveStatus = approveStatusEnum.getApproveStatus(); switch (statusEnum) { diff --git a/src/main/java/cn/palmte/work/service/ProjectSettleService.java b/src/main/java/cn/palmte/work/service/ProjectSettleService.java index 216c030..5e4ce52 100644 --- a/src/main/java/cn/palmte/work/service/ProjectSettleService.java +++ b/src/main/java/cn/palmte/work/service/ProjectSettleService.java @@ -11,7 +11,6 @@ import top.jfunc.common.utils.CollectionUtil; import java.math.BigDecimal; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; /** @@ -47,13 +46,13 @@ public class ProjectSettleService { public void save(Project project, SettleBean settleBean, BudgetSettleBean budgetBean, EstimateSettleBean estimateBean, String time) { step(project, settleBean, budgetBean, estimateBean, time); - projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.SETTLE_ACCOUNTS, ApproveStatusEnum.APPROVAL_UNCOMMIT); + projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.SETTLE_ACCOUNTS, ApproveStatusEnum.APPROVAL_UNCOMMIT, project.getOtherName()); } public void saveAndApprove(Project project, SettleBean settleBean, BudgetSettleBean budgetBean, EstimateSettleBean estimateBean, String time) throws Exception{ step(project, settleBean, budgetBean, estimateBean, time); - projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.SETTLE_ACCOUNTS, ApproveStatusEnum.APPROVAL_PENDING); + projectService.updateStatusAndApproveStatus(project.getId(), StatusEnum.SETTLE_ACCOUNTS, ApproveStatusEnum.APPROVAL_PENDING, project.getOtherName()); //发起结算流程 projectInstanceService.startSettleProcessInstance(project, InterfaceUtil.getAdmin()); diff --git a/src/main/java/cn/palmte/work/service/ProjectSummaryService.java b/src/main/java/cn/palmte/work/service/ProjectSummaryService.java index 646ae03..24f0a96 100644 --- a/src/main/java/cn/palmte/work/service/ProjectSummaryService.java +++ b/src/main/java/cn/palmte/work/service/ProjectSummaryService.java @@ -190,8 +190,8 @@ public class ProjectSummaryService { private void setProfitMargin(SettleBean monthSettle) { BigDecimal divide2 = monthSettle.getIncomeTotal(); BigDecimal min = BigDecimal.valueOf(0.01); - if (divide2.compareTo(min) < 0) { - divide2 = BigDecimal.valueOf(1); + if (divide2.compareTo(min) < 0 && divide2.compareTo(BigDecimal.valueOf(-0.01)) > 0) { + divide2 = BigDecimal.ONE; } monthSettle.setGrossProfitProfitMargin(monthSettle.getGrossProfit().multiply(new BigDecimal(100)).divide(divide2, 4, BigDecimal.ROUND_HALF_UP)); monthSettle.setContributionProfitProfitMargin(monthSettle.getContributionProfit().multiply(new BigDecimal(100)).divide(divide2, 4, BigDecimal.ROUND_HALF_UP)); diff --git a/src/main/java/cn/palmte/work/service/StatisticsService.java b/src/main/java/cn/palmte/work/service/StatisticsService.java index dda3cfc..0a49b32 100644 --- a/src/main/java/cn/palmte/work/service/StatisticsService.java +++ b/src/main/java/cn/palmte/work/service/StatisticsService.java @@ -313,8 +313,8 @@ public class StatisticsService { BigDecimal divide2 = profitAndLossBean.getIncome(); BigDecimal min = BigDecimal.valueOf(0.01); - if (divide2.compareTo(min) < 0) { - divide2 = BigDecimal.valueOf(1); + if (divide2.compareTo(min) < 0 && divide2.compareTo(BigDecimal.valueOf(-0.01)) > 0) { + divide2 = BigDecimal.ONE; } profitAndLossBean.setGrossProfit(typeGrossProfit); profitAndLossBean.setGrossProfitProfit(profitAndLossBean.getGrossProfit().multiply(new BigDecimal(100)).divide(divide2, 4, BigDecimal.ROUND_HALF_UP)); diff --git a/src/main/java/cn/palmte/work/utils/Utils.java b/src/main/java/cn/palmte/work/utils/Utils.java index cebf5a1..9eef788 100644 --- a/src/main/java/cn/palmte/work/utils/Utils.java +++ b/src/main/java/cn/palmte/work/utils/Utils.java @@ -61,6 +61,20 @@ public class Utils { return format(number, "#,##0.00"); } + /** + * 保留五位小数 + */ + public static String format2(Number number, String defaultValue){ + if (null == number) { + return defaultValue; + }else { + return new java.text.DecimalFormat("#,##0.00###").format(number); + } + } + public static String format2(Number number){ + return format(number, "#,##0.00###"); + } + public static void main(String[] args) throws Exception { AesCrypto aesCrypto = new AesCrypto("CDGXQHCJ-HHYC2021017"); diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index 2068b26..0bc0eec 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -1,58 +1,72 @@ -INCOME_DETAIL = { - "type": [true, "类别"], - "name": [true, "名称"], - "unit": [true, "单位"], - "amount": [true, "数量"], - "price": [true, "单价"], - "taxRate": [true, "税率"], - "totalTaxInclude": [true, "含税总金额"], - "totalTaxExclude": [true, "不含税金额"] +INCOME_DETAIL={ + "num":[false,"序号","string"], + "type":[true,"类别","string"], + "name":[true,"名称","string"], + "unit":[true,"单位","string"], + "amount":[true,"数量","string"], + "price":[true,"单价","price"], + "taxRate":[true,"税率","number"], + "totalTaxInclude":[true,"含税总金额","number"], + "totalTaxExclude":[true,"不含税金额","number"] }; COST_DETAIL={ - "type":[true,"大类"], - "category":[true,"类别"], - "name":[true,"名称"], - "unit":[true,"单位"], - "amount":[true,"数量"], - "price":[true,"单价"], - "taxRate":[true,"税率"], - "totalTaxInclude":[true,"含税总金额"], - "totalTaxExclude":[true,"不含税金额"] + "num":[false,"序号","string"], + "type":[true,"大类","string"], + "category":[true,"类别","string"], + "name":[true,"名称","string"], + "unit":[true,"单位","string"], + "amount":[true,"数量","string"], + "price":[true,"单价","price"], + "taxRate":[true,"税率","number"], + "totalTaxInclude":[true,"含税总金额","number"], + "totalTaxExclude":[true,"不含税金额","number"] }; COST_PROJECT_MANAGE_DETAIL={ - "type":[true,"财务费用类别"], - "name1":[false,"业务项目"], - "name2":[false,"业务项目"], - "detail":[true,"项目明细"], - "unit":[true,"单位"], - "amount":[true,"数量"], - "price":[true,"单价"], - "total":[true,"总金额"], - "predictMethod":[false,"预估计算方法"], - "predictWhy":[false,"预估依据"], - "remark":[false,"备注"], - "deletable":[true,"是否可删除"] + "num":[false,"序号","string"], + "type":[true,"财务费用类别","string"], + "name1":[false,"业务项目","string"], + "name2":[false,"业务项目","string"], + "detail":[true,"项目明细","string"], + "unit":[true,"单位","string"], + "amount":[true,"数量","string"], + "price":[true,"单价","price"], + "total":[true,"总金额","number"], + "predictMethod":[false,"预估计算方法","string"], + "predictWhy":[false,"预估依据","string"], + "remark":[false,"备注","string"], + "deletable":[true,"是否可删除","string"] }; BUDGET_PLAN_DETAIL={ "month":[true,"月份"], - "deviceCost":[true,"设备支出"], - "engineerCost":[true,"工程支出"], - "projectManageCost":[true,"经营性开支"], - "earnestMoneyCost":[true,"保证金支出"], - "totalCost":[true,"支出合计"], - "saleIncome":[true,"销售收款"], - "earnestMoneyIncome":[true,"保证金收款"], - "totalIncome":[true,"收款合计"], - "fundBalance":[true,"资金余额"], - "capitalInterest":[true,"资金利息"], - "underwrittenPlan":[true,"垫资计划"], - "repaymentPlan":[true,"还款计划"] + "deviceCost":[true,"设备支出","number"], + "engineerCost":[true,"工程支出","number"], + "projectManageCost":[true,"经营性开支","number"], + "earnestMoneyCost":[true,"保证金支出","number"], + "totalCost":[true,"支出合计","number"], + "saleIncome":[true,"销售收款","number"], + "earnestMoneyIncome":[true,"保证金收款","number"], + "totalIncome":[true,"收款合计","number"], + "fundBalance":[true,"资金余额","number"], + "capitalInterest":[true,"资金利息","number"], + "underwrittenPlan":[true,"垫资计划","number"], + "repaymentPlan":[true,"还款计划","number"] }; $(function () { + $("input[name='costCompanyManageTaxExclude']").change(function () { + digitalSelf("costCompanyManageTaxExclude", "input[name='costCompanyManageTaxExclude']"); + }); + $("input[name='costOtherOtherTaxInclude']").change(function () { + console.log("budget.js:costOtherOtherTaxInclude"); + digitalSelf("costOtherOtherTaxInclude", "input[name='costOtherOtherTaxInclude']"); + }); + $("input[name='costOtherOtherTaxExclude']").change(function () { + console.log("budget.js:costOtherOtherTaxExclude"); + digitalSelf("costOtherOtherTaxExclude", "input[name='costOtherOtherTaxExclude']"); + }); //绑定删除按钮删除当前行 bindDeleteBtn(); //绑定收入和采购成本的输入框【都有税率】 @@ -309,7 +323,14 @@ function arr2ObjectVerify(line, arr, detailPropertyArr, detailProperty) { layuiAlert("第 " + (line + 1) + " 行的 " + o[1] + " 不允许为空"); return null; } - obj[detailPropertyArr[i]] = arr[i]; + //如果要求是数字类型的,进行转换 + var v = arr[i]; + if(o[2] === 'number' ){ + v = f2(v); + } else if(o[2] === 'price' ){ + v = f5(v); + } + obj[detailPropertyArr[i]]=v; } return obj; } @@ -336,7 +357,6 @@ function arr2ObjectVerifyCheck(line, arr, detailPropertyArr, detailProperty, s) function collectData(className) { var a = []; $("." + className).each(function (t) { - console.log("收集:" + className + "," + $(this).val()) a.push($(this).val()); }); return a; @@ -349,6 +369,7 @@ function bindDeleteBtn() { $(".am-modal-line-delete").click(function () { //删除自己对应的tr $(this).parent().parent().remove(); + bindNum(); }); } @@ -436,7 +457,7 @@ function bindChangeableInput() { }); //单价改变 $(".input-changeable-price").change(function () { - var price = f2($(this).val()); + var price = f5($(this).val()); //找到对应的数量和税率 var amount = parseInt($(this).parent().parent().find(".input-changeable-amount").val()); var taxRate = f2($(this).parent().parent().find(".input-changeable-tax-rate").val()); @@ -444,6 +465,8 @@ function bindChangeableInput() { $(this).parent().parent().find(".input-changeable-total-tax-include").val(f2Fixed(amount * price)); $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100))); + $(this).val(f5Price(price)); + console.log("单价:" + $(this).val()); }); //税率改变 $(".input-changeable-tax-rate").change(function () { @@ -457,6 +480,16 @@ function bindChangeableInput() { }); } +/** + * 绑定序号 + */ +function bindNum() { + $(".input-budget-num").each(function(t) { + var prevIndex = $(this).parent().parent().prev("tr").find(".input-budget-num").val(); + $(this).val(f2(prevIndex) + 1); + }); +} + /** * 校验项目贡献利润率必须大于阀值 * 低于阀值就返回提示信息,否则返回"" @@ -489,9 +522,9 @@ function updateProjectContributionProfitRate() { var costCompanyManageTaxExclude = f2(inputVal("costCompanyManageTaxExclude")); var projectGrossProfit = f2Fixed(incomeTotalTaxExclude - costTotalTaxExclude - costExpropriationTaxExclude); - var projectGrossProfitRate = f2Fixed(rate(projectGrossProfit, incomeTotalTaxExclude)); - var projectContributionProfit = f2Fixed(projectGrossProfit - costCompanyManageTaxExclude); - var projectContributionProfitRate = f2Fixed(rate(projectContributionProfit, incomeTotalTaxExclude)); + var projectGrossProfitRate = f2Fixed(rate(f2(projectGrossProfit), incomeTotalTaxExclude)); + var projectContributionProfit = f2Fixed(f2(projectGrossProfit) - costCompanyManageTaxExclude); + var projectContributionProfitRate = f2Fixed(rate(f2(projectContributionProfit), incomeTotalTaxExclude)); $("input[name='projectGrossProfit']").val(projectGrossProfit); $("input[name='projectGrossProfitRate']").val(projectGrossProfitRate); diff --git a/src/main/resources/static/assets/js/project_budget_cost.js b/src/main/resources/static/assets/js/project_budget_cost.js index 27fb2f7..57a3a1d 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -3,15 +3,16 @@ */ //COST_DETAIL_ARR=["type","category","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"]; COST_DETAIL={ - "type":[true,"大类"], - "category":[true,"类别"], - "name":[true,"名称"], - "unit":[true,"单位"], - "amount":[true,"数量"], - "price":[true,"单价"], - "taxRate":[true,"税率"], - "totalTaxInclude":[true,"含税总金额"], - "totalTaxExclude":[true,"不含税金额"] + "num":[false,"序号","string"], + "type":[true,"大类","string"], + "category":[true,"类别","string"], + "name":[true,"名称","string"], + "unit":[true,"单位","string"], + "amount":[true,"数量","string"], + "price":[true,"单价","price"], + "taxRate":[true,"税率","number"], + "totalTaxInclude":[true,"含税总金额","number"], + "totalTaxExclude":[true,"不含税金额","number"] }; /* [ @@ -161,7 +162,9 @@ function appendTrCost() { options+='\r\n'; }); - var template = '' + + ''+ ''+ ''+ - ''+ - ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -198,6 +201,8 @@ function appendTrCost() { $("#costTable").append(template); //重新绑定删除事件和input修改事件 bindDeleteBtn(); + //绑定序号 + bindNum(); //重新绑定 bindChangeableInput(); //绑定采购明细中select联动事件 @@ -288,7 +293,7 @@ function bindOtherOtherChangeable() { calCostInclude(); updateProjectContributionProfitRate(); - + digitalSelf("costOtherOtherTaxInclude", "input[name='costOtherOtherTaxInclude']"); }); $("input[name='costOtherOtherTaxExclude']").change(function () { @@ -306,6 +311,7 @@ function bindOtherOtherChangeable() { calCostExclude(); updateProjectContributionProfitRate(); + digitalSelf("costOtherOtherTaxExclude", "input[name='costOtherOtherTaxExclude']"); }); } diff --git a/src/main/resources/static/assets/js/project_budget_cost_project_manage.js b/src/main/resources/static/assets/js/project_budget_cost_project_manage.js index 89cd281..99ca14f 100644 --- a/src/main/resources/static/assets/js/project_budget_cost_project_manage.js +++ b/src/main/resources/static/assets/js/project_budget_cost_project_manage.js @@ -3,18 +3,19 @@ */ //COST_PROJECT_MANAGE_DETAIL_ARR=["type","name","detail","unit","amount","price","total","predictMethod","predictWhy","remark","deletable"]; COST_PROJECT_MANAGE_DETAIL={ - "type":[true,"财务费用类别"], - "name1":[false,"业务项目"], - "name2":[false,"业务项目"], - "detail":[true,"项目明细"], - "unit":[true,"单位"], - "amount":[true,"数量"], - "price":[true,"单价"], - "total":[true,"总金额"], - "predictMethod":[false,"预估计算方法"], - "predictWhy":[false,"预估依据"], - "remark":[false,"备注"], - "deletable":[true,"是否可删除"] + "num":[false,"序号","string"], + "type":[true,"财务费用类别","string"], + "name1":[false,"业务项目","string"], + "name2":[false,"业务项目","string"], + "detail":[true,"项目明细","string"], + "unit":[true,"单位","string"], + "amount":[true,"数量","string"], + "price":[true,"单价","price"], + "total":[true,"总金额","number"], + "predictMethod":[false,"预估计算方法","string"], + "predictWhy":[false,"预估依据","string"], + "remark":[false,"备注","string"], + "deletable":[true,"是否可删除","string"] }; SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER={}; @@ -96,6 +97,7 @@ $(function () { */ function appendTrCostProjectManage() { var template = '\n' + + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + - ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + @@ -130,6 +132,8 @@ function appendTrCostProjectManage() { $("#costProjectManageTable").append(template); //重新绑定删除事件和input修改事件 bindDeleteBtn(); + //绑定序号 + bindNum(); bindChangeableInputProjectManage(); bindTypeSelectChangeManager(); //绑定数字输入框保留两位小数 @@ -224,17 +228,17 @@ function bindChangeableInputProjectManage() { $(".input-changeable-amount-project-manage").change(function () { var amount = parseInt($(this).val()); //找到对应的单价 - var price = f2($(this).parent().parent().find(".input-changeable-price-project-manage").val()); + var price = f5($(this).parent().parent().find(".input-changeable-price-project-manage").val()); - $(this).parent().parent().find(".input-changeable-total-project-manage").val(f2(amount*price)); + $(this).parent().parent().find(".input-changeable-total-project-manage").val(f2Fixed(amount*price)); }); //单价改变 $(".input-changeable-price-project-manage").change(function () { - var price = f2($(this).val()); + var price = f5($(this).val()); //找到对应的数量 var amount = parseInt($(this).parent().parent().find(".input-changeable-amount-project-manage").val()); - $(this).parent().parent().find(".input-changeable-total-project-manage").val(f2(amount*price)); + $(this).parent().parent().find(".input-changeable-total-project-manage").val(f2Fixed(amount*price)); }); } /** diff --git a/src/main/resources/static/assets/js/project_budget_income.js b/src/main/resources/static/assets/js/project_budget_income.js index c7cda2f..a433273 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -3,14 +3,15 @@ */ //INCOME_DETAIL_ARR=["type","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"]; INCOME_DETAIL={ - "type":[true,"类别"], - "name":[true,"名称"], - "unit":[true,"单位"], - "amount":[true,"数量"], - "price":[true,"单价"], - "taxRate":[true,"税率"], - "totalTaxInclude":[true,"含税总金额"], - "totalTaxExclude":[true,"不含税金额"] + "num":[false,"序号","string"], + "type":[true,"类别","string"], + "name":[true,"名称","string"], + "unit":[true,"单位","string"], + "amount":[true,"数量","string"], + "price":[true,"单价","price"], + "taxRate":[true,"税率","number"], + "totalTaxInclude":[true,"含税总金额","number"], + "totalTaxExclude":[true,"不含税金额","number"] }; /*$(function () { @@ -127,6 +128,7 @@ function updateIncomeData(data,returnData) { */ function appendTrIncome() { var template = '\n' + + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + @@ -146,6 +148,7 @@ function appendTrIncome() { $("#incomeTable").append(template); //重新绑定删除事件和input修改事件 bindDeleteBtn(); + bindNum(); bindChangeableInput(); //绑定数字输入框保留两位小数 bindNumberInput(); diff --git a/src/main/resources/static/assets/js/project_budget_plan.js b/src/main/resources/static/assets/js/project_budget_plan.js index 0270cbe..965db6d 100644 --- a/src/main/resources/static/assets/js/project_budget_plan.js +++ b/src/main/resources/static/assets/js/project_budget_plan.js @@ -4,18 +4,18 @@ BUDGET_PLAN_DETAIL_ARR=["month","deviceCost","engineerCost","projectManageCost","earnestMoneyCost","totalCost","saleIncome","earnestMoneyIncome","totalIncome","fundBalance","capitalInterest","underwrittenPlan","repaymentPlan"]; BUDGET_PLAN_DETAIL={ "month":[true,"月份"], - "deviceCost":[true,"设备支出"], - "engineerCost":[true,"工程支出"], - "projectManageCost":[true,"经营性开支"], - "earnestMoneyCost":[true,"保证金支出"], - "totalCost":[true,"支出合计"], - "saleIncome":[true,"销售收款"], - "earnestMoneyIncome":[true,"保证金收款"], - "totalIncome":[true,"收款合计"], - "fundBalance":[true,"资金余额"], - "capitalInterest":[true,"资金利息"], - "underwrittenPlan":[true,"垫资计划"], - "repaymentPlan":[true,"还款计划"] + "deviceCost":[true,"设备支出","number"], + "engineerCost":[true,"工程支出","number"], + "projectManageCost":[true,"经营性开支","number"], + "earnestMoneyCost":[true,"保证金支出","number"], + "totalCost":[true,"支出合计","number"], + "saleIncome":[true,"销售收款","number"], + "earnestMoneyIncome":[true,"保证金收款","number"], + "totalIncome":[true,"收款合计","number"], + "fundBalance":[true,"资金余额","number"], + "capitalInterest":[true,"资金利息","number"], + "underwrittenPlan":[true,"垫资计划","number"], + "repaymentPlan":[true,"还款计划","number"] }; @@ -189,18 +189,18 @@ function verifyBudgetPlan(){ function appendTrBudgetPlan() { var template = '\n' + ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + ' \n' + ' '; $("#budgetPlanDetailTable").append(template); @@ -274,7 +274,7 @@ function bindChangeableInputBudgetPlanDetail() { var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); //更新本月所有项支出 - $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(deviceCost+engineerCost+projectManageCost+earnestMoneyCost); + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); //更新所有月设备支出总额 updateBudgetPlanTotal("input-changeable-device-cost-budget-plan","input-total-device-cost-budget-plan"); //更新所有月支出总额 @@ -292,7 +292,7 @@ function bindChangeableInputBudgetPlanDetail() { var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); //更新本月所有项支出 - $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(deviceCost+engineerCost+projectManageCost+earnestMoneyCost); + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); //更新所有月工程支出总额 updateBudgetPlanTotal("input-changeable-engineer-cost-budget-plan","input-total-engineer-cost-budget-plan"); //更新所有月支出总额 @@ -310,7 +310,7 @@ function bindChangeableInputBudgetPlanDetail() { var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); //更新本月所有项支出 - $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(deviceCost+engineerCost+projectManageCost+earnestMoneyCost); + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); //更新所有月经营性支出总额 updateBudgetPlanTotal("input-changeable-project-manage-cost-budget-plan","input-total-project-manage-cost-budget-plan"); //更新所有月支出总额 @@ -328,7 +328,7 @@ function bindChangeableInputBudgetPlanDetail() { var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); //更新本月所有项支出 - $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); //更新所有月保证金支出总额 updateBudgetPlanTotal("input-changeable-earnest-money-cost-budget-plan","input-total-earnest-money-cost-budget-plan"); updateBudgetPlanTotal("input-changeable-earnest-money-cost-budget-plan","input-total-title-earnest-money-cost-budget-plan"); @@ -346,7 +346,7 @@ function bindChangeableInputBudgetPlanDetail() { var earnestMoneyIncome = f2($(this).parent().parent().find(".input-changeable-earnest-money-income-budget-plan").val()); //更新本月所有项收入 - $(this).parent().parent().find(".input-changeable-total-income-budget-plan").val(f2(saleIncome+earnestMoneyIncome)); + $(this).parent().parent().find(".input-changeable-total-income-budget-plan").val(f2Fixed(saleIncome+earnestMoneyIncome)); //更新所有月销售收款总额 updateBudgetPlanTotal("input-changeable-sale-income-budget-plan","input-total-sale-income-budget-plan"); //更新所有月收入总额 @@ -362,7 +362,7 @@ function bindChangeableInputBudgetPlanDetail() { var saleIncome = f2($(this).parent().parent().find(".input-changeable-sale-income-budget-plan").val()); //更新本月所有项收入 - $(this).parent().parent().find(".input-changeable-total-income-budget-plan").val(f2(saleIncome+earnestMoneyIncome)); + $(this).parent().parent().find(".input-changeable-total-income-budget-plan").val(f2Fixed(saleIncome+earnestMoneyIncome)); //更新所有月保证金收款总额 updateBudgetPlanTotal("input-changeable-earnest-money-income-budget-plan","input-total-earnest-money-income-budget-plan"); updateBudgetPlanTotal("input-changeable-earnest-money-income-budget-plan","input-total-title-earnest-money-income-budget-plan"); @@ -549,7 +549,6 @@ function updateEachRepaymentPlan() { */ function calRepaymentPlan(income, cost, prevFundBalance) { var repaymentPlan = 0; - if(!income || !cost){ //数据还不全的时候 repaymentPlan = NaN; @@ -560,10 +559,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); } } } @@ -722,15 +721,15 @@ function updateCashFlow() { d,f,g,m,m);*/ - $("input[name='saleIncomeCash']").val(f2Fixed(saleIncome)); - $("input[name='earnestMoneyIncome']").val(f2Fixed(earnestMoneyIncome)); + $("input[name='saleIncomeCash']").val(f2Fixed(f2(saleIncome))); + $("input[name='earnestMoneyIncome']").val(f2Fixed(f2(earnestMoneyIncome))); $("input[name='purchaseCost']").val(f2Fixed(d)); $("input[name='earnestMoneyCost']").val(f2Fixed(f)); $("input[name='netCashFlow']").val(f2Fixed(g)); - $("input[name='financingCapitalInflow']").val(f2Fixed(underwrittenPlan)); - $("input[name='financingCapitalOutflow']").val(f2Fixed(repaymentPlan)); + $("input[name='financingCapitalInflow']").val(f2Fixed(f2(underwrittenPlan))); + $("input[name='financingCapitalOutflow']").val(f2Fixed(f2(repaymentPlan))); $("input[name='financingCapitalCashflow']").val(f2Fixed(m)); $("input[name='netIncreaseMonetaryFunds']").val(f2Fixed(n)); diff --git a/src/main/resources/static/assets/js/project_common.js b/src/main/resources/static/assets/js/project_common.js index c61cd3c..7779882 100644 --- a/src/main/resources/static/assets/js/project_common.js +++ b/src/main/resources/static/assets/js/project_common.js @@ -42,6 +42,34 @@ function f2Fixed(f) { return f; } +/** + * 适配单价 + */ +function f5Price(f) { + //return Number(f).toFixed(2); + //格式化413,423,423.24 + f = Number(f).toLocaleString('en-US',{minimumFractionDigits: 2, maximumFractionDigits: 5, useGrouping: true}); + return f; +} + +/** + * 适配单价 + */ +function f5(x) { + if(!x){ + return 0; + } + if(typeof x === 'string'){ + //这一步因为数字格式化为了包含分隔符,获取的时候就去掉这个分隔符 + x = x.replaceAll(",",""); + } + var f = parseFloat(x); + if (isNaN(f)) { + return 0; + } + return Math.round(f*100000)/100000; +} + function digitalSelf(name, action) { var self = inputVal(name); @@ -50,6 +78,30 @@ function digitalSelf(name, action) { $action.val(f2Fixed(f2(self))); } +/** + * parse float保留两位小数,四舍五入 + * 空格或者非数字认为是0 + * @param x + * @returns {*} + */ +function f2min(x) { + if(!x){ + return 1; + } + if(typeof x === 'string'){ + //这一步因为数字格式化为了包含分隔符,获取的时候就去掉这个分隔符 + x = x.replaceAll(",",""); + } + var f = parseFloat(x); + if (isNaN(f)) { + return 1; + } + if (f < 0.01 && f > -0.01) { + return 1; + } + return Math.round(f*100)/100; +} + /** * 计算利润率 * @param r1 @@ -70,19 +122,23 @@ function rate(r1,r2) { */ function bindNumberInput() { //所有的数字类型输入框 - var $numberTypeInputs = $("input[type='number']"); - inputKeepDigital($numberTypeInputs); + // var $numberTypeInputs = $("input[type='number']"); + // inputKeepDigital($numberTypeInputs); //所有的number类的输入框 var $numberClassInputs = $("input.number"); inputKeepDigital($numberClassInputs); + + //所有的price类的输入框,根据单价要求单独设置 + var $priceClassInputs = $("input.price"); + inputKeepDigitalPrice($priceClassInputs); } function inputKeepDigital($inputs) { - //键盘键弹起的时候 - $inputs.keyup(function () { - keepDigital($(this)); - }); + //键盘键弹起的时候,会在每次输入一位数的时候就格式化,先行去除 + // $inputs.keyup(function () { + // keepDigital($(this)); + // }); //失去焦点时再校验一遍 $inputs.blur(function() { keepDigital($(this)); @@ -93,6 +149,15 @@ function keepDigital($input) { $input.val(keepDigitalVal($input.val())); } +function inputKeepDigitalPrice($inputs) { + console.log("1"); + + //失去焦点时再校验一遍 + $inputs.blur(function() { + $(this).val(keepDigitalValPrice($(this).val())); + }); +} + /** * 只保留数字 */ @@ -106,7 +171,23 @@ function keepDigitalVal(value) { value = parseFloat(value); } - return value; + return f2Fixed(f2(value)); +} + +/** + * 只保留数字 + */ +function keepDigitalValPrice(value) { + value = value.replace(/[^\-\d.]/g, ""); //清除“-”、“数字”和“.”以外的字符 + value = value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的 + value = value.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); + value = value.replace(/^(\-)?(\d+)\.(\d\d\d\d\d).*$/, '$1$2.$3'); //只能输入两个小数 + if (value.indexOf(".") < 0 && value != "") { + //以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 + value = parseFloat(value); + } + + return f5Price(f5(value)); } /** @@ -179,7 +260,6 @@ function calCostInclude() { var costProjectManageTaxInclude = inputVal("costProjectManageTaxInclude"); var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - var $costTotalTaxInclude = $("input[name='costTotalTaxInclude']"); $costTotalTaxInclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude) +f2(costPurchaseBuildTaxInclude) diff --git a/src/main/resources/static/assets/js/project_estimate.js b/src/main/resources/static/assets/js/project_estimate.js index 19af6c8..aa0842f 100644 --- a/src/main/resources/static/assets/js/project_estimate.js +++ b/src/main/resources/static/assets/js/project_estimate.js @@ -1,4 +1,13 @@ function calIncomeAndCost() { + $("input[name='contractAmount']").change(function () { + digitalSelf("contractAmount", "input[name='contractAmount']"); + }); + $("input[name='huazhiProductAmount']").change(function () { + digitalSelf("huazhiProductAmount", "input[name='huazhiProductAmount']"); + }); + $("input[name='ziguangOtherAmount']").change(function () { + digitalSelf("ziguangOtherAmount", "input[name='ziguangOtherAmount']"); + }); $("input[name='incomeDeviceTaxInclude']").change(function () { calIncomeInclude(); calIncomeCost(); @@ -139,7 +148,7 @@ function calIncomeAndCost() { } else { $("input[name='incomeDeviceTaxExclude']").attr('readonly',true); var incomeDeviceTaxInclude = inputVal("incomeDeviceTaxInclude"); - $incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude/(1+Number(val)))); + $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -154,7 +163,7 @@ function calIncomeAndCost() { }else if(val == "请选择税率"){ return; } else { - $incomeDeviceTaxExclude.val(f2Fixed(incomeDeviceTaxInclude/(1+Number(val)))); + $incomeDeviceTaxExclude.val(f2Fixed(f2(incomeDeviceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -172,7 +181,7 @@ function calIncomeAndCost() { } else { $("input[name='incomeEngineerTaxExclude']").attr('readonly',true); var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - $incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude/(1+Number(val)))); + $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -187,7 +196,7 @@ function calIncomeAndCost() { return; } else { var incomeEngineerTaxInclude = inputVal("incomeEngineerTaxInclude"); - $incomeEngineerTaxExclude.val(f2Fixed(incomeEngineerTaxInclude/(1+Number(val)))); + $incomeEngineerTaxExclude.val(f2Fixed(f2(incomeEngineerTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -205,7 +214,7 @@ function calIncomeAndCost() { } else { $("input[name='incomeServiceTaxExclude']").attr('readonly',true); var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - $incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude/(1+Number(val)))); + $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -220,7 +229,7 @@ function calIncomeAndCost() { return; } else { var incomeServiceTaxInclude = inputVal("incomeServiceTaxInclude"); - $incomeServiceTaxExclude.val(f2Fixed(incomeServiceTaxInclude/(1+Number(val)))); + $incomeServiceTaxExclude.val(f2Fixed(f2(incomeServiceTaxInclude)/(1+Number(val)))); } calIncomeExclude(); calIncomeCost(); @@ -238,7 +247,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseDeviceTaxExclude']").attr('readonly',true); var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); - $costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude/(1+Number(val)))); + $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -253,7 +262,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseDeviceTaxInclude = inputVal("costPurchaseDeviceTaxInclude"); - $costPurchaseDeviceTaxExclude.val(f2Fixed(costPurchaseDeviceTaxInclude/(1+Number(val)))); + $costPurchaseDeviceTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -271,7 +280,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseBuildTaxExclude']").attr('readonly',true); var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); - $costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude/(1+Number(val)))); + $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -286,7 +295,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); - $costPurchaseBuildTaxExclude.val(f2Fixed(costPurchaseBuildTaxInclude/(1+Number(val)))); + $costPurchaseBuildTaxExclude.val(f2Fixed(f2(costPurchaseBuildTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -304,7 +313,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseServiceTaxExclude']").attr('readonly',true); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); - $costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude/(1+Number(val)))); + $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -319,7 +328,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); - $costPurchaseServiceTaxExclude.val(f2Fixed(costPurchaseServiceTaxInclude/(1+Number(val)))); + $costPurchaseServiceTaxExclude.val(f2Fixed(f2(costPurchaseServiceTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -337,7 +346,7 @@ function calIncomeAndCost() { } else { $("input[name='costOtherOtherTaxExclude']").attr('readonly',true); var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - $costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude/(1+Number(val)))); + $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -352,7 +361,7 @@ function calIncomeAndCost() { return; } else { var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); - $costOtherOtherTaxExclude.val(f2Fixed(costOtherOtherTaxInclude/(1+Number(val)))); + $costOtherOtherTaxExclude.val(f2Fixed(f2(costOtherOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -370,7 +379,7 @@ function calIncomeAndCost() { } else { $("input[name='costPurchaseOtherTaxExclude']").attr('readonly',true); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - $costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude/(1+Number(val)))); + $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); @@ -385,7 +394,7 @@ function calIncomeAndCost() { return; } else { var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - $costPurchaseOtherTaxExclude.val(f2Fixed(costPurchaseOtherTaxInclude/(1+Number(val)))); + $costPurchaseOtherTaxExclude.val(f2Fixed(f2(costPurchaseOtherTaxInclude)/(1+Number(val)))); } calCostExclude(); calIncomeCost(); diff --git a/src/main/resources/static/assets/js/project_final.js b/src/main/resources/static/assets/js/project_final.js index 4bdf666..5f92b92 100644 --- a/src/main/resources/static/assets/js/project_final.js +++ b/src/main/resources/static/assets/js/project_final.js @@ -2,50 +2,95 @@ function calculateFinal() { $("input[name='incomeDeviceFinalTotal']").change(function () { calIncomeFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("incomeDeviceFinalTotal", "input[name='incomeDeviceFinalTotal']"); }); $("input[name='incomeEngineerFinalTotal']").change(function () { calIncomeFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("incomeEngineerFinalTotal", "input[name='incomeEngineerFinalTotal']"); }); $("input[name='incomeServiceFinalTotal']").change(function () { calIncomeFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("incomeServiceFinalTotal", "input[name='incomeServiceFinalTotal']"); }); $("input[name='costPurchaseDeviceFinalTotal']").change(function () { calCostFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseDeviceFinalTotal", "input[name='costPurchaseDeviceFinalTotal']"); }); $("input[name='costPurchaseBuildFinalTotal']").change(function () { calCostFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseBuildFinalTotal", "input[name='costPurchaseBuildFinalTotal']"); }); $("input[name='costPurchaseServiceFinalTotal']").change(function () { calCostFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseServiceFinalTotal", "input[name='costPurchaseServiceFinalTotal']"); }); $("input[name='costPurchaseOtherFinalTotal']").change(function () { calCostFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costPurchaseOtherFinalTotal", "input[name='costPurchaseOtherFinalTotal']"); }); $("input[name='costProjectManageFinalTotal']").change(function () { calCostFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costProjectManageFinalTotal", "input[name='costProjectManageFinalTotal']"); }); $("input[name='costOtherFinalTotal']").change(function () { calCostFinalTotal(); + calGrossProfitFinalTotal(); + calGrossProfitProfitMargin(); + calContributionMarginFinalTotal(); + calContributionMarginProfitMargin(); calNetMarginFinalTotal(); calNetMarginProfitMargin(); + digitalSelf("costOtherFinalTotal", "input[name='costOtherFinalTotal']"); }); @@ -53,48 +98,57 @@ 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']"); }); - + //现金流量表 $("input[name='saleIncomeCash']").change(function () { //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 +157,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 +172,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 +206,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 +223,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 +239,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 +253,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 +270,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(""); } @@ -232,9 +290,9 @@ function calCostFinalTotal() { var costFinalTotal = $("input[name='costFinalTotal']"); if (costPurchaseDeviceFinalTotal && costPurchaseBuildFinalTotal && costPurchaseServiceFinalTotal && - costPurchaseOtherFinalTotal && costProjectManageFinalTotal && costOtherFinalTotal) { - costFinalTotal.val(f2(parseFloat(costPurchaseDeviceFinalTotal) + parseFloat(costPurchaseBuildFinalTotal) + parseFloat(costPurchaseServiceFinalTotal) + - parseFloat(costPurchaseOtherFinalTotal) + parseFloat(costProjectManageFinalTotal) + parseFloat(costOtherFinalTotal))); + costPurchaseOtherFinalTotal && costProjectManageFinalTotal) { + costFinalTotal.val(f2Fixed(f2(costPurchaseDeviceFinalTotal) + f2(costPurchaseBuildFinalTotal) + f2(costPurchaseServiceFinalTotal) + + f2(costPurchaseOtherFinalTotal) + f2(costProjectManageFinalTotal) + f2(costOtherFinalTotal))); } else { costFinalTotal.val(""); } @@ -252,7 +310,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 +342,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 +363,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 +378,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) / f2min(incomeFinalTotal))); } else { grossProfitProfitMargin.val(""); } @@ -337,7 +395,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 +410,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) / f2min(incomeFinalTotal))); } else { contributionMarginProfitMargin.val(""); } @@ -369,7 +427,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 +442,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) / f2min(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..bc7aeed 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(""); } @@ -383,8 +405,8 @@ function calCostOtherSettleTotal() { var costOtherSettleTotal = $("input[name='costOtherSettleTotal']"); - if(costOtherFormerSettleTotal && costOther){ - costOtherSettleTotal.val(f2(parseFloat(costOtherFormerSettleTotal)+parseFloat(costOther))); + if(costOtherFormerSettleTotal){ + costOtherSettleTotal.val(f2Fixed(f2(costOtherFormerSettleTotal)+f2(costOther))); }else { costOtherSettleTotal.val(""); } @@ -403,8 +425,8 @@ 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))); + if(costPurchaseDevice && costPurchaseBuild && costPurchaseService && costPurchaseOther && costProjectManage){ + 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)/f2min(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)/f2min(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)/f2min(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/static/assets/js/project_settle_valid.js b/src/main/resources/static/assets/js/project_settle_valid.js index 63bddfb..bd6771c 100644 --- a/src/main/resources/static/assets/js/project_settle_valid.js +++ b/src/main/resources/static/assets/js/project_settle_valid.js @@ -1,7 +1,7 @@ var valid = function() { return incomeDeviceValid() && incomeEngineerValid() && incomeServiceValid() && incomeTotalValid() && costPurchaseDeviceValid() && costPurchaseBuildValid() && costPurchaseServiceValid() && costPurchaseOtherValid() - && costProjectManageValid() && costOtherValid() && costTotalValid() && costExpropriationValid() + && costProjectManageValid() && costTotalValid() && costExpropriationValid() && costCompanyManageValid() && costIncomeTaxValid() && saleIncomeCashValid() && taxReturnValid() && earnestMoneyIncomeValid() && purchaseCostValid() && taxCostValid() && earnestMoneyCostValid() && cashInflowFromInvestingActivitiesValid() && cashOutflowFromInvestingActivitiesValid() @@ -17,13 +17,6 @@ var incomeDeviceValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月收入设备类数据不能小于0"); - }); - return false; - } return true; }; @@ -36,13 +29,6 @@ var incomeEngineerValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月收入工程类数据不能小于0"); - }); - return false; - } return true; }; @@ -55,13 +41,6 @@ var incomeServiceValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月收入服务类数据不能小于0"); - }); - return false; - } return true; }; @@ -87,13 +66,6 @@ var costPurchaseDeviceValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月采购成本设备类数据不能小于0"); - }); - return false; - } return true; }; @@ -106,13 +78,6 @@ var costPurchaseBuildValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月采购成本施工类数据不能小于0"); - }); - return false; - } return true; }; @@ -125,13 +90,6 @@ var costPurchaseServiceValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月采购成本服务类数据不能小于0"); - }); - return false; - } return true; }; @@ -144,13 +102,6 @@ var costPurchaseOtherValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月采购成本其他类数据不能小于0"); - }); - return false; - } return true; }; @@ -164,13 +115,6 @@ var costProjectManageValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月项目管理成本数据不能小于0"); - }); - return false; - } if (parseFloat(salary) > parseFloat(month)) { layui.use('layer', function(){ var layer = layui.layer; @@ -181,25 +125,6 @@ var costProjectManageValid = function() { return true; }; -var costOtherValid = function() { - var month = $("input[name='costOther']").val(); - if (month == "") { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("请填入本月其他成本数据"); - }); - return false; - } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月其他成本数据不能小于0"); - }); - return false; - } - return true; -}; - var costTotalValid = function() { var settle = $("input[name='costSettleTotal']").val(); var budget = $("input[name='costBudgetTotal']").val(); @@ -224,13 +149,6 @@ var costExpropriationValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月财务费用数据不能小于0"); - }); - return false; - } if (parseFloat(settle) > parseFloat(budget)) { layui.use('layer', function(){ var layer = layui.layer; @@ -250,13 +168,6 @@ var costCompanyManageValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月公司管理费用数据不能小于0"); - }); - return false; - } return true; }; @@ -269,13 +180,6 @@ var costIncomeTaxValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月所得税费用数据不能小于0"); - }); - return false; - } return true; }; @@ -288,13 +192,6 @@ var saleIncomeCashValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月本月销售商品、提供劳务收到的现金数据不能小于0"); - }); - return false; - } return true; }; @@ -307,13 +204,6 @@ var taxReturnValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月收到的税费返还数据不能小于0"); - }); - return false; - } return true; }; @@ -326,13 +216,6 @@ var earnestMoneyIncomeValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月收到其他与经营活动有关的现金数据不能小于0"); - }); - return false; - } return true; }; @@ -345,13 +228,6 @@ var purchaseCostValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月购买商品、接受劳务支付的现金数据不能小于0"); - }); - return false; - } return true; }; @@ -364,13 +240,6 @@ var taxCostValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月支付的各项税费数据不能小于0"); - }); - return false; - } return true; }; @@ -383,13 +252,6 @@ var earnestMoneyCostValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月支付其他与经营活动有关的现金数据不能小于0"); - }); - return false; - } return true; }; @@ -402,13 +264,6 @@ var cashInflowFromInvestingActivitiesValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月投资活动现金流入数据不能小于0"); - }); - return false; - } return true; }; @@ -421,13 +276,6 @@ var cashOutflowFromInvestingActivitiesValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月投资活动现金流出数据不能小于0"); - }); - return false; - } return true; }; @@ -440,13 +288,6 @@ var financingCapitalInflowValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月融资资金流入数据不能小于0"); - }); - return false; - } return true; }; @@ -459,13 +300,6 @@ var financingCapitalOutflowValid = function() { }); return false; } - if (parseFloat(month) < 0) { - layui.use('layer', function(){ - var layer = layui.layer; - layer.alert("本月还款资金流出数据不能小于0"); - }); - return false; - } return true; }; diff --git a/src/main/resources/templates/admin/project_approve.ftl b/src/main/resources/templates/admin/project_approve.ftl index e82c6b6..02398ce 100644 --- a/src/main/resources/templates/admin/project_approve.ftl +++ b/src/main/resources/templates/admin/project_approve.ftl @@ -100,18 +100,18 @@
@@ -199,20 +199,20 @@
-<#--
--> -<#--
*垫资利息
--> -<#--
--> -<#-- ${Utils.format(project.advanceInterestAmount)}元--> -<#--
--> -<#--
--> -<#--
--> -<#--
--> -<#--
*垫资峰值
--> -<#--
--> -<#-- ${Utils.format(project.advancePeakAmount)}元--> -<#--
--> -<#--
--> -<#--
--> + <#--
--> + <#--
*垫资利息
--> + <#--
--> + <#-- ${Utils.format(project.advanceInterestAmount)}元--> + <#--
--> + <#--
--> + <#--
--> + <#--
--> + <#--
*垫资峰值
--> + <#--
--> + <#-- ${Utils.format(project.advancePeakAmount)}元--> + <#--
--> + <#--
--> + <#--
-->
*合同金额
@@ -230,14 +230,14 @@
华智产品金额
- ${Utils.format(project.huazhiProductAmount)}元 + ${Utils.format(project.huazhiProductAmount, '0.00')}
其他产品金额
- ${Utils.format(project.ziguangOtherAmount)}元 + ${Utils.format(project.ziguangOtherAmount, '0.00')}
@@ -283,26 +283,26 @@ 收入 设备类 - - + + 收入 工程类 - - + + 收入 服务类 - - + + 合计 - - + + @@ -320,50 +320,50 @@ 成本 采购成本 设备 - - + + 成本 采购成本 施工 - - + + 成本 采购成本 服务 - - + + 成本 采购成本 其他 - - + + 成本 项目管理成本 项目管理成本 - - + + 成本 其他 ${project.otherName!} - - + + 合计 - - + + @@ -378,12 +378,12 @@ 财务费用 资金占用成本 - + 公司管理费用 - + @@ -397,19 +397,19 @@ 项目毛利(元) - + 项目毛利率(%) - + 项目贡献利润(元) - + 项目贡献利润率(%) - + @@ -419,231 +419,735 @@
- <#if (project.status==5 || project.status==10 || project.status==15) && project.approveStatusBudget == 1> -
- - <#if (project.status==5 || project.status==10 || project.status==15) && project.approveStatusBudget == 2> -
- - <#if (project.status==5 || project.status==10 || project.status==15) && project.approveStatusBudget == 3> -
- - 收入 - 收入明细表 - 采购成本明细表 - 项目管理成本表 - 资金计划表 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
类别费用含税金额(元)不含税金额(元)
收入设备类
收入工程类
收入服务类
合计
- 成本 - <#-- 采购成本明细表 - 项目管理成本表--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
类别费用费用项目含税金额(元)不含税金额(元)
成本采购成本设备
成本采购成本施工
成本采购成本服务
成本采购成本其他
成本项目管理成本项目管理成本
成本其他${project.otherName!}
合计
- 管理 - <#--资金计划表--> - - - - - - - - - - - - - - - - - - -
类别费用项目不含税金额(元)
财务费用资金占用成本
公司管理费用
- 利润率计算 - - - - - - - - - - - - - - - - - - - - - - - -
类别
项目毛利(元)
项目毛利率(%)
项目贡献利润(元)
项目贡献利润率(%)
+ +
+
+ <#if (project.status==5 || project.status==10 || project.status==15) && project.approveStatusBudget == 1> +
+ + <#if (project.status==5 || project.status==10 || project.status==15) && project.approveStatusBudget == 2> +
+ + <#if (project.status==5 || project.status==10 || project.status==15) && project.approveStatusBudget == 3> +
+ + <#--收入明细表--> + + + + + + + + + + + + + <#----> + - 现金流量表 - <#--资金计划表--> -
序号类别名称单位数量单价税率(%)含税总金额(元)不含税金额(元)操作
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
类别金额(元)
销售商品、提供劳务收到的现金
收到的税费返还/
收到其他与经营活动有关的现金
购买商品、接受劳务支付的现金
支付的各项税费/
支付其他与经营活动有关的现金
经营活动产生的现金流量净额
投资活动现金流入/
投资活动现金流出/
投资活动产生的现金流量净额/
融资资金流入
还款资金流出
筹资活动产生的现金流量净额
货币资金净增加额
+ <#if incomeDetails??> + <#list incomeDetails as incomeDetail> + + ${(incomeDetail_index+1)!} + + <#----> + <#if incomeDetail.type ==1 > + 设备类 + <#elseif incomeDetail.type ==2> + 工程类 + <#elseif incomeDetail.type ==3> + 服务类 + + + + + + + + + + <#-- + + --> + + + + + + +
+
+ <#--采购成本明细表--> + + + + + + + + + + + + + + <#----> + + + <#if costDetails??> + <#list costDetails as costDetail> + + + + + + + + + + + + + + + + + +
序号大类类别名称单位数量单价税率(%)含税总金额(元)不含税金额(元)操作
${(costDetail_index+1)!} + <#----> + <#if costDetail.type ==1 > + 设备 + <#elseif costDetail.type ==2> + 施工 + <#elseif costDetail.type ==3> + 服务 + <#elseif costDetail.type ==4> + 其他 + + + <#list procurementTypes as procurementType> + <#if costDetail.category == procurementType.id>${procurementType.name} + + + + + <#-- --> +
+
+
+ <#--项目管理成本表--> + + + + + + + + + + + + + + + <#----> + + + <#if costProjectManageDetails??> + <#list costProjectManageDetails as costProjectManageDetail> + + + + + + + + + + + + + <#----> + + + + + +
序号财务费用类别业务项目项目明细单位数量单价总金额(元)预估计算方法预估依据备注操作
${(costProjectManageDetail_index+1)!} + <#----> + <#if costProjectManageDetail.type ==1 > + 人工成本 + <#elseif costProjectManageDetail.type ==2> + 业务费用 + <#elseif costProjectManageDetail.type ==3> + 其他费用 + + readonly-->> + + <#if costProjectManageDetail.deletable==1> + + +
+
+
+ <#--资金计划表--> + + + + + + + + + + + + + + + + + <#-- --> + + + + + + + + + + + + + + + + + + + <#if projectBudgetPlanDetails??> + <#list projectBudgetPlanDetails as projectBudgetPlanDetail> + + + + + + + + + + + + + + + <#----> + + + + + +
月份设备支出工程支出(含服务+施工+其他)经营性开支保证金支出支出合计销售收款保证金收款收款合计资金余额资金利息垫资计划还款计划操作
<#---->${projectBudgetPlanDetailTotal.month}
<#---->${projectBudgetPlanDetail.month!} + + + + + + + +
+
+ <#--收入明细表 + 采购成本明细表 + 项目管理成本表 + 资金计划表--> +
+ 收入 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
类别费用含税金额(元)不含税金额(元)
收入设备类
收入工程类
收入服务类
合计
+ 成本 + <#-- 采购成本明细表 + 项目管理成本表--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
类别费用费用项目含税金额(元)不含税金额(元)
成本采购成本设备
成本采购成本施工
成本采购成本服务
成本采购成本其他
成本项目管理成本项目管理成本
成本其他${project.otherName!}
合计
+ 管理 + <#--资金计划表--> + + + + + + + + + + + + + + + + + + +
类别费用项目不含税金额(元)
财务费用资金占用成本
公司管理费用
+ + + + 利润率计算 + + + + + + + + + + + + + + + + + + + + + + + +
类别
项目毛利(元)
项目毛利率(%)
项目贡献利润(元)
项目贡献利润率(%)
+ + 现金流量表 + <#--资金计划表--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
类别金额(元)
销售商品、提供劳务收到的现金
收到的税费返还/
收到其他与经营活动有关的现金
购买商品、接受劳务支付的现金
支付的各项税费/
支付其他与经营活动有关的现金
经营活动产生的现金流量净额
投资活动现金流入/
投资活动现金流出/
投资活动产生的现金流量净额/
融资资金流入
还款资金流出
筹资活动产生的现金流量净额
货币资金净增加额
+
+
@@ -684,38 +1188,38 @@ 收入 设备类 - - - - - + + + + + 收入 工程类 - - - - - + + + + + 收入 服务类 - - - - - + + + + + 合计 - - - - - + + + + + @@ -736,71 +1240,71 @@ 成本 采购成本 设备 - - - - - + + + + + 成本 采购成本 施工 - - - - - + + + + + 成本 采购成本 服务 - - - - - + + + + + 成本 采购成本 其他 - - - - - + + + + + 成本 项目管理成本 项目管理成本 - - - - - + + + + + 成本 其他 ${project.otherName!} - - - - - + + + + + 合计 - - - - - + + + + + @@ -819,38 +1323,38 @@ 财务费用 资金占用成本 - - - - - + + + + + 公司管理费用 - - - - - + + + + + 所得税费用 / / - - - + + + 合计 - - - - - + + + + + @@ -869,30 +1373,30 @@ 项目毛利 - - - - - - + + + + + + 项目贡献利润 - - - - - - + + + + + + 项目净利润 / - /<#----> - - - - + /<#----> + + + + @@ -909,109 +1413,109 @@ 销售商品、提供劳务收到的现金 - - - - + + + + 收到的税费返还 / - - - + + + 收到其他与经营活动有关的现金 - - - - + + + + 购买商品、接受劳务支付的现金 - - - - + + + + 支付的各项税费 / - - - + + + 支付其他与经营活动有关的现金 - - - - + + + + 经营活动产生的现金流量净额 - - - - + + + + 投资活动现金流入 / - - - + + + 投资活动现金流出 / - - - + + + 投资活动产生的现金流量净额 / - - - + + + 融资资金流入 - - - - + + + + 还款资金流出 - - - - + + + + 筹资活动产生的现金流量净额 - - - - + + + + 货币资金净增加额 - - - - + + + + <#-- 合计 - - - - + + + --> @@ -1046,34 +1550,34 @@ 收入 设备类 - - - - + + + + 收入 工程类 - - - - + + + + 收入 服务类 - - - - + + + + 合计 - - - - + + + + @@ -1093,64 +1597,64 @@ 成本 采购成本 设备 - - - - + + + + 成本 采购成本 施工 - - - - + + + + 成本 采购成本 服务 - - - - + + + + 成本 采购成本 其他 - - - - + + + + 成本 项目管理成本 项目管理成本 - - - - + + + + 成本 其他 ${project.otherName!} - - - - + + + + 合计 - - - - + + + + @@ -1168,34 +1672,34 @@ 财务费用 资金占用成本 - - - - + + + + 公司管理费用 - - - - + + + + 所得税费用 / / - - + + 合计 - - - - + + + + @@ -1213,27 +1717,27 @@ 项目毛利 - - - - - + + + + + 项目贡献利润 - - - - - + + + + + 项目净利润 / - <#---->/ - - - + <#---->/ + + + @@ -1249,93 +1753,93 @@ 销售商品、提供劳务收到的现金 - - - + + + 收到的税费返还 / - - + + 收到其他与经营活动有关的现金 - - - + + + 购买商品、接受劳务支付的现金 - - - + + + 支付的各项税费 / - - + + 支付其他与经营活动有关的现金 - - - + + + 经营活动产生的现金流量净额 - - - + + + 投资活动现金流入 / - - + + 投资活动现金流出 / - - + + 投资活动产生的现金流量净额 / - - + + 融资资金流入 - - - + + + 还款资金流出 - - - + + + 筹资活动产生的现金流量净额 - - - + + + 货币资金净增加额 - - - + + + <#-- 合计 - - - + + + --> @@ -1424,13 +1928,13 @@ - - - + - - - + - <#-- --> + <#-- --> @@ -1607,19 +2111,19 @@ readonly-->> + <#--<#if costProjectManageDetail.deletable==0>readonly-->> - - + value="${Utils.format2(costProjectManageDetail.price,'0')}"> 月份 设备支出 - 工程支出 + 工程支出(含服务+施工+其他) 经营性开支 保证金支出 支出合计 @@ -1680,56 +2184,56 @@ 资金利息 垫资计划 还款计划 - <#-- 操作--> + <#-- 操作--> <#---->${projectBudgetPlanDetailTotal.month} - - - - - - - - - - - - @@ -1742,49 +2246,49 @@ <#---->${projectBudgetPlanDetail.month!} - - - - - - - - - - - - @@ -1834,7 +2338,7 @@
@@ -1902,7 +2406,7 @@ 返回上一级 <#if adminId==project.approveId> - + @@ -1923,6 +2427,11 @@