VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FControlCombustibleAjuste 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Ajuste de Control de Combustible"
   ClientHeight    =   6375
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   7590
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6375
   ScaleWidth      =   7590
   StartUpPosition =   2  'CenterScreen
   Begin MSDataGridLib.DataGrid dbAjuste 
      Height          =   3015
      Left            =   240
      TabIndex        =   1
      Top             =   3000
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   5318
      _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
      Caption         =   "VENTAS CON AJUSTES PARA IGUALAR LAS VENTAS SEGUN GASBOY / CEN44"
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            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            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin MSDataGridLib.DataGrid dbVentas 
      Height          =   2295
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   4048
      _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
      Caption         =   "Ventas por Artículo según TITANIUM"
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            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            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "FControlCombustibleAjuste"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Programador : EDGAR CANCHO RUIZ

Private ObjCtrlFuel As DB_OP_MANTENIMIENTOS.C_CTRLFUEL
Private MobjVentasGeneral  As DB_OP_FACTURACION.C_VENTASGENERAL
Public MlngCorrelativo As Long

Public MblnAgregando As Boolean
Public MstrCodAlmacen As String
Public MdatFecha As Date

Private Sub FormatoGrilla()
With dbVentas
    .Columns(0).Width = 500
    .Columns(0).Visible = False
    .Columns(1).Width = 800
    .Columns(1).Visible = False
    .Columns(2).Width = 2700
    .Columns(3).Width = 1200
    .Columns(3).Alignment = dbgRight
    .Columns(3).NumberFormat = GMascara(GintDecStock)
    .Columns(4).Width = 1200
    .Columns(4).Alignment = dbgRight
    .Columns(4).NumberFormat = GMascara(GintDecPrecio)
    .Columns(5).Width = 1200
    .Columns(5).Alignment = dbgRight
    .Columns(5).NumberFormat = GMascara(GintDecResultado)
End With
End Sub

Private Sub FormatoGrilla2()
With dbAjuste
    .Columns(0).Width = 500
    .Columns(0).Visible = False
    .Columns(1).Width = 800
    .Columns(1).Visible = False
    .Columns(2).Width = 2700
    .Columns(3).Width = 1200
    .Columns(3).Alignment = dbgRight
    .Columns(3).NumberFormat = GMascara(GintDecStock)
    .Columns(4).Width = 1200
    .Columns(4).Alignment = dbgRight
    .Columns(4).NumberFormat = GMascara(GintDecPrecio)
    .Columns(5).Width = 1200
    .Columns(5).Alignment = dbgRight
    .Columns(5).NumberFormat = GMascara(GintDecResultado)
End With
End Sub

Private Sub CargaGrid(lngId As Long)

    If MblnAgregando Then
        Set dbVentas.DataSource = ObjCtrlFuel.VentasCombustible(lngId, GstrSiteProce, MdatFecha)
        Set dbAjuste.DataSource = ObjCtrlFuel.SeleccionaAjustesTmp(lngId)

    Else
        Set dbVentas.DataSource = ObjCtrlFuel.SeleccionaVentas(GstrSiteProce, MdatFecha)
        Set dbAjuste.DataSource = ObjCtrlFuel.SeleccionaAjustes(GstrSiteProce, MdatFecha)
    End If
    
    Call FormatoGrilla
    Call FormatoGrilla2
    
End Sub

Private Sub Form_Load()
On Error GoTo TrataError
    Screen.MousePointer = 11
    Set ObjCtrlFuel = New DB_OP_MANTENIMIENTOS.C_CTRLFUEL
    Set MobjVentasGeneral = New DB_OP_FACTURACION.C_VENTASGENERAL
    Call CargaGrid(MlngCorrelativo)
    
    Me.Top = 200
    Me.Left = (Screen.Width - Me.Width) / 2
    Screen.MousePointer = 0
    
Exit Sub
TrataError:
    Screen.MousePointer = 0
    MsgBox "Error de carga de Formulario", vbExclamation, "Control de Combustible"
    
End Sub
