Browse Source

处理诚信扣款、甲供材超供抵扣款、税金处理

chengqiang 5 years ago
parent
commit
eb4db686ab

File diff suppressed because it is too large
+ 1128 - 592
src/main/java/com/jeeplus/modules/sg/overheadline/service/OverheadLineService.java


+ 117 - 15
src/main/java/com/jeeplus/modules/sg/overheadline/util/BashInfo.java

@@ -57,12 +57,14 @@ public class BashInfo {
     public static final String MX_GZW = "2 构筑物";
     public static final String MX_FZGC = "3 辅助工程";
     public static final String MX_CSXM = "4 措施项目";
+    public static final String MX_JZCSXM = "4 措施项目";
     public static final String MX_DLQ = "1 电缆桥、支架制作安装";
     public static final String MX_DLFS = "2 电缆敷设";
     public static final String MX_DLFJ = "3 电缆附件";
     public static final String MX_DLFH= "4 电缆防火";
     public static final String MX_TSJSY = "5 调试及试验";
     public static final String MX_DLJC = "6 电缆监测(控)系统";
+    public static final String MX_AZCSXM = "7 措施项目";
 
 
     public static final String MX_FHGL = "1 复合光缆线路";
@@ -236,6 +238,33 @@ public class BashInfo {
     }
 
     /**
+     * 获取架线工程措施费数组 【0】临时设施费、安全文明施工费和   【1】其他费用和
+     */
+    public static double[] getCsFees(ImportExcel importExcel){
+        int lastRow = importExcel.getLastDataRowNum();
+        double ls = 0.00;
+        double aq = 0.00;
+        double total = 0.00;
+        for(int i=2;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            String type1 = importExcel.getValue(i+1,0);
+            if(type.contains(CS_LS)){
+                ls = importExcel.getDouble(i+1,4);
+            }
+            if(type.contains(CS_AQWM)){
+                aq = importExcel.getDouble(i+1,4);
+            }
+            if(type1.equals(QT_HJ)){
+                total = importExcel.getDouble(i+1,4);
+            }
+        }
+        double[] cs = new double[2];
+        cs[0] = ls+aq;
+        cs[1] = total - ls -aq;
+        return cs;
+    }
+
+    /**
      * 获取建筑工程措施费率
      * 代码逻辑:获取“安装措施项目”前的费率和
      * 这里默认如果建筑安装都有建筑排前面
@@ -254,7 +283,7 @@ public class BashInfo {
      }
 
     /**
-     * 架空线路规费合计
+     * 架空线路措施费一合计
      * @param importExcel
      * @return
      */
@@ -405,6 +434,41 @@ public class BashInfo {
     }
 
     /**
+     * 获取建筑措施费,[0]临时设置+安全文明  [1]剩余和
+     */
+    public static double[] getJzCsFees(ImportExcel importExcel){
+        int lastRow = importExcel.getLastDataRowNum();
+        int azRow = 0;
+        for(int i=0;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            if(type.equals(CS_AZ)){
+                azRow = i+1;
+                break;
+            }
+        }
+        double ls = 0.00;
+        double aq = 0.00;
+        double total = 0.00;
+        for(int i=0;i<azRow+1;i++){
+            String type = importExcel.getValue(i+1,1);
+            String type1 = importExcel.getValue(i+1,0);
+            if(type.contains(CS_LS)){
+                ls = importExcel.getDouble(i+1,4);
+            }
+            if(type.contains(CS_AQWM)){
+                aq = importExcel.getDouble(i+1,4);
+            }
+            if(type1.equals(QT_XJ)){
+                total = importExcel.getDouble(i+1,4);
+            }
+        }
+        double[] d = new double[2];
+        d[0] = DoubleUtil.add(ls,aq);
+        d[1] = DoubleUtil.sub(total,d[0]);
+        return d;
+    }
+
+    /**
      * 获取安装措施费中除去“临时设施费”、“安全文明施工费”以外金额合计
      * 代码逻辑:找到“安装措施项目”,往下找“临时设施费“、”安全文明施工费“、”小计“,
      * 返回“小计” - “临时设施费” - “安全文明施工费”结果
@@ -442,6 +506,44 @@ public class BashInfo {
         return d;
     }
 
+    /**
+     * 获取安装措施费,[0]临时设置+安全文明  [1]剩余和
+     */
+    public static double[] getAzCsFees(ImportExcel importExcel){
+        int lastRow = importExcel.getLastDataRowNum();
+        int azRow = 0;
+        for(int i=0;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            if(type.equals(CS_AZ)){
+                azRow = i+1;
+                break;
+            }
+        }
+        if(azRow == 0){
+            return new double[]{0.00,0.00};
+        }
+        double ls = 0.00;
+        double aq = 0.00;
+        double total = 0.00;
+        for(int i=azRow;i<lastRow;i++){
+            String type = importExcel.getValue(i+1,1);
+            String type1 = importExcel.getValue(i+1,0);
+            if(type.contains(CS_LS)){
+                ls = importExcel.getDouble(i+1,4);
+            }
+            if(type.contains(CS_AQWM)){
+                aq = importExcel.getDouble(i+1,4);
+            }
+            if(type1.equals(QT_XJ)){
+                total = importExcel.getDouble(i+1,4);
+            }
+        }
+        double[] cs = new double[2];
+        cs[0] = DoubleUtil.add(ls,aq);
+        cs[1] = DoubleUtil.sub(total,cs[0]);
+        return cs;
+    }
+
 
 
     /**
@@ -576,15 +678,15 @@ public class BashInfo {
         if(azRow == 0){
             return 0.00;
         }
-        double totalRate = 0.00;
+        double total = 0.00;
         for (int i = azRow; i < lastRow; i++) {
             String type = importExcel.getValue(i + 1, 0);
             if (type.equals(QT_XJ)) {
-                totalRate = importExcel.getDouble(i + 1, 4);
+                total = importExcel.getDouble(i + 1, 4);
             }
         }
 
-        return totalRate;
+        return total;
     }
 
     /**
@@ -653,30 +755,30 @@ public class BashInfo {
      */
     public static double[] getQtFees(ImportExcel importExcel) {
         int lastRow = importExcel.getLastDataRowNum();
-        double cdFree = 0.00;
-        double zbFree = 0.00;
-        double totalFree = 0.00;
+        double cdFee = 0.00;
+        double zbFee = 0.00;
+        double totalFee = 0.00;
         for(int i=2;i<lastRow;i++){
             String type = importExcel.getValue(i+1,1);
             String type1 = importExcel.getValue(i+1,0);
             if(type.equals(QT_SGCDZY)){
-                cdFree = importExcel.getDouble(i+1,2);
+                cdFee = importExcel.getDouble(i+1,2);
                 continue;
             }
             if(type.contains(QT_ZBDL)){
-                zbFree = importExcel.getDouble(i+1,2);
+                zbFee = importExcel.getDouble(i+1,2);
                 continue;
             }
             if(type1.equals(QT_HJ)){
-                totalFree = importExcel.getDouble(i+1,2);
+                totalFee = importExcel.getDouble(i+1,2);
                 continue;
             }
         }
-        double[] rate = new double[3];
-        rate[0] = cdFree;
-        rate[1] = zbFree;
-        rate[2] = totalFree-cdFree-zbFree;
-        return  rate;
+        double[] qt = new double[3];
+        qt[0] = cdFee;
+        qt[1] = zbFee;
+        qt[2] = totalFee-cdFee-zbFee;
+        return  qt;
     }
 
 

+ 22 - 0
src/main/java/com/jeeplus/modules/sg/overheadline/util/DoubleUtil.java

@@ -20,6 +20,8 @@ public class DoubleUtil {
      * @return
      */
     public static double sub(Double value1, Double value2) {
+        value1 = value1 != null?value1:0.00;
+        value2 = value2 != null?value2:0.00;
         BigDecimal b1 = new BigDecimal(Double.toString(value1));
         BigDecimal b2 = new BigDecimal(Double.toString(value2));
         return b1.subtract(b2).doubleValue();
@@ -32,9 +34,29 @@ public class DoubleUtil {
      * @return
      */
     public static double add(Double value1, Double value2) {
+        value1 = value1 != null?value1:0.00;
+        value2 = value2 != null?value2:0.00;
         BigDecimal b1 = new BigDecimal(Double.toString(value1));
         BigDecimal b2 = new BigDecimal(Double.toString(value2));
         return b1.add(b2).doubleValue();
     }
 
+    /**
+     * 返回多个Double的精确相加值
+     * @param value1
+     * @param values
+     * @return
+     */
+    public static double add(Double value1,Double...values){
+        value1 = value1 != null?value1:0.00;
+        BigDecimal b1 = new BigDecimal(Double.toString(value1));
+        for(int i=0;i<values.length;i++){
+            Double value2 = values[i];
+            value2 = value2!=null?value2:0.00;
+            BigDecimal b2 = new BigDecimal(Double.toString(value2));
+            b1 = b1.add(b2);
+        }
+        return b1.doubleValue();
+    }
+
 }

+ 2 - 2
src/main/webapp/webpage/modules/sg/project/management.js

@@ -55,7 +55,7 @@ layui.config({
                                 +"<a style='margin-top: 3px;' class='layui-btn layui-btn-xs layui-btn-danger' id=delPro"+d.id+" onclick=\"deleteProject('"+d.id+"')\">删除</a>"
                                 // +"<br>"
                                 +"<a style='margin-top: 3px;' class='layui-btn layui-btn-warm layui-btn-xs' lay-event=''href=\"${ctx}/project/exportone?id=" + d.id+"\">导出wbs工程</a>"
-                                +"<a style='margin-top: 3px;' class='layui-btn layui-btn-normal layui-btn-xs'onclick=\"withhold( '${ctx}/project/withholdform?id=" + d.id + "&tabId=1')\">诚信扣款</a></div>";
+                                +"<a style='margin-top: 3px;' class='layui-btn layui-btn-normal layui-btn-xs'onclick=\"withhold( '${ctx}/project/withholdform?id=" + d.id + "&tabId=1')\">财务处理</a></div>";
                                 // +"<a style='margin-top: 3px;' class='layui-btn layui-btn-warm layui-btn-xs'onclick=\"materialOffset( '${ctx}/project/materialOffsetForm?id=" + d.id + "&tabId=1')\">甲供材抵扣</a>"
                                 // +"<a style='margin-top: 3px;' class='layui-btn layui-btn-warm layui-btn-xs'onclick=\"taxDeductions( '${ctx}/project/taxDeductionsForm?id=" + d.id + "&tabId=1')\">税额扣减</a></div>";
 
@@ -200,7 +200,7 @@ function look(url) { //工程 查看
     function withhold(url) { //诚信扣款
        layer.open({
         type: 2,
-        title: '诚信扣款',
+        title: '财务处理',
         area: ['70%', '90%'],
         offset:['7%','14%'],
         shade: 0.8,

+ 6 - 6
src/main/webapp/webpage/modules/sg/projecttem/addItem2Form.js

@@ -107,11 +107,11 @@ function okSubmit() {
     }
     //判断施工单位是否输入
     for(var k = 0;k < div3value.length;k++){
-        if(div3value[k]=='合计'){
-            layer.msg("供应商不能为合计",{icon: 3,offset:['40%','40%']});
-            throw SyntaxError;
-        }
-        if(div3value[k]==null||div3value[k]==""){
+        // if(div3value[k].trim()=='合计'){
+        //     layer.msg("供应商不能为合计",{icon: 3,offset:['40%','40%']});
+        //     throw SyntaxError;
+        // }
+        if(div3value[k]==null||div3value[k].trim()==""){
             layer.msg("请输入供应商",{icon: 3,offset:['40%','40%']});
             throw SyntaxError;
         }
@@ -178,7 +178,7 @@ function okSubmit() {
 function clearTotal(id) {
     var totalId = "tab"+id;
     var total = $("#"+totalId).text();
-    if(total == '合计'){
+    if(total.trim() == '合计'){
         $("#"+totalId).text(" ");
         layer.msg("供应商名称不能为合计",{icon: 3,offset:['40%','40%']});
     }

+ 2 - 2
src/main/webapp/webpage/modules/sg/projecttem/manageList.js

@@ -32,7 +32,7 @@
     xml += "<div><a class='layui-btn layui-btn-primary layui-btn-xs' onclick=\"look( '${ctx}/project/tem/form?id=" + d.id + "&tabId=1')\">查看</a>"
         +"<a class='layui-btn layui-btn-xs'  onclick=\"update( '${ctx}/project/tem/form?id=" + d.id + "&tabId=2')\">修改</a>"
         +"<a class='layui-btn layui-btn-normal layui-btn-xs' lay-event='add'>添加结算书</a>"
-        +"<a  class='layui-btn layui-btn-warm layui-btn-xs'onclick=\"withhold( '${ctx}/project/withholdform?id=" + d.id + "&tabId=1')\">诚信扣款</a></div>";
+        +"<a  class='layui-btn layui-btn-warm layui-btn-xs'onclick=\"withhold( '${ctx}/project/withholdform?id=" + d.id + "&tabId=1')\">财务处理</a></div>";
         // +"<a  class='layui-btn layui-btn-warm layui-btn-xs'onclick=\"materialOffset( '${ctx}/project/materialOffsetForm?id=" + d.id + "&tabId=1')\">甲供材抵扣</a>"
         // +"<a  class='layui-btn layui-btn-warm layui-btn-xs'onclick=\"taxDeductions( '${ctx}/project/taxDeductionsForm?id=" + d.id + "&tabId=1')\">税额扣减</a>";
     }
@@ -175,7 +175,7 @@ function update(url) {//修改工程下项目
     function withhold(url) { //诚信扣款
     layer.open({
         type: 2,
-        title: '诚信扣款',
+        title: '财务处理',
         area: ['70%', '90%'],
         offset:['7%','14%'],
         shade: 0.8,