北京用友

用友软件

用友财务软件

用友软件促销热线
当前位置:首页 > 客户自助 > 年末结转专题

限时抢购

联系我们
   在线客服:
   销售热线:
北京总部 010- 86398138
                010- 51295018                 
   技术支持:
北京总部 010- 51297518
站内搜索
类 型:
关键字:
用友U821版年末结转记录

一家用友U821版本的用户年末结转的记录,大多数企业每年业务需要结账了,财务工作还没结束,8.21不支持录入下年单据,因此结转时需要注意结转的步骤,该客户是商业企业,帐套号001,年末使用一个临时帐套500,财务结转后用远程传递把临时帐套的单据导入。

2006年末结转说明:

2006-12-23 进销存结帐

一 001帐套结帐准备  
1 修改累计出库数量错误

现存量检查     ——是个检查现存量与累计出库数的SQL,我们两个仓库,批次管理的商品经常发生累计出库数漏加,原因应该是发票审核调用的存储过程有漏洞。
 
SELECT Inventory.cInvCode AS 编号, Inventory.cInvName AS 品名, JC.W1JC AS w1结存,
      cs.w1 AS w1现存量, JC.W1JC - cs.w1 AS w1结存减现存, JC.W2JC AS w2结存,
      cs.w2 AS w2现存量, JC.W2JC - cs.w2 AS w2结存减现存
FROM (SELECT RdRecords.cInvCode,
              SUM(CASE WHEN RdRecord.cWhcode = '01' THEN ABS(RdRecords.iQuantity)
              - RdRecords.iSOutQuantity END) AS W1JC,
              SUM(CASE WHEN RdRecord.cWhcode = '02' THEN ABS(RdRecords.iQuantity)
              - RdRecords.iSOutQuantity END) AS W2JC
        FROM RdRecord INNER JOIN
              RdRecords ON RdRecord.ID = RdRecords.ID
        WHERE ((RdRecord.bRdFlag = 1) AND (RdRecords.iQuantity > 0)) OR
              ((RdRecord.bRdFlag = 0) AND (RdRecords.iQuantity < 0))
        GROUP BY RdRecords.cInvCode) JC RIGHT OUTER JOIN
      Inventory ON Inventory.cInvCode = JC.cInvCode LEFT OUTER JOIN
          (SELECT cInvCode, SUM(CASE WHEN cWhcode = '01' THEN iQuantity END) AS W1,
               SUM(CASE WHEN cWhcode = '02' THEN iQuantity END) AS W2
         FROM CurrentStock
         GROUP BY cInvCode) AS CS ON Inventory.cInvCode = CS.cInvCode
WHERE (JC.w1JC - cs.w1 > 0.000001) OR
      (JC.w1JC - cs.w1 < - 0.000001) OR
      (JC.w2JC - cs.w2 > 0.000001) OR
      (JC.w2JC - cs.w2 < - 0.000001)
ORDER BY Inventory.cInvCode

——最好每月结账前检查一次,每月结时错误的发票弃审重选一下批次就改过来了。

二 备份数据

销售、采购、库存结账
存货核算记账
年度备份 2006

三 引入整备份复制一个帐套500帐套号 

四 引入2006年度备份改帐套号500

500_2006帐套覆盖后丢失SYSTEM数据  ——有时会发生,可能是帐套id的原因,登录时看不到年度就是了
 
INSERT INTO [UA_Period]
      (cAcc_Id, iYear, iId, dBegin, dEnd, bIsDelete)
SELECT '500', '2006', iId, dBegin, dEnd, bIsDelete
FROM UA_Period
WHERE (cAcc_Id = '001') AND (iYear = '2006')

五 500帐套结存货核算
存货核算期末处理  报有未暂估入库单不能期末处理

——期间有提示,不过最后一个月才不允许期末处理,暂估处理都作了,使用单到补差。以前查过数据,都是一些不需要补价的单据,可能是因为多张发票入库单结算的原因,反正是期末处理与暂估处理对结算单据的判断不一致。

UPDATE PurSettleVouchs
SET bAccount = 1
WHERE (iRdsID <> 0) AND (bAccount = 0)

——改成这样期末处理就可以做了

六 建500_2007帐套 结转购销链

