From 58eb34e93e4cbbe1dc27c6d0fb4454aa86d6a275 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期三, 05 一月 2022 16:46:58 +0800
Subject: [PATCH] 夏宝

---
 WebAPI/Controllers/POInStockController.cs |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/POInStockController.cs b/WebAPI/Controllers/POInStockController.cs
index 85a8bfd..ccb5618 100644
--- a/WebAPI/Controllers/POInStockController.cs
+++ b/WebAPI/Controllers/POInStockController.cs
@@ -612,7 +612,7 @@
                 SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
                 //閲囪喘璁㈠崟 鐢熸垚閫佽揣鍗曞垪琛�
                 if (!String.IsNullOrEmpty(HBillNo))
-                    HInterID = GetHinterIDByBillNo(HBillNo).ToString();
+                    HInterID = GetHinterIDByBillNo(HBillNo, "Aduit").ToString();
                 if (HInterID == "0")
                 {
                     objjson.code = "0";
@@ -790,12 +790,12 @@
         [HttpGet]
         public object GetHinterID(string HBillNo)
         {
-            int HinterID = GetHinterIDByBillNo(HBillNo);
+            int HinterID = GetHinterIDByBillNo(HBillNo, "Print");
             if (HinterID == 0)
             {
                 objjson.code = "0";
                 objjson.count = 0;
-                objjson.Message = "鎿嶄綔澶辫触,璇峰厛淇濆瓨璁㈠崟";
+                objjson.Message = "鎿嶄綔澶辫触,璇峰厛淇濆瓨骞跺鏍歌鍗�";
                 objjson.data = HinterID;
                 return objjson;
             }
@@ -806,11 +806,13 @@
             return objjson;
         }
 
-        public int GetHinterIDByBillNo(string HBillNo)
+        public int GetHinterIDByBillNo(string HBillNo, string type)
         {
             SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
             int HInterID = 0;
             string sql = "select HInterID from CG_POINSTOCKBILLMAIN where HBILLNO = '" + HBillNo + "'";
+            if (type == "Print")
+                sql += " and HBillStatus = '2' ";//鎵撳嵃鍒ゆ柇鏄惁瀹℃牳
             DataTable dt = oCn.RunProcReturn(sql, "HInterID").Tables[0];
             if (dt.Rows.Count > 0)
                 HInterID = Convert.ToInt32(dt.Rows[0]["HInterID"]);
@@ -832,7 +834,7 @@
                 if (objjson.code == "0")
                     return objjson;
 
-                WebAPIController.Add_Log("閫佽揣鍗曞垹闄わ紝鍗曞彿锛�" + HBillNo, HUserName, "閫佽揣鍗曞垹闄�");
+                WebAPIController.Add_Log("閫佽揣鍗曞垹闄�", HUserName, "閫佽揣鍗曞垹闄わ紝鍗曞彿锛�" + HBillNo);
                 oCN.BeginTran();
                 oBill.DeleteRelation(ref DBUtility.ClsPub.sExeReturnInfo, Convert.ToInt32(HInterID));
                 oCN.RunProc("Delete From Cg_POInStockBillMain where HInterID = " + HInterID);

--
Gitblit v1.9.1