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

📄 凭证批处理条件.frm

📁 用友软件部分代码
💻 FRM
字号:
VERSION 5.00
Object = "{A0C292A3-118E-11D2-AFDF-000021730160}#1.0#0"; "UFEDIT.OCX"
Begin VB.Form frmVouchsTj 
   BackColor       =   &H80000000&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "凭证批处理选择"
   ClientHeight    =   1725
   ClientLeft      =   1470
   ClientTop       =   1590
   ClientWidth     =   4500
   HelpContextID   =   88000054
   Icon            =   "凭证批处理条件.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1725
   ScaleWidth      =   4500
   Begin VB.CommandButton Command2 
      Height          =   375
      Index           =   1
      Left            =   2760
      Style           =   1  'Graphical
      TabIndex        =   15
      Top             =   1200
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Height          =   375
      Index           =   0
      Left            =   720
      Style           =   1  'Graphical
      TabIndex        =   14
      Top             =   1200
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H8000000E&
      Height          =   15
      Left            =   1560
      ScaleHeight     =   15
      ScaleWidth      =   15
      TabIndex        =   4
      Top             =   1095
      Visible         =   0   'False
      Width           =   15
      Begin VB.CheckBox Check1 
         BackColor       =   &H8000000E&
         Caption         =   "银行存款"
         Height          =   315
         Index           =   0
         Left            =   210
         TabIndex        =   9
         Top             =   60
         Value           =   1  'Checked
         Width           =   1065
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H8000000E&
         Caption         =   "银行取款"
         Height          =   315
         Index           =   1
         Left            =   210
         TabIndex        =   8
         Top             =   420
         Value           =   1  'Checked
         Width           =   1065
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H8000000E&
         Caption         =   "内部存款"
         Height          =   315
         Index           =   2
         Left            =   210
         TabIndex        =   7
         Top             =   780
         Value           =   1  'Checked
         Width           =   1065
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H8000000E&
         Caption         =   "内部存款"
         Height          =   315
         Index           =   3
         Left            =   210
         TabIndex        =   6
         Top             =   1140
         Value           =   1  'Checked
         Width           =   1065
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H8000000E&
         Caption         =   "银行贷款"
         Height          =   315
         Index           =   4
         Left            =   210
         TabIndex        =   5
         Top             =   1500
         Value           =   1  'Checked
         Width           =   1065
      End
   End
   Begin VB.CommandButton Command1 
      Height          =   252
      Index           =   0
      Left            =   2250
      Style           =   1  'Graphical
      TabIndex        =   3
      TabStop         =   0   'False
      Top             =   735
      Width           =   285
   End
   Begin VB.CommandButton Command1 
      Height          =   252
      Index           =   1
      Left            =   3930
      Style           =   1  'Graphical
      TabIndex        =   2
      TabStop         =   0   'False
      Top             =   735
      Width           =   285
   End
   Begin VB.Frame Frame1 
      Height          =   15
      Left            =   180
      TabIndex        =   1
      Top             =   360
      Visible         =   0   'False
      Width           =   15
   End
   Begin EDITLib.Edit Edit1 
      Height          =   270
      Left            =   1170
      TabIndex        =   10
      Top             =   720
      Width           =   1035
      _Version        =   65536
      _ExtentX        =   1826
      _ExtentY        =   476
      _StockProps     =   253
      ForeColor       =   0
      BackColor       =   16777215
      Appearance      =   1
      Property        =   5
      MaxLength       =   10
   End
   Begin EDITLib.Edit Edit2 
      Height          =   270
      Left            =   2850
      TabIndex        =   11
      Top             =   720
      Width           =   1035
      _Version        =   65536
      _ExtentX        =   1826
      _ExtentY        =   476
      _StockProps     =   253
      ForeColor       =   0
      BackColor       =   16777215
      Appearance      =   1
      Property        =   5
      MaxLength       =   10
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "业务日期"
      Height          =   180
      Left            =   360
      TabIndex        =   13
      Top             =   765
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "--"
      Height          =   180
      Left            =   2520
      TabIndex        =   12
      Top             =   765
      Width           =   180
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "请选择进行凭证批处理单据的业务日期:"
      DragMode        =   1  'Automatic
      Height          =   180
      Left            =   690
      TabIndex        =   0
      Top             =   270
      Width           =   3150
   End
End
Attribute VB_Name = "frmVouchsTj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'软件著作权: 北京用友软件集团有限公司
'系统名称: 资金管理8.5
'功能说明:凭证批处理条件
'作者: 罗涛