备份存货表Inventory 名称Inventory_20061223
  ——存货自定义项宽度不够,改过字段大小,建账用的是模版数据库,字段大小需改回不然结转档案会失败,建账后再改大就行了

改回字段大小,用备份更新存货表

UPDATE Inventory
SET Inventory.cInvDefine1 = UFDATA_500_2006.dbo.Inventory_20061223.cInvDefine1,
      cInvDefine2 = UFDATA_500_2006.dbo.Inventory_20061223.cInvDefine2
FROM Inventory INNER JOIN
      UFDATA_500_2006.dbo.Inventory_20061223 ON
      Inventory.cInvCode = UFDATA_500_2006.dbo.Inventory_20061223.cInvCode

七设置临时权限

DELETE FROM UA_HoldAuth
WHERE (cAcc_Id = '500') AND (iYear = 2007)


INSERT INTO [UA_HoldAuth]
      (cAcc_Id, iYear, cUser_Id, cAuth_Id)
SELECT '500', 2007, cUser_Id, cAuth_Id
FROM UA_HoldAuth
WHERE (cAcc_Id = '001') AND (iYear = 2006)


删除 001 入库单 其它出入库单权限  ——避免001帐套rd表添加记录
DELETE FROM UA_HoldAuth
WHERE (cAcc_Id = '001') AND (iYear = 2006) AND (cAuth_Id = 'asm0102' OR
      cAuth_Id = 'asm0502' OR
      cAuth_Id = 'asm0602')

复制销售选项  ——不会自动转至新年度,设置很麻烦是独占操作,却需要每台终端都设一遍
SA_INIMain: 001_2006
INSERT INTO UFDATA_500_2007.dbo.SA_INIMain
SELECT *
FROM SA_INIMain

SA_INISub: 001_2006
INSERT INTO UFDATA_500_2007.dbo.SA_INISub
SELECT *
FROM SA_INISub

查询最大销售发票号码

——贴张纸条,通知制票员,改用500帐套,第一张发票手工录入最大发票号 不然财务结转时有重复

2007-1-6 财务结帐

一 现存量检查   

二 001帐套结存货核算结帐
1.存货核算 期末处理

2.检查采购结算后RDS未写入数据   
SELECT *
FROM PurSettleVouchs INNER JOIN
      RdRecords ON PurSettleVouchs.iRdsID = RdRecords.AutoID
WHERE (PurSettleVouchs.iSVQuantity <> 0) AND
      (PurSettleVouchs.iSVQuantity <> PurSettleVouchs.iSVQuantity)

检查正确

采购结算写入RDS检查  ——只是看一下有没有部分结算的入库单,821可以部分结算,我们不允许用,因为821部分结算是按照入库单价*结算数量作为结算金额,分次结算可能出现尾差,其实一笔入库完成最后一次结算应该按暂估金额-结算金额

SELECT RdRecords.*
FROM RdRecords
WHERE iSQuantity <> 0 AND iSQuantity <> iQuantity

3.检查存货与总账对帐
 
未通过

——可能库存调拨单造成的,存货中并没有调拨单,是一出一入两张单据,财务部因为没有对方科目可用就把调拨对方科目设为了库存核算科目(这样生成的凭证更像调拨单),存货制单对方科目是不可以使用受控科目的,根据收发类别自动带出的却可以用,单据漏填收发类别时就麻烦了

4.001_2006现存量检查

5.存货12月结帐
提示有未生成凭证单据  可能为金额0单据,又是制单和月末结帐检查不一致
未处理直接结帐


6.总帐结帐

7.采购余额检查  ——咱只有一个采购类型,只用RdRecord.cSource = '采购' 就够了
SELECT SUM(rdrecords.iaprice)
FROM RdRecord INNER JOIN
      RdRecords ON RdRecord.ID = RdRecords.ID
WHERE (RdRecords.iSQuantity = 0) AND (RdRecord.cSource = '采购') AND
      (RdRecord.cBusType = '普通采购')

总数为 118997339.06
采购管理货先到明细表 118997339.06
存货12月暂估余额 118997339.06

——采购管理货先到明细表  跟上面查的应该不会不同,存货可不一定,以前的版本错过,821没发现

8.修改年末采购结转程序错误:

