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 = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx"
Begin VB.Form Fimpcustomer 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Impresión de Clientes"
   ClientHeight    =   3330
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6885
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3330
   ScaleWidth      =   6885
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      Height          =   3255
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6855
      Begin VB.CheckBox Chktermino 
         Caption         =   "Todos los Términos"
         Height          =   255
         Left            =   3240
         TabIndex        =   13
         Top             =   2280
         Width           =   1815
      End
      Begin Crystal.CrystalReport crlistarclientes 
         Left            =   6120
         Top             =   840
         _ExtentX        =   741
         _ExtentY        =   741
         _Version        =   348160
         PrintFileLinesPerPage=   60
      End
      Begin MSDataListLib.DataCombo Dtcestadocliente 
         Height          =   315
         Left            =   120
         TabIndex        =   12
         Top             =   1440
         Width           =   2535
         _ExtentX        =   4471
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.CommandButton cmdCancelar 
         Caption         =   "&Cancelar"
         Height          =   735
         Left            =   5160
         Picture         =   "Fimpcustomer.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   8
         Top             =   2190
         Width           =   1425
      End
      Begin VB.CommandButton cmdAceptar 
         Caption         =   "&Aceptar"
         Height          =   735
         Left            =   5160
         Picture         =   "Fimpcustomer.frx":030A
         Style           =   1  'Graphical
         TabIndex        =   7
         Top             =   1410
         Width           =   1425
      End
      Begin VB.CheckBox chktodos 
         Caption         =   "Todos los Tipos"
         Height          =   375
         Left            =   3240
         TabIndex        =   5
         Top             =   600
         Width           =   1455
      End
      Begin VB.CheckBox chkTdEstados 
         Caption         =   "Todos los estados"
         Height          =   255
         Left            =   3240
         TabIndex        =   4
         Top             =   1440
         Width           =   1815
      End
      Begin VB.ComboBox cmdsimbolo 
         Height          =   315
         ItemData        =   "Fimpcustomer.frx":0614
         Left            =   120
         List            =   "Fimpcustomer.frx":0627
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   2280
         Width           =   975
      End
      Begin VB.TextBox txttermino 
         Alignment       =   1  'Right Justify
         Height          =   375
         Left            =   1320
         TabIndex        =   2
         Text            =   "0"
         Top             =   2280
         Width           =   615
      End
      Begin MSComCtl2.UpDown UpDown1 
         Height          =   375
         Left            =   1920
         TabIndex        =   1
         Top             =   2280
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   661
         _Version        =   393216
         BuddyControl    =   "txttermino"
         BuddyDispid     =   196616
         OrigLeft        =   2160
         OrigTop         =   2400
         OrigRight       =   2400
         OrigBottom      =   2895
         Max             =   100
         SyncBuddy       =   -1  'True
         BuddyProperty   =   65547
         Enabled         =   -1  'True
      End
      Begin MSDataListLib.DataCombo DtcTipoCli 
         Height          =   315
         Left            =   120
         TabIndex        =   6
         Top             =   600
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.Image Image1 
         Height          =   720
         Left            =   5520
         Picture         =   "Fimpcustomer.frx":063C
         Stretch         =   -1  'True
         Top             =   480
         Width           =   600
      End
      Begin VB.Label Label1 
         Caption         =   "Tipo de Cliente"
         Height          =   255
         Left            =   120
         TabIndex        =   11
         Top             =   240
         Width           =   1695
      End
      Begin VB.Label Label2 
         Caption         =   "Estado del Cliente"
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   1080
         Width           =   1695
      End
      Begin VB.Label Label3 
         Caption         =   "Término"
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   1920
         Width           =   1455
      End
   End
End
Attribute VB_Name = "Fimpcustomer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objTipocliente As DB_OP_MANTENIMIENTOS.C_TIPO_CLIENTE
Dim objEstadoCliente As DB_MA_MANTENIMIENTOS.C_ESTADO_CLIENTE

Public Sub CargaDataCombo(objDataCombo As DataCombo, rsSource As ADODB.Recordset, istrCampo1 As String, istrCampo2 As String)
    If rsSource.RecordCount <> 0 Then
        Set objDataCombo.DataSource = rsSource
        objDataCombo.DataField = istrCampo2
        Set objDataCombo.RowSource = rsSource
        objDataCombo.ListField = istrCampo2
        objDataCombo.BoundColumn = istrCampo1
        objDataCombo.BoundText = rsSource.Fields(istrCampo2)
        
    End If
End Sub

Private Sub cmdAceptar_Click()
  
  Dim LintTipoCliente As Integer
  Dim LintEstadosCliente As Integer
  Dim LintTermino As Integer
  
  If chktodos.Value = 1 Then
    LintTipoCliente = 1
  Else
    LintTipoCliente = 0
  End If
  
  If chkTdEstados.Value = 1 Then
    LintEstadosCliente = 1
  Else
    LintEstadosCliente = 0
  End If
  
  If Chktermino.Value = 1 Then
    LintTermino = 1
  Else
    LintTermino = 0
  End If
    
  crlistarclientes.ReportFileName = GstrReportesVta + "rpt_ListarClientes.rpt"
  crlistarclientes.Formulas(1) = "formusuario=stringvar strusuario; strusuario:='" & GCUSERID & "'"
  
  crlistarclientes.StoredProcParam(0) = LintTipoCliente
  crlistarclientes.StoredProcParam(1) = DtcTipoCli.BoundText
  crlistarclientes.StoredProcParam(2) = LintEstadosCliente
  crlistarclientes.StoredProcParam(3) = Dtcestadocliente.BoundText
  crlistarclientes.StoredProcParam(4) = LintTermino
  crlistarclientes.StoredProcParam(5) = txttermino.Text
  crlistarclientes.StoredProcParam(6) = cmdsimbolo.Text
  
  crlistarclientes.WindowTitle = "Listado de Clientes"
   
  crlistarclientes.WindowShowPrintSetupBtn = True
  crlistarclientes.WindowState = crptMaximized
  crlistarclientes.WindowShowSearchBtn = True

  crlistarclientes.Action = 1
    
End Sub

Private Sub cmdCancelar_Click()
   Unload Me
End Sub

Private Sub Form_Load()
    
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2

    
    Set objTipocliente = New DB_OP_MANTENIMIENTOS.C_TIPO_CLIENTE
    Set objEstadoCliente = New DB_MA_MANTENIMIENTOS.C_ESTADO_CLIENTE
    
    Call CargaDataCombo(DtcTipoCli, objTipocliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "Descr")
    Call CargaDataCombo(Dtcestadocliente, objEstadoCliente.ListarEstados_Cliente, "CUSTSTATUSID", "DESCRCUST")
    
    Dtcestadocliente.BoundText = "A"
    DtcTipoCli.BoundText = "03"
    
    cmdsimbolo.ListIndex = 1
    Chktermino.Value = 1
    
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
  
   Set objTipocliente = Nothing
  
End Sub

Private Sub txttermino_KeyPress(KeyAscii As Integer)
    If KeyAscii < Asc("0") Then
      If KeyAscii <> 8 Then
         KeyAscii = 0
      End If
    End If
    
    If KeyAscii > Asc("9") Then
       KeyAscii = 0
    End If
    
End Sub



