VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Form_Ingreso_Cheques_hue 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Ingreso de cheques"
   ClientHeight    =   7845
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   11640
   FillStyle       =   0  'Solid
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7845
   ScaleWidth      =   11640
   ShowInTaskbar   =   0   'False
   Begin VB.ListBox List2 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1530
      Left            =   5880
      TabIndex        =   38
      Top             =   720
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.ListBox List1 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1530
      Left            =   960
      TabIndex        =   37
      Top             =   720
      Visible         =   0   'False
      Width           =   4455
   End
   Begin VB.Frame Frame_Mvto_Chq 
      Caption         =   "Estado de cheques"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   3735
      Left            =   120
      TabIndex        =   39
      Top             =   1320
      Width           =   11415
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grid_Chq_Solo 
         Height          =   3015
         Left            =   6720
         TabIndex        =   8
         Top             =   240
         Width           =   4575
         _ExtentX        =   8070
         _ExtentY        =   5318
         _Version        =   393216
         BackColor       =   16777215
         Cols            =   8
         AllowBigSelection=   0   'False
         FocusRect       =   0
         FillStyle       =   1
         SelectionMode   =   1
         FormatString    =   ">Nº|>run_apo|>folio_chq|>Cta. Cte.|>Serie|>Número|>Banco|>Monto"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _NumberOfBands  =   1
         _Band(0).Cols   =   8
      End
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grid_Chq_Mvto_Ok 
         Height          =   3015
         Left            =   3360
         TabIndex        =   7
         Top             =   240
         Width           =   3255
         _ExtentX        =   5741
         _ExtentY        =   5318
         _Version        =   393216
         Cols            =   8
         AllowBigSelection=   0   'False
         FocusRect       =   0
         FillStyle       =   1
         SelectionMode   =   1
         FormatString    =   ">Nº|>run_alu|>folio_mvto|>folio_chq|^Vencimiento|>Monto|>Nº Serie Cheque|>Run_Apo"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _NumberOfBands  =   1
         _Band(0).Cols   =   8
      End
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grid_Mvto_Solo 
         Height          =   3015
         Left            =   120
         TabIndex        =   6
         Top             =   240
         Width           =   3135
         _ExtentX        =   5530
         _ExtentY        =   5318
         _Version        =   393216
         Cols            =   6
         AllowBigSelection=   0   'False
         FocusRect       =   0
         FillStyle       =   1
         ScrollBars      =   2
         SelectionMode   =   1
         FormatString    =   "^Nº|>folio_mvto|>run_alu|^Vencimiento|>Monto|^Fecha Pago"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _NumberOfBands  =   1
         _Band(0).Cols   =   6
      End
      Begin VB.Label Label15 
         Alignment       =   2  'Center
         Caption         =   "Cheques sin Movimientos Asociados"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   7080
         TabIndex        =   42
         Top             =   3360
         Width           =   4215
      End
      Begin VB.Label Label14 
         Alignment       =   2  'Center
         Caption         =   "Movientos con cheques Ingresados"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3480
         TabIndex        =   41
         Top             =   3360
         Width           =   3135
      End
      Begin VB.Label Label13 
         Alignment       =   2  'Center
         Caption         =   "Movimientos sin cheques Ingresados"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   40
         Top             =   3360
         Width           =   3255
      End
   End
   Begin VB.CommandButton Btn_Imprimir 
      Caption         =   "Imprimir"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   10080
      TabIndex        =   13
      Top             =   7200
      Width           =   1335
   End
   Begin VB.CommandButton Btn_Chq_New 
      Caption         =   "Agregar Cheque"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   10080
      TabIndex        =   10
      Top             =   5280
      Width           =   1335
   End
   Begin VB.CommandButton Btn_Chq_Edit 
      Caption         =   "Editar Cheque"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   10080
      TabIndex        =   11
      Top             =   5880
      Width           =   1335
   End
   Begin VB.CommandButton Btn_Chq_Link 
      Caption         =   "Vincular Cheque"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   10080
      TabIndex        =   12
      Top             =   6600
      Width           =   1335
   End
   Begin VB.Frame Frame_Chq_Edicion 
      Caption         =   "Agregar / Editar Cheque"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   2535
      Left            =   120
      TabIndex        =   16
      Top             =   5160
      Width           =   9735
      Begin VB.TextBox Text14 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         Locked          =   -1  'True
         TabIndex        =   53
         Text            =   "Text14"
         Top             =   600
         Width           =   1335
      End
      Begin VB.TextBox Text13 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1320
         Locked          =   -1  'True
         TabIndex        =   51
         Text            =   "Text13"
         Top             =   600
         Width           =   3975
      End
      Begin VB.CommandButton Btn_Limpiar_chq 
         Caption         =   "Limpiar Datos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   8160
         TabIndex        =   49
         Top             =   960
         Width           =   1335
      End
      Begin MSComctlLib.ImageCombo ICmb_Banco 
         Height          =   345
         Left            =   1320
         TabIndex        =   29
         Top             =   2040
         Width           =   3975
         _ExtentX        =   7011
         _ExtentY        =   609
         _Version        =   393216
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "ICmb_Banco"
      End
      Begin VB.CommandButton Btn_Cancelar_Chq 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   8160
         TabIndex        =   33
         Top             =   1680
         Width           =   1335
      End
      Begin VB.CommandButton Btn_Grabar_Chq 
         Caption         =   "Grabar Cheque"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   8160
         TabIndex        =   32
         Top             =   240
         Width           =   1335
      End
      Begin VB.TextBox Text9 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         TabIndex        =   28
         Text            =   "Text9"
         Top             =   1680
         Width           =   1335
      End
      Begin VB.TextBox Text8 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         TabIndex        =   27
         Text            =   "Text8"
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox Text7 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3960
         TabIndex        =   26
         Text            =   "Text7"
         Top             =   1680
         Width           =   1335
      End
      Begin VB.TextBox Text6 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3960
         TabIndex        =   25
         Text            =   "Text6"
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox Text5 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1320
         TabIndex        =   24
         Text            =   "Text5"
         Top             =   1680
         Width           =   1335
      End
      Begin VB.TextBox Text4 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1320
         TabIndex        =   23
         Text            =   "Text4"
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox Text3 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1320
         TabIndex        =   22
         Text            =   "Text3"
         Top             =   960
         Width           =   5175
      End
      Begin MSComCtl2.DTPicker DTPicker1 
         Height          =   285
         Left            =   6600
         TabIndex        =   31
         Top             =   2040
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   503
         _Version        =   393216
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Format          =   16580609
         CurrentDate     =   40779
         MinDate         =   38353
      End
      Begin VB.Label lbl_estadocheque 
         Height          =   255
         Left            =   6600
         TabIndex        =   55
         Top             =   840
         Width           =   1335
      End
      Begin VB.Label Label20 
         Caption         =   "Run Apoderado:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5400
         TabIndex        =   54
         Top             =   600
         Width           =   1215
      End
      Begin VB.Label Label19 
         Caption         =   "Apoderado:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   52
         Top             =   600
         Width           =   1215
      End
      Begin VB.Label LB_Folio_chq 
         Caption         =   "Folio_chq"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1320
         TabIndex        =   43
         Top             =   240
         Visible         =   0   'False
         Width           =   1095
      End
      Begin VB.Label Label12 
         Caption         =   "Banco:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   36
         Top             =   2040
         Width           =   975
      End
      Begin VB.Label Label11 
         Caption         =   "Número cheque:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5400
         TabIndex        =   35
         Top             =   1680
         Width           =   1215
      End
      Begin VB.Label Label10 
         Caption         =   "Serie Cheque:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5400
         TabIndex        =   34
         Top             =   1320
         Width           =   1215
      End
      Begin VB.Label Label9 
         Caption         =   "Cta. Corriente:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2760
         TabIndex        =   30
         Top             =   1680
         Width           =   1215
      End
      Begin VB.Label Label8 
         Caption         =   "Fecha Cheque:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5400
         TabIndex        =   21
         Top             =   2040
         Width           =   1215
      End
      Begin VB.Label Label7 
         Caption         =   "Monto Cheque:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2760
         TabIndex        =   20
         Top             =   1320
         Width           =   1215
      End
      Begin VB.Label Label6 
         Caption         =   "Teléfono Titular:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   19
         Top             =   1680
         Width           =   1215
      End
      Begin VB.Label Label5 
         Caption         =   "Run titular:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   18
         Top             =   1320
         Width           =   1215
      End
      Begin VB.Label Label4 
         Caption         =   "Nombre Titular:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   17
         Top             =   960
         Width           =   1215
      End
   End
   Begin VB.Frame Frame_Alu 
      Caption         =   "Alumno"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1095
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   11415
      Begin VB.TextBox Text12 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000012&
         Height          =   285
         Left            =   7560
         TabIndex        =   48
         Text            =   "Text12"
         Top             =   720
         Width           =   975
      End
      Begin VB.TextBox Text11 
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000012&
         Height          =   285
         Left            =   3960
         TabIndex        =   46
         Text            =   "Text11"
         Top             =   720
         Width           =   3255
      End
      Begin VB.TextBox Text10 
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000012&
         Height          =   285
         Left            =   840
         TabIndex        =   45
         Text            =   "Text10"
         Top             =   720
         Width           =   2055
      End
      Begin VB.CommandButton Btn_Cancelar 
         Caption         =   "Cambiar Alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   10080
         TabIndex        =   5
         Top             =   360
         Width           =   1095
      End
      Begin VB.ComboBox Cmb_Agno 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   7680
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   360
         Width           =   855
      End
      Begin VB.CommandButton Btn_Ver 
         Caption         =   "Ver Alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   8760
         TabIndex        =   4
         Top             =   360
         Width           =   1095
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   5760
         TabIndex        =   2
         Text            =   "Text2"
         Top             =   360
         Width           =   1455
      End
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   840
         TabIndex        =   1
         Text            =   "Text1"
         Top             =   360
         Width           =   4455
      End
      Begin VB.Label Label18 
         Caption         =   "Run:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   7200
         TabIndex        =   50
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label17 
         Caption         =   "Apoderado:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3000
         TabIndex        =   47
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label16 
         Alignment       =   1  'Right Justify
         Caption         =   "Colegio:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   44
         Top             =   720
         Width           =   615
      End
      Begin VB.Label Label3 
         Caption         =   "Año:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   7320
         TabIndex        =   15
         Top             =   360
         Width           =   375
      End
      Begin VB.Label Label2 
         Caption         =   "Run:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5400
         TabIndex        =   14
         Top             =   360
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "Nombre:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   360
         Width           =   735
      End
   End