——结转后将产生错误单据(RdRecord.cSource =采购,RdRecord.cVouchType = '34'),此类单据(结存为0的会漏转,不为0会结转为下年期初库存,采购系统不能使用)。原因是这样的,821年末购销结转是先库存后采购,只要是结存不为0的单据就会结转为期初库存,然后才是暂估单据结转,上年帐套中暂估且有结存的单据就变成上面的样子,本年不会影响使用,因为采购的判断标准使用RdRecord.cSource,年末结转判断是使用RdRecord.cVouchType就出了问题。

修改RdRecord.cVouchType为33
UPDATE RdRecord
SET RdRecord.cVouchType = '33'
FROM RdRecord INNER JOIN
      RdRecords ON RdRecord.ID = RdRecords.ID
WHERE (RdRecords.iSQuantity = 0) AND (RdRecord.dDate < CONVERT(DATETIME,
      '2007-01-01 00:00:00', 102)) AND (RdRecord.cSource = '采购') AND
      (RdRecord.cBusType = '普通采购') AND (RdRecord.cVouchType = '34')

9. 备份001_2006  
 
10. 存货表改字段设置
001建2007年度帐

11.001转购销链

12.采购余额检查001_2007   ——还是不放心
总数为 118997339.06

采购管理货先到明细表 118997339.06
存货1月余额 118997339.06

与2006期末余额相符

2007存在下一年结转后将产生错误单据(RdRecord.cSource =采购,RdRecord.cVouchType = '34') 未处理

13.存货字段改回

14.001现存量检查通过

15.500修改累计出库数量错误
   500现存量检查

16.导入库存单据前检查
比较001_2006-500_2006最大单号表 无异常


500与001重RdRecords.AutoID单据

SELECT RdRecord.*, RdRecords.*
FROM UFDATA_001_2007.dbo.RdRecords INNER JOIN
      UFDATA_001_2007.dbo.RdRecord ON
      UFDATA_001_2007.dbo.RdRecords.ID = UFDATA_001_2007.dbo.RdRecord.ID AND
      UFDATA_001_2007.dbo.RdRecords.ID = UFDATA_001_2007.dbo.RdRecord.ID INNER JOIN
      RdRecord INNER JOIN
      RdRecords ON RdRecord.ID = RdRecords.ID ON
      UFDATA_001_2007.dbo.RdRecords.AutoID = RdRecords.AutoID
WHERE (RdRecord.dDate >= CONVERT(DATETIME, '2007-01-01 00:00:00', 102))

500与001重ID单据

SELECT RdRecord.*, RdRecords.*
FROM UFDATA_001_2007.dbo.RdRecords INNER JOIN
      UFDATA_001_2007.dbo.RdRecord ON
      UFDATA_001_2007.dbo.RdRecords.ID = UFDATA_001_2007.dbo.RdRecord.ID AND
      UFDATA_001_2007.dbo.RdRecords.ID = UFDATA_001_2007.dbo.RdRecord.ID INNER JOIN
      RdRecord INNER JOIN
      RdRecords ON RdRecord.ID = RdRecords.ID ON
      UFDATA_001_2007.dbo.RdRecord.ID = RdRecord.ID
WHERE (RdRecord.dDate >= CONVERT(DATETIME, '2007-01-01 00:00:00', 102))

500与001重cCode单据——不同仓库是可以重号的

SELECT RdRecord.*, RdRecords.*
FROM UFDATA_001_2007.dbo.RdRecords INNER JOIN
      UFDATA_001_2007.dbo.RdRecord ON
      UFDATA_001_2007.dbo.RdRecords.ID = UFDATA_001_2007.dbo.RdRecord.ID AND
      UFDATA_001_2007.dbo.RdRecords.ID = UFDATA_001_2007.dbo.RdRecord.ID INNER JOIN
      RdRecord INNER JOIN
      RdRecords ON RdRecord.ID = RdRecords.ID ON
      UFDATA_001_2007.dbo.RdRecord.cCode = RdRecord.cCode
WHERE (RdRecord.dDate >= CONVERT(DATETIME, '2007-01-01 00:00:00', 102))

——本次结帐无异常 我也该运气好一回了 如果有重号单据应该修改500中数据

17.导入500单据
——销售单据直接由500导入

导入发票主表
INSERT INTO UFDATA_001_2007.dbo.SaleBillVouch
SELECT SaleBillVouch.*
FROM SaleBillVouch

导入发票子表
INSERT INTO UFDATA_001_2007.dbo.SaleBillVouchs
SELECT SaleBillVouchs.*
FROM SaleBillVouchs

导入发货主表
INSERT INTO UFDATA_001_2007.dbo.DispatchList
SELECT DispatchList.*
FROM DispatchList

导入发货子表
需先更改自动标识字段
INSERT INTO UFDATA_001_2007.dbo.DispatchLists
SELECT DispatchLists.*
FROM DispatchLists

导入销售选项
INSERT INTO UFDATA_001_2007.dbo.SA_INIMain
SELECT SA_INIMain.*
FROM SA_INIMain


导入销售选项子表
INSERT INTO UFDATA_001_2007.dbo.SA_INISub
SELECT SA_INISub.*
FROM SA_INISub

改001发票累计发货数 ——因此表有触发器,导入出库单时会重添此数值
UPDATE SaleBillVouchs
SET fOutQuantity = 0

——下面用库存管理的远程传递功能将库存单据导入,因批次不能0出库要注意顺序

导入兰入库单

导入红出库

导入兰其他入库

修改待出入库数   ——反正我的都应该是0
UPDATE CurrentStock
SET fOutQuantity = 0, fInQuantity = 0

导入蓝销售


导入红入库


导入兰其他出库

比较 001  500 库存单据数量正确

18. 档案更新
比较001 500 存货   客户   供货商   数量正确
以500更新001客户档案
UPDATE Customer
SET cCusName = UFDATA_500_2007.dbo.Customer.cCusName,
      cCusAbbName = UFDATA_500_2007.dbo.Customer.cCusAbbName,
      cCCCode = UFDATA_500_2007.dbo.Customer.cCCCode,
      cDCCode = UFDATA_500_2007.dbo.Customer.cDCCode,
      cTrade = UFDATA_500_2007.dbo.Customer.cTrade,
      cCusAddress = UFDATA_500_2007.dbo.Customer.cCusAddress,
      cCusPostCode = UFDATA_500_2007.dbo.Customer.cCusPostCode,
      cCusRegCode = UFDATA_500_2007.dbo.Customer.cCusRegCode,
      cCusBank = UFDATA_500_2007.dbo.Customer.cCusBank,
      cCusAccount = UFDATA_500_2007.dbo.Customer.cCusAccount,
      dCusDevDate = UFDATA_500_2007.dbo.Customer.dCusDevDate,
      cCusLPerson = UFDATA_500_2007.dbo.Customer.cCusLPerson,
      cCusEmail = UFDATA_500_2007.dbo.Customer.cCusEmail,
      cCusPerson = UFDATA_500_2007.dbo.Customer.cCusPerson,
      cCusPhone = UFDATA_500_2007.dbo.Customer.cCusPhone,
      cCusFax = UFDATA_500_2007.dbo.Customer.cCusFax,
      cCusBP = UFDATA_500_2007.dbo.Customer.cCusBP,
      cCusHand = UFDATA_500_2007.dbo.Customer.cCusHand,
      cCusPPerson = UFDATA_500_2007.dbo.Customer.cCusPPerson,
      iCusDisRate = UFDATA_500_2007.dbo.Customer.iCusDisRate,
      cCusCreGrade = UFDATA_500_2007.dbo.Customer.cCusCreGrade,
      iCusCreLine = UFDATA_500_2007.dbo.Customer.iCusCreLine,
      iCusCreDate = UFDATA_500_2007.dbo.Customer.iCusCreDate,
      cCusPayCond = UFDATA_500_2007.dbo.Customer.cCusPayCond,
      cCusOAddress = UFDATA_500_2007.dbo.Customer.cCusOAddress,
      cCusOType = UFDATA_500_2007.dbo.Customer.cCusOType,
      cCusHeadCode = UFDATA_500_2007.dbo.Customer.cCusHeadCode,
      cCusWhCode = UFDATA_500_2007.dbo.Customer.cCusWhCode,
      cCusDepart = UFDATA_500_2007.dbo.Customer.cCusDepart,
      iARMoney = UFDATA_500_2007.dbo.Customer.iARMoney,
      dLastDate = UFDATA_500_2007.dbo.Customer.dLastDate,
      iLastMoney = UFDATA_500_2007.dbo.Customer.iLastMoney,
      dLRDate = UFDATA_500_2007.dbo.Customer.dLRDate,
      iLRMoney = UFDATA_500_2007.dbo.Customer.iLRMoney,
      dEndDate = UFDATA_500_2007.dbo.Customer.dEndDate,
      iFrequency = UFDATA_500_2007.dbo.Customer.iFrequency,
      cCusDefine1 = UFDATA_500_2007.dbo.Customer.cCusDefine1,
      cCusDefine2 = UFDATA_500_2007.dbo.Customer.cCusDefine2,
      cCusDefine3 = UFDATA_500_2007.dbo.Customer.cCusDefine3,
      iCostGrade = UFDATA_500_2007.dbo.Customer.iCostGrade
