Public Class ReportosCE
    Private _CodigoInversion As String
    Private _CodigoCasa As String
    Private _Nombre As String
    Private _FechaDeCompra As Date
    Private _ValorTransado As Double
    Private _Dias As Integer
    Private _FechaVencimiento As Date
    Private _Rendimiento As Double
    Private _Impuestos As Double
    Private _OtrosCostos As Double
    Private _TotalCostos As Double
    Private _MontoALiquidar As Double
    Private _InteresAGenerar As Double
    Private _CostoDeTransferencia As Double
    Private _RendimientoNetoAntesDeImpuestos As Double
    Private _ValorReCompra As Double
    Private _ImpuestosLiquidacion As Double
    Private _IngresoNeto As Double
    Private _ValorNeto As Double
    Private _RendimientoNetoDespuesDeImpuestos As Double
    Private Operaciones As New Operaciones




    Function FechaDeVencimiento(ByVal fecha As Date, ByVal dias As Integer)
        Dim Valor = fecha.AddDays(dias)
        Return Valor

    End Function


    Function Comision(ByVal valortrasado As String, ByVal dias As Integer, ByVal por As Double, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
        Dim Valor As Double = 0
        Valor = valortrasado * dias * por / 365
        Return Valor
    End Function

    Function IOF(ByVal valortrasado As Double, comisioncasa As Double, ByVal comisionbolsa As Double, ByVal dias As Integer, ByVal VALIOF As Double, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
        Dim Valor As Double = 0
        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (dias * VALIOF)) / 365
        Return Valor
    End Function

    Function TotCostos(ByVal ComisionCasa As Double, ByVal ComisionBolsa As Double, ByVal IOF As Double, ByVal OC As Double, ByVal ValorTransado As Double, ByVal Instrumento As String)
        Dim Valor As Double = 0
        Valor = ComisionCasa + ComisionBolsa + IOF + OC
        Return Valor
    End Function
    Function MontoLiquidacion(ByVal ValorTrasado As Double, ByVal totalcosto As Double)
        Dim Valor = ValorTrasado + totalcosto
        Return Valor
    End Function

    Function InteresGenerar(ByVal ValorTrasado As Double, ByVal rendimiento As Double, ByVal dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
        Dim Valor As Double = 0
        Valor = ValorTrasado * rendimiento * dias / 365
        Return Valor
    End Function

    Function RendimientoAntes(ByVal interesgenerar As Double, ByVal totcostos As Double, ByVal valortra As Double, ByVal dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer, ByVal Tabla As String)
        Dim Valor As Double = 0
        If Tabla = "REP0" Then
            Valor = ((interesgenerar - totcostos) / valortra) * (365 / dias)
        Else
            Valor = ((interesgenerar + totcostos) / valortra) * (365 / dias)
        End If
        Return Valor * 100
    End Function

    Function ValorRecompras(ByVal Valortrasado As Double, ByVal InteresGenerar As Double)
        Dim Valor = Valortrasado + InteresGenerar
        Return Valor
    End Function


    Function IngresoNet(ByVal InteresGenerar As Double, ByVal Renta As Double)
        Dim Valor = InteresGenerar - Renta
        Return Valor
    End Function

    Function ValorNet(ByVal ValorTrasado As Double, ByVal IngresoNeto As Double, ByVal CostoTrans As Double)
        Dim Valor = ValorTrasado + IngresoNeto - CostoTrans
        Return Valor
    End Function

    Function RendimientoDespues(ByVal IngresoNeto As Double, ByVal totalcosto As Double, ByVal valortrasado As Double, ByVal dias As Integer, ByVal Fecha1 As Date, Fecha2 As Date, ByVal IndexBase As Integer)
        Dim Valor As Double = 0
        Valor = (IngresoNeto - totalcosto) / valortrasado * 365 / dias
        Return Valor * 100
    End Function
End Class
