📄 i-
字号:
Case 10 '人员
If Trim(.LrText(11).Text) <> "" Then
Str_QueryCondi = Str_QueryCondi & " And PersonCode='" & Trim(.LrText(11).Tag) & "'"
End If
Case 11 '批次
If Trim(.LrText(12).Text) <> "" Then
Str_QueryCondi = Str_QueryCondi & " And BatchNum='" & Trim(.LrText(12).Text) & "'"
End If
Case 12 '货区
If Trim(.LrText(13).Text) <> "" Then
Str_QueryCondi = Str_QueryCondi & " And MArea='" & Trim(.LrText(13).Tag) & "'"
End If
Case 13 '成本对象
If Trim(.LrText(14).Text) <> "" Then
Str_QueryCondi = Str_QueryCondi & " And costobjectcode='" & Trim(.LrText(14).Tag) & "'"
End If
Case 14 '工程
If Trim(.LrText(15).Text) <> "" Then
Str_QueryCondi = Str_QueryCondi & " And Projectcode='" & Trim(.LrText(15).Tag) & "'"
End If
Case 15 '审核状态
If Not .Opt_Check(0).Value Then
If .Opt_Check(1).Value Then
Str_QueryCondi = Str_QueryCondi & " and KfChecker='' "
Else
Str_QueryCondi = Str_QueryCondi & " and KfChecker<>'' "
End If
End If
Case 16 'Maker
If Trim(.LrText(16).Text) <> "" Then
Str_QueryCondi = Str_QueryCondi & " and Maker='" & Trim(.LrText(16).Text) & "'"
End If
Case 17 '单据类型
Dim StrType As String
StrType = ""
For i = 0 To .Check1.count - 1
If .Check1(i).Value = 1 Then
StrType = StrType & "'" & Trim(CStr(.Check1(i).Tag)) & "',"
End If
Next i
If StrType <> "" Then
StrType = Mid(StrType, 1, Len(StrType) - 1)
Str_QueryCondi = Str_QueryCondi & " and BillCode in (" & StrType & ")"
Else
Str_QueryCondi = Str_QueryCondi & " and 1=2"
End If
End Select
Next jsqte
End With
Sqlstr = "SELECT * From KF_V_InOut " & Str_QueryCondi & " Order By KF_V_InOut.InOutMainID"
Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
OutMoney = 0
InMoney = 0
With Rec_Query
CxbbGrid.Rows = CxbbGrid.FixedRows
jsqte = CxbbGrid.FixedRows
Do While Not .EOF
CxbbGrid.AddItem ""
'[>>自定义填充内容
CxbbGrid.TextMatrix(jsqte, 0) = Val(.Fields("InOutMainID"))
CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Format(.Fields("BillDate"), "yyyy-mm-dd") '单据日期
CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("WhName") & "") '仓库
CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("BillNum") & "") '单据号
CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("DeptName") & "") '部门
CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("OperBillNum") & "") '业务单号
CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("MNumber") & "") '物料编码
CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("MName") & "") '物料名称
CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("Model") & "") '规格型号
CxbbGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("batchnum") & "") '批次
CxbbGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("MareaName") & "") '货区
If .Fields("FactReceiptQuan") <> 0 Then
CxbbGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = .Fields("FactReceiptQuan") '入库数量
If .Fields("price") <> 0 Then
CxbbGrid.TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = .Fields("price") '价格
End If
If .Fields("emoney") <> 0 Then
CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = .Fields("emoney") '金额
InMoney = InMoney + Val(.Fields("emoney"))
End If
End If
If .Fields("FactIssueQuan") <> 0 Then
CxbbGrid.TextMatrix(jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("FactIssueQuan") '出库数量
If .Fields("price") <> 0 Then
CxbbGrid.TextMatrix(jsqte, Sydz("018", GridStr(), Szzls)) = .Fields("price") '价格
End If
If .Fields("issuemoney") <> 0 Then
CxbbGrid.TextMatrix(jsqte, Sydz("019", GridStr(), Szzls)) = .Fields("issuemoney") '金额
OutMoney = OutMoney + Val(.Fields("issuemoney"))
End If
End If
CxbbGrid.TextMatrix(jsqte, Sydz("024", GridStr(), Szzls)) = Trim(.Fields("suppliername") & "") '供应商
CxbbGrid.TextMatrix(jsqte, Sydz("014", GridStr(), Szzls)) = Trim(.Fields("maker") & "") '制单人
CxbbGrid.TextMatrix(jsqte, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("KfChecker") & "") '审核人
CxbbGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = Trim(.Fields("ChalkItupMan") & "") '记帐人
CxbbGrid.TextMatrix(jsqte, Sydz("020", GridStr(), Szzls)) = Trim(.Fields("InOutClassName") & "") '收发类别
CxbbGrid.TextMatrix(jsqte, Sydz("021", GridStr(), Szzls)) = Trim(.Fields("CusName") & "") '客户
CxbbGrid.TextMatrix(jsqte, Sydz("022", GridStr(), Szzls)) = Trim(.Fields("ProjectName") & "") '工程
CxbbGrid.TextMatrix(jsqte, Sydz("023", GridStr(), Szzls)) = Trim(.Fields("CostObjectName") & "") '成本对象
'<<]
'设置数据行高度(Fixed)
CxbbGrid.RowHeight(jsqte) = Sjhgd
'动态集指针加1,同时将计数器加1(Fixed)
.MoveNext
jsqte = jsqte + 1
Loop
End With
CxbbGrid.AddItem ""
CxbbGrid.TextMatrix(jsqte, Qslz) = "合计"
CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = IIf(InMoney = 0, "", InMoney)
CxbbGrid.TextMatrix(jsqte, Sydz("019", GridStr(), Szzls)) = IIf(OutMoney = 0, "", OutMoney)
']以上为用户自定义部分
End Sub
Private Sub CxbbGrid_DblClick() '用户双击网格调入相应单据
Dim RecTemp As New ADODB.Recordset '临时使用动态集
'当第一次查询结果为空时,判断总记录行是否与固定行数相同,如相同则出现错误(双表头出现此情况)
If CxbbGrid.Rows = CxbbGrid.FixedRows Then
Exit Sub
End If
'非数据行退出
If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
Exit Sub
End If
Sqlstr = "SELECT InOutMainID,BillCode From gy_inOutMain Where InOutMainID=" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
With RecTemp
If .EOF Then
Tsxx = "此单据已被其他用户删除!"
Call Xtxxts(Tsxx, 0, 4)
Exit Sub
Else
'调入单据处理窗体
XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 0)
Xtcdcsfz = Str_QueryCondi
'设置单据处理为列表查询(修改)状态
Xtcdcs = "3"
Select Case Trim(.Fields("BillCode"))
Case "1201"
With KF_FrmStockIn
'填充查询单据标识
.Show 1
End With
Case "1202"
With KF_FrmProductIn
'填充查询单据标识
.Show 1
End With
Case "1203"
With KF_FrmOtherIn
'填充查询单据标识
.Show 1
End With
Case "1204"
With KF_FrmMateOut
'填充查询单据标识
.Show 1
End With
Case "1205"
With KF_FrmSellOut
'填充查询单据标识
.Show 1
End With
Case "1206"
With KF_FrmOtherOut
'填充查询单据标识
.Show 1
End With
End Select
If Xtfhcs = "1" Then
Tsxx = "单据发生变化,是否刷新单据列表?"
Yhanswer = Xtxxts(Tsxx, 2, 2)
If Yhanswer = 1 Then
Xt_Wait.Show
Xt_Wait.Refresh
'加快显示速度
CxbbGrid.Redraw = False
'生成查询结果
Call Sub_Query(1)
CxbbGrid.Redraw = True
Xt_Wait.Hide
End If
End If
End If
End With
End Sub
Private Sub Sub_AddBill() '新增单据
With KF_FrmGliad
'设置单据处理为填制单据状态
Xtcdcs = "1"
.Show 1
End With
If Xtfhcs = "1" Then
Tsxx = "单据发生变化,是否刷新单据列表?"
Yhanswer = Xtxxts(Tsxx, 2, 2)
If Yhanswer = 1 Then
Xt_Wait.Show
Xt_Wait.Refresh
'加快显示速度
CxbbGrid.Redraw = False
'生成查询结果
Call Sub_Query(1)
CxbbGrid.Redraw = True
Xt_Wait.Hide
End If
End If
End Sub
Private Sub bbyl(bbylte As Boolean) '报表打印预览
Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
Bbxbtgs = 1 '报 表 小 标 题 行 数
Bbbwhgs = 0 '报 表 表 尾 行 数
ReDim Bbxbt(1 To Bbxbtgs)
ReDim bbxbtzzxs(1 To Bbxbtgs)
If Bbbwhgs <> 0 Then
ReDim Bbbwh(1 To Bbbwhgs)
ReDim Bbbwhzzxs(1 To Bbbwhgs)
End If
Bbzbt = ReportTitle
Bbxbt(1) = ""
bbxbtzzxs(1) = 0 '报表行组织形式(0-居左 1-居中 2-居右)
Call Scyxsjb(CxbbGrid) '生成报表数据
Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
If Not bbylte Then
Unload DY_Tybbyldy
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -