Browse Source

上报自检,超计相关

MaiXinRong 3 years ago
parent
commit
f7ada8c5b7
1 changed files with 7 additions and 4 deletions
  1. 7 4
      app/lib/ledger.js

+ 7 - 4
app/lib/ledger.js

@@ -861,10 +861,12 @@ class checkData {
             if (posRange.length > 0) {
                 for (const p of posRange) {
                     const end_contract_qty = this.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
-                    if (!p.quantity) return !!end_contract_qty;
-                    return p.quantity > 0
-                        ? end_contract_qty > p.quantity
-                        : end_contract_qty < p.quantity || end_contract_qty > 0;
+                    if (!p.quantity && !!end_contract_qty) return true;
+                    if (p.quantity > 0) {
+                        if (end_contract_qty > p.quantity) return true;
+                    } else {
+                        if (end_contract_qty < p.quantity || end_contract_qty > 0) return true;
+                    }
                 }
                 return false;
             }
@@ -883,6 +885,7 @@ class checkData {
         }
     }
     checkOverRange() {
+        console.log('checkOverRange');
         const isTz = this.ctx.tender.data.measure_type === this.measureType.tz.value;
         for (const b of this.checkBills.nodes) {
             if (b.children && b.children.length > 0) continue;