End
Attribute VB_Name = "Form_Ingreso_Cheques_hue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Variables Generales
Dim Flag_sub As Boolean
Dim Flag_Edi As Boolean
Dim Flag_Ins As Boolean
Dim Flag_Chq As Boolean
Dim Flag_Mvt As Boolean
'######################

Public Sub Flag_Sub_True()
    Flag_sub = True
End Sub

Public Sub Flag_Sub_False()
    Flag_sub = False
End Sub

Private Sub Btn_Cancelar_Chq_Click()
    Frame_Mvto_Chq.Enabled = True
    Frame_Alu.Enabled = True
    Frame_Chq_Edicion.Enabled = False
    Flag_Ins = False
    Flag_Edi = False
End Sub

Private Sub Btn_Cancelar_Click()
    Text1.Locked = False
    Text2.Locked = False
    Text1.Text = ""
    Text2.Text = ""
    Text10.Text = ""
    Text11.Text = ""
    Text12.Text = ""
    Formato_Grid_Mvto_Solo
    Formato_Grid_Chq_Mvto_Ok
    Formato_Grid_Chq_Solo
    'Frame_Chq.Enabled = False
    Btn_Chq_New.Enabled = False
    Btn_Chq_Edit.Enabled = False
    Limpia_Frame_Ing_Chq
End Sub

Private Sub Btn_Chq_Edit_Click()
    If LB_Folio_chq.Caption = "" Then
        MsgBox "No ha sido seleccionado ningun cheque para editar.", vbInformation, "Falta Información"
        Exit Sub
    End If
    Frame_Mvto_Chq.Enabled = False
    Frame_Chq_Edicion.Enabled = True
    Flag_Edi = True
