VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Form_listafichabecas 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Fichas ingresadas postulacion a Becas"
   ClientHeight    =   8910
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   12300
   Icon            =   "Form_listafichabecas.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   8910
   ScaleWidth      =   12300
   Begin VB.Frame Frame10 
      Caption         =   "Sub Tipo Beca"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1335
      Left            =   2520
      TabIndex        =   54
      Top             =   120
      Width           =   2295
      Begin VB.OptionButton Option2 
         Caption         =   "Todos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   120
         TabIndex        =   58
         Top             =   960
         Value           =   -1  'True
         Width           =   1455
      End
      Begin VB.OptionButton rbtndepor 
         Caption         =   "Excelencia Deportiva"
         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        =   57
         Top             =   720
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.OptionButton rbtnfuncio 
         Caption         =   "Funcionario"
         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        =   56
         Top             =   240
         Width           =   2055
      End
      Begin VB.OptionButton Option1 
         Caption         =   "Excelencia Academica"
         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        =   55
         Top             =   480
         Visible         =   0   'False
         Width           =   2055
      End
   End
   Begin VB.Frame Frame9 
      Caption         =   "Imprimir Libro de Recepción"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   6840
      TabIndex        =   47
      Top             =   7800
      Width           =   5295
      Begin VB.OptionButton opt1 
         Caption         =   "Pantalla"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   360
         TabIndex        =   50
         Top             =   240
         Value           =   -1  'True
         Width           =   975
      End
      Begin VB.OptionButton opt2 
         Caption         =   "Impresora"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   360
         TabIndex        =   49
         Top             =   600
         Width           =   1095
      End
      Begin VB.CommandButton Command3 
         Caption         =   "Imprimir"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1920
         TabIndex        =   48
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label9 
         Caption         =   "Label9"
         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        =   51
         Top             =   360
         Visible         =   0   'False
         Width           =   855
      End
   End
   Begin VB.Frame Frame8 
      Caption         =   "Enviar Comunicado"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   120
      TabIndex        =   41
      Top             =   7800
      Width           =   6615
      Begin VB.OptionButton optpant 
         Caption         =   "Pantalla"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3720
         TabIndex        =   46
         Top             =   240
         Value           =   -1  'True
         Width           =   975
      End
      Begin VB.OptionButton optimp 
         Caption         =   "Impresora"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3720
         TabIndex        =   45
         Top             =   480
         Width           =   1095
      End
      Begin VB.CommandButton Command2 
         Caption         =   "Imprimir"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   5280
         TabIndex        =   44
         Top             =   480
         Width           =   1215
      End
      Begin MSComCtl2.DTPicker dtcomunicado 
         Height          =   300
         Left            =   2040
         TabIndex        =   42
         Top             =   360
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _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          =   266010625
         CurrentDate     =   40851
      End
      Begin VB.Label Label8 
         Caption         =   "Fecha de Presentación:"
         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        =   43
         Top             =   360
         Width           =   1815
      End
   End
   Begin VB.CheckBox chkcurso 
      Height          =   375
      Left            =   5160
      TabIndex        =   39
      Top             =   360
      Width           =   255
   End
   Begin VB.Frame Frame7 
      Caption         =   "Curso"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1335
      Left            =   4920
      TabIndex        =   32
      Top             =   120
      Width           =   7215
      Begin VB.ComboBox Cmb_Let_Cur 
         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          =   330
         Left            =   5880
         Style           =   2  'Dropdown List
         TabIndex        =   35
         Top             =   840
         Width           =   1215
      End
      Begin VB.ComboBox Cmb_Grado 
         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          =   330
         Left            =   3240
         Style           =   2  'Dropdown List
         TabIndex        =   34
         Top             =   840
         Width           =   1215
      End
      Begin VB.ComboBox Cmb_Cod_ens 
         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          =   330
         Left            =   3240
         Style           =   2  'Dropdown List
         TabIndex        =   33
         Top             =   360
         Width           =   3795
      End
      Begin VB.Label Label7 
         Caption         =   "Mostrar por curso"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   40
         Top             =   600
         Width           =   1455
      End
      Begin VB.Label Tipo 
         Caption         =   "Tipo de enseñanza"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   1680
         TabIndex        =   38
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label Label6 
         Caption         =   "Grado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   1680
         TabIndex        =   37
         Top             =   840
         Width           =   495
      End
      Begin VB.Label Label5 
         Caption         =   "Letra Curso"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   4800
         TabIndex        =   36
         Top             =   720
         Width           =   1095
      End
   End
   Begin VB.Frame Frame6 
      Caption         =   "Mostrar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   120
      TabIndex        =   28
      Top             =   1440
      Width           =   4695
      Begin VB.OptionButton rbtnall 
         Caption         =   "Todos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3240
         TabIndex        =   31
         Top             =   360
         Value           =   -1  'True
         Width           =   855
      End
      Begin VB.OptionButton rbtnsin 
         Caption         =   "Sin Beca"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1800
         TabIndex        =   30
         Top             =   360
         Width           =   975
      End
      Begin VB.OptionButton rbtncon 
         Caption         =   "Con Beca"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   29
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.Frame Frame5 
      Caption         =   "Tipo Beca"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1335
      Left            =   120
      TabIndex        =   25
      Top             =   120
      Width           =   2295
      Begin VB.OptionButton rbtnsociovul 
         Caption         =   "Socioeconómica Vulne"
         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        =   59
         Top             =   600
         Width           =   2055
      End
      Begin VB.OptionButton rbtnsocio 
         Caption         =   "Socioeconómica"
         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        =   27
         Top             =   360
         Value           =   -1  'True
         Width           =   1695
      End
      Begin VB.OptionButton rbtnacademina 
         Caption         =   "Libre Disponibilidad"
         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        =   26
         Top             =   840
         Width           =   2055
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "Resumen"
      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        =   15
      Top             =   6600
      Width           =   2295
      Begin VB.Label lb0 
         Height          =   255
         Left            =   1200
         TabIndex        =   24
         Top             =   720
         Width           =   735
      End
      Begin VB.Label lb100 
         Height          =   255
         Left            =   1200
         TabIndex        =   23
         Top             =   240
         Width           =   735
      End
      Begin VB.Label lb50 
         Height          =   255
         Left            =   1200
         TabIndex        =   22
         Top             =   480
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   ":"
         Height          =   255
         Left            =   960
         TabIndex        =   21
         Top             =   720
         Width           =   255
      End
      Begin VB.Label Label2 
         Caption         =   ":"
         Height          =   255
         Left            =   960
         TabIndex        =   20
         Top             =   240
         Width           =   255
      End
      Begin VB.Label Label1 
         Caption         =   ":"
         Height          =   255
         Left            =   960
         TabIndex        =   19
         Top             =   480
         Width           =   255
      End
      Begin VB.Label lbltotsin 
         Caption         =   "Ninguna"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   18
         Top             =   720
         Width           =   735
      End
      Begin VB.Label lbltotmedia 
         Caption         =   "50%"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   17
         Top             =   480
         Width           =   735
      End
      Begin VB.Label lbtotcomp 
         Caption         =   "100% "
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   16
         Top             =   240
         Width           =   735
      End
   End
   Begin VB.Frame Frame4 
      Caption         =   "Imprimir"
      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            =   4920
      TabIndex        =   9
      Top             =   6600
      Width           =   3375
      Begin VB.OptionButton OptDesImp 
         Caption         =   "Impresora"
         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        =   12
         Top             =   600
         Width           =   1095
      End
      Begin VB.OptionButton OptDesPan 
         Caption         =   "Pantalla"
         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        =   11
         Top             =   240
         Value           =   -1  'True
         Width           =   975
      End
      Begin VB.CommandButton BtnImprimit 
         Caption         =   "Imprimir"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   10
         Top             =   600
         Width           =   1215
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Asignar Beca"
      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            =   8400
      TabIndex        =   6
      Top             =   6600
      Width           =   3735
      Begin VB.CommandButton BtnAsignbeca 
         Caption         =   "Asignar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2520
         TabIndex        =   8
         Top             =   600
         Width           =   1095
      End
      Begin VB.ComboBox CmbBeca 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   120
         TabIndex        =   7
         Top             =   360
         Width           =   1815
      End
   End
   Begin VB.CommandButton BtnRecalcula 
      Caption         =   "Recalcular Puntaje"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   10440
      TabIndex        =   4
      Top             =   1560
      Width           =   1695
   End
   Begin VB.CommandButton BtnSalir 
      Caption         =   "Salir"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   10440
      TabIndex        =   3
      Top             =   2040
      Width           =   1695
   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            =   9240
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   1800
      Width           =   855
   End
   Begin MSFlexGridLib.MSFlexGrid grd_tabla_pagos 
      Height          =   3615
      Left            =   120
      TabIndex        =   0
      Top             =   2520
      Width           =   12000
      _ExtentX        =   21167
      _ExtentY        =   6376
      _Version        =   393216
      Cols            =   5
      FixedCols       =   0
      BackColor       =   16777215
      SelectionMode   =   1
      FormatString    =   "^Nombre Alumno|^Rut|^Pnt. notas|^Pnt. Socioeconomico|^Beca"
      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
   End
   Begin VB.Frame Frame2 
      Caption         =   "Acciones"
      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            =   2520
      TabIndex        =   13
      Top             =   6600
      Width           =   2295
      Begin VB.CommandButton Command1 
         Caption         =   "Eliminar Registro"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   360
         TabIndex        =   14
         Top             =   360
         Width           =   1575
      End
   End
   Begin MSComctlLib.ProgressBar pgtotal 
      Height          =   375
      Left            =   120
      TabIndex        =   5
      Top             =   6120
      Visible         =   0   'False
      Width           =   12015
      _ExtentX        =   21193
      _ExtentY        =   661
      _Version        =   393216
      Appearance      =   1
      Min             =   1e-4
      Scrolling       =   1
   End
   Begin VB.Label Label10 
      Caption         =   "Alumno Sin Problemas"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   1
      Left            =   5400
      TabIndex        =   53
      Top             =   1560
      Width           =   2295
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H000000FF&
      BackStyle       =   1  'Opaque
      FillColor       =   &H000000FF&
      Height          =   255
      Index           =   0
      Left            =   5040
      Shape           =   1  'Square
      Top             =   2040
      Width           =   255
   End
   Begin VB.Label Label10 
      Caption         =   "Alumno con Renuncia a Reserva"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   0
      Left            =   5400
      TabIndex        =   52
      Top             =   2040
      Width           =   2415
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      FillColor       =   &H000000FF&
      Height          =   255
      Index           =   1
      Left            =   5040
      Shape           =   1  'Square
      Top             =   1560
      Width           =   255
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      Caption         =   "Año Beca:"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   8160
      TabIndex        =   2
      Top             =   1800
      Width           =   855
   End
