⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pub_me.bas

📁 杭州舟远信息技术连锁有限公司的棋牌管理系统源代码
💻 BAS
📖 第 1 页 / 共 2 页
字号:
count = chick_ff(m_zh)


'MsgBox "退" + Val(count)

                        
Set fj_rec = New ADODB.Recordset
fj_rec.Source = "SELECT * FROM N_FJ WHERE FHID = '" & Trim(m_fjh) & "'"
Set fj_rec.ActiveConnection = objConn
fj_rec.CursorType = adOpenDynamic
fj_rec.LockType = adLockOptimistic
fj_rec.Open


'delcj (xf_rec.Fields("je"))
'MsgBox "退房成功!需要退还客人定金" + Val(count) + "元。"
Set xf_rec = New ADODB.Recordset
xf_rec.Source = "select * from N_FFJL "
Set xf_rec.ActiveConnection = objConn
xf_rec.CursorType = adOpenDynamic
xf_rec.LockType = adLockOptimistic
xf_rec.Open

If Trim(fj_rec.Fields("jxbj")) = "1" Then '连号房
If Trim(fj_rec.Fields("jx")) = "1" Then '连号主房
    MsgBox m_fjh + "为连号主房,该房无法直接退出"
    GoTo endless
Else  '连号从房
    Dim temp As ADODB.Recordset

        
        Set temp = New ADODB.Recordset
        temp.Source = "select * from DT_KRQD WHERE tf = 0 AND KR_FJ='" & Trim(fj_rec.Fields("jx")) & "'"
        Set temp.ActiveConnection = objConn
        temp.CursorType = adOpenDynamic
        temp.LockType = adLockOptimistic
        temp.Open

        If temp.EOF Then
            MsgBox "退房连号房错误!"

        Else
            xf_rec.AddNew
            With xf_rec
            .Fields("id") = fGetMaxComID("N_ffjl", "ID") + 1
            .Fields("ZH") = temp.Fields("ZH")
            .Fields("KX") = "加押金"
            .Fields("je") = Val(count)
            .Fields("RQ") = Trim(Format(Date, "YYYYMMDD"))
            .Fields("MS") = Trim(m_fjh) & "客人退房转帐到" & Trim(fj_rec.Fields("jx"))
             End With
             xf_rec.Update
             'addcj (xf_rec.Fields("je")) 需要再思考一下,是否正确
        End If
        temp.Close
        Set temp = Nothing
 

End If '结束连号主从选择
End If '结束连号房判断

If krqd_rec.Fields("tf") = 0 Then
    'm_ldrq.Text = Trim(Format(Date, "YYYYMMDD"))
    'm_ldsj.Text = Format(Time, "HHMMSS")
    krqd_rec.Fields("LDRQ") = Trim(Format(Date, "YYYYMMDD"))
    krqd_rec.Fields("LD_SJ") = Trim(Format(Time, "HHMMSS"))
    krqd_rec.Fields("LDRQS") = CStr(Trim(Format(Date, "YYYYMMDD")))
    krqd_rec.Fields("ZXFE") = Val(count)
    
End If

    krqd_rec.Fields("tf") = 1
krqd_rec.Update





xf_rec.AddNew
With xf_rec
.Fields("id") = fGetMaxComID("N_ffjl", "ID") + 1
.Fields("ZH") = m_zh
.Fields("KX") = "退押金"
.Fields("je") = Val(count)
.Fields("RQ") = Trim(Format(Date, "YYYYMMDD"))
.Fields("MS") = m_fjh + "客人退房"
'.Fields("JSRQ") = TRIM(Format(Date, "YYYYMMDD"))
End With
xf_rec.Update
                        
                        

If Not fj_rec.EOF Then
   fj_rec.Fields("lybj") = "0"
   fj_rec.Fields("drbj") = "0"
   fj_rec.Fields("jxbj") = "0"
   fj_rec.Fields("kbj") = "0"
                            
    If fj_rec.Fields("FZT") = 1 Or fj_rec.Fields("FZT") = 5 Or fj_rec.Fields("FZT") = 6 Then
        fj_rec.Fields("FZT") = 2
        fj_rec.Update
    End If


