Browse Source

退料数量不能大于领料单的已出数量!

master
DESKTOP-DIHMM3I\22375 2 years ago
parent
commit
297c9fcf19
  1. 11
      ICSSoft.ERP.WebAPI/ICSSoft.DataProject/MOIssueDocNegatives.cs
  2. 12
      ICSSoft.ERP.WebAPI/ICSSoft.DataProject/OutsourcingIssueDoNegative.cs

11
ICSSoft.ERP.WebAPI/ICSSoft.DataProject/MOIssueDocNegatives.cs

@ -321,6 +321,17 @@ namespace ICSSoft.DataProject
}
else
{
sql = @"SELECT isnull(fOutQuantity,0) as fOutQuantity,iQuantity from MaterialAppVouchs a where a.AutoID='" + body.SourceDetailID + "' ";
DataTable dtClose = DBHelper.SQlReturnData(sql, cmd);
if (dtClose != null && dtClose.Rows.Count > 0)
{
if (Convert.ToDecimal(dtClose.Rows[0][0].ToString()) + body.Quantity > Convert.ToDecimal(dtClose.Rows[0][1].ToString()))
{
throw new Exception("退料数量不能大于领料单的已出数量!");
}
}
sql = @"INSERT INTO dbo.rdrecords11
( AutoID ,ID ,cInvCode ,iQuantity ,iFlag ,cDefine22 ,iMPoIds,cmocode,iNum,
cDefine23 ,cDefine24 ,cDefine25 ,cDefine26 ,cDefine27 ,

12
ICSSoft.ERP.WebAPI/ICSSoft.DataProject/OutsourcingIssueDoNegative.cs

@ -496,6 +496,18 @@ GROUP BY d.number ";
}
else
{
sql = @"SELECT isnull(fOutQuantity,0) as fOutQuantity,iQuantity from MaterialAppVouchs a where a.AutoID='" + body.SourceDetailID + "' ";
DataTable dtClose = DBHelper.SQlReturnData(sql, cmd);
if (dtClose != null && dtClose.Rows.Count > 0)
{
if (Convert.ToDecimal(dtClose.Rows[0][0].ToString()) + body.Quantity > Convert.ToDecimal(dtClose.Rows[0][1].ToString()))
{
throw new Exception("退料数量不能大于领料单的已出数量!");
}
}
sql = @"INSERT INTO dbo.rdrecords11
( AutoID ,ID ,cInvCode ,iQuantity ,iFlag ,cDefine22 ,iOMoDID,iOMoMID,iNum,
cDefine23 ,cDefine24 ,cDefine25 ,cDefine26 ,cDefine27 ,

Loading…
Cancel
Save