Parcourir la source

合同支付,起扣、限额计算判断调整

MaiXinRong il y a 2 ans
Parent
commit
c916d0bc40
1 fichiers modifiés avec 15 ajouts et 13 suppressions
  1. 15 13
      app/lib/pay_calc.js

+ 15 - 13
app/lib/pay_calc.js

@@ -118,21 +118,23 @@ class PayCalculate {
      * @param {Array} pays - (标段)合同支付数据
      */
     async calculateStartRangePrice (pays) {
-        const order = this.stage.curOrder;
+        //const order = this.stage.curOrder;
         for (const p of pays) {
             // 非本期,本次添加的合同支付项,不允许计算,其中默认添加的合同支付项,归属于第一期原报
-            if (p.csorder === this.stage.order || (p.csorder === 0 || this.stage.order === 1)) {
-                if (p.csaorder === order) {
-                    if (!p.sprice && p.sexpr && p.sexpr !== '') {
-                        p.sprice = this.ctx.helper.round(this._calculateExpr(p.sexpr), this.decimal);
-                    } else if (p.sprice && !p.sexpr) {
-                        p.sprice = this.ctx.helper.round(p.sprice, this.decimal);
-                    }
-                    if (!p.rprice && p.rexpr && p.rexpr !== '') {
-                        p.rprice = this.ctx.helper.round(this._calculateExpr(p.rexpr), this.decimal);
-                    } else if (p.rprice && !p.rexpr) {
-                        p.rprice = this.ctx.helper.round(p.rprice, this.decimal);
-                    }
+            // if (p.csorder === this.stage.order || (p.csorder === 0 || this.stage.order === 1)) {
+            //     if (p.csaorder === order) {
+            //     }
+            // }
+            if (!p.pre_used) {
+                if (!p.sprice && p.sexpr && p.sexpr !== '') {
+                    p.sprice = this.ctx.helper.round(this._calculateExpr(p.sexpr), this.decimal);
+                } else if (p.sprice && !p.sexpr) {
+                    p.sprice = this.ctx.helper.round(p.sprice, this.decimal);
+                }
+                if (!p.rprice && p.rexpr && p.rexpr !== '') {
+                    p.rprice = this.ctx.helper.round(this._calculateExpr(p.rexpr), this.decimal);
+                } else if (p.rprice && !p.rexpr) {
+                    p.rprice = this.ctx.helper.round(p.rprice, this.decimal);
                 }
             }
         }