VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Form_fnza_devoluciones 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Devoluciones"
   ClientHeight    =   6330
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   7050
   Icon            =   "Form_fnza_devoluciones.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   6330
   ScaleWidth      =   7050
   Begin VB.Frame Frame3 
      Height          =   1935
      Left            =   840
      TabIndex        =   24
      Top             =   1920
      Visible         =   0   'False
      Width           =   5295
      Begin VB.CommandButton Command5 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   3720
         TabIndex        =   30
         Top             =   1200
         Width           =   1335
      End
      Begin VB.CommandButton Command4 
         Caption         =   "Devolver"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   2160
         TabIndex        =   29
         Top             =   1200
         Width           =   1335
      End
      Begin MSComCtl2.DTPicker DTPicker1 
         Height          =   375
         Left            =   240
         TabIndex        =   27
         Top             =   1320
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   661
         _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          =   189792257
         CurrentDate     =   38905
      End
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   25
         Top             =   480
         Width           =   4815
      End
      Begin VB.Label Label4 
         Caption         =   "Fecha"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   28
         Top             =   1080
         Width           =   1575
      End
      Begin VB.Label Label3 
         Caption         =   "Glosa"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   26
         Top             =   240
         Width           =   4815
      End
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Salir"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   5520
      Picture         =   "Form_fnza_devoluciones.frx":2A8B2
      Style           =   1  'Graphical
      TabIndex        =   21
      Top             =   5160
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Realizar Devolución"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   5520
      Picture         =   "Form_fnza_devoluciones.frx":2AED8
      Style           =   1  'Graphical
      TabIndex        =   20
      Top             =   1440
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Otra Boleta"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   5520
      Picture         =   "Form_fnza_devoluciones.frx":2B4DA
      Style           =   1  'Graphical
      TabIndex        =   19
      Top             =   240
      Width           =   1335
   End
   Begin VB.Frame Frame2 
      Caption         =   "Boleta 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          =   4815
      Left            =   120
      TabIndex        =   4
      Top             =   1320
      Width           =   5175
      Begin VB.TextBox Text6 
         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
         Height          =   255
         Left            =   1200
         Locked          =   -1  'True
         TabIndex        =   23
         Text            =   "Text6"
         Top             =   4440
         Width           =   3855
      End
      Begin VB.TextBox Text5 
         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
         Height          =   255
         Left            =   1200
         Locked          =   -1  'True
         TabIndex        =   16
         Text            =   "Text5"
         Top             =   1200
         Width           =   3855
      End
      Begin VB.TextBox Text4 
         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
         Height          =   255
         Left            =   1200
         Locked          =   -1  'True
         TabIndex        =   14
         Text            =   "Text4"
         Top             =   960
         Width           =   3855
      End
      Begin VB.TextBox Text3 
         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
         Height          =   255
         Left            =   1200
         Locked          =   -1  'True
         TabIndex        =   13
         Text            =   "Text3"
         Top             =   720
         Width           =   3855
      End
      Begin VB.TextBox Text2 
         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
         Height          =   255
         Left            =   1200
         Locked          =   -1  'True
         TabIndex        =   12
         Text            =   "Text2"
         Top             =   480
         Width           =   3855
      End
      Begin VB.TextBox Text1 
         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
         Height          =   255
         Left            =   1200
         Locked          =   -1  'True
         TabIndex        =   11
         Text            =   "Text1"
         Top             =   240
         Width           =   3855
      End
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid grilla_dtll_blta 
         Height          =   2535
         Left            =   120
         TabIndex        =   10
         Top             =   1800
         Width           =   4935
         _ExtentX        =   8705
         _ExtentY        =   4471
         _Version        =   393216
         FixedCols       =   0
         FocusRect       =   0
         HighLight       =   0
         ScrollBars      =   0
         Appearance      =   0
         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   =   2
      End
      Begin VB.Label Label2 
         Caption         =   "Estado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   6
         Left            =   120
         TabIndex        =   22
         Top             =   4440
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Colegio"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   5
         Left            =   120
         TabIndex        =   15
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Detalle"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   9
         Top             =   1560
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Monto"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   8
         Top             =   1200
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Fecha"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   7
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   6
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Apoderado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   5
         Top             =   480
         Width           =   975
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Boleta"
      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           =   5175
      Begin VB.OptionButton Option2 
         Caption         =   "Pre-Kinder"
         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        =   18
         Top             =   600
         Width           =   1095
      End
      Begin VB.OptionButton Option1 
         Caption         =   "Colegio"
         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        =   17
         Top             =   360
         Value           =   -1  'True
         Width           =   1095
      End
      Begin VB.TextBox Text_Boleta 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2400
         TabIndex        =   2
         Text            =   "Text_Boleta"
         Top             =   480
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Buscar 
         Caption         =   "Buscar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   3840
         Picture         =   "Form_fnza_devoluciones.frx":2BA7A
         Style           =   1  'Graphical
         TabIndex        =   1
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "Boleta 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            =   1680
         TabIndex        =   3
         Top             =   480
         Width           =   735
      End
   End
   Begin VB.CommandButton Command6 
      Caption         =   "Imprimir Comprobante"
      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          =   975
      Left            =   5520
      Picture         =   "Form_fnza_devoluciones.frx":2C06D
      Style           =   1  'Graphical
      TabIndex        =   31
      Top             =   2640
      Width           =   1335
   End