Option Explicit

Private sqlVouchs As String
Private sqlwhere  As String
Private Quitfs    As Boolean
Private showFieldsCount As Integer
Public cond_or_fld As Integer

Private Sub Command1_Click(Index As Integer)
   Select Case Index
      Case 0: DisplayCalendar Edit1, Me.hWnd, Frame1.left, Frame1.top
      Case 1: DisplayCalendar Edit2, Me.hWnd, Frame1.left, Frame1.top
   End Select

End Sub

Private Sub Command2_Click(Index As Integer)
   Dim i As Integer
   Select Case Index
      Case 0
         If VerifyConditions Then
            frmVouchs.sqlwhere = sqlwhere
            frmVouchs.showField = sqlVouchs
            frmVouchs.showFieldsCount = showFieldsCount
            Quitfs = False
            Unload Me
            For i = 0 To Forms.count - 1
                If Forms(i).Name = "frmvouchs" Then
                    frmVouchs.PZCl_Show
                    Exit Sub
                End If
            Next
            frmVouchs.Show
         End If
      Case 1
         Quitfs = True
         Unload Me
         Exit Sub
   End Select
End Sub

'********************************************************************
'*函数说明: 验证输入条件并产生 SQL 语句                                *
'*参    数:                                                          *
'*                                                                   *
'*返回值  : True : 成功                                               *
'*********************************************************************
Private Function VerifyConditions() As Boolean
   Dim sqlVouch As String
   Dim blnUnion As Boolean
   Dim i As Integer
   VerifyConditions = False
   sqlVouchs = ""
   sqlwhere = ""
   If Edit1 <> "" Then
      Edit1 = ForDate(Edit1)
      If Not IsDate(Edit1) Then
         MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
         SetTxtFocus Edit1
         Exit Function
      Else
         Edit1 = FormatDate(Edit1)
         sqlwhere = sqlwhere & "AND bill_date >= '" & FormatDate(Edit1) & "' "
      End If
   Else
      sqlwhere = sqlwhere & "And bill_date >= '" & FormatDate(ZjAccInfo.zjStartdate) & "' "
   End If
   If Edit2 <> "" Then
      Edit2 = ForDate(Edit2)
      If Not IsDate(Edit2) Then
         MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
         SetTxtFocus Edit2
         Exit Function
      Else
         Edit2 = Format(Edit2, "YYYY-MM-DD")
         sqlwhere = sqlwhere & "AND bill_date <= '" & FormatDate(Edit2) & "' "
      End If
   End If
   If Edit1 <> "" And Edit2 <> "" Then
      If CDate(Edit1) > CDate(Edit2) Then
         Beep
         MsgBox "起始日期应小于等于结束日期,请重新输入!", vbInformation, zjGl_Name
         SetTxtFocus Edit1
         Exit Function
      End If
   End If
    
   For i = 0 To 4
     mField(i).fshow = False
   Next
   
   blnUnion = False
   showFieldsCount = 1
   If Check1(0).Value Then
      mField(0).fshow = True
      sqlVouchs = sqlVouchs & " " & vbTab & "Format(![BillDate], 'YYYY-MM-DD')"
      showFieldsCount = showFieldsCount + 1
      blnUnion = True
   End If
   If Check1(1).Value Then
      mField(1).fshow = True
      If blnUnion Then
         sqlVouchs = sqlVouchs & vbTab & "GetClassName(Left(![BillID], 2))"
      Else
         sqlVouchs = sqlVouchs & " " & vbTab & "GetClassName(Left(![BillID], 2))"
         blnUnion = True
      End If
      showFieldsCount = showFieldsCount + 1
   End If
   If Check1(2).Value Then
      mField(2).fshow = True
      If blnUnion Then
         sqlVouchs = sqlVouchs & vbTab & "Right(![BillID], 10)"
      Else
         sqlVouchs = sqlVouchs & " " & vbTab & "Right(![BillID], 10)"
         blnUnion = True
      End If
      showFieldsCount = showFieldsCount + 1
   End If
   If Check1(3).Value Then
      mField(3).fshow = True
      If blnUnion Then
         sqlVouchs = sqlVouchs & vbTab & "Format(![BillMoney], '#0.00')"
      Else
         sqlVouchs = sqlVouchs & " " & vbTab & "Format(![BillMoney], '#0.00')"
         blnUnion = True
      End If
      showFieldsCount = showFieldsCount + 1
   End If
   If Check1(4).Value Then
      mField(4).fshow = True
      If blnUnion Then
         sqlVouchs = sqlVouchs & vbTab & "![BillDigest]"
      Else
         sqlVouchs = sqlVouchs & " " & vbTab & "![BillDigest]"
         blnUnion = True
      End If
      showFieldsCount = showFieldsCount + 1
   End If
   
   VerifyConditions = True
   