End If

    Set temp = New ADODB.Recordset
    temp.Source = "select * from N_FJ WHERE jxbj = '1' and  jx='" & Trim(fj_rec.Fields("jx")) & "'"
    Set temp.ActiveConnection = objConn
    temp.CursorType = adOpenDynamic
    temp.LockType = adLockOptimistic
    temp.Open

    If temp.EOF Then
        Dim tp_fj As ADODB.Recordset
        Set tp_fj = New ADODB.Recordset
        tp_fj.Source = "select * from N_FJ WHERE fhid='" & Trim(fj_rec.Fields("jx")) & "'"
        Set tp_fj.ActiveConnection = objConn
        tp_fj.CursorType = adOpenDynamic
        tp_fj.LockType = adLockOptimistic
        tp_fj.Open
        tp_fj.Fields("jxbj") = "0"
        tp_fj.Update
        tp_fj.Close
        Set tp_fj = Nothing
    End If
    temp.Close
    Set temp = Nothing

endless:
    xf_rec.Close
Set xf_rec = Nothing
    fj_rec.Close
    Set fj_rec = Nothing
krqd_rec.Close
Set krqd_rec = Nothing

Call dt_main.fj_road


End Function
Public Function chick_ff(m_zh As String) As Variant
On Error Resume Next
Dim count_rec As ADODB.Recordset
Dim count As Variant
Dim temp As Variant
temp = 0
Set count_rec = New ADODB.Recordset
count_rec.Source = "SELECT SUM(JE) FROM N_XFJL where KX ='迷你吧' AND zh='" + Trim(m_zh) + "'"
Set count_rec.ActiveConnection = objConn
count_rec.CursorType = adOpenDynamic
count_rec.LockType = adLockOptimistic
count_rec.Open
temp = IIf(IsNull(count_rec.Fields(0)), 0, Val(count_rec.Fields(0)))
count = 0 - temp
count_rec.Close
Set count_rec = Nothing
temp = 0
Set count_rec = New ADODB.Recordset
count_rec.Source = "SELECT SUM(JE) FROM N_XFJL where KX ='酒店消费' AND zh='" + Trim(m_zh) + "'"
Set count_rec.ActiveConnection = objConn
count_rec.CursorType = adOpenDynamic
count_rec.LockType = adLockOptimistic
count_rec.Open
temp = IIf(IsNull(count_rec.Fields(0)), 0, Val(count_rec.Fields(0)))
count = count - temp
count_rec.Close
Set count_rec = Nothing
temp = 0
Set count_rec = New ADODB.Recordset
count_rec.Source = "SELECT SUM(JE) FROM N_XFJL where KX ='抵退消费' AND zh='" + Trim(m_zh) + "'"
Set count_rec.ActiveConnection = objConn
count_rec.CursorType = adOpenDynamic
count_rec.LockType = adLockOptimistic
count_rec.Open
temp = IIf(IsNull(count_rec.Fields(0)), 0, Val(count_rec.Fields(0)))
count = count + temp
count_rec.Close
Set count_rec = Nothing
temp = 0
Set count_rec = New ADODB.Recordset
count_rec.Source = "SELECT SUM(JE) FROM N_FFJL where KX ='加押金' AND zh='" + Trim(m_zh) + "'"
Set count_rec.ActiveConnection = objConn
count_rec.CursorType = adOpenDynamic
count_rec.LockType = adLockOptimistic
count_rec.Open
temp = IIf(IsNull(count_rec.Fields(0)), 0, Val(count_rec.Fields(0)))
count = count + temp
count_rec.Close
Set count_rec = Nothing
temp = 0
Set count_rec = New ADODB.Recordset
count_rec.Source = "SELECT SUM(JE) FROM N_FFJL where KX ='退押金' AND zh='" + Trim(m_zh) + "'"
Set count_rec.ActiveConnection = objConn
count_rec.CursorType = adOpenDynamic
count_rec.LockType = adLockOptimistic
count_rec.Open
temp = IIf(IsNull(count_rec.Fields(0)), 0, Val(count_rec.Fields(0)))
count = count - temp
count_rec.Close
Set count_rec = Nothing
temp = 0
Set count_rec = New ADODB.Recordset
count_rec.Source = "SELECT SUM(JE) FROM N_FFJL where KX ='房租' AND zh='" + Trim(m_zh) + "'"
Set count_rec.ActiveConnection = objConn
count_rec.CursorType = adOpenDynamic
count_rec.LockType = adLockOptimistic
count_rec.Open
temp = IIf(IsNull(count_rec.Fields(0)), 0, Val(count_rec.Fields(0)))
count = count - temp
count_rec.Close
Set count_rec = Nothing
chick_ff = count
End Function