End
Attribute VB_Name = "Form_fnza_devoluciones"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub limpiar()
    Text_Boleta.Text = ""
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    Text6.Text = ""
    grilla_dtll_blta.Clear
    grilla_dtll_blta.Rows = 2
    grilla_dtll_blta.FormatString = "<Mes|<Concepto|>Monto"
    grilla_dtll_blta.ColWidth(0) = 1000
    grilla_dtll_blta.ColWidth(1) = 1200
    grilla_dtll_blta.ColWidth(2) = 1000
    Frame1.Enabled = True
    Frame2.Enabled = False
    Command2.Enabled = False
End Sub

Private Sub Llena_Boleta()
    Dim QRY As String
    Dim REC As ADODB.Recordset
    Dim CodColegio As String
    Dim FolioBlta As Long
    Dim Bloqueada As Boolean
    
    Frame1.Enabled = False
    Set REC = New ADODB.Recordset
    CodColegio = RetornaCampo("CFG", "valor", "param='" & IIf(Option1, "CODBC", "CODPK") & "'", conn)
    QRY = "SELECT * FROM fnza_boletas WHERE folio_blta_fisico=" & Trim(Text_Boleta.Text) & " AND colegio='" & CodColegio & "'"
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        Text1.Text = UCase(RetornaCampo("hist_cod_colegio", "nombre", "colegio='" & CodColegio & "'", conn))
        Text2.Text = RetornaCampo("apoderados", "concat(noms_apo,' ',ape1_apo,' ',ape2_apo) as nombre", "rut_Apo='" & REC!run_apo & "'", conn)
        Text3.Text = RetornaCampo("postulantes", "concat(nom_alu,' ',ape_pat_alu,' ',ape_mat_alu) as nombre", "ci_Alu='" & REC!run_alu & "'", conn)
        Text4.Text = REC!fecha_blta
        Text5.Text = REC!monto_blta
        Text6.Text = UCase(TraduceEstadoBlta(REC!estado_blta, conn))
        'Rescato el folio interno de la boleta
        FolioBlta = REC!folio_blta
        'Determino si la boleta está bloqueada para ser devuelta
        If (REC!estado_blta = "aprb") Then
            If (Val(RetornaCampo("fnza_detalle_ntcr", "count(blta_rel) as validas", "blta_rel=" & FolioBlta & " AND nulo='NO'", conn)) = 0) Then
                Bloqueada = False
            Else
                Bloqueada = True
                Text6.Text = Text6.Text & " (N. de C. asociada)"
            End If
        Else
            Bloqueada = True
            If REC!estado_blta = "devo" Then
                Command6.Enabled = True
            End If
        End If
        '**************************************
        REC.Close
        QRY = "SELECT * FROM fnza_dtll_mvto as dm, fnza_movimientos_mensualidad as fmm where dm.folio_blta=" & FolioBlta & " and dm.folio_mvto=fmm.folio_mvto"
        REC.Open QRY, conn
        If REC.RecordCount > 0 Then
            For i = 1 To REC.RecordCount
                grilla_dtll_blta.AddItem Mes2Texto(Month(REC!fech_venc_cptos)) & Chr(9) & TraduceConceptoDtll(REC!cod_concepto, conn) & Chr(9) & REC!Monto_Pago, i
                REC.MoveNext
            Next i
        End If
        If Not Bloqueada Then
            Command2.Enabled = True
        End If
    Else
        MsgBox "Boleta no encontrada en el sistema", vbExclamation, "BOLETA NO INGRESADA"
    End If
    REC.Close
    Frame2.Enabled = True
End Sub

Private Sub Btn_Buscar_Click()
    If Val(Text_Boleta.Text) > 0 Then
        Llena_Boleta
    End If
End Sub

Private Sub Command1_Click()
    Frame1.Enabled = True
    Frame2.Enabled = False
    Command2.Enabled = False
    Command6.Enabled = False
    limpiar
End Sub

