企业新闻
南通金蝶KIS专业版双击凭证提示“下标越界”
一、在南通金蝶KIS专业版中,打开凭证管理界面,然后双击凭证提示“下标越界”: 问题描述:凭证管理中,双击某一张凭证,提示“下标越界” ,无法显示当前凭证 问题原因:凭证表体丢失数据或者FEntryID不连续 解决方法:1、凭证表体数据丢失 查询凭证头中存在而凭证体中不存在的凭证如下: select * from t_voucher where fvoucherid not in (select fvoucherid from t_voucherentry ) 记录1步骤中的凭证号,然后执行如下语句删除: delete from t_voucher where fvoucherid not in (select fvoucherid from t_voucherentry ) 查询凭证体中分录不全的记录 select a.fentrycount,b.* into t_voucherentry_temp from t_voucher a join t_voucherentry b on a.fvoucherid=b.fvoucherid select fvoucherid,fentrycount,count(fentryid) fentryidcount into temp_voucherid from t_voucherentry_temp group by fvoucherid,fentrycount 记录丢失分录的凭证号: select * from t_voucher where fvoucherid in (select fvoucherid from temp_voucherid where fentrycount<>fentryidcount) 记录未丢失的凭证体分录信息 select * from t_voucherentry where fvoucherid in (select fvoucherid from temp_voucherid where fentrycount<>fentryidcount) 删除丢失分录的凭证: delete from t_voucher where fvoucherid in (select fvoucherid from temp_voucherid where fentrycount<>fentryidcount) delete from t_voucherentry where fvoucherid in (select fvoucherid from temp_voucherid where fentrycount<>fentryidcount) 在前台软件界面重新录入删除的凭证。 2、凭证表体FEntryID不连续 查找不连续的FVoucherID select fvoucherid, count(fentryid) as fentryidcount, (max(fentryid)+1) as fmaxentryid into #tmpb from t_voucherentry group by fvoucherid having count(fentryid)<>(max(fentryid)+1) 生成新的FEntryID declare @Fvoucherid int declare Cvoucherid cursor for select distinct fvoucherid from t_voucher where fvoucherid in (select fvoucherid from #tmpb ) open Cvoucherid Fetch Cvoucherid into @Fvoucherid while (@@Fetch_Status=0) begin select distinct(fentryid) AS Foldid,IDENTITY(int,0,1) as fnewid into #tmpa from t_voucherentry where fvoucherid=@Fvoucherid update t_voucherentry set fentryid=#tmpa.fnewid from t_voucherentry join #tmpa on t_voucherentry.fentryid=#tmpa.foldid and t_voucherentry.fvoucherid=@Fvoucherid drop table #tmpa fetch next from Cvoucherid into @Fvoucherid end CLOSE Cvoucherid DEALLOCATE Cvoucherid drop table #tmpb
搜索关键字:南通金蝶KIS专业版 南通金蝶KIS专业版凭证“下标越界”