第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

手動執(zhí)行預(yù)設(shè)補貼功能

標簽:
PHP

SQL中有两个表,pridectsubsidy,employee
实现功能为当手动执行预设补贴时,将补贴表里的补贴值存储到人员表对应得人员上。
其中有两个Tag 1,自动清零、2,补贴月份
1、如果客户端传递自动补贴清零参数到存储数据时,先进行清零操作否则不进行
2、补贴月份是要更新到人员表中的数据,用来跟predate进行对比判断。

核心判断代码:
if (cInt(rs_E("lastsubsidyid")) <> cInt(dateM)) and (tagClear = 1) then '判断补贴月份是否相同,且是否补贴清零.

其次,无论判断是否满足条件,最终都应该对人员表进行操作。

其中 RechargeRecordClear,RechargeRecordSave 为封装内部方法没有列出。

asp代码如下:

<%

dim sql_p,rs_p,dateP

dim sql_E,rs_E

dim sql_U,sequence,mSequence,SubsidyBalance

dateP = now

dim dateM

dateM = month(now)

'response.write(dateM) 

dim RdWorkNo,Cardid,mMacId,CardDiscount

dim MacDiscount,RealExpend,AccountCashRealExpend,AccountSubsidyRealExpend

dim AccountCashBalance,AccountSubsidyBalance,sex,DeptName

dim PositionName,CardTypeName,UserName,StrRecType

dim sql_Del

sql_p = "select * from predictsubsidy where predate <= '"& dateP &"'"

set rs_p = server.createobject("adodb.recordset")

rs_p.open sql_p,conn,1,3

'response.write(rs_p.recordcount)

if rs_p.eof then 

response.write"<script LANGUAGE = 'javascript'>alertMsg('不存在小于当前日期的预设补贴',66,'pridectSelect.asp')</script>"

response.end 

end if 

do while not rs_p.eof '遍历predictSubsidy表

    sql_E = "select * from employee where workno = '"& rs_p("workno") &"' and f_delflag = 0 " '获取满足条件的人员数据'

    set rs_E = server.createobject("adodb.recordset")

    rs_E.open sql_E,conn,1,1

    if not rs_E.eof then 

            if (cInt(rs_E("lastsubsidyid")) <> cInt(dateM)) and (tagClear = 1) then '判断补贴月份是否相同,且是否补贴清零.

                sequence = clng(rs_E("LastRecSequence"))

                mSequence = sequence + 1

                SubsidyBalance = 0

                'SubsidyBalance = SubsidyBalance + rs_p("subsidy")

                RdWorkNo = rs_E("workno")

                Cardid =  rs_E("Cardid")

                mMacId = 0

                CardDiscount = 100

                MacDiscount = 100

                RealExpend = rs_E("subsidy")

                AccountCashRealExpend = 0

                AccountSubsidyRealExpend = rs_E("subsidy")

                AccountCashBalance = csng(rs_E("yuer"))

                AccountSubsidyBalance = SubsidyBalance

                Sex = rs_E("sex")

                DeptName = rs_E("DeptName")

                PositionName = rs_E("PositionName")

                CardTypeName = rs_E("CardTypeName")

                UserName = rs_E("Name")

                call RechargeRecordClear

                sql_U = "Update Employee Set LastSubsidyID =" & month(rs_p("predate")) & ", subsidy = 0 ,  LastRecSequence =" & mSequence &  " ,yuerlastupdate ='"& now &"'  Where F_Delflag = 0 And WorkNo='" & rs_E("workno") & "' "

                conn.execute(sql_U)

                rs_E.close   '将集合关闭方便二次访问

                rs_E.open sql_E,conn,1,1

            end if

            sequence = clng(rs_E("LastRecSequence"))

            mSequence = sequence + 1

            SubsidyBalance = csng(rs_E("subsidy"))

            SubsidyBalance = SubsidyBalance + rs_p("subsidy")

            RdWorkNo = rs_E("workno")

            Cardid =  rs_E("Cardid")

            mMacId = 0

            CardDiscount = 100

            MacDiscount = 100

            RealExpend = rs_p("subsidy")

            AccountCashRealExpend = 0

            AccountSubsidyRealExpend = rs_p("subsidy")

            AccountCashBalance = csng(rs_E("yuer"))

            AccountSubsidyBalance = SubsidyBalance

            Sex = rs_E("sex")

            DeptName = rs_E("DeptName")

            PositionName = rs_E("PositionName")

            CardTypeName = rs_E("CardTypeName")

            UserName = rs_E("Name")

            StrRecType = "预设补贴充值[" &rs_p("batch")&"]"

            sql_U = "Update Employee Set LastSubsidyID =" & month(rs_p("predate")) & ", subsidy =" & SubsidyBalance & ",  LastRecSequence =" & mSequence &  " ,yuerlastupdate ='"& now &"'  Where F_Delflag = 0 And WorkNo='" & rs_E("workno") & "' "

            conn.execute(sql_U)

            call RechargeRecordSave

    end if 

    rs_E.close

    dim DelId

    DelId = rs_p("id")

    rs_p.movenext

    sql_Del = "delete from predictsubsidy where id = "& DelId  

    conn.execute(sql_Del)

loop 

rs_p.close

call EventRecordSave("用户:" & session("Cashier") & "手动执行预设补贴成功!" , 1)

response.write"<script LANGUAGE = 'javascript'>alertMsg('手动执行预设补贴成功!',53,'pridectSelect.asp')</script>"

%>
點擊查看更多內(nèi)容
1人點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消