如希望数量为零件数不为零的不再显示,可从数据库中修改,参考语句:
此语句正确生效的前提条件为帐套为固定换算率。
1、依据累计出库数量修改累计出库件数,然件数与数量同步:
update rdrecords
set isoutNum = isoutquantity/iInvExChRate
from MainBatch INNER JOIN RdRecords ON dbo.MainBatch.RdID = RdRecords.AutoID
where rdrecords.iNum <> 0 and rdrecords.isoutquantity <> 0 and isoutNum<>(isoutquantity/iInvExChRate)
2、更新mainbatch表
----没有出完,但是isnull 已经置为1,置回0
update UFDATA_010_2009..mainbatch
set bisnull = 0
where bisnull = 1 and rdid in(select autoid from UFDATA_010_2009..rdrecords rds inner join UFDATA_010_2009..rdrecord rd on rds.id = rd.id
where ((brdflag = 1 and iquantity > 0) or (brdflag = 0 and iquantity < 0)) and (round(abs(isnull(rds.iquantity,0)) - abs(isnull(rds.isoutquantity,0)),6) >0) )
----已经出完,但是isnull 已经置为0,置回1
update UFDATA_010_2009..mainbatch
set bisnull = 1
where bisnull = 0 and rdid in(select autoid from UFDATA_010_2009..rdrecords rds inner join UFDATA_010_2009..rdrecord rd on rds.id = rd.id
where ((brdflag = 1 and iquantity > 0) or (brdflag = 0 and iquantity < 0)) and (round(abs(isnull(rds.isoutquantity,0)) - abs(isnull(rds.iquantity,0)),6) >=0) )
|