Parcourir la source

台账分解,修改部位明细,不报错

MaiXinRong il y a 6 ans
Parent
commit
69e47f6317
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      app/service/ledger.js

+ 2 - 4
app/service/ledger.js

@@ -1935,7 +1935,7 @@ module.exports = app => {
             const precision = this.ctx.helper.findPrecision(info.precision, node.unit);
 
             const calcQtySql = 'SELECT SUM(`quantity`) As quantity FROM ?? WHERE `lid` = ?';
-            const data = await transaction.queryOne(this.db.format(calcQtySql, [this.ctx.service.pos.tableName, node.id]));
+            const data = await transaction.queryOne(calcQtySql, [this.ctx.service.pos.tableName, node.id]);
             data.id = node.id;
             data.quantity = this.round(data.quantity, precision.value);
             data.total_price = this.round(this.ctx.helper.times(data.quantity, node.unit_price), info.decimal.tp);
@@ -1950,9 +1950,7 @@ module.exports = app => {
          * @return {Promise<void>}
          */
         async calc(tid, id, transaction) {
-            const node = await transaction.queryOne({
-                id: id
-            });
+            const node = await transaction.get(this.tableName, {id: id});
             if (!node) {
                 throw '数据错误';
             }