[求助] 金蝶K3软件物流反初始化的SQL语句
作者:
积分:2313
等级:初中
经验值:318
威望:2050
发帖数:102
回帖数:7
精华数:102
注册时间:2008-11-24
在线时间:
金蝶K3软件物流反初始化的SQL语句
环境参数
WIN 2003 SQL2000
内 容
Drop procedure RestartSystem ----存在则删除之
Go
Create Procedure RestartSystem ---定义存储过程
AS
Declare @StartPeriod int,
@startyear int,
@CurStartDate varchar(20)
----处理余额和即时库存数据
Delete From ICBal
Delete From ICInvBal
Delete From ICInventory
Delete From ICInvInitial Where FPeriod>0
----取帐套启用时间
select @startyear=convert(int,FValue) from t_SystemProfile where FCategory='ic' and FKey='startyear'
select @startperiod=convert(int,FValue) from t_SystemProfile where FCategory='ic' and FKey='startperiod'
select @CurStartDate=convert(varchar(4),@startyear)+ '-' + convert(varchar(2),@startperiod)+'-'+'01'
---select @CurStartDate=convert(varchar,convert(datetime, @CurStartDate),110)
---select @CurStartDate=substring( @CurStartDate,7,4)+'-'+substring( @CurStartDate,1,2)+'-'+substring( @CurStartDate,4,2)
----处理起用前的数据
delete from t_MakevouchTemp where FTranType=4000 and fgroupid=0 and fvchinterid=-1 and fprevchinterid=0
and fscbillinterid in (select finterid from icstockbill where fdate <@CurStartDate AND FTranType=1 And FCancellation=0)
delete from ICSaleVoucher WHERE finterid in(select finterid from icstockbill where FDate<@CurStartDate AND FTranType=21 AND FSaleStyle=102 And FCancellation=0)
Update ICstockBill set FVchInterID=Null Where FDate<@CurStartDate AND FTranType=1 and FCancellation=0
----处理系统参数
Update t_SystemProfile Set FValue='0' Where FKey='ICClosed' and FCategory='IC'
Update t_SystemProfile Set FValue=convert(varchar(2),@startperiod) Where FKey='CurrentPeriod' and FCategory='IC'
Update t_SystemProFile Set FValue='0' Where FKey='InvDataPeriod' And FCategory='IC'
----转换初始余额数据时间
Update ICInvInitial Set FPeriod=convert(int,@StartPeriod) Where FPeriod=0
--Exec StockIniDataOn
--Update t_SystemProfile Set FValue='1' Where FKey='ICClosed' and FCategory='IC'
Return
Go
------启动帐套
Exec RestartSystem
Go
- 相关问题
- ·关于加密狗合并的问题
- 2010-09-13 13:53
- ·在k3存货模块期末结账时,有一张生产领料单不能记账,请帮忙解答。
- 2010-09-10 15:48
- ·关于金蝶K/3 成长版软件中销售管理模块的问题
- 2010-09-09 09:28
- ·怎么找到我想要的东西啊?我要破解的K312.0成长和精益
- 2010-09-08 10:09
- ·我想将K3中的数据导出来,请问各位高手帮忙
- 2010-09-07 09:05
- ·关于国内,与国外一个账册两套报表的问题请问如何处理
- 2010-09-06 17:22
- ·关于金蝶K3系统的问题,可以咨询吗
- 2010-09-06 17:21
- ·怎么设置金蝶K/3中F7内容窗体的列?
- 2010-09-03 09:34
- ·请问我在输入凭证时怎么将凭证的日期设为我想要的日期
- 2010-09-01 13:41
- ·金蝶K/3存货各模块与总账间的数据不一致
- 2010-08-31 09:03
-
等您来回答
-
您可能想知道