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

📄

📁 VB开发的ERP系统
💻
字号:
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 Xs_Z_MonthAccount 
   Caption         =   "月末结帐"
   ClientHeight    =   4875
   ClientLeft      =   60
   ClientTop       =   360
   ClientWidth     =   5400
   Icon            =   "月末结账.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4875
   ScaleWidth      =   5400
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Cmd_Help 
      Caption         =   "帮助(&H)"
      Height          =   300
      Left            =   2100
      TabIndex        =   4
      ToolTipText     =   "4290"
      Top             =   4380
      Width           =   1155
   End
   Begin VB.CommandButton Cmd_Exit 
      Caption         =   "退出(&X)"
      Height          =   300
      Left            =   3780
      TabIndex        =   2
      Top             =   4380
      Width           =   1155
   End
   Begin VB.CommandButton Cmd_CancelAccount 
      Caption         =   "恢复结帐(&N)"
      Height          =   300
      Left            =   420
      TabIndex        =   1
      ToolTipText     =   "4290"
      Top             =   4380
      Visible         =   0   'False
      Width           =   1155
   End
   Begin VB.CommandButton Cmd_OKAccount 
      Caption         =   "结帐(&Y)"
      Height          =   300
      Left            =   420
      TabIndex        =   0
      Top             =   4380
      Width           =   1155
   End
   Begin VSFlex8Ctl.VSFlexGrid vsFlx_Grid 
      Height          =   4095
      Left            =   90
      TabIndex        =   3
      Top             =   90
      Width           =   5205
      _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    =   -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            =   50
      Cols            =   10
      FixedRows       =   1
      FixedCols       =   1
      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 MSComctlLib.Toolbar GsToolbar 
      Height          =   525
      Left            =   2325
      TabIndex        =   5
      Top             =   3945
      Visible         =   0   'False
      Width           =   2685
      _ExtentX        =   4736
      _ExtentY        =   926
      ButtonWidth     =   1455
      ButtonHeight    =   926
      AllowCustomize  =   0   'False
      Appearance      =   1
      Style           =   1
      ImageList       =   "Imagelist1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   3
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "保存格式"
            Key             =   "bcgs"
            ImageKey        =   "bc"
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "默认格式"
            Key             =   "hfmrgs"
            ImageKey        =   "fq"
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "显示项目"
            Key             =   "CSXM"
            ImageKey        =   "xsxm"
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "Xs_Z_MonthAccount"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'***********************************************************************************************************
'*    模 块 名 称 :月末结帐
'*    功 能 描 述 :此功能模块主要完成销售月末结帐处理
'*    程序员姓名  :王长兴
'*    最后修改人  :王长兴
'*    最后修改时间:2001/12/06
'*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
'*
'***********************************************************************************************************

'以下为固定使用变量
Dim Tsxx As String                       '系统信息提示
Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
Dim GridCode As String                   '显示网格网格代码
Dim GridInf() As Variant                 '整个网格设置信息
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)

Public BlTemp As Boolean

Private Sub Cmd_CancelAccount_Click()
    Dim Lng_Tmp As Long
    Dim str_Period As String
    Dim rs_Period As New ADODB.Recordset
    With Me.vsFlx_Grid
        For Lng_Tmp = .Rows - 1 To .FixedRows Step -1
            If .TextMatrix(Lng_Tmp, Sydz("005", GridStr(), Szzls)) = True Then
                .Row = Lng_Tmp
                Exit For
            End If
        Next Lng_Tmp
        If Lng_Tmp < .FixedRows Then
            Call Xtxxts("没有要恢复结帐的会计期间!", 0, 4)
            Exit Sub
        End If
        
        str_Period = "select * from Gy_kjrlb where BeginFlag='1'"
        Set rs_Period = Cw_DataEnvi.DataConnect.Execute(str_Period)
        If Not rs_Period.EOF Then
            If rs_Period.Fields("KjYear") = Val(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls))) And rs_Period.Fields("Period") > Val(.TextMatrix(.Row, Sydz("002", GridStr(), Szzls))) Then
                Call Xtxxts("系统期初月份为" & rs_Period.Fields("Period") & "不能恢复结帐!", 0, 4)
                Exit Sub
            End If
        End If
        
        str_Period = "select * from Gy_kjrlb where kjyear='" & Xtyear + 1 & "' and xsjzbz=1"
        Set rs_Period = Cw_DataEnvi.DataConnect.Execute(str_Period)
        If rs_Period.RecordCount > 0 Then
            Call Xtxxts("系统下一年度已经有结帐数据,不能恢复本期数据!", 0, 4)
            Exit Sub
        End If
        
        str_Period = "select top 1 *  from Gy_kjrlb where xsjzbz=1 order by KjYear desc,Period desc "
        
        Set rs_Period = Cw_DataEnvi.DataConnect.Execute(str_Period)
        Cw_DataEnvi.DataConnect.Execute ("XS_SP_CancelAccount " & rs_Period.Fields("KjYear") & "," & rs_Period.Fields("Period"))
        .TextMatrix(Lng_Tmp, Sydz("005", GridStr(), Szzls)) = False
        .Row = Lng_Tmp - 1
        Call Xtxxts("恢复结帐完成!", 0, 4)
    End With
End Sub

Private Sub Cmd_Exit_Click()
    Unload Me
End Sub

Private Sub Cmd_Help_Click()
    Call F1bz
End Sub

Private Sub Cmd_OKAccount_Click()
    Dim int_MsgResult As Integer
    Dim Lng_Jsq As Long
    Dim str_Invoice As String
    Dim rs_Invoice As New ADODB.Recordset
    '判断选择合法性
    With Me.vsFlx_Grid
        Lng_Jsq = .Row
        If Lng_Jsq >= 12 + .FixedRows Then Exit Sub
        '判断是否可以结帐
        str_Invoice = "select * from Xs_ConsignBillMain where KjYear=" & Val(.TextMatrix(Lng_Jsq, Sydz("001", GridStr(), Szzls))) & " and Period=" & Val(.TextMatrix(Lng_Jsq, Sydz("002", GridStr(), Szzls))) & " and  Checker=''"
        Set rs_Invoice = Cw_DataEnvi.DataConnect.Execute(str_Invoice)
        If Not rs_Invoice.EOF() Then
            Call Xtxxts("结帐会计期间有未审核的货单,不能结帐!", 0, 4)
            Exit Sub
        End If
        str_Invoice = "select * from Xs_InvoiceBillMain where KjYear=" & Val(.TextMatrix(Lng_Jsq, Sydz("001", GridStr(), Szzls))) & " and Period=" & Val(.TextMatrix(Lng_Jsq, Sydz("002", GridStr(), Szzls))) & " and  Checker=''"
        Set rs_Invoice = Cw_DataEnvi.DataConnect.Execute(str_Invoice)
        If Not rs_Invoice.EOF() Then
            Call Xtxxts("结帐会计期间有未审核的发票,不能结帐!", 0, 4)
            Exit Sub
        End If
        '结帐
        int_MsgResult = Xtxxts("你确定要结帐吗?", 1, 4)
        If int_MsgResult = 6 Then
            Xt_Wait.Show
            On Error GoTo Err_Ctrl
            Cw_DataEnvi.DataConnect.BeginTrans
                Cw_DataEnvi.DataConnect.Execute ("Xs_SP_Account " & Val(.TextMatrix(Lng_Jsq, Sydz("001", GridStr(), Szzls))) & "," & Val(.TextMatrix(Lng_Jsq, Sydz("002", GridStr(), Szzls))) & ",'" & Xtczy & "','" & Xtrq & "'")
            Cw_DataEnvi.DataConnect.CommitTrans
            .TextMatrix(Lng_Jsq, Sydz("005", GridStr(), Szzls)) = True
            If .Row < .Rows - 1 Then
                    .Row = Lng_Jsq + 1
                Else
                    .Row = Lng_Jsq
            End If
            Xt_Wait.Hide
            Call Xtxxts("月末结帐完成!", 0, 4)
        End If
    End With
    Exit Sub
Err_Ctrl:
    Cw_DataEnvi.DataConnect.RollbackTrans
    Call Xtxxts("月末结帐失败,恢复成未结帐状态!", 0, 4)
    Xt_Wait.Hide
End Sub

Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
    Select Case Button.Key
        Case "bcgs"                                          '保存表格格式
            Call Bcwggs(vsFlx_Grid, GridCode, GridStr())
        Case "hfmrgs"                                        '恢复默认格式
            Call Hfmrgs(vsFlx_Grid, GridCode, GridStr())
        Case "szxsxm"                                        '设置显示项目
            Call Szxsxm(vsFlx_Grid, GridCode)
    End Select
End Sub

Private Sub Form_Load()
    Dim rs_Record As New ADODB.Recordset
    Dim str_Record As String
    Dim InTemp As Integer
    
    
    If Not BlTemp Then
        Xs_Z_MonthAccount.Caption = "恢复结帐"
        Cmd_OKAccount.Visible = False
        Cmd_CancelAccount.Visible = True
    End If
    GridCode = "Xs_Z_MonthAccount"
    Call BzWgcsh(Me.vsFlx_Grid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
    Qslz = GridInf(1)
    Sjhgd = GridInf(2)
    Sfxshjwg = GridInf(7)
    Szzls = Me.vsFlx_Grid.Cols - 1
    
    str_Record = "select * from Gy_kjrlb where kjyear='" & Xtyear & "' order by KjYear,Period,qsrq,zzrq,cgjzbz"
    Set rs_Record = Cw_DataEnvi.DataConnect.Execute(str_Record)
    With Me.vsFlx_Grid
        .Rows = .FixedRows
        InTemp = .FixedRows
        Do While Not rs_Record.EOF()
            .AddItem ""
            .RowHeight(.Rows - 1) = 300
            .TextMatrix(.Rows - 1, Sydz("001", GridStr(), Szzls)) = Trim(rs_Record.Fields("KjYear") & "")
            .TextMatrix(.Rows - 1, Sydz("002", GridStr(), Szzls)) = Trim(rs_Record.Fields("Period") & "")
            .TextMatrix(.Rows - 1, Sydz("003", GridStr(), Szzls)) = Trim(rs_Record.Fields("qsrq") & "")
            .TextMatrix(.Rows - 1, Sydz("004", GridStr(), Szzls)) = Trim(rs_Record.Fields("zzrq") & "")
            .TextMatrix(.Rows - 1, Sydz("005", GridStr(), Szzls)) = rs_Record.Fields("xsjzbz")
            rs_Record.MoveNext
        Loop
        rs_Record.Close
        
        '期初数据处理
        str_Record = "select * from Gy_kjrlb where BeginFlag='1' and kjyear='" & Xtyear & "'"
        Set rs_Record = Cw_DataEnvi.DataConnect.Execute(str_Record)
        If Not rs_Record.EOF Then
            InTemp = Val(rs_Record.Fields("Period")) + .FixedRows - 1
        End If
        '选择所操作的会计期间
        For I = InTemp To .Rows - 1
            If .TextMatrix(I, Sydz("005", GridStr(), Szzls)) = False Then
                If BlTemp Then
                    .Row = I
                Else
                    .Row = I - 1
                End If
                Exit For
            Else
                .Row = .Rows - 1
            End If
        Next I
        
        .Enabled = False
    End With
End Sub

  

⌨️ 快捷键说明

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