VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{69F9D01E-F1DE-11D4-9536-002018603DA2}#7.0#0"; "MiControl.ocx"
Begin VB.Form frmfiltro 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Filtrar Información"
   ClientHeight    =   4815
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6030
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   4815
   ScaleWidth      =   6030
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdaceptar 
      Caption         =   "Aceptar"
      Height          =   495
      Left            =   4320
      TabIndex        =   17
      Top             =   3480
      Width           =   1335
   End
   Begin VB.CommandButton cmddesmarT 
      Caption         =   "Desmarcar Todo"
      Height          =   495
      Left            =   2400
      TabIndex        =   16
      Top             =   3480
      Width           =   1455
   End
   Begin VB.CommandButton cmddesmarcar 
      Caption         =   "Desmarcar"
      Height          =   495
      Left            =   1200
      TabIndex        =   15
      Top             =   3480
      Width           =   1215
   End
   Begin VB.CommandButton cmdmarcar 
      Caption         =   "Marcar"
      Height          =   495
      Left            =   120
      TabIndex        =   14
      Top             =   3480
      Width           =   1095
   End
   Begin VB.CheckBox Chk3 
      Caption         =   "and"
      Height          =   255
      Left            =   5160
      TabIndex        =   13
      Top             =   2640
      Width           =   735
   End
   Begin VB.CheckBox ChK2 
      Caption         =   "and"
      Height          =   255
      Left            =   5160
      TabIndex        =   9
      Top             =   1800
      Width           =   615
   End
   Begin VB.CheckBox Chk1 
      Caption         =   "and"
      Height          =   255
      Left            =   5160
      TabIndex        =   5
      Top             =   960
      Width           =   855
   End
   Begin VB.Frame Frame3 
      Caption         =   "Fecha Emisión"
      Height          =   735
      Left            =   120
      TabIndex        =   10
      Top             =   2400
      Width           =   4935
      Begin MSComCtl2.DTPicker DTPEMI1 
         Height          =   345
         Left            =   600
         TabIndex        =   11
         Top             =   240
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   609
         _Version        =   393216
         Format          =   20971521
         CurrentDate     =   37974
      End
      Begin MSComCtl2.DTPicker DTPEMI2 
         Height          =   345
         Left            =   2880
         TabIndex        =   12
         Top             =   240
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   609
         _Version        =   393216
         Format          =   20971521
         CurrentDate     =   37974
      End
      Begin VB.Label Label7 
         Caption         =   "Al"
         Height          =   255
         Left            =   2400
         TabIndex        =   23
         Top             =   360
         Width           =   495
      End
      Begin VB.Label Label5 
         Caption         =   "Del"
         Height          =   255
         Left            =   120
         TabIndex        =   21
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "Fecha Vencimiento"
      Height          =   735
      Left            =   120
      TabIndex        =   6
      Top             =   1560
      Width           =   4935
      Begin MSComCtl2.DTPicker DTPVEN2 
         Height          =   345
         Left            =   2880
         TabIndex        =   8
         Top             =   240
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   609
         _Version        =   393216
         Format          =   20971521
         CurrentDate     =   37974
      End
      Begin MSComCtl2.DTPicker DTPVEN1 
         Height          =   345
         Left            =   600
         TabIndex        =   7
         Top             =   240
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   609
         _Version        =   393216
         Format          =   20971521
         CurrentDate     =   37974
      End
      Begin VB.Label Label6 
         Caption         =   "Al"
         Height          =   255
         Left            =   2400
         TabIndex        =   22
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label4 
         Caption         =   "Del"
         Height          =   255
         Left            =   120
         TabIndex        =   20
         Top             =   240
         Width           =   615
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Número de Documento"
      Height          =   735
      Left            =   120
      TabIndex        =   2
      Top             =   720
      Width           =   4935
      Begin MiControl.CtrlNumber ctrlnumberal 
         Height          =   375
         Left            =   2880
         TabIndex        =   4
         Top             =   240
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   661
         BackColor       =   -2147483643
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin MiControl.CtrlNumber ctrlnumberdel 
         Height          =   375
         Left            =   600
         TabIndex        =   3
         Top             =   240
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   661
         BackColor       =   -2147483643
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Label Label3 
         Caption         =   "Al"
         Height          =   255
         Left            =   2520
         TabIndex        =   19
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label2 
         Caption         =   "Del"
         Height          =   255
         Left            =   120
         TabIndex        =   18
         Top             =   240
         Width           =   615
      End
   End
   Begin MSDataListLib.DataCombo dtctipodocumento 
      Height          =   315
      Left            =   1440
      TabIndex        =   1
      Top             =   240
      Width           =   3255
      _ExtentX        =   5741
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   5880
      Y1              =   4080
      Y2              =   4080
   End
   Begin VB.Label lbltotalfilt 
      Alignment       =   1  'Right Justify
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      TabIndex        =   25
      Top             =   4200
      Width           =   1575
   End
   Begin VB.Label Label8 
      Caption         =   "Total"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3600
      TabIndex        =   24
      Top             =   4320
      Width           =   615
   End
   Begin VB.Label Label1 
      Caption         =   "Tipo Documento"
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   1455
   End
End
Attribute VB_Name = "frmfiltro"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public GlngCorrelativo As Long
Dim MobjListarDocu As DB_MA_MANTENIMIENTOS.C_DOCUMENTO
Dim MUtil As DB_UT_MANTENIMIENTOS.C_PROCESOS

Private Sub cmdaceptar_Click()
  Unload Me
End Sub

Private Sub cmddesmarcar_Click()

  Dim Lstrcadena As String
  
  Lstrcadena = " UPDATE TMP_AR_COBRANZAS SET PAGOPEN=0 " & _
               " WHERE CORRNBR=" & GlngCorrelativo & " AND DOCTYPEID='" & dtctipodocumento.BoundText & "' "
  
  
  If Chk1.Value = 1 Then
     Lstrcadena = Lstrcadena & " AND " & " (NBRDOCUMENT >=" & ctrlnumberdel.Text & " AND NBRDOCUMENT <=" & ctrlnumberal.Text & ") "
  End If
   
  If ChK2.Value = 1 Then
     Lstrcadena = Lstrcadena & " AND " & " (DUEDATE BETWEEN '" & DTPVEN1.Value & "' AND '" & DTPVEN2.Value & "') "
  End If
  
  If Chk3.Value = 1 Then
     Lstrcadena = Lstrcadena & " AND " & " (DATEPROCESALES BETWEEN '" & DTPEMI1.Value & "' AND '" & DTPEMI2.Value & "') "
  End If
  
  MUtil.Auxiliar1 Lstrcadena
  
  FCobranzas.ActualizaGrilla (GlngCorrelativo)

End Sub

Private Sub cmddesmarT_Click()
  
  Dim Lstrcadena As String
  
  Lstrcadena = " UPDATE TMP_AR_COBRANZAS SET PAGOPEN=0 " & _
               " WHERE CORRNBR=" & GlngCorrelativo
   
  MUtil.Auxiliar1 Lstrcadena
  
  FCobranzas.ActualizaGrilla (GlngCorrelativo)


End Sub

Private Sub cmdmarcar_Click()
  
  Dim Lstrcadena As String
  
  Lstrcadena = " UPDATE TMP_AR_COBRANZAS SET PAGOPEN=TOTALPEN " & _
               " WHERE CORRNBR=" & GlngCorrelativo & " AND DOCTYPEID='" & dtctipodocumento.BoundText & "' "
  
  
  If Chk1.Value = 1 Then
     Lstrcadena = Lstrcadena & " AND " & " (NBRDOCUMENT >=" & ctrlnumberdel.Text & " AND NBRDOCUMENT <=" & ctrlnumberal.Text & ") "
  End If
   
  If ChK2.Value = 1 Then
     Lstrcadena = Lstrcadena & " AND " & " (DUEDATE BETWEEN '" & DTPVEN1.Value & "' AND '" & DTPVEN2.Value & "') "
  End If
  
  If Chk3.Value = 1 Then
     Lstrcadena = Lstrcadena & " AND " & " (DATEPROCESALES BETWEEN '" & DTPEMI1.Value & "' AND '" & DTPEMI2.Value & "') "
  End If
  
  MUtil.Auxiliar1 Lstrcadena
  
  FCobranzas.ActualizaGrilla (GlngCorrelativo)
    
End Sub

Private Sub Form_Load()
  
  Set MUtil = New DB_UT_MANTENIMIENTOS.C_PROCESOS
  Set MobjListarDocu = New DB_MA_MANTENIMIENTOS.C_DOCUMENTO
  Call CargaDataCombo(dtctipodocumento, MobjListarDocu.ListarDocumentos, "DOCTYPEID", "DESCR")

  ctrlnumberdel.Enteros = 10
  ctrlnumberal.Enteros = 10
   
  Me.Left = (Screen.Width - Me.Width) / 2

End Sub

Private Sub Form_Unload(Cancel As Integer)

  Set MobjListarDocu = Nothing
  Set MUtil = Nothing
  
End Sub
