VERSION 5.00
Begin VB.Form FplacaKilometraje 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Registro de placas"
   ClientHeight    =   3765
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4920
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3765
   ScaleWidth      =   4920
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      ForeColor       =   &H80000008&
      Height          =   2415
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4695
      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            =   1680
         TabIndex        =   3
         Top             =   1560
         Width           =   2175
      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            =   1680
         MaxLength       =   9
         TabIndex        =   2
         Top             =   960
         Width           =   2175
      End
      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            =   1680
         MaxLength       =   12
         TabIndex        =   1
         Top             =   360
         Width           =   2175
      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            =   240
         TabIndex        =   8
         Top             =   1560
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "Nro de Vale"
         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        =   7
         Top             =   960
         Width           =   1455
      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        =   6
         Top             =   360
         Width           =   1335
      End
   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            =   3240
      Picture         =   "FplacaKilometraje.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   2760
      Width           =   1575
   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            =   1440
      Picture         =   "FplacaKilometraje.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   4
      Tag             =   "R ASDASD"
      Top             =   2760
      Width           =   1575
   End
End
Attribute VB_Name = "FplacaKilometraje"
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

Private MobjVentascombustible As DB_OP_FACTURACION.C_VENTASPLAYA
Public GBlnUsuarioCreditoOK As Boolean

Private Sub cmdaceptarprodadi_Click()

  'Validacion de la Placa
   
   If txtplaca.Enabled = True Then
     If MobjVentascombustible.VerificarPlacadeCliente(FDatosClientCombust.txtcodcliente, txtplaca.Text) = False Then
        MsgBox "Número de Placa no esiste para este Cliente", vbDefaultButton1 + vbExclamation, "Advertencia"
        txtplaca.SetFocus
        Exit Sub
     End If
   End If
   
   'Validacion del Numero de Vale
   
   If Trim(txtnrovale.Text) = Empty Then
      MsgBox "Ingrese Número de GUIA", vbDefaultButton1 + vbExclamation, "Advertencia"
      txtnrovale.SetFocus
      Exit Sub
   Else
      If MobjVentascombustible.VerificarValedeCliente(FDatosClientCombust.txtcodcliente, txtnrovale.Text) = True Then
         MsgBox "Número de GUIA ya fue registrado ", vbDefaultButton1 + vbExclamation, "Advertencia"
         txtnrovale.SetFocus
         Exit Sub
      End If
   End If
   
   'Validacion del Kilometraje
   
   If txtplaca.Enabled = True Then
      If Trim(txtkilometraje.Text) = Empty Then
          MsgBox "Ingrese Kilometraje", vbDefaultButton1 + vbExclamation, "Advertencia"
          txtkilometraje.SetFocus
          Exit Sub
      End If
   End If
        
   'Si la Cara está Vacía se procede a emitir directamente sin grabar a temporal
      
   If Trim(FDatosClientCombust.txtcara.Text) = Empty Or GIntVentaAutoCombust = 0 Then
      If FDatosClientCombust.MrsGrilla.RecordCount < 1 Then
         MsgBox "No se ha Ingresado Ningún Producto", vbDefaultButton1 + vbExclamation, "Advertencia"
         Unload Me
         Exit Sub
      End If

      FDatosClientCombust.GStrNumeroPlaca = txtplaca.Text
      FDatosClientCombust.GintNumeroVale = txtnrovale.Text
      If Trim(txtkilometraje.Text) <> Empty Then
         FDatosClientCombust.GdblKilometraje = txtkilometraje.Text
      Else
         FDatosClientCombust.GdblKilometraje = 0
      End If
      
      GBlnUsuarioCreditoOK = False
      FingresoCodVend.GIntdepantalla = 2
      FingresoCodVend.Show vbModal
      If GBlnUsuarioCreditoOK = False Then
         Exit Sub
      End If
            
      FDatosClientCombust.EmitirDocumentoDirectamente 0, "", GStrCodVendedorVentaCombus, GStrCodUsuarioVentaCombus
      If GIntVentaAutoCombust = 1 Then
         Unload Me
         Unload FDatosClientCombust
      Else
         Unload Me
         FDatosClientCombust.GLimpiarDatosdePantalla
      End If
   Else
      FDatosClientCombust.GStrNumeroPlaca = txtplaca.Text
      FDatosClientCombust.GintNumeroVale = txtnrovale.Text
      
      If Trim(txtkilometraje.Text) <> Empty Then
         FDatosClientCombust.GdblKilometraje = txtkilometraje.Text
      Else
         FDatosClientCombust.GdblKilometraje = 0
      End If
      
      If GblnVienedePendientes = False Then
         FDatosClientCombust.GrabarDatosenTemporal
      Else  'Actualizar
         FDatosClientCombust.ActualizarDatosenTemporal
         FTranspendientes.GactualizarPendientes
      End If
      Unload Me
      Unload FDatosClientCombust
   End If
   
End Sub

Private Sub cmdCancelar_Click()
'  Unload Me
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
   
'   If KeyCode = 27 Then
'      Unload Me
'   End If

End Sub

Private Sub Form_Load()
     
'     Me.KeyPreview = True
'
'     Me.Top = (Screen.Width - Me.Width) / 2
'     Me.Left = (Screen.Height - Me.Height) / 2
'
'    'Instanciar Objeto
'     Set MobjVentascombustible = New DB_OP_FACTURACION.C_VENTASPLAYA
'
'    'Buscar en la Tabla op_custbadge
'     txtplaca.Enabled = FDatosClientCombust.GblnconPlacas
'     txtkilometraje.Enabled = FDatosClientCombust.GblnconPlacas
'
'     If GblnVienedePendientes = True Then
'        ' Cargo los datos ingresado previos
'         txtplaca.Text = Trim(FDatosClientCombust.GStrNumeroPlaca)
'         txtnrovale.Text = Trim(FDatosClientCombust.GintNumeroVale)
'         txtkilometraje.Text = FDatosClientCombust.GdblKilometraje
'     End If
    
End Sub

Private Sub Form_Unload(Cancel As Integer)

'    Set MobjVentascombustible = Nothing
    
End Sub

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 GUIA", 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 GUIA 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
