...
select o.id,o.billnumberid,o.OperateType,e.usercode 操作员编号,e.fullname 操作员名称,o.operatetime 操作时间,o.IP,o.billcode,o.billdate,case when ifcheck ='f' then '草稿' when ifcheck='t' then '过账' end 单据状态 ,b.usercode 往来单位编号,b.fullname 往来单位名称,o.ntotalmoney 单据金额,bn.billname from BillOperateLog o left join employee e on e.typeid=o.etypeid left join btype b on b.typeid=o.btypeid left join billname bn on bn.billtype=o.billtype
where o.billnumberid in(
select billnumberid from billindex b where ( b.ifcheck='f' or b.draft = 1)
and ( exists (select 1 from inoutstocktable i where i.billnumberid=b.billnumberid and i.billtype=b.billtype)
or exists(select 1 from listtable l where l.billnumberid=b.billnumberid and l.billtype=b.billtype)))
order by o.billnumberid,o.id
处理方法:备份数据后,执行下面脚本:
https://share.weiyun.com/KcZBknmhf1XUb9mY --- 14、过账异常单据处理本张草稿已过账.sql
注意:执行完以上脚本后,该单据在经营历程了,请客户核对一下库存和往来即可。费用类 收付款单 调账单据等单据改不了状态
...