----执行下面的脚本，去查询以下3中情况有没有，有根据查询的结果去调整期初库存数量或者期初序列号

------ 查库存与序列号数量不符


SELECT I.Qty 库存,a.QTY 序列号数量,p.UserCode 商品编号,p.FullName 商品名称,s.FullName 仓库名称 FROM  IniGoodsStocks AS I,#A AS A,ptype as p,Stock as s WHERE I.PRec=A.Prec AND I.KRec=A.KRec and i.PRec=p.rec and i.KRec=s.rec
AND I.SNUniqueid=A.SNUniqueid AND I.Qty<>A.QTY





----- 商品序列号批次在库存中不存在


select p.UserCode 商品编号,p.FullName 商品名称,s.FullName from #a  as a,ptype as p,Stock as s where a.SNUniqueid not in (select SNUniqueid from  INIGoodsStocks) AND  A.PRec=P.rec AND A.KRec=S.Rec



---- 严密管理序列号的商品有库存但没有序列号


select p.UserCode 商品编号,p.FullName 商品名称,s.FullName from INIGoodsStocks  as a,ptype as p,Stock as s where a.SNUniqueid not in (select SNUniqueid from  SNList) AND  A.PRec=P.rec AND A.KRec=S.Rec and p.Flags>='3221225472'