|
@@ -971,30 +971,26 @@ class checkData {
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
if (isTz && posRange.length > 0) {
|
|
if (isTz && posRange.length > 0) {
|
|
- if (posRange.length > 0) {
|
|
|
|
- for (const p of posRange) {
|
|
|
|
- const end_contract_qty = this.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
|
|
|
|
- if (!p.quantity && !!end_contract_qty) return true;
|
|
|
|
- if (p.quantity > 0) {
|
|
|
|
- if (end_contract_qty > p.final_1_qty) return true;
|
|
|
|
- } else {
|
|
|
|
- if (end_contract_qty < p.final_1_qty || end_contract_qty > 0) return true;
|
|
|
|
- }
|
|
|
|
|
|
+ for (const p of posRange) {
|
|
|
|
+ const end_contract_qty = this.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
|
|
|
|
+ if (!p.quantity && !!end_contract_qty) return true;
|
|
|
|
+ if (p.quantity > 0) {
|
|
|
|
+ if (end_contract_qty > p.final_1_qty) return true;
|
|
|
|
+ } else {
|
|
|
|
+ if (end_contract_qty < p.final_1_qty || end_contract_qty > 0) return true;
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ const end_contract_qty = this.ctx.helper.add(bills.contract_qty, bills.pre_contract_qty);
|
|
|
|
+ const end_contract_tp = this.ctx.helper.add(bills.contract_tp, bills.pre_contract_tp);
|
|
|
|
+ if (bills.is_tp) {
|
|
|
|
+ const compare_tp = isTz ? bills.total_price : bills.deal_tp;
|
|
|
|
+ if (!compare_tp) return !!end_contract_tp;
|
|
|
|
+ return compare_tp >= 0 ? end_contract_tp > compare_tp : end_contract_tp < compare_tp || end_contract_tp > 0;
|
|
} else {
|
|
} else {
|
|
- const end_contract_qty = this.ctx.helper.add(bills.contract_qty, bills.pre_contract_qty);
|
|
|
|
- const end_contract_tp = this.ctx.helper.add(bills.contract_tp, bills.pre_contract_tp);
|
|
|
|
- if (bills.is_tp) {
|
|
|
|
- const compare_tp = isTz ? bills.total_price : bills.deal_tp;
|
|
|
|
- if (!compare_tp) return !!end_contract_tp;
|
|
|
|
- return compare_tp >= 0 ? end_contract_tp > compare_tp : end_contract_tp < compare_tp || end_contract_tp > 0;
|
|
|
|
- } else {
|
|
|
|
- const compare_qty = isTz ? bills.final_1_qty : bills.deal_final_1_qty;
|
|
|
|
- if (!compare_qty) return !!end_contract_qty;
|
|
|
|
- return compare_qty >= 0 ? end_contract_qty > compare_qty : end_contract_qty < compare_qty || end_contract_qty > 0;
|
|
|
|
- }
|
|
|
|
|
|
+ const compare_qty = isTz ? bills.final_1_qty : bills.deal_final_1_qty;
|
|
|
|
+ if (!compare_qty) return !!end_contract_qty;
|
|
|
|
+ return compare_qty >= 0 ? end_contract_qty > compare_qty : end_contract_qty < compare_qty || end_contract_qty > 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkOverRange() {
|
|
checkOverRange() {
|