diff --git a/WMS-BS/NFine.Application/WMS/WMSDeleteReceipts.cs b/WMS-BS/NFine.Application/WMS/WMSDeleteReceipts.cs index 9d0c66c..9ece31f 100644 --- a/WMS-BS/NFine.Application/WMS/WMSDeleteReceipts.cs +++ b/WMS-BS/NFine.Application/WMS/WMSDeleteReceipts.cs @@ -152,18 +152,18 @@ namespace NFine.Application.WMS string sql = $@" select Distinct A.ApplyCode,A.WorkPoint from ICSOApply A where A.ApplyCode='{code}'"; DataTable dt = Repository().FindDataSetBySql(sql).Tables[0]; - for (int j = 0; j < dt.Rows.Count; i++) + for (int j = 0; j < dt.Rows.Count; j++) { string chksql = @"select SUM(Quantity) AS Quantity,SUM(IssueQuantity) AS IssueQuantity from ICSOApply where ApplyCode='{0}' and WorkPoint='{1}' GROUP BY ApplyCode,WorkPoint"; - chksql = string.Format(chksql, dt.Rows[i]["ApplyCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); + chksql = string.Format(chksql, dt.Rows[j]["ApplyCode"].ToString(), dt.Rows[j]["WorkPoint"].ToString()); DataTable chkdt = Repository().FindDataSetBySql(chksql).Tables[0]; SAPCallBackDocVPNCS.ZWMS_SK_WS_PZ Client = new SAPCallBackDocVPNCS.ZWMS_SK_WS_PZ(); SAPCallBackDocVPNCS.ZWMS_SK_WS_PZ1 Info = new SAPCallBackDocVPNCS.ZWMS_SK_WS_PZ1(); Info.NEWID = Guid.NewGuid().ToString(); - Info.DANJU = dt.Rows[i]["ApplyCode"].ToString(); + Info.DANJU = dt.Rows[j]["ApplyCode"].ToString(); Info.STATE = "0"; List ItemList = new List(); List ItemLineList = new List(); @@ -172,7 +172,7 @@ namespace NFine.Application.WMS ,ISNULL(B.BatchCode,'') AS BatchCode,A.ID,A.WorkPoint,A.WHCode from ICSOApply A LEFT JOIN ICSExtension B ON B.ID=A.ExtensionID AND B.WorkPoint=A.WorkPoint WHERE ApplyCode='{0}' AND A.WorkPoint='{1}'"; - sql = string.Format(sql, dt.Rows[i]["ApplyCode"].ToString(), dt.Rows[i]["WorkPoint"].ToString()); + sql = string.Format(sql, dt.Rows[j]["ApplyCode"].ToString(), dt.Rows[j]["WorkPoint"].ToString()); DataTable Sapdt = Repository().FindDataSetBySql(sql).Tables[0]; foreach (DataRow dr in Sapdt.Rows) { @@ -302,7 +302,7 @@ namespace NFine.Application.WMS ItemLineList.Add(ItemLine); } sqlString.Append($@"DELETE FROM ICSSDN WHERE ID='{id}';"); - sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','5','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); + sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','7','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); } } @@ -344,7 +344,7 @@ namespace NFine.Application.WMS string IsSuccess = ""; string ErrorMessage = ""; string sql = $@" select Distinct A.OutCode,A.WorkPoint from ICSOtherOut A - where A.OutCode in {codes}"; + where A.OutCode in ({codes})"; DataTable dt = Repository().FindDataSetBySql(sql).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { @@ -397,7 +397,7 @@ namespace NFine.Application.WMS ItemLineList.Add(ItemLine); } sqlString.Append($@"DELETE FROM ICSOtherOut WHERE ID='{id}';"); - sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','5','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); + sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','8','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); } } @@ -443,7 +443,7 @@ namespace NFine.Application.WMS string IsSuccess = ""; string ErrorMessage = ""; string sql = $@" select Distinct A.TransferNO,A.WorkPoint from ICSTransfer A - where A.TransferNO in {codes}"; + where A.TransferNO in ({codes})"; DataTable dt = Repository().FindDataSetBySql(sql).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { @@ -462,7 +462,7 @@ namespace NFine.Application.WMS List ItemList = new List(); List ItemLineList = new List(); Info.Z_FLAG = new SAPCallBackDocVPNCS.ZWEB_RETURN[1]; - sql = @" select A.ID,A.WorkPoint,A.WHCode, A.TransferNO,A.SAPSequence,A.InvCode,A.Sequence,A.Quantity,A.TransferQuantity + sql = @" select A.ID,A.WorkPoint,A.FromWarehouseCode, A.TransferNO,A.SAPSequence,A.InvCode,A.Sequence,A.Quantity,A.TransferQuantity ,ISNULL(B.BatchCode,'') AS BatchCode from ICSTransfer A LEFT JOIN ICSExtension B ON B.ID=A.ExtensionID AND B.WorkPoint=A.WorkPoint WHERE TransferNO='{0}' AND A.WorkPoint='{1}'"; @@ -476,7 +476,7 @@ namespace NFine.Application.WMS string dnCode = dr["TransferNO"].ToString(); string invCode = dr["INVCode"].ToString(); string workPoint = dr["WorkPoint"].ToString(); - string whCode = dr["WHCode"].ToString(); + string whCode = dr["FromWarehouseCode"].ToString(); decimal quantity = dr["Quantity"].ToDecimal(); string sequence = dr["SAPSequence"].ToString(); string batchCode = dr["BatchCode"].ToString(); @@ -496,7 +496,7 @@ namespace NFine.Application.WMS ItemLineList.Add(ItemLine); } sqlString.Append($@"DELETE FROM ICSTransfer WHERE ID='{id}';"); - sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','5','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); + sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','10','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); } } @@ -616,7 +616,7 @@ namespace NFine.Application.WMS string IsSuccess = ""; string ErrorMessage = ""; string sql = $@" select Distinct A.RCVCode,A.WorkPoint from ICSManufactureReceive A - where A.RCVCode in {codes}"; + where A.RCVCode in ({codes})"; DataTable dt = Repository().FindDataSetBySql(sql).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { @@ -668,6 +668,10 @@ namespace NFine.Application.WMS ItemLine.GERNR = dr["BatchCode"].ToString(); ItemLineList.Add(ItemLine); } + + sqlString.Append($@"DELETE FROM ICSManufactureReceive WHERE ID='{id}';"); + sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','14','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); + } } if (ItemList.Count > 0) @@ -925,7 +929,7 @@ namespace NFine.Application.WMS string IsSuccess = ""; string ErrorMessage = ""; string sql = $@" select Distinct A.SDNCode,A.WorkPoint from ICSSDN A - where A.SDNCode in {codes}"; + where A.SDNCode in ({codes})"; DataTable dt = Repository().FindDataSetBySql(sql).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { @@ -979,7 +983,7 @@ namespace NFine.Application.WMS ItemLineList.Add(ItemLine); } sqlString.Append($@"DELETE FROM ICSSDN WHERE ID='{id}';"); - sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','5','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); + sqlString.Append($@"INSERT INTO ICSDeleteReceiptsLog VALUES(NEWID(),'{dnCode}','{sequence}','17','{workPoint}','{invCode}',{dnQuantity},null,'{MUSER}','{MUSERNAME}','{MTime}');"); } } diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/DeleteReceipts/ICSDeleteReceipts.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/DeleteReceipts/ICSDeleteReceipts.cshtml index e9b0e46..33a5e24 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/DeleteReceipts/ICSDeleteReceipts.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/DeleteReceipts/ICSDeleteReceipts.cshtml @@ -1462,7 +1462,8 @@ $.modalAlertNew("WMS00116"); return; } - if (Status == "已过账") { + var strValue1 = $("#gridList").jqGrid("getCell", objList[i], "Status");//得到单元格数据 + if (strValue1 == "已过账") { $.modalAlertNew("WMS00118"); return; }