|
@@ -316,12 +316,14 @@ module.exports = app => {
|
|
|
updateBills.sjcl_qty = this.ctx.helper.add(updateBills.sjcl_qty, calcData.sjcl_qty);
|
|
|
updateBills.qtcl_qty = this.ctx.helper.add(updateBills.qtcl_qty, calcData.qtcl_qty);
|
|
|
updateBills.quantity = this.ctx.helper.add(updateBills.quantity, calcData.quantity);
|
|
|
+ updateBills.ex_qty1 = this.ctx.helper.add(updateBills.ex_qty1, calcData.ex_qty1);
|
|
|
}
|
|
|
const info = this.ctx.tender.info;
|
|
|
updateBills.sgfh_tp = this.ctx.helper.mul(updateBills.sgfh_qty, bills.unit_price, info.decimal.tp);
|
|
|
updateBills.sjcl_tp = this.ctx.helper.mul(updateBills.sjcl_qty, bills.unit_price, info.decimal.tp);
|
|
|
updateBills.qtcl_tp = this.ctx.helper.mul(updateBills.qtcl_qty, bills.unit_price, info.decimal.tp);
|
|
|
updateBills.total_price = this.ctx.helper.mul(updateBills.quantity, bills.unit_price, info.decimal.tp);
|
|
|
+ updateBills.ex_tp1 = this.ctx.helper.mul(updateBills.ex_qty1, bills.unit_price, info.decimal.tp);
|
|
|
}
|
|
|
|
|
|
const transaction = await this.db.beginTransaction();
|
|
@@ -579,8 +581,8 @@ module.exports = app => {
|
|
|
* @returns {Promise<*>}
|
|
|
*/
|
|
|
async getPosGather(tid, sid, lid, transaction) {
|
|
|
- const calcQtySql = 'SELECT SUM(`contract_qty`) As `contract_qty`, SUM(`qc_qty`) As `qc_qty`, SUM(`qc_minus_qty`) AS `qc_minus_qty`, SUM(`positive_qc_qty`) As `positive_qc_qty`, SUM(`negative_qc_qty`) As `negative_qc_qty` FROM (' +
|
|
|
- ' SELECT `contract_qty`, `qc_qty`, `qc_minus_qty`, `positive_qc_qty`, `negative_qc_qty` FROM ' + this.ctx.service.stagePos.tableName + ' As Pos ' +
|
|
|
+ const calcQtySql = 'SELECT SUM(`contract_qty`) As `contract_qty`, SUM(`qc_qty`) As `qc_qty`, SUM(`qc_minus_qty`) AS `qc_minus_qty`, SUM(`positive_qc_qty`) As `positive_qc_qty`, SUM(`negative_qc_qty`) As `negative_qc_qty`, SUM(`ex_stage_qty1`) As ex_stage_qty1 FROM (' +
|
|
|
+ ' SELECT `contract_qty`, `qc_qty`, `qc_minus_qty`, `positive_qc_qty`, `negative_qc_qty`, ex_stage_qty1 FROM ' + this.ctx.service.stagePos.tableName + ' As Pos ' +
|
|
|
' INNER JOIN (' +
|
|
|
' SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `pid` ' +
|
|
|
' FROM ' + this.ctx.service.stagePos.tableName +
|