解决方案: |
总帐明细表中存在与货明细表不一一对应的记录(也就是说该记录在总帐明细表中存在,在存货明细表中却不存在)。此问题可以以下二种方式解决:
1、重新作7月份凭证或则在总帐明细表中删除存货列表中无法显示的凭证。
2、用下面的语句将总帐中的记录与存货明细表的记录建立关联,但是这种关联不是真正的一一对应关系,只是使凭证在存货模块的凭证列表中显示出来。
select i_id,coutid
into #aaaa
from gl_accvouch
where coutno_id not in (select distinct cpzid from ia_subsidiary where cpzid is not null)
and coutno_id not in (select distinct cpzid from ia_ensubsidiary where cpzid is not null)
and coutsysname='IA' and coutno_id is not null
order by ino_id
go
select cvoucode,max(cpzid) as cpzid
into #bbbb
from ia_ensubsidiary
where cvoutype='27'
and cvoucode in (select coutid from #aaaa)
and cpzid is not null
group by cvoucode
go
update gl_accvouch
set coutno_id=cpzid
from gl_accvouch a
inner join #bbbb b on a.coutid=b.cvoucode
where a.i_id in(select i_id from #aaaa) |