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"; "ControlNumber.ocx"
Begin VB.Form FTarjetasCredito 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Tarjetas de Crédito (05.090.00)"
   ClientHeight    =   4095
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7890
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   4095
   ScaleWidth      =   7890
   Begin VB.Frame Frame1 
      Caption         =   "Comentario"
      Height          =   1215
      Left            =   240
      TabIndex        =   9
      Top             =   2760
      Width           =   5295
      Begin VB.TextBox txtcomentario 
         Height          =   855
         Left            =   120
         TabIndex        =   10
         Top             =   240
         Width           =   5055
      End
   End
   Begin VB.CommandButton cmdRegistros 
      Caption         =   "Ver Registros >>"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   6000
      Picture         =   "0509000.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   3000
      Width           =   1695
   End
   Begin VB.CheckBox chkEstado 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      Caption         =   "Estado"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   255
      Left            =   6525
      TabIndex        =   19
      Top             =   990
      Width           =   975
   End
   Begin VB.CommandButton cmdBuscar 
      Enabled         =   0   'False
      Height          =   495
      Left            =   4440
      MouseIcon       =   "0509000.frx":030A
      MousePointer    =   99  'Custom
      Picture         =   "0509000.frx":045C
      Style           =   1  'Graphical
      TabIndex        =   0
      ToolTipText     =   "Buscar Registros de Tarjetas"
      Top             =   150
      Width           =   615
   End
   Begin MiControl.CtrlNumber ctnMonto 
      Height          =   375
      Left            =   5640
      TabIndex        =   8
      Top             =   2160
      Width           =   1935
      _ExtentX        =   3413
      _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.CommandButton cmdBusMoneda 
      Height          =   375
      Left            =   3960
      MouseIcon       =   "0509000.frx":098E
      MousePointer    =   99  'Custom
      Picture         =   "0509000.frx":0AE0
      Style           =   1  'Graphical
      TabIndex        =   7
      ToolTipText     =   "Buscar Tipo de Moneda"
      Top             =   2160
      Width           =   375
   End
   Begin MSComCtl2.DTPicker dtpFechaPos 
      Height          =   375
      Left            =   5640
      TabIndex        =   5
      Top             =   1560
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   661
      _Version        =   393216
      Format          =   16777217
      CurrentDate     =   37582
   End
   Begin VB.CommandButton cmdBustarjeta 
      Height          =   375
      Left            =   3960
      MouseIcon       =   "0509000.frx":1012
      MousePointer    =   99  'Custom
      Picture         =   "0509000.frx":1164
      Style           =   1  'Graphical
      TabIndex        =   4
      ToolTipText     =   "Buscar Almacén"
      Top             =   1560
      Width           =   375
   End
   Begin MSDataListLib.DataCombo dtcTarjetas 
      Height          =   315
      Left            =   1200
      TabIndex        =   3
      Top             =   1590
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin VB.CommandButton cmdBusAlmacen 
      Height          =   375
      Left            =   4920
      MouseIcon       =   "0509000.frx":1696
      MousePointer    =   99  'Custom
      Picture         =   "0509000.frx":17E8
      Style           =   1  'Graphical
      TabIndex        =   2
      ToolTipText     =   "Buscar Almacén"
      Top             =   960
      Width           =   375
   End
   Begin MSDataListLib.DataCombo dtcAlmacen 
      Height          =   315
      Left            =   1200
      TabIndex        =   1
      Top             =   960
      Width           =   3615
      _ExtentX        =   6376
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo dtcMoneda 
      Height          =   315
      Left            =   1200
      TabIndex        =   6
      Top             =   2190
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin VB.Label lblestado 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5760
      TabIndex        =   20
      Top             =   120
      Width           =   1935
   End
   Begin VB.Image Image1 
      Height          =   465
      Left            =   5160
      Picture         =   "0509000.frx":1D1A
      Stretch         =   -1  'True
      Top             =   120
      Width           =   465
   End
   Begin VB.Label lblMonto 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Monto"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   255
      Left            =   4920
      TabIndex        =   18
      Top             =   2160
      Width           =   615
   End
   Begin VB.Label lblMoneda 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      Caption         =   "Moneda"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   195
      Left            =   360
      TabIndex        =   17
      Top             =   2160
      Width           =   690
   End
   Begin VB.Label lblFecha 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Fecha "
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   4920
      TabIndex        =   16
      Top             =   1560
      Width           =   615
   End
   Begin VB.Label lblTarjeta 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Tarjeta"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   255
      Left            =   360
      TabIndex        =   15
      Top             =   1560
      Width           =   735
   End
   Begin VB.Shape Shape1 
      BorderColor     =   &H80000002&
      Height          =   495
      Left            =   240
      Shape           =   4  'Rounded Rectangle
      Top             =   120
      Width           =   3975
   End
   Begin VB.Label lblFechaProceso 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1680
      TabIndex        =   14
      Top             =   240
      Width           =   2175
   End
   Begin VB.Label lblFechaProc 
      Caption         =   "Fecha de Proceso"
      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            =   480
      TabIndex        =   13
      Top             =   170
      Width           =   1455
   End
   Begin VB.Label lblAlmacen 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      Caption         =   "Almacen"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   195
      Left            =   360
      TabIndex        =   12
      Top             =   960
      Width           =   735
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H80000004&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H80000006&
      Height          =   1935
      Left            =   240
      Top             =   720
      Width           =   7455
   End
End
Attribute VB_Name = "FTarjetasCredito"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Se retiraron los Fuentes de la red el 24/04/2003
'PROGRAMADOR: EDGAR CANCHO RUIZ

Option Explicit
Public pb_editar As Boolean
Public pb_agregar As Boolean
Public pb_primerregistro As Boolean
Public pb_ultimoregistro As Boolean

Public pbderecho_agregar As Boolean
Public pbderecho_consultar As Boolean
Public pbderecho_editar As Boolean
Public pbderecho_borrar As Boolean
Public pbderecho_imprimir As Boolean
Public pbderecho_anular As Boolean
Public pbderecho_emitir As Boolean
Public pb_tiposcreen As String

Public GrecibeUbicacion As BookmarkEnum
Public GrecibeColumnaID As String
Public GrecibeColumnaOpcional As String

Public rs_Tarjetas As ADODB.Recordset
Public objTarjetasMonto As DB_OP_MANTENIMIENTOS.C_TARJETA_MONTO
Public objAlmacen As DB_INV_MANTENIMIENTOS.C_ALMACEN
Public objMoneda  As DB_MA_MANTENIMIENTOS.C_MONEDA
Public objTarjetas As DB_OP_MANTENIMIENTOS.C_TARJETA
Private MobjVentasGeneral As DB_OP_FACTURACION.C_VENTASGENERAL
'Private objTipoNegocio As DB_UT_MANTENIMIENTOS.C_PUNTODEVENTA


Private Sub CmdBuscar_Click()
    FBuscarTarjetaMonto.Show vbModal
End Sub

Private Sub cmdBusAlmacen_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "Siteid"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "Name"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasVta.GObtenerRegistros objAlmacen.ListarAlmacenesPorStatus(1), ArrayBusqueda, 2, 2
    FBusquedasVta.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcAlmacen.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBusMoneda_Click()
    'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "CuryId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasVta.GObtenerRegistros objMoneda.ListarMonedas, ArrayBusqueda, 2, 2
     FBusquedasVta.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcMoneda.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBustarjeta_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "Cardid"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "Descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasVta.GObtenerRegistros objTarjetas.ListarTarjetaAyuda, ArrayBusqueda, 2, 2
    FBusquedasVta.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcTarjetas.BoundText = GrecibeColumnaID
    End If
End Sub


Private Sub cmdRegistros_Click()
    FVtasTarjetas.strAlmacen = dtcAlmacen.BoundText
    'FVtasTarjetas.strNegocio = Trim(dtcTipoNegocio.BoundText)
    FVtasTarjetas.datFechaProceso = CDate(lblFechaProceso.Caption)
    FVtasTarjetas.Show vbModal
End Sub

Private Sub ctnMonto_GotFocus()
ctnMonto.BackColor = GC_ColorEnfoque
End Sub

Private Sub ctnMonto_LostFocus()
ctnMonto.BackColor = GC_ColorDefecto
End Sub