Public Function tdkr_tf(m_zh As String, m_fjh As String) '团队客人退房程序
On Error Resume Next
Dim xf_rec As ADODB.Recordset
Dim krqd_rec As ADODB.Recordset
Dim fj_rec As ADODB.Recordset
Dim intrtn  As Integer
Dim count As Variant

Set krqd_rec = New ADODB.Recordset
krqd_rec.Source = "SELECT * FROM DT_KRQD WHERE ZH ='" & Trim(m_zh) & "'"
Set krqd_rec.ActiveConnection = objConn
krqd_rec.CursorType = adOpenDynamic
krqd_rec.LockType = adLockOptimistic
krqd_rec.Open

If krqd_rec.EOF Then
    MsgBox "帐号错误!"
    krqd_rec.Close
    Set krqd_rec = Nothing
    Exit Function
End If
'Call Command8_Click
'MsgBox "退111las"
count = chick_ff(m_zh)


'MsgBox "退" + Val(count)

                        
Set fj_rec = New ADODB.Recordset
fj_rec.Source = "SELECT * FROM N_FJ WHERE FHID = '" & Trim(m_fjh) & "'"
Set fj_rec.ActiveConnection = objConn
fj_rec.CursorType = adOpenDynamic
fj_rec.LockType = adLockOptimistic
fj_rec.Open


'delcj (xf_rec.Fields("je"))
'MsgBox "退房成功!需要退还客人定金" + Val(count) + "元。"
Set xf_rec = New ADODB.Recordset
xf_rec.Source = "select * from N_FFJL "
Set xf_rec.ActiveConnection = objConn
xf_rec.CursorType = adOpenDynamic
xf_rec.LockType = adLockOptimistic
xf_rec.Open

           xf_rec.AddNew
            With xf_rec
            .Fields("id") = fGetMaxComID("N_ffjl", "ID") + 1
            .Fields("ZH") = Trim(krqd_rec.Fields("tdmc"))
            .Fields("KX") = "加押金"
            .Fields("je") = Val(count)
            .Fields("RQ") = Trim(Format(Date, "YYYYMMDD"))
            .Fields("MS") = Trim(m_fjh) & "客人退房转帐到团队"
             End With
             xf_rec.Update


If krqd_rec.Fields("tf") = 0 Then
    'm_ldrq.Text = Trim(Format(Date, "YYYYMMDD"))
    'm_ldsj.Text = Format(Time, "HHMMSS")
    krqd_rec.Fields("LDRQ") = Trim(Format(Date, "YYYYMMDD"))
    krqd_rec.Fields("LD_SJ") = Trim(Format(Time, "HHMMSS"))
    krqd_rec.Fields("LDRQS") = CStr(Trim(Format(Date, "YYYYMMDD")))
    krqd_rec.Fields("ZXFE") = Val(count)
    
End If

    krqd_rec.Fields("tf") = 1
krqd_rec.Update





xf_rec.AddNew
With xf_rec
.Fields("id") = fGetMaxComID("N_ffjl", "ID") + 1
.Fields("ZH") = m_zh
.Fields("KX") = "退押金"
.Fields("je") = Val(count)
.Fields("RQ") = Trim(Format(Date, "YYYYMMDD"))
.Fields("MS") = m_fjh + "客人退房"
'.Fields("JSRQ") = TRIM(Format(Date, "YYYYMMDD"))
End With
xf_rec.Update
                        
                        

If Not fj_rec.EOF Then
   fj_rec.Fields("lybj") = "0"
   fj_rec.Fields("drbj") = "0"
   fj_rec.Fields("jxbj") = "0"
   fj_rec.Fields("kbj") = "0"
                            
    If fj_rec.Fields("FZT") = 1 Or fj_rec.Fields("FZT") = 5 Or fj_rec.Fields("FZT") = 6 Then
        fj_rec.Fields("FZT") = 2
        fj_rec.Update
    End If


End If


endless:
    xf_rec.Close
Set xf_rec = Nothing
    fj_rec.Close
    Set fj_rec = Nothing
krqd_rec.Close
Set krqd_rec = Nothing

Call dt_main.fj_road


End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -