您好,欢迎光临青岛用友软件销售公司网站!青岛友鹏源信息科技有限公司

关于我们 产品中心

欢迎来电咨询

18605320425

快速导航

全国服务热线

0532-66730821

客户至上、诚意为先

百科问答

当前位置:首页>>新闻中心>>百科问答

用友U8财务数据降级到T3版本SQL脚本

2022-06-14 04:34:32 已有159人浏览

用友U8财务数据降级到T+3版本SQL脚本 /*手工设置内容:权限以及打印信息,如果U8是账套库不是年度库需要对导入的年度区分,如果在导入过程中期初余额可能对账不平的话,直接做T+3账套的年结就可以,然后在导入凭证,这个没有结算方式,要手工增加下,要不修改凭证就会报错*/ /*旧帐套006导入到新帐套001中*/ delete from [UFDAT+A_001_2013].[dbo].[dsign] delete from [UFDAT+A_001_2013].[dbo].[code] delete from [UFDAT+A_001_2013].[dbo].[Customer] delete from [UFDATA_001_2013].[dbo].[CustomerClass] delete from [UFDATA_001_2013].[dbo].[Department] delete from [UFDATA_001_2013].[dbo].[Person] delete from [UFDATA_001_2013].[dbo].[fitem] delete from [UFDATA_001_2013].[dbo].[fitemss97class] delete from [UFDATA_001_2013].[dbo].[fitemss97] delete from [UFDATA_001_2013].[dbo].[GL_accvouch] delete from [UFDATA_001_2013].[dbo].[GL_accsum] delete from [UFDATA_001_2013].[dbo].[GL_accass] delete from [UFDATA_001_2013].[dbo].[vendorClass] delete from [UFDATA_001_2013].[dbo].[vendor] delete from [UFDATA_001_2013].[dbo].[hr_hi_person] go --插入凭证类别 insert into [UFDATA_001_2013].[dbo].[dsign](csign,isignseq,ctext,itype,iotherused) select csign,isignseq,ctext,itype,iotherused from [ufdata_006_2013].[dbo].[dsign] go --插入凭证类别 --插入会计科目 INSERT INTO [UFDATA_001_2013].[dbo].[code]([cclass], [cclass_engl], [cclassany], [cclassany_engl], [ccode], [ccode_name], [ccode_engl], [igrade], [bproperty], [cbook_type], [cbook_type_engl], [chelp], [cexch_name], [cmeasure], [bperson], [bcus], [bsup], [bdept], [bitem], [cass_item], [br], [be], [cgather], [bend], [bexchange], [bcash], [bbank], [bused], [bd_c], [dbegin], [dend], [itrans], [bclose], [cother], [iotherused], [bcDefine1], [bcDefine2], [bcDefine3], [bcDefine4], [bcDefine5], [bcDefine6], [bcDefine7], [bcDefine8], [bcDefine9], [bcDefine10], [iViewItem], [bGCJS], [bCashItem]) SELECT [cclass], [cclass_engl], [cclassany], [cclassany_engl], [ccode], [ccode_name], [ccode_engl], [igrade], [bproperty], [cbook_type], [cbook_type_engl], [chelp], [cexch_name], [cmeasure], [bperson], [bcus], [bsup], [bdept], [bitem], [cass_item], [br], [be], [cgather], [bend], [bexchange], [bcash], [bbank], [bused], [bd_c], [dbegin], [dend], [itrans], [bclose], [cother], [iotherused], [bcDefine1], [bcDefine2], [bcDefine3], [bcDefine4], [bcDefine5], [bcDefine6], [bcDefine7], [bcDefine8], [bcDefine9], [bcDefine10], [iViewItem], [bGCJS], [bCashItem] FROM [ufdata_006_2013].[dbo].[code] /*where  iyear=2015  年度库时使用 */ go --插入会计科目 --客户分类 INSERT INTO [UFDATA_001_2013].[dbo].[CustomerClass]([cCCCode], [cCCName], [iCCGrade], [bCCEnd]) SELECT [cCCCode], [cCCName], [iCCGrade], [bCCEnd] FROM [ufdata_006_2013].[dbo].[CustomerClass] go --客户分类 --客户档案 INSERT INTO [UFDATA_001_2013].[dbo].[Customer] ([cCusCode],[cCusName],[cCusAbbName],[cCCCode],[cDCCode],[cTrade],[cCusAddress],[cCusPostCode],[cCusRegCode], [cCusBank],[cCusAccount],[dCusDevDate],[cCusLPerson],[cCusEmail],[cCusPerson],[cCusPhone],[cCusFax],[cCusBP], [cCusHand],[cCusPPerson],[iCusDisRate],[cCusCreGrade],[iCusCreLine],[iCusCreDate],[cCusPayCond],[cCusOAddress], [cCusOType],[cCusHeadCode],[cCusWhCode],[cCusDepart],[iARMoney],[dLastDate],[iLastMoney],[dLRDate],[iLRMoney], [dEndDate],[iFrequency],[cCusDefine1],[cCusDefine2],[cCusDefine3],[iCostGrade]) SELECT [cCusCode],[cCusName],[cCusAbbName],[cCCCode],[cDCCode],[cTrade],[cCusAddress],[cCusPostCode],[cCusRegCode], [cCusBank],[cCusAccount],[dCusDevDate],[cCusLPerson],[cCusEmail],[cCusPerson],[cCusPhone],[cCusFax],[cCusBP], [cCusHand],[cCusPPerson],[iCusDisRate],[cCusCreGrade],[iCusCreLine],[iCusCreDate],[cCusPayCond],[cCusOAddress], [cCusOType],[cCusHeadCode],[cCusWhCode],[cCusDepart],[iARMoney],[dLastDate],[iLastMoney],[dLRDate],[iLRMoney], [dEndDate],[iFrequency],[cCusDefine1],[cCusDefine2],[cCusDefine3],[iCostGrade] FROM [ufdata_006_2013].[dbo].[Customer] go --供应商分类 insert into [ufdata_001_2013].[dbo].[vendorclass]( cVCCode,cVCName,iVCGrade,bVCEnd) select cVCCode,cVCName,iVCGrade,bVCEnd from [ufdata_006_2013].[dbo].[vendorclass] go --供应商分类 --供应商档案 INSERT INTO [UFDATA_001_2013].[dbo].[Vendor]( [cVenCode],[cVenName],[cVenAbbName],[cVCCode],[cDCCode],[cTrade],[cVenAddress],[cVenPostCode],[cVenRegCode],[cVenBank], [cVenAccount],[dVenDevDate],[cVenLPerson],[cVenPhone],[cVenFax],[cVenEmail],[cVenPerson],[cVenBP],[cVenHand],[cVenPPerson], [iVenDisRate],[iVenCreGrade],[iVenCreLine],[iVenCreDate],[cVenPayCond],[cVenIAddress],[cVenIType],[cVenHeadCode],[cVenWhCode], [cVenDepart],[iAPMoney],[dLastDate],[iLastMoney],[dLRDate],[iLRMoney],[dEndDate],[iFrequency],[bVenTax],[cVenDefine1], [cVenDefine2],[cVenDefine3]) SELECT [cVenCode],[cVenName],[cVenAbbName],[cVCCode],[cDCCode],[cTrade],[cVenAddress],[cVenPostCode],[cVenRegCode],[cVenBank], [cVenAccount],[dVenDevDate],[cVenLPerson],[cVenPhone],[cVenFax],[cVenEmail],[cVenPerson],[cVenBP],[cVenHand],[cVenPPerson], [iVenDisRate],[iVenCreGrade],[iVenCreLine],[iVenCreDate],[cVenPayCond],[cVenIAddress],[cVenIType],[cVenHeadCode],[cVenWhCode], [cVenDepart],[iAPMoney],[dLastDate],[iLastMoney],[dLRDate],[iLRMoney],[dEndDate],[iFrequency],[bVenTax],[cVenDefine1], [cVenDefine2],[cVenDefine3] FROM [ufdata_006_2013].[dbo].[Vendor] go --供应商档案 --部门档案 INSERT INTO [UFDATA_001_2013].[dbo].[Department] ([cDepCode], [bDepEnd], [cDepName], [iDepGrade], [cDepPerson], [cDepProp], [cDepPhone], [cDepAddress], [cDepMemo]) SELECT [cDepCode], [bDepEnd], [cDepName], [iDepGrade], [cDepPerson], [cDepProp], [cDepPhone], [cDepAddress], [cDepMemo] FROM [ufdata_006_2013].[dbo].[Department] go INSERT INTO [UFDATA_001_2013].[dbo].[fa_Departments] (sNum,sName,sParentNum,sNum1,bSumDepr,iLevel,iDefinetype) select  cdepcode,cdepname,'',cdepcode,1,1,1 from [UFDATA_001_2013].[dbo].[department] go --部门档案 --职员档案 INSERT INTO [UFDATA_001_2013].[dbo].[Person]( [cPersonCode], [cPersonName], [cDepCode], [cPersonProp]) SELECT [cPersonCode], [cPersonName], [cDepCode], [cPersonProp] FROM [ufdata_006_2013].[dbo].[Person] go --职员档案
--项目大类 insert into [UFDATA_001_2013].[dbo].[fitem](citem_class,citem_name,citem_text,crule,ctable,cclasstable) select citem_class,citem_name,citem_text,crule,ctable,cclasstable from [ufdata_006_2013].[dbo].[fitem] go --项目大类 --项目分类 insert into [UFDATA_001_2013].[dbo].[fitemss97class]( cItemCcode,cItemCname,iItemCgrade,bItemCend) select cItemCcode,cItemCname,iItemCgrade,bItemCend from [ufdata_006_2013].[dbo].[fitemss97class] go --项目分类 --项目档案 insert into [UFDATA_001_2013].[dbo].[fitemss97]( citemcode,citemname,bclose,citemccode,iotherused,dEndDate) select citemcode,citemname,bclose,citemccode,iotherused,dEndDate from [ufdata_006_2013].[dbo].[fitemss97] go --项目档案
--凭证 INSERT INTO [UFDATA_001_2013].[dbo].[GL_accvouch]( [iperiod], [csign], [isignseq], [ino_id], [inid], [dbill_date], [idoc], [cbill], [ccheck], [cbook], [ibook], [ccashier], [iflag], [ctext1], [ctext2], [cdigest], [ccode], [cexch_name], [md], [mc], [md_f], [mc_f], [nfrat], [nd_s], [nc_s], [csettle], [cn_id], [dt_date], [cdept_id], [cperson_id], [ccus_id], [csup_id], [citem_id], [citem_class], [cname], [ccode_equal], [iflagbank], [iflagPerson], [bdelete], [coutaccset], [ioutyear], [coutsysname], [coutsysver], [doutbilldate], [ioutperiod], [coutsign], [coutno_id], [doutdate], [coutbillsign], [coutid], [bvouchedit], [bvouchAddordele], [bvouchmoneyhold], [bvalueedit], [bcodeedit], [ccodecontrol], [bPCSedit], [bDeptedit], [bItemedit], [bCusSupInput], [cDefine1], [cDefine2], [cDefine3], [cDefine4], [cDefine5], [cDefine6], [cDefine7], [cDefine8], [cDefine9], [cDefine10]) SELECT [iperiod], [csign], [isignseq], [ino_id], [inid], [dbill_date], [idoc], [cbill], [ccheck], [cbook], [ibook], [ccashier], [iflag], [ctext1], [ctext2], [cdigest], [ccode], [cexch_name], [md], [mc], [md_f], [mc_f], [nfrat], [nd_s], [nc_s], [csettle], [cn_id], [dt_date], [cdept_id], [cperson_id], [ccus_id], [csup_id], [citem_id], [citem_class], [cname], [ccode_equal], [iflagbank], [iflagPerson], [bdelete], [coutaccset], [ioutyear], [coutsysname], [coutsysver], [doutbilldate], [ioutperiod], [coutsign], [coutno_id], [doutdate], [coutbillsign], [coutid], [bvouchedit], [bvouchAddordele], [bvouchmoneyhold], [bvalueedit], [bcodeedit], [ccodecontrol], [bPCSedit], [bDeptedit], [bItemedit], [bCusSupInput], [cDefine1], [cDefine2], [cDefine3], [cDefine4], [cDefine5], [cDefine6], [cDefine7], [cDefine8], [cDefine9], [cDefine10] FROM [ufdata_006_2013].[dbo].[GL_accvouch] /*where  iyear=2015  年度库时使用 */ go --凭证 --凭证1 INSERT INTO [UFDATA_001_2013].[dbo].[GL_accsum]( [ccode], [cexch_name], [iperiod], [cbegind_c], [cbegind_c_engl], [mb], [md], [mc], [cendd_c], [cendd_c_engl], [me], [mb_f], [md_f], [mc_f], [me_f], [nb_s], [nd_s], [nc_s], [ne_s]) SELECT [ccode], [cexch_name], [iperiod], [cbegind_c], [cbegind_c_engl], [mb], [md], [mc], [cendd_c], [cendd_c_engl], [me], [mb_f], [md_f], [mc_f], [me_f], [nb_s], [nd_s], [nc_s], [ne_s] FROM [ufdata_006_2013].[dbo].[GL_accsum] /*where  iyear=2015  年度库时使用 */ go --凭证1 --凭证2 INSERT INTO [UFDATA_001_2013].[dbo].[GL_accass]( [ccode], [cexch_name], [cdept_id], [cperson_id], [ccus_id], [csup_id], [citem_class], [citem_id], [iperiod], [cbegind_c], [cbegind_c_engl], [mb], [md], [mc], [cendd_c], [cendd_c_engl], [me], [mb_f], [md_f], [mc_f], [me_f], [nb_s], [nd_s], [nc_s], [ne_s]) SELECT [ccode], [cexch_name], [cdept_id], [cperson_id], [ccus_id], [csup_id], [citem_class], [citem_id], [iperiod], [cbegind_c], [cbegind_c_engl], [mb], [md], [mc], [cendd_c], [cendd_c_engl], [me], [mb_f], [md_f], [mc_f], [me_f], [nb_s], [nd_s], [nc_s], [ne_s] FROM [ufdata_006_2013].[dbo].[GL_accass] /*where  iyear=2015  年度库时使用 */ go --凭证2 ---更新结帐标记为记帐 UPDATE [UFDATA_001_2013].dbo.GL_mend  SET bflag='True' go ---更新结帐标记为记帐 --现金流量 delete from [UFDATA_001_2013].[dbo].[GL_CashTable] go INSERT INTO [UFDATA_001_2013].[dbo].[GL_CashTable]( [iPeriod], [iSignSeq], [iNo_id], [inid], [cCashItem], [md], [mc]) select a.iperiod,a.isignseq,a.ino_id,a.inid,b.cCashItem,b.md,b.mc from  [ufdata_006_2013].[dbo].[GL_accvouch] a,[ufdata_006_2013].[dbo].[GL_CashTable] b where a.iperiod=b.iperiod and a.isignseq=b.isignseq and a.iNo_id=b.iNo_id and a.inid=b.inid go --现金流量