FROM Customer INNER JOIN
      UFDATA_500_2007.dbo.Customer ON
      Customer.cCusCode = UFDATA_500_2007.dbo.Customer.cCusCode
以500更新001供应商档案
UPDATE Vendor
SET cVenCode = UFDATA_500_2007.dbo. Vendor .cVenCode,
      cVenName = UFDATA_500_2007.dbo. Vendor .cVenName,
      cVenAbbName = UFDATA_500_2007.dbo. Vendor .cVenAbbName,
      cVCCode = UFDATA_500_2007.dbo. Vendor .cVCCode,
      cDCCode = UFDATA_500_2007.dbo. Vendor .cDCCode,
      cTrade = UFDATA_500_2007.dbo. Vendor .cTrade,
      cVenAddress = UFDATA_500_2007.dbo. Vendor .cVenAddress,
      cVenPostCode = UFDATA_500_2007.dbo. Vendor .cVenPostCode,
      cVenRegCode = UFDATA_500_2007.dbo. Vendor .cVenRegCode,
      cVenBank = UFDATA_500_2007.dbo. Vendor .cVenBank,
      cVenAccount = UFDATA_500_2007.dbo. Vendor .cVenAccount,
      dVenDevDate = UFDATA_500_2007.dbo. Vendor .dVenDevDate,
      cVenPhone = UFDATA_500_2007.dbo. Vendor .cVenPhone,
      cVenLPerson = UFDATA_500_2007.dbo. Vendor .cVenLPerson,
      cVenFax = UFDATA_500_2007.dbo. Vendor .cVenFax,
      cVenEmail = UFDATA_500_2007.dbo. Vendor .cVenEmail,
      cVenPerson = UFDATA_500_2007.dbo. Vendor .cVenPerson,
      cVenBP = UFDATA_500_2007.dbo. Vendor .cVenBP,
      cVenHand = UFDATA_500_2007.dbo. Vendor .cVenHand,
      cVenPPerson = UFDATA_500_2007.dbo. Vendor .cVenPPerson,
      iVenDisRate = UFDATA_500_2007.dbo. Vendor .iVenDisRate,
      iVenCreLine = UFDATA_500_2007.dbo. Vendor .iVenCreLine,
      iVenCreGrade = UFDATA_500_2007.dbo. Vendor .iVenCreGrade,
      iVenCreDate = UFDATA_500_2007.dbo. Vendor .iVenCreDate,
      cVenPayCond = UFDATA_500_2007.dbo. Vendor .cVenPayCond,
      cVenIAddress = UFDATA_500_2007.dbo. Vendor .cVenIAddress,
      cVenIType = UFDATA_500_2007.dbo. Vendor .cVenIType,
      cVenHeadCode = UFDATA_500_2007.dbo. Vendor .cVenHeadCode,
      cVenWhCode = UFDATA_500_2007.dbo. Vendor .cVenWhCode,
      cVenDepart = UFDATA_500_2007.dbo. Vendor .cVenDepart,
      iAPMoney = UFDATA_500_2007.dbo. Vendor .iAPMoney,
      iLastMoney = UFDATA_500_2007.dbo. Vendor .iLastMoney,
      dLRDate = UFDATA_500_2007.dbo. Vendor .dLRDate,
      dLastDate = UFDATA_500_2007.dbo. Vendor .dLastDate,
      iLRMoney = UFDATA_500_2007.dbo. Vendor .iLRMoney,
      dEndDate = UFDATA_500_2007.dbo. Vendor .dEndDate,
      iFrequency = UFDATA_500_2007.dbo. Vendor .iFrequency,
      bVenTax = UFDATA_500_2007.dbo. Vendor .bVenTax,
      cVenDefine1 = UFDATA_500_2007.dbo. Vendor .cVenDefine1,
      cVenDefine2 = UFDATA_500_2007.dbo. Vendor .cVenDefine2,
      cVenDefine3 = UFDATA_500_2007.dbo. Vendor .cVenDefine3
