|
|
@ -1954,30 +1954,30 @@ c.Sequence, |
|
|
|
} |
|
|
|
try |
|
|
|
{ |
|
|
|
//#region 占料前增加验证,如果条码数量超出实际需要领料数量,直接报错。
|
|
|
|
//string chksql = @"select InvCode,WHCode,SUM(Quantity) as Quantity from ICSMOApply
|
|
|
|
// where ApplyCode in ({0}) and WorkPoint='{1}'
|
|
|
|
// GROUP BY InvCode,WHCode";
|
|
|
|
//chksql = string.Format(chksql, ID, WorkPoint);
|
|
|
|
//var chkdata = Repository().FindDataSetBySql(chksql);
|
|
|
|
//DataTable chktable = dataset.Tables[0];
|
|
|
|
//foreach (DataRow chkdr in chktable.Rows)
|
|
|
|
//{
|
|
|
|
// decimal ZLQty = 0;
|
|
|
|
// for (int i = 0; i < table.Rows.Count; i++)
|
|
|
|
// {
|
|
|
|
// if (table.Rows[i]["WarehouseCode"].ToString() == chkdr["WarehouseCode"].ToString()
|
|
|
|
// && table.Rows[i]["InvCode"].ToString() == chkdr["InvCode"].ToString())
|
|
|
|
// {
|
|
|
|
// ZLQty += Convert.ToDecimal(table.Rows[i]["SendQTY"].ToString());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (Convert.ToDecimal(chkdr["iQuantity"]) < ZLQty)
|
|
|
|
// {
|
|
|
|
// throw new Exception("物料:"+ chkdr["InvCode"].ToString() + "实际拣料数量大于单据需求数量,请尝试重新拣料。");
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#region 占料前增加验证,如果条码数量超出实际需要领料数量,直接报错。
|
|
|
|
string chksql = @"select InvCode,WHCode,SUM(Quantity) as Quantity from ICSMOApply
|
|
|
|
where ApplyCode in ({0}) and WorkPoint='{1}' |
|
|
|
GROUP BY InvCode,WHCode";
|
|
|
|
chksql = string.Format(chksql, ID, WorkPoint); |
|
|
|
var chkdata = Repository().FindDataSetBySql(chksql); |
|
|
|
DataTable chktable = dataset.Tables[0]; |
|
|
|
foreach (DataRow chkdr in chktable.Rows) |
|
|
|
{ |
|
|
|
decimal ZLQty = 0; |
|
|
|
for (int i = 0; i < table.Rows.Count; i++) |
|
|
|
{ |
|
|
|
if (table.Rows[i]["WarehouseCode"].ToString() == chkdr["WHCode"].ToString() |
|
|
|
&& table.Rows[i]["InvCode"].ToString() == chkdr["InvCode"].ToString()) |
|
|
|
{ |
|
|
|
ZLQty += Convert.ToDecimal(table.Rows[i]["SendQTY"].ToString()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (Convert.ToDecimal(chkdr["Quantity"]) < ZLQty) |
|
|
|
{ |
|
|
|
throw new Exception("物料:" + chkdr["InvCode"].ToString() + "实际拣料数量大于单据需求数量,请尝试重新拣料。"); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
if (table.Rows.Count != 0) |
|
|
|
{ |
|
|
|
#region 拣料时增加条码出入库记录,修改库存锁定数量,以作占料处理
|
|
|
|