VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form fpagotarjetas 
   Caption         =   "Pago en Tarjetas"
   ClientHeight    =   3240
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6585
   LinkTopic       =   "Form2"
   ScaleHeight     =   3240
   ScaleWidth      =   6585
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txt_tcambio 
      DataField       =   "NBRDOCUMENT"
      DataMember      =   "OP_SALES"
      DataSource      =   "DataEnvironment1"
      Enabled         =   0   'False
      Height          =   285
      Left            =   5520
      TabIndex        =   11
      TabStop         =   0   'False
      Top             =   240
      Width           =   735
   End
   Begin VB.TextBox txt_tarjeta 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3240
      MaxLength       =   16
      TabIndex        =   10
      Top             =   1680
      Width           =   3255
   End
   Begin VB.CommandButton CMD_CANCELAR 
      Cancel          =   -1  'True
      Caption         =   "&Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   4560
      Picture         =   "fpagotarjetas.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   2280
      Width           =   1935
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      Caption         =   "&Aceptar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   1920
      Picture         =   "fpagotarjetas.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   4
      Tag             =   "R ASDASD"
      Top             =   2280
      Width           =   1815
   End
   Begin MSDataListLib.DataCombo dtc_monedat 
      Height          =   315
      Left            =   3120
      TabIndex        =   3
      Top             =   240
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin VB.Frame Frame1 
      Caption         =   "Total en"
      Height          =   855
      Left            =   1920
      TabIndex        =   1
      Top             =   720
      Width           =   4575
      Begin VB.Label lbl_monto 
         Caption         =   "Monto"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3240
         TabIndex        =   8
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label lbl_moneda 
         Caption         =   "Moneda"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   7
         Top             =   240
         Width           =   2175
      End
   End
   Begin MSDataListLib.DataList dtl_tarjetas 
      Height          =   2985
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   5265
      _Version        =   393216
   End
   Begin VB.Label Label11 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "Tipo Cambio:"
      Height          =   285
      Left            =   5400
      TabIndex        =   12
      Top             =   0
      Width           =   930
   End
   Begin VB.Label Label5 
      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
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "Moneda Tarjeta:"
      Height          =   255
      Left            =   1920
      TabIndex        =   6
      Top             =   240
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "No.Tarjeta:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1920
      TabIndex        =   2
      Top             =   1800
      Width           =   1335
   End
End
Attribute VB_Name = "fpagotarjetas"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim MOBJ_CMONEDA As DB_MA_MANTENIMIENTOS.C_MONEDA
Dim MOBJ_Ctarjeta As DB_OP_MANTENIMIENTOS.C_TARJETA
Dim mobj_cventasgen As DB_OP_FACTURACION.C_VENTASGENERAL
Dim strDOCTYPEID As String
Dim strNBRDOCUMENT As String
Dim pbln_inicio As Boolean
Dim TOTCARDpen As Double
Dim TOTCARDUSD As Double

Private Sub CMD_ACEPTAR_Click()
Dim strSITEID As String
Dim strCARDID As String
Dim strNBRCARD As String
Dim strcuryid As String
strSITEID = GstrSiteProce
pbln_inicio = False
If Len(Trim(dtc_monedat.Text)) = 0 Then
    MsgBox "Debe Escoger una Moneda", vbInformation, "Falta Datos"
    dtc_monedat.SetFocus
    Exit Sub
Else
    strcuryid = dtc_monedat.BoundText
End If
If Len(Trim(dtl_tarjetas.Text)) = 0 Then
    MsgBox "Debe Escoger una Tarjeta", vbInformation, "Falta Datos"
    dtl_tarjetas.SetFocus
    Exit Sub
Else
    strCARDID = dtl_tarjetas.BoundText
End If
If Len(Trim(txt_tarjeta.Text)) = 0 Then
    MsgBox "Debe Ingresar un # de Tarjeta", vbInformation, "Falta Datos"
    txt_tarjeta.SetFocus
    Exit Sub
Else
    If Len(Trim(txt_tarjeta.Text)) < 1 Then
        MsgBox "Faltan Digitos en el  # de Tarjeta", vbInformation, "Falta Datos"
        txt_tarjeta.SetFocus
        Exit Sub
    End If
    strNBRCARD = txt_tarjeta.Text
End If

mobj_cventasgen.grabarsalescard pdbl_correlativo, strSITEID, strCARDID, strNBRCARD, strcuryid, TOTCARDpen, TOTCARDUSD
'llamar al procedimiento de grabar
gbln_ventaefectuada = True

