|
|
@ -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 , |
|
|
|