Private Sub dtcAlmacen_GotFocus()
dtcAlmacen.BackColor = GC_ColorEnfoque
End Sub

Private Sub dtcAlmacen_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    dtcTarjetas.SetFocus
End If
End Sub

Private Sub dtcAlmacen_LostFocus()
dtcAlmacen.BackColor = GC_ColorDefecto
End Sub

Private Sub dtcMoneda_GotFocus()
dtcMoneda.BackColor = GC_ColorEnfoque
End Sub

Private Sub dtcMoneda_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    ctnMonto.SetFocus
End If
End Sub

Private Sub dtcMoneda_LostFocus()
dtcMoneda.BackColor = GC_ColorDefecto
End Sub

Private Sub dtcTarjetas_GotFocus()
dtcTarjetas.BackColor = GC_ColorEnfoque
End Sub

Private Sub dtcTarjetas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    dtpFechaPos.SetFocus
End If
End Sub

Private Sub dtcTarjetas_LostFocus()
dtcTarjetas.BackColor = GC_ColorDefecto
End Sub

Private Sub dtpFechaPos_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    dtcMoneda.SetFocus
End If
End Sub


Private Sub Form_Activate()
    Call gactualizaopcion(pbderecho_agregar, pbderecho_editar, pbderecho_borrar, pbderecho_imprimir)
    Call gactualiza_barra(Me)
    'lineas nuevas
    If pbderecho_consultar = False Then
        Unload Me
    End If
End Sub

Public Sub primer_registro()

End Sub

Public Sub ultimo_registro()

End Sub

Public Sub registro_anterior()

End Sub
Public Sub registro_siguiente()

End Sub

Private Sub Form_Load()
    'seguridad
    Call gseguridad(Me)

    If pbderecho_consultar Then

        Set objAlmacen = New DB_INV_MANTENIMIENTOS.C_ALMACEN
        Set objTarjetas = New DB_OP_MANTENIMIENTOS.C_TARJETA
        Set objMoneda = New DB_MA_MANTENIMIENTOS.C_MONEDA
        Set objTarjetasMonto = New DB_OP_MANTENIMIENTOS.C_TARJETA_MONTO
        Set MobjVentasGeneral = New DB_OP_FACTURACION.C_VENTASGENERAL
        'Set objTipoNegocio = New DB_UT_MANTENIMIENTOS.C_PUNTODEVENTA
        
        Call obtener_datos
        Call CargaDataCombo(dtcAlmacen, objAlmacen.ListarAlmacenesPorStatus(1), "SiteId", "Name")
        Call CargaDataCombo(dtcTarjetas, objTarjetas.ListarTarjetaAyuda, "CardId", "Descr")
        Call CargaDataCombo(dtcMoneda, objMoneda.ListarMonedas, "CuryId", "Descr")
        'Call CargaDataCombo(dtcTipoNegocio, objTipoNegocio.ListarTiposNegocio(1), "BUSINESSTYPE", "DESCRBUSINESS")
        
        Call asigna_campos
        Call gHabilitarReg(Me, False)
        
        cmdBuscar.Enabled = True
        
        pb_primerregistro = True
        dtpFechaPos.Value = GDatFechaProceso
        
    Else

        MsgBox ("No tiene Derechos de Consultar en este formulario"), vbCritical + vbDefaultButton1, "Mensaje"
    End If
    
    
    ctnMonto.Enteros = 8
    ctnMonto.Decimales = GintDecResultado
    ctnMonto.PermitirNegativos = True
    
    lblFechaProceso.Caption = Format(GDatFechaProceso, "DD/MM/YYYY")
    
    Me.Top = 1300
    Me.Left = (Screen.Width - Me.Width) / 2
    
End Sub
Public Sub borrar_registro()

On Error GoTo errhandler

    objTarjetasMonto.EliminarTarjetaMonto dtcAlmacen.BoundText, dtcTarjetas.BoundText, dtpFechaPos.Value, _
                                            GDatFechaProceso
                                            
    Call gborrar_Registro(Me)
    Call actualizar_registro
    Limpiar
    
