📄 frmwriteoffbill.frm
字号:
VERSION 5.00
Object = "{81110CCB-022B-11D3-A348-0080C89152FF}#1.3#0"; "ORAGLIST.OCX"
Begin VB.Form frmWriteOffBill
BorderStyle = 1 'Fixed Single
Caption = "冲销"
ClientHeight = 2370
ClientLeft = 45
ClientTop = 330
ClientWidth = 4560
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2370
ScaleWidth = 4560
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancel
Height = 375
Left = 3240
Style = 1 'Graphical
TabIndex = 1
Tag = "1002"
Top = 660
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton cmdOK
Height = 375
Left = 3240
Style = 1 'Graphical
TabIndex = 0
Tag = "1001"
Top = 240
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.Frame Frame1
Caption = "选择需要冲销的应付单"
Height = 2055
Left = 90
TabIndex = 2
Top = 180
Width = 3015
Begin ListRefer.ListText lstNO
Height = 300
Left = 1200
TabIndex = 10
Top = 1590
Width = 1635
_ExtentX = 2884
_ExtentY = 529
CodeSort = -1 'True
SeekCol = "1,2"
BackColor = -2147483643
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.ComboBox cmbSelect
Height = 300
Index = 2
Left = 1200
Style = 2 'Dropdown List
TabIndex = 8
Top = 1170
Width = 1635
End
Begin VB.ComboBox cmbSelect
Height = 300
Index = 1
Left = 1200
Style = 2 'Dropdown List
TabIndex = 6
Top = 750
Width = 1635
End
Begin VB.ComboBox cmbSelect
Height = 300
Index = 0
Left = 1200
Style = 2 'Dropdown List
TabIndex = 4
Top = 330
Width = 1635
End
Begin VB.Label lblName
AutoSize = -1 'True
Caption = "单据编号(&C)"
Height = 180
Index = 3
Left = 150
TabIndex = 9
Top = 1650
Width = 990
End
Begin VB.Label lblName
AutoSize = -1 'True
Caption = "单据类型(&T)"
Height = 180
Index = 2
Left = 150
TabIndex = 7
Top = 1230
Width = 990
End
Begin VB.Label lblName
AutoSize = -1 'True
Caption = "会计期间(&P)"
Height = 180
Index = 1
Left = 150
TabIndex = 5
Top = 810
Width = 990
End
Begin VB.Label lblName
AutoSize = -1 'True
Caption = "会计年度(&Y)"
Height = 180
Index = 0
Left = 150
TabIndex = 3
Top = 390
Width = 990
End
End
End
Attribute VB_Name = "frmWriteOffBill"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'选择冲销单据窗体
'作者:苏梦
Option Explicit
Private my_lngReceiptTypeID As Long '单据类型ID
Private my_lngActivityID As Long '单据ID
Private my_lngVoucherTypeID As Long
Private my_intYear As Integer
Private my_bytPeriod As Byte
Private my_blnIsSpecial As Boolean
Private blnSucceed As Boolean
Private mstrName As String
Private mblnSeek As Boolean '定位、冲销标志
Private mstrUse As String '用途
Private mblnView As Boolean '查询权限
Private mblnStart As Boolean '查询权限
Public Function WriteOffBill(ByVal lngReceiptTypeID As Long, Optional ByVal lngActivityID As Long, Optional ByVal lnghWnd As Long = 0, Optional ByVal lngVoucherTypeID _
As Long, Optional ByVal intYear As Integer = 0, Optional ByVal bytPeriod As Byte = 0, Optional ByVal blnIsSpecial As Boolean) As Long
'调用接口
'lngReceiptTypeID ---- 单据类型ID
'lngActivityID ---- 单据ID
'lngHwnd ---- 调用窗体句柄
'lngVoucherTypeID ---- 凭证类型ID
'intYear ---- 默认会计年度
'bytPeriod ---- 默认会计期间
'blnIsSpecial ---- 收付款单采购付款/销售收款标志
If lngReceiptTypeID <= 0 Then
Exit Function
End If
my_lngReceiptTypeID = lngReceiptTypeID
my_lngActivityID = lngActivityID
my_lngVoucherTypeID = lngVoucherTypeID
my_intYear = intYear
my_bytPeriod = bytPeriod
my_blnIsSpecial = blnIsSpecial
mblnSeek = False
mstrUse = "冲销"
If blnBillCanWriteOff(lnghWnd) = False Then
Unload Me
my_lngActivityID = 0
WriteOffBill = 0
Exit Function
End If
On Error GoTo ErrHandle
Me.Show vbModal
WriteOffBill = my_lngActivityID
Exit Function
ErrHandle:
' Unload Me
WriteOffBill = 0
End Function
Public Function SeekBill(ByVal lngReceiptTypeID As Long, Optional ByVal lngActivityID As Long, Optional ByVal lnghWnd As Long = 0, Optional ByVal lngVoucherTypeID _
As Long, Optional ByVal intYear As Integer = 0, Optional ByVal bytPeriod As Byte = 0, Optional ByVal blnIsSpecial As Boolean) As Long
'调用接口
'lngReceiptTypeID ---- 单据类型ID
'lngActivityID ---- 单据ID
'lngHwnd ---- 调用窗体句柄
'lngVoucherTypeID ---- 凭证类型ID
'intYear ---- 默认会计年度
'bytPeriod ---- 默认会计期间
'blnIsSpecial ---- 收付款单采购付款/销售收款标志
If lngReceiptTypeID <= 0 Then
Exit Function
End If
my_lngReceiptTypeID = lngReceiptTypeID
my_lngActivityID = lngActivityID
my_lngVoucherTypeID = lngVoucherTypeID
my_intYear = intYear
my_bytPeriod = bytPeriod
my_blnIsSpecial = blnIsSpecial
mblnSeek = True
mstrUse = "查找"
' If blnBillCanWriteOff(lnghWnd) = False Then
' Unload Me
' my_lngActivityID = 0
' WriteOffBill = 0
' Exit Function
' End If
On Error GoTo ErrHandle
Me.Show vbModal
SeekBill = my_lngActivityID
Exit Function
ErrHandle:
' Unload Me
SeekBill = 0
End Function
Private Sub cmbSelect_lostfocus(Index As Integer)
If cmbSelect(Index).ListIndex <> 0 Then
If Trim(cmbSelect(Index).list(cmbSelect(Index).ListIndex)) = Trim(cmbSelect(Index).Text) Then
Exit Sub
End If
ElseIf cmbSelect(Index).Text = "" Then
Exit Sub
End If
Dim i As Long
For i = 0 To cmbSelect(Index).ListCount - 1
If cmbSelect(Index).list(i) = cmbSelect(Index).Text Then
cmbSelect(Index).ListIndex = i
Exit For
End If
Next
If cmbSelect(Index).ListIndex < 0 Then
cmbSelect(Index).Text = ""
End If
End Sub
Private Sub cmbSelect_Click(Index As Integer)
If Index = 3 Then
Exit Sub
End If
Select Case Index
Case 0
If my_intYear <> C2lng(cmbSelect(0).Text) Then
my_intYear = C2lng(cmbSelect(0).Text)
SetPeriod
SetBillNO
End If
Case 1
If my_bytPeriod <> C2lng(cmbSelect(1).Text) Then
my_bytPeriod = C2lng(cmbSelect(1).Text)
SetBillNO
End If
Case 2
If my_lngVoucherTypeID <> C2lng(cmbSelect(2).ItemData(cmbSelect(2).ListIndex)) Then
my_lngVoucherTypeID = C2lng(cmbSelect(2).ItemData(cmbSelect(2).ListIndex))
SetBillNO
End If
Case 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -