diff --git a/src/main/java/cn/palmte/work/bean/IncomeCostBean.java b/src/main/java/cn/palmte/work/bean/IncomeCostBean.java index b3c7e19..1288065 100644 --- a/src/main/java/cn/palmte/work/bean/IncomeCostBean.java +++ b/src/main/java/cn/palmte/work/bean/IncomeCostBean.java @@ -160,11 +160,14 @@ public abstract class IncomeCostBean { } - /*public BigDecimal getCostProjectManageTaxInclude() { - return costProjectManageTaxInclude; + /** + * 项目管理成本含税=项目管理成本不含税 + */ + public BigDecimal getCostProjectManageTaxInclude() { + return getCostProjectManageTaxExclude(); } - public void setCostProjectManageTaxInclude(BigDecimal costProjectManageTaxInclude) { + /*public void setCostProjectManageTaxInclude(BigDecimal costProjectManageTaxInclude) { this.costProjectManageTaxInclude = costProjectManageTaxInclude; }*/ @@ -285,12 +288,13 @@ public abstract class IncomeCostBean { BigDecimal costPurchaseBuildTaxInclude = getCostPurchaseBuildTaxInclude(); BigDecimal costPurchaseServiceTaxInclude = getCostPurchaseServiceTaxInclude(); BigDecimal costPurchaseOtherTaxInclude = getCostPurchaseOtherTaxInclude(); + BigDecimal costProjectManageTaxInclude = getCostProjectManageTaxInclude(); BigDecimal costOtherOtherTaxInclude = getCostOtherOtherTaxInclude(); if(null == costPurchaseDeviceTaxInclude || null == costPurchaseBuildTaxInclude || null == costPurchaseServiceTaxInclude || null == costPurchaseOtherTaxInclude - /*|| null == costProjectManageTaxInclude*/ + || null == costProjectManageTaxInclude || null == costOtherOtherTaxInclude){ return handleSpecial(null); } @@ -298,7 +302,7 @@ public abstract class IncomeCostBean { .add(costPurchaseBuildTaxInclude) .add(costPurchaseServiceTaxInclude) .add(costPurchaseOtherTaxInclude) - /*.add(null == costProjectManageTaxInclude ? new BigDecimal(0) : costProjectManageTaxInclude)*/ + .add(costProjectManageTaxInclude) .add(costOtherOtherTaxInclude); } @@ -320,7 +324,8 @@ public abstract class IncomeCostBean { || null == costOtherOtherTaxExclude){ return handleSpecial(null); } - return costPurchaseDeviceTaxExclude.add(costPurchaseBuildTaxExclude) + return costPurchaseDeviceTaxExclude + .add(costPurchaseBuildTaxExclude) .add(costPurchaseServiceTaxExclude) .add(costPurchaseOtherTaxExclude) .add(costProjectManageTaxExclude) 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 619da2a..1c93b58 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -106,12 +106,13 @@ function updateCostData(data, returnData) { $("input[name='costPurchaseOtherTaxInclude']").val(f2(otherTaxInclude)); $("input[name='costPurchaseOtherTaxExclude']").val(f2(otherTaxExclude)); - var costOtherOtherTaxInclude = parseFloat($("input[name='costOtherOtherTaxInclude']").val()); - var costOtherOtherTaxExclude = parseFloat($("input[name='costOtherOtherTaxExclude']").val()); + var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val()); + var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val()); - var costProjectManageTaxExclude = parseFloat($("input[name='costProjectManageTaxExclude']").val()); + var costProjectManageTaxInclude = f2($("input[name='costProjectManageTaxInclude']").val()); + var costProjectManageTaxExclude = f2($("input[name='costProjectManageTaxExclude']").val()); - $("input[name='costTotalTaxInclude']").val(f2(deviceTaxInclude+buildTaxInclude+serviceTaxInclude+otherTaxInclude+costOtherOtherTaxInclude)); + $("input[name='costTotalTaxInclude']").val(f2(deviceTaxInclude+buildTaxInclude+serviceTaxInclude+otherTaxInclude+costOtherOtherTaxInclude+costProjectManageTaxInclude)); $("input[name='costTotalTaxExclude']").val(f2(deviceTaxExclude+buildTaxExclude+serviceTaxExclude+otherTaxExclude+costOtherOtherTaxExclude+costProjectManageTaxExclude)); updateProjectContributionProfitRate(); @@ -124,9 +125,10 @@ function bindOtherOtherChangeable() { var costPurchaseServiceTaxInclude = f2($("input[name='costPurchaseServiceTaxInclude']").val()); var costPurchaseOtherTaxInclude = f2($("input[name='costPurchaseOtherTaxInclude']").val()); + var costProjectManageTaxInclude = f2($("input[name='costProjectManageTaxInclude']").val()); var costOtherOther = f2($(this).val()); - $("input[name='costTotalTaxInclude']").val(f2(costPurchaseDeviceTaxInclude+costPurchaseBuildTaxInclude+costPurchaseServiceTaxInclude+costPurchaseOtherTaxInclude+costOtherOther)); + $("input[name='costTotalTaxInclude']").val(f2(costPurchaseDeviceTaxInclude+costPurchaseBuildTaxInclude+costPurchaseServiceTaxInclude+costPurchaseOtherTaxInclude+costProjectManageTaxInclude+costOtherOther)); updateProjectContributionProfitRate(); 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 b6ce589..4a148a2 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 @@ -82,6 +82,20 @@ function updateCostProjectManageData(data,returnData) { }); $("input[name='costProjectManageTaxExclude']").val(total); + $("input[name='costProjectManageTaxInclude']").val(total); + + var costPurchaseDeviceTaxInclude = f2($("input[name='costPurchaseDeviceTaxInclude']").val()); + var costPurchaseBuildTaxInclude = f2($("input[name='costPurchaseBuildTaxInclude']").val()); + var costPurchaseServiceTaxInclude = f2($("input[name='costPurchaseServiceTaxInclude']").val()); + var costPurchaseOtherTaxInclude = f2($("input[name='costPurchaseOtherTaxInclude']").val()); + + var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val()); + + $("input[name='costTotalTaxInclude']").val(f2(costPurchaseDeviceTaxInclude+costPurchaseBuildTaxInclude+costPurchaseServiceTaxInclude+costPurchaseOtherTaxInclude+total+costOtherOtherTaxInclude)); + + + + var costPurchaseDeviceTaxExclude = f2($("input[name='costPurchaseDeviceTaxExclude']").val()); var costPurchaseBuildTaxExclude = f2($("input[name='costPurchaseBuildTaxExclude']").val()); @@ -92,5 +106,6 @@ function updateCostProjectManageData(data,returnData) { $("input[name='costTotalTaxExclude']").val(f2(costPurchaseDeviceTaxExclude+costPurchaseBuildTaxExclude+costPurchaseServiceTaxExclude+costPurchaseOtherTaxExclude+total+costOtherOtherTaxExclude)); + updateProjectContributionProfitRate(); } \ No newline at end of file diff --git a/src/main/resources/static/assets/js/project_estimate.js b/src/main/resources/static/assets/js/project_estimate.js index 76d2d6b..67a16f5 100644 --- a/src/main/resources/static/assets/js/project_estimate.js +++ b/src/main/resources/static/assets/js/project_estimate.js @@ -70,6 +70,12 @@ function calIncomeAndCost() { }); $("input[name='costProjectManageTaxExclude']").change(function () { calCostExclude(); + + //不含税的=含税的 + //含税的总额更新 + $("input[name='costProjectManageTaxInclude']").val($("input[name='costProjectManageTaxExclude']").val()); + calCostInclude(); + calIncomeCost(); }); $("input[name='costOtherOtherTaxExclude']").change(function () { @@ -127,14 +133,14 @@ function calCostInclude() { var costPurchaseBuildTaxInclude = $("input[name='costPurchaseBuildTaxInclude']").val(); var costPurchaseServiceTaxInclude = $("input[name='costPurchaseServiceTaxInclude']").val(); var costPurchaseOtherTaxInclude = $("input[name='costPurchaseOtherTaxInclude']").val(); - //var costProjectManageTaxInclude = $("input[name='costProjectManageTaxInclude']").val(); + var costProjectManageTaxInclude = $("input[name='costProjectManageTaxInclude']").val(); var costOtherOtherTaxInclude = $("input[name='costOtherOtherTaxInclude']").val(); var costTotalTaxInclude = $("input[name='costTotalTaxInclude']"); - if(costPurchaseDeviceTaxInclude && costPurchaseBuildTaxInclude && costPurchaseServiceTaxInclude && costPurchaseOtherTaxInclude /*&& costProjectManageTaxInclude*/ && costOtherOtherTaxInclude){ - costTotalTaxInclude.val(parseFloat(costPurchaseDeviceTaxInclude)+parseFloat(costPurchaseBuildTaxInclude)+parseFloat(costPurchaseServiceTaxInclude)+parseFloat(costPurchaseOtherTaxInclude)/*+parseFloat(costProjectManageTaxInclude)*/+parseFloat(costOtherOtherTaxInclude)); + if(costPurchaseDeviceTaxInclude && costPurchaseBuildTaxInclude && costPurchaseServiceTaxInclude && costPurchaseOtherTaxInclude && costProjectManageTaxInclude && costOtherOtherTaxInclude){ + costTotalTaxInclude.val(parseFloat(costPurchaseDeviceTaxInclude)+parseFloat(costPurchaseBuildTaxInclude)+parseFloat(costPurchaseServiceTaxInclude)+parseFloat(costPurchaseOtherTaxInclude)+parseFloat(costProjectManageTaxInclude)+parseFloat(costOtherOtherTaxInclude)); }else { costTotalTaxInclude.val(""); } diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index 12b2c0b..b5bf03e 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -276,8 +276,8 @@