From b63dd864e092dbeab2ffdd3c246a95112a18680e Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期四, 30 六月 2022 21:23:24 +0800
Subject: [PATCH] 森楷其他入库增加多源单扫码功能

---
 DLL/Pub_Class.dll            |    0 
 CLOUDWEB/WebService1.asmx.cs |  758 +++++++++++++++++++++++++++++++--------------------------
 2 files changed, 408 insertions(+), 350 deletions(-)

diff --git a/CLOUDWEB/WebService1.asmx.cs b/CLOUDWEB/WebService1.asmx.cs
index 7d8cdea..0af2b76 100644
--- a/CLOUDWEB/WebService1.asmx.cs
+++ b/CLOUDWEB/WebService1.asmx.cs
@@ -5906,10 +5906,9 @@
         [WebMethod]
         public bool set_SaveMoveBill_CLD(Model.ClsKf_MoveStockBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
         {
-            //棰嗘枡璋冩嫧(婧愬崟锛氱敓浜т换鍔″崟-鎶曟枡)
-            if (sHSourceType == "3720")
+            if (sHSourceType == "3720")//鐢熶骇鐢ㄦ枡娓呭崟
             {
-                if (SaveMoveMaterOut_CLD(oMain, oSystemParameterMain, ref sErrMsg))
+                if (SaveMoveStockBill_PPBom_CLD(oMain, sHSourceType, oSystemParameterMain, ref sErrMsg))
                 {
                     //"淇濆瓨鎴愬姛锛�";
                     sErrMsg = "淇濆瓨鎴愬姛锛�" + oMain.HBillNo;
@@ -5919,10 +5918,26 @@
                 {
                     //"淇濆瓨澶辫触锛�";
                     sErrMsg = "鍗曟嵁鍙凤細" + oMain.HBillNo + "锛屽崟鎹甀D锛�" + oMain.HInterID + "锛�" + sErrMsg;
-                    //sErrMsg = sErrMsg;
                     return false;
                 }
             }
+            ////棰嗘枡璋冩嫧(婧愬崟锛氱敓浜т换鍔″崟-鎶曟枡)
+            //if (sHSourceType == "3720")
+            //{
+            //    if (SaveMoveMaterOut_CLD(oMain, oSystemParameterMain, ref sErrMsg))
+            //    {
+            //        //"淇濆瓨鎴愬姛锛�";
+            //        sErrMsg = "淇濆瓨鎴愬姛锛�" + oMain.HBillNo;
+            //        return true;
+            //    }
+            //    else
+            //    {
+            //        //"淇濆瓨澶辫触锛�";
+            //        sErrMsg = "鍗曟嵁鍙凤細" + oMain.HBillNo + "锛屽崟鎹甀D锛�" + oMain.HInterID + "锛�" + sErrMsg;
+            //        //sErrMsg = sErrMsg;
+            //        return false;
+            //    }
+            //}
             //鍙戣揣璋冩嫧(婧愬崟锛氬彂璐ч�氱煡鍗�)
             else if (sHSourceType == "1402")
             {
@@ -7416,6 +7431,13 @@
                     //瀹℃牳鍗曟嵁
                     oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString());
                 }
+
+                if (oSystemParameterMain.WMS_MouldManagerCtl == "Y") //绯荤粺鍙傛暟  鍚敤鍣ㄥ叿绠$悊
+                {
+                    string HMouldBillType = "3814";
+                    oCn.RunProc("EXEC h_p_Sc_MouldStockBill_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillType + "','" + HMouldBillType + "'," + oMain.HSupID.ToString() + "," + oMain.HKeeperID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HDeptID.ToString() + ",3");
+                }
+
 
                 //鏍规嵁TMP琛� 杩斿洖 瀛愯〃淇℃伅
                 DataSet Ds;
@@ -33775,7 +33797,7 @@
             //钃濆瓧浜у搧鍏ュ簱銆佸璐叆搴撱�佸澶栧叆搴撱�佺敓浜ф眹鎶ワ紝鏍规嵁鐗╂枡鏉$爜寰楀埌瀵瑰簲婧愬崟淇℃伅锛岄潪澶氭簮鍗曟ā寮�
             //鏈壂鎻忔簮鍗曠殑鎯呭喌涓嬶紝绗竴娆℃壂鎻忕墿鏂欐潯鐮佽幏鍙栨簮鍗曚俊鎭苟瀛樺叆涓存椂琛�
             //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸叾浠栧叆搴擄紙1203锛夈�佸澶栧叆搴擄紙1210锛夈�佺敓浜ф眹鎶ワ紙3711锛�
-            if (SourceFlag == false && (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1210" || HBillType == "3711"))
+            if (SourceFlag == false && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711"))
             {
                 if (HSourceBillType != "-1")
                 {
@@ -34289,6 +34311,44 @@
                         }
                         else
                         {
+                            if (HBillType == "1203")
+                            {
+                                HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]);
+                                HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]);
+                                //oBar = get_SourceBarCode_OtherIn(HBillID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HOWNERID, ref sErrMsg);
+                                //if (oBar == null)
+                                //{
+                                //    return null;
+                                //}
+                                //SourceFlag = true;
+
+                                Int64 sMulSourceFlag = 0;   //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛�
+                                if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟  鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮�
+                                {
+                                    sMulSourceFlag = 1;
+                                }
+
+                                //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                                DataSet dsyd = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn");
+                                if (dsyd == null || dsyd.Tables[0].Rows.Count == 0)
+                                {
+                                    sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛涘皢鏉$爜瀵瑰簲婧愬崟淇℃伅瀛樺叆鏉$爜鍑哄叆搴撲复鏃惰〃澶辫触锛�";
+                                    return null;
+                                }
+                                else
+                                {
+                                    if (DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0][0]) == 0)
+                                    {
+                                        SourceFlag = true;
+                                    }
+                                    else
+                                    {
+                                        sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HBillID + "锛�" + DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HRemark"]);
+                                        return null;
+                                    }
+                                }
+                            }
+
                             for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                             {
                                 sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]);
@@ -34300,10 +34360,6 @@
                                     oBar.HSupName = sHSupName;
                                     oBar.HDeptID = sHDeptID;
                                     oBar.HDeptName = sHDeptName;
-                                    if (HBillType == "1203")
-                                    {
-                                        SourceFlag = true;
-                                    }
                                 }
                                 else
                                 {
@@ -35706,18 +35762,18 @@
             Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
             Int64 sMulSourceFlag = 0;   //澶氭簮鍗曟爣蹇楋紙0涓洪潪澶氭簮鍗曟ā寮忥紝1涓哄婧愬崟妯″紡锛�
 
-            ////鑾峰彇绯荤粺鍙傛暟
-            //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
-            //if (oSystemParameter.ShowBill(ref sErrMsg) == false)
-            //{
-            //    sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曟椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
-            //    return null;
-            //}
+            //鑾峰彇绯荤粺鍙傛暟
+            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
+            {
+                sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曟椂鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                return null;
+            }
 
-            //if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟  鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮�
-            //{
-            //    sMulSourceFlag = 1;
-            //}
+            if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //绯荤粺鍙傛暟  鍏朵粬鍏ュ簱鍗�-澶氭簮鍗曟ā寮�
+            {
+                sMulSourceFlag = 1;
+            }
 
             //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
             DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn");
@@ -37384,367 +37440,369 @@
 
         #endregion
 
-        #endregion
 
 
-        //        #region 鎵弿鐗╂枡鏉$爜璋冪敤鏂规硶
+            #endregion
 
-        //        #region 鎵弿鐗╂枡鏉$爜
 
-        //        [WebMethod]
-        //        public Model.ClsKf_ICStockBill_WMS get_MaterBarCode_New(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWhID, Int64 HSCSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockOrgID, Int64 HStockOutOrgID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg)
-        //        {
-        //            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
-        //            Model.ClsKf_ICStockBill_WMS model = new Model.ClsKf_ICStockBill_WMS();
-        //            //鑾峰彇绯荤粺鍙傛暟
-        //            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
-        //            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
-        //            {
-        //                sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
-        //                return null;
-        //            }
-        //            //鍒ゆ柇鏉$爜鏄惁涓虹┖
-        //            if (HBarCode.Trim() == "")
-        //            {
-        //                sErrMsg = "鏉$爜涓嶈兘涓虹┖锛岃閲嶆柊鎵弿鐗╂枡鏉$爜锛�";
-        //                return null;
-        //            }
-        //            //鍒ゆ柇鏉$爜鏄惁鍚壒娈婄鍙� # 锛屽鏋滃惈鏈夊垯鎷嗗垎锛屾埅鍙� # 鍓嶅瓧绗︿覆
-        //            string[] NewBarCode;
-        //            if (HBarCode.CompareTo("#") > 0)
-        //            {
-        //                NewBarCode = HBarCode.Split(Convert.ToChar("#"));
-        //                HBarCode = NewBarCode[0];
-        //            }
-        //            //鑾峰彇鏉$爜妗f淇℃伅
-        //            Model.ClsGy_BarCodeBill_WMS_Model_View oBar = new Model.ClsGy_BarCodeBill_WMS_Model_View();
-        //            DataSet ds1 = oCn.RunProcReturn("Select * from h_v_Gy_BarCodeBill_New Where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill_New");
-        //            if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
-        //            {
-        //                sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 鏃犳晥锛屼笉瀛樺湪鏉$爜妗f涓紒";
-        //                return null;
-        //            }
-        //            else
-        //            {
-        //                oBar.HItemID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HItemID"]);
-        //                oBar.HBarCode = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCode"]);
-        //                oBar.HBarCodeType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCodeType"]);
-        //                oBar.HStopflag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HStopflag"]);
-        //                oBar.HRemark = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]);
-        //                oBar.HMaterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HMaterID"]);
-        //                oBar.HUnitID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HUnitID"]);
-        //                oBar.HAuxPropID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HAuxPropID"]);
-        //                oBar.HBatchNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBatchNo"]);
-        //                oBar.HQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[0]["HQty"]);
-        //                oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceInterID"]);
-        //                oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceEntryID"]);
-        //                oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]);
-        //                oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]);
-        //                oBar.HMTONo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HMTONo"]);
-        //                oBar.HSTOCKORGID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSTOCKORGID"]);
-        //                oBar.HOWNERID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HOWNERID"]);
-        //            }
-        //            //鍒ゆ柇鏉$爜鏄惁鍙敤
-        //            if (oBar.HStopflag)
-        //            {
-        //                sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 宸蹭綔搴燂紝涓嶅厑璁歌繘琛屾壂鐮佹搷浣滐紒";
-        //                return null;
-        //            }
-        //            //鍏ュ簱銆佹眹鎶ユā鍧楋紝鏈夋簮鍗曟潯鐮� 涓� 鏉$爜绫诲瀷涓哄敮涓�鏉$爜锛屾壂鎻忕墿鏂欐潯鐮佹椂鑷姩甯﹀嚭婧愬崟淇℃伅
-        //            //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸澶栧叆搴擄紙1210锛夈�佺敓浜ф眹鎶ワ紙3711锛�
-        //            if (oBar.HBarCodeType == "鍞竴鏉$爜" && oBar.HSourceBillNo == "" && HSourceBillType != "-1"
-        //                && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711"))
-        //            {
-        //                Int64 HAccessFlag = 1;   //鏄惁鐗╂枡鏉$爜甯﹀嚭婧愬崟淇℃伅鏍囧織锛�0涓虹洿鎺ユ壂婧愬崟鏉$爜锛�1涓虹墿鏂欐潯鐮佸甫鍑烘簮鍗曚俊鎭級
-        //                model = getSourceBill_New(HInterID, HBillNo, HBillType, oBar.HSourceBillNo, oBar.HSourceBillType, HRedBlueFlag, HMaker, 0, 0, 0, HStockOrgID, HAccessFlag, SourceFlag, oSystemParameter.omodel, ref sErrMsg);
-        //                if (model == null)
-        //                {
-        //                    sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曞け璐ワ紒" + sErrMsg;
-        //                    return null;
-        //                }
-        //                else
-        //                {
-        //                    HSourceBillType = model.HSourceBillType;
-        //                    SourceFlag = true;
-        //                    return model;
-        //                }
-        //            }
+            //        #region 鎵弿鐗╂枡鏉$爜璋冪敤鏂规硶
 
-        //            //1銆侀娆℃壂鐮侀槻涓插崟鍒ゆ柇锛� 2銆佹簮鍗曠被鍨嬫槸鍚﹀湪婧愬崟鍒楄〃閲屽垽鏂紱3銆佸敮涓�鏉$爜鏄惁瀛樺湪鐩稿悓鏉$爜鍒ゆ柇锛� 4銆佹湁婧愬崟锛岀墿鏂欐槸鍚﹀湪婧愬崟涓垽鏂�
-        //            DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetSourceInterID_AddBarCode " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HSourceBillType + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + oSystemParameter.omodel.WMS_BarCodeMustSameSourceBill + "'," + HStockOrgID.ToString(), "h_p_WMS_GetSourceInterID_AddBarCode");
-        //            if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
-        //            {
-        //                sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂潯鐮佹槸鍚﹀湪婧愬崟涓椂鍙戠敓閿欒锛�";
-        //                return null;
-        //            }
-        //            else
-        //            {
-        //                if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 1)
-        //                {
-        //                    sErrMsg = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
-        //                    return null;
-        //                }
-        //                else
-        //                {
-        //                    oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]);
-        //                    oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]);
-        //                    oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]);
-        //                    oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillType"]);
-        //                    oBar.HMaterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HMaterID"]);
-        //                    oBar.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]);    //鍓╀綑鏈壂鐮佹暟閲忥紙搴旀敹鏁伴噺-鎵爜鎬绘暟閲� 鎴�0锛夛紝闈炲敮涓�鏉$爜鐢ㄥ埌
-        //                }
-        //            }
+            //        #region 鎵弿鐗╂枡鏉$爜
 
-        //            //鑾峰彇銆佸垽鏂粨搴撱�佷粨浣�
-        //            DataSet ds3 = oCn.RunProcReturn("exec h_p_WMS_GetWHIDandSPID_AddBarCode " + HInterID.ToString() + ",'" + HBillType + "'," + HWhID + "," + HSPID + "," + HSCWhID + "," + HSCSPID + "," + oBar.HSourceInterID + "," + oBar.HSourceEntryID + "," + oBar.HMaterID + "," + HStockOrgID + "," + HStockOutOrgID + ",'" + oBar.HBarCodeType + "','" + oSystemParameter.omodel.WMS_WMSStockCtl + "'", "h_p_WMS_GetWHIDandSPID_AddBarCode");
-        //            if (ds3 == null || ds3.Tables[0].Rows.Count == 0)
-        //            {
-        //                sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂粨搴撱�佷粨浣嶅�兼椂鍙戠敓閿欒锛�";
-        //                return null;
-        //            }
-        //            else
-        //            {
-        //                if (DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0][0]) == 1)
-        //                {
-        //                    sErrMsg = DBUtility.ClsPub.isStrNull(ds3.Tables[0].Rows[0]["HRemark"]);
-        //                    return null;
-        //                }
-        //                else
-        //                {
-        //                    model.HWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HWHID"]);
-        //                    model.HSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSPID"]);
-        //                    model.HSCWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCWHID"]);
-        //                    model.HSCSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCSPID"]);
-        //                }
-        //            }
+            //        [WebMethod]
+            //        public Model.ClsKf_ICStockBill_WMS get_MaterBarCode_New(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWhID, Int64 HSCSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockOrgID, Int64 HStockOutOrgID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg)
+            //        {
+            //            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            //            Model.ClsKf_ICStockBill_WMS model = new Model.ClsKf_ICStockBill_WMS();
+            //            //鑾峰彇绯荤粺鍙傛暟
+            //            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+            //            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
+            //            {
+            //                sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+            //                return null;
+            //            }
+            //            //鍒ゆ柇鏉$爜鏄惁涓虹┖
+            //            if (HBarCode.Trim() == "")
+            //            {
+            //                sErrMsg = "鏉$爜涓嶈兘涓虹┖锛岃閲嶆柊鎵弿鐗╂枡鏉$爜锛�";
+            //                return null;
+            //            }
+            //            //鍒ゆ柇鏉$爜鏄惁鍚壒娈婄鍙� # 锛屽鏋滃惈鏈夊垯鎷嗗垎锛屾埅鍙� # 鍓嶅瓧绗︿覆
+            //            string[] NewBarCode;
+            //            if (HBarCode.CompareTo("#") > 0)
+            //            {
+            //                NewBarCode = HBarCode.Split(Convert.ToChar("#"));
+            //                HBarCode = NewBarCode[0];
+            //            }
+            //            //鑾峰彇鏉$爜妗f淇℃伅
+            //            Model.ClsGy_BarCodeBill_WMS_Model_View oBar = new Model.ClsGy_BarCodeBill_WMS_Model_View();
+            //            DataSet ds1 = oCn.RunProcReturn("Select * from h_v_Gy_BarCodeBill_New Where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill_New");
+            //            if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
+            //            {
+            //                sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 鏃犳晥锛屼笉瀛樺湪鏉$爜妗f涓紒";
+            //                return null;
+            //            }
+            //            else
+            //            {
+            //                oBar.HItemID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HItemID"]);
+            //                oBar.HBarCode = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCode"]);
+            //                oBar.HBarCodeType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBarCodeType"]);
+            //                oBar.HStopflag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HStopflag"]);
+            //                oBar.HRemark = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]);
+            //                oBar.HMaterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HMaterID"]);
+            //                oBar.HUnitID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HUnitID"]);
+            //                oBar.HAuxPropID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HAuxPropID"]);
+            //                oBar.HBatchNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBatchNo"]);
+            //                oBar.HQty = DBUtility.ClsPub.isDoule(ds1.Tables[0].Rows[0]["HQty"]);
+            //                oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceInterID"]);
+            //                oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSourceEntryID"]);
+            //                oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillNo"]);
+            //                oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSourceBillType"]);
+            //                oBar.HMTONo = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HMTONo"]);
+            //                oBar.HSTOCKORGID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HSTOCKORGID"]);
+            //                oBar.HOWNERID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HOWNERID"]);
+            //            }
+            //            //鍒ゆ柇鏉$爜鏄惁鍙敤
+            //            if (oBar.HStopflag)
+            //            {
+            //                sErrMsg = "鎵�鎵弿鐗╂枡鏉$爜锛�" + HBarCode + " 宸蹭綔搴燂紝涓嶅厑璁歌繘琛屾壂鐮佹搷浣滐紒";
+            //                return null;
+            //            }
+            //            //鍏ュ簱銆佹眹鎶ユā鍧楋紝鏈夋簮鍗曟潯鐮� 涓� 鏉$爜绫诲瀷涓哄敮涓�鏉$爜锛屾壂鎻忕墿鏂欐潯鐮佹椂鑷姩甯﹀嚭婧愬崟淇℃伅
+            //            //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸澶栧叆搴擄紙1210锛夈�佺敓浜ф眹鎶ワ紙3711锛�
+            //            if (oBar.HBarCodeType == "鍞竴鏉$爜" && oBar.HSourceBillNo == "" && HSourceBillType != "-1"
+            //                && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711"))
+            //            {
+            //                Int64 HAccessFlag = 1;   //鏄惁鐗╂枡鏉$爜甯﹀嚭婧愬崟淇℃伅鏍囧織锛�0涓虹洿鎺ユ壂婧愬崟鏉$爜锛�1涓虹墿鏂欐潯鐮佸甫鍑烘簮鍗曚俊鎭級
+            //                model = getSourceBill_New(HInterID, HBillNo, HBillType, oBar.HSourceBillNo, oBar.HSourceBillType, HRedBlueFlag, HMaker, 0, 0, 0, HStockOrgID, HAccessFlag, SourceFlag, oSystemParameter.omodel, ref sErrMsg);
+            //                if (model == null)
+            //                {
+            //                    sErrMsg = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涙壂鎻忔簮鍗曞け璐ワ紒" + sErrMsg;
+            //                    return null;
+            //                }
+            //                else
+            //                {
+            //                    HSourceBillType = model.HSourceBillType;
+            //                    SourceFlag = true;
+            //                    return model;
+            //                }
+            //            }
 
-        //            //鍒濇鑾峰彇鏉$爜鏁伴噺
-        //            if (oBar.HBarCodeType == "鍞竴鏉$爜")
-        //            {
-        //                if (HQty > 0 && oBar.HQty > HQty)   //0<鐣岄潰閫掑叆鏁伴噺<鏉$爜妗f鏁伴噺锛屽彇閫掑叆鏁伴噺
-        //                {
-        //                    oBar.HQty = HQty;
-        //                }
-        //            }
-        //            else
-        //            {
-        //                if (HQty > 0)               //鐣岄潰閫掑叆鏁伴噺>0锛屽彇閫掑叆鏁伴噺
-        //                {
-        //                    oBar.HQty = HQty;
-        //                }
-        //                else if (oBar.HinitQty > 0) //鐣岄潰閫掑叆鏁伴噺<0锛屾簮鍗曞墿浣欐湭鎵爜鏁伴噺>0锛屽彇婧愬崟鍓╀綑鏈壂鐮佹暟閲�
-        //                {
-        //                    oBar.HQty = oBar.HinitQty;
-        //                }
-        //            }
+            //            //1銆侀娆℃壂鐮侀槻涓插崟鍒ゆ柇锛� 2銆佹簮鍗曠被鍨嬫槸鍚﹀湪婧愬崟鍒楄〃閲屽垽鏂紱3銆佸敮涓�鏉$爜鏄惁瀛樺湪鐩稿悓鏉$爜鍒ゆ柇锛� 4銆佹湁婧愬崟锛岀墿鏂欐槸鍚﹀湪婧愬崟涓垽鏂�
+            //            DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetSourceInterID_AddBarCode " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HSourceBillType + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + oSystemParameter.omodel.WMS_BarCodeMustSameSourceBill + "'," + HStockOrgID.ToString(), "h_p_WMS_GetSourceInterID_AddBarCode");
+            //            if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
+            //            {
+            //                sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂潯鐮佹槸鍚﹀湪婧愬崟涓椂鍙戠敓閿欒锛�";
+            //                return null;
+            //            }
+            //            else
+            //            {
+            //                if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 1)
+            //                {
+            //                    sErrMsg = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
+            //                    return null;
+            //                }
+            //                else
+            //                {
+            //                    oBar.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]);
+            //                    oBar.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]);
+            //                    oBar.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]);
+            //                    oBar.HSourceBillType = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillType"]);
+            //                    oBar.HMaterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HMaterID"]);
+            //                    oBar.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]);    //鍓╀綑鏈壂鐮佹暟閲忥紙搴旀敹鏁伴噺-鎵爜鎬绘暟閲� 鎴�0锛夛紝闈炲敮涓�鏉$爜鐢ㄥ埌
+            //                }
+            //            }
 
-        //            //鐢熶骇棰嗘枡锛�1204锛夈�侀攢鍞嚭搴擄紙1205锛夈�佸叾浠栧嚭搴撹摑瀛楋紙1206锛夈�佸澶栧嚭搴擄紙1211锛�
-        //            //澶栬喘閫�鏂欙紙1239锛夈�佷骇鍝侀��搴擄紙1245锛夈�佸叾浠栧叆搴撶孩瀛楋紙1248锛夈�佸澶栭��搴擄紙1246锛�
-        //            //鐢熶骇琛ユ枡锛�1254锛�
-        //            if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211"
-        //                || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246"
-        //                || HBillType == "1254")
-        //            {
-        //                if (oSystemParameter.omodel.WMS_ERPStockCtl == "Y")
-        //                {
+            //            //鑾峰彇銆佸垽鏂粨搴撱�佷粨浣�
+            //            DataSet ds3 = oCn.RunProcReturn("exec h_p_WMS_GetWHIDandSPID_AddBarCode " + HInterID.ToString() + ",'" + HBillType + "'," + HWhID + "," + HSPID + "," + HSCWhID + "," + HSCSPID + "," + oBar.HSourceInterID + "," + oBar.HSourceEntryID + "," + oBar.HMaterID + "," + HStockOrgID + "," + HStockOutOrgID + ",'" + oBar.HBarCodeType + "','" + oSystemParameter.omodel.WMS_WMSStockCtl + "'", "h_p_WMS_GetWHIDandSPID_AddBarCode");
+            //            if (ds3 == null || ds3.Tables[0].Rows.Count == 0)
+            //            {
+            //                sErrMsg = "鎵弿鐗╂枡鏉$爜锛屽垽鏂粨搴撱�佷粨浣嶅�兼椂鍙戠敓閿欒锛�";
+            //                return null;
+            //            }
+            //            else
+            //            {
+            //                if (DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0][0]) == 1)
+            //                {
+            //                    sErrMsg = DBUtility.ClsPub.isStrNull(ds3.Tables[0].Rows[0]["HRemark"]);
+            //                    return null;
+            //                }
+            //                else
+            //                {
+            //                    model.HWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HWHID"]);
+            //                    model.HSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSPID"]);
+            //                    model.HSCWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCWHID"]);
+            //                    model.HSCSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSCSPID"]);
+            //                }
+            //            }
 
-        //                }
+            //            //鍒濇鑾峰彇鏉$爜鏁伴噺
+            //            if (oBar.HBarCodeType == "鍞竴鏉$爜")
+            //            {
+            //                if (HQty > 0 && oBar.HQty > HQty)   //0<鐣岄潰閫掑叆鏁伴噺<鏉$爜妗f鏁伴噺锛屽彇閫掑叆鏁伴噺
+            //                {
+            //                    oBar.HQty = HQty;
+            //                }
+            //            }
+            //            else
+            //            {
+            //                if (HQty > 0)               //鐣岄潰閫掑叆鏁伴噺>0锛屽彇閫掑叆鏁伴噺
+            //                {
+            //                    oBar.HQty = HQty;
+            //                }
+            //                else if (oBar.HinitQty > 0) //鐣岄潰閫掑叆鏁伴噺<0锛屾簮鍗曞墿浣欐湭鎵爜鏁伴噺>0锛屽彇婧愬崟鍓╀綑鏈壂鐮佹暟閲�
+            //                {
+            //                    oBar.HQty = oBar.HinitQty;
+            //                }
+            //            }
+
+            //            //鐢熶骇棰嗘枡锛�1204锛夈�侀攢鍞嚭搴擄紙1205锛夈�佸叾浠栧嚭搴撹摑瀛楋紙1206锛夈�佸澶栧嚭搴擄紙1211锛�
+            //            //澶栬喘閫�鏂欙紙1239锛夈�佷骇鍝侀��搴擄紙1245锛夈�佸叾浠栧叆搴撶孩瀛楋紙1248锛夈�佸澶栭��搴擄紙1246锛�
+            //            //鐢熶骇琛ユ枡锛�1254锛�
+            //            if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211"
+            //                || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246"
+            //                || HBillType == "1254")
+            //            {
+            //                if (oSystemParameter.omodel.WMS_ERPStockCtl == "Y")
+            //                {
+
+            //                }
 
 
 
 
 
 
-        //                //闈炲敮涓�鏉$爜鎵弿鏃跺垽鏂粨搴撲粨浣嶆槸鍚﹀凡閫夋嫨
-        //                if (dal.omodel_View.HBarCodeType != "鍞竴鏉$爜")
-        //                {
-        //                    if (oSystemParameter.omodel.WMS_ERPStockCtl == "N")
-        //                    {
+            //                //闈炲敮涓�鏉$爜鎵弿鏃跺垽鏂粨搴撲粨浣嶆槸鍚﹀凡閫夋嫨
+            //                if (dal.omodel_View.HBarCodeType != "鍞竴鏉$爜")
+            //                {
+            //                    if (oSystemParameter.omodel.WMS_ERPStockCtl == "N")
+            //                    {
 
-        //                    }
-        //                    else
-        //                    {
-        //                        //鍒ゆ柇ERP搴撳瓨   杩斿洖ERP搴撳瓨鏁伴噺
-        //                        DataSet ds6 = oCn.RunProcReturn("exec h_p_IF_CheckQtyByERPICInventory " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + dal.omodel_View.HMaterID.ToString() + "," + dal.omodel_View.HAuxPropID.ToString() + ",'" + dal.omodel_View.HBatchNo + "'," + sRelQty.ToString() + "," + HOWNERID.ToString(), "h_p_IF_CheckQtyByERPICInventory");
-        //                        if (ds6 == null || ds6.Tables[0].Rows.Count == 0)
-        //                        {
-        //                            sErrMsg = "鍒ゆ柇ERP搴撳瓨锛屾湭鐭ラ敊璇紒";
-        //                            return false;
-        //                        }
-        //                        else
-        //                        {
-        //                            if (DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0][0]) == 0)
-        //                            {
-        //                                dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0]["HMaterID"]);
-        //                                HQty = DBUtility.ClsPub.isDoule(ds6.Tables[0].Rows[0]["HQty"]);
-        //                            }
-        //                            else
-        //                            {
-        //                                sErrMsg = DBUtility.ClsPub.isStrNull(ds6.Tables[0].Rows[0]["HRemark"]);
-        //                                return false;
-        //                            }
-        //                        }
-        //                    }
-        //                }
-        //                else
-        //                {
-        //                    //鍒ゆ柇鏉$爜搴撳瓨   杩斿洖搴撳瓨鏁伴噺 浠撳簱 浠撲綅
-        //                    DAL.ClsKF_PonderationBillMain_Temp_View Tempdal = new DAL.ClsKF_PonderationBillMain_Temp_View();
-        //                    if (Tempdal.CheckQtyByBarCode(HBillID, HBillType, sBarCode, ref HWhID, ref HSPID, sRelQty, ref sRelQty))
-        //                    {
+            //                    }
+            //                    else
+            //                    {
+            //                        //鍒ゆ柇ERP搴撳瓨   杩斿洖ERP搴撳瓨鏁伴噺
+            //                        DataSet ds6 = oCn.RunProcReturn("exec h_p_IF_CheckQtyByERPICInventory " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + dal.omodel_View.HMaterID.ToString() + "," + dal.omodel_View.HAuxPropID.ToString() + ",'" + dal.omodel_View.HBatchNo + "'," + sRelQty.ToString() + "," + HOWNERID.ToString(), "h_p_IF_CheckQtyByERPICInventory");
+            //                        if (ds6 == null || ds6.Tables[0].Rows.Count == 0)
+            //                        {
+            //                            sErrMsg = "鍒ゆ柇ERP搴撳瓨锛屾湭鐭ラ敊璇紒";
+            //                            return false;
+            //                        }
+            //                        else
+            //                        {
+            //                            if (DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0][0]) == 0)
+            //                            {
+            //                                dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0]["HMaterID"]);
+            //                                HQty = DBUtility.ClsPub.isDoule(ds6.Tables[0].Rows[0]["HQty"]);
+            //                            }
+            //                            else
+            //                            {
+            //                                sErrMsg = DBUtility.ClsPub.isStrNull(ds6.Tables[0].Rows[0]["HRemark"]);
+            //                                return false;
+            //                            }
+            //                        }
+            //                    }
+            //                }
+            //                else
+            //                {
+            //                    //鍒ゆ柇鏉$爜搴撳瓨   杩斿洖搴撳瓨鏁伴噺 浠撳簱 浠撲綅
+            //                    DAL.ClsKF_PonderationBillMain_Temp_View Tempdal = new DAL.ClsKF_PonderationBillMain_Temp_View();
+            //                    if (Tempdal.CheckQtyByBarCode(HBillID, HBillType, sBarCode, ref HWhID, ref HSPID, sRelQty, ref sRelQty))
+            //                    {
 
-        //                    }
-        //                    else
-        //                    {
-        //                        if (sRelQty == 0)
-        //                        {
-        //                            sErrMsg = "鏃犲簱瀛橈紒";
-        //                            return false;
-        //                        }
-        //                        else
-        //                        {
-        //                            sErrMsg = "搴撳瓨涓嶈冻锛屽凡鑾峰彇瀹為檯搴撳瓨鏁伴噺锛�";
-        //                        }
-        //                    }
-        //                }
-        //            }
-        //            //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸叾浠栧叆搴撹摑瀛楋紙1203锛夈�佸澶栧叆搴擄紙1210锛�
-        //            //鐢熶骇閫�鏂欙紙1244锛夈�侀攢鍞��搴擄紙1247锛夈�佸叾浠栧嚭搴撶孩瀛楋紙1249锛夈�佸澶栭��鏂欙紙1238锛�
-        //            else
-        //            {
-        //                //鍒ゆ柇骞惰幏鍙� 浠撳簱 浠撲綅淇℃伅
-        //                DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID");
-        //                if (ds4 == null || ds4.Tables[0].Rows.Count == 0)
-        //                {
-        //                    sErrMsg = "鍒ゆ柇骞惰幏鍙栦粨搴撲粨浣嶄俊鎭紝鏈煡閿欒锛�";
-        //                    return false;
-        //                }
-        //                else
-        //                {
-        //                    if (DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0][0]) == 0)
-        //                    {
-        //                        HWhID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HWHID"]);
-        //                        HSPID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HSPID"]);
-        //                    }
-        //                    else
-        //                    {
-        //                        sErrMsg = DBUtility.ClsPub.isStrNull(ds4.Tables[0].Rows[0]["HRemark"]);
-        //                        return false;
-        //                    }
-        //                }
-        //                //鍒ゆ柇鏉$爜鎵弿鏁伴噺   杩斿洖鍓╀綑鏈壂鎻忔暟閲�
-        //                if (tem.IsBarCode_New(sBarCode, HBillType, HRedBlueFlag, ref sRelQty, ref sErrMsg))
-        //                {
+            //                    }
+            //                    else
+            //                    {
+            //                        if (sRelQty == 0)
+            //                        {
+            //                            sErrMsg = "鏃犲簱瀛橈紒";
+            //                            return false;
+            //                        }
+            //                        else
+            //                        {
+            //                            sErrMsg = "搴撳瓨涓嶈冻锛屽凡鑾峰彇瀹為檯搴撳瓨鏁伴噺锛�";
+            //                        }
+            //                    }
+            //                }
+            //            }
+            //            //閲囪喘鍏ュ簱锛�1201锛夈�佷骇鍝佸叆搴擄紙1202锛夈�佸叾浠栧叆搴撹摑瀛楋紙1203锛夈�佸澶栧叆搴擄紙1210锛�
+            //            //鐢熶骇閫�鏂欙紙1244锛夈�侀攢鍞��搴擄紙1247锛夈�佸叾浠栧嚭搴撶孩瀛楋紙1249锛夈�佸澶栭��鏂欙紙1238锛�
+            //            else
+            //            {
+            //                //鍒ゆ柇骞惰幏鍙� 浠撳簱 浠撲綅淇℃伅
+            //                DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID");
+            //                if (ds4 == null || ds4.Tables[0].Rows.Count == 0)
+            //                {
+            //                    sErrMsg = "鍒ゆ柇骞惰幏鍙栦粨搴撲粨浣嶄俊鎭紝鏈煡閿欒锛�";
+            //                    return false;
+            //                }
+            //                else
+            //                {
+            //                    if (DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0][0]) == 0)
+            //                    {
+            //                        HWhID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HWHID"]);
+            //                        HSPID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HSPID"]);
+            //                    }
+            //                    else
+            //                    {
+            //                        sErrMsg = DBUtility.ClsPub.isStrNull(ds4.Tables[0].Rows[0]["HRemark"]);
+            //                        return false;
+            //                    }
+            //                }
+            //                //鍒ゆ柇鏉$爜鎵弿鏁伴噺   杩斿洖鍓╀綑鏈壂鎻忔暟閲�
+            //                if (tem.IsBarCode_New(sBarCode, HBillType, HRedBlueFlag, ref sRelQty, ref sErrMsg))
+            //                {
 
-        //                }
-        //                else
-        //                {
-        //                    sErrMsg = sErrMsg;
-        //                    return false;
-        //                }
-        //            }
-        //        }
+            //                }
+            //                else
+            //                {
+            //                    sErrMsg = sErrMsg;
+            //                    return false;
+            //                }
+            //            }
+            //        }
 
-        //            if (HExpressNumber == "宸ュ簭姹囨姤杞Щ鍗�")
-        //            {
-        //                model.HSubBillType = "1270";
-        //                HExpressNumber = "";
-        //            }
-        //    model.HInterID = HBillID;
-        //            model.HBillNo = HBillNo;
-        //            model.HBillType = HBillType;
-        //            model.HMaker = HMaker;
-        //            //
-        //            model.HMaterID = dal.omodel_View.HMaterID;
-        //            model.HAuxPropID = dal.omodel_View.HAuxPropID;
-        //            model.HErpClsID = dal.omodel_View.HErpClsID;
-        //            model.HQty = sRelQty;
-        //            model.HQtyMust = dal.omodel_View.HinitQty;
-        //            model.HBarCode = dal.omodel_View.HBarCode;
-        //            model.HBatchNo = dal.omodel_View.HBatchNo;
-        //            model.HMTONo = dal.omodel_View.HMTONo;
+            //            if (HExpressNumber == "宸ュ簭姹囨姤杞Щ鍗�")
+            //            {
+            //                model.HSubBillType = "1270";
+            //                HExpressNumber = "";
+            //            }
+            //    model.HInterID = HBillID;
+            //            model.HBillNo = HBillNo;
+            //            model.HBillType = HBillType;
+            //            model.HMaker = HMaker;
+            //            //
+            //            model.HMaterID = dal.omodel_View.HMaterID;
+            //            model.HAuxPropID = dal.omodel_View.HAuxPropID;
+            //            model.HErpClsID = dal.omodel_View.HErpClsID;
+            //            model.HQty = sRelQty;
+            //            model.HQtyMust = dal.omodel_View.HinitQty;
+            //            model.HBarCode = dal.omodel_View.HBarCode;
+            //            model.HBatchNo = dal.omodel_View.HBatchNo;
+            //            model.HMTONo = dal.omodel_View.HMTONo;
 
-        //            model.HWhID = HWhID;
-        //            model.HStockPlaceID = HSPID;
-        //            model.HSourceInterID = dal.omodel_View.HSourceInterID;
-        //            model.HSourceEntryID = dal.omodel_View.HSourceEntryID;
-        //            model.HSourceBillNo = dal.omodel_View.HSourceBillNo;
-        //            model.HSourceBillType = HSourceBillType;
-        //            model.HRedBlueFlag = HRedBlueFlag;
-        //            model.HPieceQty = 1;
-        //            model.HSTOCKORGID = HOWNERID;
-        //            model.HOWNERID = HOWNERID;
-        //            model.HCusBarCode = HExpressNumber;
+            //            model.HWhID = HWhID;
+            //            model.HStockPlaceID = HSPID;
+            //            model.HSourceInterID = dal.omodel_View.HSourceInterID;
+            //            model.HSourceEntryID = dal.omodel_View.HSourceEntryID;
+            //            model.HSourceBillNo = dal.omodel_View.HSourceBillNo;
+            //            model.HSourceBillType = HSourceBillType;
+            //            model.HRedBlueFlag = HRedBlueFlag;
+            //            model.HPieceQty = 1;
+            //            model.HSTOCKORGID = HOWNERID;
+            //            model.HOWNERID = HOWNERID;
+            //            model.HCusBarCode = HExpressNumber;
 
-        //            ////鑾峰彇绯荤粺鍙傛暟
-        //            //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
-        //            //if (oSystemParameter.ShowBill(ref sErrMsg) == false)
-        //            //{
-        //            //    sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
-        //            //    return false;
-        //            //}
-        //            //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
-        //            if (HBillType == "1204" && oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟  鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
-        //            {
-        //                DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_BarCode " + HBillID.ToString() + ",'" + HBillType + "','" + model.HBatchNo + "','" + model.HBarCode + "'," + model.HQty.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_BarCode");
-        //                if (FIFO == null || FIFO.Tables[0].Rows.Count == 0)
-        //                {
-        //                    sErrMsg = "璇锋牴鎹厛杩涘厛鍑烘竻鍗曟壂鐮侊紒";
-        //                    return false;
-        //                }
-        //                else
-        //{
-        //    model.HWhID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HWHID"]);
-        //    model.HStockPlaceID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSPID"]);
-        //    model.HQty = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HQty"]);
-        //    model.HQtyMust = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HSumQtyMust"]);
-        //    model.HSourceInterID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceInterID"]);
-        //    model.HSourceEntryID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceEntryID"]);
-        //    model.HSourceBillNo = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillNo"]);
-        //    model.HSourceBillType = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillType"]);
-        //}
-        //            }
+            //            ////鑾峰彇绯荤粺鍙傛暟
+            //            //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+            //            //if (oSystemParameter.ShowBill(ref sErrMsg) == false)
+            //            //{
+            //            //    sErrMsg = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+            //            //    return false;
+            //            //}
+            //            //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
+            //            if (HBillType == "1204" && oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl == "Y") //绯荤粺鍙傛暟  鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗
+            //            {
+            //                DataSet FIFO = oCn.RunProcReturn("exec h_p_Kf_ICInventory_FIFO_Tmp_BarCode " + HBillID.ToString() + ",'" + HBillType + "','" + model.HBatchNo + "','" + model.HBarCode + "'," + model.HQty.ToString(), "h_p_Kf_ICInventory_FIFO_Tmp_BarCode");
+            //                if (FIFO == null || FIFO.Tables[0].Rows.Count == 0)
+            //                {
+            //                    sErrMsg = "璇锋牴鎹厛杩涘厛鍑烘竻鍗曟壂鐮侊紒";
+            //                    return false;
+            //                }
+            //                else
+            //{
+            //    model.HWhID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HWHID"]);
+            //    model.HStockPlaceID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSPID"]);
+            //    model.HQty = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HQty"]);
+            //    model.HQtyMust = DBUtility.ClsPub.isDoule(FIFO.Tables[0].Rows[0]["HSumQtyMust"]);
+            //    model.HSourceInterID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceInterID"]);
+            //    model.HSourceEntryID = DBUtility.ClsPub.isLong(FIFO.Tables[0].Rows[0]["HSourceEntryID"]);
+            //    model.HSourceBillNo = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillNo"]);
+            //    model.HSourceBillType = DBUtility.ClsPub.isStrNull(FIFO.Tables[0].Rows[0]["HSourceBillType"]);
+            //}
+            //            }
 
-        //            //鐗╂枡鏉$爜鍐欏叆涓存椂琛ㄦ椂锛屽垽鏂粨搴撲粨浣嶆槸鍚︽纭�
-        //            DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP");
-        //if (ds5 == null || ds5.Tables[0].Rows.Count == 0)
-        //{
-        //    sErrMsg = "鎵弿鐗╂枡鏉$爜瀛樺叆涓存椂琛ㄦ椂鍒ゆ柇浠撳簱浠撲綅鏄惁姝g‘,鏈煡閿欒锛�";
-        //    return false;
-        //}
-        //else
-        //{
-        //    if (DBUtility.ClsPub.isLong(ds5.Tables[0].Rows[0][0]) == 1)
-        //    {
-        //        sErrMsg = DBUtility.ClsPub.isStrNull(ds5.Tables[0].Rows[0]["HRemark"]);
-        //        return false;
-        //    }
-        //}
+            //            //鐗╂枡鏉$爜鍐欏叆涓存椂琛ㄦ椂锛屽垽鏂粨搴撲粨浣嶆槸鍚︽纭�
+            //            DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP");
+            //if (ds5 == null || ds5.Tables[0].Rows.Count == 0)
+            //{
+            //    sErrMsg = "鎵弿鐗╂枡鏉$爜瀛樺叆涓存椂琛ㄦ椂鍒ゆ柇浠撳簱浠撲綅鏄惁姝g‘,鏈煡閿欒锛�";
+            //    return false;
+            //}
+            //else
+            //{
+            //    if (DBUtility.ClsPub.isLong(ds5.Tables[0].Rows[0][0]) == 1)
+            //    {
+            //        sErrMsg = DBUtility.ClsPub.isStrNull(ds5.Tables[0].Rows[0]["HRemark"]);
+            //        return false;
+            //    }
+            //}
 
-        ////灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
-        //if (set_SavePonderationBillMain_Temp_Select_Qty(model, HQty, ref sErrMsg))
-        //{
+            ////灏嗙墿鏂欐潯鐮佷俊鎭啓鍏ュ嚭鍏ュ簱鏉$爜涓存椂琛�
+            //if (set_SavePonderationBillMain_Temp_Select_Qty(model, HQty, ref sErrMsg))
+            //{
 
-        //}
-        //else
-        //{
-        //    sErrMsg = "鎵弿澶辫触锛�" + sErrMsg;
-        //    return false;
-        //}
-        //return true;
-        //        }
+            //}
+            //else
+            //{
+            //    sErrMsg = "鎵弿澶辫触锛�" + sErrMsg;
+            //    return false;
+            //}
+            //return true;
+            //        }
 
-        //        #endregion
+            //        #endregion
 
 
-        //        #endregion
+            //        #endregion
 
 
-        #region 妯″叿鏉$爜澶勭悊鏂规硶
+            #region 妯″叿鏉$爜澶勭悊鏂规硶
 
-        #region 鎵弿妯″叿婧愬崟鏉$爜
+            #region 鎵弿妯″叿婧愬崟鏉$爜
 
-        [WebMethod]
+            [WebMethod]
         public Model.ClsKf_ICStockBill_Mould get_CheckTypeByMouldSource(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HHMaker, Int64 HOWNERID, ref string sErrMsg)
         {
             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
diff --git a/DLL/Pub_Class.dll b/DLL/Pub_Class.dll
index fc1f961..6526824 100644
--- a/DLL/Pub_Class.dll
+++ b/DLL/Pub_Class.dll
Binary files differ

--
Gitblit v1.9.1