Browse Source

1.累计发货数量计算Bug修复

master
hao.jin 3 years ago
parent
commit
83f47fc59a
  1. 6
      Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs
  2. 8
      Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs

6
Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs

@ -255,9 +255,9 @@ namespace Stone.WinModule.Standard
);
}
string PartNumber = dtData.Rows[0]["PartNumber"].ToString();
int quantity = Convert.ToInt32(dtData.Rows[0]["quantity"]); //本次需求货数量
int quantity_transit = Convert.ToInt32(dtData.Rows[0]["quantity_transit"]); //在途数量
string PartNumber = drData["PartNumber"].ToString();
int quantity = Convert.ToInt32(drData["quantity"]); //本次需求货数量
int quantity_transit = Convert.ToInt32(drData["quantity_transit"]); //在途数量
if (quantity_transit > 0)
{

8
Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs

@ -239,7 +239,7 @@ namespace Stone.WinModule.Standard
var code = drData["PartNumber"].ToString();
var outQty = decimal.Parse(drData["Qty"].ToString());
var asnNum = drData["AsnNumber"].ToString();
strsql = CreatePartOutSql(code, outQty, dtPartOutQty, asnNum,out dtPartOutQty);
strsql = CreatePartOutSql(db,code, outQty, dtPartOutQty, asnNum,out dtPartOutQty);
if (!string.IsNullOrEmpty(strsql))
{
db.Exec_NonQuery(strsql);
@ -789,14 +789,14 @@ namespace Stone.WinModule.Standard
}
}
private static string CreatePartOutSql(string PartCode, decimal outQty, DataTable dt, string asnNum,out DataTable dtPartOutQty)
private static string CreatePartOutSql(LocalDBService db,string PartCode, decimal outQty, DataTable dt, string asnNum,out DataTable dtPartOutQty)
{
dtPartOutQty = dt;
string strsql = "";
if (dtPartOutQty.Select(" Code = '" + PartCode + "'").Length > 0)
{
//继续校验该ASN是否维护累计发货数量信息
if (dtPartOutQty.Select(" AsnNum = '" + asnNum + "'").Length > 0)
if (dtPartOutQty.Select(" Code = '" + PartCode + "' and AsnNum = '" + asnNum + "'").Length > 0)
{
strsql = "Update t_PartOutQty" +
" set PartOutQty += " + outQty + "," +
@ -812,7 +812,6 @@ namespace Stone.WinModule.Standard
" LastOutTime = getdate()," +
" AsnNum = '" + asnNum + "'" +
" where Code = '" + PartCode + "'";
var db = new LocalDBService();
db.Exec_NonQuery(strsql);
//DT重新赋值
strsql = "select * from t_PartOutQty";
@ -825,7 +824,6 @@ namespace Stone.WinModule.Standard
{
//该零件未维护累计发货数量信息
strsql = "Insert into t_PartOutQty(Code,PartOutQty,LastOutQty,LastOutTime,AsnNum) values ('" + PartCode + "'," + outQty + "," + outQty + ",getdate(),'"+ asnNum + "')";
var db = new LocalDBService();
db.Exec_NonQuery(strsql);
//DT重新赋值
strsql = "select * from t_PartOutQty";

Loading…
Cancel
Save