Browse Source

台账修订,删除计量单元问题

MaiXinRong 5 năm trước cách đây
mục cha
commit
c0b1a0f8a7
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 2 1
      app/service/stage_bills.js
  2. 1 1
      app/service/stage_pos.js

+ 2 - 1
app/service/stage_bills.js

@@ -115,7 +115,8 @@ module.exports = app => {
         }
 
         async getStageUsedBills(tid, sid) {
-            const sql = 'SELECT Bills.lid, (Bills.contract_qty <> 0 or Bills.qc_qty <> 0) As used FROM ' + this.tableName + ' As Bills ' +
+            const sql = 'SELECT Bills.lid, ((not IsNull(Bills.contract_qty) and Bills.contract_qty <> 0) or (not IsNull(Bills.qc_qty) and Bills.qc_qty <> 0)) As used' +
+                '  FROM ' + this.tableName + ' As Bills ' +
                 '  INNER JOIN ( ' +
                 '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `progress`, `lid`, `sid` From ' + this.tableName +
                 '      WHERE tid = ? And sid = ?' +

+ 1 - 1
app/service/stage_pos.js

@@ -128,7 +128,7 @@ module.exports = app => {
             const self = this;
             const stagePos = await this.getLastestStageData2(tid, sid, where);
             const pids = this._.map(stagePos, function (sp) {
-                if (self.ctx.helper.checkZero(sp.contract_qty) || self.ctx.helper.checkZero(sp.qc_qty)) {
+                if (!self.ctx.helper.checkZero(sp.contract_qty) || !self.ctx.helper.checkZero(sp.qc_qty)) {
                     return sp.pid;
                 } else {
                     return -1;