FROM Vendor INNER JOIN
      UFDATA_500_2007.dbo. Vendor ON
      Vendor .cVenCode = UFDATA_500_2007.dbo. Vendor .cVenCode

以500存货档案更新001——先要取消I_id自动编号,这个字段不知干什么用的,保险起见也一起更新吧UPDATE Inventory
SET Inventory.cInvAddCode = UFDATA_500_2007.dbo.Inventory.cInvAddCode,
      Inventory.cInvName = UFDATA_500_2007.dbo.Inventory.cInvName,
      Inventory.cInvStd = UFDATA_500_2007.dbo.Inventory.cInvStd,
      Inventory.cInvCCode = UFDATA_500_2007.dbo.Inventory.cInvCCode,
      Inventory.cVenCode = UFDATA_500_2007.dbo.Inventory.cVenCode,
      Inventory.cInvM_Unit = UFDATA_500_2007.dbo.Inventory.cInvM_Unit,
      Inventory.cInvA_Unit = UFDATA_500_2007.dbo.Inventory.cInvA_Unit,
      Inventory.cReplaceItem = UFDATA_500_2007.dbo.Inventory.cReplaceItem,
      Inventory.cPosition = UFDATA_500_2007.dbo.Inventory.cPosition,
      Inventory.bSale = UFDATA_500_2007.dbo.Inventory.bSale,
      Inventory.bPurchase = UFDATA_500_2007.dbo.Inventory.bPurchase,
      Inventory.bSelf = UFDATA_500_2007.dbo.Inventory.bSelf,
      Inventory.bComsume = UFDATA_500_2007.dbo.Inventory.bComsume,
      Inventory.bProducing = UFDATA_500_2007.dbo.Inventory.bProducing,
      Inventory.bService = UFDATA_500_2007.dbo.Inventory.bService,
      Inventory.bAccessary = UFDATA_500_2007.dbo.Inventory.bAccessary,
      Inventory.iInvExchRate = UFDATA_500_2007.dbo.Inventory.iInvExchRate,
      Inventory.iTaxRate = UFDATA_500_2007.dbo.Inventory.iTaxRate,
      Inventory.iInvWeight = UFDATA_500_2007.dbo.Inventory.iInvWeight,
      Inventory.iVolume = UFDATA_500_2007.dbo.Inventory.iVolume,
      Inventory.iInvRCost = UFDATA_500_2007.dbo.Inventory.iInvRCost,
      Inventory.iInvSPrice = UFDATA_500_2007.dbo.Inventory.iInvSPrice,
      Inventory.iInvSCost = UFDATA_500_2007.dbo.Inventory.iInvSCost,
      Inventory.iInvLSCost = UFDATA_500_2007.dbo.Inventory.iInvLSCost,
      Inventory.iInvNCost = UFDATA_500_2007.dbo.Inventory.iInvNCost,
      Inventory.iInvAdvance = UFDATA_500_2007.dbo.Inventory.iInvAdvance,
      Inventory.iInvBatch = UFDATA_500_2007.dbo.Inventory.iInvBatch,
      Inventory.iSafeNum = UFDATA_500_2007.dbo.Inventory.iSafeNum,
      Inventory.iTopSum = UFDATA_500_2007.dbo.Inventory.iTopSum,
      Inventory.iLowSum = UFDATA_500_2007.dbo.Inventory.iLowSum,
      Inventory.iOverStock = UFDATA_500_2007.dbo.Inventory.iOverStock,
      Inventory.cInvABC = UFDATA_500_2007.dbo.Inventory.cInvABC,
      Inventory.bInvQuality = UFDATA_500_2007.dbo.Inventory.bInvQuality,
      Inventory.bInvBatch = UFDATA_500_2007.dbo.Inventory.bInvBatch,
      Inventory.bInvEntrust = UFDATA_500_2007.dbo.Inventory.bInvEntrust,
      Inventory.bInvOverStock = UFDATA_500_2007.dbo.Inventory.bInvOverStock,
      Inventory.dSDate = UFDATA_500_2007.dbo.Inventory.dSDate,
      Inventory.dEDate = UFDATA_500_2007.dbo.Inventory.dEDate,
      Inventory.bFree1 = UFDATA_500_2007.dbo.Inventory.bFree1,
      Inventory.bFree2 = UFDATA_500_2007.dbo.Inventory.bFree2,
      Inventory.cInvDefine1 = UFDATA_500_2007.dbo.Inventory.cInvDefine1,
      Inventory.cInvDefine2 = UFDATA_500_2007.dbo.Inventory.cInvDefine2,
      Inventory.cInvDefine3 = UFDATA_500_2007.dbo.Inventory.cInvDefine3,
      Inventory.bInvType = UFDATA_500_2007.dbo.Inventory.bInvType,
      Inventory.iInvMPCost = UFDATA_500_2007.dbo.Inventory.iInvMPCost,
      Inventory.cQuality = UFDATA_500_2007.dbo.Inventory.cQuality,
      Inventory.iInvSaleCost = UFDATA_500_2007.dbo.Inventory.iInvSaleCost,
      Inventory.iInvSCost1 = UFDATA_500_2007.dbo.Inventory.iInvSCost1,
      Inventory.iInvSCost2 = UFDATA_500_2007.dbo.Inventory.iInvSCost2,
      Inventory.iInvSCost3 = UFDATA_500_2007.dbo.Inventory.iInvSCost3,
      Inventory.I_id = UFDATA_500_2007.dbo.Inventory.I_id
