Browse Source

调整整单拣料

master
lilili 1 year ago
parent
commit
ac5c6781bb
  1. 53
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

53
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -1924,18 +1924,22 @@ left join (select distinct TransCode,TransType,WorkPoint from dbo.ICSWareHouseLo
{
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量大于单据需求数量,请尝试重新拣料。");
}
if (Convert.ToDecimal(chkdr["Quantity"]) > ZLQty && (Type == "2" || Type == "5" || Type == "12"))
//if (Convert.ToDecimal(chkdr["Quantity"]) > ZLQty && (Type == "2" || Type == "5" || Type == "12"))
//{
// chksql = @" select B.F_Define2 from ICSInventoryDetail A
// INNER JOIN Sys_SRM_ItemsDetail B ON B.F_Define1=A.WHCode AND B.F_Define2=A.LocationCode AND B.F_Define4=A.WorkPoint
// where INVCode='{0}' and WHCode='{1}' and WorkPoint='{2}'";
// chksql = string.Format(chksql, chkdr["InvCode"].ToString(), chkdr["WHCode"].ToString(), WorkPoint);
// var chkds = Repository().FindDataSetBySql(chksql);
// DataTable chkdt = chkds.Tables[0];
// if (chkdt.Rows.Count != 0)
// {
// throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量小于单据需求数量,货柜单据必须整单拣料,请先核对库存。");
// }
//}
if (Convert.ToDecimal(chkdr["Quantity"]) > ZLQty)
{
chksql = @" select B.F_Define2 from ICSInventoryDetail A
INNER JOIN Sys_SRM_ItemsDetail B ON B.F_Define1=A.WHCode AND B.F_Define2=A.LocationCode AND B.F_Define4=A.WorkPoint
where INVCode='{0}' and WHCode='{1}' and WorkPoint='{2}'";
chksql = string.Format(chksql, chkdr["InvCode"].ToString(), chkdr["WHCode"].ToString(), WorkPoint);
var chkds = Repository().FindDataSetBySql(chksql);
DataTable chkdt = chkds.Tables[0];
if (chkdt.Rows.Count != 0)
{
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量小于单据需求数量,货柜单据必须整单拣料,请先核对库存。");
}
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量小于单据需求数量,货柜单据必须整单拣料,请先核对库存。");
}
}
#endregion
@ -2517,18 +2521,23 @@ a.Sequence,
{
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量大于单据需求数量,请尝试重新拣料。");
}
if (Convert.ToDecimal(chkdr["Quantity"]) > ZLQty && (Type == "2" || Type == "5" || Type == "12"))
//if (Convert.ToDecimal(chkdr["Quantity"]) > ZLQty && (Type == "2" || Type == "5" || Type == "12"))
//{
// chksql = @" select B.F_Define2 from ICSInventoryDetail A
// INNER JOIN Sys_SRM_ItemsDetail B ON B.F_Define1=A.WHCode AND B.F_Define2=A.LocationCode AND B.F_Define4=A.WorkPoint
// where INVCode='{0}' and WHCode='{1}' and WorkPoint='{2}'";
// chksql = string.Format(chksql, chkdr["InvCode"].ToString(), chkdr["WHCode"].ToString(), WorkPoint);
// var chkds = Repository().FindDataSetBySql(chksql);
// DataTable chkdt = chkds.Tables[0];
// if (chkdt.Rows.Count != 0)
// {
// throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量小于单据需求数量,货柜单据必须整单拣料,请先核对库存。");
// }
//}
if (Convert.ToDecimal(chkdr["Quantity"]) > ZLQty)
{
chksql = @" select B.F_Define2 from ICSInventoryDetail A
INNER JOIN Sys_SRM_ItemsDetail B ON B.F_Define1=A.WHCode AND B.F_Define2=A.LocationCode AND B.F_Define4=A.WorkPoint
where INVCode='{0}' and WHCode='{1}' and WorkPoint='{2}'";
chksql = string.Format(chksql, chkdr["InvCode"].ToString(), chkdr["WHCode"].ToString(), WorkPoint);
var chkds = Repository().FindDataSetBySql(chksql);
DataTable chkdt = chkds.Tables[0];
if (chkdt.Rows.Count != 0)
{
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量小于单据需求数量,货柜单据必须整单拣料,请先核对库存。");
}
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量小于单据需求数量,单据必须整单拣料,请先核对库存。");
}
}
#endregion

Loading…
Cancel
Save