专业版采购发票到票之后钩稽核算产生的红蓝字单据无法删除,但是发票与原入库单都已经删除掉了?
【问题描述】
专业版16.0,反钩稽不删除红蓝冲回单,又无法直接删除。
【原因分析】
属于程序问题,需要安装最新补丁,再用解决方案里的脚本修复历史数据。
【解决方案】
可参考以下脚本执行处理:
select t2.FDate,t2.FBillNo,t2.FHookInterID,t2.FHookStatus,t2.FTranType,t2.FROB,t2.FStatus,t2.FCheckerID,t2.FCheckDate,t2.FChildren,t2.FVchInterID,t1.FInterID,t1.FEntryID,t1.FNote
into #ICStockBill
from ICStockBillEntry t1
inner join ICStockBill t2 on t1.FInterID=t2.FInterID
inner join (
select t2.FInterID,t1.FEntryID,t2.FTranType,t2.FHookInterID,t1.FSourceInterId,t1.FSourceEntryID,t1.FSourceTranType,t1.FNote
from ICStockBillEntry t1
inner join ICStockBill t2 on t1.FInterID=t2.FInterID
where t2.FTranType=1 and t1.FNote not like '%核算自动生成%'
)t3 on t3.FInterID=t1.FSourceInterId and t3.FEntryID=t1.FSourceEntryID and t2.FTranType=t1.FSourceTranType
where t2.FTranType=1 and isnull(t2.FVchInterID,0)=0 and t1.FNote like '%核算自动生成%' and t2.FHookInterID<>t3.FHookInterID
go
alter table ICStockBill disable trigger all
go
alter table ICStockBillEntry disable trigger all
go
update ICStockBill set FStatus=0,FCheckDate=null,FCheckerID=0 where FInterID in (select FInterID from #ICStockBill)
go
delete t1 from ICStockBillEntry t1
inner join ICStockBill t2 on t1.FInterID=t2.FInterID
where t1.FInterID in (select FInterID from #ICStockBill)
go
delete from ICStockBill where FInterID in (select FInterID from #ICStockBill)
go
alter table ICStockBill enable trigger all
go
alter table ICStockBillEntry enable trigger all
go
drop table #ICStockBill
go
【注意事项】
正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。
专业版采购发票到票之后钩稽核算产生的红蓝字单据无法删除,但是发票与原入库单都已经删除掉了?
本文2024-09-22 15:54:32发表“kis知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-kis-84495.html