⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄

📁 VB开发的ERP系统
💻
字号:
VERSION 5.00
Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
Begin VB.Form Balance_KF_Invoice 
   Caption         =   "结算发票"
   ClientHeight    =   5745
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8355
   Icon            =   "结算_发票.frx":0000
   LinkTopic       =   "Form2"
   ScaleHeight     =   5745
   ScaleWidth      =   8355
   StartUpPosition =   2  '屏幕中心
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   1
      Left            =   5400
      Top             =   300
   End
   Begin VB.CommandButton Gridsz 
      Caption         =   "保存表格格式"
      Height          =   300
      Left            =   4470
      TabIndex        =   7
      Top             =   5280
      Width           =   1305
   End
   Begin VB.CheckBox Check1 
      Caption         =   "全消"
      Height          =   255
      Index           =   1
      Left            =   1200
      TabIndex        =   6
      Top             =   5280
      Width           =   855
   End
   Begin VB.CheckBox UnloadCheck 
      Caption         =   "卸载窗体"
      Height          =   615
      Left            =   2640
      TabIndex        =   5
      Top             =   5880
      Visible         =   0   'False
      Width           =   825
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消(&C)"
      Height          =   300
      Left            =   7110
      TabIndex        =   2
      Top             =   5280
      Width           =   1120
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定(&O)"
      Height          =   300
      Left            =   5880
      TabIndex        =   1
      Top             =   5280
      Width           =   1120
   End
   Begin VB.CheckBox Check1 
      Caption         =   "全选"
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   0
      Top             =   5280
      Width           =   855
   End
   Begin VSFlex8Ctl.VSFlexGrid CXBBGrid 
      Height          =   4635
      Left            =   90
      TabIndex        =   3
      Top             =   480
      Width           =   8175
      _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    =   8388608
      ForeColorSel    =   -2147483639
      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 Label1 
      Caption         =   "用鼠标单击所要选择的单据记录,出现选中标志,可以单选,也可以多选"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   120
      Width           =   5895
   End
End
Attribute VB_Name = "Balance_KF_Invoice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************************************************
'*    模 块 名 称 :发票列表
'*    功 能 描 述 :
'*    程序员姓名  :周化江
'*    最后修改人  :周化江
'*    最后修改时间:2001/10/06
'*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
'**************************************************************************

'以下为固定使用变量
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 Sfxshjwg As Boolean                  '是否显示合计网格
Dim GridBoolean() As Boolean             '网格列信息(布尔型)
Dim GridStr()  As String                 '网格列信息(字符型)
Dim GridInt() As Integer                 '网格列信息(整型)
Dim Szzls As Integer                     '数组总列数(网格列数-1)
'''''''''''''自定义
Dim str_OldFilterCondition As String
Dim str_NowFilterCondition As String


Private Sub Check1_Click(Index As Integer)
Dim count As Integer
Select Case Index
    Case 0
        If Check1(Index).Value Then
            Check1(1).Value = 0
            For count = CxbbGrid.FixedRows To CxbbGrid.Rows - CxbbGrid.FixedRows
                CxbbGrid.TextMatrix(count, Sydz("001", GridStr(), Szzls)) = "√"
            Next
        Else
            For count = CxbbGrid.FixedRows To CxbbGrid.Rows - CxbbGrid.FixedRows
                CxbbGrid.TextMatrix(count, Sydz("001", GridStr(), Szzls)) = ""
            Next
        End If
    Case 1
        If Check1(Index).Value Then
            Check1(0).Value = 0
            For count = CxbbGrid.FixedRows To CxbbGrid.Rows - CxbbGrid.FixedRows
                CxbbGrid.TextMatrix(count, Sydz("001", GridStr(), Szzls)) = ""
            Next
        Else
            For count = CxbbGrid.FixedRows To CxbbGrid.Rows - CxbbGrid.FixedRows
                CxbbGrid.TextMatrix(count, Sydz("001", GridStr(), Szzls)) = "√"
            Next
        End If

End Select
End Sub

Private Sub Command1_Click()
    Dim str_InvoiceFilter As String
    Dim int_temp As Integer
    str_InvoiceFilter = "  InvoiceMainID in ( 0 "
    With CxbbGrid
        For int_temp = .FixedRows To .Rows - 1
            If Trim(.TextMatrix(int_temp, Sydz("001", GridStr(), Szzls))) = "√" Then
                str_InvoiceFilter = str_InvoiceFilter & "," & .ValueMatrix(int_temp, 0)
            End If
        Next int_temp
        str_InvoiceFilter = str_InvoiceFilter & ")"
    End With
    Balance_KF_HandBalance.Invoice_FilterCondition = str_InvoiceFilter
    Balance_KF_HandBalance.Timer2.Enabled = True
    Me.Hide
End Sub

Private Sub Command2_Click()
 Me.Hide
End Sub

Private Sub CxbbGrid_DblClick()
    With CxbbGrid
        If .Row > .FixedRows - 1 Then
            If Trim(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls))) = "" Then
                Call grid_select(.TextMatrix(.Row, Sydz("007", GridStr(), Szzls)), "1")
                .TextMatrix(.Row, Sydz("001", GridStr(), Szzls)) = "√"
            Else
                Call grid_select(.TextMatrix(.Row, Sydz("007", GridStr(), Szzls)), "")
                .TextMatrix(.Row, Sydz("001", GridStr(), Szzls)) = ""
            End If
        End If
    End With
End Sub

Private Sub Form_Activate()
    If Trim(Me.Old_FilterCondition) <> Trim(Me.Now_FilterCondition) Then
        Timer1.Enabled = True
    End If
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If UnloadCheck.Value <> 1 Then
        Cancel = 1
        Me.Hide
    End If
End Sub


Private Sub Form_Load()                                                   '窗体装入
    '调 入 网 格(Fixed)
    GridCode = "Kf_InvoiceBalance"
    Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
    
    Qslz = GridInf(1)
    Sjhgd = GridInf(2)
    Sfxshjwg = GridInf(7)
    Szzls = CxbbGrid.Cols - 1
End Sub
Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
    Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Me.Old_FilterCondition = ""
End Sub

Private Sub Gridsz_Click()
    Call Bcwggs(CxbbGrid, GridCode, GridStr()) '保存表格格式
End Sub

Private Sub grid_select(str_InvoiceNum As String, flag As String)
Dim count As Integer
    If flag = "1" Then
        With CxbbGrid
            For count = 0 To .Rows - .FixedRows - 1
                If Trim(.TextMatrix(.FixedRows + count, Sydz("007", GridStr(), Szzls))) = Trim(str_InvoiceNum) Then
                    .TextMatrix(.FixedRows + count, Sydz("001", GridStr(), Szzls)) = "√"
                End If
            Next
        End With
    Else
        With CxbbGrid
            For count = 0 To .Rows - .FixedRows - 1
                If Trim(.TextMatrix(.FixedRows + count, Sydz("007", GridStr(), Szzls))) = Trim(str_InvoiceNum) Then
                    .TextMatrix(.FixedRows + count, Sydz("001", GridStr(), Szzls)) = ""
                End If
            Next
        End With
    End If
End Sub

Public Property Get Old_FilterCondition() As String
  Old_FilterCondition = str_OldFilterCondition
End Property

Public Property Let Old_FilterCondition(ByVal vNewValue As String)
  str_OldFilterCondition = vNewValue
End Property
Public Property Get Now_FilterCondition() As String
  Now_FilterCondition = str_NowFilterCondition
End Property

Public Property Let Now_FilterCondition(ByVal vNewValue As String)
  str_NowFilterCondition = vNewValue
End Property

Private Sub Timer1_Timer()
    Timer1.Enabled = False
    If Me.Old_FilterCondition = Me.Now_FilterCondition Then
        Exit Sub
    End If
    Dim int_temp As Long
    Dim rst_temp As New ADODB.Recordset
    Dim str_sqlTemp As String
    Dim jsqte As Long
    CxbbGrid.Rows = CxbbGrid.FixedRows
    Set rst_temp = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM KF_V_BalanceInvoice " & Me.Now_FilterCondition)
    jsqte = CxbbGrid.FixedRows
    If rst_temp.RecordCount <> 0 Then
        rst_temp.MoveFirst
        With CxbbGrid
            For int_temp = 1 To rst_temp.RecordCount
                If jsqte >= .Rows Then
                   .AddItem ""
                End If
                
                .TextMatrix(jsqte, 0) = rst_temp.Fields("InvoiceMainID")                        '主表ID
                .TextMatrix(jsqte, 1) = rst_temp.Fields("InvoiceSubID")                        '子表ID
                .TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim("" & rst_temp.Fields("MNumber"))
                .TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim("" & rst_temp.Fields("MName"))
                .TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(rst_temp.Fields("Model") & "")
                .TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(rst_temp.Fields("PrimaryUnitName") & "")
                .TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(rst_temp.Fields("SupplierName") & "")
                .TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim("" & rst_temp.Fields("InvoiceNum"))
                .TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Format(rst_temp.Fields("InvoiceDate"), "yyyy-mm-dd")
                .TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = IIf(IsNull(rst_temp.Fields("Quantity")) Or rst_temp.Fields("Quantity") = 0, "", rst_temp.Fields("Quantity"))
                .TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = IIf(IsNull(rst_temp.Fields("PriceBb")) Or rst_temp.Fields("PriceBb") = 0, "", rst_temp.Fields("PriceBb"))
                .TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = IIf(IsNull(rst_temp.Fields("TotalMoneyBb")) Or rst_temp.Fields("TotalMoneyBb") = 0, "", rst_temp.Fields("TotalMoneyBb"))
                .TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = rst_temp.Fields("IsCharge")
                .RowHeight(jsqte) = Sjhgd
                jsqte = jsqte + 1
                rst_temp.MoveNext
            Next int_temp
        End With
    End If
    rst_temp.Close
    Set rst_temp = Nothing
    Me.Old_FilterCondition = Me.Now_FilterCondition
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -