首页 T+ 总账 结转期间损益多出1块钱

结转期间损益多出1块钱


【问题现象】

结转损益多出1块钱

【解决方案】:

期间损益结转不含辅助项的科目,GL_Journal表里如果辅助项有值,会导致期间损益结转总是多1元

您好,请备份好账套数据,执行以下脚本:

--更新凭证表

update GL_Journal set idauxAccDepartment=null

where idaccount in (select id from AA_Account where isauxaccdepartment=0)

and idauxAccDepartment is not null

update GL_Journal set idauxAccInventory=null

where idaccount in (select id from AA_Account where isauxaccinventory=0)

and idauxAccInventory is not null

update GL_Journal set idauxAccCustomer=null

where idaccount in (select id from AA_Account where isauxacccustomer=0)

and idauxAccCustomer is not null

update GL_Journal set idauxAccSupplier=null

where idaccount in (select id from AA_Account where isauxaccsupplier=0)

and idauxAccSupplier is not null

update GL_Journal set idauxAccPerson=null

where idaccount in (select id from AA_Account where isauxaccperson=0)

and idauxAccPerson is not null

update GL_Journal set idauxAccProject=null

where idaccount in (select id from AA_Account where isauxaccproject=0)

and idauxAccProject is not null

update GL_Journal set idexauxacc1=null

where idaccount in (select id from AA_Account where isexauxacc1=0)

and idexauxacc1 is not null

update GL_Journal set idexauxacc2=null

where idaccount in (select id from AA_Account where isexauxacc2=0)

and idexauxacc2 is not null

update GL_Journal set idexauxacc3=null

where idaccount in (select id from AA_Account where isexauxacc3=0)

and idexauxacc3 is not null

update GL_Journal set idexauxacc4=null

where idaccount in (select id from AA_Account where isexauxacc4=0)

and idexauxacc4 is not null

update GL_Journal set idexauxacc5=null

where idaccount in (select id from AA_Account where isexauxacc5=0)

and idexauxacc5 is not null

update GL_Journal set idexauxacc6=null

where idaccount in (select id from AA_Account where isexauxacc6=0)

and idexauxacc6 is not null

update GL_Journal set idexauxacc7=null

where idaccount in (select id from AA_Account where isexauxacc7=0)

and idexauxacc7 is not null

update GL_Journal set idexauxacc8=null

where idaccount in (select id from AA_Account where isexauxacc8=0)

and idexauxacc8 is not null

update GL_Journal set idexauxacc9=null

where idaccount in (select id from AA_Account where isexauxacc9=0)

and idexauxacc9 is not null

update GL_Journal set idexauxacc10=null

where idaccount in (select id from AA_Account where isexauxacc10=0)

and idexauxacc10 is not null

--更新凭证的辅助项表

update GL_AuxiliaryInfo set idauxAccDepartment=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isauxaccdepartment=0 )

) and idauxAccDepartment is not null

update GL_AuxiliaryInfo set idauxAccInventory=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isauxaccinventory=0 )

) and idauxAccInventory is not null

update GL_AuxiliaryInfo set idauxAccCustomer=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isauxacccustomer=0 )

) and idauxAccCustomer is not null

update GL_AuxiliaryInfo set idauxAccPerson=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isauxaccperson=0 )

) and idauxAccPerson is not null

update GL_AuxiliaryInfo set idauxAccProject=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isauxaccproject=0 )

) and idauxAccProject is not null

update GL_AuxiliaryInfo set idexauxacc1=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc1=0 )

) and idexauxacc1 is not null

update GL_AuxiliaryInfo set idexauxacc2=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc2=0 )

) and idexauxacc2 is not null

update GL_AuxiliaryInfo set idexauxacc3=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc3=0 )

) and idexauxacc3 is not null

update GL_AuxiliaryInfo set idexauxacc4=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc4=0 )

) and idexauxacc4 is not null

update GL_AuxiliaryInfo set idexauxacc5=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc5=0 )

) and idexauxacc5 is not null

update GL_AuxiliaryInfo set idexauxacc6=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc6=0 )

) and idexauxacc6 is not null

update GL_AuxiliaryInfo set idexauxacc7=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc7=0 )

) and idexauxacc7 is not null

update GL_AuxiliaryInfo set idexauxacc8=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc8=0 )

) and idexauxacc8 is not null

update GL_AuxiliaryInfo set idexauxacc9=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc9=0 )

) and idexauxacc9 is not null

update GL_AuxiliaryInfo set idexauxacc10=null where

id in (select auxiliaryinfoid from GL_Journal where idaccount in (select id from AA_Account where isexauxacc10=0 )

) and idexauxacc10 is not null

作者:熊嘉颖 |  时间:2023年10月14日 18:40


对我有用 对我有用
没有帮助 没有帮助