End Sub

Private Sub Btn_Chq_Link_Click()
    ' Aqui se vinculara un cheque con un movimiento.
    Dim sw As Boolean
    Dim QRY As String
    Dim inicio As Integer
    Dim fin As Integer
    Dim CMD As ADODB.Command
    Dim Affected As Long
    Dim RowChq As Integer
    Dim RowMvt As Integer
    Dim FolioMvto As Integer
    Dim FolioChq As Integer
    Dim Disponible As Long
    Dim MontoMvto As Long
    Dim accion_detalle As String
    ' Asignar variables a utilizar
    RowChq = Grid_Chq_Solo.Row
    RowMvt = Grid_Mvto_Solo.Row
    ' Primero ver si el cheque tiene dinero sin asignar suficiente para cubrir el movimiento.
    Disponible = Val(Grid_Chq_Solo.TextMatrix(RowChq, 7)) - Val(Grid_Chq_Solo.TextMatrix(RowChq, 8))
    MontoMvto = Val(Grid_Mvto_Solo.TextMatrix(RowMvt, 4))
'    If Disponible < (MontoMvto - 1500) Then
'        MsgBox "El monto no asignado en el cheque " & vbCrLf & "es inferior al monto del movimiento.", vbCritical, "Error de Validación"
'        Exit Sub
'    End If
    
    inicio = Grid_Mvto_Solo.Row
    fin = Grid_Mvto_Solo.RowSel
    inicio2 = Grid_Chq_Solo.Row
    fin2 = Grid_Chq_Solo.RowSel
    
    If inicio = fin And inicio2 = fin2 Then
        sw = True
    End If
    If inicio <> fin And inicio2 = fin2 Then
        sw = True
    End If
    If inicio = fin And inicio2 <> fin2 Then
        sw = False
    End If
        
    If sw = True Then
    If inicio <= fin Then
        For i = inicio To fin
           QRY = "INSERT INTO fnza_chq_mvto(folio_chq,folio_mvto,run_apo,run_alu) VALUES ('" & Grid_Chq_Solo.TextMatrix(RowChq, 2) & "','" & Grid_Mvto_Solo.TextMatrix(i, 1) & "','" & Trim(Text14.Text) & "','" & Trim(Text2.Text) & "');"
           Set CMD = New ADODB.Command
           CMD.ActiveConnection = conn
           CMD.CommandType = adCmdText
           CMD.CommandText = QRY
           CMD.Execute Affected
           ' Tercero limpiar variables.
           If Affected > 0 Then
                accion_detalle = "Se asigno el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " a la mensualidad " _
                           & Grid_Mvto_Solo.TextMatrix(Grid_Mvto_Solo.Row, 3)
                Call Inserta_Vitacora_Finanza(Text2.Text, Text14.Text, "Vinculación de cheques", accion_detalle, 0, 0)
'                Btn_Ver_Click
'                Btn_Chq_Link.Enabled = False
           Else
                MsgBox "No se pudo realizar la operacion.", vbCritical, "ANOMALÍA"
           End If
        Next i
    Else
        For i = fin To inicio Step -1
           QRY = "INSERT INTO fnza_chq_mvto(folio_chq,folio_mvto,run_apo,run_alu) VALUES ('" & Grid_Chq_Solo.TextMatrix(RowChq, 2) & "','" & Grid_Mvto_Solo.TextMatrix(i, 1) & "','" & Trim(Text14.Text) & "','" & Trim(Text2.Text) & "');"
           Set CMD = New ADODB.Command
           CMD.ActiveConnection = conn
           CMD.CommandType = adCmdText
           CMD.CommandText = QRY
           CMD.Execute Affected
           ' Tercero limpiar variables.
           If Affected > 0 Then
                accion_detalle = "Se asigno el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " a la mensualidad " _
                           & Grid_Mvto_Solo.TextMatrix(Grid_Mvto_Solo.Row, 3)
                Call Inserta_Vitacora_Finanza(Text2.Text, Text14.Text, "Vinculación de cheques", accion_detalle, 0, 0)
'                Btn_Ver_Click
'                Btn_Chq_Link.Enabled = False
           Else
                MsgBox "No se pudo realizar la operacion.", vbCritical, "ANOMALÍA"
           End If
        Next i
    End If
    End If
            
    If sw = False Then
    If inicio2 <= fin2 Then
        For i = inicio2 To fin2
           QRY = "INSERT INTO fnza_chq_mvto(folio_chq,folio_mvto,run_apo,run_alu) VALUES ('" & Grid_Chq_Solo.TextMatrix(i, 2) & "','" & Grid_Mvto_Solo.TextMatrix(RowMvt, 1) & "','" & Trim(Text14.Text) & "','" & Trim(Text2.Text) & "');"
           Set CMD = New ADODB.Command
           CMD.ActiveConnection = conn
           CMD.CommandType = adCmdText
           CMD.CommandText = QRY
           CMD.Execute Affected
           ' Tercero limpiar variables.
           If Affected > 0 Then
                accion_detalle = "Se asigno el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " a la mensualidad " _
                           & Grid_Mvto_Solo.TextMatrix(Grid_Mvto_Solo.Row, 3)
                Call Inserta_Vitacora_Finanza(Text2.Text, Text14.Text, "Vinculación de cheques", accion_detalle, 0, 0)
'                Btn_Ver_Click
'                Btn_Chq_Link.Enabled = False
           Else
                MsgBox "No se pudo realizar la operacion.", vbCritical, "ANOMALÍA"
           End If
        Next i
    Else
        For i = inicio2 To fin2 Step -1
           QRY = "INSERT INTO fnza_chq_mvto(folio_chq,folio_mvto,run_apo,run_alu) VALUES ('" & Grid_Chq_Solo.TextMatrix(i, 2) & "','" & Grid_Mvto_Solo.TextMatrix(RowMvt, 1) & "','" & Trim(Text14.Text) & "','" & Trim(Text2.Text) & "');"
           Set CMD = New ADODB.Command
           CMD.ActiveConnection = conn
           CMD.CommandType = adCmdText
           CMD.CommandText = QRY
           CMD.Execute Affected
           ' Tercero limpiar variables.
           If Affected > 0 Then
                accion_detalle = "Se asigno el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " a la mensualidad " _
                           & Grid_Mvto_Solo.TextMatrix(Grid_Mvto_Solo.Row, 3)
                Call Inserta_Vitacora_Finanza(Text2.Text, Text14.Text, "Vinculación de cheques", accion_detalle, 0, 0)
'                Btn_Ver_Click
'                Btn_Chq_Link.Enabled = False
           Else
                MsgBox "No se pudo realizar la operacion.", vbCritical, "ANOMALÍA"
           End If
        Next i
    End If
    End If
            
          Btn_Ver_Click
          Btn_Chq_Link.Enabled = False
          
          
    ' Segundo asignar.
    ' Modificado, vinculacion segun apoderado-alu
'    QRY = "INSERT INTO fnza_chq_mvto(folio_chq,folio_mvto,run_apo,run_alu) VALUES ('" & Grid_Chq_Solo.TextMatrix(RowChq, 2) & "','" & Grid_Mvto_Solo.TextMatrix(RowMvt, 1) & "','" & Trim(Text14.Text) & "','" & Trim(Text2.Text) & "');"
'    MsgBox Grid_Mvto_Solo.Row & "-" & Grid_Mvto_Solo.RowSel
    'MsgBox Grid_Mvto_Solo.RowSel
    
    
'    Set CMD = New ADODB.Command
'    CMD.ActiveConnection = conn
'    CMD.CommandType = adCmdText
'    CMD.CommandText = QRY
'    CMD.Execute Affected
'    ' Tercero limpiar variables.
'    If Affected > 0 Then
'        accion_detalle = "Se asigno el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " a la mensualidad " _
'                       & Grid_Mvto_Solo.TextMatrix(Grid_Mvto_Solo.Row, 3)
'        Call Inserta_Vitacora_Finanza(Text2.Text, Text14.Text, "Vinculación de cheques", accion_detalle)
'        Btn_Ver_Click
'        Btn_Chq_Link.Enabled = False
'    Else
'        MsgBox "No se pudo realizar la operacion.", vbCritical, "ANOMALÍA"
'    End If
    
End Sub

Private Sub Btn_Chq_New_Click()
    Frame_Mvto_Chq.Enabled = False
    Frame_Alu.Enabled = False
    Frame_Chq_Edicion.Enabled = True
    Flag_Ins = True
    LB_Folio_chq.Caption = ""
    Text13.Text = Text11.Text
    Text14.Text = Text12.Text
End Sub

Private Sub Btn_Grabar_Chq_Click()
On Error GoTo Controlerror:
    Dim accion_detalle, accion As String
    Dim QRY As String
    Dim CMD As ADODB.Command
    Dim Affected As Long
    Dim RunTit As String
    ' ###########################
    ' Validar el rut del titular.
    RunTit = Text4.Text
    If Not (ValidaRut(RunTit)) Then
        MsgBox "El Rut del titular es incorrecto.", vbCritical, "Error de Validación"
        Exit Sub
    End If
    Text4.Text = RunTit
    If Val(Text6.Text) <= 0 Then
        MsgBox "El monto del cheque es incorrecto.", vbCritical, "Error de Validación"
        Exit Sub
    End If
    If (Text3.Text = "") Or (Text4.Text = "") Or (Text5.Text = "") Or (Text6.Text = "") Or (Text7.Text = "") Or (Text8.Text = "") Or (Text9.Text = "") Then
        MsgBox "Faltan información por ingresar.", vbCritical, "Error de Validación"
    End If
    ' ###########################################
    ' Desplegar los datos y preguntar si esta OK.
    If MsgBox("¿Está seguro que los datos son correctos?", vbOKCancel + vbQuestion, "Validar") = vbCancel Then
        Exit Sub
    End If
    Text3.Text = UCase(Text3.Text)
    ' Insertar o editar
    ' modificar segun nueva relacion cheque con apoderado
    If Flag_Ins Then
        QRY = "INSERT INTO fnza_cheques_recibidos(run_apo,banco,cta_cte,chq_serie,chq_numero,chq_fecha,run_titular,nom_titular,tel_titular,monto_chq) VALUES ('" & Text14.Text & "','" & Mid(ICmb_Banco.SelectedItem.Key, 2) & "','" & Trim(Text7.Text) & "','" & Trim(Text8.Text) & "','" & Trim(Text9.Text) & "','" & Format(DTPicker1.Value, "yyyy-mm-dd") & "','" & Trim(Text4.Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text5.Text) & "','" & Trim(Text6.Text) & "');"
        accion_detalle = "Se ha ingresado el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " del banco " & ICmb_Banco.Text
        accion = "Inserción de cheque"
    ElseIf Flag_Edi Then
        QRY = "UPDATE fnza_cheques_recibidos SET banco='" & Mid(ICmb_Banco.SelectedItem.Key, 2) & "', cta_cte='" & Trim(Text7.Text) & "', chq_serie='" & Trim(Text8.Text) & "', chq_numero='" & Trim(Text9.Text) & "', chq_fecha='" & Format(DTPicker1.Value, "yyyy-mm-dd") & "', run_titular='" & Trim(Text4.Text) & "', nom_titular='" & Trim(Text3.Text) & "', tel_titular='" & Trim(Text5.Text) & "', monto_chq='" & Trim(Text6.Text) & "' WHERE folio_chq=" & Trim(LB_Folio_chq.Caption) & ";"
        accion_detalle = "Se ha editado el cheque Serie: " & Text8.Text & " Número: " & Text9.Text & " del banco " & ICmb_Banco.Text
        accion = "Edición de cheque"
    Else
        Err.Raise vbObjectError + 1001, Btn_Grabar_Chq, "Petición de acción ambigua."
    End If
    
    Set CMD = New ADODB.Command
    CMD.ActiveConnection = conn
    CMD.CommandType = adCmdText
    CMD.CommandText = QRY
    CMD.Execute Affected
    If Affected = 0 Then
        MsgBox "No se realizó ninguna operación.", vbInformation, "Información"
    Else
        Call Inserta_Vitacora_Finanza(Text2.Text, Text14.Text, accion, CStr(accion_detalle), 0, 0)
    End If
    Btn_Cancelar_Chq_Click
    Btn_Ver_Click
    LB_Folio_chq.Caption = ""
    
    Exit Sub
Controlerror:
    If Err.Number = -2147217900 Then
        MsgBox "Este cheque ya esta ingresado.", vbExclamation, "Cheque Repetido"
    Else
        MsgBox "Anomalía: " & Err.Number & vbCrLf & "Motivo : " & Err.Description, vbCritical, "ANOMALÍA"
    End If
    Btn_Cancelar_Chq_Click
    Btn_Ver_Click
End Sub

Private Sub Btn_Limpiar_chq_Click()
    Limpia_Frame_Ing_Chq
End Sub

Private Sub Btn_Ver_Click()
    ' No hacer nada si no hay datos de alumno
    If Text1.Text = "" Or Text2.Text = "" Then Exit Sub
    ' Llenar çinfo de movimientos y cheques
    Text1.Locked = True
    Text2.Locked = True
    LLena_Grid_Mvto_Solo Text2.Text, cmb_agno.Text
    LLena_Grid_Chq_Mvto_Ok Text2.Text, cmb_agno.Text
    marca_grilla
    LLena_Grid_Chq_Solo Text12.Text, cmb_agno.Text
    Btn_Chq_New.Enabled = True
    Btn_Chq_Edit.Enabled = True
End Sub

Public Sub Btn_Ver_ext()
    Call Btn_Ver_Click
End Sub

Private Sub Cmb_Agno_Click()
    Text10.Text = ""
    Text11.Text = ""
    Text12.Text = ""
    llena_info_adicional
    Btn_Ver_Click
End Sub

Private Sub Form_Load()
    Flag_Ins = False
    Flag_Edi = False
    Flag_sub = False
    Flag_Chq = False
    Flag_Mvt = False
    Text1.Text = ""
    Text2.Text = ""
    Text10.Text = ""
    Text11.Text = ""
    Text12.Text = ""
    Llena_Cmb_Agno
    Formato_Grid_Mvto_Solo
    Formato_Grid_Chq_Mvto_Ok
    Formato_Grid_Chq_Solo
    Limpia_Frame_Ing_Chq
End Sub

Private Sub Grid_Chq_Mvto_Ok_Click()
    'MsgBox Grid_Chq_Mvto_Ok.CellBackColor
    Dim i As Integer
    Limpia_Frame_Ing_Chq
    Llena_Frame_Chq_Edicion Val(Grid_Chq_Mvto_Ok.TextMatrix(Grid_Chq_Mvto_Ok.Row, 3))
    
    If Grid_Chq_Mvto_Ok.CellBackColor = &H80000005 Then
       lbl_estadocheque.ForeColor = &H0&
       lbl_estadocheque = "EN CARTERA"
    End If
    If Grid_Chq_Mvto_Ok.CellBackColor = &HFF00& Then
        lbl_estadocheque.ForeColor = &H8000&
        lbl_estadocheque = "COBRADO"
    End If
    If Grid_Chq_Mvto_Ok.CellBackColor = &H8080FF Then
        lbl_estadocheque.ForeColor = &HFF&
        lbl_estadocheque = "PROTESTADO"
    End If
    
End Sub

Private Sub Grid_Chq_Mvto_Ok_KeyPress(KeyAscii As Integer)
    Dim QRY As String
    Dim CMD As ADODB.Command
    Dim Row As Long
    Dim FolioChq As Long
    Dim FolioMvt As Long
    Dim Affected As Long
    
'    Dim var_sql As String
'    Dim objRS As ADODB.Recordset
'    Set objRS = New ADODB.Recordset
    
    If KeyAscii = 8 Then
        Row = Grid_Chq_Mvto_Ok.Row
        If Grid_Chq_Mvto_Ok.CellBackColor = 8421631 Then
            MsgBox "No se puede eliminar vinculo porque el cheque esta protestado", vbCritical
            Exit Sub
        End If
        If Grid_Chq_Mvto_Ok.CellBackColor = 65280 Then
            MsgBox "No se puede eliminar vinculo porque el cheque ya fue cobrado", vbCritical
            Exit Sub
        End If
        If Val(Grid_Chq_Mvto_Ok.TextMatrix(Row, 0)) > 0 Then
            ' pergunta de verificación
            If MsgBox("¿Está realmente seguro de querer eliminar el vinculo?", vbYesNo + vbExclamation, "Ratificar Eliminación") = vbNo Then
                Exit Sub
            End If
            ' borramos
            FolioChq = Grid_Chq_Mvto_Ok.TextMatrix(Row, 3)
            FolioMvt = Grid_Chq_Mvto_Ok.TextMatrix(Row, 2)
            Set CMD = New ADODB.Command
            CMD.ActiveConnection = conn
            CMD.CommandType = adCmdText
            QRY = "DELETE FROM fnza_chq_mvto WHERE folio_chq='" & FolioChq & "' AND folio_mvto='" & FolioMvt & "' LIMIT 1;"
            CMD.CommandText = QRY
            CMD.Execute Affected
            Btn_Ver_Click
        End If
    End If
    
End Sub

Private Sub Grid_Chq_Solo_Click()
    If Val(Grid_Chq_Solo.TextMatrix(Grid_Chq_Solo.Row, 0)) > 0 Then
        Flag_Chq = True
    Else
        Flag_Chq = False
    End If
    Habilita_vincular_chq
    Limpia_Frame_Ing_Chq
    Llena_Frame_Chq_Edicion Val(Grid_Chq_Solo.TextMatrix(Grid_Chq_Solo.Row, 2))
End Sub

Private Sub Grid_Chq_Solo_KeyPress(KeyAscii As Integer)
    Dim QRY As String
    Dim CMD As ADODB.Command
    Dim Row As Long
    Dim FolioChq As Long
    Dim Affected As Long
    
    If KeyAscii = 8 Then
        Row = Grid_Chq_Solo.Row
        If Val(Grid_Chq_Solo.TextMatrix(Row, 0)) > 0 Then
            ' pregunta de verificación
            If MsgBox("¿Está realmente seguro de querer eliminar el cheque?", vbYesNo + vbExclamation, "Ratificar Eliminación") = vbNo Then
                Exit Sub
            End If
            ' borramos
            FolioChq = Grid_Chq_Solo.TextMatrix(Row, 2)
            Set CMD = New ADODB.Command
            CMD.ActiveConnection = conn
            CMD.CommandType = adCmdText
            QRY = "DELETE FROM fnza_cheques_recibidos WHERE folio_chq='" & FolioChq & "' LIMIT 1;"
            CMD.CommandText = QRY
            CMD.Execute Affected
            Btn_Ver_Click
        End If
    End If
End Sub

Private Sub Grid_Mvto_Solo_Click()
    If Val(Grid_Mvto_Solo.TextMatrix(Grid_Mvto_Solo.Row, 0)) > 0 Then
        Flag_Mvt = True
    Else
        Flag_Mvt = False
    End If
    Habilita_vincular_chq
End Sub

Private Sub List1_DblClick()
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    
    Text1.Text = List1.Text
    List1.Visible = False
    List2.Visible = False
    RC.Open "SELECT ci_alu FROM postulantes WHERE left(CONCAT(ape_Pat_alu,' ',ape_Mat_alu,' ',nom_alu)," & Len(Text1.Text) & ")='" & Text1.Text & "' ORDER BY ape_pat_alu, ape_mat_alu, nom_alu;", conn
    RC.MoveFirst
    Flag_sub = True
    Text2.Text = RC("ci_alu")
    RC.Close
    Flag_sub = False
    Text1.Locked = True
    Text2.Locked = True
    llena_info_adicional
End Sub

Private Sub List2_DblClick()
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    
    Text2.Text = List2.Text
    List2.Visible = False
    List1.Visible = False
    RC.Open "SELECT CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu FROM postulantes WHERE ci_alu='" & Text2.Text & "' ORDER BY ci_alu;", conn
    RC.MoveFirst
    Flag_sub = True
    Text1.Text = RC("nombre_alu")
    RC.Close
    Flag_sub = False
    Text1.Locked = True
    Text2.Locked = True
    llena_info_adicional
End Sub

Private Sub Text1_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If Text1.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    RC.Open "SELECT DISTINCT a.ape_pat_alu, a.ape_mat_alu, a.nom_alu FROM postulantes a, matriculas m WHERE left(CONCAT(a.ape_pat_alu,' ',a.ape_mat_alu,' ',a.nom_alu)," & Len(Text1.Text) & ")='" & Text1.Text & "' AND a.ci_alu=m.ci_alu ORDER BY a.ape_pat_alu, a.ape_mat_alu, a.nom_alu;", conn
    List1.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            List1.AddItem RC("ape_pat_alu") & " " & RC("ape_mat_alu") & " " & RC("nom_alu")
            RC.MoveNext
        Wend
        List1.Visible = True
        List2.Visible = False
    End If
    RC.Close
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub



Private Sub Text2_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If Text2.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    
    RC.Open "SELECT DISTINCT a.ci_alu FROM postulantes a, matriculas m WHERE left(a.ci_alu," & Len(Text2.Text) & ")='" & Text2.Text & "' AND a.ci_alu=m.ci_alu ORDER BY a.ci_alu;", conn
    List2.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            List2.AddItem RC("ci_alu")
            RC.MoveNext
        Wend
        List1.Visible = False
        List2.Visible = True
    End If
    RC.Close
    'Btn_Ver_Alumno.Enabled = False
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Private Sub Llena_Cmb_Agno()
    Dim AgnoFin As Integer
    'Cmb_Agno.Text = ""
    AgnoFin = IIf(Year(Date) < 2005, 2005, Year(Date))
    For i = 1 To (AgnoFin - 2003)
        cmb_agno.AddItem str(2004 + i)
    Next i
    cmb_agno.ListIndex = cmb_agno.ListCount - 2
End Sub

Private Sub Formato_Grid_Mvto_Solo()
    ' Formato de Movimientos de cheques sin cheques registrados
    Grid_Mvto_Solo.Clear
    Grid_Mvto_Solo.Rows = 2
    Grid_Mvto_Solo.FormatString = "^Nº|>folio_mvto|>run_alu|^Vencimiento|>Monto|^Fecha Pago"
    Grid_Mvto_Solo.ColWidth(1) = 0
    Grid_Mvto_Solo.ColWidth(2) = 0
    Grid_Mvto_Solo.ColWidth(4) = 630
End Sub

Private Sub Formato_Grid_Chq_Mvto_Ok()
    ' Formato de Movimientos de cheques Con cheques registrados
    Grid_Chq_Mvto_Ok.Clear
    Grid_Chq_Mvto_Ok.Rows = 2
    Grid_Chq_Mvto_Ok.FormatString = ">Nº|>run_alu|>folio_mvto|>folio_chq|^Vencimiento|>Monto|>Serie-Nº Chq.|>Run Apo"
    Grid_Chq_Mvto_Ok.ColWidth(1) = 0
    Grid_Chq_Mvto_Ok.ColWidth(2) = 0
    Grid_Chq_Mvto_Ok.ColWidth(3) = 0
    Grid_Chq_Mvto_Ok.ColWidth(5) = 630
    Grid_Chq_Mvto_Ok.ColWidth(7) = 0
End Sub

Private Sub Formato_Grid_Chq_Solo()
    ' Formato de cheques sin movimientos asociados
    Grid_Chq_Solo.Clear
    Grid_Chq_Solo.Rows = 2
    Grid_Chq_Solo.FormatString = ">Nº|>run_apo|>folio_chq|>Cta. Cte.|>Serie|>Número|>Banco|>Monto|>Asignado"
    Grid_Chq_Solo.ColWidth(1) = 0
    Grid_Chq_Solo.ColWidth(2) = 0
    Grid_Chq_Solo.ColWidth(3) = 1100
    Grid_Chq_Solo.ColWidth(4) = 800
    Grid_Chq_Solo.ColWidth(7) = 630
    
End Sub

Private Sub LLena_Grid_Mvto_Solo(ByVal RunAlu As String, ByVal agno As Integer)
    ' Llenar Movimientos de cheques sin cheques registrados
    Dim QRY As String
    Dim REC As ADODB.Recordset
    
    Formato_Grid_Mvto_Solo
    Set REC = New ADODB.Recordset
    QRY = "SELECT d.folio_mvto,d.run_alu,d.fech_venc_cptos,d.monto_pago,d.fech_pago FROM (SELECT fdm.run_alu, fmm.* FROM fnza_movimientos_mensualidad as fmm, fnza_dtll_mvto as mv, fnza_detalle_mensualidad as fdm  WHERE fmm.tipo_pago='chqe' AND fmm.estado_pago<>'nula' AND mv.folio_mvto=fmm.folio_mvto AND mv.folio_dtll=fdm.folio_dtll) as d LEFT JOIN fnza_chq_mvto as fcm ON d.folio_mvto=fcm.folio_mvto WHERE d.run_alu='" & RunAlu & "' AND YEAR(d.fech_venc_cptos)=" & agno & " AND fcm.folio_mvto is null;"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        For i = 1 To REC.RecordCount
            Grid_Mvto_Solo.AddItem i & Chr(9) & REC!folio_mvto & Chr(9) & REC!run_alu & Chr(9) & REC!fech_venc_cptos & Chr(9) & REC!Monto_Pago & Chr(9) & REC!fech_pago, i
            REC.MoveNext
        Next i
        Grid_Mvto_Solo.Row = i
        Grid_Mvto_Solo.RowSel = i
        Flag_Mvt = False
        Habilita_vincular_chq
    End If
    REC.Close
    
End Sub

Private Sub LLena_Grid_Chq_Mvto_Ok(ByVal RunAlu As String, ByVal agno As Integer)
    ' Llenar Movimientos de cheques Con cheques registrados
    Dim QRY As String
    Dim REC As ADODB.Recordset
       
    Formato_Grid_Chq_Mvto_Ok
    Set REC = New ADODB.Recordset
    'Relacionado con Run_Apo, Run_alu
    QRY = "SELECT estado_chq,fcr.run_apo, fcm.run_alu, fmm.folio_mvto, fcr.folio_chq, fmm.fech_venc_cptos, fmm.monto_pago, concat(fcr.chq_serie,' ',fcr.chq_numero) as numero_serie FROM fnza_chq_mvto as fcm, fnza_movimientos_mensualidad fmm, fnza_cheques_recibidos as fcr WHERE fcm.folio_mvto=fmm.folio_mvto AND fcm.folio_chq=fcr.folio_chq AND fcm.run_alu='" & RunAlu & "' AND YEAR(fmm.fech_venc_cptos)=" & agno & ";"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        For i = 1 To REC.RecordCount
            Grid_Chq_Mvto_Ok.AddItem i & Chr(9) & REC!run_alu & Chr(9) & REC!folio_mvto & Chr(9) & REC!folio_chq & Chr(9) & REC!fech_venc_cptos & Chr(9) & REC!Monto_Pago & Chr(9) & REC!numero_Serie & Chr(9) & REC!run_apo, i
            REC.MoveNext
        Next i
        Grid_Chq_Mvto_Ok.Row = i
        Grid_Chq_Mvto_Ok.RowSel = i
    End If
    REC.Close
End Sub

Private Sub LLena_Grid_Chq_Solo(ByVal RunApo As String, ByVal agno As Integer)
    ' Llenar cheques sin movimientos asociados
    Dim QRY As String
    Dim REC As ADODB.Recordset
    
    Formato_Grid_Chq_Solo
    Set REC = New ADODB.Recordset
    'Busca por apoderado en Fnza_chq_recibido
    QRY = "(SELECT fcr.run_apo, fcr.folio_chq, fcr.cta_cte, fcr.chq_serie, fcr.chq_numero, fcr.banco, fcr.monto_chq, (0) as 'asignado', fcr.chq_fecha FROM fnza_cheques_recibidos as fcr LEFT JOIN fnza_chq_mvto as fcm ON fcr.folio_chq=fcm.folio_chq WHERE fcr.run_apo='" & RunApo & "' AND fcm.folio_chq is null ) UNION (SELECT d.* FROM (SELECT fcr.run_apo, fcr.folio_chq, fcr.cta_cte, fcr.chq_serie, fcr.chq_numero, fcr.banco,if(sum(fmm.monto_pago) > 0,sum(fmm.monto_pago),fcr.monto_chq) as monto_chq, sum(fmm.monto_pago) as 'asignado', fcr.chq_fecha FROM fnza_cheques_recibidos as fcr, fnza_chq_mvto as fcm, fnza_movimientos_mensualidad as fmm WHERE fcm.folio_chq=fcr.folio_chq AND fcm.folio_mvto=fmm.folio_mvto AND fcr.run_apo='" & RunApo & "' GROUP BY fcr.folio_chq, fcr.run_apo) as d WHERE d.monto_chq>d.asignado) ORDER BY folio_chq, run_apo;"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        For i = 1 To REC.RecordCount
            Grid_Chq_Solo.AddItem i & Chr(9) & REC!run_apo & Chr(9) & REC!folio_chq & Chr(9) & REC!cta_cte & Chr(9) & REC!chq_serie & Chr(9) & REC!chq_numero & Chr(9) & REC!Banco & Chr(9) & REC!monto_chq & Chr(9) & REC!asignado, i
            Grid_Chq_Solo.Row = i
            Grid_Chq_Solo.RowSel = i
            Grid_Chq_Solo.Col = 1
            Grid_Chq_Solo.ColSel = (Grid_Chq_Solo.Cols - 1)
            If Val(REC!asignado) > 0 Then
                Grid_Chq_Solo.CellBackColor = &HC0FFFF
            Else
                Grid_Chq_Solo.CellBackColor = &HFFFFFF
            End If
            REC.MoveNext
            Flag_Chq = False
            Habilita_vincular_chq
        Next i
        Grid_Chq_Solo.Row = i
        Grid_Chq_Solo.RowSel = i
    End If
    REC.Close
End Sub

Private Sub Limpia_Frame_Ing_Chq()
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    Text6.Text = ""
    Text7.Text = ""
    Text8.Text = ""
    Text9.Text = ""
    Text13.Text = ""
    Text14.Text = ""
    LB_Folio_chq.Caption = ""
    DTPicker1.Value = Date
    Llena_combo_bancos
End Sub

Private Sub Llena_combo_bancos()
    Dim QRY As String
    Dim REC As ADODB.Recordset
    
    Set REC = New ADODB.Recordset
    QRY = "SELECT * FROM fnza_cod_banco;"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        ICmb_Banco.ComboItems.Clear
        For i = 1 To REC.RecordCount
            ICmb_Banco.ComboItems.Add i, "B" & REC!Banco, REC!descripcion
            REC.MoveNext
        Next i
    End If
    REC.Close
    Set ICmb_Banco.SelectedItem = ICmb_Banco.ComboItems.Item(6)
End Sub

Private Sub Llena_Frame_Chq_Edicion(ByVal FolioChq As Long)
    Dim QRY As String
    Dim REC As ADODB.Recordset
    
    Set REC = New ADODB.Recordset
    QRY = "Select fcr.*, concat(a.ape1_apo,' ',a.ape2_apo,' ',a.noms_apo) as nom_apo From fnza_cheques_recibidos as fcr, apoderados as a WHERE fcr.folio_chq=" & FolioChq & " AND fcr.run_apo=a.rut_apo LIMIT 1;"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        LB_Folio_chq.Caption = FolioChq
        Text13.Text = REC!nom_apo
        Text14.Text = REC!run_apo
        Text3.Text = REC!nom_titular
        Text4.Text = REC!run_titular
        Text5.Text = REC!tel_titular
        Text6.Text = REC!monto_chq
        Text7.Text = REC!cta_cte
        Text8.Text = REC!chq_serie
        Text9.Text = REC!chq_numero
        DTPicker1.Value = REC!chq_fecha
        Set ICmb_Banco.SelectedItem = ICmb_Banco.ComboItems.Item("B" & REC!Banco)
        ICmb_Banco.Refresh
    End If
    REC.Close
    
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
    ' solo mayusculas
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
    ' Sólo numeros y borrar
    If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or KeyAscii = 8) Then KeyAscii = 0
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
    ' Sólo numeros y borrar y "-"
    If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or KeyAscii = 8 Or Chr(KeyAscii) = "-") Then KeyAscii = 0
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
    ' Sólo numeros y borrar y "-"
    If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or KeyAscii = 8 Or Chr(KeyAscii) = "-") Then KeyAscii = 0
End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)
    ' Sólo numeros y borrar y "-"
    If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or KeyAscii = 8 Or Chr(KeyAscii) = "-") Then KeyAscii = 0
End Sub

Public Sub llena_info_adicional()
    Dim QRY As String
    Dim REC As ADODB.Recordset
    Set REC = New ADODB.Recordset
    QRY = "SELECT nombre FROM (select colegio from fnza_detalle_mensualidad WHERE run_alu='" & Text2.Text & "' and agno=" & cmb_agno.Text & " ORDER BY fech_venc DESC LIMIT 1) as d, hist_cod_colegio as hcc WHERE hcc.colegio=d.colegio;"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        Text10.Text = REC!nombre
    End If
    REC.Close
    QRY = "SELECT concat(a.ape1_apo,' ',a.ape2_apo,' ',a.noms_apo) as 'nombre', a.rut_apo FROM apo_x_alu as axa, apoderados as a WHERE axa.ci_alu='" & Text2.Text & "' AND axa.rut_apo=a.rut_apo AND axa.agno=" & cmb_agno.Text & ";"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        Text11.Text = REC!nombre
        Text12.Text = REC!rut_apo
    End If
    REC.Close
End Sub

Private Sub Habilita_vincular_chq()
    If Flag_Chq And Flag_Mvt Then
        Btn_Chq_Link.Enabled = True
    Else
        Btn_Chq_Link.Enabled = False
    End If
End Sub

Public Sub marca_grilla()
    Exit Sub
'    Dim i, j As Integer
'    Dim Fecha As Date
'    Dim var_sql As String
'    Dim objRS As ADODB.Recordset
'    Set objRS = New ADODB.Recordset
'
'    Grid_Chq_Mvto_Ok.Row = 1
'    var_sql = "SELECT date_format(date_add(current_date, interval 1 day),'%Y-%m-%d');"
'    objRS.Open var_sql, conn
'    If Not objRS.EOF Then
'        Date = objRS.Fields(0)
'    End If
'    objRS.Close
'
'    For i = 1 To Grid_Chq_Mvto_Ok.Rows - 2
'
'        Grid_Chq_Mvto_Ok.Row = i
'        Grid_Chq_Mvto_Ok.Col = 3
'        'MsgBox Grid_Chq_Mvto_Ok.Text
'
'        var_sql = "select chq_fecha,estado_cobro from fnza_chq_mvto fcm,fnza_cheques_recibidos fcr" _
'                & " where fcm.folio_chq = fcr.folio_chq" _
'                & " and fcm.folio_chq = " & Grid_Chq_Mvto_Ok.Text _
'                & " group by fcm.folio_chq"
'        objRS.Open var_sql, conn
'
'            If Not objRS.EOF Then
'
'                If Format(Date, "yyyy-mm-dd") > Format(objRS("chq_fecha"), "yyyy-mm-dd") Then
'                    For j = 1 To Grid_Chq_Mvto_Ok.Cols - 1
'                        Grid_Chq_Mvto_Ok.Col = j
'                        Grid_Chq_Mvto_Ok.CellBackColor = &HFF00&
'                    Next j
'                End If
'
'                If objRS("estado_cobro") = "prto" Then
'                    For j = 1 To Grid_Chq_Mvto_Ok.Cols - 1
'                        Grid_Chq_Mvto_Ok.Col = j
'                        Grid_Chq_Mvto_Ok.CellBackColor = &H8080FF
'                    Next j
'                End If
'            End If
'
'        objRS.Close
'    Next i
End Sub
