📄 frmpayfroomman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmPayFRoomMan
Caption = "实收结款管理"
ClientHeight = 5595
ClientLeft = 60
ClientTop = 345
ClientWidth = 9495
Icon = "FrmPayFRoomMan.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 5595
ScaleWidth = 9495
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtDate
Height = 270
Left = 3960
TabIndex = 5
Top = 285
Width = 1215
End
Begin VB.CommandButton Cmd_Search
Caption = "查 询"
Height = 375
Left = 5520
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.ComboBox ComboStatus
Height = 300
ItemData = "FrmPayFRoomMan.frx":0CCA
Left = 1320
List = "FrmPayFRoomMan.frx":0CD4
Style = 2 'Dropdown List
TabIndex = 3
Top = 270
Width = 1215
End
Begin VB.CommandButton Cmd_Close
Caption = "关 闭"
Height = 495
Left = 5400
TabIndex = 2
Top = 4920
Width = 1335
End
Begin VB.CommandButton Cmd_Pay
Caption = "结 款"
Height = 495
Left = 2760
TabIndex = 1
Top = 4920
Width = 1335
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3735
Left = 120
TabIndex = 0
Top = 840
Width = 9255
_ExtentX = 16325
_ExtentY = 6588
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
MarqueeStyle = 3
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6960
Top = 240
Visible = 0 'False
Width = 2415
_ExtentX = 4260
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "退房日期"
Height = 180
Left = 3000
TabIndex = 7
Top = 330
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "选择状态"
Height = 180
Left = 240
TabIndex = 6
Top = 330
Width = 720
End
End
Attribute VB_Name = "FrmPayFRoomMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Pay()
Dim strSearch As String
'设置查询条件
If Trim(txtDate) <> "" Then
strSearch = " And r.LeaveDate LIKE '%" + Trim(txtDate) + "%'"
Else
strSearch = ""
End If
Adodc1.ConnectionString = Conn
If ComboStatus.ListIndex = 0 Then '已退房记录
Adodc1.RecordSource = "SELECT r.RegId As 编号, r.CustId As 客户编号, c.CustName As 客户姓名," _
+ " r.RoomNo As 客房编号, r.InDate As 入住日期, r.LeaveDate As 退房日期," _
+ " r.Days As 入住天数, r.Price As 单价, r.Rate As 折扣, r.OtherFee As 其他费用," _
+ " ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee As 总费用," _
+ " r.FirstPay As 押金, ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee -r.FirstPay" _
+ " As 应收款 FROM Registration r, Customer c" _
+ " WHERE r.Status=2 And r.CustId=c.CustId" + strSearch
Else '已结款记录
Adodc1.RecordSource = "SELECT p.RegId As 编号, r.CustId As 客户编号, c.CustName As 客户姓名," _
+ " r.RoomNo As 客房编号, r.InDate As 入住日期, r.LeaveDate As 退房日期," _
+ " r.Days As 入住天数, r.Price As 单价, r.Rate As 折扣, r.OtherFee As 其他费用," _
+ " ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee As 总费用," _
+ " r.FirstPay As 押金, ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee -r.FirstPay" _
+ " As 应收款, p.Amount As 实收款, u.EmpName As 收款人, p.OptTime As 收款时间" _
+ " FROM PayforRoom p, Registration r,Users u, Customer c" _
+ " WHERE p.RegId=r.RegId And r.Status=3 And r.CustId=c.CustId" _
+ " And p.UserName=u.UserName" + strSearch
End If
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Cmd_Close_Click()
Unload Me
End Sub
Private Sub Cmd_Delt_Click()
'删除信息
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
MyPayFRoom.Delete (Adodc1.Recordset.Fields(0))
Refresh_Pay
End Sub
Private Sub Cmd_Pay_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择要结款记录"
Exit Sub
End If
If ComboStatus.ListIndex = 0 Then '结款
With FrmPayFRoomEdit
'入住登记编号
.TmpRid = Adodc1.Recordset.Fields(0)
'客户信息
.lblCid = Adodc1.Recordset.Fields(1)
.lblCname = Adodc1.Recordset.Fields(2)
'客房编号
.lblRoomNo = Adodc1.Recordset.Fields(3)
'入住日期
.lblInDate = Adodc1.Recordset.Fields(4)
'退房日期
.lblLeaveDate = Adodc1.Recordset.Fields(5)
'入住天数
.lblDays = Adodc1.Recordset.Fields(6)
'单价
.lblPrice = Adodc1.Recordset.Fields(7)
'折扣
.lblRate = Adodc1.Recordset.Fields(8)
'其他费用
.lblOtherFee = Adodc1.Recordset.Fields(9)
'总费用
.lblTotal = Adodc1.Recordset.Fields(10)
'押金
.lblFirstPay = Adodc1.Recordset.Fields(11)
'应收款
.lblPay = Adodc1.Recordset.Fields(12)
.Show 1
End With
Else '取消结款
If MsgBox("是否取消结款?", vbYesNo, "请确认") = vbYes Then
If CurUser.UserType = 2 Then
MsgBox "没有权限"
Exit Sub
End If
MyPayFRoom.Delete (Adodc1.Recordset.Fields(0))
'设置入住登记状态
MyReg.Status = 2
MyReg.UpdateStatus (Adodc1.Recordset.Fields(0))
End If
End If
Refresh_Pay
End Sub
Private Sub Cmd_Search_Click()
Refresh_Pay
End Sub
Private Sub ComboStatus_Click()
If ComboStatus.ListIndex = 0 Then
Cmd_Pay.Caption = "结 款"
Else
Cmd_Pay.Caption = "取消结款"
End If
Refresh_Pay
End Sub
Private Sub Form_Load()
ComboStatus.ListIndex = 0
'刷新结款记录
Refresh_Pay
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -