主题:管家婆服装。net 服装年结存后负库存不能开帐 回复 引用 修改 删除 订阅本帖 邀请阅读 返回 作者:管理员 发表时间:2013-09-09 16:58 原因在一些服装版在期初时不能列表,如果一类一类进去查商品,效率太慢可以在SQL查询分析器里用语句查询到那些商品是负数的 delete inigoodsstocks where ktypeid='99999' delete inigoodsstocks where ptypeid not in(select typeid from ptype where sonnum=0 and deleted=0) delete inigoodsstocks where ktypeid not in(select typeid from stock where sonnum=0 and deleted=0) delete inigoodsstocks where qty=0 and total=0 delete inigoodsdetail where orderid not in(select orderid from inigoodsstocks) select p.usercode 商品编号,p.fullname 商品全名,k.fullname 仓库名称,i.qty 数量,i.total 金额 from inigoodsstocks i,ptype p,stock k where i.ptypeid=p.typeid and i.ktypeid=k.typeid and ((i.total<=0 or i.qty<=0) or i.orderid in(select orderid from inigoodsdetail where qty<=0)) select p.usercode 商品编号,p.fullname 商品全名,k.fullname 往来单位名称,i.qty 数量,i.total 金额 from IniCommission i,ptype p,btype k where i.ptypeid=p.typeid and i.btypeid=k.typeid and ((i.total<0 or i.qty<0 or i.costtotal<0) or i.dlyorder in(select orderid from Inicommissiondetail where qty<0)) (责任编辑:金华管家婆_义乌管家婆软件) |