VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmCajaVoucher 
   Caption         =   "Caja Voucher"
   ClientHeight    =   5760
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8790
   LinkTopic       =   "Form1"
   ScaleHeight     =   5760
   ScaleWidth      =   8790
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton CmdCancelar 
      Cancel          =   -1  'True
      Caption         =   "&Cancelar  (Esc)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   4800
      TabIndex        =   10
      Top             =   5310
      Width           =   1980
   End
   Begin VB.CommandButton CmdAceptar 
      Caption         =   "&Aceptar  (F5)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   2145
      TabIndex        =   9
      Top             =   5310
      Width           =   1980
   End
   Begin VB.Frame frmTarjeta 
      Caption         =   "&EMISORES  - - (F1)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3375
      Left            =   4995
      TabIndex        =   0
      Top             =   30
      Width           =   3735
      Begin MSDataGridLib.DataGrid grdTar 
         Height          =   2550
         Left            =   90
         TabIndex        =   1
         Top             =   540
         Width           =   3525
         _ExtentX        =   6218
         _ExtentY        =   4498
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         HeadLines       =   1
         RowHeight       =   19
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {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
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   "cod_tar"
            Caption         =   "Código"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   "0"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   10250
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "descrip"
            Caption         =   "Descripción"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   10250
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               Object.Visible         =   0   'False
            EndProperty
            BeginProperty Column01 
               ColumnWidth     =   3495.118
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame frmPagTar 
      Caption         =   "&PAGO TARJETA (S/.)  - -  (F2)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3375
      Left            =   30
      TabIndex        =   2
      Top             =   30
      Width           =   4950
      Begin MSDataGridLib.DataGrid grdPagTar 
         Height          =   2580
         Left            =   135
         TabIndex        =   3
         Top             =   525
         Width           =   4710
         _ExtentX        =   8308
         _ExtentY        =   4551
         _Version        =   393216
         AllowUpdate     =   -1  'True
         HeadLines       =   1
         RowHeight       =   19
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {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
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   4
         BeginProperty Column00 
            DataField       =   "descrip"
            Caption         =   "Descripción"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   "0"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   10250
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "pago"
            Caption         =   "Pago"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   10250
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "SD"
            Caption         =   "Moneda"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   10250
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cod_tar"
            Caption         =   "Código"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   10250
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               Locked          =   -1  'True
            EndProperty
            BeginProperty Column01 
            EndProperty
            BeginProperty Column02 
               Button          =   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column03 
               Object.Visible         =   0   'False
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame frmEfectivo 
      Caption         =   "EFECTIVO"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1815
      Left            =   30
      TabIndex        =   4
      Top             =   3435
      Width           =   4950
      Begin VB.TextBox txtEfectivoSoles 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   1920
         Locked          =   -1  'True
         TabIndex        =   6
         Text            =   "0.00"
         Top             =   540
         Width           =   1815
      End
      Begin VB.TextBox txtVueltoSoles 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000018&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   1920
         Locked          =   -1  'True
         TabIndex        =   8
         TabStop         =   0   'False
         Text            =   "0.00"
         Top             =   1080
         Width           =   1815
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "&Efectivo:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   15.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   765
         TabIndex        =   5
         Top             =   525
         Width           =   1200
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "Vuelto:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   15.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   960
         TabIndex        =   7
         Top             =   1140
         Width           =   990
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         Caption         =   "(S/.)"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2550
         TabIndex        =   15
         Top             =   165
         Width           =   570
      End
   End
   Begin VB.Frame fraTotal 
      Caption         =   "TOTALES"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1815
      Left            =   4980
      TabIndex        =   11
      Top             =   3435
      Width           =   3735
      Begin VB.TextBox txtDolares 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   465
         Left            =   1155
         Locked          =   -1  'True
         TabIndex        =   16
         TabStop         =   0   'False
         Text            =   "0.00"
         Top             =   1050
         Width           =   1800
      End
      Begin VB.TextBox txtSoles 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   465
         Left            =   1155
         Locked          =   -1  'True
         TabIndex        =   13
         TabStop         =   0   'False
         Text            =   "0.00"
         Top             =   405
         Width           =   1800
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "U$"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   345
         Left            =   480
         TabIndex        =   14
         Top             =   1155
         Width           =   390
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "S/."
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   345
         Left            =   465
         TabIndex        =   12
         Top             =   465
         Width           =   435
      End
   End
End
Attribute VB_Name = "FrmCajaVoucher"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sub_t As Double
Dim flag As Double

Private Sub cmdaceptar_Click()
  Dim llvwitem As ListItems
  If val(txtEfectivoSoles.Text) < 0 Then
    MsgBox "Error el importe en voucher es mayor al importe de Venta"
    Exit Sub
  End If
  
   If rsPagTar.RecordCount <= 0 Then
    MsgBox "Debe seleccionar por lo menos una tarjeta"
    Exit Sub
  End If
  frmCajaRegistradoraFull.txtEfectivoSoles = txtEfectivoSoles
  frmCajaRegistradoraFull.txtVueltoSoles = txtVueltoSoles
  frmCajaRegistradoraFull.txtliqefectivosoles = txtEfectivoSoles
  frmCajaRegistradoraFull.txtliqvueltosoles = txtVueltoSoles
  frmCajaRegistradoraFull.piEmitevoucher = 1
  sFlag = True
  Unload Me
End Sub

Private Sub CmdAceptar_KeyDown(KeyCode As Integer, Shift As Integer)
Form_KeyDown KeyCode, 0
End Sub

Private Sub cmdCancelar_Click()
terminar
End Sub

Private Sub CmdCancelar_KeyDown(KeyCode As Integer, Shift As Integer)
Form_KeyDown KeyCode, 0
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next

'SHIFT
'-----
'1, se está pulsando la tecla Shift (mayúsculas)
'2, se está pulsando Control
'4, se está pulsando Alt
'3, se están pulsando Shift y Ctrl,
'5, se están pulsando Shift y Alt,
'6, se están pulsando Ctrl y Alt,
'7, se están pulsando las tres teclas.

  Select Case Shift
  
    Case 0
      Select Case KeyCode
        Case vbKeyF1
            grdTar.SetFocus
'          Call cmdTecla_Click(KeyCode - 111)
           
        Case vbKeyF5
            CmdAceptar.SetFocus
        Case vbKeyEscape
            CmdCancelar.SetFocus
        Case vbKeyF2
          'grdPagTar.SetFocus
          grdPagTar.Col = 1
          grdPagTar.SelText = True
          'grdPagTar.SetFocus
       
      End Select
  
End Select
    
  Exit Sub
End Sub

Private Sub Form_Load()
carga_rs
initial_form

End Sub
Private Sub initial_form()
  Dim sSql As String
  Dim oRs As ADODB.Recordset
  
On Error GoTo Salir
  
  sSql = "select cod_tar,descrip from tipo_tarjeta"
  
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSql, oRs) Then GoTo Salir
  
  If oRs.RecordCount > 0 Then
    oRs.MoveFirst
    Do While Not oRs.EOF
        rsTar.AddNew
        rsTar.Fields("cod_tar") = oRs!cod_tar
        rsTar.Fields("descrip") = oRs!descrip
        rsTar.Update
        oRs.MoveNext
    Loop
    oRs.MoveFirst
    
  End If
  sub_t = 0
  flag = 0
  
 'jpcb270710
  If frmCajaRegistradoraFull.iTipoVenta = 7 Then
  txtSoles = frmCajaRegistradoraFull.txtPagoAdelantado
  Else
  txtSoles = frmCajaRegistradoraFull.txtSoles
  txtDolares = frmCajaRegistradoraFull.txtDolares
  txtEfectivoSoles = txtSoles
  End If
  
  grdTar.TabIndex = 0
  sFlag = False
Salir:
   Exit Sub
End Sub

Private Sub lstTarjeta_DblClick()
'MsgBox lstPagTar.ItemData(lstPagTar.Index)
End Sub

Private Sub carga_rs()
    Set rsTar = New Recordset
    rsTar.CursorType = adOpenStatic
    rsTar.Fields.Append "Cod_tar", adChar, 4, adFldIsNullable
    rsTar.Fields.Append "descrip", adVarChar, 50, adFldIsNullable
    rsTar.Open
    Set grdTar.DataSource = rsTar
    
    Set rsPagTar = New Recordset
    rsPagTar.CursorType = adOpenStatic
    rsPagTar.Fields.Append "descrip", adVarChar, 50, adFldIsNullable
    rsPagTar.Fields.Append "Pago", adVarChar, 15, adFldIsNullable
    rsPagTar.Fields.Append "SD", adChar, 7, adFldIsNullable
    rsPagTar.Fields.Append "cod_tar", adChar, 4, adFldIsNullable
    rsPagTar.Open
    Set grdPagTar.DataSource = rsPagTar
End Sub

Private Sub grdPagTar_AfterColEdit(ByVal ColIndex As Integer)
If rsPagTar.RecordCount > 0 Then
If Trim(grdPagTar.Columns(2)) = "Soles" Then
'
'    'grdPagTar.Columns(1) = Str(Format(Val(grdPagTar.Columns(1)), "0.00"))
'    If Val(grdPagTar.Columns(1)) <= Val(txtEfectivoSoles) Then
'        If Val(grdPagTar.Columns(1)) = 0 And Val(txtEfectivoSoles) = 0 Then
'        Else
'        txtEfectivoSoles = Val(txtEfectivoSoles) - Val(grdPagTar.Columns(1))
'        txtEfectivoSoles = Format(txtEfectivoSoles, "0.00")
'        txtVueltoSoles = "0.00"
'        flag = 0
'        sub_t = sub_t + Val(grdPagTar.Columns(1))
'        Exit Sub
'        End If
'    End If
'
'
'    sub_t = sub_t + Val(grdPagTar.Columns(1))
'
'    If (sub_t + Val(txtEfectivoSoles)) > Val(txtSoles) Then
'        flag = sub_t - Val(txtSoles)
'        Else
'        flag = Val(txtEfectivoSoles) - sub_t
'    End If
'
'    If (sub_t + flag) > Val(txtSoles) Then
'
'        txtEfectivoSoles = "0.00"
'        txtVueltoSoles = Format(CStr(flag), "0.00")
'
'        Else
'        txtEfectivoSoles = Val(txtEfectivoSoles) - sub_t
'        txtEfectivoSoles = Format(txtEfectivoSoles, "0.00")
'        txtVueltoSoles = "0.00"
'        flag = 0
'    End If
     Dim TOT
     TOT = 0
'rsPagTar.Fields ("pago")
     rsPagTar.MoveFirst
     Do While Not rsPagTar.EOF
        TOT = TOT + rsPagTar.Fields("pago")
        rsPagTar.MoveNext
     Loop
If val(txtSoles.Text) >= val(TOT) Then
     txtEfectivoSoles.Text = Format((val(txtSoles) - TOT), "0.00")
txtVueltoSoles.Text = "0.00"
Else
 txtEfectivoSoles.Text = "0.00"
txtVueltoSoles = Format(val(TOT) - val(txtSoles.Text), "0.00")
End If


Else
    
End If
End If


End Sub

Private Sub grdPagTar_BeforeColEdit(ByVal ColIndex As Integer, ByVal KeyAscii As Integer, Cancel As Integer)
'calcula_vuelto
End Sub

Private Sub grdPagTar_ButtonClick(ByVal ColIndex As Integer)
'If Trim(rsPagTar!sd) = "Soles" Then
'   rsPagTar!sd = "Soles"
'Else
'   rsPagTar!sd = "Soles"
'End If
'rsPagTar.Update
End Sub


Private Sub grdPagTar_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyDelete Then

    If rsPagTar.RecordCount > 0 Then
        'If rsPagTar.BOF Or rsPagTar.EOF Then MsgBox "Debe seleccionar de la Lista el ITEM a eliminar", vbCritical, "¡¡ ERROR !!": Exit Sub
            '*****
            '*****
            grdPagTar.Col = 1
            
            calcula_vuelto
            
            rsPagTar.Move grdPagTar.Row
            rsPagTar.Find "cod_tar=" & grdPagTar.Columns(3), , , 1
            
            If Not rsPagTar.EOF Then
                rsPagTar.Delete
                If Not rsPagTar.EOF Then
                  rsPagTar.Update
                End If
            End If
                        
            'rsmovipla.Update
            'txtSiaf.SetFocus
            'Call Totales
                If rsPagTar.RecordCount <= 0 Then
                    'fraLista.Enabled = False
                    'txtSiaf.SetFocus
                End If
    End If
    '    Call grDatLista_Change
Else
    
    If KeyCode = 113 Then
     Form_KeyDown 112, 0
    End If

Form_KeyDown KeyCode, 0
End If

End Sub
Private Sub grdTar_DblClick()
Dim s As Double
s = 0
Dim TOT
TOT = 0
'rsPagTar.Fields ("pago")
If Not rsPagTar.EOF Then
rsPagTar.MoveFirst
Do While Not rsPagTar.EOF
    TOT = TOT + rsPagTar.Fields("pago")
    rsPagTar.MoveNext
Loop
End If
    rsPagTar.Find "pago=" & s, , , 1
    If rsPagTar.EOF Then
'
        rsPagTar.Find "cod_tar=" & grdTar.Columns(0), , , 1
        If rsPagTar.EOF Then
            rsPagTar.AddNew
            rsPagTar.Fields("descrip") = grdTar.Columns(1)
            rsPagTar.Fields("sd") = "Soles"
            'rsPagTar.Fields("pago") = "0.00"
            rsPagTar.Fields("pago") = Format(CDbl(txtSoles.Text) - TOT, "0.00")
            rsPagTar.Fields("cod_tar") = grdTar.Columns(0)
            rsPagTar.Update
            txtEfectivoSoles.Text = "0.00"
            Form_KeyDown 113, 0
        Else
            MsgBox "Ya se Ingreso Tarjeta...!!!"
        End If
    Else
    MsgBox "Ingrese Monto...!!!"
    Exit Sub
    End If
    

End Sub
Private Sub calcula_vuelto()
Dim TOT As Double
If rsPagTar.RecordCount > 0 Then
'If Trim(grdPagTar.Columns(2)) = "Soles" Then
'    If sub_t < Val(txtSoles) Then
'    txtEfectivoSoles = Val(txtEfectivoSoles) + Val(grdPagTar.Columns(1)) - flag
'    txtEfectivoSoles = Format(txtEfectivoSoles, "0.00")
'    End If
'    sub_t = sub_t - Val(grdPagTar.Columns(1))
'    If sub_t < Val(txtSoles) Then
'    txtVueltoSoles = "0.00"
'    flag = 0
'    txtEfectivoSoles = Val(txtSoles) - sub_t
'    txtEfectivoSoles = Format(txtEfectivoSoles, "0.00")
'    Else
'    flag = sub_t - Val(txtEfectivoSoles)
'    txtVueltoSoles = Format(CStr(flag), "0.00")
'    End If
'
'Else
'
'
'End If
'End If
TOT = 0
'If Not rsPagTar.EOF Then
rsPagTar.MoveFirst
Do While Not rsPagTar.EOF
    TOT = TOT + rsPagTar.Fields("pago")
    rsPagTar.MoveNext
Loop
'vd 03/09/2007  txtVueltoSoles.Text = Format(Val(txtSoles.Text) - (Val(txtEfectivoSoles.Text) + TOT), "0.00")
If TOT > txtSoles.Text Then
txtVueltoSoles.Text = Format((TOT - val(txtSoles.Text)), "0.00")
Else
txtVueltoSoles.Text = "0.00"
End If
End If

End Sub
Private Sub grdTar_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 113 Then
Form_KeyDown KeyCode, 0
grdPagTar.SetFocus
End If
End Sub

Private Sub grdTar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    grdTar_DblClick
   
'    grdPagTar.SelText
    
    Form_KeyDown 113, 0
   grdPagTar.SetFocus
End If
End Sub

Private Sub terminar()
    sFlag = False
    Set rsPagTar = Nothing
    Set rsTar = Nothing
    Unload Me
End Sub
Private Sub txtEfectivoSoles_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
   calcula_vuelto
End If
End Sub

Private Sub txtEfectivoSoles_LostFocus()
calcula_vuelto
End Sub
