/*
--********软件安全相关处理**********
DECLARE @ProInfoname VARCHAR(6)
SELECT @ProInfoname = CASE SubValue WHEN '1' THEN 'V3' WHEN '2' THEN 'A8' WHEN '4' THEN 'V1' ELSE '' END FROM dbo.sysdata WHERE SubName = 'ProInfo'
IF EXISTS(SELECT TOP 1 1 FROM sysdatadb..rwxsysadmin WHERE [Version] = @ProInfoname AND rgday <> 99999)
BEGIN
IF EXISTS(SELECT TOP 1 1 FROM sysdata WHERE SubName = 'ControlFlag' AND SubValue = 'ssct')
BEGIN
RETURN -99
END
DECLARE @roundN INT
,@NetLevel INT
,@DiffDay INT
SELECT @DiffDay = DATEDIFF(DAY,SubValue,GETDATE()) FROM sysdata WHERE SubName = 'PassVchCheck'
IF @importtype = 0 AND @BillType IN (11,34) AND @DiffDay > 90 AND EXISTS(SELECT TOP 1 1 FROM Ac_AccountsPeroid_Stype WHERE Stypeid = @STypeID)
RETURN -98
SELECT @roundN = CAST(RAND()*100 as INT)
SELECT @NetLevel = CAST( SubValue AS INT) FROM sysdata WHERE SubName = 'NetLevel'
IF @roundN > @NetLevel AND EXISTS(SELECT TOP 1 1 FROM Ac_AccountsPeroid_Stype WHERE Stypeid = @STypeID)
RETURN -97
UPDATE sysdata SET SubComment = @roundN WHERE SubName = 'NetLevel'
END
*/
--********软件安全相关处理end**********
-- ******** 判断是否试用版 - Start ********
DECLARE @N INT ,
@intVersion INT
-- 判断版本号,是否试用版
SELECT @N = CAST(SubValue AS INT)
FROM SysData1
WHERE SubNo = 2 -- 版本号
IF @N IS NULL RETURN -1
/*
IF EXISTS(SELECT TOP 1 1 FROM dbo.sysdata1 WHERE SubNo = 6 AND SubValue = '1')
AND (EXISTS(SELECT TOP 1 1 FROM dbo.sysdata1 WHERE SubNo = 10 AND ISNULL(SubValue,'') = '')
OR EXISTS(SELECT TOP 1 1 FROM dbo.sysdata1 WHERE SubNo = 9 AND ISNULL(SubValue,'') = '')
OR EXISTS(SELECT TOP 1 1 FROM dbo.sysdata1 WHERE SubNo = 11 AND ISNULL(SubValue,'') = '')
OR EXISTS(SELECT TOP 1 1 FROM dbo.sysdata1 WHERE SubNo = 13 AND ISNULL(SubValue,'') = ''))
RETURN -3
*/
DECLARE @intBit INT ,
@intMask INT
SELECT @intBit = @N & 15
SELECT @intMask = POWER(2, @intBit) ^ POWER(2, @intBit + 1) ^ POWER(2,
@intBit + 2)
^ POWER(2, @intBit + 3) ^ POWER(2, @intBit + 4) ^ POWER(2,
@intBit + 5)
SELECT @intVersion = ( @intMask & @N ) / POWER(2, @intBit)
-- ******** 判断是否试用版 - END ********
DECLARE @Re INT ,
@Flag INT
EXEC @Re= Gp_Validate 2, @Flag OUTPUT
IF @Re <> 0
RETURN -3 --检查程序版本错误
IF @intVersion NOT IN ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15 )
BEGIN
--RAISERROR('校验错误 !',16,1)
RETURN -3 --检查程序版本错误
END
IF @intVersion IN (2,3,5,7,9,11,13,15) --试用版
BEGIN
DECLARE @billnumberid int
SELECT @billnumberid=ISNULL(COUNT(billnumberid),0) FROM billindex
IF @billnumberid >= 200
BEGIN
--RAISERROR('试用版最多录200条单据 !',16,1)
RETURN -1
END
END
DECLARE @BeginDate DATETIME ,
@szItem VARCHAR(30) ,
@szVchCode VARCHAR(30)
--EXEC Gp_GetSubValue 'period', @STypeID, @szPeriod OUT
SELECT TOP 1
@BeginDate = startdate
FROM monthproc
WHERE MonthNo='本期' AND STypeID=@STypeID
EXEC @re = Gp_Fz_Base '',2
IF @re <> 0 RETURN -2
/*
IF EXISTS(SELECT TOP 1 1 FROM sysdatadb..rwxsysadmin WHERE [Version] = @ProInfoname AND rgday <> 99999)
BEGIN
--验证数据是否已经被控制
--此处不做数据清理,放在C++中进行数据清理
DECLARE @isControl varchar(10)
SET @isControl=''
SELECT @isControl=subvalue FROM SYSDATA WHERE subname='ControlFlag'
IF @isControl = 'ssct'
BEGIN
RETURN -100
END
--验证数据是否允许执行保存
IF @checkSave='check_account_num_err'
BEGIN
RETURN -102
END
IF @checkSave<>'bill_allow_save' AND @BillType IN (4,11)
BEGIN
RETURN -101
END
ELSE
BEGIN
--bill_unsave
UPDATE sysdata1 SET subvalue=N'`ljk_vlvgqe' WHERE subname='BillSaveCheck'
END
END
*/
--DECLARE
--@intNeed TINYINT