资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:100k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Begin VB.Form CL_MakeVoucherSub
- BorderStyle = 3 'Fixed Dialog
- Caption = "确认修改科目"
- ClientHeight = 5805
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 9375
- HelpContextID = 130407
- Icon = "处理_生成凭证子窗体.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5805
- ScaleWidth = 9375
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 '屏幕中心
- Begin VB.ComboBox Combo1
- Height = 315
- Left = 1020
- Style = 2 'Dropdown List
- TabIndex = 2
- Top = 5310
- Width = 2070
- End
- Begin VB.CommandButton cmd_Ok
- Caption = "确定(&O)"
- Height = 300
- Left = 6960
- TabIndex = 0
- Top = 5370
- Width = 1120
- End
- Begin VB.CommandButton cmd_Cancel
- Caption = "取消(&C)"
- Height = 300
- Left = 8190
- TabIndex = 1
- Top = 5370
- Width = 1120
- End
- Begin VB.TextBox Ydtext
- BackColor = &H00C0FFFF&
- BorderStyle = 0 'None
- Height = 300
- Left = 3270
- MultiLine = -1 'True
- TabIndex = 8
- Top = 5340
- Visible = 0 'False
- Width = 1185
- End
- Begin VB.ComboBox YdCombo
- Height = 315
- Left = 4500
- Style = 2 'Dropdown List
- TabIndex = 7
- Top = 5340
- Visible = 0 'False
- Width = 1695
- End
- Begin VB.Timer Timer1
- Interval = 1
- Left = 5250
- Top = 5310
- End
- Begin VB.CommandButton Ydcommand
- Height = 300
- Left = 6240
- Picture = "处理_生成凭证子窗体.frx":1042
- Style = 1 'Graphical
- TabIndex = 6
- Top = 5520
- Visible = 0 'False
- Width = 300
- End
- Begin VSFlex8Ctl.VSFlexGrid vsFlex_PzMain
- Height = 2475
- Left = 90
- TabIndex = 5
- Top = 6030
- Width = 4125
- _cx = 5080
- _cy = 5080
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = -2147483636
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 1
- Cols = 7
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin VSFlex8Ctl.VSFlexGrid vsFlex_PzChild
- Height = 2475
- Left = 4290
- TabIndex = 4
- Top = 6030
- Width = 4935
- _cx = 5080
- _cy = 5080
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = -2147483636
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 1
- Cols = 29
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin VSFlex8Ctl.VSFlexGrid WglrGrid
- Height = 5115
- Left = 90
- TabIndex = 3
- Top = 90
- Width = 9195
- _cx = 5080
- _cy = 5080
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483643
- ForeColorSel = -2147483640
- BackColorBkg = 8421504
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin VB.Label Label2
- Caption = "凭证类型:"
- Height = 255
- Left = 120
- TabIndex = 10
- Top = 5370
- Width = 825
- End
- Begin VB.Label Lab_OperStatus
- BackColor = &H000080FF&
- Caption = "1"
- Height = 345
- Left = 6600
- TabIndex = 9
- Top = 5430
- Visible = 0 'False
- Width = 345
- End
- End
- Attribute VB_Name = "CL_MakeVoucherSub"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '**************************************************************************
- '* 模 块 名 称 : 生成凭证子窗体
- '* 功 能 描 述 :
- '* 程序员姓名 : 杨波
- '* 最后修改人 : 杨波
- '* 最后修改时间: 2000/10/09
- '* 备 注: 一 .WglrGrid.TextMatrix(Yxxpdh, 6)中存放生成凭证的各种情况
- '**************************************************************************
- '其它固定使用变量
- Dim Tsxx As String '系统信息提示(Fixed)
- Dim ReportTitle As String '报表主标题(Fixed)
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Pmbcsjhs As Long '屏幕网格保持数据行数(大于等于1)
- Dim Fzxwghs As Integer '辅助项网格行数(包括合计行)
- Dim Sfxshjwg As Boolean '是否显示合计网格
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Sfblbzkd As Boolean '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
- Dim Dqlrwgh As Long '当前录入数据网格行
- Dim Dqlrwgl As Long '当前录入数据网格列
- Dim Dqlkwgh As Long '刚刚离开网格行(不一定为录入行)
- Dim Dqlkwgl As Long '刚刚离开网格列
- Dim Dqtoprow As Long '当前录入状态时最上端可视行
- Dim Dqleftcol As Long '当前录入状态时最左端可视列
- Dim Zdlrqnr As String '字段录入修改前内容(用来判断内容是否修改)
- Dim Wbkbhlock As Boolean '文本框改变值锁
- Dim Changelock As Boolean '网格行列改变控制锁(用来区别用户改变.程序改变)
- Dim Gdtlock As Boolean '滚动条滚动控制(用来区别用户改变.程序改变)
- Dim Yxxpdlock As Boolean '字段有效性判断锁(内容不修改不需进行字段有效性判断)
- Dim Hyxxpdlock As Boolean '行有效性判断锁(字段内容不修改不需进行行有效性判断)
- Dim Valilock As Boolean '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
- Dim Shsfts As Boolean '删除记录行是否提示
- Dim Szzls As Integer '网格信息数组最大下标值(网格列数-1)
- Private Sub cmd_Cancel_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- Unload Me
- End Sub
- Private Sub cmd_Ok_Click()
- Dim count As Long '循环变量
- Dim countrow As Integer '循环变量
- Dim PzCount As Integer '循环变量
- Dim Note As String '摘要
- Dim InoutMainIdValue As Integer '单据主表ID
- Dim InoutSubIdValue As Integer '单据子表ID
- Dim WuLiaoCodeValue As String '物料科目编码
- Dim WuliaoNameValue As String '物料科目名称
- Dim DuifangCodeValue As String '对方科目编码
- Dim DuifangNameValue As String '对方科目名称
- Dim ChaYiCodeValue As String '差异科目编码
- Dim ChaYiNameValue As String '差异科目名称
- Dim WuLiaoCodeValue1 As String '物料科目编码
- Dim DuifangCodeValue1 As String '对方科目编码
- Dim ChaYiCodeValue1 As String '差异科目编码
- Dim Money As Double '金额
- Dim WuLiaoMoney As Double '物料科目金额
- Dim DuiFangMoney As Double '对方料日金额
- Dim JieFangMoney As Double '借方金额
- Dim DaiFangMoney As Double '贷方金额
- Dim IsInoutMainID As Boolean '判断单据主表ID是否相同
- Dim PzBillNum As Integer '凭证单据号
- '存货科目、差异科目、对方科目不能全部为空
- For count = WglrGrid.FixedRows To WglrGrid.Rows - WglrGrid.FixedRows
- If WglrGrid.TextMatrix(count, Sydz("007", GridStr(), Szzls)) = "" And WglrGrid.TextMatrix(count, Sydz("008", GridStr(), Szzls)) = "" And WglrGrid.TextMatrix(count, Sydz("009", GridStr(), Szzls)) = "" Then
- Tsxx = "存货科目、差异科目、对方科目不能全部为空!"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- End If
- Hyxxpdlock = False
- If Not Sjhzyxxpd(count) Then
- Exit Sub
- End If
- Next count
- '凭证类别不能为空
- If Trim(Combo1.Text) = "" Then
- Tsxx = "请选择凭证类型"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- End If
- vouchz = Trim(Mid(Trim(Combo1.Text), 1, 2))
- '凭证为“生成”
- If CL_MakeVoucher.PzType = 0 Then
- With WglrGrid
- '向vsflex_pzmain中加入记录
- IsInoutMainID = False
- For count = .FixedRows To .Rows - .FixedRows
- '根据单据类型填充主子表ID
- Select Case .TextMatrix(count, 4)
- Case "1301", "1302", "1303"
- InoutMainIdValue = Trim(.TextMatrix(count, 2))
- InoutSubIdValue = Trim(.TextMatrix(count, 3))
- Case Else
- InoutMainIdValue = Trim(.TextMatrix(count, 0))
- InoutSubIdValue = Trim(.TextMatrix(count, 1))
- End Select
- '合并主表ID相同的单据
- For countrow = vsFlex_PzMain.FixedRows To vsFlex_PzMain.Rows - vsFlex_PzMain.FixedRows
- If Trim(vsFlex_PzMain.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzMain.TextMatrix(countrow, 5)) = InoutSubIdValue Then
- IsInoutMainID = True
- Exit For
- End If
- Next countrow
- If IsInoutMainID = False Then
- vsFlex_PzMain.AddItem ""
- vsFlex_PzMain.TextMatrix(vsFlex_PzMain.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzMain.TextMatrix(vsFlex_PzMain.Rows - 1, 1) = Xtrq
- vsFlex_PzMain.TextMatrix(vsFlex_PzMain.Rows - 1, 2) = 1
- vsFlex_PzMain.TextMatrix(vsFlex_PzMain.Rows - 1, 4) = Trim(.TextMatrix(count, 6))
- vsFlex_PzMain.TextMatrix(vsFlex_PzMain.Rows - 1, 5) = InoutSubIdValue
- vsFlex_PzMain.TextMatrix(vsFlex_PzMain.Rows - 1, 6) = Trim(.TextMatrix(count, 4))
- Else
- IsInoutMainID = False
- End If
- Next count
- For PzCount = vsFlex_PzMain.FixedRows To vsFlex_PzMain.Rows - 1
- InoutMainIdValue = Trim(vsFlex_PzMain.TextMatrix(PzCount, 0))
- InoutSubIdValue = Trim(vsFlex_PzMain.TextMatrix(PzCount, 5))
- '非计划价法的出入库单,计划价法出库单,无差异的计划价法入库单,非计划价的调整单,不进行差异处理的计划价调整单
- If Trim(.TextMatrix(PzCount, 6)) = "1" Or Trim(.TextMatrix(PzCount, 6)) = "4" Then
- Call InOutMakePz(InoutMainIdValue, InoutSubIdValue)
- End If
- '有差异的计划价法入库单
- If Trim(.TextMatrix(PzCount, 6)) = "2" Then
- Call InPlanMakePz(InoutMainIdValue, InoutSubIdValue)
- End If
- '进行差异处理的计划价调整单
- If Trim(.TextMatrix(PzCount, 6)) = "3" Then
- Call PlanAdjustPz(InoutMainIdValue, InoutSubIdValue)
- End If
- '差异结转单
- If Trim(.TextMatrix(PzCount, 6)) = "5" Then
- Call EvaluPz(InoutMainIdValue)
- End If
- Next PzCount
- End With
- CL_PzFrm.lbl_Tag = 0
- End If
- Dim Same As Boolean
- '合并生成凭证
- If CL_MakeVoucher.PzType = 1 Then
- With WglrGrid
- '向vsflex_pzmain中加入记录,物料科目、对方科目、差异科目都相同合并
- For count = .FixedRows To .Rows - .FixedRows
- WuLiaoCodeValue = Trim(.TextMatrix(count, Sydz("007", GridStr(), Szzls)))
- ChaYiCodeValue = Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls)))
- DuifangCodeValue = Trim(.TextMatrix(count, Sydz("009", GridStr(), Szzls)))
- For countrow = vsFlex_PzMain.FixedRows To vsFlex_PzMain.Rows - vsFlex_PzMain.FixedRows
- WuLiaoCodeValue1 = Trim(vsFlex_PzMain.TextMatrix(countrow, 0))
- ChaYiCodeValue1 = Trim(vsFlex_PzMain.TextMatrix(countrow, 1))
- DuifangCodeValue1 = Trim(vsFlex_PzMain.TextMatrix(countrow, 2))
- If WuLiaoCodeValue = WuLiaoCodeValue1 And ChaYiCodeValue = ChaYiCodeValue1 And DuifangCodeValue = DuifangCodeValue1 Then
- Same = True
- Exit For
- End If
- Same = False
- Next countrow
- If Not Same Then
- vsFlex_PzMain.AddItem ""
- vsFlex_PzMain.TextMatrix(countrow, 0) = WuLiaoCodeValue
- vsFlex_PzMain.TextMatrix(countrow, 1) = ChaYiCodeValue
- vsFlex_PzMain.TextMatrix(countrow, 2) = DuifangCodeValue
- vsFlex_PzMain.TextMatrix(countrow, 4) = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- End If
- Next count
- '根据物料科目、对方科目、差异科目计算借方、贷方金额
- For countrow = vsFlex_PzMain.FixedRows To vsFlex_PzMain.Rows - vsFlex_PzMain.FixedRows
- WuLiaoCodeValue1 = Trim(vsFlex_PzMain.TextMatrix(countrow, 0))
- ChaYiCodeValue1 = Trim(vsFlex_PzMain.TextMatrix(countrow, 1))
- DuifangCodeValue1 = Trim(vsFlex_PzMain.TextMatrix(countrow, 2))
- Note = Trim(.TextMatrix(countrow, Sydz("010", GridStr(), Szzls)))
- WuLiaoMoney = 0
- DuiFangMoney = 0
- JieFangMoney = 0
- DaiFangMoney = 0
- For count = .FixedRows To .Rows - .FixedRows
- WuLiaoCodeValue = Trim(.TextMatrix(count, Sydz("007", GridStr(), Szzls)))
- ChaYiCodeValue = Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls)))
- DuifangCodeValue = Trim(.TextMatrix(count, Sydz("009", GridStr(), Szzls)))
- If WuLiaoCodeValue = WuLiaoCodeValue1 And ChaYiCodeValue = ChaYiCodeValue1 And DuifangCodeValue = DuifangCodeValue1 Then
- WuliaoNameValue = Trim(.TextMatrix(count, Sydz("004", GridStr(), Szzls)))
- ChaYiNameValue = Trim(.TextMatrix(count, Sydz("005", GridStr(), Szzls)))
- DuifangNameValue = Trim(.TextMatrix(count, Sydz("006", GridStr(), Szzls)))
- Select Case WglrGrid.TextMatrix(count, 6)
- Case "3", "5"
- If Trim(WglrGrid.TextMatrix(count, 4)) = "1303" Then
- JieFangMoney = JieFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- DaiFangMoney = DaiFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- Else
- JieFangMoney = JieFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- DaiFangMoney = DaiFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- End If
- If JieFangMoney <> 0 Then
- DuiFangMoney = JieFangMoney
- Else
- DuiFangMoney = DaiFangMoney
- End If
- Case Else
- If Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls))) And Trim(.TextMatrix(count, 5)) = "计划价法" Then
- WuLiaoMoney = WuLiaoMoney + Format(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- DuiFangMoney = DuiFangMoney + Format(Val(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls))) + Val(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls))) - Val(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls))), "#####." + String(Xtjexsws, "0"))
- Else
- WuLiaoMoney = WuLiaoMoney + Format(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- DuiFangMoney = DuiFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- End If
- If Not Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls))) Then
- WuLiaoMoney = WuLiaoMoney + Format(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- DuiFangMoney = DuiFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- End If
- JieFangMoney = JieFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- DaiFangMoney = DaiFangMoney + Format(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)), "#####." + String(Xtjexsws, "0"))
- End Select
- End If
- Next count
- If WuLiaoCodeValue1 <> "" Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = WuLiaoCodeValue1
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = WuliaoNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "1"
- If Trim(vsFlex_PzMain.TextMatrix(countrow, 4)) Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = WuLiaoMoney
- Else
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = WuLiaoMoney
- End If
- End If
- If DuifangCodeValue1 <> "" Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = DuifangCodeValue1
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = DuifangNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "2"
- If Trim(vsFlex_PzMain.TextMatrix(countrow, 4)) Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = DuiFangMoney
- Else
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = DuiFangMoney
- End If
- End If
- If ChaYiCodeValue1 <> "" Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = ChaYiCodeValue1
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = ChaYiNameValue
- If Val(JieFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = JieFangMoney
- End If
- If Val(DaiFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = DaiFangMoney
- End If
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "3"
- End If
- Next countrow
- End With
- CL_PzFrm.lbl_Tag = 1
- End If
- Me.Hide
- CL_PzFrm.LoadMassage = 0
- CL_PzFrm.Show 1
- End Sub
- Private Sub InOutMakePz(InoutMainIdValue As Integer, InoutSubIdValue As Integer)
- Dim count As Integer '循环变量
- Dim Note As String '摘要
- Dim WuLiaoCodeValue As String '存货科目代码
- Dim WuliaoNameValue As String '存货科目名称
- Dim ISinout As Boolean '收发记录标志
- Dim Money As Double '金额
- Dim countrow As Integer '循环变量
- Dim IsPzInoutMainID As Boolean
- Dim DuifangCodeValue As String '对方科目编码
- Dim DuifangNameValue As String '对方科目名称
- With WglrGrid
- '计算物料科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue And Trim(.TextMatrix(count, 1)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- WuLiaoCodeValue = Trim(.TextMatrix(count, Sydz("007", GridStr(), Szzls)))
- WuliaoNameValue = Trim(.TextMatrix(count, Sydz("004", GridStr(), Szzls)))
- ISinout = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- If ISinout Then
- Money = Val(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)))
- Else
- Money = Val(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)))
- End If
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = WuLiaoCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "1" Then
- IsPzInoutMainID = True
- If ISinout Then
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + Money
- Else
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + Money
- End If
- Exit For
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = WuLiaoCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = WuliaoNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "1"
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- If ISinout Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = Money
- Else
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = Money
- End If
- End If
- End If
- Next count
- '计算对方科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue And Trim(.TextMatrix(count, 1)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- DuifangCodeValue = Trim(.TextMatrix(count, Sydz("009", GridStr(), Szzls)))
- DuifangNameValue = Trim(.TextMatrix(count, Sydz("006", GridStr(), Szzls)))
- ISinout = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- If ISinout Then
- Money = Trim(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)))
- Else
- Money = Trim(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)))
- End If
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "2" Then
- IsPzInoutMainID = True
- If ISinout Then
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + Money
- Else
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + Money
- End If
- Exit For
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = DuifangCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = DuifangNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "2"
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- If ISinout Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = Money
- Else
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = Money
- End If
- End If
- End If
- Next count
- End With
- End Sub
- Private Sub InPlanMakePz(InoutMainIdValue As Integer, InoutSubIdValue As Integer)
- Dim count As Integer '循环变量
- Dim Note As String '摘要
- Dim WuLiaoCodeValue As String '存货科目代码
- Dim WuliaoNameValue As String '存货科目名称
- Dim ISinout As Boolean '收发记录标志
- Dim Money As Double '金额
- Dim countrow As Integer '循环变量
- Dim IsPzInoutMainID As Boolean
- Dim DuifangCodeValue As String '对方科目代码
- Dim DuifangNameValue As String '对方科目名称
- Dim ChaYiCodeValue As String '差异科目代码
- Dim ChaYiNameValue As String '差异科目名称
- Dim JieFangMoney As Double '借方金额
- Dim DaiFangMoney As Double '贷方金额
- With WglrGrid
- '计算物料科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue And Trim(.TextMatrix(count, 1)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- WuLiaoCodeValue = Trim(.TextMatrix(count, Sydz("007", GridStr(), Szzls)))
- WuliaoNameValue = Trim(.TextMatrix(count, Sydz("004", GridStr(), Szzls)))
- ISinout = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- Money = Trim(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)))
- If ISinout Then
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = WuLiaoCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "1" Then
- IsPzInoutMainID = True
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + Money
- Exit For
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = WuLiaoCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = WuliaoNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "1"
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = Money
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- End If
- End If
- End If
- Next count
- '计算对方科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue And Trim(.TextMatrix(count, 1)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- DuifangCodeValue = Trim(.TextMatrix(count, Sydz("009", GridStr(), Szzls)))
- DuifangNameValue = Trim(.TextMatrix(count, Sydz("006", GridStr(), Szzls)))
- ISinout = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- Money = Val(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls))) + Val(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls))) - Val(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)))
- If ISinout Then
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "2" Then
- IsPzInoutMainID = True
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + Money
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = DuifangCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = DuifangNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "2"
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = Money
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- End If
- End If
- End If
- Next count
- '计算差异科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue And Trim(.TextMatrix(count, 1)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- ChaYiCodeValue = Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls)))
- ChaYiNameValue = Trim(.TextMatrix(count, Sydz("005", GridStr(), Szzls)))
- JieFangMoney = Trim(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls)))
- DaiFangMoney = Trim(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)))
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls))) <> "" Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "3" Then
- IsPzInoutMainID = True
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + JieFangMoney
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + DaiFangMoney
- Exit For
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = True
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = ChaYiCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = ChaYiNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- If Val(JieFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = JieFangMoney
- End If
- If Val(DaiFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = DaiFangMoney
- End If
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "3"
- End If
- End If
- Next count
- End With
- End Sub
- Private Sub PlanAdjustPz(InoutMainIdValue As Integer, InoutSubIdValue As Integer)
- Dim count As Integer '循环变量
- Dim Note As String '摘要
- Dim ISinout As Boolean '收发记录标志
- Dim Money As Double '金额
- Dim countrow As Integer '循环变量
- Dim IsPzInoutMainID As Boolean
- Dim DuifangCodeValue As String '对方科目代码
- Dim DuifangNameValue As String '对方科目名称
- Dim ChaYiCodeValue As String '差异科目代码
- Dim ChaYiNameValue As String '差异科目名称
- Dim JieFangMoney As Double '借方金额
- Dim DaiFangMoney As Double '贷方金额
- With WglrGrid
- '计算对方科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 2)) = InoutMainIdValue And Trim(.TextMatrix(count, 3)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- DuifangCodeValue = Trim(.TextMatrix(count, Sydz("009", GridStr(), Szzls)))
- DuifangNameValue = Trim(.TextMatrix(count, Sydz("006", GridStr(), Szzls)))
- ISinout = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- If Trim(.TextMatrix(count, 4)) = "1303" Then
- If ISinout Then
- Money = Val(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)))
- Else
- Money = Val(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)))
- End If
- Else
- If ISinout Then
- Money = Val(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls)))
- Else
- Money = Val(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)))
- End If
- End If
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "2" Then
- IsPzInoutMainID = True
- If ISinout Then
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + Money
- Else
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + Money
- End If
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = DuifangCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = DuifangNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "2"
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- If ISinout Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = Money
- Else
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = Money
- End If
- End If
- End If
- Next count
- '计算差异科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 2)) = InoutMainIdValue And Trim(.TextMatrix(count, 3)) = InoutSubIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- ChaYiCodeValue = Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls)))
- ChaYiNameValue = Trim(.TextMatrix(count, Sydz("005", GridStr(), Szzls)))
- ISinout = Trim(.TextMatrix(count, Sydz("011", GridStr(), Szzls)))
- If Trim(.TextMatrix(count, 4)) = "1303" Then
- If ISinout Then
- JieFangMoney = Val(WglrGrid.TextMatrix(count, Sydz("013", GridStr(), Szzls)))
- Else
- DaiFangMoney = Val(WglrGrid.TextMatrix(count, Sydz("015", GridStr(), Szzls)))
- End If
- Else
- If ISinout Then
- JieFangMoney = Val(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls)))
- Else
- DaiFangMoney = Val(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)))
- End If
- End If
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 28)) = InoutSubIdValue Then
- If Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls))) <> "" Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "3" Then
- IsPzInoutMainID = True
- If ISinout Then
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + JieFangMoney
- Else
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + DaiFangMoney
- End If
- Exit For
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = True
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = ChaYiCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = ChaYiNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 28) = InoutSubIdValue
- If Val(JieFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = JieFangMoney
- End If
- If Val(DaiFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = DaiFangMoney
- End If
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "3"
- End If
- End If
- Next count
- End With
- End Sub
- Private Sub EvaluPz(InoutMainIdValue As Integer)
- Dim count As Integer '循环变量
- Dim Note As String '摘要
- Dim ISinout As Boolean '收发记录标志
- Dim Money As Double '金额
- Dim countrow As Integer '循环变量
- Dim IsPzInoutMainID As Boolean
- Dim DuifangCodeValue As String '对方科目代码
- Dim DuifangNameValue As String '对方科目名称
- Dim ChaYiCodeValue As String '差异科目代码
- Dim ChaYiNameValue As String '差异科目名称
- Dim JieFangMoney As Double '借方金额
- Dim DaiFangMoney As Double '贷方金额
- With WglrGrid
- '计算对方科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- DuifangCodeValue = Trim(.TextMatrix(count, Sydz("009", GridStr(), Szzls)))
- DuifangNameValue = Trim(.TextMatrix(count, Sydz("006", GridStr(), Szzls)))
- Money = Val(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)))
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "2" Then
- IsPzInoutMainID = True
- vsFlex_PzChild.TextMatrix(countrow, 4) = Val(vsFlex_PzChild.TextMatrix(countrow, 4)) + Money
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = DuifangCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = DuifangNameValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "2"
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = Money
- End If
- End If
- Next count
- '计算差异科目的借贷金额
- For count = .FixedRows To .Rows - 1
- If Trim(.TextMatrix(count, 0)) = InoutMainIdValue Then
- Note = Trim(.TextMatrix(count, Sydz("010", GridStr(), Szzls)))
- ChaYiCodeValue = Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls)))
- ChaYiNameValue = Trim(.TextMatrix(count, Sydz("005", GridStr(), Szzls)))
- JieFangMoney = Val(WglrGrid.TextMatrix(count, Sydz("016", GridStr(), Szzls)))
- DaiFangMoney = Val(WglrGrid.TextMatrix(count, Sydz("017", GridStr(), Szzls)))
- For countrow = vsFlex_PzChild.FixedRows To vsFlex_PzChild.Rows - 1
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 0)) = InoutMainIdValue Then
- If Trim(.TextMatrix(count, Sydz("008", GridStr(), Szzls))) <> "" Then
- If Trim(vsFlex_PzChild.TextMatrix(countrow, 2)) = DuifangCodeValue And Trim(vsFlex_PzChild.TextMatrix(countrow, 6)) = "3" Then
- IsPzInoutMainID = True
- vsFlex_PzChild.TextMatrix(countrow, 5) = Val(vsFlex_PzChild.TextMatrix(countrow, 5)) + DaiFangMoney
- Exit For
- Else
- IsPzInoutMainID = False
- End If
- Else
- IsPzInoutMainID = True
- End If
- Else
- IsPzInoutMainID = False
- End If
- Next countrow
- If IsPzInoutMainID = False Then
- vsFlex_PzChild.AddItem ""
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 0) = InoutMainIdValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 1) = Note
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 2) = ChaYiCodeValue
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 3) = ChaYiNameValue
- If Val(JieFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 4) = JieFangMoney
- End If
- If Val(DaiFangMoney) <> 0 Then
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 5) = DaiFangMoney
- End If
- vsFlex_PzChild.TextMatrix(vsFlex_PzChild.Rows - 1, 6) = "3"
- End If
- End If
- Next count
- End With
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer) '限制录入字符"'"
- Select Case KeyAscii
- Case 39 '屏蔽字符"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load() '窗 体 装 入
- '初始化各种锁值(Fixed)
- Changelock = False '网格行列改变控制锁
- Gdtlock = False '滚动条滚动控制
- Yxxpdlock = True '字段有效性判断锁
- Hyxxpdlock = True '行有效性判断锁
- Wbkbhlock = False '文本框内容改变锁
- '调 入 网 格(Fixed)
- GridCode = "Chhs_MakeVoucherSub" '网格属性编码
- Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Pmbcsjhs = GridInf(3)
- Fzxwghs = GridInf(4)
- Sfblbzkd = GridInf(5)
- Shsfts = GridInf(6)
- Sfxshjwg = GridInf(7)
- Szzls = WglrGrid.Cols - 1
- '填充列表框
- Call Fill_Combo
- '生成查询结果
- Call Sub_Query
- '填写辅助表
- vsFlex_PzMain.TextMatrix(0, 0) = "InoutMainID"
- vsFlex_PzMain.TextMatrix(0, 1) = "制单日期"
- vsFlex_PzMain.TextMatrix(0, 2) = "随符单据数"
- vsFlex_PzMain.TextMatrix(0, 3) = "生成凭证"
- vsFlex_PzMain.TextMatrix(0, 4) = "生成凭证的各种情况"
- With vsFlex_PzChild
- .TextMatrix(0, 0) = "InoutMainID"
- .TextMatrix(0, 1) = "摘要"
- .TextMatrix(0, 2) = "科目编码"
- .TextMatrix(0, 3) = "科目名称"
- .TextMatrix(0, 4) = "借方"
- .TextMatrix(0, 5) = "贷方"
- .TextMatrix(0, 6) = "科目标志"
- .TextMatrix(0, 7) = "结算方式代码"
- .TextMatrix(0, 8) = "结算方式"
- .TextMatrix(0, 9) = "票号"
- .TextMatrix(0, 10) = "发生日期"
- .TextMatrix(0, 11) = "数量"
- .TextMatrix(0, 12) = "单价"
- .TextMatrix(0, 13) = "外币金额"
- .TextMatrix(0, 14) = "汇率"
- .TextMatrix(0, 15) = "部门代码"
- .TextMatrix(0, 16) = "部门"
- .TextMatrix(0, 17) = "客户代码"
- .TextMatrix(0, 18) = "客户"
- .TextMatrix(0, 19) = "个人"
- .TextMatrix(0, 20) = "个人代码"
- .TextMatrix(0, 21) = "项目"
- .TextMatrix(0, 22) = "项目代码"
- .TextMatrix(0, 23) = "项目数量1"
- .TextMatrix(0, 24) = "项目数量2"
- .TextMatrix(0, 25) = "供应商代码"
- .TextMatrix(0, 26) = "供应商"
- .TextMatrix(0, 27) = "经办人"
- End With
- End Sub
- Private Sub Sub_Query() '生成查询结果
- Dim SqlStr As String '临时使用字符串
- Dim Rectemp As New ADODB.Recordset '临时使用动态集
- Dim Jsqte As Long '临时计数器
- '禁止网格刷新动作,为加快网格显示速度(Fixed)
- WglrGrid.Redraw = False
- '本张单据查询字符串
- If Trim(CL_MakeVoucher.ListId) = "" Then
- Exit Sub
- Else
- SqlStr = "SELECT * FROM Chhs_V_List WHERE KjYear='" & PGKjYear & "' and Period='" & PGNowmon & "' and startflag=0 and " & CL_MakeVoucher.ListId
- Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- End If
- With Rectemp
- WglrGrid.Rows = WglrGrid.FixedRows
- If .EOF Then
- WglrGrid.Redraw = True
- Exit Sub
- End If
- Jsqte = WglrGrid.FixedRows
- Do While Not .EOF
- WglrGrid.AddItem ""
- If Trim(.Fields("BillCode")) = "1307" Then
- WglrGrid.TextMatrix(Jsqte, 0) = Val(.Fields("ListId"))
- Else
- WglrGrid.TextMatrix(Jsqte, 0) = Val(.Fields("InoutMainId")) '主表ID
- End If
- WglrGrid.TextMatrix(Jsqte, 1) = Val(.Fields("InOutSubId")) '子表ID
- WglrGrid.TextMatrix(Jsqte, 2) = Val(.Fields("InoutAdjustMainId")) '调整单主表ID
- WglrGrid.TextMatrix(Jsqte, 3) = Val(.Fields("InoutAdjustSubId")) '调整单子表ID
- WglrGrid.TextMatrix(Jsqte, 4) = Trim(.Fields("BillCode")) '单据类型
- WglrGrid.TextMatrix(Jsqte, 5) = Trim(.Fields("PriceMode")) '记价方式
- WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("BillNum") & "") '单据号
- WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = .Fields("WhName") '仓库编码
- WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = .Fields("MName") '材料编码
- WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("MateAcctName") & "") '物料科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("DiffAcctName") & "") '差异科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("DfAcctName") & "") '对方科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("MateAcct") & "") '物料科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("DiffAcct") & "") '差异科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("DfAcct") & "") '对方科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("BillName") & "") '入库日期
- WglrGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("InoutFlag") & "") '收发标志
- WglrGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = .Fields("InQuan") '收入数量
- WglrGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = .Fields("InMoney") '收入金额
- WglrGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = .Fields("OutQuan") '发出数量
- WglrGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = .Fields("OutMoney") '发出金额
- WglrGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = .Fields("JfDiff") '借方差异
- WglrGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("DfDiff") '贷方差异
- '<<]
- WglrGrid.RowHeight(Jsqte) = Sjhgd
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- '将网格刷新解禁(Fixed)
- WglrGrid.Redraw = True
- End Sub
- Private Sub Wbkcl() '文本框录入之前处理(根据实际情况)
- Dim xswbrr As String
- With WglrGrid
- Zdlrqnr = Trim(.Text)
- xswbrr = Trim(.Text)
- If GridBoolean(.Col, 3) Then '列表框录入
- '填充列表框程序
- Call FillCombo(YdCombo, GridStr(.Col, 5), xswbrr, 0)
- Else
- Wbkbhlock = True
- '====以下为用户自定义
- Ydtext.Text = xswbrr
- '====以上为用户自定义
- Wbkbhlock = False
- Ydtext.SelStart = Len(Ydtext.Text)
- End If
- End With
- End Sub
- Private Function sjzdyxxpd(Dqpdwgh As Long, Dqpdwgl As Long) '录入数据字段有效性判断,同时进行字段录入事后处理
- Dim Str_JudgeText As String '临时有效性判断字段内容
- Dim Coljsq As Long '临时列计数器
- Dim Rectemp As New ADODB.Recordset '临时使用动态集
- Dim SqlStr As String
- With WglrGrid
- '非录入状态有效性为合法
- If Yxxpdlock Or .Row < .FixedRows Then
- sjzdyxxpd = True
- Exit Function
- End If
- Str_JudgeText = Trim(.TextMatrix(Dqpdwgh, Dqpdwgl))
- Select Case GridStr(Dqpdwgl, 1)
- '以下为自定义部分[
- '1.放置字段有效性判断程序
- Case "007", "008", "009"
- If Len(Str_JudgeText) <> 0 Then
- SqlStr = "SELECT Ccode,Cname FROM Cwzz_Acccode WHERE EndFlag=1 and Ccode='" & Trim(Str_JudgeText) & "' and StopFlag=0 "
- Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Not Rectemp.EOF Then
- If GridStr(Dqpdwgl, 1) = "007" Then
- WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)) = Trim(Rectemp.Fields("Cname"))
- ElseIf GridStr(Dqpdwgl, 1) = "008" Then
- WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)) = Trim(Rectemp.Fields("Cname"))
- Else
- WglrGrid.TextMatrix(Dqpdwgh, Sydz("006", GridStr(), Szzls)) = Trim(Rectemp.Fields("Cname"))
- End If
- Dqpdwgl = Sydz(GridStr(Dqpdwgl, 1), GridStr(), Szzls)
- Else
- Tsxx = "此科目不存在!"
- Dqpdwgl = Sydz(GridStr(Dqpdwgl, 1), GridStr(), Szzls)
- GoTo Lrcwcl
- End If
- Else
- If GridStr(Dqpdwgl, 1) = "007" Then
- WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)) = ""
- ElseIf GridStr(Dqpdwgl, 1) = "008" Then
- WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)) = ""
- Else
- WglrGrid.TextMatrix(Dqpdwgh, Sydz("006", GridStr(), Szzls)) = ""
- End If
- End If
- '2.放置字段事后处理程序
- '以上为自定义部分]
- End Select
- sjzdyxxpd = True
- Yxxpdlock = True
- Exit Function
- End With
- Lrcwcl: '录入错误处理
- With WglrGrid
- Call Xtxxts(Tsxx, 0, 1)
- Changelock = True
- .Select Dqpdwgh, Dqpdwgl
- Changelock = False
- Call xswbk
- sjzdyxxpd = False
- Exit Function
- End With
- End Function
- Private Function Sjhzyxxpd(ByVal Yxxpdh As Long) As Boolean '录入数据行有效性判断,同时进行行处理
- Dim Lrywlz As Long '录入错误列值(Fixed)
- Dim Rectemp As New ADODB.Recordset '临时使用动态集
- Dim SqlStr As String '临时查询字符串
- Dim Str_Ccode As String '临时索引编码
- Dim count As Integer
- With WglrGrid
- If Yxxpdh > (.Rows - 1) Then Exit Function
- '行没有发生变化则不进行有效性判断
- If Hyxxpdlock Then
- Sjhzyxxpd = True
- Exit Function
- End If
- '以下为自定义部分[
- '1.1首先进行单个不能为空或不能为零判断(Fixed)
- For Jsqte = Qslz To .Cols - 1
- '字段不能为空
- If GridInt(Jsqte, 5) = 1 Then
- If Len(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0 Then
- Tsxx = GridStr(Jsqte, 2)
- Lrywlz = Jsqte
- GoTo Lrcwcl
- Exit For
- End If
- End If
- '字段不能为零
- If GridInt(Jsqte, 5) = 2 Then
- If Val(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0 Then
- Tsxx = GridStr(Jsqte, 2)
- Lrywlz = Jsqte
- GoTo Lrcwcl
- Exit For
- End If
- End If
- Next Jsqte
- '1.2进行其他有效性判断,编写格式同1.1
- '2.放置行处理程序(当数据行通过有效性判断)
- '存货科目编码、对方科目编码、差异科目编码都为空,不进行行有效性判断
- If WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls)) = "" And WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls)) = "" And WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls)) = "" Then
- Sjhzyxxpd = True
- Hyxxpdlock = True
- Exit Function
- End If
- '非计划价法的出入库单,计划价法出库单,无差异的计划价法入库单
- If (WglrGrid.TextMatrix(Yxxpdh, 5) <> "计划价法" And InStr(1, "1212,1202,1203,1204,1205,1206,1304,1305", Trim(WglrGrid.TextMatrix(Yxxpdh, 4)))) _
- Or (WglrGrid.TextMatrix(Yxxpdh, 5) = "计划价法" And InStr(1, "1212,1202,1203,1304,1305", Trim(WglrGrid.TextMatrix(Yxxpdh, 4))) _
- And Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("016", GridStr(), Szzls))) = 0 And Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("017", GridStr(), Szzls))) = 0) _
- Or (WglrGrid.TextMatrix(Yxxpdh, 5) = "计划价法" And InStr(1, "1204,1205,1206", Trim(WglrGrid.TextMatrix(Yxxpdh, 4)))) Then
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("007", GridStr(), Szzls)
- Tsxx = "存货科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls))) <> "" Then
- Lrywlz = Sydz("008", GridStr(), Szzls)
- Tsxx = "不能输入差异科目!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("009", GridStr(), Szzls)
- Tsxx = "对方科目不能为空!"
- GoTo Lrcwcl
- End If
- WglrGrid.TextMatrix(Yxxpdh, 6) = "1"
- End If
- '有差异的计划价法入库单
- If WglrGrid.TextMatrix(Yxxpdh, 5) = "计划价法" And InStr(1, "1212,1202,1203,1304,1305", Trim(WglrGrid.TextMatrix(Yxxpdh, 4))) _
- And (Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("016", GridStr(), Szzls))) <> 0 Or Val(WglrGrid.TextMatrix(Yxxpdh, Sydz("017", GridStr(), Szzls))) <> 0) Then
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("007", GridStr(), Szzls)
- Tsxx = "存货科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("008", GridStr(), Szzls)
- Tsxx = "差异科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("009", GridStr(), Szzls)
- Tsxx = "对方科目不能为空!"
- GoTo Lrcwcl
- End If
- WglrGrid.TextMatrix(Yxxpdh, 6) = "2"
- End If
- '进行差异处理的计划价调整单
- If InStr(1, "1301,1302,1303", Trim(WglrGrid.TextMatrix(Yxxpdh, 4))) Then
- If WglrGrid.TextMatrix(Yxxpdh, 5) = "计划价法" Then
- If Qmclcy Then
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))) <> "" Then
- Lrywlz = Sydz("007", GridStr(), Szzls)
- Tsxx = "不能输入存货科目!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("008", GridStr(), Szzls)
- Tsxx = "差异科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("009", GridStr(), Szzls)
- Tsxx = "对方科目不能为空!"
- GoTo Lrcwcl
- End If
- WglrGrid.TextMatrix(Yxxpdh, 6) = "3"
- Else
- '不进行差异处理的计划价调整单
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("007", GridStr(), Szzls)
- Tsxx = "存货科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls))) <> "" Then
- Lrywlz = Sydz("008", GridStr(), Szzls)
- Tsxx = "不能输入差异科目!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("009", GridStr(), Szzls)
- Tsxx = "对方科目不能为空!"
- GoTo Lrcwcl
- End If
- WglrGrid.TextMatrix(Yxxpdh, 6) = "4"
- End If
- Else
- '非计划价的调整单
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("007", GridStr(), Szzls)
- Tsxx = "存货科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls))) <> "" Then
- Lrywlz = Sydz("008", GridStr(), Szzls)
- Tsxx = "不能输入差异科目!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("009", GridStr(), Szzls)
- Tsxx = "对方科目不能为空!"
- GoTo Lrcwcl
- End If
- WglrGrid.TextMatrix(Yxxpdh, 6) = "4"
- End If
- End If
- '差异结转单
- If InStr(1, "1307", Trim(WglrGrid.TextMatrix(Yxxpdh, 4))) Then
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))) <> "" Then
- Lrywlz = Sydz("007", GridStr(), Szzls)
- Tsxx = "不能输入存货科目!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("008", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("008", GridStr(), Szzls)
- Tsxx = "差异科目不能为空!"
- GoTo Lrcwcl
- End If
- If Trim(WglrGrid.TextMatrix(Yxxpdh, Sydz("009", GridStr(), Szzls))) = "" Then
- Lrywlz = Sydz("009", GridStr(), Szzls)
- Tsxx = "对方科目不能为空!"
- GoTo Lrcwcl
- End If
- WglrGrid.TextMatrix(Yxxpdh, 6) = "5"
- End If
- End With
- '以上为自定义部分]
- Sjhzyxxpd = True
- Hyxxpdlock = True
- Exit Function
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- Lrcwcl: '录入错误处理
- With WglrGrid
- Call Xtxxts(Tsxx, 0, 1)
- Changelock = True
- .Select Yxxpdh, Lrywlz
- Changelock = False
- Call xswbk
- Sjhzyxxpd = False
- Exit Function
- End With
- End Function
- '===================以 下 程 序 为 通 用 部 分 ,一 般 不 需 更 改(程序动作部分)======================='
- Private Sub Lrzdbz() '录入字段帮助
- If Not Ydcommand.Visible Then
- Exit Sub
- End If
- With WglrGrid
- Valilock = True
- '处理通用部分
- Changelock = True '调入另外窗体必须加锁
- Call Drbmhelp(GridInt(.Col, 6), GridStr(.Col, 3), Trim(Ydtext.Text))
- Changelock = False
- If Len(Xtfhcs) <> 0 Then
- If GridInt(.Col, 7) = 0 Then
- Ydtext.Text = Xtfhcs
- Else
- Ydtext.Text = Xtfhcsfz
- End If
- End If
- Valilock = False
- If Ydtext.Visible Then
- Ydtext.SetFocus
- End If
- End With
- End Sub
- Private Sub Form_Resize() '窗体大小发生变化时,重新显示文本框
- Call Cxxswbk
- End Sub
- Private Function Fun_Drfrmyxxpd() As Boolean '调入其它窗体或功能产生的有效性判断(包括数据回写)
- Fun_Drfrmyxxpd = True
- With WglrGrid
- '如果当前网格处于编辑状态,则先进行数据回写再进行有效性判断
- If Ydtext.Visible Or YdCombo.Visible Then
- Call Lrsjhx
- If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
- Fun_Drfrmyxxpd = False
- Exit Function
- End If
- End If
- '进行行有效性判断
- If Not Sjhzyxxpd(.Row) Then
- Fun_Drfrmyxxpd = False
- Exit Function
- End If
- End With
- End Function
- Private Sub WglrGrid_EnterCell() '显示当前数据行相关信息
- With WglrGrid
- If .Row >= .FixedRows Then
- '[>>
- '此处可以填写显示与此网格行相关信息
- '<<]
- End If
- End With
- End Sub
- Private Sub WglrGrid_GotFocus() '网格得到焦点
- '网格得到焦点,如果当前选择行为非数据行
- '则调整当前焦点至有效数据行
- With WglrGrid
- If .Row < .FixedRows And .Rows > .FixedRows Then
- Changelock = True
- .Select .FixedRows, .Col
- Changelock = False
- End If
- If .Col < Qslz Then
- Changelock = True
- .Select .Row, Qslz
- Changelock = False
- End If
- End With
- End Sub
- Private Sub WglrGrid_LostFocus() '录入网格失去焦点
- '用以屏蔽调用其它窗体时发生网格失去焦点事件
- If Changelock Then
- Exit Sub
- End If
- '引发网格RowcolChange事件
- With WglrGrid
- If Not (Ydtext.Visible Or YdCombo.Visible) Then
- .Select 0, 0
- End If
- End With
- End Sub
- Private Sub WglrGrid_AfterScroll(ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long) '限制用户在录入过程中滚动鼠标
- If Gdtlock Then
- Exit Sub
- End If
- With WglrGrid
- If Ydtext.Visible Or YdCombo.Visible Then
- Gdtlock = True
- .TopRow = Dqtoprow
- .LeftCol = Dqleftcol
- Gdtlock = False
- Exit Sub
- End If
- End With
- End Sub
- Private Sub WglrGrid_LeaveCell() '离开单元格
- If Changelock Then
- Exit Sub
- End If
- '记录刚刚离开网格单元的行列值
- Dqlkwgh = WglrGrid.Row
- Dqlkwgl = WglrGrid.Col
- '判断是否需要录入数据回写
- If Not (Ydtext.Visible Or YdCombo.Visible) Then
- Exit Sub
- End If
- Call Lrsjhx
- End Sub
- Private Sub WglrGrid_RowColChange() '网格录入行列发生变化时,进行有效性判断
- Valilock = True '屏蔽文本框失去焦点进行有效性判断
- With WglrGrid
- If Changelock Then
- Exit Sub
- End If
- If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
- Exit Sub
- End If
- If .Row <> Dqlkwgh Then
- If Not Sjhzyxxpd(Dqlkwgh) Then
- Exit Sub
- End If
- End If
- End With
- Call fhyxh
- Call Xldql
- End Sub
- Private Sub WglrGrid_DblClick() '鼠标双击网格显示文本框
- With WglrGrid
- Call xswbk
- End With
- End Sub
- Private Sub Ycwbk() '隐藏文本框,帮助按钮,列表组合框
- 'Valilock = True
- Ydtext.Visible = False
- YdCombo.Visible = False
- Ydcommand.Visible = False
- End Sub
- Private Sub YdCombo_KeyDown(KeyCode As Integer, Shift As Integer) '列表框移动
- With WglrGrid
- Select Case KeyCode
- Case vbKeyEscape 'ESC 键放弃录入
- Valilock = True
- .SetFocus
- Call Ycwbk
- Valilock = False
- Case vbKeyReturn '回 车 键 =13
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- Rowjsq = .Row
- Coljsq = .Col + 1
- If Coljsq > .Cols - 1 Then
- If Rowjsq < .Rows - 1 Then
- Rowjsq = Rowjsq + 1
- End If
- Coljsq = Qslz
- End If
- Do While Rowjsq <= .Rows - 1
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq + 1
- If Coljsq > .Cols - 1 Then
- Rowjsq = Rowjsq + 1
- Coljsq = Qslz
- End If
- Else
- Exit Do
- End If
- Loop
- .Select Rowjsq, Coljsq
- Case vbKeyLeft '左 箭 头 =37
- If .Col - 1 = Qslz Then
- If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
- GoTo jzzx
- End If
- End If
- If .Col > Qslz Then
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- Coljsq = .Col - 1
- Do While Coljsq > Qslz
- If Coljsq - 1 = Qslz Then
- If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
- GoTo jzzx
- End If
- End If
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq - 1
- Else
- Exit Do
- End If
- Loop
- .Select .Row, Coljsq
- End If
- Case vbKeyRight '右 箭 头 =39
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- Rowjsq = .Row
- Coljsq = .Col + 1
- If Coljsq > .Cols - 1 Then
- If Rowjsq < .Rows - 1 Then
- Rowjsq = Rowjsq + 1
- End If
- Coljsq = Qslz
- End If
- Do While Rowjsq <= .Rows - 1
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq + 1
- If Coljsq > .Cols - 1 Then
- Rowjsq = Rowjsq + 1
- Coljsq = Qslz
- End If
- Else
- Exit Do
- End If
- Loop
- .Select Rowjsq, Coljsq
- Case Else
- End Select
- jzzx:
- End With
- End Sub
- Private Sub YdCombo_LostFocus() '列表框失去焦点
- With WglrGrid '因为选中网格会先发生Rowcolchange事件置Valiock
- If Not Valilock Then '为TRUE
- Call Lrsjhx
- If Not Sjhzyxxpd(Dqlrwgh) Then
- Exit Sub
- End If
- End If
- End With
- End Sub
- Private Sub Ydcommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- Call Lrzdbz
- End Sub
- Private Sub ydtext_KeyDown(KeyCode As Integer, Shift As Integer)
- Dim Rowjsq As Long, Coljsq As Long
- With WglrGrid
- Select Case KeyCode
- Case vbKeyF2
- Call Lrzdbz
- Case vbKeyEscape 'ESC 键放弃录入
- Valilock = True
- Call Ycwbk
- .SetFocus
- Case vbKeyReturn '回 车 键 =13
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- Rowjsq = .Row
- Coljsq = .Col + 1
- If Coljsq > .Cols - 1 Then
- If Rowjsq < .Rows - 1 Then
- Rowjsq = Rowjsq + 1
- End If
- Coljsq = Qslz
- End If
- Do While Rowjsq <= .Rows - 1
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq + 1
- If Coljsq > .Cols - 1 Then
- Rowjsq = Rowjsq + 1
- Coljsq = Qslz
- End If
- Else
- Exit Do
- End If
- Loop
- If Rowjsq <= .Rows - 1 Then
- .Select Rowjsq, Coljsq
- End If
- Case vbKeyUp '上 箭 头 =38
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- If .Row > .FixedRows Then
- .Row = .Row - 1
- End If
- Case vbKeyDown '下 箭 头 =40
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- If .Row < .Rows - 1 Then
- .Row = .Row + 1
- End If
- Case vbKeyLeft '左 箭 头 =37
- If .Col - 1 = Qslz Then
- If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
- GoTo jzzx
- End If
- End If
- If Ydtext.SelStart = 0 And .Col > Qslz Then
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- Coljsq = .Col - 1
- Do While Coljsq > Qslz
- If Coljsq - 1 = Qslz Then
- If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
- GoTo jzzx
- End If
- End If
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq - 1
- Else
- Exit Do
- End If
- Loop
- .Select .Row, Coljsq
- End If
- jzzx:
- Case vbKeyRight '右 箭 头 =39
- wblong = Len(Ydtext.Text)
- If (Ydtext.SelStart = wblong Or Ydtext.SelLength = wblong) Then
- KeyCode = 0
- .SetFocus
- Call Lrsjhx
- Rowjsq = .Row
- Coljsq = .Col + 1
- If Coljsq > .Cols - 1 Then
- If Rowjsq < .Rows - 1 Then
- Rowjsq = Rowjsq + 1
- End If
- Coljsq = Qslz
- End If
- Do While Rowjsq <= .Rows - 1
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq + 1
- If Coljsq > .Cols - 1 Then
- Rowjsq = Rowjsq + 1
- Coljsq = Qslz
- End If
- Else
- Exit Do
- End If
- Loop
- .Select Rowjsq, Coljsq
- End If
- Case Else
- End Select
- End With
- End Sub
- Private Sub ydtext_KeyPress(KeyAscii As Integer) '录入字符事中控制
- Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
- End Sub
- Private Sub ydtext_Change() '录入事中变化处理
- '防止程序改变但不进行处理
- If Wbkbhlock Then
- Exit Sub
- End If
- With WglrGrid
- '限制字段录入长度
- Wbkbhlock = True
- Select Case GridInt(.Col, 1)
- Case 8, 11 '金额型
- Call Sjgskz(Ydtext, Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9, 12 '数量型
- Call Sjgskz(Ydtext, Xtslzws - Xtslxsws - 1, Xtslxsws)
- Case 10 '单价型
- Call Sjgskz(Ydtext, Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
- Case Else '其他类型
- If GridInt(.Col, 3) <> 0 Or GridInt(.Col, 4) <> 0 Then
- Call Sjgskz(Ydtext, GridInt(.Col, 3), GridInt(.Col, 4))
- End If
- End Select
- Wbkbhlock = False
- End With
- End Sub
- Private Sub ydtext_LostFocus() '如果由于选中网格之外的控件而发生有效性判断(选中网格会先发生Rowcolchange事件置Valiock为TRUE)
- With WglrGrid
- If Not Valilock Then
- Call Lrsjhx
- If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
- Exit Sub
- End If
- If Not Sjhzyxxpd(Dqlrwgh) Then
- Exit Sub
- End If
- End If
- End With
- End Sub
- Private Sub xswbk() '在当前选中单元显示文本框,列表框,帮助按钮(通用)
- Dim Wbkpy As Integer, Wbkpy1 As Integer '文本框偏移量
- '显示文本框前返回有效行列(解决滚动条问题)
- Call Xldqh
- Call Xldql
- '隐藏文本框,帮助按钮,列表组合框
- Call Ycwbk
- With WglrGrid
- Dqlrwgh = .Row
- Dqlrwgl = .Col
- If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
- Exit Sub
- End If
- Wbkpy = 30
- Wbkpy1 = 15
- On Error Resume Next
- If GridBoolean(.Col, 3) Then
- YdCombo.Left = .CellLeft + .Left + Wbkpy
- YdCombo.Top = .CellTop + .Top + Wbkpy
- YdCombo.Width = .CellWidth - Wbkpy1
- Call Wbkcl
- YdCombo.Visible = True
- YdCombo.SetFocus
- Ydcommand.Visible = False
- Ydtext.Visible = False
- Else
- If GridBoolean(.Col, 2) Then
- Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
- Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
- Ydcommand.Visible = True
- Else
- Ydcommand.Visible = False
- End If
- Ydtext.Left = .CellLeft + .Left + Wbkpy
- Ydtext.Top = .CellTop + .Top + Wbkpy
- If Ydcommand.Visible Then
- If Sfblbzkd Then
- Ydtext.Width = .CellWidth - Ydcommand.Width
- Else
- Ydtext.Width = .CellWidth - Wbkpy1
- End If
- Else
- Ydtext.Width = .CellWidth - Wbkpy1
- End If
- Ydtext.Height = .CellHeight - Wbkpy1
- If GridInt(.Col, 2) <> 0 Then
- Ydtext.MaxLength = GridInt(.Col, 2)
- Else
- Ydtext.MaxLength = 3000
- End If
- Call Wbkcl
- Ydtext.Visible = True
- Ydtext.SetFocus
- End If
- Dqtoprow = .TopRow
- Dqleftcol = .LeftCol
- '重置锁值
- Valilock = False
- Wbkbhlock = False
- End With
- End Sub
- Private Sub Cxxswbk() 'Formresize中重新显示文本框,列表框,帮助按钮(通用)
- Dim Wbkpy As Integer, Wbkpy1 As Integer
- Wbkpy = 30
- Wbkpy1 = 15
- With WglrGrid
- If YdCombo.Visible Then
- YdCombo.Left = .CellLeft + .Left + Wbkpy
- YdCombo.Top = .CellTop + .Top + Wbkpy
- YdCombo.Width = .CellWidth - Wbkpy1
- End If
- If Ydcommand.Visible Then
- Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
- Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
- End If
- If Ydtext.Visible Then
- If Ydcommand.Visible Then
- If Sfblbzkd Then
- Ydtext.Width = .CellWidth - Ydcommand.Width
- Else
- Ydtext.Width = .CellWidth - Wbkpy1
- End If
- Else
- Ydtext.Width = .CellWidth - Wbkpy1
- End If
- Ydtext.Left = .CellLeft + .Left + Wbkpy
- Ydtext.Top = .CellTop + .Top + Wbkpy
- Ydtext.Height = .CellHeight - Wbkpy1
- End If
- End With
- End Sub
- Private Sub Lrsjhx() '文本框录入数据回写
- With WglrGrid
- If YdCombo.Visible Then
- .Text = Trim(YdCombo.Text)
- End If
- If Ydtext.Visible Then
- .Text = Trim(Ydtext.Text)
- End If
- '(如果字段录入内容发生变化,则打开有效性判断锁)
- If Zdlrqnr <> Trim(.Text) Then
- Yxxpdlock = False
- Hyxxpdlock = False
- End If
- '隐藏文本框,帮助按钮,列表组合框
- Call Ycwbk
- End With
- End Sub
- Private Sub WglrGrid_KeyDown(KeyCode As Integer, Shift As Integer) '网格快捷键
- Select Case KeyCode
- Case vbKeyF2 '按F2键参照
- Call xswbk
- Call Lrzdbz
- End Select
- End Sub
- Private Sub WglrGrid_KeyPress(KeyAscii As Integer) '网格接受键盘录入
- With WglrGrid
- '屏 蔽 回 车 键
- If KeyAscii = vbKeyReturn Then
- KeyAscii = 0
- Rowjsq = .Row
- Coljsq = .Col + 1
- If Coljsq > .Cols - 1 Then
- If Rowjsq < .Rows - 1 Then
- Rowjsq = Rowjsq + 1
- End If
- Coljsq = Qslz
- End If
- Do While Rowjsq <= .Rows - 1
- If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
- Coljsq = Coljsq + 1
- If Coljsq > .Cols - 1 Then
- Rowjsq = Rowjsq + 1
- Coljsq = Qslz
- End If
- Else
- Exit Do
- End If
- Loop
- If Rowjsq <= .Rows - 1 Then
- .Select Rowjsq, Coljsq
- End If
- Exit Sub
- End If
- '接受用户录入
- Select Case KeyAscii
- Case 0 To 32 '用户输入KeyAscii为0-32的键 如空格
- '显示录入载体
- Call xswbk
- Case Else
- '防止非编辑字段SendKeys()出现死循环
- If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
- Exit Sub
- End If
- '如果此字段为列表框录入则调入相应列表框
- If GridBoolean(.Col, 3) Then
- '列表框录入
- Call xswbk
- Else
- Ydtext.Text = ""
- '录入限制
- Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
- If KeyAscii = 0 Then
- Exit Sub
- End If
- Call xswbk
- Ydtext.Text = ""
- Valilock = True
- SendKeys Chr(KeyAscii), True
- DoEvents
- Valilock = False
- End If
- End Select
- End With
- End Sub
- Private Sub fhyxh() '返回录入数据有效行,同时让得到焦点网格可见
- With WglrGrid
- If .Row >= .FixedRows Then
- Call Xldqh
- End If
- End With
- End Sub
- Private Sub Xldqh() '显露当前行
- Dim Toprowte As Long
- With WglrGrid
- Toprowte = 0
- Do While .CellTop + .RowHeight(.Row) + Fzxwghs * Sjhgd > .Height And .TopRow <> Toprowte
- Toprowte = .TopRow
- .TopRow = .TopRow + 1
- Loop
- Toprowte = 0
- Do While .CellTop < .FixedRows * .RowHeight(0) And .TopRow <> Toprowte
- Toprowte = .TopRow
- If .TopRow > 1 Then
- .TopRow = .TopRow - 1
- End If
- Loop
- End With
- End Sub
- Private Sub Xldql() '显露当前列
- Dim Leftcolte As Long
- With WglrGrid
- If .Col >= Qslz And .Col >= .FixedCols Then
- If .LeftCol > .Col Then
- .LeftCol = .Col
- End If
- Leftcolte = 0
- Do While .CellLeft + .CellWidth > .Width And .LeftCol <> Leftcolte
- Leftcolte = .LeftCol
- .LeftCol = .LeftCol + 1
- Loop
- End If
- End With
- End Sub
- Private Sub WglrGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
- End Sub
- '填补列表
- Private Sub Fill_Combo()
- Dim MRecord As New ADODB.Recordset
- Set MRecord = Cw_DataEnvi.DataConnect.Execute("select * from Cwzz_VouchClass ")
- Do While Not MRecord.EOF
- With Combo1
- .AddItem MRecord.Fields("VouchClassCode") + MRecord.Fields("VouchClassName")
- End With
- MRecord.MoveNext
- Loop
- Set MRecord = Nothing
- End Sub