VERSION 5.00
Object = "{69F9D01E-F1DE-11D4-9536-002018603DA2}#7.0#0"; "ControlNumber.ocx"
Begin VB.Form FEditarContometro 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Edición de detalle de Contómetro"
   ClientHeight    =   2520
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2520
   ScaleWidth      =   6000
   StartUpPosition =   2  'CenterScreen
   Begin MiControl.CtrlNumber ctnTotal 
      Height          =   255
      Left            =   4080
      TabIndex        =   5
      Top             =   1440
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   450
      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 MiControl.CtrlNumber ctnVenta 
      Height          =   255
      Left            =   1080
      TabIndex        =   2
      Top             =   1440
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   450
      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 cmdDescartar 
      Caption         =   "&Descartar"
      Height          =   375
      Left            =   4560
      TabIndex        =   7
      Top             =   1920
      Width           =   1335
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "&Aceptar"
      Height          =   375
      Left            =   3240
      TabIndex        =   6
      Top             =   1920
      Width           =   1335
   End
   Begin MiControl.CtrlNumber ctnOtros 
      Height          =   255
      Left            =   4080
      TabIndex        =   4
      Top             =   1080
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   450
      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 MiControl.CtrlNumber ctnSerafin 
      Height          =   255
      Left            =   4080
      TabIndex        =   3
      Top             =   720
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   450
      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 MiControl.CtrlNumber ctnFinal 
      Height          =   255
      Left            =   1080
      TabIndex        =   1
      Top             =   1080
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   450
      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 MiControl.CtrlNumber ctnInicial 
      Height          =   255
      Left            =   1080
      TabIndex        =   0
      Top             =   720
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   450
      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.Image Image1 
      Height          =   480
      Left            =   5220
      Picture         =   "FEditarContometro.frx":0000
      Top             =   45
      Width           =   480
   End
   Begin VB.Label Label2 
      Caption         =   "# Manguera"
      Height          =   255
      Left            =   2880
      TabIndex        =   17
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "Cara"
      Height          =   255
      Left            =   360
      TabIndex        =   16
      Top             =   120
      Width           =   495
   End
   Begin VB.Label lblManguera 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3840
      TabIndex        =   15
      Top             =   120
      Width           =   1095
   End
   Begin VB.Label lblCara 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   840
      TabIndex        =   14
      Top             =   120
      Width           =   1095
   End
   Begin VB.Shape Shape1 
      BorderColor     =   &H80000006&
      FillColor       =   &H00404040&
      Height          =   1215
      Left            =   120
      Top             =   585
      Width           =   5775
   End
   Begin VB.Label lblTotall 
      Caption         =   "Total"
      Height          =   255
      Left            =   3240
      TabIndex        =   13
      Top             =   1440
      Width           =   615
   End
   Begin VB.Label lblOtros 
      Caption         =   "Otros"
      Height          =   255
      Left            =   3240
      TabIndex        =   12
      Top             =   1080
      Width           =   690
   End
   Begin VB.Label lblSerafin 
      Caption         =   "Serafin"
      Height          =   255
      Left            =   3240
      TabIndex        =   11
      Top             =   720
      Width           =   615
   End
   Begin VB.Label lblVentaa 
      Caption         =   "Venta"
      Height          =   255
      Left            =   240
      TabIndex        =   10
      Top             =   1440
      Width           =   735
   End
   Begin VB.Label lblFinal 
      Caption         =   "Final"
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   1080
      Width           =   615
   End
   Begin VB.Label lblInicial 
      Caption         =   "Inicial"
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   720
      Width           =   735
   End
End
Attribute VB_Name = "FEditarContometro"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Programador: Edgar Cancho Ruiz
' Empresa Texaco
' EDICION DE CONTOMETROS MANUALES

Public MlngCorrelativo As Long
Public MintNro_Cara As String
Public MintNro_Manguera As Integer
Public MdblInicial As Double
Public MdblFinal As Double
Public MdblVenta As Double
Public MdblSerafin As Double
Public MdblOtros As Double
Public MdblTotal As Double

Private ObjContometro As DB_OP_MANTENIMIENTOS.C_CONTOMETROM

Private Sub cmdAceptar_Click()
On Error GoTo errhandler

    ObjContometro.ActualizaTemporal MlngCorrelativo, MintNro_Cara, MintNro_Manguera, GFormatodeNumero(CDbl(ctnInicial.Text), GintDecStock), GFormatodeNumero(CDbl(ctnFinal.Text), GintDecStock), _
                             GFormatodeNumero(CDbl(ctnVenta.Text), GintDecStock), GFormatodeNumero(CDbl(ctnSerafin.Text), GintDecStock), GFormatodeNumero(CDbl(ctnOtros.Text), GintDecStock), GFormatodeNumero(CDbl(ctnTotal.Text), GintDecStock)
    
    
    Unload Me
    
    Exit Sub

errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"

End Sub

Private Sub cmdDescartar_Click()
Unload Me
End Sub

Private Sub ctnFinal_change()
    Resultado
End Sub

Private Sub ctnFinal_GotFocus()
ctnFinal.BackColor = GC_ColorEnfoque
End Sub

Private Sub ctnFinal_KeyPress(KeyAscii As Integer)
KeyAscii = BloqueSignoMenos(KeyAscii)
If KeyAscii = 13 Then
    ctnSerafin.SetFocus
End If
End Sub

Private Sub ctnFinal_LostFocus()
ctnFinal.BackColor = GC_ColorDefecto
End Sub

Private Sub ctnInicial_change()
    Resultado
End Sub

Private Sub ctnInicial_GotFocus()
ctnInicial.BackColor = GC_ColorEnfoque
End Sub

Private Sub ctnInicial_KeyPress(KeyAscii As Integer)
KeyAscii = BloqueSignoMenos(KeyAscii)
If KeyAscii = 13 Then
    ctnFinal.SetFocus
End If
End Sub

Private Sub ctnInicial_LostFocus()
ctnInicial.BackColor = GC_ColorDefecto
End Sub

Private Sub ctnOtros_change()
    Resultado
End Sub

Private Sub ctnOtros_GotFocus()
ctnOtros.BackColor = GC_ColorEnfoque
End Sub

Private Sub ctnOtros_KeyPress(KeyAscii As Integer)
KeyAscii = BloqueSignoMenos(KeyAscii)
If KeyAscii = 13 Then
    cmdaceptar.SetFocus
End If
End Sub

Private Sub ctnOtros_LostFocus()
ctnOtros.BackColor = GC_ColorDefecto
End Sub

Private Sub ctnSerafin_change()
    Resultado
End Sub

Private Sub ctnSerafin_GotFocus()
ctnSerafin.BackColor = GC_ColorEnfoque
End Sub

Private Sub ctnSerafin_KeyPress(KeyAscii As Integer)
KeyAscii = BloqueSignoMenos(KeyAscii)
If KeyAscii = 13 Then
    ctnOtros.SetFocus
End If
End Sub

Private Sub ctnSerafin_LostFocus()
ctnSerafin.BackColor = GC_ColorDefecto
End Sub

Private Sub Form_Load()
    Controles
    Set ObjContometro = New DB_OP_MANTENIMIENTOS.C_CONTOMETROM
    lblCara.Caption = MintNro_Cara
    lblManguera.Caption = MintNro_Manguera
    ctnInicial.Text = GFormatodeNumero(MdblInicial, GintDecStock)
    ctnFinal.Text = GFormatodeNumero(MdblFinal, GintDecStock)
    ctnVenta.Text = GFormatodeNumero(MdblVenta, GintDecStock)
    ctnSerafin.Text = GFormatodeNumero(MdblSerafin, GintDecStock)
    ctnOtros.Text = GFormatodeNumero(MdblOtros, GintDecStock)
    ctnTotal.Text = GFormatodeNumero(MdblTotal, GintDecStock)
End Sub
 
Private Sub Controles()
    ctnInicial.Enteros = 7
    ctnInicial.Decimales = GintDecStock
    ctnInicial.ValorPorDefecto
    ctnFinal.Enteros = 7
    ctnFinal.Decimales = GintDecStock
    ctnFinal.ValorPorDefecto
    ctnVenta.Enteros = 7
    ctnVenta.Decimales = GintDecStock
    ctnVenta.Enabled = False
    ctnVenta.ValorPorDefecto
    ctnSerafin.Enteros = 7
    ctnSerafin.Decimales = GintDecStock
    ctnSerafin.ValorPorDefecto
    ctnOtros.Enteros = 7
    ctnOtros.Decimales = GintDecStock
    ctnOtros.ValorPorDefecto
    ctnTotal.Enteros = 7
    ctnTotal.Decimales = GintDecStock
    ctnTotal.Enabled = False
    ctnTotal.ValorPorDefecto

End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set ObjContometro = Nothing
End Sub

Private Sub Resultado()
On Error Resume Next
    ctnVenta.Text = GFormatodeNumero(CDbl(ctnFinal.Text) - CDbl(ctnInicial.Text), GintDecStock)
    ctnTotal.Text = GFormatodeNumero(CDbl(ctnVenta.Text) - CDbl(ctnSerafin.Text) - CDbl(ctnOtros.Text), GintDecStock)
End Sub

Private Function BloqueSignoMenos(KeyAscii As Integer) As Integer
    If KeyAscii = 45 Then
        BloqueSignoMenos = 0
    Else
        BloqueSignoMenos = KeyAscii
    End If
End Function
