大神们!!求助!谁能帮忙解读下!!感谢~~

[复制链接]
查看11 | 回复0 | 2016-9-7 23:13:00 | 显示全部楼层 |阅读模式
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
ALTER PROCEDURE PBank_BillSave
(
@BResult bit output,
@IInvestType int,
@SAccount nVarchar(50),
@IBillNum Int,
@SIDNum nvarchar(50),
@SCustNum varchar(50),
@SName Varchar(50),
@SAddress Varchar(50),
@SPhone Varchar(50),
@SCellPhone Varchar(50),
@FSaveM money,
@DSaveDate Datetime,
@ISaveType int,
@IAutoSave int,
@FInteRate decimal(18,8),
@DMatureDate Datetime,
@FMatureInte decimal(18,8),
@FMaturetax decimal(18,8),
@SPsw nVArchar(100),
@SSalesMan nvarchar(50),
@IDealType int,
@IMonthInteMark int,
@DNextInteDate Datetime,
@FMonthInte money,
@FCurMonthInte money,
@SBookAcc nvarchar(50),
@SBank nvarchar(50),
@IOperNum Int,
@SOperName nVArchar(50),
@ITestmark int
)
AS

begin tran
declare @DTallyDate datetime
select @DTallyDate=(select TallyDate from Bank_Config)
Insert into Bank_Bill (InvestType,Num,Account,IDNum,CustNum,Name,Address,Phone,SaveDate,SaveSaDate,SaveM,SaveType,AutoSave,Psw,SalesMan,CaclDate,

MatureDate,MatureInteRate,MatureInte,MatureTax,SaveOperNum,SaveOperator,BillStatus,DealType,MonthInteMark,NextInteDate,MonthInte,MonthInted,BookAcc,CellPhone)
values(@IInvestType,@IBillNum,@SAccount,@SIDNum,@SCustNum,@SName,@SAddress,@SPhone,@DSaveDate,@DTallyDate,@FSaveM,@ISaveType,@IAutoSave,@SPSW,@SSalesMan,@DSaveDate,
@DMatureDate,@FInteRate,@FMatureInte,@FMatureTax,@IOperNum,@SOperName,0,@IDealType,@IMonthInteMark,@DNextInteDate,@FMonthInte,0,@SBookAcc,@SCellPhone)
Update Bank_Customers set BIllSave=BIllSave+@FSaveM where Account=@SCustNum
Update Bank_Config set CurSaveAccNum=@SAccount
Update VBank_Mbill set CurNum=CurNum+1 where OperNum=@IOperNum and BillTypeNum=3 and BillStatus='在用中'
Insert into Bank_BillM (BillType,TranDate,BillNum,BillMark,OperNum,Operator)

Values(3,GetDate(),@IBillNum,'正常',@IOperNum,@SOperName)
/*
*/
--如果正式启用则启动自动记账
if @ITestMark=1
begin
Declare @IYear int
Declare @IMonth int
Declare @IDay int
Declare @IScripNum int
Declare @SNotenvarchar(50)
Declare @SSubjNumnvarchar(50)
select @IYear=Datepart(Year,@DTallyDate)
select @IMonth=Datepart(Month,@DTallyDate)
select @IDay=Datepart(Day,@DTallyDate)
select @IScripNum=(select isnull(max(Num),0)+1 from bank_Scrip whereDYear=@IYear and DMonth=@IMonth)
select @SNote=(select Name from Bank_AutoScripType where Num=3)
--将凭单编号写入业务:格式为:YYYYMMNum
Declare @SScripNum nvarchar(50)
select @SScripNum=Cast(@IYear as nvarchar(4))
If @IMonth0
begin
set@BResult=0
Rollback
end
else
begin
set @BResult=1
commit
end

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行