Просмотр исходного кода

修改正负变更值计算方式

ellisran 2 дней назад
Родитель
Сommit
c27bbdf57a
1 измененных файлов с 11 добавлено и 11 удалено
  1. 11 11
      app/service/change_audit_list.js

+ 11 - 11
app/service/change_audit_list.js

@@ -516,12 +516,12 @@ module.exports = app => {
                             } else {
                                 unvaluation_amount = this.ctx.helper.add(unvaluation_amount, cl.spamount);
                             }
-                            const posOrNePrice = this.ctx.helper.mul(cl.spamount, this.ctx.helper.round(cl.unit_price, up_decimal), tp_decimal);
-                            if (posOrNePrice >= 0) {
-                                positive_tp = this.ctx.helper.add(positive_tp, posOrNePrice);
-                            } else {
-                                negative_tp = this.ctx.helper.add(negative_tp, posOrNePrice);
-                            }
+                            // const posOrNePrice = this.ctx.helper.mul(cl.spamount, this.ctx.helper.round(cl.unit_price, up_decimal), tp_decimal);
+                            // if (posOrNePrice >= 0) {
+                            //     positive_tp = this.ctx.helper.add(positive_tp, posOrNePrice);
+                            // } else {
+                            //     negative_tp = this.ctx.helper.add(negative_tp, posOrNePrice);
+                            // }
                         }
                     }
                     const price = this.ctx.helper.mul(spamount, this.ctx.helper.round(unitPrice, up_decimal), tp_decimal);
@@ -530,11 +530,11 @@ module.exports = app => {
                     valuation_tp = this.ctx.helper.add(valuation_tp, valuation_price);
                     unvaluation_tp = this.ctx.helper.add(unvaluation_tp, unvaluation_price);
                     total_price = this.ctx.helper.add(total_price, price);
-                    // if (price >= 0) {
-                    //     positive_tp = this.ctx.helper.accAdd(positive_tp, price);
-                    // } else {
-                    //     negative_tp = this.ctx.helper.accAdd(negative_tp, price);
-                    // }
+                    if (price >= 0) {
+                        positive_tp = this.ctx.helper.accAdd(positive_tp, price);
+                    } else {
+                        negative_tp = this.ctx.helper.accAdd(negative_tp, price);
+                    }
                 } else {
                     const list = this._.filter(changeList, { gcl_id: g });
                     for (const cl of list) {