|
@@ -297,7 +297,7 @@ module.exports = app => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- async calcCamountSum(transaction) {
|
|
|
|
|
|
+ async calcCamountSum(transaction, updateTpDecimal = false) {
|
|
// const sql = 'SELECT SUM(ROUND(`camount`*`unit_price`, )) as total_price FROM ?? WHERE cid = ?';
|
|
// const sql = 'SELECT SUM(ROUND(`camount`*`unit_price`, )) as total_price FROM ?? WHERE cid = ?';
|
|
// const sqlParam = [this.tableName, this.change.cid];
|
|
// const sqlParam = [this.tableName, this.change.cid];
|
|
// const tp = await transaction.queryOne(sql, sqlParam);
|
|
// const tp = await transaction.queryOne(sql, sqlParam);
|
|
@@ -313,6 +313,9 @@ module.exports = app => {
|
|
const updateData = {
|
|
const updateData = {
|
|
total_price,
|
|
total_price,
|
|
};
|
|
};
|
|
|
|
+ if (updateTpDecimal) {
|
|
|
|
+ updateData.tp_decimal = tp_decimal;
|
|
|
|
+ }
|
|
const options = {
|
|
const options = {
|
|
where: {
|
|
where: {
|
|
cid: this.ctx.change.cid,
|
|
cid: this.ctx.change.cid,
|