6.3.4退宿结帐
ublic Sub JS() '定义计算住宿天数的函数
If DTP2.Value > DTP1.Value Then
If tim2.Value > #11:59:00 PM# Then
If tim2.Value > #12:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = DTP2.Value - DTP1.Value + 1
Else
Texts.Text = DTP2.Value - DTP1.Value + 0.5
End If
Else
Texts.Text = DTP2.Value - DTP1.Value
End If
Else
Texts.Text = DTP2.Value - DTP1.Value
End If
Else
If tim1.Value < #2:00:00 AM# Then
If tim2.Value > #2:00:00 AM# Then
If tim2.Value > #12:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = 1 + 1
Else
Texts.Text = 1 + 0.5
End If
Else
Texts.Text = 1
End If
Else
Texts.Text = 1
End If
Else
Texts.Text = 1
End If
End If
End Sub
Public Sub ssje() '定义计算实收金额和退还金额的函数
Texssje.Text = Val(Texzhje.Text) + Val(Texzf.Text) + Val(Texdhf.Text) + Val(Texpcf.Text) + Val(Texhyf.Text) + Val(Textcf.Text)
Texthje.Text = Val(Texyj.Text) - Val(Texssje.Text)
End Sub
Private Sub Form_Load()
'自动识别数据库路径
Data1.DatabaseName = App.Path & "\KFGL.MDB"
Data2.DatabaseName = App.Path & "\KFGL.MDB"
Data3.DatabaseName = App.Path & "\KFGL.MDB"
Data4.DatabaseName = App.Path & "\KFGL.MDB"
Data5.DatabaseName = App.Path & "\KFGL.MDB"
End Sub
Private Sub Form_Activate()
czy.Text = main.StatusBar1.Panels(4).Text '赋值给czy
DTP2.Value = Date: tim2.Value = Time
'查询住宿登记信息
Data5.RecordSource = "select 凭证号码 from djb where 标志='1'order by 凭证号码"
Data5.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True '设置主窗体有效
End Sub
Private Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DBCombo2.SetFocus '按回车键DBCombo2获得焦点
End Sub
Private Sub DBCOMBO2_KeyDown(KeyCode As Integer, Shift As Integer)
751com.cn
Texzk.Text = 0
End If
If Combo2.Text = "挂帐" Then
Lab10.Visible = True
Texgzdw.Visible = True
Texgzdw.Text = Texxm.Text '赋值给Texxm.text
Else
Lab10.Visible = False
Texgzdw.Visible = False '设置Texgzdw不可见
Texgzdw.Text = ""
End If
End Sub
Private Sub Combo3_Click()
Texfjf.SetFocus 'Texfjf获得焦点
Texfjf.Text = "0" '赋值给Texfjf.text
End Sub
Private Sub DBCombo4_Change()
If DBCombo4.Text <> "" Then
'查询住宿登记信息
Data1.RecordSource = "select * from djb where 凭证号码='" + DBCombo4.Text + "'"
Data1.Refresh
bh.Text = "T" & DBCombo4.Text
'赋值给texxm.text等
If Data1.Recordset.RecordCount > 0 Then
If Data1.Recordset.Fields("姓名") <> "" Then Texxm.Text = Data1.Recordset.Fields("姓名")
If Data1.Recordset.Fields("证件名称") <> "" Then Combo1.Text = Data1.Recordset.Fields("证件名称")
If Data1.Recordset.Fields("证件号码") <> "" Then Texsfz.Text = Data1.Recordset.Fields("证件号码")
If Data1.Recordset.Fields("详细地址") <> "" Then Texdz.Text = Data1.Recordset.Fields("详细地址")
If Data1.Recordset.Fields("房间号") <> "" Then DBCombo3.Text = Data1.Recordset.Fields("房间号")
If Data1.Recordset.Fields("客房类型") <> "" Then DBCombo1.Text = Data1.Recordset.Fields("客房类型")
If Data1.Recordset.Fields("客房价格") <> "" Then DBCombo2.Text = Data1.Recordset.Fields("客房价格")
If Data1.Recordset.Fields("住宿日期") <> "" Then DTP1.Value = Data1.Recordset.Fields("住宿日期")
If Data1.Recordset.Fields("住宿时间") <> "" Then tim1.Value = Data1.Recordset.Fields("住宿时间")
If Data1.Recordset.Fields("住宿天数") <> "" Then Texts.Text = Data1.Recordset.Fields("住宿天数")
If Data1.Recordset.Fields("预收金额") <> "" Then Texyj.Text = Data1.Recordset.Fields("预收金额") Else Texyj.Text = "0"
If Data1.Recordset.Fields("结款方式") <> "" Then Combo2.Text = Data1.Recordset.Fields("结款方式")
If Data1.Recordset.Fields("折扣") <> "" Then Texzk.Text = Data1.Recordset.Fields("折扣")
End If
'计算住宿天数
If DTP2.Value > DTP1.Value Then
If tim2.Value > #11:59:00 AM# Then
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>