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

📄 frmcountfilter.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 2 页
字号:
                    strSqlTemplate = "17"
                Case 347
                    strSqlTemplate = "18"
                Case 348
                    strSqlTemplate = "19"
                Case 349, 1245
                    strSqlTemplate = "20"
                Case 350
                    strSqlTemplate = "21"
                Case 351
                    strSqlTemplate = "22"
                Case 352
                    strSqlTemplate = "23"
                Case 353
                    strSqlTemplate = "24"
                Case 312, 313, 314, 315, 316, 317, 318, 319, 320
                    If Trim(mstrReceiptTypeID) <> "" Then
                        strSqlTemplate = mstrReceiptTypeID
                    Else
                        strSqlTemplate = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,47,52"
                    End If
                Case Else
                    If mlngReceiptTypeID <> 0 Then
                        strSqlTemplate = mlngReceiptTypeID
                    Else
                        strSqlTemplate = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,47,52"
                    End If
                End Select
           strSql = "select distinct strTemplateName as b2  from Template where bytVersion in" & strCondVersion & " and lngReceiptTypeID in (" & strSqlTemplate & ")"
           If mlngViewID = 349 Or mlngViewID = 1245 Then
                strSql = "select distinct strTemplateName as b2  from Template where bytVersion in" & strCondVersion & " and lngReceiptTypeID=20 and blnIsSaleDataBook=0 "
           End If
        Case "代发银行", "银行名称"
            strSql = "select distinct strBankName as b2 FROM Bank"
        Case "工程状态"
            strSql = "select distinct strJobStatusName as b2 from JobStatus"
        Case "职务"
            strSql = "select distinct strTitleName as b2 from Title where not ltrim(rtrim(strTitleName)) IS NULL  order by strTitleName"
        Case "工资表"
            strSql = "select distinct strSalaryListName as b2 from SalaryList"
        Case "操作员组名称"
            strSql = "select distinct strOperatorGroupName as b2 from OperatorGroup where not ltrim(rtrim(strOperatorGroupName)) IS NULL  order by strOperatorGroupName"
        Case "操作员", "制单", "制单人", "复核", "记帐", "执行", "执行者", "建表人", "建卡人", "撰写人", "提醒对象"
            strSql = "select distinct strOperatorName as b2 from Operator where not ltrim(rtrim(strOperatorName)) IS NULL  order by strOperatorName"
        Case "规格型号"
            strSql = "select distinct strItemStyle as b2  from Item where not ltrim(rtrim(strItemStyle)) IS NULL  order by strItemStyle"
        Case "计量规格", "计量单位", "最小计量单位", "存货计量单位", "基本计量单位", "常用计量单位"
            strSql = "select distinct strUnitname as b2 from ItemUnit where not ltrim(rtrim(strUnitname)) IS NULL  order by strUnitname"
        Case "商品性质"
            strSql = "select distinct strItemNatureName as b2  from ItemNature where not ltrim(rtrim(strItemNatureName)) IS NULL  order by strItemNatureName"
        Case "征收个人所得税标准"
            strSql = "select distinct PersonTaxType.strPersonTaxTypeName  as b2 from PersonTaxType"
        Case "税率"
            strSql = "select distinct Tax.strTaxname || ' ' || Tax.dblPurchaseTaxRate || '%' || ' ' || Tax.dblSaleTaxRate || '%' as b2 from Tax"
        Case "凭单类型", "核销单据类型"
            strSql = "select distinct strActivityTypeName as b2   from ActivityType where not ltrim(rtrim(strActivityTypeName)) IS NULL  and bytVersion in " & strCondVersion & _
                            " union select distinct strVoucherTypeName as b2 from VoucherType where not ltrim(rtrim(strVoucherTypeName)) IS NULL  "
        Case "科目类型", "科目类别"
            strSql = "select distinct strAccountTypeName as b2  from AccountType where not ltrim(rtrim(strAccountTypeName)) IS NULL  order by strAccountTypeName"
        Case "固定资产名称", "固资名称", "固定资产"
            strSql = "select distinct strFixedName as b2  from FixedCard where  not ltrim(strFixedName) IS NULL  order by strFixedName"
        Case "文化程度"
            strSql = "select distinct strEducationName as b2  from Education where not ltrim(rtrim(strEducationName)) IS NULL  order by strEducationName"
        Case "单据类型6", "类型6", "业务类型6", "单据类型", "类型", "业务类型"
            Select Case mlngViewID
                Case 312, 313, 314, 315, 316, 317, 318, 319, 320, 1245
                    If Trim(mstrReceiptTypeID) <> "" Then
                        strSql = "select strReceiptTypeName as b2 from ReceiptType where not ltrim(rtrim(strReceiptTypeName)) IS NULL  and lngReceiptTypeID in (" & mstrReceiptTypeID & ")  and  bytVersion in " & strCondVersion & " order by strReceiptTypeName"
                    Else
                        strSql = "select strReceiptTypeName as b2 from ReceiptType where not ltrim(rtrim(strReceiptTypeName)) IS NULL  and bytVersion in " & strCondVersion & " order by strReceiptTypeName"
                    End If
                Case 37
                    If gclsBase.BaseNoControl Then
                        strSql = "select strReceiptTypeName as b2 from ReceiptType where bytVersion in " & strCondVersion & " And lngReceiptTypeID>40 "
                    Else
                        strSql = "select strReceiptTypeName as b2 from ReceiptType where bytVersion in " & strCondVersion
                    End If
                Case Else
                    strSql = "select strReceiptTypeName as b2 from ReceiptType where not ltrim(rtrim(strReceiptTypeName)) IS NULL  and bytVersion in " & strCondVersion & " order by strReceiptTypeName"
                End Select
'        Case "单据类型", "类型", "业务类型"
'            strSql = "select distinct strActivityTypeName as b2 from ActivityType where trim(strActivityTypeName) IS NULL  and bytVersion in " & strCondVersion & " order by strActivityTypeName"
        Case Else
            strSql = "select  strEnumNumber as b2 from EnumTable WHERE " & "LTrim( Rtrim(Enumtable.strViewFieldDesc ))='" & strTableName & "'" & strCondVersionEnum & " order by strEnumNumber"
    End Select
    Set rs = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
    If rs.RowCount > 0 Then
        rs.MoveFirst
        Do While Not rs.EOF
            Flag = False
            Index = lstSelected.ListCount
            Do While Index > 0
                lstSelected.ListIndex = Index - 1
                If rs!b2 = lstSelected.Text Then
                    Flag = True
                    Exit Do
                End If
                Index = Index - 1
            Loop
            If Flag = False Then lstAll.AddItem rs!b2, lstAll.ListCount
            rs.MoveNext
        Loop
    End If
 End If
    
    '1999-11-09
    #If conVersionType = 1 Then
        Select Case mlngViewID
            Case 37
'                ReferText1.AddRefer "采购付款", 2
'                ReferText1.AddRefer "销售收款", 2
                
                Flag = False
                Index = lstSelected.ListCount
                Do While Index > 0
                    lstSelected.ListIndex = Index - 1
                    If "采购付款" = lstSelected.Text Then
                        Flag = True
                        Exit Do
                    End If
                    Index = Index - 1
                Loop
                If Flag = False Then lstAll.AddItem "采购付款", lstAll.ListCount
        
                Flag = False
                Index = lstSelected.ListCount
                Do While Index > 0
                    lstSelected.ListIndex = Index - 1
                    If "销售收款" = lstSelected.Text Then
                        Flag = True
                        Exit Do
                    End If
                    Index = Index - 1
                Loop
                If Flag = False Then lstAll.AddItem "销售收款", lstAll.ListCount
        
        End Select
    #End If

    
 If lstAll.ListCount > 0 Then lstAll.ListIndex = 0
 If lstSelected.ListCount > 0 Then lstSelected.ListIndex = 0
 RefreshButton
 mTagShow = True
 Exit Sub
EndAllHandle:
    If blnIsEnum = False Then
      MsgBox "找不到表<<" & strTableName & ">>,请确信其是否存在.", vbOKOnly, Me.Caption
    End If
    mblnOk = False
    mTagShow = False
    Unload Me
End Sub
'**********
Private Sub CmdCancel_Click()
    strOK = ""
    strCodeTerm = ""
    mblnOk = False
    Unload Me
End Sub

Private Sub cmdOK_Click()
  Dim intCount As Integer
  Dim rs As rdoResultset
  Dim strCode As String
  If lstSelected.ListCount < 1 Then
    strOK = ""
  Else
    strOK = GetStrCode
  End If
  mblnOk = True
  Unload Me
End Sub
Private Function GetStrCode() As String
 Dim LstCount As Long
 Dim Index As Long
 Dim strCode As String
 Dim strTempCode As String
 Dim strTemp As String
 On Error Resume Next
 strCode = ""
 strTempCode = ""
 LstCount = lstSelected.ListCount
 For Index = 0 To LstCount - 1
'    lstSelected.ListIndex = Index - 1
    If blnIsEnum = False Then
        If Len(Trim(lstSelected.list(Index))) > 10 Then
        strCode = strCode & "," & Trim(Right(lstSelected.list(Index), Len(lstSelected.list(Index)) - InStr(lstSelected.list(Index), "`")))
        strTemp = Trim(Left(lstSelected.list(Index), InStr(lstSelected.list(Index), " ") - 1))
        strTempCode = strTempCode & " " & strTemp 'Right(lstSelected.Text, Len(lstSelected.Text) - InStr(lstSelected.Text, "--") - 1)
    End If
    Else
      strTempCode = strTempCode & "," & lstSelected.list(Index)
      strCode = strCode & ",'" & lstSelected.list(Index) & "'"
    End If
 Next
 strCode = Trim(strCode)
 strCode = Right(strCode, Len(strCode) - 1)
 strTempCode = Trim(strTempCode)
 If blnIsEnum = False Then
    GetStrCode = strCode
    strCodeTerm = Trim(strTempCode)
 Else
    strTempCode = Right(strTempCode, Len(strTempCode) - 1)
    GetStrCode = strTempCode
    strCodeTerm = strCode
 End If
End Function
Private Sub cmdLeftAll_Click()
    Dim i As Integer
    Dim Count As Integer
    With lstSelected
        Count = .ListCount
        For i = 0 To Count - 1
            lstAll.AddItem .list(0)
            .RemoveItem 0
        Next
        If Count <> 0 Then lstAll.ListIndex = 0
    End With
    RefreshButton
End Sub

Private Sub cmdLeftOne_Click()
    Dim Index As Integer
    Dim IndexNow As Integer
    With lstSelected
      Index = .ListIndex
      If Index <> -1 Then
        IndexNow = 0
        Do While IndexNow < lstAll.ListCount
           If .Text < lstAll.list(IndexNow) Then
             Exit Do
           End If
           IndexNow = IndexNow + 1
        Loop
        lstAll.AddItem .Text, IndexNow
        lstAll.Text = .Text
        .RemoveItem Index
        If .ListCount > 0 Then
            .ListIndex = IIf(Index < .ListCount, Index, .ListCount - 1)
        End If
      End If
    End With
    RefreshButton
End Sub

Private Sub cmdRightAll_Click()
    Dim i As Integer
    Dim Count As Integer
    With lstAll
        Count = .ListCount
        For i = 0 To Count - 1
            If lstSelected.ListCount > 250 Then
                MsgBox "已选条件项目个数已经很多,不能再增加了!", vbOKOnly, Me.Caption
                Exit Sub
            End If
            lstSelected.AddItem .list(0)
            .RemoveItem 0
        Next
        lstSelected.ListIndex = 0
    End With
    RefreshButton
End Sub

Private Sub cmdRightOne_Click()
    Dim Index As Integer
    Dim IndexNow As Integer
    With lstAll
      Index = .ListIndex
      If Index <> -1 Then
        IndexNow = 0
        Do While IndexNow < lstSelected.ListCount
           If .Text < lstSelected.list(IndexNow) Then
             Exit Do
           End If
           IndexNow = IndexNow + 1
        Loop
        If lstSelected.ListCount > 250 Then
            MsgBox "已选条件项目个数已经很多,不能再增加了!", vbOKOnly, Me.Caption
            Exit Sub
        End If
        lstSelected.AddItem .Text, IndexNow
        lstSelected.Text = .Text
         .RemoveItem Index
        If .ListCount > 0 Then
            .ListIndex = IIf(Index < .ListCount, Index, .ListCount - 1)
        End If
      End If
    End With
    RefreshButton
End Sub


Private Sub Form_Load()
    On Error GoTo EndHandle
    Utility.LoadFormResPicture Me
   #If conVersionType = 1 Then
        strCondVersionEnum = " And (EnumTable.bytVersion IN (1,3,7,5,9,11,13,15,17,19,21,23,25,27,29,31))"
        strCondVersion = "(1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31)"
   #Else
      #If conVersionType = 2 Then
      #Else
        #If conVersionType = 4 Then
            strCondVersionEnum = " And (EnumTable.bytVersion IN (4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31))"
            strCondVersion = "(4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31)"
        #ElseIf conVersionType = 8 Then
            strCondVersionEnum = " And (EnumTable.bytVersion IN (8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31))"
            strCondVersion = "(8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31)"
        #Else
            strCondVersionEnum = " And (EnumTable.bytVersion IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31))"
            strCondVersion = "(16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)"
        #End If
      #End If
   #End If
   Me.Left = 1000
   Me.top = 1000
   Exit Sub
EndHandle:
   Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
     Utility.UnLoadFormResPicture Me
End Sub

Private Sub lstAll_DblClick()
    cmdRightOne_Click
    RefreshButton
End Sub

Private Sub lstSelected_DblClick()
    cmdLeftOne_Click
    RefreshButton
End Sub

Private Sub RefreshUpDown()
End Sub

Private Sub RefreshButton()
   If lstAll.ListCount = 0 Then
      cmdRightAll.Enabled = False
   Else
      cmdRightAll.Enabled = True
   End If
   If lstAll.ListIndex = -1 Then
      cmdRightOne.Enabled = False
   Else
      cmdRightOne.Enabled = True
   End If

   If lstSelected.ListCount = 0 Then
      cmdLeftAll.Enabled = False
   Else
      cmdLeftAll.Enabled = True
   End If
   If lstSelected.ListIndex = -1 Then
      cmdLeftOne.Enabled = False
   Else
      cmdLeftOne.Enabled = True
   End If
End Sub

Public Function AccountFilter(strTable As String, strKeyCode As String, Optional blnEnum As Boolean = False, Optional ByVal lngViewId As Long = 0, Optional ByVal lngReceiptTypeID As Long = 0, Optional strReceiptTypeID As String = "", Optional lngEmployeeTag As Long = -1) As String
 AccountFilter = ""
 strCodeInput = strKeyCode
 strTableName = Trim(strTable)
 blnIsEnum = blnEnum
 mlngViewID = lngViewId
 mlngReceiptTypeID = lngReceiptTypeID
 mstrReceiptTypeID = strReceiptTypeID
 mEmployeeTag = lngEmployeeTag
 InitLst
End Function

⌨️ 快捷键说明

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