FROM Inventory INNER JOIN
      UFDATA_500_2007.dbo.Inventory ON
      Inventory.cInvCode = UFDATA_500_2007.dbo.Inventory.cInvCode

19.备份001 2007年度 

20.应收应付结转准备 

发票号检查  ——汉字开头的,发票号与开票员相关可能会有,不改会结不过去

001_2006与001_2007重复发票 4827 条   ——821发票号不使用maxvouch,只查询最大发票号,不同时结应收和销售会出现重号,咱客户欠款期又这么长,通知了第一张要手工录入发票号的

SELECT *
FROM SaleBillVouch INNER JOIN
      Ap_Detail ON SaleBillVouch.cSBVCode = Ap_Detail.cVouchID AND
      SaleBillVouch.cVouchType = Ap_Detail.cVouchType INNER JOIN
      UFDATA_001_2007.dbo.SaleBillVouch ON
      SaleBillVouch.cSBVCode = UFDATA_001_2007.dbo.SaleBillVouch.cSBVCode AND
      SaleBillVouch.cVouchType = UFDATA_001_2007.dbo.SaleBillVouch.cVouchType
WHERE (Ap_Detail.cFlag = 'AR')

备份  001-2006 SaleBillVouch, Ap_Detail

处理SaleBillVouch
UPDATE SaleBillVouch
SET SaleBillVouch.cSBVCode = '4' + RIGHT(SaleBillVouch.cSBVCode,
      len(SaleBillVouch.cSBVCode) - 1)
FROM SaleBillVouch INNER JOIN
      Ap_Detail ON SaleBillVouch.cSBVCode = Ap_Detail.cVouchID AND
      SaleBillVouch.cVouchType = Ap_Detail.cVouchType INNER JOIN
      UFDATA_001_2007.dbo.SaleBillVouch ON
      SaleBillVouch.cSBVCode = UFDATA_001_2007.dbo.SaleBillVouch.cSBVCode AND
      SaleBillVouch.cVouchType = UFDATA_001_2007.dbo.SaleBillVouch.cVouchType
WHERE (Ap_Detail.cFlag = 'AR')

处理Ap_Detail
UPDATE Ap_Detail
SET Ap_Detail.cVouchID = '4' + RIGHT(Ap_Detail.cVouchID, len(Ap_Detail.cVouchID) - 1)
FROM SaleBillVouch_bak INNER JOIN
      Ap_Detail ON SaleBillVouch_bak.cSBVCode = Ap_Detail.cVouchID AND
      SaleBillVouch_bak.cVouchType = Ap_Detail.cVouchType INNER JOIN
      UFDATA_001_2007.dbo.SaleBillVouch ON
      SaleBillVouch_bak.cSBVCode = UFDATA_001_2007.dbo.SaleBillVouch.cSBVCode AND
      SaleBillVouch_bak.cVouchType = UFDATA_001_2007.dbo.SaleBillVouch.cVouchType