End
Attribute VB_Name = "Form_listafichabecas"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim swfuncion As Boolean

Private Sub Llena_Cmb_Agno()
    Dim AgnoFin As Integer
    AgnoFin = IIf(Anno < 2005, 2005, Anno + 1)
    For i = AgnoFin To 2005 Step -1
        Cmb_Agno.AddItem str(i)
    Next i
    Cmb_Agno.ListIndex = Cmb_Agno.ListCount - 1
End Sub

Private Sub BtnAsignbeca_Click()
    Dim CantidadAsignada As String
    Dim RsDa As ADODB.Recordset
    Set RsDa = New ADODB.Recordset
    If (grd_tabla_pagos.RowSel > 0) Then
        If (CmbBeca.Text = "0" Or CmbBeca.Text = "100%" Or CmbBeca.Text = "50%") Then
            Rutalu = grd_tabla_pagos.TextMatrix(grd_tabla_pagos.RowSel, 1)
            Reserva = devuelvecampo("matriculas", "", "reserva", "ci_alu = '" & Rutalu & "' AND anno_mat = " & CStr(CInt(Cmb_Agno.Text) - 1) & " ", conn)
            RsDa.Open "SELECT CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu FROM postulantes WHERE ci_alu='" & Rutalu & "' ORDER BY ci_alu;", conn
            RsDa.MoveFirst
            If Reserva = 2 Then
                For k = 0 To 4
                    grd_tabla_pagos.Col = k
                    grd_tabla_pagos.CellBackColor = &HFF
                Next k
                MsgBox ("El Alumno " & RsDa("nombre_alu") & ", Rut :" & Rutalu & ", se encuentra en estado de renuncia de matricula")
            End If
            RsDa.Close
            CantidadAsignada = "0"
            If (CmbBeca.Text = "100%") Then
                CantidadAsignada = "100"
            End If
            If (CmbBeca.Text = "50%") Then
                CantidadAsignada = "50"
            End If
            sql = "UPDATE becas_fichas SET asignada = " & CantidadAsignada & " WHERE ci_alumno = '" & Rutalu & "' AND agno = " & Cmb_Agno.Text
            Resp = MsgBox("Esta seguro que desea asignar una beca a " & grd_tabla_pagos.TextMatrix(grd_tabla_pagos.RowSel, 0) & ", cubriendo el " & CmbBeca.Text & " de la totalidad de la mensualidad??", vbYesNo + vbQuestion)
            If (Resp = 6) Then
                conn.Execute sql, Affected
                If Affected > 0 Then
                    ' Insertar Log de modificación de tipo de pago de Alumno.
                    sql = "CREATE TABLE IF NOT EXISTS `becas_log`(`id` bigint(20) NOT NULL auto_increment,`LOGIN_USUARIO` varchar(100) NOT NULL default '',`NOMBRE_USUARIO` varchar(100) NOT NULL default '',`RUN_ALU` varchar(10) NOT NULL default '',`AGNO` int(11) NOT NULL default '0',`ASIGNADO` decimal(10,0) NOT NULL default '0',`ACCION` varchar(100) NOT NULL default '',`FECHA_MODIFICACION` datetime NOT NULL default '0000-00-00 00:00:00',PRIMARY KEY  (`id`),UNIQUE KEY `becas_log_sec_key` (`FECHA_MODIFICACION`,`LOGIN_USUARIO`),KEY `becas_log_index_one` (`RUN_ALU`,`AGNO`)) ENGINE=MyISAM;"
                    conn.Execute sql
                    sql = "INSERT INTO becas_log(LOGIN_USUARIO,NOMBRE_USUARIO,RUN_ALU,AGNO,FECHA_MODIFICACION,ACCION,ASIGNADO) VALUES ('" & Nom_usu_ses & "','" & Nom_com_usu_ses & "','" & Trim(Rutalu) & "','" & Cmb_Agno.Text & "',concat(current_date,' ',current_time),'ASIGNAR'," & CantidadAsignada & ");"
                    conn.Execute sql
                End If
                
                
                LlenaGrilla
            End If
        Else
            MsgBox "Debe Seleccionar la cantidad a cubrir"
        End If
    Else
        MsgBox "Debe seleccionar un alumno para asignar Beca"
    End If
    
End Sub

Private Sub BtnImprimit_Click()
'***********************************************************************
'* Guarda matriz en base de datos temporal GesTem.mdb en el directorio *
'* de la aplicacion                                                    *
'***********************************************************************

If Me.OptDesPan.Value = True Then Form_main.CrystalReport.Destination = crptToWindow
If Me.OptDesImp.Value = True Then Form_main.CrystalReport.Destination = crptToPrinter

Call CreaBD(DirAplicacion & "\GesTemp.mdb")
Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "becas1", "19,10")
Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "becas2", "19,10")
Dim dbsTemp As Database
Dim rsTemp As Recordset
Dim EntrA As Boolean
Dim CamposInsert, ValoresInsert As String
Set dbsTemp = OpenDatabase(DirAplicacion & "\GesTemp.mdb")
Set rsTemp = dbsTemp.OpenRecordset("becas1", dbOpenDynaset)

grd_tabla_pagos.Col = 0
grd_tabla_pagos.Row = 0

ValoresInsert = ""
CamposInsert = ""
For i = 0 To Me.grd_tabla_pagos.Cols - 1
    CamposInsert = CamposInsert & "C" & i + 1 & ", "
    ValoresInsert = ValoresInsert & "'" & Me.grd_tabla_pagos.TextMatrix(0, i) & "', "
Next i
For nul = 1 To 18 - i - 1
    CamposInsert = CamposInsert & "C" & i + nul & ", "
    contenido = "Null" & ", "
    ValoresInsert = ValoresInsert & contenido
Next nul
CamposInsert = CamposInsert & "C" & i + nul & ", "
ValoresInsert = ValoresInsert & contenido


CamposInsert = "(" & Mid(CamposInsert, 1, Len(CamposInsert) - 2) & ")"
ValoresInsert = "(" & Mid(ValoresInsert, 1, Len(ValoresInsert) - 2) & ")"
dbsTemp.Execute "INSERT INTO becas2" & CamposInsert & "values" & ValoresInsert


ValoresInsert = ""
For f = 1 To Me.grd_tabla_pagos.Rows - 1
        ValoresInsert = ""
        EntrA = True
        If EntrA Then
        '***********
            For i = 1 To Me.grd_tabla_pagos.Cols - 1
                If Val(Me.grd_tabla_pagos.TextMatrix(f, i)) = 0 Then
                    contenido = "Null" & ", "
                Else
                    contenido = "'" & Me.grd_tabla_pagos.TextMatrix(f, i) & "', "
                End If
                ValoresInsert = ValoresInsert & contenido
            Next i
    
            For nul = 1 To 18 - i - 1
                contenido = "Null" & ", "
                ValoresInsert = ValoresInsert & contenido
            Next nul
    
    
            ValoresInsert = ValoresInsert & contenido
            nombre = Me.grd_tabla_pagos.TextMatrix(f, 0)
            ValoresInsert = "'" & nombre & "', " & ValoresInsert
            ValoresInsert = "(" & Mid(ValoresInsert, 1, Len(ValoresInsert) - 2) & ")"
    
    
            dbsTemp.Execute "INSERT INTO becas1" & CamposInsert & " values" & Trim(ValoresInsert)
        End If
Next f
Set dbsTemp = Nothing
GenRep

End Sub

Private Sub BtnRecalcula_Click()
    pntrecalcular
    LlenaGrilla
End Sub

Private Sub BtnSalir_Click()
    Unload Me
End Sub

Private Sub chkcurso_Click()
    If chkcurso.Value = 1 Then
        rbtnsin.Enabled = False
        rbtncon.Enabled = False
        rbtnall.Enabled = False
        rbtnacademina.Enabled = False
        rbtnsocio.Enabled = False
        rbtndepor.Enabled = False
        rbtnfuncio.Enabled = False
        
        Cmb_Cod_ens.Enabled = True
        Cmb_Grado.Enabled = False
        Cmb_Grado.Clear
        Cmb_let_cur.Clear
        Cmb_let_cur.Enabled = False
        Me.grd_tabla_pagos.Rows = 1
        Cmb_Cod_ens_Click
    Else
        rbtnsin.Enabled = True
        rbtncon.Enabled = True
        rbtnall.Enabled = True
        rbtnacademina.Enabled = True
        rbtnsocio.Enabled = True
        Cmb_Grado.Enabled = False
        Cmb_Cod_ens.Enabled = False
        Cmb_let_cur.Enabled = False
        rbtndepor.Enabled = True
        rbtnfuncio.Enabled = True
        Cmb_Grado.Clear
        Cmb_let_cur.Clear
        LlenaGrilla
    End If
End Sub

Private Sub Cmb_Agno_Click()
    If chkcurso.Value = 1 Then
        Cmb_Cod_ens_Click
    Else
        LlenaGrilla
    End If
End Sub

Private Sub Cmb_Cod_ens_Click()
    If Len(Me.Cmb_Cod_ens) <> 0 Then
        Cmb_Grado.Enabled = True
        Cmb_Grado.Clear
        If Len(Me.Cmb_Cod_ens.Text) <> 0 Then
            nivel = devuelvecampo("codigos_ensenanza", "des_ens", "num_gra_max", "des_ens = " & "'" & Me.Cmb_Cod_ens.Text & "'", conn)
            Me.Cmb_Grado.Enabled = True
            Me.Cmb_Grado.Clear
            For t = 1 To Val(nivel)
                Me.Cmb_Grado.AddItem t
            Next t
        End If
        Cmb_let_cur.Clear
        Cmb_Grado.ListIndex = 0
        Cmb_Grado_Click
    End If
End Sub

Private Sub Cmb_Grado_Click()
On Error GoTo continua:
    Ngrado = Me.Cmb_Grado.Text
    CodModalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.Cmb_Cod_ens.Text & "'", conn)
    Cmb_let_cur.Clear
    Call llenacombo(Me.Cmb_let_cur, "cursos", "let_cur", "where cod_ens = '" & CodModalidad & "' and num_gra = '" & Ngrado & "' and agno = " & Anno, conn)
    Me.Cmb_let_cur.Enabled = True
    Cmb_let_cur.ListIndex = 0
    Me.grd_tabla_pagos.Rows = 1
    Cmb_let_cur_Click
    Exit Sub
continua:
    MsgBox Err.Description & vbCrLf & vbCrLf & Err.Source, vbCritical + vbOKOnly, Err.Number
    Resume
End Sub

Private Sub Cmb_let_cur_Click()
    LlenaGrilla
End Sub

Private Sub Command1_Click()
    If (grd_tabla_pagos.RowSel > 0) Then
            Rutalu = grd_tabla_pagos.TextMatrix(grd_tabla_pagos.RowSel, 1)
            sql = "DELETE FROM becas_fichas WHERE ci_alumno = '" & Rutalu & "' AND agno = " & Cmb_Agno.Text
            Resp = MsgBox("Esta seguro que desea eliminar a " & grd_tabla_pagos.TextMatrix(grd_tabla_pagos.RowSel, 0) & ", de la lista de postulantes a beca?", vbYesNo + vbQuestion)
            If (Resp = 6) Then
                conn.Execute sql, Affected
                If Affected > 0 Then
                    ' Insertar Log de modificación de tipo de pago de Alumno.
                    sql = "CREATE TABLE IF NOT EXISTS `becas_log`(`id` bigint(20) NOT NULL auto_increment,`LOGIN_USUARIO` varchar(100) NOT NULL default '',`NOMBRE_USUARIO` varchar(100) NOT NULL default '',`RUN_ALU` varchar(10) NOT NULL default '',`AGNO` int(11) NOT NULL default '0',`ASIGNADO` decimal(10,0) NOT NULL default '0',`ACCION` varchar(100) NOT NULL default '',`FECHA_MODIFICACION` datetime NOT NULL default '0000-00-00 00:00:00',PRIMARY KEY  (`id`),UNIQUE KEY `becas_log_sec_key` (`FECHA_MODIFICACION`,`LOGIN_USUARIO`),KEY `becas_log_index_one` (`RUN_ALU`,`AGNO`)) ENGINE=MyISAM;"
                    conn.Execute sql
                    sql = "INSERT INTO becas_log(LOGIN_USUARIO,NOMBRE_USUARIO,RUN_ALU,AGNO,FECHA_MODIFICACION,ACCION,ASIGNADO) VALUES ('" & Nom_usu_ses & "','" & Nom_com_usu_ses & "','" & Trim(Rutalu) & "','" & Cmb_Agno.Text & "',concat(current_date,' ',current_time),'ELIMINAR',0);"
                    conn.Execute sql
                End If
            End If
    Else
        MsgBox "Debe seleccionar un alumno para asignar Beca"
    End If
    LlenaGrilla
End Sub

Private Sub Command2_Click()
    Dim i As Integer
    Dim C1, C2, C3, C4, C5, C6, C7, C8, Dia, Mes, sqlstr As String
    Dim rs As ADODB.Recordset
    Dim RsDa As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Set RsDa = New ADODB.Recordset
    Dim dbsTemp As Database
    Dim rsTemp As Recordset
    
    If Me.optpant.Value = True Then Form_main.CrystalReport.Destination = crptToWindow
    If Me.optimp.Value = True Then Form_main.CrystalReport.Destination = crptToPrinter
    
    rs.CursorLocation = adUseClient
    Form_msgbox.Show vbModal
    
    'Selección de alumnos para emitir carta.
    sqlstr = "select bf.*, CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu,ac.cod_ens,ac.let_cur,ac.num_gra from becas_fichas as bf, postulantes as p  left join alu_x_cur as ac ON ac.agno=" & Anno & " AND bf.ci_alumno = ac.Ci_alu And ac.activo_alu = 'SI' and ac.fec_cam = '1111/11/11' WHERE bf.agno =  " & Cmb_Agno.Text & " AND p.ci_alu = bf.Ci_alumno " & Label9.Caption & " ORDER BY ac.cod_ens,ac.num_gra,ac.let_cur, asignada"

    rs.Open sqlstr, conn
    i = 1
    Call CreaBD(DirAplicacion & "\GesTemp.mdb")
    Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "Detalles", "19,10")
    Set dbsTemp = OpenDatabase(DirAplicacion & "\GesTemp.mdb")
    If rs.RecordCount > 0 Then
        Me.pgtotal.Max = rs.RecordCount
        Me.pgtotal.Min = 0
        Me.pgtotal.Value = 0
        Me.pgtotal.Visible = True
        While Not (rs.EOF)
            Me.pgtotal.Value = i
            Me.Refresh
            C1 = rs("nombre_alu")
            C2 = rs("num_gra") & " " & rs("let_cur") & " " & devuelvecampo("codigos_ensenanza", "", "cod_des", "cod_ens = " & rs("cod_ens"), conn)

            C3 = rs("becapostula")
            C4 = rs("asignada") & "%"
            C5 = "Marzo de " & rs("agno") & " hasta Diciembre de " & rs("agno") & ","
            If rs("asignada") = 100 Then
                C6 = "Beca Completa"
            Else
                C6 = "Media Beca"
            End If
            Select Case dtcomunicado.Month
                Case "1": Mes = "Enero"
                Case "2": Mes = "Febrero"
                Case "3": Mes = "Marzo"
                Case "4": Mes = "Abril"
                Case "5": Mes = "Mayo"
                Case "6": Mes = "Junio"
                Case "7": Mes = "Julio"
                Case "8": Mes = "Agosto"
                Case "9": Mes = "Septiembre"
                Case "10": Mes = "Octubre"
                Case "11": Mes = "Noviembre"
                Case "12": Mes = "Diciembre"
            End Select
            
            C7 = "el día " & dtcomunicado.Day & " de " & Mes & " de " & dtcomunicado.Year
            
            dbsTemp.Execute "INSERT INTO Detalles (C1,C2,C3,C4,C5,C6,C7) values ('" & C1 & "','" & C2 & "','" & C3 & "','" & C4 & "','" & C5 & "','" & C6 & "','" & C7 & "')"
            
            rs.MoveNext
            i = i + 1
        Wend
        LlenaGrilla
        MsgBox "proceso Terminado"
        Me.pgtotal.Visible = False
        Me.Refresh
    End If
    sql = "CREATE TABLE IF NOT EXISTS `becas_log`(`id` bigint(20) NOT NULL auto_increment,`LOGIN_USUARIO` varchar(100) NOT NULL default '',`NOMBRE_USUARIO` varchar(100) NOT NULL default '',`RUN_ALU` varchar(10) NOT NULL default '',`AGNO` int(11) NOT NULL default '0',`ASIGNADO` decimal(10,0) NOT NULL default '0',`ACCION` varchar(100) NOT NULL default '',`FECHA_MODIFICACION` datetime NOT NULL default '0000-00-00 00:00:00',PRIMARY KEY  (`id`),UNIQUE KEY `becas_log_sec_key` (`FECHA_MODIFICACION`,`LOGIN_USUARIO`),KEY `becas_log_index_one` (`RUN_ALU`,`AGNO`)) ENGINE=MyISAM;"
    conn.Execute sql
    sql = "INSERT INTO becas_log(LOGIN_USUARIO,NOMBRE_USUARIO,AGNO,FECHA_MODIFICACION,ACCION) VALUES ('" & Nom_usu_ses & "','" & Nom_com_usu_ses & "','" & Cmb_Agno.Text & "',concat(current_date,' ',current_time),'IMPRIMIR COMUNICADO');"
    conn.Execute sql
    GenRep2
End Sub

Private Sub Command3_Click()
    Dim i As Integer
    Dim C1, C2, C3, C4, C5, C6, C7, C8, Dia, Mes, sqlstr As String
    Dim rs As ADODB.Recordset
    Dim RsDa As ADODB.Recordset
    Dim RsCurSo As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Set RsDa = New ADODB.Recordset
    Set RsCurSo = New ADODB.Recordset
    Dim dbsTemp As Database
    Dim rsTemp As Recordset
    
    If Me.opt1.Value = True Then Form_main.CrystalReport.Destination = crptToWindow
    If Me.opt2.Value = True Then Form_main.CrystalReport.Destination = crptToPrinter
    
    rs.CursorLocation = adUseClient
    Form_msgbox.Show vbModal
    sqlstr = "select bf.*, CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu,ac.cod_ens,ac.let_cur,ac.num_gra from becas_fichas as bf, postulantes as p  left join alu_x_cur as ac on bf.ci_alumno = ac.Ci_alu And ac.activo_alu = 'SI' and ac.fec_cam = '1111-11-11' and ac.agno=" & Anno & " WHERE bf.agno = " & Cmb_Agno.Text & " AND bf.asignada > 0 and p.ci_alu = bf.Ci_alumno " & Label9.Caption & " ORDER BY ac.cod_ens,ac.num_gra,ac.let_cur, asignada"

    rs.Open sqlstr, conn
    i = 1
    Call CreaBD(DirAplicacion & "\GesTemp.mdb")
    Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "Detalles", "19,10")
    Set dbsTemp = OpenDatabase(DirAplicacion & "\GesTemp.mdb")
    If rs.RecordCount > 0 Then
        paginas = rs.RecordCount \ 26
        resto = 26 - (rs.RecordCount - (26 * paginas))
        resto = resto + 26
        Me.pgtotal.Max = rs.RecordCount + resto
        Me.pgtotal.Min = 0
        Me.pgtotal.Value = 0
        Me.pgtotal.Visible = True
        rs.MoveFirst
        While Not (rs.EOF)
            Me.pgtotal.Value = i
            Me.Refresh
            sqlstr = "SELECT num_gra, let_cur, cod_ens FROM alu_x_cur WHERE ci_alu = '" & rs("ci_alumno") & "' AND activo_alu = 'SI' AND agno = " & Cmb_Agno.Text
            RsCurSo.Open sqlstr, conn
            If RsCurSo.RecordCount > 0 Then
                C6 = RsCurSo("num_gra") & " " & RsCurSo("let_cur") & " " & devuelvecampo("codigos_ensenanza", "", "cod_des", "cod_ens = " & RsCurSo("cod_ens"), conn)
            Else
                C6 = " "
            End If
            RsCurSo.Close
            C1 = rs("nombre_alu")
            C2 = rs("num_gra") & " " & rs("let_cur") & " " & devuelvecampo("codigos_ensenanza", "", "cod_des", "cod_ens = " & rs("cod_ens"), conn)
            C3 = rs("becapostula")
            C4 = rs("asignada") & "%"
            C5 = Mid("0000", 1, 4 - Len(CStr(i))) & CStr(i)
            dbsTemp.Execute "INSERT INTO Detalles (C1,C2,C3,C4,C5,C6) values ('" & C1 & "','" & C2 & "','" & C3 & "','" & C4 & "', '" & C5 & "', '" & C6 & "')"
            
            rs.MoveNext
            i = i + 1
        Wend
        For j = 1 To resto
            Me.pgtotal.Value = i
            Me.Refresh
            C5 = Mid("0000", 1, 4 - Len(CStr(i))) & CStr(i)
            dbsTemp.Execute "INSERT INTO Detalles (C1,C2,C3,C4,C5,C6) values (' ',' ',' ',' ','" & C5 & "',' ')"
            i = i + 1
        Next j
        MsgBox "proceso Terminado"
        Me.pgtotal.Visible = False
        Me.Refresh
    End If
On Error GoTo libcon
'**************************************
Set rs = New ADODB.Recordset
Dim TipoStr, L2 As String
rs.CursorLocation = adUseClient
a = "select nom_est, dir_est, localidad_est from establecimientos"
rs.Open a, conn
If rs.RecordCount > 0 Then
Form_main.CrystalReport.Formulas(0) = "nomcol = '" & rs(0) & "'"
Form_main.CrystalReport.Formulas(1) = "dircol = '" & rs(1) & "'"
Form_main.CrystalReport.Formulas(2) = "comunacol = '" & rs(2) & "'"
End If
rs.Close

Form_main.CrystalReport.WindowTitle = "Libro de asignacion de Beca " & Cmb_Agno.Text
Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\libro.rpt"
Form_main.CrystalReport.DataFiles(0) = DirAplicacion & "\GesTemp.mdb"
Form_main.CrystalReport.Action = 1
Call LimpiaFormulas(Form_main.CrystalReport, 30)
    sql = "CREATE TABLE IF NOT EXISTS `becas_log`(`id` bigint(20) NOT NULL auto_increment,`LOGIN_USUARIO` varchar(100) NOT NULL default '',`NOMBRE_USUARIO` varchar(100) NOT NULL default '',`RUN_ALU` varchar(10) NOT NULL default '',`AGNO` int(11) NOT NULL default '0',`ASIGNADO` decimal(10,0) NOT NULL default '0',`ACCION` varchar(100) NOT NULL default '',`FECHA_MODIFICACION` datetime NOT NULL default '0000-00-00 00:00:00',PRIMARY KEY  (`id`),UNIQUE KEY `becas_log_sec_key` (`FECHA_MODIFICACION`,`LOGIN_USUARIO`),KEY `becas_log_index_one` (`RUN_ALU`,`AGNO`)) ENGINE=MyISAM;"
    conn.Execute sql
    sql = "INSERT INTO becas_log(LOGIN_USUARIO,NOMBRE_USUARIO,AGNO,FECHA_MODIFICACION,ACCION) VALUES ('" & Nom_usu_ses & "','" & Nom_com_usu_ses & "','" & Cmb_Agno.Text & "',concat(current_date,' ',current_time),'IMPRIMIR LIBRO');"
    conn.Execute sql
Exit Sub
libcon:
   MsgBox Err.Description & vbCrLf & vbCrLf & Err.Source & vbCrLf & vbCrLf & Err.Number, vbCritical, "ALERTA DE ANOMALIA"
End Sub

Private Sub Form_Activate()
    If ManTab = "fichapost" Then
        ManTab = "listaficha"
    End If

End Sub

Private Sub Form_Load()
    Me.Top = 0
    Me.Left = 0
    Llena_Cmb_Agno
    CmbBeca.AddItem "100%"
    CmbBeca.AddItem "50%"
    CmbBeca.AddItem "0"
    Me.OptDesPan.Value = True
    Call llenacombo(Me.Cmb_Cod_ens, "codigos_ensenanza ce", "distinct ce.des_ens", "order by ce.ord_ens", conn)
    dtcomunicado.Value = Date
    dtcomunicado.MinDate = Date
    Frame7.Caption = "Curso " & Anno
End Sub

Private Sub LlenaGrilla()
    Dim Orden, sqlstr As String
    Dim Filtro As String
    Dim i, contcancela As Integer
    Dim Mostrar As String
    Dim rs As ADODB.Recordset
    Dim RsDa As ADODB.Recordset
    
    Set rs = New ADODB.Recordset
    Set RsDa = New ADODB.Recordset
    grd_tabla_pagos.ColWidth(0) = 5500
    grd_tabla_pagos.ColWidth(1) = 1500
    grd_tabla_pagos.ColWidth(2) = 1800
    grd_tabla_pagos.ColWidth(3) = 1800
    grd_tabla_pagos.ColWidth(4) = 1300
    If (chkcurso.Value = 1) Then
        CodModalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.Cmb_Cod_ens.Text & "'", conn)
        Filtro = "bf.agno =  " & Cmb_Agno.Text & " AND bf.ci_alumno = ac.Ci_alu And ac.activo_alu = 'SI' and ac.fec_cam = '1111-11-11' and ac.let_cur = '" & Cmb_let_cur.Text & "' and ac.cod_ens = '" & CodModalidad & "' and ac.num_gra = " & Cmb_Grado.Text & " and ac.agno=" & Anno & " ;"
        sqlstr = "select bf.* from becas_fichas as bf , alu_x_cur as ac where " & Filtro
        
    Else
        If rbtnsocio.Value = True Then
            Filtro = " becapostula = 'Socioeconómica' "
            If rbtnfuncio.Value = True Then
                Filtro = " becapostula = 'Socioeconómica' AND becapostula2 = 'Funcionario' "
            End If
        ElseIf rbtnacademina.Value = True Then
            Filtro = " becapostula = 'Libre Disponibilidad' "
            If rbtnfuncio.Value = True Then
                Filtro = " becapostula = 'Libre Disponibilidad' AND becapostula2 = 'Funcionario' "
            End If
            If Option1.Value = True Then
                Filtro = " becapostula = 'Libre Disponibilidad' AND becapostula2 = 'Excelencia Academica' "
            End If
            If rbtndepor.Value = True Then
                Filtro = " becapostula = 'Libre Disponibilidad' AND becapostula2 = 'Deportiva' "
            End If
        ElseIf rbtnsociovul.Value = True Then
                Filtro = "becapostula='Socioeconómica Vulne'"
        End If
    '     Filtro = IIf(rbtnsocio.Value, " becapostula = 'Socioeconómica' ", " becapostula = 'Excelencia Académica' ")
        If (rbtnsin.Value) Then
            Mostrar = " AND asignada = 0 "
        Else
            If (rbtncon.Value) Then
                Mostrar = " AND asignada > 0 "
            Else
                Mostrar = " "
            End If
        End If
        Orden = IIf(rbtnsocio.Value, " puntaje desc, ptj_promedio desc ", " ptj_promedio desc, puntaje desc ")
        sqlstr = "SELECT * FROM becas_fichas WHERE agno = " & Cmb_Agno.Text & " AND " & Filtro & Mostrar & " ORDER BY asignada DESC," & Orden
    End If
    grd_tabla_pagos.Rows = 1
    rs.CursorLocation = adUseClient
    
    rs.Open sqlstr, conn
    i = 1
    If rs.RecordCount > 0 Then
        While Not (rs.EOF)
            grd_tabla_pagos.Rows = i + 1
            Reserva = devuelvecampo("matriculas", "", "reserva", "ci_alu = '" & rs("ci_alumno") & "' AND anno_mat = " & CStr(CInt(Cmb_Agno.Text) - 1) & " ", conn)
            grd_tabla_pagos.Row = i
            RsDa.Open "SELECT CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu FROM postulantes WHERE ci_alu='" & rs("ci_alumno") & "' ORDER BY ci_alu;", conn
            'parche
            If RsDa.RecordCount <= 0 Then GoTo SaltoNulo
            RsDa.MoveFirst
            
            grd_tabla_pagos.TextMatrix(i, 0) = RsDa("nombre_alu")
            
            If Reserva = 2 Then
                For k = 0 To 4
                    grd_tabla_pagos.Col = k
                    grd_tabla_pagos.CellBackColor = &HFF
                Next k
                If rs("asignada") > 0 Then
                    MsgBox ("El Alumno " & RsDa("nombre_alu") & ", Rut :" & rs("ci_alumno") & " Tiene una beca por " & rs("asignada") & "% y se encuentra en estado de renuncia de matricula")
                End If
            End If
            
            grd_tabla_pagos.TextMatrix(i, 1) = rs("ci_alumno")
            grd_tabla_pagos.TextMatrix(i, 2) = rs("ptj_promedio")
            grd_tabla_pagos.TextMatrix(i, 3) = rs("puntaje")
            If rs("asignada") > 0 Then
                Select Case (rs("asignada"))
                    Case 100: grd_tabla_pagos.TextMatrix(i, 4) = "100%"
                    Case 50: grd_tabla_pagos.TextMatrix(i, 4) = "50%"
                End Select
            End If