Private Sub Command2_Click()
    If MsgBox("¿Posee en su poder la copia de boleta a hacer devolución?", vbYesNo + vbQuestion, "REQUISITO") = vbNo Then Exit Sub
    MsgBox "Debe asegurar el registro de los siguientes datos al reverso de la boleta:" & vbCrLf & vbCrLf & " - NONMBRE APODERADO." & vbCrLf & " - RUT." & vbCrLf & " - FONO." & vbCrLf & " - FECHA DE RECEPCIÓN DEL DINERO." & vbCrLf & " - MONTO RECIBIDO." & vbCrLf & " - FIRMA DE RECEPCIÓN CONFORME.", vbInformation, "REQUISITOS"
    Frame3.Visible = True
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Command4_Click()
    Dim REC As ADODB.Recordset
    Dim QRY As String
    Dim FolioBlta As Long
    Dim CodColegio As String
    Dim RunApo As String
    Dim RunAlu As String
    Dim MontoBlta As String
    Dim CodGlosa As Long
    
    If Combo1.Text = "" Then Exit Sub
    
    CodColegio = RetornaCampo("CFG", "valor", "param='" & IIf(Option1, "CODBC", "CODPK") & "'", conn)
    FolioBlta = RetornaCampo("fnza_boletas", "folio_blta", "folio_blta_fisico=" & Trim(Text_Boleta.Text) & " and colegio='" & CodColegio & "'", conn)
    RunApo = RetornaCampo("fnza_boletas", "run_apo", "folio_blta=" & FolioBlta, conn)
    RunAlu = RetornaCampo("fnza_boletas", "run_alu", "folio_blta=" & FolioBlta, conn)
    MontoBlta = RetornaCampo("fnza_boletas", "monto_blta", "folio_blta=" & FolioBlta, conn)
    CodGlosa = Val(RetornaCampo("fnza_glosa_devo", "cod_glosa", "descripcion='" & Combo1.Text & "'", conn))
    
    QRY = "SELECT fmm.* FROM fnza_dtll_mvto as dm, fnza_movimientos_mensualidad as fmm where dm.folio_blta=" & FolioBlta & " and dm.folio_mvto=fmm.folio_mvto and fmm.estado_pago='aprb'"
    
    Set REC = New ADODB.Recordset
    REC.Open QRY, conn
    If REC.RecordCount > 0 Then
        For i = 1 To REC.RecordCount
            If abonar_detalle(REC!folio_dtll, (-1 * REC!Monto_Pago), Format(DTPicker1.Value, "yyyy-mm-dd"), conn) Then
                conn.Execute "UPDATE fnza_movimientos_mensualidad SET estado_pago='nula' WHERE folio_mvto=" & REC!folio_mvto & " LIMIT 1;"
            End If
        REC.MoveNext
        Next i
        conn.Execute "UPDATE fnza_boletas SET estado_blta='devo' WHERE folio_blta=" & FolioBlta & " LIMIT 1;"
        conn.Execute "INSERT fnza_devoluciones(monto,run_apo,glosa,run_alu,folio_blta,colegio,usuario,usuario_nombre,fecha) VALUES('" & MontoBlta & "','" & RunApo & "','" & CodGlosa & "','" & RunAlu & "','" & FolioBlta & "','" & CodColegio & "','" & Nom_usu_ses & "','" & Nom_com_usu_ses & "','" & Format(DTPicker1.Value, "yyyy-mm-dd") & "');"
        Command6.Enabled = True
        Command2.Enabled = False
        Text6.Text = "DEVOLUCIÓN"
        Call Command5_Click
    Else
        MsgBox "No se encuentran los movimientos asociados a esta boleta.", vbExclamation, "ALERTA DE ANOMALIA"
    End If
    REC.Close
End Sub

Private Sub Command5_Click()
    Frame3.Visible = False
End Sub

Private Sub Command6_Click()
    Dim CodColegio As String
    CodColegio = RetornaCampo("CFG", "valor", "param='" & IIf(Option1, "CODBC", "CODPK") & "'", conn)
    Call LimpiaFormulas(Form_main.CrystalReport, 99)
    Form_main.CrystalReport.Destination = crptToWindow
    Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\devoluciones.rpt"
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.ReplaceSelectionFormula ("{fnza_boletas.FOLIO_BLTA_FISICO}=" & Trim(Text_Boleta) & " and {fnza_boletas.COLEGIO}='" & CodColegio & "'")
    Form_main.CrystalReport.Action = 1
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Call LimpiaFormulas(Form_main.CrystalReport, 99)
    MsgBox "Adjunte el comprobante a la boleta (original y copia)", vbInformation, "Impresión"
End Sub

Private Sub Form_Load()
    limpiar
    DTPicker1.Value = Date
    DTPicker1.MaxDate = Date
    llenacombo Combo1, "fnza_glosa_devo", "descripcion", "WHERE valido='SI'", conn
End Sub