WHERE (Ap_Detail.cFlag = 'AR')

001_2006结算单关联发票号与2007重号 4847条
SELECT Ap_Detail.cVouchID AS AP_DT, Ap_Detail.cCoVouchID AS AP_DTCCO
FROM Ap_Detail INNER JOIN
      UFDATA_001_2007.dbo.SaleBillVouch ON
      Ap_Detail.cCoVouchID = UFDATA_001_2007.dbo.SaleBillVouch.cSBVCode AND
      Ap_Detail.cCoVouchType = UFDATA_001_2007.dbo.SaleBillVouch.cVouchType
WHERE (Ap_Detail.cFlag = 'AR')
ORDER BY Ap_Detail.cCoVouchID

处理Ap_Detail
UPDATE Ap_Detail
SET Ap_Detail.cVouchID = '4' + RIGHT(Ap_Detail.cVouchID, len(Ap_Detail.cVouchID) - 1),
      Ap_Detail.cCoVouchID = '4' + RIGHT(Ap_Detail.cCoVouchID,
      len(Ap_Detail.cCoVouchID) - 1)
FROM Ap_Detail INNER JOIN
      UFDATA_001_2007.dbo.SaleBillVouch ON
      Ap_Detail.cCoVouchID = UFDATA_001_2007.dbo.SaleBillVouch.cSBVCode AND
      Ap_Detail.cCoVouchType = UFDATA_001_2007.dbo.SaleBillVouch.cVouchType
WHERE (Ap_Detail.cFlag = 'AR')


21.应收应付结转

——如果重新结转应收应付,会提示上年已结转不能重复结转,需修改UA_Account_sub.bClosing

比较应收余额  ——必须做,少结转发票是不提示的

22.转总账 

23.备份001_2006

24. 会计科目期初余额

25.001_2007权限设置

复制权限sql  ——821没有组权限设置,只有这样了,一个个设很麻烦,别忘了删除权限以后再复制
INSERT INTO UA_HoldAuth
      (cAcc_Id, iYear, cUser_Id, cAuth_Id)
SELECT cAcc_Id, iYear, '复制人id' AS cuser_id, cAuth_Id
FROM UA_HoldAuth
WHERE (cAcc_Id = '001') AND (iYear = 2007) AND (cUser_Id = '被复制人id')

26.删除500权限

27.检查maxvouch

28.删除2005年度账

29.备份001_2007

 
阅读关于 用友软件   U821   年末结转的全部文章
【用友U8 Cloud】用友U8 Cloudn 3.1全产品报价清单(软...
【用友ERP U8+】用友ERP-U8+ V16.0全产品报价单
【用友ERP-T6】农业产品依靠用友T6软件实现新发展
【T+ Cloud】T+ Cloud改变企业管理模式 让企业数据清...
【资讯中心】再创佳绩 用友云2017 SaaS市场占有率第一...
【用友ERP U8+】用友U8+智能制造案例----黑旋风锯业股...
【用友ERP U8+】用友U8+智能制造案例----湖北雷迪特冷...
【用友ERP U8+】用友U8+智能制造案例----武汉盛帆电子...
【用友ERP U8+】用友U8+智能制造案例----奥英光电(苏...
【用友云产品】【U8cloud+友报账】为金仕达联合打造“...
【用友U8 Cloud】细说U8 cloud之合并报表篇
【用友ERP U8+】用友U8+智能制造案例----扬州亚星客车...
【用友云产品】古井集团:用友云营销服务构建数字化运...
【用友ERP U8+】用友U8+智能制造案例----金浦新材料股...
【用友ERP U8+】用友U8+智能制造案例----阿鲁克邦复合...
【资讯中心】用友网络云营收暴增,成本费用加大控制力...
【资讯中心】用友网络与传化智联战略签约 打造物流数字...
【用友ERP U8+】用友U8+智能制造案例----常州永盛新材...
【用友ERP U8+】用友U8+智能制造案例----苏州安特威阀...
【资讯中心】用友云市场登陆天津世界智能大会 生态布局...