From ae60d9f94c079f97310e676e8fa10319c0a2c070 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期四, 31 八月 2023 13:44:46 +0800
Subject: [PATCH] 新增涤纶半成品生成条码模块,称重入库条码生成模块数量存入修改

---
 WarM/条码打印/Kf_WeighToBarCode.cs |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs"
index cbb25c7..8f913b6 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode.cs"
@@ -363,6 +363,8 @@
                     + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ") ");
                 //鏇存柊鍏宠仈鏁伴噺
                 oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToProductIn_Add " + HInterID.ToString());
+                //鍥炲~宸茬敓鍗曠姸鎬�
+                oCn.RunProc("Update KF_WeighSource_Temp set HRelationInterID=1 where HInterID= " + HInterID.ToString());
                 MessageBox.Show("鐢熸垚鐢熶骇鍏ュ簱鍗曪細" + HBillNo + " 鎴愬姛锛�", "鎻愮ず");
                 oCn.Commit();
                 return true;
@@ -536,6 +538,11 @@
                 MessageBox.Show("璇疯緭鍏ユ纭噸閲忥紒", "鎻愮ず");
                 return false;
             }
+            else if (DBUtility.ClsPub.isDoule(txtHQty.Text)- DBUtility.ClsPub.isDoule(txtHKDQty.Text) <= 0)
+            {
+                MessageBox.Show("杈撳叆鐨勬墸鐐规暟涓嶈兘澶т簬绫虫暟锛�", "鎻愮ず");
+                return false;
+            }
             else if (DBUtility.ClsPub.isInt(txtHBarcodeNo.Text) == 0)
             {
                 MessageBox.Show("璇疯緭鍏ュ寘鍙凤紒", "鎻愮ず");
@@ -626,9 +633,10 @@
 
             string HBarCode = "";
             string HBarCodeType = "";
-            double HQty = 0;            //绫虫暟
+            double HNowQty = 0;         //绫虫暟
             double HMaterialJQty = 0;   //閲嶉噺
             double HMaterialMQty = 0;   //鎵g偣鏁�
+            double HQty = 0;            //鏁伴噺
             Int64 HDeptID = 0;
             string HRemark = "";
             string HMaterName = "";
@@ -641,9 +649,10 @@
 
             HBarCode = TM;
             HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text);
-            HQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
+            HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
             HMaterialJQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text);
             HMaterialMQty = DBUtility.ClsPub.isDoule(txtHKDQty.Text);
+            HQty = HNowQty- HMaterialMQty;
             HDeptID = DBUtility.ClsPub.isLong(txtHDeptName.Tag);
             HRemark = DBUtility.ClsPub.isStrNull(txtHRemark.Text);
             HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text);
@@ -657,31 +666,31 @@
             try
             {
                 oCn.BeginTran();
-                //鍐欏叆鏉$爜妗f    (瀹㈡埛鐗╂枡鍚嶇ОHCusMaterName瀛樺叆HMaterialModel瀛楁锛屽鎴疯鏍煎瀷鍙稨CusModel瀛樺叆HCusModel瀛楁
+                //鍐欏叆鏉$爜妗f    (瀹㈡埛鐗╂枡鍚嶇ОHCusMaterName瀛樺叆HMaterialModel瀛楁锛屽鎴疯鏍煎瀷鍙稨CusModel瀛樺叆HCusModel瀛楁锛屼笉鑹師鍥營D瀛樺叆HCustomQty1瀛楁锛�
                 oCn.RunProc("Insert into Gy_BarCodeBill " +
                 "(HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                 ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                 ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                 ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
-                ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty " +
+                ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty,HNowQty " +
                 ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HGiveAwayFlag " +
                 ",HOrderInterID,HOrderEntryID,HOrderBillNo,HCustomQty1,HMaterialModel,HCusModel " +
-                ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
+                ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HLogo " +
                 ") Values ("
                 + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString()
                 + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + HMaker + "',getdate(),0," + HQty.ToString()
                 + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "',''"
                 + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
-                + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString()
+                + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() + "," + HNowQty.ToString()
                 + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0"
                 + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'"
-                + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','')");
+                + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','','1')");
 
                 //鍥炲~鏈�澶ф祦姘村彿
                 oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "',1 ");
 
                 //鍥炲~婧愬崟涓存椂琛℉InterID
-                oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo + "' from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and convert(varchar(10),a.HMakeDate,120)=convert(varchar(10),getdate(),120)");
+                oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo +"',a.HRelationInterID= 0 from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and a.HSourceBillNo='" + ProcessExchangeBillNo + "'");
 
                 //鍐欏叆鏉$爜鍑哄叆搴撲复鏃惰〃
                 oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +

--
Gitblit v1.9.1