f_ventascstore.LDblTOTRETURNEDPEN = 0
f_ventascstore.LDblTOTRETURNEDUSD = 0
f_ventascstore.LDblTOTCASHPEN = LdblTotalBase
f_ventascstore.LDblTOTCASHUSD = LdblTotalExt

Unload Me
End Sub

Private Sub cmd_Cancelar_Click()
pbln_inicio = False
Unload Me
End Sub

Private Sub dtc_monedat_Change()
Dim ldbl_monto As Double
ldbl_monto = Val(lbl_monto.Caption)
If pbln_inicio Then
    If dtc_monedat.BoundText = GstrMonedaExtranjera Then
        lbl_moneda.Caption = MOBJ_CMONEDA.ListarPorMonedaID(GstrMonedaExtranjera)!DescrMoney
        TOTCARDUSD = mobj_cventasgen.ConvertirMoneda(ldbl_monto, GstrCodMonedaBase, GstrMonedaExtranjera, GDatFechaProcesoVentas, GstrTipodeCambio, GintDecPrecio)
        TOTCARDpen = mobj_cventasgen.ConvertirMoneda(TOTCARDUSD, GstrMonedaExtranjera, GstrCodMonedaBase, GDatFechaProcesoVentas, GstrTipodeCambio, GintDecPrecio)
        lbl_monto.Caption = Str(TOTCARDUSD)
    Else
        lbl_moneda.Caption = MOBJ_CMONEDA.ListarPorMonedaID(GstrCodMonedaBase)!DescrMoney
        TOTCARDpen = mobj_cventasgen.ConvertirMoneda(ldbl_monto, GstrMonedaExtranjera, GstrCodMonedaBase, GDatFechaProcesoVentas, GstrTipodeCambio, GintDecPrecio)
        TOTCARDUSD = mobj_cventasgen.ConvertirMoneda(TOTCARDpen, GstrCodMonedaBase, GstrMonedaExtranjera, GDatFechaProcesoVentas, GstrTipodeCambio, GintDecPrecio)
        lbl_monto.Caption = Str(TOTCARDpen)
    End If
Else
    If dtc_monedat.BoundText = GstrMonedaExtranjera Then
        TOTCARDUSD = ldbl_monto
        TOTCARDpen = mobj_cventasgen.ConvertirMoneda(TOTCARDUSD, GstrMonedaExtranjera, GstrCodMonedaBase, GDatFechaProcesoVentas, GstrTipodeCambio, GintDecPrecio)
    Else
        TOTCARDpen = ldbl_monto
        TOTCARDUSD = mobj_cventasgen.ConvertirMoneda(TOTCARDpen, GstrCodMonedaBase, GstrMonedaExtranjera, GDatFechaProcesoVentas, GstrTipodeCambio, GintDecPrecio)
    End If
End If
End Sub

Private Sub dtc_monedat_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    If Len(Trim(dtc_monedat.Text)) = 0 Then
        MsgBox "Debe Escoger una Moneda", vbInformation, "Falta Datos"
    Else
        txt_tarjeta.SetFocus
    End If
End If
End Sub
Private Sub dtl_tarjetas_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    If Len(Trim(dtl_tarjetas.Text)) = 0 Then
        MsgBox "Debe Escoger una Tarjeta", vbInformation, "Falta Datos"
    Else
        dtc_monedat.SetFocus
    End If
End If
End Sub

Private Sub Form_Activate()
pbln_inicio = True

End Sub

Private Sub Form_Load()

Dim Lrstemp As ADODB.Recordset
Dim Lutil As UTIL_SETUP.C_SETUP
Set Lutil = New UTIL_SETUP.C_SETUP
Set Lrstemp = Lutil.Auxiliar3("SELECT CARDid,descr FROM Op_CARD where not cardadjust is null")

Set MOBJ_CMONEDA = New DB_MA_MANTENIMIENTOS.C_MONEDA
Set MOBJ_Ctarjeta = New DB_OP_MANTENIMIENTOS.C_TARJETA
Set mobj_cventasgen = New DB_OP_FACTURACION.C_VENTASGENERAL

Call CargaDataCombo(dtc_monedat, MOBJ_CMONEDA.ListarMonedas, "curyid", "descr")
'Call CargaDataCombo(dtl_tarjetas, MOBJ_Ctarjeta.ListartarjetaAyuda, "CARDid", "descr")
Call CargaDataCombo(dtl_tarjetas, Lrstemp, "CARDid", "descr")

Me.Top = 1650
Me.Left = 1350


End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
pbln_inicio = False
End Sub

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

Private Sub txt_tarjeta_KeyPress(KeyAscii As Integer)
KeyAscii = GBloqueanonumeros(KeyAscii)
End Sub
