Browse Source

Merge branch 'develop' into develop-green

hu 1 month ago
parent
commit
d40a3c6504
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

+ 8 - 0
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -518,6 +518,14 @@ public class dispatch extends Controller {
                 + sa_dispatchid + "' and  siteid='" + siteid + "'");
         Rows rowsdetail = dbConnect.runSqlQuery("select cast(sa_dispatch_itemsid AS CHAR) as sa_dispatch_itemsid from sa_dispatch_items where sa_dispatchid ='"
                 + sa_dispatchid + "' and  siteid='" + siteid + "'");
+        Rows rowsdetail_qty = dbConnect.runSqlQuery("select qty,ifnull(outwarehouseqty,0) outwarehouseqty,rowno from sa_dispatch_items where sa_dispatchid ='"
+                + sa_dispatchid + "' and  siteid='" + siteid + "'");
+        for(Row row :rowsdetail_qty){
+            if(row.getBigDecimal("outwarehouseqty").compareTo(row.getBigDecimal("qty"))>0){
+                return getErrReturnObject().setErrMsg("行号为:【" + row.getString("rowno") + "】的记录已出库数量大于发货数量,无法手工关闭")
+                        .toString();
+            }
+        }
         if (rows.isEmpty()) {
             return getErrReturnObject().setErrMsg("该发货单不存在")
                     .toString();