|
@@ -516,12 +516,12 @@ module.exports = app => {
|
|
|
} else {
|
|
} else {
|
|
|
unvaluation_amount = this.ctx.helper.add(unvaluation_amount, cl.spamount);
|
|
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);
|
|
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);
|
|
valuation_tp = this.ctx.helper.add(valuation_tp, valuation_price);
|
|
|
unvaluation_tp = this.ctx.helper.add(unvaluation_tp, unvaluation_price);
|
|
unvaluation_tp = this.ctx.helper.add(unvaluation_tp, unvaluation_price);
|
|
|
total_price = this.ctx.helper.add(total_price, 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 {
|
|
} else {
|
|
|
const list = this._.filter(changeList, { gcl_id: g });
|
|
const list = this._.filter(changeList, { gcl_id: g });
|
|
|
for (const cl of list) {
|
|
for (const cl of list) {
|