📄 frmincomeedit.frm
字号:
VERSION 5.00
Begin VB.Form FrmIncomeEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑财务收款"
ClientHeight = 4215
ClientLeft = 45
ClientTop = 345
ClientWidth = 6375
Icon = "FrmIncomeEdit.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4215
ScaleWidth = 6375
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame3
Height = 3255
Left = 240
TabIndex = 8
Top = 120
Width = 5895
Begin VB.TextBox txtMemo
Height = 735
Left = 1320
MaxLength = 100
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Top = 2280
Width = 4335
End
Begin VB.TextBox txtAmount
Alignment = 1 'Right Justify
Height = 270
Left = 1320
MaxLength = 20
TabIndex = 4
Top = 1335
Width = 1455
End
Begin VB.ComboBox ComboIncomeType
Height = 300
ItemData = "FrmIncomeEdit.frx":0CCA
Left = 1320
List = "FrmIncomeEdit.frx":0CD4
Style = 2 'Dropdown List
TabIndex = 0
Top = 360
Width = 1455
End
Begin VB.TextBox txtClient
Alignment = 1 'Right Justify
Enabled = 0 'False
Height = 270
Left = 1320
MaxLength = 20
TabIndex = 2
Top = 855
Width = 1455
End
Begin VB.ComboBox ComboId
Height = 300
ItemData = "FrmIncomeEdit.frx":0CF0
Left = 4320
List = "FrmIncomeEdit.frx":0CF2
Style = 2 'Dropdown List
TabIndex = 1
Top = 360
Width = 1455
End
Begin VB.ComboBox ComboPay
Height = 300
ItemData = "FrmIncomeEdit.frx":0CF4
Left = 4320
List = "FrmIncomeEdit.frx":0D04
Style = 2 'Dropdown List
TabIndex = 3
Top = 840
Width = 1455
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注信息"
Height = 180
Left = 240
TabIndex = 18
Top = 2325
Width = 720
End
Begin VB.Label Label19
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "收款金额"
Height = 180
Left = 240
TabIndex = 17
Top = 1380
Width = 720
End
Begin VB.Label Label22
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "收款类型"
Height = 180
Left = 240
TabIndex = 16
Top = 420
Width = 720
End
Begin VB.Label Label23
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "客户名称"
Height = 180
Left = 240
TabIndex = 15
Top = 900
Width = 720
End
Begin VB.Label Label24
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "付款方式"
Height = 180
Left = 3240
TabIndex = 14
Top = 900
Width = 720
End
Begin VB.Label Label21
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "凭单编号"
Height = 180
Left = 3240
TabIndex = 13
Top = 420
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "收款日期"
Height = 180
Left = 3240
TabIndex = 12
Top = 1860
Width = 720
End
Begin VB.Label Label27
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "经办人"
Height = 180
Left = 240
TabIndex = 11
Top = 1860
Width = 540
End
Begin VB.Label lblOptDate
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "OptDate"
Height = 180
Left = 4320
TabIndex = 10
Top = 1860
Width = 630
End
Begin VB.Label lblEmpName
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "EmpName"
Height = 180
Left = 1320
TabIndex = 9
Top = 1860
Width = 630
End
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 3670
MouseIcon = "FrmIncomeEdit.frx":0D20
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 7
Top = 3600
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 400
Left = 1510
MouseIcon = "FrmIncomeEdit.frx":102A
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 6
Top = 3600
Width = 1300
End
End
Attribute VB_Name = "FrmIncomeEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As Long
Public OriIncomeId As Long
Private Function Check() As Boolean
If Trim(ComboId.Text) = "" Then
MsgBox "请选择凭单编号"
Check = False
Exit Function
End If
If txtAmount = "" Then
MsgBox "请输入付款金额"
txtAmount.SetFocus
Check = False
Exit Function
End If
Check = True
End Function
Private Sub Cmd_OK_Click()
Dim TmpId As Long
If Check = False Then
Exit Sub
End If
With MyIncome
.OriId = Val(ComboId.Text)
.CltId = MyClt.GetId(txtClient.Text)
.IncomeType = ComboIncomeType.Text
.PayWay = ComboPay.Text
.Amount = Val(txtAmount)
.EmpName = CurUser.EmpName
.OptDate = Format(Now, "yyyy-mm-dd")
.Memo = MakeStr(txtMemo)
If Modify = False Then
.Insert
Else
.Update (OriIncomeId)
End If
End With
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub ComboId_Click()
'如果没有收款单号则返回
If ComboId.Text = "" Then
Exit Sub
End If
'销售收款
If ComboIncomeType.ListIndex = 0 Then
'根据收款单号,读取收款信息到MySales对象中
MySales.GetInfo (Val(ComboId.Text))
'根据MySales对象中的客户编号MySales.Client,读取客户名称
txtClient = MyClt.GetName(MySales.ClientId)
Else
'采购退货收款
'根据收款单号,读取收款信息到MyOrders对象中
MyOrders.GetInfo (Val(ComboId.Text))
'根据MyOrders对象中的客户编号MyOrders.Client,读取客户名称
txtClient = MyClt.GetName(MyOrders.ClientId)
End If
End Sub
Private Sub ComboIncomeType_Click()
If ComboIncomeType.ListIndex = 0 Then '销售收款
'读取所有的销售单号到数组ArrId()中
Call MySales.LoadId("销售", 0)
Else
'读取所有的采购退货单号到数组ArrId()中
Call MyOrders.LoadId("采购退货", 0)
End If
'清空凭单编号组合框
ComboId.Clear
'把数组ArrId()中的所有编号装入到ComboId组合框中
i = 0
Do While ArrId(i) > 0
ComboId.AddItem ArrId(i)
i = i + 1
Loop
'决定ComboId组合框的显示文本
If OriId = 0 Then
If ComboId.ListCount > 0 Then
ComboId.ListIndex = 0
End If
Else
If InCombo(Trim(OriId), ComboId) = True Then
ComboId.Text = Trim(OriId)
End If
End If
OriId = 0
If ComboIncomeType.ListIndex = 0 Then
'如果当前收款类型为销售收款,则根据凭单编号读取销售信息
MySales.GetInfo (Val(ComboId.Text))
'根据销售信息中的客户信息
txtClient = MyClt.GetName(MySales.ClientId)
Else
MyOrders.GetInfo (Val(ComboId.Text))
txtClient = MyClt.GetName(MyOrders.ClientId)
End If
End Sub
Private Sub txtAmount_KeyPress(KeyAscii As Integer)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -