VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FVentaVales 
   Caption         =   "Registro de Vales"
   ClientHeight    =   4605
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8250
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4605
   ScaleWidth      =   8250
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Agregar >>"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   2640
      TabIndex        =   10
      Top             =   1830
      Width           =   1455
   End
   Begin VB.TextBox txtnrovale 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   150
      MaxLength       =   9
      TabIndex        =   8
      Top             =   1860
      Width           =   2175
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   2310
      Left            =   4590
      TabIndex        =   7
      Top             =   1095
      Width           =   3540
      _ExtentX        =   6244
      _ExtentY        =   4075
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      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            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton cmdaceptarprodadi 
      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            =   4575
      Picture         =   "FVentaVales.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   6
      Tag             =   "R ASDASD"
      Top             =   3660
      Width           =   1575
   End
   Begin VB.CommandButton cmdcancelar 
      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            =   6390
      Picture         =   "FVentaVales.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   3630
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      ForeColor       =   &H80000008&
      Height          =   960
      Left            =   60
      TabIndex        =   0
      Top             =   15
      Width           =   8130
      Begin VB.TextBox txtplaca 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   420
         Left            =   1170
         MaxLength       =   12
         TabIndex        =   2
         Top             =   345
         Width           =   2175
      End
      Begin VB.TextBox txtkilometraje 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   420
         Left            =   5190
         TabIndex        =   1
         Top             =   345
         Width           =   2175
      End
      Begin VB.Label Label1 
         Caption         =   "Placa"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   4
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label3 
         Caption         =   "Kilometraje"
         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            =   3720
         TabIndex        =   3
         Top             =   405
         Width           =   1215
      End
   End
   Begin VB.Label Label2 
      Caption         =   "Numero de Vales"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   150
      TabIndex        =   9
      Top             =   1515
      Width           =   2010
   End
End
Attribute VB_Name = "FVentaVales"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private MobjVentascombustible As DB_OP_FACTURACION.C_VENTASPLAYA
Public GBlnUsuarioCreditoOK As Boolean
Private Sub txtkilometraje_KeyPress(KeyAscii As Integer)
  KeyAscii = GBloqueaCaracter(KeyAscii)
  
  If Not IsNumeric(Chr(KeyAscii)) Then
    If (KeyAscii = 8 Or KeyAscii = 13 Or KeyAscii = 32) Then
      If KeyAscii = 13 Then
         ' Inicio de Validacion
         If txtplaca.Enabled = True Then
           If Trim(txtkilometraje.Text) = Empty Then
              MsgBox "Ingrese Kilometraje", vbDefaultButton1 + vbExclamation, "Advertencia"
              Exit Sub
            End If
            cmdaceptarprodadi.SetFocus
         End If
         ' Fin de Validacion
       End If
    Else
       KeyAscii = 0
    End If
  End If
End Sub

Private Sub txtnrovale_KeyPress(KeyAscii As Integer)
  KeyAscii = GBloqueaCaracter(KeyAscii)
  
  If Not IsNumeric(Chr(KeyAscii)) Then
    If (KeyAscii = 8 Or KeyAscii = 13 Or KeyAscii = 32) Then
      If KeyAscii = 13 Then
         
         ' Inicio de Validacion
                              
            'Verificar si Numero de Vale no está repetido para ese cliente
             If Trim(txtnrovale.Text) = Empty Then
                MsgBox "Ingrese Número de Vale", vbDefaultButton1 + vbExclamation, "Advertencia"
                Exit Sub
              Else
                If MobjVentascombustible.VerificarValedeCliente(FDatosClientCombust.txtcodcliente, txtnrovale.Text) = False Then
                  If txtkilometraje.Enabled = True Then
                     txtkilometraje.SetFocus
                  Else
                     cmdaceptarprodadi.SetFocus
                  End If
                Else
                  MsgBox "Número de Vale ya fue registrado ", vbDefaultButton1 + vbExclamation, "Advertencia"
                  txtnrovale.SetFocus
                  Exit Sub
                End If
             End If
         
         ' Fin de Validacion
         
       End If
    Else
       KeyAscii = 0
    End If
  End If

End Sub

Private Sub txtplaca_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
      'Verificar si la Placa Existe para el Cliente
      If MobjVentascombustible.VerificarPlacadeCliente(FDatosClientCombust.txtcodcliente, txtplaca.Text) = True Then
          txtnrovale.SetFocus
      Else
          MsgBox "Número de Placa no esiste para este Cliente", vbDefaultButton1 + vbExclamation, "Advertencia"
          Exit Sub
      End If
   End If
End Sub
