|
@@ -6194,6 +6194,12 @@ function calcChangePrice() {
|
|
|
} else {
|
|
|
unvaluation_amount = ZhCalc.add(unvaluation_amount, ZhCalc.round(c.spamount, findDecimal(c.unit)));
|
|
|
}
|
|
|
+ const posOrNePrice = ZhCalc.round(ZhCalc.mul(ZhCalc.round(c.spamount, findDecimal(c.unit)), ZhCalc.round(c.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
|
|
|
+ if (posOrNePrice >= 0) {
|
|
|
+ positive_tp = this.ctx.helper.accAdd(positive_tp, posOrNePrice);
|
|
|
+ } else {
|
|
|
+ negative_tp = this.ctx.helper.accAdd(negative_tp, posOrNePrice);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
const price = ZhCalc.round(ZhCalc.mul(spamount, ZhCalc.round(unitPrice, unitPriceUnit)), totalPriceUnit);
|
|
@@ -6202,11 +6208,11 @@ function calcChangePrice() {
|
|
|
valuation_tp = ZhCalc.add(valuation_tp, valuation_price);
|
|
|
unvaluation_tp = ZhCalc.add(unvaluation_tp, unvaluation_price);
|
|
|
new_tp = ZhCalc.add(new_tp, price);
|
|
|
- if (price >= 0) {
|
|
|
- positive_tp = ZhCalc.add(positive_tp, price);
|
|
|
- } else {
|
|
|
- negative_tp = ZhCalc.add(negative_tp, price);
|
|
|
- }
|
|
|
+ // if (price >= 0) {
|
|
|
+ // positive_tp = ZhCalc.add(positive_tp, price);
|
|
|
+ // } else {
|
|
|
+ // negative_tp = ZhCalc.add(negative_tp, price);
|
|
|
+ // }
|
|
|
} else {
|
|
|
const list = _.filter(changeList, { gcl_id: g });
|
|
|
for (const c of list) {
|