<%
if FoundBankUserID then
    dim C_AccDate
    C_AccDate = cint(datediff("d",C_Date,now()))
    if C_AccDate > 0 then
        cjconn.execute ("update bankuser set C_accrual=C_accrual+"&int(C_DateProfit/100*CurrDeposit*C_AccDate)&",DateAndTime='"&now()&"' where bankuserid="&BankUserID)
        csql="select PID,bankuserid,PaymentForGoods,P_Accrual,ByDetainCP,DateAndTime,LastTime from PaymentForGoods where bankuserid="&BankUserID
        set crs=cjconn.execute (csql)
        if not (crs.bof and crs.eof) then
            do while not crs.eof
                if datediff("d",datediff("d",crs(5),now()),P_repay) < 0 then
                    cjconn.execute ("update bank set loveliness=loveliness+"&crs(4)&",PaymentForGoods=PaymentForGoods-"&crs(2)&" where bankid="&BankID)
                    cjconn.execute ("update bankuser set PaymentForGoods=PaymentForGoods-"&crs(2)&",P_accrual=P_accrual-"&crs(3)&",ByDetainCP=ByDetainCP-"&crs(4)&" where bankuserid="&crs(1))
                    cjconn.execute ("delete from PaymentForGoods where PID="&crs(0))
                elseif datediff("d",dateadd("d",P_DateCount,crs(5)),now()) > 0 then
                    cjconn.execute ("update bankuser set P_Accrual=P_Accrual + " & int(P_DateProfit/100*crs(2)*cint(datediff("d",crs(6),now()))) & " where bankuserid="&BankUserID)
                    cjconn.execute ("update PaymentForGoods set P_Accrual=P_Accrual+"&int(P_DateProfit/100*crs(2)*cint(datediff("d",crs(6),now())))&",LastTime='"&now()&"' where PID="&crs(0))
                end if
                crs.movenext
            loop
        end if
        set crs=nothing
    end if
end if
%>