SaltoNulo:
            RsDa.Close
            rs.MoveNext
            i = i + 1
        Wend
    End If
    grd_tabla_pagos.Row = 0
    rs.Close
    If (chkcurso.Value = 1) Then
        rs.Open "SELECT count(asignada) as suma FROM becas_fichas as bf , alu_x_cur as ac WHERE bf.agno = " & Cmb_Agno.Text & " AND asignada = 0  AND " & Filtro
        lb0.Caption = rs("suma")
        rs.Close
        rs.Open "SELECT count(asignada) as suma FROM becas_fichas as bf , alu_x_cur as ac WHERE bf.agno = " & Cmb_Agno.Text & " AND asignada = 100  AND " & Filtro
        lb100.Caption = rs("suma")
        rs.Close
        rs.Open "SELECT count(asignada) as suma FROM becas_fichas as bf , alu_x_cur as ac WHERE bf.agno = " & Cmb_Agno.Text & " AND asignada = 50  AND " & Filtro
        lb50.Caption = rs("suma")
    Else
        rs.Open "SELECT count(*) as suma FROM becas_fichas WHERE agno = " & Cmb_Agno.Text & " AND asignada = 0  AND " & Filtro
        lb0.Caption = rs("suma")
        rs.Close
        rs.Open "SELECT count(*) as suma FROM becas_fichas WHERE agno = " & Cmb_Agno.Text & " AND asignada = 100  AND " & Filtro
        lb100.Caption = rs("suma")
        rs.Close
        rs.Open "SELECT count(*) as suma FROM becas_fichas WHERE agno = " & Cmb_Agno.Text & " AND asignada = 50  AND " & Filtro
        lb50.Caption = rs("suma")
    rs.Close
    End If

End Sub

Private Sub grd_tabla_pagos_DblClick()
    Form_fichabeca.Text2.Text = grd_tabla_pagos.TextMatrix(grd_tabla_pagos.RowSel, 1)
    Form_fichabeca.Text1.Text = grd_tabla_pagos.TextMatrix(grd_tabla_pagos.RowSel, 0)
    Form_fichabeca.Cmb_Agno.Text = Cmb_Agno.Text
    Form_fichabeca.List1.Visible = False
    
    Load Form_fichabeca
    Form_fichabeca.SetFocus
End Sub

Private Sub Option1_Click()
LlenaGrilla
End Sub

Private Sub Option2_Click()
LlenaGrilla
End Sub

Private Sub rbtnacademina_Click()
Frame10.Visible = True
rbtnfuncio.Visible = True
Option1.Visible = True
rbtndepor.Visible = True
Option2.Visible = True

 LlenaGrilla
End Sub

Private Sub rbtnall_Click()
    LlenaGrilla
End Sub

Private Sub rbtncon_Click()
    LlenaGrilla
End Sub

Private Sub rbtndepor_Click()
LlenaGrilla
End Sub

Private Sub rbtnfuncio_Click()
LlenaGrilla
End Sub

Private Sub rbtnsin_Click()
    LlenaGrilla
End Sub

Private Sub rbtnsocio_Click()
Frame10.Visible = True
rbtnfuncio.Visible = True
Option1.Visible = False
rbtndepor.Visible = False
Option2.Visible = True
  LlenaGrilla
End Sub

