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

📄 frmfinancebook.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
                        D1 = CDate(gclsBase.BeginDate)
                    End If
                End If
                AnalyBeginDate.Value = D1
                AnalyEndDate.Value = D2
            Else
                ShowMsg Me.hWnd, "没有相应的期间!", vbExclamation + vbOKOnly, App.title
                cmbAnalyDate.Text = mclsFinanceReport.DateCond
            End If
        End If
    End If
    mclsFinanceReport.AnalyPeriod = cmbAnalyDate.Text
    mclsFinanceReport.AnalyStart = CDate(AnalyBeginDate.Text)
    mclsFinanceReport.AnalyEnd = CDate(AnalyEndDate.Text)
    mblnIsPeriodChanged = True
    mblnCondIsChanged = True
    CreatNewCond
'    mblnResponseChange = True
    Exit Sub
ErrHandler:
    If mblnCondIsChanged = False Then
        cmbAnalyDate.Text = mclsFinanceReport.DateCond
    Else
        cmbAnalyDate.Text = mclsFinanceReport.AnalyPeriod
    End If
End Sub
Private Sub cmbOtherAnaly_Choose()
    Dim D1 As Date
    Dim D2 As Date
    On Error GoTo ErrHandler
    If Not mblnFormIsLoad Then
        Exit Sub
    End If
    If mblnFirstChange = True Or mblnReportReset = True Or (cmbOtherAnaly.Text = mclsFinanceReport.OtherAnalyCond And cmbOtherAnaly.Text <> "自定义") Then
        Exit Sub
    End If
    If Format(OtherAnalyBegin.Text, "yyyy-mm-dd") = Format(mclsFinanceReport.OtherAnalyBegin, "yyyy-mm-dd") And Format(OtherAnalyEnd.Text, "yyyy-mm-dd") = Format(mclsFinanceReport.OtherAnalyEnd, "yyyy-mm-dd") And cmbOtherAnaly.Text = "自定义" Then
        Exit Sub
    End If
    If mclsFinanceReport.ViewId <> 321 And mclsFinanceReport.ViewId <> 682 And mclsFinanceReport.IsUseRefer = False Then
        If PeriodIsSame Then
            ShowMsg Me.hWnd, "分析期类型与比较期类型重复!", vbExclamation, App.title
            cmbOtherAnaly.ReferRow = mintReferRow3
            Me.Refresh
            Exit Sub
        End If
    End If
    mstrOtherAnalyDateOP = mclsFinanceReport.ExgPeriodType(cmbOtherAnaly.Text)
     If Trim(cmbOtherAnaly.Text) = "自定义" Then
        mclsFinanceReport.OtherAnalyBegin = OtherAnalyBegin.Text
        mclsFinanceReport.OtherAnalyEnd = OtherAnalyEnd.Text
        mblnCondIsChanged = True
        CreatNewCond
        mblnIsPeriodChanged = True
        Exit Sub
    End If
    If Trim(cmbOtherAnaly.Text) = "所有" Then
        OtherAnalyBegin.Text = gclsBase.BeginDate
        OtherAnalyEnd.Text = gclsBase.EndDate
    Else
        If cmbAnalyDate.Text <> "去年" Then
            gclsBase.GetBeginAndEndDate cmbOtherAnaly.Text, gclsBase.BaseDate, D1, D2
            If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                If Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                    cmbOtherAnaly.Text = mclsFinanceReport.OtherAnalyCond
                    Exit Sub
                End If
                If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") And Format(D2, "yyyy-mm-dd") > Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                    D1 = CDate(gclsBase.BeginDate)
                End If
                '修改于1999-7-15
            End If
            If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                    cmbOtherAnaly.Text = mclsFinanceReport.OtherAnalyCond
                    Exit Sub
                End If
                If Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") And Format(D1, "yyyy-mm-dd") <= Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                    D2 = CDate(gclsBase.EndDate)
                End If
            End If
            OtherAnalyBegin.Text = Format(D1, "yyyy-mm-dd")
            OtherAnalyEnd.Text = Format(D2, "yyyy-mm-dd")
        ElseIf cmbOtherAnaly.Text = "去年" Then
            gclsBase.GetBeginAndEndDate cmbOtherAnaly.Text, gclsBase.BaseDate, D1, D2
            If D1 <> #12:00:00 AM# Then
                If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                    If Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                        cmbOtherAnaly.Text = mclsFinanceReport.OtherAnalyCond
                        Exit Sub
                    End If
                    If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") And Format(D2, "yyyy-mm-dd") > Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                        D1 = CDate(gclsBase.BeginDate)
                    End If
                End If
                If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                    If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                        cmbOtherAnaly.Text = mclsFinanceReport.OtherAnalyCond
                        Exit Sub
                    End If
                    If Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") And Format(D1, "yyyy-mm-dd") <= Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                        D2 = CDate(gclsBase.EndDate)
                    End If
                End If
                OtherAnalyBegin.Text = Format(D1, "yyyy-mm-dd")
                OtherAnalyEnd.Text = Format(D2, "yyyy-mm-dd")
            End If
        End If
    End If
    mclsFinanceReport.OtherAnalyCond = cmbOtherAnaly.Text
    mclsFinanceReport.OtherAnalyBegin = OtherAnalyBegin.Text
    mclsFinanceReport.OtherAnalyEnd = OtherAnalyEnd.Text
    mblnIsPeriodChanged = True
    mblnCondIsChanged = True
    CreatNewCond
