VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Begin VB.Form frmDocumentosPendientesPago 
   Caption         =   "Docs Pendientes de Pago"
   ClientHeight    =   5580
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   10935
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   ScaleHeight     =   5580
   ScaleWidth      =   10935
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtCliente 
      Height          =   375
      Left            =   1320
      TabIndex        =   1
      Top             =   120
      Width           =   9495
   End
   Begin MSDataGridLib.DataGrid DgdPendientes 
      Height          =   4815
      Left            =   120
      TabIndex        =   0
      Top             =   600
      Width           =   10815
      _ExtentX        =   19076
      _ExtentY        =   8493
      _Version        =   393216
      BackColor       =   -2147483624
      HeadLines       =   1
      RowHeight       =   19
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   13
      BeginProperty Column00 
         DataField       =   "TipoDoc"
         Caption         =   "Tipo Doc"
         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       =   "cSerieDoc"
         Caption         =   "Serie Doc"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "NroDoc"
         Caption         =   "Nro Doc"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "FechaEmision"
         Caption         =   "Fecha Emision"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04 
         DataField       =   "Local"
         Caption         =   "Local"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column05 
         DataField       =   "DscCliente"
         Caption         =   "Cliente"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column06 
         DataField       =   "cClienteCode"
         Caption         =   "cClienteCode"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column07 
         DataField       =   "IdLocal"
         Caption         =   "IdLocal"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column08 
         DataField       =   "Moneda"
         Caption         =   "Moneda"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column09 
         DataField       =   "TotVta"
         Caption         =   "Total Vta"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column10 
         DataField       =   "TotVtaUSD"
         Caption         =   "Total Vta USD"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column11 
         DataField       =   "MontoRestante"
         Caption         =   "Saldo"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column12 
         DataField       =   "MontoRestanteUSD"
         Caption         =   "Saldo USD"
         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 
         MarqueeStyle    =   3
         BeginProperty Column00 
            ColumnWidth     =   959.811
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   1154.835
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1574.929
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1755.213
         EndProperty
         BeginProperty Column04 
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   3344.882
         EndProperty
         BeginProperty Column06 
            Object.Visible         =   0   'False
            ColumnWidth     =   3509.858
         EndProperty
         BeginProperty Column07 
            Object.Visible         =   0   'False
         EndProperty
         BeginProperty Column08 
            Object.Visible         =   -1  'True
            ColumnWidth     =   989.858
         EndProperty
         BeginProperty Column09 
         EndProperty
         BeginProperty Column10 
         EndProperty
         BeginProperty Column11 
         EndProperty
         BeginProperty Column12 
         EndProperty
      EndProperty
   End
   Begin VB.Label Label1 
      Caption         =   "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          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   240
      Width           =   1095
   End
End
Attribute VB_Name = "frmDocumentosPendientesPago"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public sTipoDoc As String
Dim ADORS As ADODB.Recordset
Private Sub CargarGrilla()
Dim cnSQL As ADODB.Connection

Dim sSQL As String


If Not oDBAdmin.AbrirBD(cnSQL, psConnectString) Then GoTo Salir 'OMNISYS

sSQL = "usp_sel_ListadoDocumentosPendientesPago '" & sTipoDoc & "'"

If Not oDBAdmin.EjecutarConsulta(cnSQL, sSQL, ADORS) Then GoTo Salir

Set DgdPendientes.DataSource = ADORS

FormatoGrilla

Salir:
Set cnSQL = Nothing

End Sub

Private Sub DgdPendientes_DblClick()

With frmCajaFacturacionPagos
    .LimpiarPagos

    .P_TipoDoc = DgdPendientes.Columns(0).Value
    .P_cSerieDoc = DgdPendientes.Columns(1).Value
    .P_NroDoc = DgdPendientes.Columns(2).Value
    .P_FechaEmision = DgdPendientes.Columns(3).Value
    .P_DscCliente = DgdPendientes.Columns(5).Value
    .P_cClienteCode = DgdPendientes.Columns(6).Value
    .P_IdLocal = DgdPendientes.Columns(7).Value
    .P_Moneda = DgdPendientes.Columns(8).Value
    .P_TotVta = DgdPendientes.Columns(9).Value
    .P_TotVtaUSD = DgdPendientes.Columns(10).Value
    .P_MontoRestante = DgdPendientes.Columns(11).Value
    .P_MontoRestanteUSD = DgdPendientes.Columns(12).Value
    
    .CargarPagos .P_TipoDoc, .P_cSerieDoc, .P_NroDoc, .P_Moneda, .P_MontoRestante, .P_MontoRestanteUSD
    
End With



Unload Me
End Sub
Private Sub FormatoGrilla()
With DgdPendientes
    .Columns(0).Visible = False
    .Columns(1).Caption = "Serie"
    .Columns(1).Width = 800
    .Columns(2).Caption = "Numero"
    .Columns(2).Width = 1000
    .Columns(3).Caption = "Fec Emision"
    .Columns(3).Width = 1200
    .Columns(4).Caption = "Local"
    .Columns(4).Width = 1000
    .Columns(5).Caption = "Cliente"
    .Columns(5).Width = 3200
    .Columns(6).Visible = False
    .Columns(7).Visible = False
    
    .Columns(9).Caption = "Total Vta"
    .Columns(9).Width = 1350
    .Columns(9).NumberFormat = "0.00"
    .Columns(9).Alignment = dbgRight
    .Columns(10).Caption = "Total Vta USD"
    .Columns(10).Width = 1350
    .Columns(10).NumberFormat = "0.00"
    .Columns(10).Alignment = dbgRight
    .Columns(11).Caption = "M. Restante"
    .Columns(11).Width = 1450
    .Columns(11).NumberFormat = "0.00"
    .Columns(11).Alignment = dbgRight
    .Columns(12).Caption = "M. Restante USD"
    .Columns(12).Width = 1450
    .Columns(12).NumberFormat = "0.00"
    .Columns(12).Alignment = dbgRight
End With
End Sub
Private Sub Form_Load()
CargarGrilla
End Sub

Private Sub txtCliente_Change()

    If txtCliente <> "" Then
        ADORS.Filter = "DscCliente LIKE '*" + txtCliente.Text + "*'"
    Else

        ADORS.Filter = ""
           
        Set DgdPendientes.DataSource = ADORS
           

        ADORS.MoveFirst
    End If
End Sub
