ʰ
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:52k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
- Begin VB.Form YH_FrmZddz
- Caption = "自动对帐"
- ClientHeight = 6930
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 9570
- HelpContextID = 5103
- Icon = "银行_自动对帐.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 6930
- ScaleWidth = 9570
- Begin VB.PictureBox Pic_Title
- BackColor = &H00FFFFFF&
- Height = 1065
- Left = 30
- Picture = "银行_自动对帐.frx":1042
- ScaleHeight = 1005
- ScaleWidth = 11820
- TabIndex = 0
- Top = 600
- Width = 11880
- Begin VB.Label Label4
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H80000008&
- Height = 180
- Index = 2
- Left = 10365
- TabIndex = 15
- Top = 240
- Width = 390
- End
- Begin VB.Label Lab_Bill
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "未勾对"
- ForeColor = &H00000000&
- Height = 180
- Index = 1
- Left = 10815
- TabIndex = 14
- Top = 240
- Width = 540
- End
- Begin VB.Label Label4
- Appearance = 0 'Flat
- BackColor = &H00E9FC61&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H80000008&
- Height = 180
- Index = 0
- Left = 9240
- TabIndex = 13
- Top = 247
- Width = 390
- End
- Begin VB.Label Lab_Bill
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "已勾对"
- ForeColor = &H00000000&
- Height = 180
- Index = 0
- Left = 9675
- TabIndex = 12
- Top = 247
- Width = 540
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Height = 180
- Left = 1560
- TabIndex = 6
- Top = 750
- Width = 90
- End
- Begin VB.Label Label2
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "银行科目:"
- ForeColor = &H80000008&
- Height = 180
- Left = 690
- TabIndex = 5
- Top = 750
- Width = 810
- End
- Begin VB.Label CxjgLabel
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- ForeColor = &H00FF0000&
- Height = 379
- Index = 2
- Left = 3512
- TabIndex = 2
- Top = 1674
- Width = 166
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "银行自动对帐"
- BeginProperty Font
- Name = "宋体"
- Size = 14.25
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 285
- Index = 4
- Left = 360
- TabIndex = 1
- Top = 180
- Width = 1800
- End
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 3
- Top = 0
- Width = 9570
- _ExtentX = 16880
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 13
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "对帐"
- Key = "dz"
- ImageKey = "dz"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "取消"
- Key = "qx"
- ImageKey = "fq"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "过滤"
- Key = "gl"
- ImageKey = "cx"
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "对照"
- Key = "dz1"
- ImageKey = "pk"
- Style = 1
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "检查"
- Key = "jc"
- ImageKey = "pd"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "核销"
- Key = "hx"
- ImageKey = "exec"
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "选择"
- Key = "sel"
- ImageIndex = 19
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "tc"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.ImageList ImageList1
- Left = 4740
- Top = 0
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 34
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":35106
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":354A0
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3583A
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":35BD4
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":35F6E
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":36308
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":366A2
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":36A3C
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":36DD6
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":37170
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3750A
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":378A4
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":37C3E
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":37FD8
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":38372
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3870C
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":38AA6
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":38E40
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":391DA
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":39574
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3990E
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":39CA8
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3A042
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3A3DC
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3A776
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3AB10
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3AEAA
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3B244
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3B5DE
- Key = "dw"
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3B978
- Key = "hf"
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3BD12
- Key = "pz"
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3C0AC
- Key = "check"
- EndProperty
- BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3C446
- Key = "pd"
- EndProperty
- BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_自动对帐.frx":3C7E0
- Key = "pk"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar N
- Height = 540
- Left = 10185
- TabIndex = 4
- Top = 0
- Width = 1680
- _ExtentX = 2963
- _ExtentY = 953
- ButtonWidth = 1455
- ButtonHeight = 953
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 2
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认格式"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- EndProperty
- End
- End
- Begin VB.Frame Frame2
- Height = 5925
- Left = 30
- TabIndex = 7
- Top = 1620
- Width = 11895
- Begin VB.Frame Frame3
- Height = 5925
- Left = 6300
- TabIndex = 11
- Top = 0
- Width = 30
- End
- Begin VB.Frame Frame1
- Height = 90
- Left = 0
- TabIndex = 10
- Top = 510
- Width = 11805
- End
- Begin VSFlex8Ctl.VSFlexGrid vsFlexGrid1
- Height = 5235
- Left = 80
- TabIndex = 16
- Top = 630
- Width = 6195
- _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 = 16777215
- ForeColor = -2147483640
- BackColorFixed = -2147483638
- ForeColorFixed = -2147483630
- BackColorSel = 16777215
- ForeColorSel = -2147483640
- BackColorBkg = -2147483636
- BackColorAlternate= 16777215
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = 0 'False
- AllowBigSelection= 0 'False
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 20
- 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 = -1 'True
- 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 CxbbGrid
- Height = 5235
- Left = 6360
- TabIndex = 17
- Top = 630
- Width = 5475
- _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 = 12632256
- ForeColorFixed = -2147483630
- BackColorSel = 16777215
- ForeColorSel = -2147483640
- BackColorBkg = -2147483636
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = 0 'False
- AllowBigSelection= 0 'False
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 20
- 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 = -1 'True
- 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 Label5
- AutoSize = -1 'True
- Caption = "银行对帐单"
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 8370
- TabIndex = 9
- Top = 180
- Width = 1275
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "单位日记帐"
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Index = 1
- Left = 1950
- TabIndex = 8
- Top = 180
- Width = 1275
- End
- End
- End
- Attribute VB_Name = "YH_FrmZddz"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*************************************************************
- '* 模 块 名 称 :银行自动对帐
- '* 功 能 描 述 建立和管理银行自动对帐数据
- '* 程序员姓名 : xjl
- '* 最后修改人 : xjl
- '* 最后修改时间:2000/11/07
- '* 备 注:
- '*************************************************************
- '以下为固定使用变量(网格)
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Tsxx As String '系统提示信息
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Szzls As Integer '数组总列数(网格列数-1)
- Dim Rowjsq As Integer
- Dim Str_RightEdit As String '编辑权限索引
- '银行对帐单手工选中标志
- Private Sub CxbbGrid_DblClick()
- Dim RecTemp As New ADODB.Recordset
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
- Exit Sub
- End If
- With CxbbGrid
- If .Rows > 1 Then
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "Select * from cwzz_bankbill where BankBillID='" & .TextMatrix(.Row, 6) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If RecTemp.EOF = False Then
- If RecTemp.Fields("bcheckflag") = True Then
- RecTemp.Fields("bcheckflag") = 0
- RecTemp.Fields("handworkflag") = 0
- RecTemp.Update
- Else
- RecTemp.Fields("bcheckflag") = 1
- RecTemp.Fields("handworkflag") = 1
- RecTemp.Update
- End If
- If .TextMatrix(.Row, 5) = "" Then
- .TextMatrix(.Row, 5) = "√"
- .Cell(flexcpBackColor, .Row, 0, .Row, .Cols - 1) = Label4(0).BackColor
- CxbbGrid.BackColorSel = Label4(0).BackColor
- Else
- .TextMatrix(.Row, 5) = ""
- .Cell(flexcpBackColor, .Row, 0, .Row, .Cols - 1) = Label4(2).BackColor
- CxbbGrid.BackColorSel = Label4(2).BackColor
- End If
- End If
- End If
- End With
- End Sub
- '控制网格颜色
- Private Sub CXBBGrid_EnterCell()
- If CxbbGrid.Cell(flexcpBackColor, CxbbGrid.Row) = Label4(0).BackColor Then
- CxbbGrid.BackColorSel = Label4(0).BackColor
- Else
- CxbbGrid.BackColorSel = Label4(2).BackColor
- End If
- End Sub
- '窗体载入
- Sub Form_Load()
- '定以网格列
- Dim I As Integer
- '隐藏选择对话框
- YH_FrmXzkm.Hide
- '调入打印页面设置窗体
- Label3.Caption = YH_FrmXzkm.Combo1.Text
- XtReportCode = "Cwzz_Zddz"
- '调入网格(银行)
- GridCode = "Cwzz_yhzddz"
- Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Sfxshjwg = GridInf(7)
- Szzls = CxbbGrid.Cols - 1
- '设置网格属性
- With vsFlexGrid1
- .Cols = 9
- .FormatString = "凭证日期|票据日期|结算方式|票号|方向|金额|两清|凭证号数|摘要" '格式网格
- For I = 0 To .Cols - 1
- .Rows = 1
- .FixedAlignment(I) = flexAlignCenterCenter
- .ColWidth(I) = 1000
- .RowHeight(0) = 450
- Next I
- .ColWidth(6) = 500
- .ColWidth(7) = 800
- .ColWidth(4) = 400
- .ColWidth(3) = 500
- .ColAlignment(5) = flexAlignRightCenter
- End With
- With CxbbGrid
- .ColAlignment(4) = flexAlignRightCenter
- End With
- '显示网格数据
- Call Sub_ShowBill
- Rowjsq = CxbbGrid.Rows
- '调整标题位置
- SetTitlePos tsLabel(4)
- Str_RightEdit = "Cwzz_yhzddz_Edit"
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- '横线条
- Frame1.Width = Me.Width - 160
- Frame1.Height = 90
- '竖线条
- Frame3.Left = Me.Width / 2 + 270
- Frame3.Height = Me.Height - Frame2.Top - 400
- Frame3.Width = 30
- 'Frame窗体
- With Frame2
- .Width = Me.Width - 150
- .Height = Me.Height - .Top - 400
- End With
- 'CxbbGrid网格
- With CxbbGrid
- CxbbGrid.Left = Me.Width / 2 + 350
- .Width = Me.Width / 2 - 550
- .Height = Me.Height - Frame2.Top - .Top - 440
- End With
- 'vsFlexGrid1网格
- With vsFlexGrid1
- .Width = Me.Width / 2 + 160
- .Height = Me.Height - Frame2.Top - .Top - 440
- End With
- '横幅
- With Pic_Title
- .Width = Me.Width - 160
- End With
- '工具条
- N.Left = Me.Width - N.Width - 160
- End Sub
- '退出
- Private Sub Form_Unload(Cancel As Integer)
- Glo_Variable.Unload_TF = True
- Unload YH_FrmXzkm
- '卸载过滤条件
- Unload YH_FrmGltj
- End Sub
- Private Sub N_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(CxbbGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(CxbbGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call Szxsxm(CxbbGrid, GridCode)
- End Select
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "dz" '对帐
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- YH_FrmDztj.HelpContextID = "0115004"
- YH_FrmDztj.Show 1
- CxbbGrid.Clear 1
- vsFlexGrid1.Clear 1
- Call Sub_ShowBill
- Case "qx" '取消对帐
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- Cw_DataEnvi.DataConnect.Execute ("update cwzz_bankbill set bcheckflag=0,HandWorkFlag=0 where bdelete=0")
- Cw_DataEnvi.DataConnect.Execute ("update cwzz_accvouchmain set checkflag=0")
- Cw_DataEnvi.DataConnect.Execute ("update cwzz_accvouchsub set bcheckflag=0,HandWorkFlag=0 where bdelete=0")
- Cw_DataEnvi.DataConnect.Execute ("update cwzz_rjznotcheck set bcheckflag=0,HandWorkFlag=0 where bdelete=0")
- CxbbGrid.Clear 1
- vsFlexGrid1.Clear 1
- Call Sub_ShowBill
- Case "gl" '过滤
- YH_FrmGltj.Tag = "Z"
- YH_FrmGltj.HelpContextID = "0115004"
- YH_FrmGltj.Show 1
- Case "jc" '检查
- YH_FrmDzjc.HelpContextID = "0115004"
- YH_FrmDzjc.Show 1
- Case "dz1" '对照
- If CxbbGrid.Rows = Rowjsq Then
- CxbbGrid.Rows = 1
- Else
- CxbbGrid.Clear 1
- vsFlexGrid1.Clear 1
- Call Sub_ShowBill
- End If
- Case "bz" '帮助
- Call F1bz
- Case "tc" '退出
- Unload Me
- Case "sel"
- Glo_Variable.Unload_TF = False
- YH_FrmXzkm.HelpContextID = "0115004"
- YH_FrmXzkm.Show 1
- Case "hx" '核销银行帐
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- Call HxYhz
- Call Sub_ShowBill
- End Select
- End Sub
- '显示所有未达帐项
- Private Sub Sub_ShowBill()
- Dim RecTemp As New ADODB.Recordset
- Dim Recfind As New ADODB.Recordset
- Dim Rowjsq As Integer
- CxbbGrid.Rows = 1
- vsFlexGrid1.Rows = 1
- '显示期初未达
- '显示银行对帐单
- Sqlstr = "select * from cwzz_bankbill where rectype=1 and bdelete=0 and ccode='" & Val(Label3.Caption) & "'order by billdate"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Rowjsq = 1
- Do While Not RecTemp.EOF
- If RecTemp.Fields("bdelete") = True Then
- End If
- With CxbbGrid
- .Cols = 7
- If Rowjsq > .Rows - 1 Then
- .AddItem ""
- .RowHeight(.Rows - 1) = 350
- End If
- .TextMatrix(Rowjsq, 0) = RecTemp.Fields("billdate")
- Sqlstr = "select * from Gy_settlement where sscode='" & RecTemp.Fields("sscode") & "'"
- Set Recfind = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Recfind.EOF = False Then
- .TextMatrix(Rowjsq, 1) = Recfind.Fields("ssname")
- End If
- .TextMatrix(Rowjsq, 2) = RecTemp.Fields("billno")
- If Val(RecTemp.Fields("Dfje")) <> 0 Then
- .TextMatrix(Rowjsq, 3) = "借"
- .TextMatrix(Rowjsq, 4) = Format(RecTemp.Fields("Dfje"), "#,###.00")
- Else
- .TextMatrix(Rowjsq, 3) = "贷"
- .TextMatrix(Rowjsq, 4) = Format(RecTemp.Fields("Jfje"), "#,###.00")
- End If
- .TextMatrix(Rowjsq, 6) = RecTemp.Fields("BankBillID")
- .ColHidden(6) = True
- If RecTemp.Fields("bcheckflag") = True Then
- If Trim(RecTemp.Fields("handworkflag")) = True Then
- .TextMatrix(Rowjsq, 5) = "√"
- Else
- .TextMatrix(Rowjsq, 5) = "○"
- End If
- .Cell(flexcpBackColor, Rowjsq, 0, Rowjsq, .Cols - 1) = Label4(0).BackColor
- End If
- Rowjsq = Rowjsq + 1
- End With
- RecTemp.MoveNext
- Loop
- '显示银行对帐单
- Sqlstr = "select * from cwzz_bankbill where rectype=2 and bdelete=0 and ccode='" & Val(Label3.Caption) & "'order by billdate"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Do While Not RecTemp.EOF
- If RecTemp.Fields("bdelete") = True Then
- End If
- With CxbbGrid
- .Cols = 7
- If Rowjsq > .Rows - 1 Then
- .AddItem ""
- .RowHeight(.Rows - 1) = 350
- End If
- .TextMatrix(Rowjsq, 0) = RecTemp.Fields("billdate")
- Sqlstr = "select * from Gy_settlement where sscode='" & RecTemp.Fields("sscode") & "'"
- Set Recfind = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Recfind.EOF = False Then
- .TextMatrix(Rowjsq, 1) = Recfind.Fields("ssname")
- End If
- .TextMatrix(Rowjsq, 2) = RecTemp.Fields("billno")
- If Val(RecTemp.Fields("jfje")) <> 0 Then
- .TextMatrix(Rowjsq, 3) = "借"
- .TextMatrix(Rowjsq, 4) = Format(RecTemp.Fields("jfje"), "#,###.00")
- Else
- .TextMatrix(Rowjsq, 3) = "贷"
- .TextMatrix(Rowjsq, 4) = Format(RecTemp.Fields("dfje"), "#,###.00")
- End If
- .TextMatrix(Rowjsq, 6) = RecTemp.Fields("BankBillID")
- .ColHidden(6) = True
- If RecTemp.Fields("bcheckflag") = True Then
- If Trim(RecTemp.Fields("handworkflag")) = True Then
- .TextMatrix(Rowjsq, 5) = "√"
- Else
- .TextMatrix(Rowjsq, 5) = "○"
- End If
- .Cell(flexcpBackColor, Rowjsq, 0, Rowjsq, .Cols - 1) = Label4(0).BackColor
- End If
- Rowjsq = Rowjsq + 1
- End With
- RecTemp.MoveNext
- Loop
- '显示单位日记帐
- Sqlstr = "select * from cwzz_rjznotcheck where rectype=1 and bdelete=0 and ccode='" & Val(Label3.Caption) & "'order by ddate"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Rowjsq = 1
- Do While Not RecTemp.EOF()
- With vsFlexGrid1
- .Cols = 10
- If Rowjsq > .Rows - 1 Then
- .AddItem ""
- .RowHeight(.Rows - 1) = 350
- End If
- .TextMatrix(Rowjsq, 0) = RecTemp.Fields("ddate")
- If IsNull(RecTemp.Fields("billdate")) = False Then
- .TextMatrix(Rowjsq, 1) = RecTemp.Fields("billdate")
- End If
- .TextMatrix(Rowjsq, 3) = RecTemp.Fields("billno")
- Sqlstr = "select * from gy_settlement where sscode='" & RecTemp.Fields("sscode") & "'"
- Set Recfind = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Recfind.EOF = False Then
- .TextMatrix(Rowjsq, 2) = Recfind.Fields("ssname")
- End If
- If Val(RecTemp.Fields("jfje")) <> 0 Then
- .TextMatrix(Rowjsq, 4) = "借"
- .TextMatrix(Rowjsq, 5) = Format(RecTemp.Fields("jfje"), "#,####.00")
- Else
- .TextMatrix(Rowjsq, 4) = "贷"
- .TextMatrix(Rowjsq, 5) = Format(RecTemp.Fields("dfje"), "#,####.00")
- End If
- .TextMatrix(Rowjsq, 7) = Trim(RecTemp.Fields("vouchclasscode")) & "-" & Trim(RecTemp.Fields("vouchno"))
- If IsNull(RecTemp.Fields("digest")) = False Then
- .TextMatrix(Rowjsq, 8) = RecTemp.Fields("digest")
- End If
- .TextMatrix(Rowjsq, 9) = RecTemp.Fields("RjzNotCheckID")
- .ColHidden(9) = True
- If RecTemp.Fields("bcheckflag") = True Then
- If RecTemp.Fields("handworkflag") = True Then
- .TextMatrix(Rowjsq, 6) = "√"
- Else
- .TextMatrix(Rowjsq, 6) = "○"
- End If
- .Cell(flexcpBackColor, Rowjsq, 0, Rowjsq, .Cols - 1) = Label4(0).BackColor
- End If
- Rowjsq = Rowjsq + 1
- End With
- RecTemp.MoveNext
- Loop
- '显示凭证日记帐
- Sqlstr = "select * from Cwzz_V_AccVouch where ccode='" & Val(Label3.Caption) & "'and bdelete=0 " _
- & "And convert(char(8),Ddate,112) >= " _
- & "(Select Convert(char(8),ddate,112) From cwzz_rjznotcheck Where rectype=0 And " _
- & "Ccode='" & Val(Label3.Caption) & "') And Convert(Char(6),Ddate,112)<= " _
- & "(select Convert(Char(6),max(qsrq),112) from gy_kjrlb where cwzzjzbz='1') Order By DDate"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Do While Not RecTemp.EOF()
- With vsFlexGrid1
- .Cols = 10
- If Rowjsq > .Rows - 1 Then
- .AddItem ""
- .RowHeight(.Rows - 1) = 350
- End If
- .TextMatrix(Rowjsq, 0) = RecTemp.Fields("ddate")
- If IsNull(RecTemp.Fields("billdate")) = False Then
- .TextMatrix(Rowjsq, 1) = RecTemp.Fields("billdate")
- End If
- .TextMatrix(Rowjsq, 3) = RecTemp.Fields("billno") & ""
- Sqlstr = "select * from gy_settlement where sscode='" & RecTemp.Fields("sscode") & "'"
- Set Recfind = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Recfind.EOF = False Then
- .TextMatrix(Rowjsq, 2) = Recfind.Fields("ssname") & ""
- End If
- If Val(RecTemp.Fields("jfje")) <> 0 Then
- .TextMatrix(Rowjsq, 4) = "借"
- .TextMatrix(Rowjsq, 5) = Format(RecTemp.Fields("jfje"), "#,####.00")
- Else
- .TextMatrix(Rowjsq, 4) = "贷"
- .TextMatrix(Rowjsq, 5) = Format(RecTemp.Fields("dfje"), "#,####.00")
- End If
- .TextMatrix(Rowjsq, 7) = Trim(RecTemp.Fields("vouchclasscode")) & "-" & Trim(RecTemp.Fields("vouchno"))
- .TextMatrix(Rowjsq, 8) = RecTemp.Fields("digest") & ""
- .TextMatrix(Rowjsq, 9) = RecTemp.Fields("SerialID") & ""
- If RecTemp.Fields("bcheckflag") = True Then
- If RecTemp.Fields("handworkflag") = True Then
- .TextMatrix(Rowjsq, 6) = "√"
- Else
- .TextMatrix(Rowjsq, 6) = "○"
- End If
- .Cell(flexcpBackColor, Rowjsq, 0, Rowjsq, .Cols - 1) = Label4(0).BackColor
- End If
- Rowjsq = Rowjsq + 1
- End With
- RecTemp.MoveNext
- Loop
- End Sub
- '双击选择银行企业的手工对帐
- Private Sub vsFlexGrid1_DblClick()
- Dim RecTemp As New ADODB.Recordset
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
- Exit Sub
- End If
- With vsFlexGrid1 '添加银行对帐单手工对帐标志
- If .Rows > 1 Then
- If RecTemp.State = 1 Then RecTemp.Close
- If .TextMatrix(.Row, 4) = "借" Then
- RecTemp.Open "select * from cwzz_rjznotcheck where RjzNotCheckID='" & .TextMatrix(.Row, 9) & "'and jfje=" & Val(Format(.TextMatrix(.Row, 5), "0.00")), Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Else
- RecTemp.Open "select * from cwzz_rjznotcheck where RjzNotCheckID='" & .TextMatrix(.Row, 9) & "'and dfje=" & Val(Format(.TextMatrix(.Row, 5), "0.00")), Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- End If
- If RecTemp.EOF = False Then
- If RecTemp.Fields("bcheckflag") = True Then
- RecTemp.Fields("bcheckflag") = 0
- RecTemp.Fields("handworkflag") = 0
- RecTemp.Update
- Else
- RecTemp.Fields("bcheckflag") = 1
- RecTemp.Fields("handworkflag") = 1
- RecTemp.Update
- End If
- Else
- If RecTemp.State = 1 Then RecTemp.Close '添加企业日记账手工对帐标志
- If .TextMatrix(.Row, 4) = "借" Then
- RecTemp.Open "select * from cwzz_accvouchsub where SerialID='" & .TextMatrix(.Row, 9) & "'and jfje=" & Val(Format(.TextMatrix(.Row, 5), "0.00")), Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Else
- RecTemp.Open "select * from cwzz_accvouchsub where SerialID='" & .TextMatrix(.Row, 9) & "'and dfje=" & Val(Format(.TextMatrix(.Row, 5), "0.00")), Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- End If
- If RecTemp.EOF = False Then
- If RecTemp.Fields("bcheckflag") = True Then
- RecTemp.Fields("bcheckflag") = 0
- RecTemp.Fields("handworkflag") = 0
- RecTemp.Update
- Else
- RecTemp.Fields("bcheckflag") = 1
- RecTemp.Fields("handworkflag") = 1
- RecTemp.Update
- End If
- End If
- End If
- If .TextMatrix(.Row, 6) = "" Then '添加颜色
- .TextMatrix(.Row, 6) = "√"
- .Cell(flexcpBackColor, .Row, 0, .Row, .Cols - 1) = Label4(0).BackColor
- .BackColorSel = Label4(0).BackColor
- Else
- .TextMatrix(.Row, 6) = ""
- .Cell(flexcpBackColor, .Row, 0, .Row, .Cols - 1) = Label4(2).BackColor
- .BackColorSel = Label4(2).BackColor
- End If
- End If
- End With
- End Sub
- '核销银行帐
- Sub HxYhz()
- Dim Msg As String
- Dim DWYE, YHYE, DWJF, DWDF, YHJF, YHDF As Currency
- Dim RecTemp As New ADODB.Recordset
- Dim RecDir As New ADODB.Recordset
- Dim SQL_Str As String
- '是否是银行帐户
- SQL_Str = "Select * From CWZZ_ACCCODE Where Cproperty='银行' And EndFlag=1 and Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If RecTemp.EOF Then
- MsgBox "科目编码输入有误!", vbOKOnly + 16, "百利/ERP5.0-财务总帐"
- Combo1.SetFocus
- Exit Sub
- End If
- '此帐户的余额是否平衡
- DWYE = 0
- YHYE = 0
- '单位帐面余额
- SQL_Str = "SELECT SUM(JFJE)-SUM(DFJE) From Cwzz_RjzNotCheck Where RecType=0 And Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = RecTemp(0)
- End If
- SQL_Str = "Select SUM(JFJE)-SUM(DFJE) From Cwzz_V_AccVouch where Ccode='" & Val(Label3.Caption) & "' " _
- & "And Convert(Char(8),Ddate,112)>=(Select Convert(Char(8),Ddate,112) From " _
- & "Cwzz_RjzNotCheck Where RecType=0 And Ccode='" & Val(Label3.Caption) & "') " _
- & "And Convert(Char(6),Ddate,112)<=(select Convert(Char(6),max(qsrq),112) from gy_kjrlb where cwzzjzbz='1')"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = DWYE + RecTemp(0)
- End If
- '银行帐面余额
- SQL_Str = "SELECT SUM(DFJE)-SUM(JFJE) From Cwzz_BankBill Where (RecType=0) And Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = RecTemp(0)
- End If
- SQL_Str = "SELECT SUM(DFJE)-SUM(JFJE) From Cwzz_BankBill Where (RecType=2) And Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = YHYE + RecTemp(0)
- End If
- '银行调整后余额=银行帐面余额+(企业己收银行未收-企业己付银行未付)
- SQL_Str = "SELECT SUM(JFJE)-SUM(DFJE) From Cwzz_RjzNotCheck Where RecType=1 And BDelete=0 And Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = YHYE + RecTemp(0)
- End If
- SQL_Str = "Select SUM(JFJE)-SUM(DFJE) From Cwzz_V_AccVouch where Ccode='" & Val(Label3.Caption) & "' " _
- & "And Convert(Char(8),Ddate,112)>=(Select Convert(Char(8),Ddate,112) From " _
- & "Cwzz_RjzNotCheck Where RecType=0 And Ccode='" & Val(Label3.Caption) & "') And BDelete=0 " _
- & "And Convert(Char(6),Ddate,112)<=(select Convert(Char(6),max(qsrq),112) from gy_kjrlb where cwzzjzbz='1')"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = YHYE + RecTemp(0)
- End If
- '单位调整后余额=银行帐面余额+(银行己收企业未收-银行己付企业未付)
- SQL_Str = "SELECT SUM(JFJE)-SUM(DFJE) From Cwzz_BankBill Where RecType=1 And BDelete=0 And Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = DWYE + RecTemp(0)
- End If
- SQL_Str = "SELECT SUM(DFJE)-SUM(JFJE) From Cwzz_BankBill Where RecType=2 And BDelete=0 And Ccode='" & Val(Label3.Caption) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = DWYE + RecTemp(0)
- End If
- If DWYE <> YHYE Then
- MsgBox "《" + Label3.Caption + "》帐户调整余额不平,不能进行核销", 16, "百利/ERP5.0-财务总帐"
- Exit Sub
- End If
- '判断己勾对的帐是否平衡
- DWJF = 0
- DWDF = 0
- YHJF = 0
- YHDF = 0
- '银行对帐单
- SQL_Str = " Select sum(jfje),sum(dfje) From Cwzz_BankBill Where bcheckflag=1 And BDelete='0' And RecType='1' "
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHDF = RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- YHJF = RecTemp(1)
- End If
- SQL_Str = " Select sum(jfje),sum(dfje) From Cwzz_BankBill Where bcheckflag=1 And BDelete='0' And RecType='2'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHJF = YHJF + RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- YHDF = YHDF + RecTemp(1)
- End If
- '单位日记帐
- SQL_Str = " Select sum(jfje),sum(dfje) From cwzz_accvouchsub Where bcheckflag=1 And BDelete='0'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWJF = RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- DWDF = RecTemp(1)
- End If
- SQL_Str = " Select sum(jfje),sum(dfje) From Cwzz_RjzNotCheck Where bcheckflag=1 And BDelete='0'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWJF = DWJF + RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- DWDF = DWDF + RecTemp(1)
- End If
- If DWJF = YHDF And DWDF = YHJF Then
- Else
- If DWDF = DWJF Then
- Else
- MsgBox "银行自动对帐数据不平衡,不能进行核销。", 16, "百利/ERP5.0-财务总帐"
- Exit Sub
- End If
- End If
- '判断是否有可核销的数据
- Sqlstr = "Select Count(*) From Cwzz_BankBill Where BCheckFlag='1' And BDelete='0'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If RecTemp.Fields(0) <= 0 Then
- MsgBox "没有可核销的数据!", vbOKOnly + 64, "百利/ERP5.0-财务总帐"
- Exit Sub
- End If
- On Error GoTo Err:
- Cw_DataEnvi.DataConnect.BeginTrans
- Msg = MsgBox("你要核销银行已经对帐的数据吗?", vbYesNo)
- If Msg = vbYes Then
- '核销银行帐
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from cwzz_bankbill where bcheckflag=1", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF()
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- '核销日记帐
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from cwzz_accvouchsub where bcheckflag=1", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF()
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- '核销单位未达帐
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from Cwzz_RjzNotCheck where bcheckflag=1", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF()
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- '核销结算方式相同,票号相同,金额相反的数据
- Sqlstr = "Select * From CWZZ_V_BILL"
- Set RecDir = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Do While Not RecDir.EOF()
- If RecTemp.State = 1 Then RecTemp.Close
- Sqlstr = "Select * From cwzz_accvouchsub Where SerialID=" + CStr(RecDir.Fields("SerialID")) + " Or SerialID=" + CStr(RecDir.Fields("B_Id")) + ""
- RecTemp.Open Sqlstr, Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF
- RecTemp.Fields("BCheckFlag") = 1
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- RecDir.MoveNext
- Loop
- MsgBox "核销完毕!", 64, "百利/ERP5.0-财务总帐"
- End If
- Cw_DataEnvi.DataConnect.CommitTrans
- Err:
- Cw_DataEnvi.DataConnect.RollbackTrans
- End Sub
- '控制网格颜色
- Private Sub vsFlexGrid1_RowColChange()
- If vsFlexGrid1.Cell(flexcpBackColor, vsFlexGrid1.Row) = Label4(0).BackColor Then
- vsFlexGrid1.BackColorSel = Label4(0).BackColor
- Else
- vsFlexGrid1.BackColorSel = Label4(2).BackColor
- End If
- End Sub