|
发表于 2008-6-18 16:41:14
|
显示全部楼层
如果08年有新凭证的话,手工反结转
如果08年有新凭证的话,可手工反结转。
方法:使用SQL的查询分析器,选定所需反结转的账套
然后执行如下代码:
--将凭证从“已记账”恢复为“未审核”或“已审核”(1为“未审核”,2为“已审核”,3为“已记账”)
update gl_pzml set zt=1,sh='',jzr='' where kjqj>=200701 and zt=3
--修改会计期间的结账标志(0为未结账,1为已结账和使用状态标志(0为未使用,1为已使用)
update pubkjqj set syzt=0,jzbz=0,xgzt=0 where kjnd>2006
--清空科目余额
update gl_kmye set kmncj=0,kmncd=0 where kjnd=2008
update gl_kmye set kmjf1=0,kmdf1=0 where kjnd=2007
update gl_kmye set kmjf2=0,kmdf2=0 where kjnd=2007
update gl_kmye set kmjf3=0,kmdf3=0 where kjnd=2007
update gl_kmye set kmjf4=0,kmdf4=0 where kjnd=2007
update gl_kmye set kmjf5=0,kmdf5=0 where kjnd=2007
update gl_kmye set kmjf6=0,kmdf6=0 where kjnd=2007
update gl_kmye set kmjf7=0,kmdf7=0 where kjnd=2007
update gl_kmye set kmjf8=0,kmdf8=0 where kjnd=2007
update gl_kmye set kmjf9=0,kmdf9=0 where kjnd=2007
update gl_kmye set kmjf10=0,kmdf10=0 where kjnd=2007
update gl_kmye set kmjf11=0,kmdf11=0 where kjnd=2007
update gl_kmye set kmjf12=0,kmdf12=0 where kjnd=2007
--清空科目余额库
update gl_kmyek set kmncj=0,kmncd=0 where kjnd=2008
update gl_kmyek set kmjf1=0,kmdf1=0 where kjnd=2007
update gl_kmyek set kmjf2=0,kmdf2=0 where kjnd=2007
update gl_kmyek set kmjf3=0,kmdf3=0 where kjnd=2007
update gl_kmyek set kmjf4=0,kmdf4=0 where kjnd=2007
update gl_kmyek set kmjf5=0,kmdf5=0 where kjnd=2007
update gl_kmyek set kmjf6=0,kmdf6=0 where kjnd=2007
update gl_kmyek set kmjf7=0,kmdf7=0 where kjnd=2007
update gl_kmyek set kmjf8=0,kmdf8=0 where kjnd=2007
update gl_kmyek set kmjf9=0,kmdf9=0 where kjnd=2007
update gl_kmyek set kmjf10=0,kmdf10=0 where kjnd=2007
update gl_kmyek set kmjf11=0,kmdf11=0 where kjnd=2007
update gl_kmyek set kmjf12=0,kmdf12=0 where kjnd=2007
--清空项目累计额
update gl_xmlje set ncj=0,ncd=0 where kjnd=2008
update gl_xmlje set yj1=0,yd1=0 where kjnd=2007
update gl_xmlje set yj2=0,yd2=0 where kjnd=2007
update gl_xmlje set yj3=0,yd3=0 where kjnd=2007
update gl_xmlje set yj4=0,yd4=0 where kjnd=2007
update gl_xmlje set yj5=0,yd5=0 where kjnd=2007
update gl_xmlje set yj6=0,yd6=0 where kjnd=2007
update gl_xmlje set yj7=0,yd7=0 where kjnd=2007
update gl_xmlje set yj8=0,yd8=0 where kjnd=2007
update gl_xmlje set yj9=0,yd9=0 where kjnd=2007
update gl_xmlje set yj10=0,yd10=0 where kjnd=2007
update gl_xmlje set yj11=0,yd11=0 where kjnd=2007
update gl_xmlje set yj12=0,yd12=0 where kjnd=2007
--清空辅助余额
update gl_fzye set ncj=0,ncd=0 where kjnd=2008
update gl_fzye set yj1=0,yd1=0 where kjnd=2007
update gl_fzye set yj2=0,yd2=0 where kjnd=2007
update gl_fzye set yj3=0,yd3=0 where kjnd=2007
update gl_fzye set yj4=0,yd4=0 where kjnd=2007
update gl_fzye set yj5=0,yd5=0 where kjnd=2007
update gl_fzye set yj6=0,yd6=0 where kjnd=2007
update gl_fzye set yj7=0,yd7=0 where kjnd=2007
update gl_fzye set yj8=0,yd8=0 where kjnd=2007
update gl_fzye set yj9=0,yd9=0 where kjnd=2007
update gl_fzye set yj10=0,yd10=0 where kjnd=2007
update gl_fzye set yj11=0,yd11=0 where kjnd=2007
update gl_fzye set yj12=0,yd12=0 where kjnd=2007
--清空辅助余额库
update gl_fzyek set ncj=0,ncd=0 where kjnd=2008
update gl_fzyek set yj1=0,yd1=0 where kjnd=2007
update gl_fzyek set yj2=0,yd2=0 where kjnd=2007
update gl_fzyek set yj3=0,yd3=0 where kjnd=2007
update gl_fzyek set yj4=0,yd4=0 where kjnd=2007
update gl_fzyek set yj5=0,yd5=0 where kjnd=2007
update gl_fzyek set yj6=0,yd6=0 where kjnd=2007
update gl_fzyek set yj7=0,yd7=0 where kjnd=2007
update gl_fzyek set yj8=0,yd8=0 where kjnd=2007
update gl_fzyek set yj9=0,yd9=0 where kjnd=2007
update gl_fzyek set yj10=0,yd10=0 where kjnd=2007
update gl_fzyek set yj11=0,yd11=0 where kjnd=2007
update gl_fzyek set yj12=0,yd12=0 where kjnd=2007
--还原到上年度会计科目(''为当前年度的会计科目)
update gl_kmxx set gsdm=2018 where gsdm=''
update gl_kmxx set gsdm='' where gsdm=2007
--删除2008年科目余额表和科目余额库
delete gl_kmye where kjnd>2007
delete gl_kmyek where kjnd>2007
delete gl_fzyek where kjnd>2007
delete gl_fzye where kjnd>2007
--还原到以后年度会计科目(''为当前年度的会计科目)
--delete gl_kmxx where gsdm=''
--update gl_kmxx set gsdm='' where gsdm=2018 |
|