From 14e1ec00865a829e9c6ed3df85a89858c55320a8 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期二, 16 十二月 2025 15:54:26 +0800
Subject: [PATCH] BindPalletNoPasteCode修改库存数量不正确

---
 Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 77dc4dd..791436c 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -2016,10 +2016,14 @@
                                 string stockDetailSql = $@"select LockQty-{lessQty} as morelockQty from DataStockDetail where IsDel='0' and SkuNo='{d.SkuNo}' and LotNo='{d.LotNo}' and PalletNo='{dr["PalletNo"] + ""}'";
                                 decimal morelockQty = Db.Ado.GetDecimal(stockDetailSql);
 
-                                if (morelockQty >= 0)
+                                if (morelockQty > 0)
                                 {
                                     sqlList.Add($@"update DataStockDetail set LockQty=LockQty-{lessQty} where IsDel='0' and SkuNo='{d.SkuNo}' and LotNo='{d.LotNo}' and PalletNo='{dr["PalletNo"] + ""}'");
                                 }
+                                else if (morelockQty == 0)
+                                {
+                                    sqlList.Add($@"update DataStockDetail set LockQty=0,Status='0' where IsDel='0' and SkuNo='{d.SkuNo}' and LotNo='{d.LotNo}' and PalletNo='{dr["PalletNo"] + ""}'");
+                                }
                             }
 
                         }

--
Gitblit v1.8.0