VERSION 5.00
Begin VB.Form Form_calculoCuota 
   Caption         =   "Calculo de Mensualidad."
   ClientHeight    =   2445
   ClientLeft      =   5115
   ClientTop       =   4680
   ClientWidth     =   5490
   LinkTopic       =   "Form1"
   ScaleHeight     =   2445
   ScaleWidth      =   5490
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command1 
      Caption         =   "Calcula"
      Height          =   615
      Left            =   1920
      TabIndex        =   2
      Top             =   1440
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   1440
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   360
      Width           =   2535
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "Monto"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   840
      Width           =   4935
   End
End
Attribute VB_Name = "Form_calculoCuota"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function CuotaAlumnoFecha(ByVal RunAlu As String, ByVal Fecha As Date, ByRef CNX As ADODB.Connection) As Variant
    Dim RC As ADODB.Recordset
    Dim QR As String
    Dim agno As Integer
    Dim Mes As Integer
    
    agno = Year(Fecha)
    Mes = Month(Fecha)
    
    QR = "SELECT alu.*, fd.convenio1, fd.hermanos, fd.arancel_base FROM fnza_descuento as fd, (SELECT axa.rut_apo, axa.ci_alu, m.fec_mat, m.fec_retiro, if(m.cod_ens='996',concat(c.colegio,'MMC'),c.colegio) as cole, concat(m.cod_ens, m.num_gra) as curso, m.cod_ens, m.anno_mat, m.ind_beca, m.ind_mbeca, p.fec_nacalu, a.cod_conv FROM apo_x_alu as axa, matriculas as m, postulantes as p, apoderados as a, (SELECT cc.colegio FROM hist_cod_colegio as cc, establecimientos as e WHERE e.rdb=cc.cod_rbd) as c WHERE axa.rut_apo='11913079-4' AND axa.ci_alu=m.ci_alu AND m.fec_mat>'" & agno & "-01-01' AND (m.fec_mat<='" & agno & "-" & Mes & "-15' AND m.fec_mat>='" & agno & "-02-28') AND (m.fec_retiro='1111-11-11' OR m.fec_retiro>'" & agno & "-" & Mes & "-15') AND p.ci_alu=axa.ci_alu AND axa.rut_apo=a.rut_apo ) as alu WHERE fd.colegio=alu.cole AND fd.curso=alu.curso AND fd.agno=alu.anno_mat ORDER BY alu.fec_nacalu;"
End Function

Private Sub Form_Load()

End Sub