Exit Sub
errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"
    
    
End Sub
Function valida_datos()
    If GVDATO(dtcAlmacen.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Almacen", vbInformation, "Error"
        dtcAlmacen.SetFocus
        Exit Function
    End If
        
    If GVDATO(dtcTarjetas.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Tarjeta", vbInformation, "Error"
        dtcTarjetas.SetFocus
        Exit Function
    End If
    
    If GVDATO(dtcMoneda.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Moneda", vbInformation, "Error"
        dtcMoneda.SetFocus
        Exit Function
    End If
    
 
    If GVDATO(ctnMonto.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Monto de Tarjeta", vbInformation, "Error"
        ctnMonto.SetFocus
        Exit Function
    End If
    
    valida_datos = True
    
End Function
Public Sub grabar_registro()

On Error GoTo errhandler

    If valida_datos() = True Then
        ' llamada al proc de grabacion
        If pb_agregar Then
            
            If Trim(txtcomentario.Text) = Empty Then txtcomentario.Text = "NINGUNO"
            
            objTarjetasMonto.AgregarTarjetaMonto dtcAlmacen.BoundText, dtcTarjetas.BoundText, dtpFechaPos.Value, _
                                                 GDatFechaProceso, dtcMoneda.BoundText, GFormatodeNumero(CDbl(ctnMonto.Text), _
                                                 GintDecResultado), 0, txtcomentario.Text, GCUSERID
        Else
            objTarjetasMonto.ActualizarTarjetaMonto dtcAlmacen.BoundText, dtcTarjetas.BoundText, dtpFechaPos.Value, _
                                                    GDatFechaProceso, dtcMoneda.BoundText, GFormatodeNumero(CDbl(ctnMonto.Text), _
                                                    GintDecResultado), txtcomentario.Text, GCUSERID
        End If
        
        Call ggrabar_registro(Me)
        cmdBuscar.Enabled = True
    End If
    
Exit Sub

errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"
        
End Sub
Public Sub actualizar_registro()
    'llamar al procedimiento de carga
    Call obtener_datos
    Call asigna_campos
    'MsgBox ("Registros Actualizados")
End Sub
Public Sub agregar_registro()

    ' Hay que Verificar si es que el Parte Diario ya está cerrado
 
    If MobjVentasGeneral.MostrarStatusParteDiario(GstrSiteProce) = True Then
       MsgBox "Parte Diario ya fue cerrado", vbDefaultButton1 + vbExclamation, "Advertencia"
       Screen.MousePointer = 0
       Exit Sub
    End If
        
    Call gagregar_registro(Me, dtcAlmacen)
    lblFechaProceso.Caption = Format(GDatFechaProceso, "DD/MM/YYYY")
    dtcAlmacen.BoundText = GstrSiteProce
    dtcMoneda.BoundText = GstrCodMonedaBase
    chkEstado.Enabled = False
    cmdBuscar.Enabled = False
    
End Sub
Public Sub modificar_registro()
    If GVDATO(dtcAlmacen.Text) = Empty Then
        MsgBox "Seleccione un Registro que desee modificar ", vbExclamation, "Mensaje"
        Exit Sub
    End If
    
    If lblestado.Caption = "CERRADO" Then
       MsgBox "Parte Diario ya está Cerrado, No se puede Modificar", vbDefaultButton1 + vbExclamation, "Advertencia"
       Exit Sub
    End If
    
    Call gmodificar_registro(Me, dtcAlmacen)
    HabilitaCampos False
    dtpFechaPos.Enabled = True
    chkEstado.Enabled = False
End Sub
Public Sub HabilitaCampos(valor As Boolean)
    cmdBusAlmacen.Enabled = valor
    dtcTarjetas.Enabled = valor
    cmdBustarjeta.Enabled = valor
    dtpFechaPos.Enabled = valor
End Sub

Public Sub descartar_registro()
    ' Revertir cambios
    HabilitaCampos True
    Call gdescartar_registro(Me)
    Call asigna_campos
    Limpiar
End Sub

Sub obtener_datos()
    'Set rs_distritos = objDistrito.ListarDistritos
End Sub

Sub salir_formulario()
    ' validar que no haya procesos pendientes
    ' si no hay problemas
    MDIFVENTAS.Toolbar1.Buttons(18).Caption = "Salir"    ' boton salir
    Unload Me
End Sub

Sub asigna_campos() ' falta decidir si va ha ser public o private
'        dtcAlmacen.BoundText = rs_distritos!Cityid
'        txtDescripcion.Text = rs_distritos!DESCR
'        dtcDepartamentos.BoundText = rs_distritos!Stateid
End Sub
Public Sub CargaDatos(Param1 As String, Param2 As String, Param3 As String, Param4 As String, _
                      Param5 As String, Param6 As String, Param7 As String, Param8 As String)

    dtcAlmacen.BoundText = Param1
    dtcTarjetas.BoundText = Trim(Param2)
    dtpFechaPos.Value = CDate(Param3)
    lblFechaProceso.Caption = Param4
    dtcMoneda.BoundText = Param5
    ctnMonto.Text = Param6
    chkEstado.Value = IIf(Trim(Param7) = "APROBADO", 1, 0)
    If Trim(Param7) = "APROBADO" Then
       lblestado.Caption = "CERRADO"
    Else
       If Trim(Param7) = "PENDIENTE" Then
         lblestado.Caption = "NO CERRADO"
       End If
    End If
    txtcomentario.Text = Param8
    'dtcTipoNegocio.BoundText = Param9
       
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If pb_editar Then
        If MsgBox("Desea Cancelar los Cambios", vbYesNo, "Esta Modificando un registro") = vbNo Then
            Cancel = True
        Else
            pb_agregar = False
            pb_editar = False
            Call gdesactiva_barra
        End If
    Else
        pb_agregar = False
        pb_editar = False
        Call gdesactiva_barra
    End If
End Sub

'   Procedimiento GCargaDataCombo
'   Elaborado por : Edgar Cancho Ruiz
'   Fecha : 12/09/2002

Public Sub GCargaDataCombo(objDataCombo As DataCombo, rsSource As Recordset, istrCampo1 As String, istrCampo2 As String)
    Set objDataCombo.DataSource = rsSource
    objDataCombo.DataField = istrCampo2
    Set objDataCombo.RowSource = rsSource
    objDataCombo.ListField = istrCampo2
    objDataCombo.BoundColumn = istrCampo1
    objDataCombo.BoundText = rsSource.Fields(istrCampo2)
End Sub

Private Sub Form_Unload(Cancel As Integer)

    Set objAlmacen = Nothing
    Set objTarjetas = Nothing
    Set objMoneda = Nothing
    Set objTarjetasMonto = Nothing
    Set MobjVentasGeneral = Nothing
    
End Sub

Sub imprimir()
'   Crdistritos.ReportFileName = GstrReportesInv + "rpt_distrito.rpt"
'   Crdistritos.WindowTitle = "Reporte de Distritos"
'   Crdistritos.Formulas(1) = "formusuario=stringvar strusuario; strusuario:='" & GCUSERID & "'"
'   Crdistritos.Formulas(2) = "formscreen=stringvar strscreen; strscreen:='01.260.00'"
'   Crdistritos.WindowState = crptMaximized
'   Crdistritos.WindowShowPrintSetupBtn = True
'   Crdistritos.Action = 1

  FReporteRegtarjetas.Show
 
End Sub

Private Sub Limpiar()
'funcionabilidad    : pone en blanco todos los controles de un formulario

Dim curcontrol As Control
    With Me
    For Each curcontrol In .Controls
        If TypeOf curcontrol Is TextBox Then
                curcontrol.Text = ""
        End If
         If TypeOf curcontrol Is DataCombo Then
                 curcontrol.BoundText = Empty
        End If
         If TypeOf curcontrol Is ComboBox Then
              curcontrol.Text = ""
        End If
        If TypeOf curcontrol Is CtrlNumber Then
              curcontrol.ValorPorDefecto
        End If
        If TypeOf curcontrol Is CheckBox Then
              curcontrol.Value = 0
        End If
        
        If TypeOf curcontrol Is DTPicker Then
              curcontrol.Value = GDatFechaProceso
        End If
    
    Next
    End With
    lblestado.Caption = Empty
    lblFechaProceso = GDatFechaProceso

        
End Sub
