Bläddra i källkod

超计判断调整

MaiXinRong 1 år sedan
förälder
incheckning
3af0857e7d
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      app/lib/ledger.js

+ 3 - 1
app/lib/ledger.js

@@ -1115,7 +1115,9 @@ class checkData {
             if (!c.used) return;
             c.bills.forEach(b => {
                 if (!b.cur_used) return;
-                if (Math.abs(b.used_qty) > Math.abs(b.qty)) error.push({ b_code: b.code, name: b.name, errorType: 'change_over', memo: c.code, lid: b.lid });
+                const qtyDecimal = this.ctx.helper.findDecimal(changeBills.unit);
+                const limitQty = this.ctx.helper.mul(qty, this.ctx.helper.div(changeBills.delimit, 100, 2), qtyDecimal);
+                if (Math.abs(b.used_qty) > Math.abs(limitQty)) error.push({ b_code: b.code, name: b.name, errorType: 'change_over', memo: c.code, lid: b.lid });
 
             });
         });