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 = '
|
项目毛利 |
- |
- |
- |
- |
- |
- |
+ |
+ |
+ |
+ |
+ |
+ |
项目贡献利润 |
- |
- |
- |
- |
- |
- |
+ |
+ |
+ |
+ |
+ |
+ |
项目净利润 |
/ |
- /<#----> |
- |
- |
- |
- |
+ /<#----> |
+ |
+ |
+ |
+ |
@@ -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 @@
|
- |
- |
- |
+ |
|
- |
- |
- |
+ |
|
- <#-- -->
+ <#-- -->
|
#list>
@@ -1607,19 +2111,19 @@
readonly#if>-->> |
+ <#--<#if costProjectManageDetail.deletable==0>readonly#if>-->>
|
|
- |
- |
+ 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>
-
+
#if>
@@ -1923,6 +2427,11 @@