|
@@ -289,7 +289,7 @@ module.exports = app => {
|
|
|
async getUsedData(tid, cid) {
|
|
|
if (this.ctx.stage.status === audit.stage.status.checked) {
|
|
|
const sql = 'SELECT scf.* ' +
|
|
|
- ' FROM ' + this.tableName + ' scf ' +
|
|
|
+ ' FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
|
|
|
' LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
|
|
|
' WHERE scf.tid = ? And scf.cid = ? And s.order = ?';
|
|
|
const result = await this.db.query(sql, [tid, cid, this.ctx.stage.order]);
|
|
@@ -457,7 +457,7 @@ module.exports = app => {
|
|
|
if (!c) continue;
|
|
|
|
|
|
for (const cb of changeBillsPart[cid]) {
|
|
|
- cb.tp = this.ctx.helper.mul(cb.spamount, cb.unit_price, c.tp_decimal);
|
|
|
+ cb.tp = this.ctx.helper.mul(cb.spamount, cb.unit_price, this.ctx.tender.info.decimal.tp);
|
|
|
cb.used_tp = this.ctx.helper.mul(cb.used_qty, cb.unit_price, this.ctx.tender.info.decimal.tp);
|
|
|
|
|
|
c.used_tp = this.ctx.helper.add(c.used_tp, cb.used_tp);
|