'    mblnResponseChange = True
    Exit Sub
ErrHandler:
    cmbOtherAnaly.Text = mclsFinanceReport.OtherAnalyCond
End Sub
Private Sub cmbOtherRefer_Choose()
    Dim D1 As Date
    Dim D2 As Date
    On Error GoTo ErrHandler
    If Not mblnFormIsLoad Then
        Exit Sub
    End If
    If mblnFirstChange = True Or mblnReportReset = True Or (cmbOtherRefer.Text = mclsFinanceReport.OtherReferCond And cmbOtherRefer.Text <> "自定义") Then
        Exit Sub
    End If
    If Format(OtherReferBegin.Text, "yyyy-mm-dd") = Format(mclsFinanceReport.OtherReferBegin, "yyyy-mm-dd") And Format(OtherReferEnd.Text, "yyyy-mm-dd") = Format(mclsFinanceReport.OtherReferEnd, "yyyy-mm-dd") And cmbOtherRefer.Text = "自定义" Then
        Exit Sub
    End If
    If mclsFinanceReport.ViewId <> 321 And mclsFinanceReport.ViewId <> 682 And mclsFinanceReport.IsUseRefer = False Then
        If PeriodIsSame Then
            ShowMsg Me.hWnd, "分析期类型与比较期类型重复!", vbExclamation, App.title
            cmbOtherRefer.ReferRow = mintReferRow4
            Me.Refresh
            Exit Sub
        End If
    End If
    mstrOtherReferDateOP = mclsFinanceReport.ExgPeriodType(cmbOtherRefer.Text)
     If Trim(cmbOtherRefer.Text) = "自定义" Then
        mclsFinanceReport.OtherReferBegin = OtherReferBegin.Text
        mclsFinanceReport.OtherReferEnd = OtherReferEnd.Text
        mblnCondIsChanged = True
        CreatNewCond
        mblnIsPeriodChanged = True
        Exit Sub
    End If
    If Trim(cmbOtherRefer.Text) = "所有" Then
        OtherReferBegin.Text = gclsBase.BeginDate
        OtherReferEnd.Text = gclsBase.EndDate
    Else
        If cmbOtherRefer.Text <> "去年" Then
            gclsBase.GetBeginAndEndDate cmbOtherRefer.Text, gclsBase.BaseDate, D1, D2
            If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                If Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                    cmbOtherRefer.Text = mclsFinanceReport.OtherReferCond
                    Exit Sub
                End If
                If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") And Format(D2, "yyyy-mm-dd") > Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                    D1 = CDate(gclsBase.BeginDate)
                End If
                '修改于1999-7-15
            End If
            If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                    cmbOtherRefer.Text = mclsFinanceReport.OtherReferCond
                    Exit Sub
                End If
                If Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") And Format(D1, "yyyy-mm-dd") <= Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                    D2 = CDate(gclsBase.EndDate)
                End If
            End If
            OtherReferBegin.Text = Format(D1, "yyyy-mm-dd")
            OtherReferEnd.Text = Format(D2, "yyyy-mm-dd")
        ElseIf cmbOtherRefer.Text = "去年" Then
            gclsBase.GetBeginAndEndDate cmbOtherRefer.Text, gclsBase.BaseDate, D1, D2
            If D1 <> #12:00:00 AM# Then
                If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                    If Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                        cmbOtherRefer.Text = mclsFinanceReport.OtherReferCond
                        Exit Sub
                    End If
                    If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") And Format(D2, "yyyy-mm-dd") > Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                        D1 = CDate(gclsBase.BeginDate)
                    End If
                End If
                If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                    If Format(D1, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                        cmbOtherRefer.Text = mclsFinanceReport.OtherReferCond
                        Exit Sub
                    End If
                    If Format(D2, "yyyy-mm-dd") > Format(gclsBase.EndDate, "yyyy-mm-dd") And Format(D1, "yyyy-mm-dd") <= Format(gclsBase.EndDate, "yyyy-mm-dd") Then
                        D2 = CDate(gclsBase.EndDate)
                    End If
                End If
                OtherReferBegin.Text = Format(D1, "yyyy-mm-dd")
                OtherReferEnd.Text = Format(D2, "yyyy-mm-dd")
            End If
        End If
    End If
    mclsFinanceReport.OtherReferCond = cmbOtherRefer.Text
    mclsFinanceReport.OtherReferBegin = OtherReferBegin.Text
    mclsFinanceReport.OtherReferEnd = OtherReferEnd.Text
    mblnIsPeriodChanged = True
    mblnCondIsChanged = True
    CreatNewCond
'    mblnResponseChange = True
    Exit Sub
ErrHandler:
    cmbOtherRefer.Text = mclsFinanceReport.OtherReferCond
End Sub

Private Sub cmbReferDate_Choose()
    Dim D1 As Date
    Dim D2 As Date
    On Error GoTo ErrHandler
    If mblnFirstChange = True Or mblnReportReset = True Or (cmbReferDate.Text = mclsFinanceReport.DateCond1 And cmbReferDate.Text <> "自定义") Then
        Exit Sub
    End If
    If CDate(ReferBeginDate.Text) = CDate(mclsFinanceReport.DateBegin1) And CDate(ReferEndDate.Text) = CDate(mclsFinanceReport.DateEnd1) And cmbReferDate.Text = "自定义" Then
        Exit Sub
    End If
    If mclsFinanceReport.ViewId <> 321 And mclsFinanceReport.ViewId <> 682 And mclsFinanceReport.IsUseRefer = False Then
        If PeriodIsSame Then
            ShowMsg Me.hWnd, "比较期类型与分析期类型重复!", vbExclamation, App.title
            cmbReferDate.ReferRow = mintReferRow2
            Me.Refresh
            Exit Sub
        End If
    End If
    mstrReferDateOP = mclsFinanceReport.ExgPeriodType(cmbReferDate.Text)
    If Trim(cmbReferDate.Text) = "自定义" Then
        mclsFinanceReport.ReferStart = CDate(ReferBeginDate.Text)
        mclsFinanceReport.ReferEnd = CDate(ReferEndDate.Text)
        mblnCondIsChanged = True
        CreatNewCond
        Exit Sub
    End If
    If Trim(cmbReferDate.Text) = "所有" Then
        ReferBeginDate.Value = CDate(gclsBase.BeginDate)
        ReferEndDate.Value = CDate(gclsBase.EndDate)
    Else
        If txtReportPeriod.Text <> "期" Or cmbReferDate.Text <> "去年" Then
            gclsBase.GetBeginAndEndDate cmbReferDate.Text, gclsBase.BaseDate, D1, D2
                If D1 < CDate(gclsBase.BeginDate) Or D2 < CDate(gclsBase.BeginDate) Then
  '                  ShowMsg Me.hwnd, "比较期不能小于帐套启用日期!", vbExclamation, app.title
                    If D2 < CDate(gclsBase.BeginDate) Then
                        cmbReferDate.Text = mclsFinanceReport.DateCond1
                        Exit Sub
                    End If
                    If D1 < CDate(gclsBase.BeginDate) And D2 > CDate(gclsBase.BeginDate) Then
                        D1 = CDate(gclsBase.BeginDate)
                    End If
                End If
            ReferBeginDate.Value = D1
            ReferEndDate.Value = D2
        ElseIf txtReportPeriod.Text = "期" And cmbReferDate.Text = "去年" Then
            gclsBase.DateOfFanYear gclsBase.BeginYear - 1, D1, D2
            If D1 <> #12:00:00 AM# Then
                If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Or Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
   '                 ShowMsg Me.hwnd, "比较期不能小于帐套启用日期!", vbExclamation, app.title
                    If Format(D2, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                        cmbReferDate.Text = mclsFinanceReport.DateCond1
                        Exit Sub
                    End If
                    If Format(D1, "yyyy-mm-dd") < Format(gclsBase.BeginDate, "yyyy-mm-dd") And Format(D2, "yyyy-mm-dd") > Format(gclsBase.BeginDate, "yyyy-mm-dd") Then
                        D1 = CDate(gclsBase.BeginDate)
                    End If
                End If
                ReferBeginDate.Value = D1
                ReferEndDate.Value = D2
            Else
                ShowMsg Me.hWnd, "没有相应的期间!", vbExclamation + vbOKOnly, App.title
                cmbReferDate.Text = mclsFinanceReport.DateCond1
            End If
        End If
    End If
    mclsFinanceReport.ReferPeriod = cmbReferDate.Text
    mclsFinanceReport.ReferStart = CDate(ReferBeginDate.Text)
    mclsFinanceReport.ReferEnd = CDate(ReferEndDate.Text)
    mblnIsPeriodChanged = True
    mblnCondIsChanged = True
    CreatNewCond
    Exit Sub
ErrHandler:
    If mblnCondIsChanged = False Then
        cmbReferDate.Text = mclsFinanceReport.DateCond1
    Else
        cmbReferDate.Text = mclsFinanceReport.ReferPeriod
    End If
End Sub
Private Sub cmdDefine_Click()
    Dim clsFilter As FormCond
    If Report.MyReportExist(mclsFinanceReport.ReportID, mclsFinanceReport.ReportName) = False Then
        mblnIsFatalErr = True
        Exit Sub
    End If
    If m

⌨️ 快捷键说明

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