Private Sub pntrecalcular()

    Dim i As Integer
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Orden = IIf(rbtnsocio.Value, " ptj_promedio desc, puntaje ", " puntaje desc, ptj_promedio ")

    rs.CursorLocation = adUseClient
    rs.Open "select * from becas_fichas where agno = " & Cmb_Agno.Text & " order by " & Orden, conn
    i = 1
    If rs.RecordCount > 0 Then
        Me.pgtotal.Max = rs.RecordCount
        Me.pgtotal.Min = 0
        Me.pgtotal.Value = 0
        Me.pgtotal.Visible = True
        While Not (rs.EOF)
            Me.pgtotal.Value = i
            Me.Refresh
            ptjjefehogar = Puntaje_JefeHogar(rs("jefehogar"), Val(Cmb_Agno.Text), conn)
            ptjpromedio = Puntaje_Notas(Val(Replace(rs("promediog"), ",", "")), Val(Cmb_Agno.Text), conn)
            ptjvivienda = Puntaje_Vivienda(rs("vivienda"), Val(Cmb_Agno.Text), conn)
            ptjsituacionlaboral = Puntaje_SituacionLaboral(rs("situacionlab"), Val(Cmb_Agno.Text), conn)
            ptjarrdiv = Puntaje_ArrDiv(Val(rs("ingresofamiliar")), Val(rs("montoarriendodiv")), Val(Cmb_Agno.Text), conn)
            'Aquí calculo la tabla enfermedades
            ptjenfermedad = 0
            ptjenfermedad = IIf(rs("enfcatpad"), Puntaje_EnfermedadCatastrofica("padre", Cmb_Agno.Text, conn), 0)
            ptjenfermedad = ptjenfermedad + IIf(rs("enfcatmad"), Puntaje_EnfermedadCatastrofica("madre", Cmb_Agno.Text, conn), 0)
            ptjenfermedad = ptjenfermedad + IIf(rs("enfcather"), Puntaje_EnfermedadCatastrofica("hermanos", Cmb_Agno.Text, conn), 0)
            ptjenfermedad = ptjenfermedad + IIf(rs("enfcatotro"), Puntaje_EnfermedadCatastrofica("otros", Cmb_Agno.Text, conn), 0)

            ptjingresofamiliar = Puntaje_IngresoFamiliar(rs("ingresofamiliar"), rs("cantidadfamilia"), Cmb_Agno.Text, conn)
            ptjvalcatastrofica = Puntaje_EnfCatGasto(rs("ingresofamiliar"), rs("valorenfcat"), Val(Cmb_Agno.Text), conn)
            ptjesthermanos = Puntaje_EstudiosHermanos(rs("ingresofamiliar"), rs("cantidadfamilia"), rs("valorestuherma"), Val(Cmb_Agno.Text), conn)

            
            TxtPntNotas = ptjpromedio
            Txtpntjefehogar = ptjjefehogar
            TxtPnteconomicos = ptjsituacionlaboral
            TxtPntingreso = ptjingresofamiliar
            TxtPntvivienda = (ptjvivienda * 0.7) + (ptjarrdiv * 0.3)
            TxtPntEnfermedad = (ptjenfermedad * 0.5) + (ptjvalcatastrofica * 0.5)
            Txtestudioptj = ptjesthermanos
            
            TxtPnttotal = (Val(Txtpntjefehogar) * 0.05) + (Val(TxtPnteconomicos) * 0.15) + (Val(TxtPntingreso) * 0.45) + (Val(TxtPntvivienda) * 0.15) + (Val(TxtPntEnfermedad) * 0.15) + (Val(Txtestudioptj) * 0.05)


            'update
            query = "UPDATE becas_fichas SET ptj_promedio=" & TxtPntNotas & ",ptj_jefehogar=" & Txtpntjefehogar & "," & _
            "ptj_situacionlab=" & TxtPnteconomicos & ",ptj_anteco=" & TxtPnteconomicos & _
            ",ptj_antvivienda=" & Replace(TxtPntvivienda, ",", ".") & _
            ",ptj_enfcat=" & Replace(TxtPntEnfermedad, ",", ".") & ",puntaje=" & Replace(TxtPnttotal, ",", ".") & ",ptj_esthermano=" & Replace(Txtestudioptj, ",", ".") & ",ptj_ingresofam=" & Replace(TxtPntingreso, ",", ".") & " WHERE ci_alumno ='" & rs("ci_alumno") & "'"
            
            conn.Execute query



            rs.MoveNext
            i = i + 1
        Wend
        LlenaGrilla
        MsgBox "proceso Terminado"
        Me.pgtotal.Visible = False
        Me.Refresh
    End If
    
End Sub


Public Sub GenRep()
On Error GoTo controler
'**************************************
Set rs = New ADODB.Recordset
Dim TipoStr, L2 As String
rs.CursorLocation = adUseClient
a = "select nom_est, dir_est, localidad_est from establecimientos"
rs.Open a, conn
If rs.RecordCount > 0 Then
Form_main.CrystalReport.Formulas(0) = "Nombrecolegio = '" & rs(0) & "'"
Form_main.CrystalReport.Formulas(1) = "Direccioncolegio = '" & rs(1) & "'"
Form_main.CrystalReport.Formulas(2) = "ComunaColegio = '" & rs(2) & "'"
End If
rs.Close
Form_main.CrystalReport.Formulas(3) = "Titulo = 'Listado de Preasignacion de Beca " & Cmb_Agno.Text & " '"
Form_main.CrystalReport.Formulas(4) = "Media = '" & lb50.Caption & "'"
Form_main.CrystalReport.Formulas(5) = "Niuna = '" & lb0.Caption & "'"

If chkcurso.Value = 1 Then
    Form_main.CrystalReport.Formulas(7) = "LineaExtra1 = 'Becados Por curso'"
    Form_main.CrystalReport.Formulas(8) = "LineaExtra2 = 'Curso : " & Cmb_Grado.Text & " " & Cmb_let_cur.Text & "'"
    Form_main.CrystalReport.Formulas(9) = "LineaExtra3 = 'Nivel : " & Cmb_Cod_ens.Text & "'"
Else
    If rbtnsocio.Value Then
        TipoStr = "Socioeconómica"
    Else
        TipoStr = "Excelencia Académica"
    End If
    L2 = ""
    If rbtncon.Value Then
        L2 = "Alumnos Becados"
    End If
    If rbtnsin.Value Then
        L2 = "Alumnos sin Becas"
    End If
    
    Form_main.CrystalReport.Formulas(7) = "LineaExtra1 = 'Tipo de Becas : " & TipoStr & "'"
    Form_main.CrystalReport.Formulas(8) = "LineaExtra2 = '" & L2 & "'"
    Form_main.CrystalReport.Formulas(9) = "LineaExtra3 = ''"
End If
Form_main.CrystalReport.Formulas(6) = "Completa = '" & lb100.Caption & "'"
Form_main.CrystalReport.WindowTitle = "Listado de Preasignacion de Beca " & Cmb_Agno.Text
Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\listabeca1.rpt"
Form_main.CrystalReport.DataFiles(0) = DirAplicacion & "\GesTemp.mdb"
Form_main.CrystalReport.Action = 1
Call LimpiaFormulas(Form_main.CrystalReport, 30)
Exit Sub
controler:
   MsgBox Err.Description & vbCrLf & vbCrLf & Err.Source & vbCrLf & vbCrLf & Err.Number, vbCritical, "ALERTA DE ANOMALIA"

End Sub

Public Sub GenRep2()
On Error GoTo controler
'**************************************
Set rs = New ADODB.Recordset
Dim TipoStr, L2 As String
rs.CursorLocation = adUseClient
a = "select nom_est, dir_est, localidad_est from establecimientos"
rs.Open a, conn
If rs.RecordCount > 0 Then
Form_main.CrystalReport.Formulas(0) = "nomcol = '" & rs(0) & "'"
Form_main.CrystalReport.Formulas(1) = "dircol = '" & rs(1) & "'"
Form_main.CrystalReport.Formulas(2) = "comunacol = '" & rs(2) & "'"
End If
rs.Close


Form_main.CrystalReport.WindowTitle = "Comunicaciones de asignacion de Beca " & Cmb_Agno.Text
Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\combecas.rpt"
Form_main.CrystalReport.DataFiles(0) = DirAplicacion & "\GesTemp.mdb"
Form_main.CrystalReport.Action = 1
Call LimpiaFormulas(Form_main.CrystalReport, 30)
Exit Sub
controler:
   MsgBox Err.Description & vbCrLf & vbCrLf & Err.Source & vbCrLf & vbCrLf & Err.Number, vbCritical, "ALERTA DE ANOMALIA"

End Sub

Private Sub rbtnsociovul_Click()
rbtnfuncio.Visible = False
Option1.Visible = False
rbtndepor.Visible = False
Option2.Visible = True
LlenaGrilla
End Sub

