|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
账套进行了年度结账,新年度又填制了新凭证(要保留新凭证)的手工反结账方法(适用于用友政务R9.6及以下版本)
方法:在SQL后台进行处理,使用查询分析器来修改数据。
1、首先选定所需手工反结账的会计账套,切记不能选错,选错了本人不负责哦。
2、执行如下代码:
--将凭证从“已记账”恢复为“未审核”或“已审核”(1为“未审核”,2为“已审核”,3为“已记账”)
update gl_pzml set zt=1,sh='',jzr='' where kjqj>=200701 and zt=3
--修改会计期间的结账标志jzbz(0为未结账,1为已结账),使用状态syzt(0为未使用,1为已使用)
update pubkjqj set syzt=0,jzbz=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_xmljek set ncj=0,ncd=0 where kjnd=2008
update gl_xmljek set yj1=0,yd1=0 where kjnd=2007
update gl_xmljek set yj2=0,yd2=0 where kjnd=2007
update gl_xmljek set yj3=0,yd3=0 where kjnd=2007
update gl_xmljek set yj4=0,yd4=0 where kjnd=2007
update gl_xmljek set yj5=0,yd5=0 where kjnd=2007
update gl_xmljek set yj6=0,yd6=0 where kjnd=2007
update gl_xmljek set yj7=0,yd7=0 where kjnd=2007
update gl_xmljek set yj8=0,yd8=0 where kjnd=2007
update gl_xmljek set yj9=0,yd9=0 where kjnd=2007
update gl_xmljek set yj10=0,yd10=0 where kjnd=2007
update gl_xmljek set yj11=0,yd11=0 where kjnd=2007
update gl_xmljek 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
--删除科目余额、辅助余额、项目累计发生额等表
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_xmlje where kjnd>2007
delete gl_xmljek where kjnd>2007
3、执行上述代码后,在账务处理系统按正常的程序完成修改、增删凭证、审核、记账、结账后,在查询分析器里选定所需操作的账套执行如下代码:
--还原到以后年度会计科目(''为当前年度的会计科目)
delete gl_kmxx where gsdm=''
update gl_kmxx set gsdm='' where gsdm=2018
[ 本帖最后由 rcldc 于 2008-6-18 17:26 编辑 ] |
评分
-
查看全部评分
|