📄 frmin_pztempletdesign.frm
字号:
BackColor = &H8000000B&
BackStyle = 0 'Transparent
Caption = "主管(&M):"
ForeColor = &H80000008&
Height = 180
Left = 7830
TabIndex = 13
Top = 135
Width = 825
End
End
Begin MSFlexGridLib.MSFlexGrid mFg
Height = 4365
Left = 0
TabIndex = 0
Top = 170
Width = 11505
_ExtentX = 20294
_ExtentY = 7699
_Version = 393216
Cols = 5
FixedCols = 0
BackColor = -2147483634
BackColorFixed = -2147483624
ForeColorFixed = 0
WordWrap = -1 'True
TextStyleFixed = 1
Appearance = 0
FormatString = "<科 目|<摘 要|<借 方 金 额||<贷 方 金 额"
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
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 240
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 15
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":0974
Key = "Cancel"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":0EB8
Key = "Save"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":0FCC
Key = "Append"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":1510
Key = "Preview"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":1A54
Key = "Print"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":1F98
Key = "Help"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":20AC
Key = "Quit"
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":2508
Key = "Query"
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":261C
Key = "Locate"
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":2A70
Key = "InsertRow"
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":2B84
Key = "DeleteRow"
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":2C98
Key = "First"
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":2DF8
Key = "Next"
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":2F58
Key = "Previous"
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletDesign.frx":30B8
Key = "Last"
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmIN_PzTempletDesign"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
'----------------------------------------------------------
'Const
Const VOUCHER_VIEWROWS = 6 '录入凭证的可见行数(窗体上 MsFlexGrid 的非固定行数)
'----------------------------------------------------------
'----------------------------------------------------------
'User Define Type
'“单张凭证数据”自定义结构
Private Type VoucherUDT
Summary As String '摘要
SubjectCode As String '科目代码
SubjectCodeOLD As String
SubjectName As String '科目名称
DBLdebit As Double '借方金额
DBLcredit As Double '贷方金额
SGNdebit As Integer '借方金额符号(1,-1)
SGNcredit As Integer '贷方金额符号(1,-1)
bHelpInputed As Boolean '是否已经输过辅助信息
'以下以 z 为前缀是为显示时排在靠后
zAmount As Double '数量
zPrice As Double '单价
zForeignMoney As Double '外币
zExchangeRate As Double '汇率
zCountModeName As String
zCountModeCode As String '“银行”之结算方式
zPersonName As String '“个人往来核算”之个人名称
zPersonCode As String ' 个人代码
zCustomerName As String '“客户往来核算”之客户名称
zCustomerCode As String ' 客户代码
zVendorName As String '“供应商往来核算”之供应商名称
zVendorCode As String ' 供应商代码
zCBDname As String '“客户或供应商核算”之业务员名称
zCBDcode As String ' 业务员代码
zBillNo As String '票号(银行或个人或客户或供应商)
zOccurDate As String '发生日期(同上)
zDepartmentName As String '“部门核算”之部门名称
zDepartmentCode As String ' 部门代码
zItemName As String '“项目核算”之项目名称
zItemCode As String ' 项目代码
CollectSubjectCode As String '汇总科目代码
bCollect As Boolean '是否已经汇总
zBillType As String '票据类型 yao add====================
End Type
'----------------------------------------------------------
'----------------------------------------------------------
'Variant
' Array
Dim m_aryVoucher() As VoucherUDT '凭证内容数组
Dim m_aryRefer(6) As Long '下标对应于表格的行标,值对应于凭证内容数组的下标
Dim m_aryKmCodeLen() As Integer '科目编码长度数组(如3、5、7、7)
' Boolean
Dim m_bManualScroll As Boolean '是否手工改变滚动条
' Integer
Dim m_iMfgOldRow As Integer 'MsFlexGrid的旧行次
' Form
'输入科目的辅助窗体已设置为全程变量
Dim frmH_Summ As frmIN_Summary '输入摘要的辅助窗体
' Interface use
Dim m_sTempletCode As String
Dim m_sVoucherType As String
Dim m_iAffixPieces As Integer
Dim COL_SUBJECT As Integer
Dim m_IsUseKmmc As Boolean '切换标志
'----------------------------------------------------------
Public Property Let usTempletCode(ByVal sTC As String)
m_sTempletCode = sTC
End Property
Public Property Let usVoucherType(ByVal sVT As String)
m_sVoucherType = sVT
End Property
Public Property Let uiAffixPieces(ByVal iAP As Integer)
m_iAffixPieces = iAP
End Property
Private Sub Form_Initialize()
Dim i As Long
'初始化凭证数据数组
ReDim m_aryVoucher(VOUCHER_VIEWROWS)
For i = LBound(m_aryVoucher) To UBound(m_aryVoucher)
m_aryVoucher(i).SGNdebit = 1
m_aryVoucher(i).SGNcredit = 1
Next i
'预置对应数组的值
For i = LBound(m_aryRefer) To UBound(m_aryRefer)
m_aryRefer(i) = i
Next i
'预置非手工改变滚动条的值
m_bManualScroll = False
Set frmH_Summ = New frmIN_Summary
frmH_Summ.ubSelectStatus = True
End Sub
Private Sub form_load()
Dim i As Long, j As Long
Dim sSQL As String
Dim rstKmCodeLevel As ADODB.Recordset
'----------------------------------------------------------
'操作:
' 设置 vaSpread;
' 设置 MsFlexGrid;
' 设置 VScrollBar;
'----------------------------------------------------------
m_IsUseKmmc = True
COL_SUBJECT = 0
With mFg
.Cols = 5
.Rows = VOUCHER_VIEWROWS + 1 '表格的行数为凭证显示的行数加 1 (表头)
'设列宽
.RowHeight(0) = 480
.ColWidth(0) = 3355 + 100 '科目
.ColWidth(1) = 3355 '摘要
.ColWidth(2) = 2237 '借方金额
.ColWidth(3) = 0 '分隔
.ColWidth(4) = 2237 '货方金额
'表头文字居中(此操作触发了 mFg_LeaveCell 事件)
For j = 0 To .Cols - 1
.Row = 0
.Col = j
.CellAlignment = 4
Next j
'设行高
For i = 1 To .Rows - 1
.RowHeight(i) = 480
Next i
.Row = 1
.Col = 0
End With
'置滚动条处于充满状态
vSb.Max = 0
vSb.Min = 0
'打开编码方案数据集,生成科目编码方案字符串
Set rstKmCodeLevel = New ADODB.Recordset
With rstKmCodeLevel
.CursorLocation = adUseClient
.Open "select * from tUSU_dmjs where Type='科目' order by JC", _
glo.cnnMain, adOpenStatic, adLockReadOnly
ReDim m_aryKmCodeLen(.RecordCount)
i = 1
.MoveFirst
Do Until .EOF
If i = 1 Then
m_aryKmCodeLen(i) = .Fields("ws").value
Else
m_aryKmCodeLen(i) = m_aryKmCodeLen(i - 1) + .Fields("ws").value
End If
i = i + 1
.MoveNext
Loop
.Close
End With
'本过程结束后,由于 mFg 的 TabIndex 为 0,因此将触发 mFg_GotFocus 事件, _
从而在 Mfg 的 1 行 0 列显示编辑框及按钮
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload frmH_Summ
End Sub
Public Sub ExecuteDesign()
Call FillMe
Me.Show 1
End Sub
Private Sub FillMe()
txtTempletCode.text = m_sTempletCode
cboPZZL.text = m_sVoucherType
txtFJZS.text = m_iAffixPieces
Call FillArray_Voucher
Call ReFillGrid(1)
End Sub
Private Sub PrintAll(strPrt As String)
Dim frmP As Form
Dim i As Integer
If Printers.Count = 0 Then
MsgBox "未安装打印。", vbInformation
Exit Sub
End If
On Error GoTo errhandle
Dim bForeignPz As Boolean
If Printers.Count = 0 Then
MsgBox "未安装打印机。", vbInformation
Exit Sub
End If
bForeignPz = False
For i = LBound(m_aryVoucher) To UBound(m_aryVoucher)
If m_aryVoucher(i).zForeignMoney <> 0 Then
bForeignPz = True
Exit For
End If
Next i
If glo.detailPrintMode = "套打" Then
If bForeignPz Then
PzPrint IIf(strPrt = "PRINT", True, False), GetSetting(App.Title, "Settings", "fCellFile", App.Path + "\CellFiles\外币凭证.cll")
Else
PzPrint IIf(strPrt = "PRINT", True, False), GetSetting(App.Title, "Settings", "nCellFile", App.Path + "\CellFiles\凭证.cll")
End If
Else
If bForeignPz Then
PzPrint IIf(strPrt = "PRINT", True, False), GetSetting(App.Title, "Settings", "sfCellFile", App.Path + "\CellFiles\实打外币凭证.cll")
Else
PzPrint IIf(strPrt = "PRINT", True, False), GetSetting(App.Title, "Settings", "snCellFile", App.Path + "\CellFiles\实打凭证.cll")
End If
End If
Exit Sub
errhandle:
MsgBox "请到打印设置中定义凭证纸张大小!", vbInformation
' Unload frmP
End Sub
Private Sub mFg_KeyDown(KeyCode As Integer, Shift As Integer)
'上下翻页
If KeyCode = 33 And Shift = 0 Then
PageUp
End If
If KeyCode = 34 And Shift = 0 Then
PageDown
End If
'名称与代码切换 F8
If KeyCode = 119 And Shift = 0 Then
m_IsUseKmmc = Not m_IsUseKmmc
Call ReFillGrid(vSb.value + 1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -