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

📄 frmlastyearcarryforward.frm

📁 一个用VB写的财务软件源码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
VERSION 5.00
Begin VB.Form frmLastYearCarryForward 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "结转上年数据"
   ClientHeight    =   2940
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   Icon            =   "frmLastYearCarryForward.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2940
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox Picture3 
      Height          =   315
      Left            =   1740
      ScaleHeight     =   255
      ScaleWidth      =   1635
      TabIndex        =   6
      Top             =   2040
      Width           =   1695
      Begin VB.Label lblNewYear 
         AutoSize        =   -1  'True
         Caption         =   "xxxx"
         Height          =   180
         Left            =   60
         TabIndex        =   7
         Top             =   30
         Width           =   360
      End
   End
   Begin VB.PictureBox Picture2 
      Height          =   315
      Left            =   1740
      ScaleHeight     =   255
      ScaleWidth      =   1905
      TabIndex        =   4
      Top             =   1530
      Width           =   1965
      Begin VB.Label lblAccountName 
         AutoSize        =   -1  'True
         Caption         =   "xxxx"
         Height          =   180
         Left            =   60
         TabIndex        =   5
         Top             =   30
         Width           =   360
      End
   End
   Begin VB.Frame frmInf 
      Caption         =   "说明"
      Height          =   1215
      Left            =   120
      TabIndex        =   2
      Top             =   90
      Width           =   4455
      Begin VB.Label lblInf 
         Caption         =   $"frmLastYearCarryForward.frx":000C
         Height          =   855
         Left            =   150
         TabIndex        =   3
         Top             =   300
         Width           =   4170
      End
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定(&O)"
      Default         =   -1  'True
      Height          =   315
      Left            =   780
      TabIndex        =   0
      Top             =   2550
      Width           =   1005
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&C)"
      Height          =   315
      Left            =   2970
      TabIndex        =   1
      Top             =   2550
      Width           =   1005
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "年"
      Height          =   180
      Left            =   3510
      TabIndex        =   10
      Top             =   2100
      Width           =   180
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "结转年份:"
      Height          =   180
      Left            =   810
      TabIndex        =   9
      Top             =   2100
      Width           =   900
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "账套名称:"
      Height          =   180
      Left            =   810
      TabIndex        =   8
      Top             =   1590
      Width           =   900
   End
End
Attribute VB_Name = "frmLastYearCarryForward"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************** not used

Option Explicit
Option Base 1

Const PrecentOfKm = 40
Const PrecentOfYe = 15
Const PrecentOfFz = 5
Const PrecentOfPz = 10
Const PrecentOfYhdzd = 10


Private Type SubSysUsedUDT                  '子系统启用情况记录表
    ZW As Boolean
    GD As Boolean
    GZ As Boolean
    BB As Boolean
    FX As Boolean
    RS As Boolean
    CF As Boolean
    MR As Boolean
End Type

Dim bSubSysUsed As SubSysUsedUDT                '判断各子系统是否启用
Dim sCarryForwardYear As String                 '结转年份
Dim sBeginYear As String                        '账套启用年份
Dim sModiYear As String                         '账套结账年份
Dim sModiMonth As Integer                       '账套结账月份
Dim adoRst As ADODB.Recordset
Dim adoSQL As String
Dim i As Integer

Dim sCarryForwardTableCode() As String          '需要结转表的代码
Dim sCarryForwardTableName() As String          '需要结转表的名称

Dim sHaveTableName() As String                  '已经成功结转的表名

Dim adoCnnAccount As New ADODB.Connection
Dim adoCmd As ADODB.Command

Public usAccountID As String                    '账套ID号
Public usAccountName As String                  '账套名称

Public Function usCarryForwardTableCode() As String()       '传递需要结转表的代码
    usCarryForwardTableCode = sCarryForwardTableCode
End Function

Public Function usCarryForwardTableName() As String()       '传递需要结转表的名称
    usCarryForwardTableName = sCarryForwardTableName
End Function



Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOk_Click()

    If sBeginYear > sModiYear Then
        MsgBox usAccountName & "账套的账务子系统刚启用,不能进行上年结转!", vbInformation
        Unload Me
        Exit Sub
    End If
    
    If sCarryForwardYear = sModiYear + 1 Then
        Call GetCarryForwardTable
        With frmSelectCarryForwardTable
'            .usCarryForwardTableCode = sCarryForwardTableCode
            .usCarryForwardTableName = sCarryForwardTableName
            .Show 1
            If .OK Then
                Me.Hide
                If MsgBox("是否确认将以上所选的" & usAccountName & "账套的" & sModiYear & _
                        "年度会计数据结转至" & sCarryForwardYear & "年?", _
                        vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then
                    fMainForm.MousePointer = vbHourglass
                    glo.frmProg.Show
                    glo.frmProg.ShowProgress 0
                    For i = 0 To .lstTable.ListCount - 1
                        If .lstTable.Selected(i) = True Then
                            '结转上年数据
                            Call CarryForwardData(sCarryForwardTableCode(i + 1), .lstTable.List(i))
                        End If
                    Next i
                    glo.frmProg.Hide
                    fMainForm.MousePointer = vbDefault
                    MsgBox "上年数据结转完成!", vbInformation
                End If
            End If
            Unload frmSelectCarryForwardTable
            Unload Me
        End With
    ElseIf sCarryForwardYear = sModiYear Then
        MsgBox sCarryForwardYear & "年账务子系统已经结账,不能进行上年数据结转!"
        Unload Me
        Exit Sub
    Else
        MsgBox sCarryForwardYear - 1 & "年账务子系统还未结账,不能进行上年数据结转!"
        Unload Me
        Exit Sub
    End If
End Sub

Private Sub Form_Load()

    Set adoRst = New ADODB.Recordset
    adoRst.CursorLocation = adUseClient
    
    '从会计期间系统表中取出当前选择账套最大年份
    adoSQL = "SELECT MAX(Year) maxYear FROM tSYS_Period" & _
            " WHERE AccountID = '" & usAccountID & "'"
    With adoRst
        .Open adoSQL, gloSys.cnnSys, adOpenStatic, adLockReadOnly
        If .BOF And .EOF Then
            MsgBox "缺少账套会计期间!"
        ElseIf IsNull(.Fields("maxYear").Value) Then
            MsgBox "缺少账套会计期间!"
        Else
            sCarryForwardYear = .Fields("maxYear").Value
        End If
        .Close
    End With
    
    
    '从子系统启用表中取出当前账套的结账年份
    adoSQL = "SELECT * FROM tSYS_SubSysUsed" & _
            " WHERE AccountID = '" & usAccountID & "'"
    With adoRst
        .Open adoSQL, gloSys.cnnSys, adOpenStatic, adLockReadOnly

⌨️ 快捷键说明

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