業(yè)務(wù)場景:
創(chuàng)新互聯(lián)建站憑借在網(wǎng)站建設(shè)、網(wǎng)站推廣領(lǐng)域領(lǐng)先的技術(shù)能力和多年的行業(yè)經(jīng)驗,為客戶提供超值的營銷型網(wǎng)站建設(shè)服務(wù),我們始終認為:好的營銷型網(wǎng)站就是好的業(yè)務(wù)員。我們已成功為企業(yè)單位、個人等客戶提供了網(wǎng)站建設(shè)、成都網(wǎng)站建設(shè)服務(wù),以良好的商業(yè)信譽,完善的服務(wù)及深厚的技術(shù)力量處于同行領(lǐng)先地位。上線時,客戶往往在財務(wù)軟件中還有個人借款余額,通常希望能導(dǎo)入到費控系統(tǒng),這樣填寫報銷單時,能夠沖銷原來手工借支的款項?;诖四康?,我們提供了下面的標(biāo)準實施方案來解決。
1、確保數(shù)據(jù)庫中有借款余額表(TLOAN_INIT)
CREATE TABLE [dbo].[TLOAN_INIT]( [LI_ID] [varchar](50) NOT NULL, [LI_USER] [varchar](50) NOT NULL CONSTRAINT [DF_TLOAN_INIT_LI_USER] DEFAULT (''), [LI_SUBJECT_FEE] [varchar](50) NOT NULL CONSTRAINT [DF_TLOAN_INIT_LI_SUBJECT_FEE] DEFAULT (''), [LI_AMOUNT] [numeric](18, 2) NOT NULL CONSTRAINT [DF_TLOAN_INIT_LI_AMOUNT] DEFAULT ((0)), [LI_REMARK] [varchar](2000) NOT NULL CONSTRAINT [DF_TLOAN_INIT_LI_REMARK] DEFAULT (''), [LI_CREATE_DATETIME] [datetime] NOT NULL CONSTRAINT [DF_TLOAN_INIT_LI_CREATE_DATETIME] DEFAULT (getdate()), [LI_ACTIVE] [char](1) NOT NULL CONSTRAINT [DF_TLOAN_INIT_LI_ACTIVE] DEFAULT ('N'), CONSTRAINT [PK_TLOAN_INIT] PRIMARY KEY CLUSTERED ( [LI_ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
2、通過自定義擴展頁面導(dǎo)入,或者excel提單導(dǎo)入的方式,把客戶整理好的借款余額數(shù)據(jù),導(dǎo)入到上面的表中
3、執(zhí)行存儲過程(p_uf_InitLoanAmount),處理借款余額表,把數(shù)據(jù)寫入單據(jù)主表和明細表,基本原理是虛擬一張借款單出來。
CREATE proc p_uf_InitLoanAmount as begin declare @li_id varchar(50)='' declare @user_id varchar(50)='' declare @fee_id varchar(50)='' declare @amount float=0 declare @remark varchar(50)='' declare @bill_id varchar(50)='' declare @bill_no varchar(50)='' declare @project_id varchar(50)='' declare @i int=0 --創(chuàng)建虛擬單號 set @bill_no='LI'+CAST(DATEPART(year,GETDATE()) AS VARCHAR(50))+'-'+CAST(DATEPART(MONTH,GETDATE()) AS VARCHAR(50))+'-'+CAST(DATEPART(DAY,GETDATE()) AS VARCHAR(50)) +'-'+CAST(DATEPART(HOUR,GETDATE()) AS VARCHAR(50))+'-'+CAST(DATEPART(minute,GETDATE()) AS VARCHAR(50))+'-'+CAST(DATEPART(second,GETDATE()) AS VARCHAR(50)) --循環(huán)寫入,并改寫標(biāo)志位,避免重復(fù)導(dǎo)入 select * from tloan_init DECLARE loan_init_Cursor CURSOR FOR SELECT li_user,li_subject_fee,li_amount,li_remark,li_id ,LI_PROJECT from tloan_init where li_active='N'; OPEN loan_init_Cursor; FETCH NEXT FROM loan_init_Cursor into @user_id,@fee_id,@amount,@remark,@li_id,@project_id; WHILE @@FETCH_STATUS = 0 BEGIN set @i=@i+1 set @bill_id=NEWID() --寫入表表 insert into TBILL (BILL_NO,BILL_ID,BILL_TEMPLATE_TYPE,BILL_USER,BILL_AMOUNT,BILL_FLAG,BILL_REMARK,bill_project) values (@bill_no+RIGHT(@bill_id,4),@bill_id,'T-L',@user_id,@amount,'CLOSE',@remark,@project_id) --寫入明細表 insert into TBILL_CONTENT (BILLC_BILL_ID,BILLC_SEQ,BILLC_USER,BILLC_SUBJECT_FEE,BILLC_AMOUNT,BILLC_LAMOUNT,BILLC_TYPE,billc_project) values (@bill_id,1,@user_id,@fee_id,@amount,@amount,'臨時借款',@project_id) --更新標(biāo)志位 update tloan_init set li_active='Y' where li_id=@li_id FETCH NEXT FROM loan_init_Cursor into @user_id,@fee_id,@amount,@remark,@li_id,@project_id; END; CLOSE loan_init_Cursor; DEALLOCATE loan_init_Cursor; select CAST(@i as varchar(50))+' 行數(shù)據(jù)導(dǎo)入完成' end
4、完成,在報銷單中即可沖銷上面的借款。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。