VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FClienteCredito 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Estado de Cuenta"
   ClientHeight    =   7275
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10170
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7275
   ScaleWidth      =   10170
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame2 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1455
      Left            =   120
      TabIndex        =   11
      Top             =   2640
      Width           =   9975
      Begin VB.Label lblmensaje 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   27.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   135
         Left            =   120
         TabIndex        =   20
         Top             =   240
         Visible         =   0   'False
         Width           =   9735
      End
      Begin VB.Label lblsaldo 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   38.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   855
         Left            =   2760
         TabIndex        =   13
         Top             =   360
         Width           =   6255
      End
      Begin VB.Label Label6 
         Caption         =   "SALDO"
         BeginProperty Font 
            Name            =   "Batang"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   720
         TabIndex        =   12
         Top             =   600
         Width           =   1935
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Datos del Cliente"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2535
      Left            =   120
      TabIndex        =   2
      Top             =   0
      Width           =   9975
      Begin VB.Label Label9 
         Caption         =   "Dias de Gracia"
         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            =   120
         TabIndex        =   19
         Top             =   2040
         Width           =   1695
      End
      Begin VB.Label lbldiasgracia 
         Alignment       =   1  'Right Justify
         BackColor       =   &H8000000E&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   390
         Left            =   2040
         TabIndex        =   18
         Top             =   2000
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "Limite de Crédito"
         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            =   120
         TabIndex        =   17
         Top             =   1170
         Width           =   1785
      End
      Begin VB.Label lbllimitecredito 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   16
         Top             =   1140
         Width           =   2655
      End
      Begin VB.Label Label7 
         Caption         =   "Estado"
         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            =   4920
         TabIndex        =   15
         Top             =   1560
         Width           =   855
      End
      Begin VB.Label lblestado 
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   6000
         TabIndex        =   14
         Top             =   1560
         Width           =   3735
      End
      Begin VB.Label Label1 
         Caption         =   "Cod. Cliente"
         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            =   120
         TabIndex        =   10
         Top             =   315
         Width           =   1695
      End
      Begin VB.Label Label2 
         Caption         =   "RUC"
         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            =   4920
         TabIndex        =   9
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "Razón Social"
         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            =   120
         TabIndex        =   8
         Top             =   720
         Width           =   1455
      End
      Begin VB.Label Label5 
         Caption         =   "Tipo"
         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            =   120
         TabIndex        =   7
         Top             =   1590
         Width           =   1215
      End
      Begin VB.Label lbltipocliente 
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   6
         Top             =   1560
         Width           =   2655
      End
      Begin VB.Label lblcodcliente 
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "20100132745"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   5
         Top             =   240
         Width           =   2655
      End
      Begin VB.Label lblrazonsocial 
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "TEXAS PETROLEUM COMPANY"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   4
         Top             =   705
         Width           =   4695
      End
      Begin VB.Label lblruc 
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "20100132745"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   6000
         TabIndex        =   3
         Top             =   240
         Width           =   2895
      End
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      Caption         =   "Aceptar"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   3600
      Picture         =   "FClienteCredito.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   1
      Tag             =   "R ASDASD"
      Top             =   6360
      Width           =   3375
   End
   Begin MSDataGridLib.DataGrid DBdocumentosVenc 
      Height          =   2055
      Left            =   120
      TabIndex        =   0
      Top             =   4200
      Width           =   9975
      _ExtentX        =   17595
      _ExtentY        =   3625
      _Version        =   393216
      AllowUpdate     =   -1  'True
      HeadLines       =   1
      RowHeight       =   21
      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            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "Documentos Vencidos"
      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
End
Attribute VB_Name = "FClienteCredito"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private MrsDocumentoVencido As ADODB.Recordset

Private Sub CMD_ACEPTAR_Click()
  Unload Me
End Sub

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

Private Sub Form_Load()
   Dim Lintdocumentosvencidos As Integer
   
   'Se le asigna el control de las Teclas
   Me.KeyPreview = True
   
   'Establecer Medidas del Formulario
   Me.Top = 850
   Me.Left = 900


   'Obtener los datos del formulario FdatosClientCombus
   
   lblcodcliente.Caption = FDatosClientCombust.txtcodcliente
   lblruc.Caption = FDatosClientCombust.txtruc
   lblrazonsocial.Caption = FDatosClientCombust.txtrazonsocial
   lblestado.Caption = FDatosClientCombust.GstrDescrEstado
   lbltipocliente.Caption = FDatosClientCombust.GstrTipoClienteDescr
   lbldiasgracia.Caption = FDatosClientCombust.GstrDiasdeGracia
   
   'Información del Estado de Cuenta
      
   lbllimitecredito.Caption = GstrSimboloMoneda & " " & GFormatodeNumero(FDatosClientCombust.GdblLimiteCredito, GintDecResultado)
   lblsaldo.Caption = GstrSimboloMoneda & " " & GFormatodeNumero(FDatosClientCombust.GdblSaldoDisponible, GintDecResultado)
   
   'LLenar la Grilla de Documentos Vencidos
   
   Set MrsDocumentoVencido = FDatosClientCombust.GobjFacturacionCombust.ObtenerDocumentosVencidos(lblcodcliente.Caption)
   Set DBdocumentosVenc.DataSource = MrsDocumentoVencido
   DBdocumentosVenc.Refresh
   
   'Verificar si Tienen Documentos Vencidos a pesar de los Dias de Gracia
   
   Lintdocumentosvencidos = 0
   
   If Not MrsDocumentoVencido.EOF Then
     Do While Not MrsDocumentoVencido.EOF
        Lintdocumentosvencidos = Lintdocumentosvencidos + MrsDocumentoVencido!Vencidos
        MrsDocumentoVencido.MoveNext
     Loop
   End If
     
   If Lintdocumentosvencidos >= 1 Then
      lblmensaje.Visible = True
      lblmensaje.Height = 1095
      lblmensaje.Caption = "NO SE PUEDE FACTURAR"
   End If
   
   'Dar formato a la Grilla
   FormatearGrilla
     
End Sub

Public Sub FormatearGrilla()
   DBdocumentosVenc.Columns(0).Visible = False
   DBdocumentosVenc.Columns(1).Width = 1700
   DBdocumentosVenc.Columns(2).Width = 1400
   DBdocumentosVenc.Columns(3).Width = 1700
   DBdocumentosVenc.Columns(4).Width = 1490
   DBdocumentosVenc.Columns(5).Width = 1490
   
   If GStrMonedaCaja = GstrCodMonedaBase Then
      DBdocumentosVenc.Columns(6).Visible = True  'Columna de Moneda Base
      DBdocumentosVenc.Columns(6).Caption = "Total"
      DBdocumentosVenc.Columns(7).Visible = False 'Columna de Moneda Extranjera
   Else
      DBdocumentosVenc.Columns(6).Visible = False 'Columna de Moneda Base
      DBdocumentosVenc.Columns(7).Visible = True  'Columna de Moneda Extranjera
      DBdocumentosVenc.Columns(7).Caption = "Total"
   End If
      
   DBdocumentosVenc.Columns(8).Visible = False
   DBdocumentosVenc.Columns(9).Visible = False
      
End Sub


