|
@@ -190,7 +190,7 @@ module.exports = app => {
|
|
|
async getSubtotal(stage) {
|
|
|
const helper = this.ctx.helper;
|
|
|
const tender = await this._getTender(stage);
|
|
|
- const sql = 'SELECT sc.*, c.quality FROM ' + this.tableName + ' sc' +
|
|
|
+ const sql = 'SELECT sc.*, c.quality, c.name FROM ' + this.tableName + ' sc' +
|
|
|
' LEFT JOIN ' + this.ctx.service.change.tableName + ' c ON sc.rela_cid = c.cid' +
|
|
|
' WHERE sid = ?';
|
|
|
const data = await this.db.query(sql, [stage.id]);
|
|
@@ -201,7 +201,7 @@ module.exports = app => {
|
|
|
if (!bd) {
|
|
|
const bills = await this.db.get(this.ctx.service.ledger.departTableName(tender.id), { id: d.lid });
|
|
|
if (!bills) continue;
|
|
|
- bd = { lid: d.lid, quality: d.quality, unit_price: bills.unit_price };
|
|
|
+ bd = { lid: d.lid, quality: d.quality, unit_price: bills.unit_price, qty: d.rela_qty, cid: d.rela_cid, name: d.name };
|
|
|
bqData.push(bd);
|
|
|
}
|
|
|
const tp = this.ctx.helper.mul(d.rela_qty, bd.unit_price, tender.info.decimal.tp);
|