End Function

Private Sub Command3_Click(Index As Integer)
   Dim i As Long
   Select Case Index
      Case 0
         For i = 0 To 4
            Check1(i).Value = 1
         Next i
      Case 1
         For i = 0 To 4
            Check1(i).Value = 0
         Next i
   End Select
   
End Sub

Private Sub Edit1_KeyUp(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyF2 Then
      Command1(0).Value = True
      Edit1.SetFocus
   End If
End Sub

Private Sub Edit1_LostFocus()
   If Edit1 <> "" Then
      Edit1 = ForDate(Edit1)
      If IsDate(Edit1) Then
         Edit1 = FormatDate(Edit1)
      Else
         MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
         SetTxtFocus Edit1
      End If
   End If
End Sub

Private Sub Edit2_KeyUp(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyF2 Then
      Command1(1).Value = True
      Edit2.SetFocus
   End If
End Sub

Private Sub Edit2_LostFocus()
   If Edit2 <> "" Then
      Edit2 = ForDate(Edit2)
      If IsDate(Edit2) Then
         Edit2 = FormatDate(Edit2)
      Else
         MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
         SetTxtFocus Edit2
      End If
   End If
End Sub

Private Sub Form_Load()
   Dim i As Integer
   Me.Icon = LoadResPicture(109, vbResIcon)
    On Error Resume Next
    i = UBound(mField)
    If Err.Number <> 0 Then
        initVouchField
        cond_or_fld = 0
    End If
'    If cond_or_fld = 0 Then
'        Picture1.Visible = True
'        Label1.Visible = True
'        Label2.Visible = True
'        Edit1.Visible = True
'        Edit2.Visible = True
'        Command1(0).Visible = True
'        Command1(1).Visible = True
'        Label3.Caption = "请选择进行凭证批处理单据的业务日期及字段列表:"
'    ElseIf cond_or_fld = 1 Then
'        Picture1.Visible = False
'        Label1.Visible = True
'        Label2.Visible = True
'        Edit1.Visible = True
'        Edit2.Visible = True
'        Command1(0).Visible = True
'        Command1(1).Visible = True
        Label3.Caption = "请选择进行凭证批处理单据的业务日期:"
'    ElseIf cond_or_fld = 2 Then
'        Picture1.Visible = True
'        Label1.Visible = False
'        Label2.Visible = False
'        Edit1.Visible = False
'        Edit2.Visible = False
'        Command1(0).Visible = False
'        Command1(1).Visible = False
'        Label3.Caption = "请选择进行凭证批处理单据的字段列表:"
'    End If
    
    For i = 0 To 4
        Check1(i).Caption = mField(i).fcaption
        Check1(i).Value = IIf(mField(i).fshow, 1, 0)
    Next
   loadstatic
   CenterForm Me
End Sub

'********************************************************************
'*函数说明: 加载资源                                                 *
'*参    数:                                                          *
'*                                                                   *
'*返回值  :                                                          *
'*********************************************************************
Private Sub loadstatic()
    Command2(0).Picture = LoadResPicture(103, vbResBitmap)
    Command2(1).Picture = LoadResPicture(104, vbResBitmap)
    Command1(0).Picture = LoadResPicture(1108, vbResBitmap)
    Command1(1).Picture = LoadResPicture(1108, vbResBitmap)
'    Command3(0).Picture = LoadResPicture(122, vbResBitmap)
'    Command3(1).Picture = LoadResPicture(121, vbResBitmap)
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
   Select Case UnloadMode
      Case vbFormControlMenu
         zjLogInfo.TaskExec "FD0502", 0, zjLogInfo.cIYear
         zjLogInfo.ClearError
         zjGen_arr.FD0502 = False
      Case vbFormCode
      
      Case vbAppWindows
      
      Case vbAppTaskManager
      
      Case vbFormMDIForm
      
   End Select
End Sub

Private Sub Form_Unload(Cancel As Integer)
'    If Quitfs Then
'        zjLogInfo.TaskExec "FD0502", 0, zjLogInfo.cIYear
'        zjLogInfo.ClearError
'        zjGen_arr.FD0502 = False
'    End If
End Sub

⌨️ 快捷键说明

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