📄
字号:
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"))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -