服务热线:

400-665-0027

知识资讯
联系我们

电话:400-665-0027


您当前位置:首页 > 知识资讯  > 知识学习 > 正文知识学习
金蝶专业16.0版采购发票到票之后钩稽核算产生的红蓝字单据无法删除,但是发票与原入库单都已经删除掉了怎么解决?
服务热线:400-665-0027 新购有特价、金蝶老客户升级金蝶云产品可以享受5折优惠,送手机、送话费,好礼不断!
【问题描述】
专业版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


【注意事项】

正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。