|
@@ -197,11 +197,11 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, ledgerData.unit);
|
|
|
- if (insertData.contract_qty) {
|
|
|
+ if (insertData.contract_qty !== undefined) {
|
|
|
d.contract_qty = this.round(insertData.contract_qty, precision.value);
|
|
|
d.contract_tp = this.ctx.helper.mul(d.contract_qty, ledgerData.unit_price, info.decimal.tp);
|
|
|
}
|
|
|
- if (insertData.qc_qty) {
|
|
|
+ if (insertData.qc_qty !== undefined) {
|
|
|
d.qc_qty = this.round(insertData.qc_qty, precision.value);
|
|
|
d.qc_tp = this.ctx.helper.mul(d.qc_qty, ledgerData.unit_price, info.decimal.tp);
|
|
|
}
|
|
@@ -235,12 +235,6 @@ module.exports = app => {
|
|
|
}
|
|
|
if (!stageBills || stageBills.times !== this.ctx.stage.curTimes || stageBills.order !== this.ctx.stage.curOrder) {
|
|
|
await this._insertStageBillsData(transaction, d, stageBills, ledgerBills);
|
|
|
- // d.tid = this.ctx.tender.id;
|
|
|
- // d.sid = this.ctx.stage.id;
|
|
|
- // d.said = this.ctx.session.sessionUser.accountId;
|
|
|
- // d.times = this.ctx.stage.curTimes;
|
|
|
- // d.order = this.ctx.stage.curOrder;
|
|
|
- // await transaction.insert(this.tableName, d);
|
|
|
} else {
|
|
|
d.id = stageBills.id;
|
|
|
await transaction.update(this.tableName, d);
|