|
@@ -509,27 +509,27 @@ module.exports = app => {
|
|
|
let unitPrice = 0;
|
|
|
for (const cl of list) {
|
|
|
if (cl.spamount) {
|
|
|
- spamount = this.ctx.helper.accAdd(spamount, cl.spamount);
|
|
|
+ spamount = this.ctx.helper.add(spamount, cl.spamount);
|
|
|
unitPrice = cl.unit_price;
|
|
|
if (cl.is_valuation) {
|
|
|
- valuation_amount = this.ctx.helper.accAdd(valuation_amount, cl.spamount);
|
|
|
+ valuation_amount = this.ctx.helper.add(valuation_amount, cl.spamount);
|
|
|
} else {
|
|
|
- unvaluation_amount = this.ctx.helper.accAdd(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.accAdd(positive_tp, posOrNePrice);
|
|
|
+ positive_tp = this.ctx.helper.add(positive_tp, posOrNePrice);
|
|
|
} else {
|
|
|
- negative_tp = this.ctx.helper.accAdd(negative_tp, posOrNePrice);
|
|
|
+ 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 valuation_price = this.ctx.helper.mul(valuation_amount, this.ctx.helper.round(unitPrice, up_decimal), tp_decimal) || 0;
|
|
|
const unvaluation_price = this.ctx.helper.mul(unvaluation_amount, this.ctx.helper.round(unitPrice, up_decimal), tp_decimal) || 0;
|
|
|
- valuation_tp = this.ctx.helper.accAdd(valuation_tp, valuation_price);
|
|
|
- unvaluation_tp = this.ctx.helper.accAdd(unvaluation_tp, unvaluation_price);
|
|
|
- total_price = this.ctx.helper.accAdd(total_price, price);
|
|
|
+ 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 {
|
|
@@ -539,16 +539,16 @@ module.exports = app => {
|
|
|
const list = this._.filter(changeList, { gcl_id: g });
|
|
|
for (const cl of list) {
|
|
|
const price = this.ctx.helper.mul(this.ctx.helper.round(cl.unit_price, up_decimal), cl.spamount, tp_decimal);
|
|
|
- total_price = this.ctx.helper.accAdd(total_price, price);
|
|
|
+ total_price = this.ctx.helper.add(total_price, price);
|
|
|
if (price >= 0) {
|
|
|
- positive_tp = this.ctx.helper.accAdd(positive_tp, price);
|
|
|
+ positive_tp = this.ctx.helper.add(positive_tp, price);
|
|
|
} else {
|
|
|
- negative_tp = this.ctx.helper.accAdd(negative_tp, price);
|
|
|
+ negative_tp = this.ctx.helper.add(negative_tp, price);
|
|
|
}
|
|
|
if (cl.is_valuation) {
|
|
|
- valuation_tp = this.ctx.helper.accAdd(valuation_tp, price);
|
|
|
+ valuation_tp = this.ctx.helper.add(valuation_tp, price);
|
|
|
} else {
|
|
|
- unvaluation_tp = this.ctx.helper.accAdd(unvaluation_tp, price);
|
|
|
+ unvaluation_tp = this.ctx.helper.add(unvaluation_tp, price);
|
|
|
}
|
|
|
}
|
|
|
}
|