ahernandez 6 anni fa
parent
commit
59fd15ed82

+ 4 - 4
DAO/CertificadosDeInversionDAO.vb

@@ -814,10 +814,10 @@ Public Class CertificadosDeInversionDAO
                 .Add("@ComisionPorVentaBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(29).ToString())
                 .Add("@YTMCompra", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(30).ToString())
                 .Add("@YTMVenta", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(31).ToString())
-                .Add("@DiasVenC", SqlDbType.Int).Value = coleccion(32).ToString
-                .Add("@DiasVenV", SqlDbType.Int).Value = coleccion(33).ToString
-                .Add("@DiasAcuC", SqlDbType.Int).Value = coleccion(34).ToString
-                .Add("@DiasAcuV", SqlDbType.Int).Value = coleccion(35).ToString
+                .Add("@DiasVenC", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(32).ToString)
+                .Add("@DiasVenV", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(33).ToString)
+                .Add("@DiasAcuC", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(34).ToString)
+                .Add("@DiasAcuV", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(35).ToString)
                 .Add("@YTMVenC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(36).ToString)
                 .Add("@YTMVenV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(37).ToString)
                 .Add("@IntAcuC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(38).ToString)

+ 1 - 1
DAO/DAOGeneral.vb

@@ -399,7 +399,7 @@ Public Class DAOGeneral
         cmd.CommandType = CommandType.StoredProcedure
 
         cmd.Parameters.Add("@TipoFuncion", SqlDbType.VarChar).Value = TipoFuncion
-        cmd.Parameters.Add("@Version", SqlDbType.Int).Value = 9
+        cmd.Parameters.Add("@Version", SqlDbType.Int).Value = 2
         da = New SqlDataAdapter(cmd)
 
         da.Fill(ds)

+ 230 - 10
DAO/LETESDAO.vb

@@ -6,7 +6,7 @@ Public Class LETESDAO
 
 
 
-    Public Function ActualizarLETE(ByVal coleccion As Collection, ByVal Instrumento As String)
+    Public Function ActualizarLETE(ByVal coleccion As Collection, ByVal Instrumento As String, Optional EmpaquetarTablaBaseDatos As Dictionary(Of Integer, Collection) = Nothing)
         Dim objCon As New Conexion
         Dim retorno As Integer
         Dim sql As String = String.Empty
@@ -15,6 +15,10 @@ Public Class LETESDAO
         If cn.State = ConnectionState.Closed Then
             cn.Open()
         End If
+
+        Dim myTrans As SqlTransaction
+        myTrans = cn.BeginTransaction()
+
         If (Instrumento = "LETE") Then
             sql = "UPDATE [dbo].[LET0] SET 
             
@@ -148,9 +152,11 @@ where [CodInv]=   @CodInv
 
 
         cmd = New SqlCommand
-            cmd.CommandText = sql
+        cmd.CommandText = sql
+        cmd.Connection = cn
+        cmd.Transaction = myTrans
 
-            With cmd.Parameters
+        With cmd.Parameters
             .Add("@ValNom", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(1).ToString)
             .Add("@FOper", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(2).ToString)
             .Add("@FLiq", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(3).ToString)
@@ -177,10 +183,10 @@ where [CodInv]=   @CodInv
                 .Add("FVenc", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(22).ToString)
             End If
 
-                If (Instrumento = "VCN" Or Instrumento = "PBUR") Then
+            If (Instrumento = "VCN" Or Instrumento = "PBUR") Then
 
 
-                    .Add("@ValorPar", SqlDbType.Bit).Value = CByte(coleccion(12))
+                .Add("@ValorPar", SqlDbType.Bit).Value = CByte(coleccion(12))
                 .Add("@FechaUltima", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(13).ToString)
             ElseIf Instrumento = "CETE" Then
                 .Add("@FechaUltima", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(12).ToString)
@@ -197,7 +203,7 @@ where [CodInv]=   @CodInv
                 .Add("FVenc", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(23).ToString)
                 .Add("@IntAcumulado", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(24).ToString)
             End If
-                If Instrumento = "VCN" Then
+            If Instrumento = "VCN" Then
                 .Add("@OtrosCostos", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(14).ToString)
                 .Add("ValTrans", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(15).ToString)
                 .Add("Precio", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(16).ToString)
@@ -212,7 +218,7 @@ where [CodInv]=   @CodInv
                 .Add("FVenc", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(25).ToString)
                 .Add("@IntAcumulado", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(26).ToString)
             End If
-                If Instrumento = "PBUR" Then
+            If Instrumento = "PBUR" Then
                 .Add("ValTrans", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(14).ToString)
                 .Add("Precio", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(15).ToString)
                 .Add("TotPagar", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(16).ToString)
@@ -227,27 +233,129 @@ where [CodInv]=   @CodInv
                 .Add("@IntAcumulado", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(25).ToString)
             End If
 
-            End With
+        End With
+
+        retorno = cmd.ExecuteNonQuery
+
+        If Instrumento = "VCN" Then
 
 
+
+
+            sql = "delete from VCN2 where [CodInv]=@CodInv"
+            cmd = New SqlCommand
+            cmd.CommandText = sql
             cmd.Connection = cn
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+            End With
 
             retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+            For Each FilaRegistros In EmpaquetarTablaBaseDatos
+                Dim FilaColeccion As Collection = FilaRegistros.Value
+
+
+
+
+                sql = "INSERT INTO [dbo].[VCN2](
+           [CodInv]
+          ,[Plazo]
+          ,[Fecha]
+          ,[Monto]
+          ,[Cedeval]
+          ,[PorcentajeRenta]
+          ,[Renta]
+          ,[CostoTransferencia]
+          ,[CostoBanco]
+          ,[TotalRecibir]
+
+
+) VALUES(
+
+           @CodInv
+          ,@Plazo
+          ,@Fecha
+          ,@Monto
+          ,@Cedeval
+          ,@PorcentajeRenta
+          ,@Renta
+          ,@CostoTransferencia
+          ,@CostoBanco
+          ,@TotalRecibir
+
+)
+    "
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                    .Add("@Plazo", SqlDbType.Int).Value = Operaciones.ConvertirEntero(FilaColeccion(2).ToString)
+                    .Add("@Fecha", SqlDbType.Date).Value = Operaciones.ConvertirFecha(FilaColeccion(3).ToString)
+                    .Add("@Monto", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(4).ToString)
+                    .Add("@Cedeval", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(5).ToString)
+                    .Add("@PorcentajeRenta", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(6)) / 100
+                    .Add("@Renta", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(7))
+                    .Add("@CostoTransferencia", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(8))
+                    .Add("@CostoBanco", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(9))
+                    .Add("@TotalRecibir", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(10))
+                End With
+
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+            Next
+
+        End If
+
+
+        ''#############################################################################################################
+        ''#############################################################################################################
+
+        Try
+            myTrans.Commit()
             MsgBox("Registro Modificado con éxito")
 
+        Catch ex As Exception
+            MsgBox("Error al crear el registro")
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+
+
+
+
+
+
+
         cn.Close()
         Return retorno
     End Function
 
-    Public Function NuevoIngreso(ByVal coleccion As Collection, ByVal Instrumento As String)
+    Public Function NuevoIngreso(ByVal coleccion As Collection, ByVal Instrumento As String, Optional EmpaquetarTablaBaseDatos As Dictionary(Of Integer, Collection) = Nothing
+                                 )
         Dim objCon As New Conexion
         Dim retorno As Integer
         Dim sql As String
         Dim cmd As SqlCommand
+
+        Dim myTrans As SqlTransaction
         Dim cn As SqlConnection = objCon.Conectar
         If cn.State = ConnectionState.Closed Then
             cn.Open()
         End If
+        myTrans = cn.BeginTransaction()
         If (Instrumento = "LETE") Then
             sql = "INSERT INTO [dbo].[LET0](
             [CodInv]
@@ -493,6 +601,8 @@ where [CodInv]=   @CodInv
 
             cmd = New SqlCommand
             cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
 
             With cmd.Parameters
                 .Add("@ValNom", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(1).ToString)
@@ -577,12 +687,100 @@ where [CodInv]=   @CodInv
             End With
 
 
-            cmd.Connection = cn
 
             retorno = cmd.ExecuteNonQuery
+
+            ''#############################################################################################################
+            ''#############################################################################################################
+            If Instrumento = "VCN" Then
+                sql = "delete from VCN2 where [CodInv]=@CodInv"
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                End With
+
+                retorno = cmd.ExecuteNonQuery
+
+
+                For Each FilaRegistros In EmpaquetarTablaBaseDatos
+                    Dim FilaColeccion As Collection = FilaRegistros.Value
+
+
+
+
+                    sql = "INSERT INTO [dbo].[VCN2](
+           [CodInv]
+          ,[Plazo]
+          ,[Fecha]
+          ,[Monto]
+          ,[Cedeval]
+          ,[PorcentajeRenta]
+          ,[Renta]
+          ,[CostoTransferencia]
+          ,[CostoBanco]
+          ,[TotalRecibir]
+
+
+) VALUES(
+
+           @CodInv
+          ,@Plazo
+          ,@Fecha
+          ,@Monto
+          ,@Cedeval
+          ,@PorcentajeRenta
+          ,@Renta
+          ,@CostoTransferencia
+          ,@CostoBanco
+          ,@TotalRecibir
+
+)
+    "
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                        .Add("@Plazo", SqlDbType.Int).Value = Operaciones.ConvertirEntero(FilaColeccion(2).ToString)
+                        .Add("@Fecha", SqlDbType.Date).Value = Operaciones.ConvertirFecha(FilaColeccion(3).ToString)
+                        .Add("@Monto", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(4).ToString)
+                        .Add("@Cedeval", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(5).ToString)
+                        .Add("@PorcentajeRenta", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(6)) / 100
+                        .Add("@Renta", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(7))
+                        .Add("@CostoTransferencia", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(8))
+                        .Add("@CostoBanco", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(9))
+                        .Add("@TotalRecibir", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(FilaColeccion(10))
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+                Next
+
+
+            End If
+
+            ''#############################################################################################################
+            ''#############################################################################################################
+
+
+
+            myTrans.Commit()
+                MsgBox("Datos Ingresados")
+
+
+
             MsgBox("Registro creado con éxito")
         Catch ex As Exception
             MsgBox("Error al crear el registro")
+            myTrans.Rollback()
+            MsgBox(ex.Message)
         End Try
         cn.Close()
         Return retorno
@@ -702,6 +900,28 @@ where [CodInv]=   @CodInv
         cn.Close()
         Return Coleccion
     End Function
+
+
+
+
+    Public Function CargarFilas(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from VCN2 where CodInv='" + codigo + "'"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        Dim Tabla As New DataTable
+
+
+        dr = cmd.ExecuteReader
+        Tabla.Load(dr)
+        cn.Close()
+        Return Tabla
+    End Function
 End Class
 
 

+ 0 - 68
ENTI/CalculosDias.vb

@@ -1,68 +0,0 @@
-Public Class CalculosDias
-    Private Operaciones As New Operaciones
-    Sub AgregarFechaIngresos(ByRef dgvIngresos As DataGridView, ByRef dtpFechaLiquidacion As DateTimePicker,
-                             ByRef NombreCampoFecha As String, ByRef TipoBase As Integer)
-
-        Dim Index As Integer = dgvIngresos.CurrentRow.Index
-        Dim IndexAnterior As Integer = Index - 1
-        Dim FechaAnterior As Date = Date.Today.Date
-        Dim FechaActual As Date = Date.Today.Date
-        Dim FechaLiquidacion As Date = dtpFechaLiquidacion.Value
-        Dim DiaFijo As Integer = FechaLiquidacion.Day
-        If Index > 0 Then
-            FechaAnterior = Operaciones.ConvertirFecha(dgvIngresos.Rows(IndexAnterior).Cells(NombreCampoFecha).Value.ToString)
-            FechaActual = CalcularFecha(FechaAnterior, DiaFijo, "Mensual", "M", TipoBase)
-            dgvIngresos.Rows(Index).Cells(NombreCampoFecha).Value = Format((FechaActual), "dd/MM/yyyy").ToString
-
-        Else
-
-            FechaActual = CalcularFecha(Operaciones.ConvertirFecha(FechaLiquidacion), DiaFijo, "Mensual", "M", TipoBase)
-            dgvIngresos.Rows(Index).Cells(NombreCampoFecha).Value = Format(FechaActual, "dd/MM/yyyy").ToString
-        End If
-
-    End Sub
-
-
-
-
-
-
-    Function CalcularFecha(ByVal FechaInicial As Date, ByVal DiaFijo As Integer, ByRef FormaCalcularFechas As String,
-                           ByRef Periodicidad As String, ByRef TipoBase As Integer)
-        'Declaracion de Variables'
-        Dim BaseDias As Integer = 0
-        Dim FechaFinal As Date = Date.Today.Date
-
-
-
-
-
-
-        If (TipoBase = 0 Or TipoBase = 2) Then
-
-            BaseDias = 360
-
-
-            If FormaCalcularFechas = "FinMes" Then
-                FechaFinal = Operaciones.FechaFinMes(FechaInicial, Periodicidad, BaseDias)
-
-            ElseIf FormaCalcularFechas = "Mensual" Then
-
-                FechaFinal = Operaciones.FechaMensual(FechaInicial, Periodicidad, FormaCalcularFechas, 0, DiaFijo, BaseDias)
-            End If
-
-
-        ElseIf TipoBase = 1 Or TipoBase = 3 Then
-            BaseDias = 365
-
-            If FormaCalcularFechas = "FinMes" Then
-                FechaFinal = Operaciones.FechaFinMes(FechaInicial, Periodicidad, BaseDias)
-
-            ElseIf FormaCalcularFechas = "Mensual" Then
-
-                FechaFinal = Operaciones.FechaMensual(FechaInicial, Periodicidad, FormaCalcularFechas, 0, DiaFijo, BaseDias)
-            End If
-        End If
-        Return FechaFinal
-    End Function
-End Class

+ 421 - 0
ENTI/CalculosTablaDiasFecha.vb

@@ -0,0 +1,421 @@
+Public Class CalculosTablaDiasFecha
+    Private Operaciones As New Operaciones
+    function AgregarFechaIngresos(ByRef dgvIngresos As DataGridView, ByRef dtpFechaLiquidacion As DateTimePicker,
+                             ByRef NombreCampoFecha As String, ByRef TipoBase As Integer, ByRef Periodicidad As String,
+                             ByRef TipoCalculoFecha As String, ByRef Index As Integer)
+
+        Dim Fecha As Date = Date.Now.Date
+        Dim IndexAnterior As Integer = Index - 1
+        Dim FechaAnterior As Date = Date.Today.Date
+        Dim FechaActual As Date = Date.Today.Date
+        Dim FechaLiquidacion As Date = dtpFechaLiquidacion.Value
+        Dim DiaFijo As Integer = FechaLiquidacion.Day
+        If Index > 0 Then
+            FechaAnterior = Operaciones.ConvertirFecha(dgvIngresos.Rows(IndexAnterior).Cells(NombreCampoFecha).Value)
+            FechaActual = CalcularFecha(FechaAnterior, DiaFijo, TipoCalculoFecha, Periodicidad, TipoBase)
+            Fecha = Format((FechaActual), "dd/MM/yyyy").ToString
+
+        Else
+
+            FechaActual = CalcularFecha(Operaciones.ConvertirFecha(FechaLiquidacion), DiaFijo, TipoCalculoFecha, Periodicidad, TipoBase)
+            Fecha = Format(FechaActual, "dd/MM/yyyy").ToString
+        End If
+        Return Fecha
+    End function
+
+
+
+
+
+
+    Private Function CalcularFecha(ByVal FechaInicial As Date, ByVal DiaFijo As Integer, ByRef FormaCalcularFechas As String,
+                           ByRef Periodicidad As String, ByRef TipoBase As Integer)
+        'Declaracion de Variables'
+        Dim BaseDias As Integer = 0
+        Dim FechaFinal As Date = Date.Today.Date
+
+
+
+
+
+
+        If (TipoBase = 0 Or TipoBase = 2) Then
+
+            BaseDias = 360
+
+
+            If FormaCalcularFechas = "FinMes" Then
+                FechaFinal = Operaciones.FechaFinMes(FechaInicial, Periodicidad, BaseDias)
+
+            ElseIf FormaCalcularFechas = "Mensual" Then
+
+                FechaFinal = Operaciones.FechaMensual(FechaInicial, Periodicidad, FormaCalcularFechas, 0, DiaFijo, BaseDias)
+            End If
+
+
+        ElseIf TipoBase = 1 Or TipoBase = 3 Then
+            BaseDias = 365
+
+            If FormaCalcularFechas = "FinMes" Then
+                FechaFinal = Operaciones.FechaFinMes(FechaInicial, Periodicidad, BaseDias)
+
+            ElseIf FormaCalcularFechas = "Mensual" Then
+
+                FechaFinal = Operaciones.FechaMensual(FechaInicial, Periodicidad, FormaCalcularFechas, 0, DiaFijo, BaseDias)
+            End If
+        End If
+        Return FechaFinal
+    End Function
+
+
+
+
+
+    Function AgregarCorrelativo(ByRef dgvTabla As DataGridView, ByRef PosicionIndex As Integer)
+        Dim Cantidad As Integer = PosicionIndex
+        Dim Index As Integer = 0
+        Dim Correlativo As Integer = 0
+        While Index <= Cantidad
+            Correlativo = Index + 1
+
+            Index += 1
+        End While
+        Return Correlativo
+    End Function
+
+
+
+
+
+
+
+    Function AgregarDias(ByRef dgvTabla As DataGridView, ByRef dtpFechaLiquidacion As DateTimePicker, ByRef TipoBase As Integer,
+                    ByRef Periodicidad As String, ByRef FormaCalcularFechas As String, ByRef NombreCampoFecha As String,
+                    ByRef NombreCampoDias As String, ByRef Index As Integer)
+
+        Dim IndexAnterior As Integer = Index - 1
+        Dim FechaAnterior As String = String.Empty
+        Dim FechaActual As String = String.Empty
+        Dim FechaLiquidacion As Date = Format(dtpFechaLiquidacion.Value, "dd/MM/yyyy")
+        Dim BaseCalculo As Integer = 0
+        Dim Meses As Integer = 0
+        Dim DiasFinales As Integer = 0
+        Dim CantidadDiasNormal360 As Integer = 0
+        Dim CantidadDias360 As Integer = 0
+        If Periodicidad = "M" Then
+            Meses = 1
+        ElseIf Periodicidad = "T" Then
+            Meses = 3
+        ElseIf Periodicidad = "S" Then
+            Meses = 6
+        ElseIf Periodicidad = "A" Then
+            Meses = 12
+        End If
+
+        CantidadDiasNormal360 = Meses * 30
+        If TipoBase = 0 Or TipoBase = 2 Then
+            BaseCalculo = 360
+
+        ElseIf TipoBase = 1 Or TipoBase = 3 Then
+            BaseCalculo = 365
+        End If
+
+
+
+        If Index > 0 Then
+            FechaAnterior = Operaciones.ConvertirFecha(dgvTabla.Rows(IndexAnterior).Cells(NombreCampoFecha).Value)
+            FechaActual = Operaciones.ConvertirFecha(dgvTabla.Rows(Index).Cells(NombreCampoFecha).Value)
+
+
+            If BaseCalculo = 360 Then
+                If FormaCalcularFechas = "FinMes" Then
+                    DiasFinales = Operaciones.Base360(FechaAnterior, FechaActual)
+                ElseIf FormaCalcularFechas = "Mensual" Then
+                    DiasFinales = CantidadDiasNormal360
+
+                End If
+
+            ElseIf BaseCalculo = 365 Then
+                DiasFinales = Operaciones.Base365(FechaAnterior, FechaActual)
+
+
+            End If
+
+
+
+        Else
+            'Primera Fecha'
+
+
+
+            FechaActual = Operaciones.ConvertirFecha(dgvTabla.Rows(Index).Cells(NombreCampoFecha).Value)
+
+
+            If BaseCalculo = 360 Then
+                If FormaCalcularFechas = "FinMes" Then
+                    DiasFinales = Operaciones.Base360(FechaLiquidacion, FechaActual)
+                ElseIf FormaCalcularFechas = "Mensual" Then
+                    DiasFinales = CantidadDiasNormal360
+
+                End If
+
+            ElseIf BaseCalculo = 365 Then
+                DiasFinales = Operaciones.Base365(FechaLiquidacion, FechaActual)
+
+
+            End If
+
+
+
+        End If
+        Return DiasFinales
+    End Function
+
+
+
+
+
+
+
+
+    Function CalcularFormulasDiasBase(ByVal dtpFechaLiquidacion As Date, ByVal dtpFechaVencimiento As Date,
+                                      ByRef TipoBase As Integer)
+        Dim ListaDiasBase As New Dictionary(Of String, String)
+
+        Dim Dias1 As Double = 0
+        Dim Dias2 As Double = 0
+
+        Dim Dias360 As Double = Operaciones.Base360(dtpFechaLiquidacion, dtpFechaVencimiento)
+        Dim Dias365 As Double = Operaciones.Base365(dtpFechaLiquidacion, dtpFechaVencimiento)
+
+
+
+        If (TipoBase = 0) Then
+            ListaDiasBase.Add("DiasNormales", Dias360)
+            ListaDiasBase.Add("DiasEspeciales", 0)
+            ListaDiasBase.Add("TipoBase", "360")
+
+
+
+        ElseIf (TipoBase = 1) Then
+
+
+            Dim FechaInicial = dtpFechaLiquidacion
+            Dim FechaFinal = dtpFechaVencimiento
+
+
+
+            Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
+
+            Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
+            Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+            If (Not CambioDeFecha = 0) Then
+
+
+                If CambioDeFecha = 1 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    Dias1 = DiasSegundaFecha
+                    Dias2 = DiasPrimeraFecha
+
+
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    Dias1 = DiasPrimeraFecha
+                    Dias2 = DiasSegundaFecha
+                End If
+
+
+
+
+                ListaDiasBase.Add("DiasNormales", Dias1)
+                ListaDiasBase.Add("DiasEspeciales", Dias2)
+                ListaDiasBase.Add("TipoBase", "365")
+
+            Else
+
+                If (Operaciones.AñoBisiesto(FechaInicial) + 1 = 365) Then
+
+
+                    ListaDiasBase.Add("DiasNormales", Dias365)
+                    ListaDiasBase.Add("DiasEspeciales", 0)
+                    ListaDiasBase.Add("TipoBase", "365")
+
+                End If
+
+                If (Operaciones.AñoBisiesto(FechaInicial) + 1 = 366) Then
+                    ListaDiasBase.Add("DiasNormales", 0)
+                    ListaDiasBase.Add("DiasEspeciales", Dias365)
+                    ListaDiasBase.Add("TipoBase", "365")
+                End If
+
+            End If
+
+
+        ElseIf (TipoBase = 2) Then
+            ''''''''''''''''
+            Dim FechaInicial = dtpFechaLiquidacion
+            Dim FechaFinal = dtpFechaVencimiento
+
+
+
+            Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
+
+            Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase360(FechaInicial)
+            Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase360(FechaFinal)
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+            If (Not CambioDeFecha = 0) Then
+
+
+                If CambioDeFecha = 1 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    Dias1 = DiasSegundaFecha
+                    Dias2 = DiasPrimeraFecha
+
+
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    Dias1 = DiasPrimeraFecha
+                    Dias2 = DiasSegundaFecha
+                End If
+
+                ListaDiasBase.Add("DiasNormales", Dias1)
+                ListaDiasBase.Add("DiasEspeciales", Dias2)
+                ListaDiasBase.Add("TipoBase", "360/365")
+
+            Else
+
+                If (Operaciones.AñoBisiesto(FechaInicial) + 1 = 365) Then
+
+
+                    ListaDiasBase.Add("DiasNormales", Dias360)
+                    ListaDiasBase.Add("DiasEspeciales", 0)
+                    ListaDiasBase.Add("TipoBase", "360/365")
+
+                End If
+
+                If (Operaciones.AñoBisiesto(FechaInicial) + 1 = 366) Then
+
+
+                    ListaDiasBase.Add("DiasNormales", 0)
+                    ListaDiasBase.Add("DiasEspeciales", Dias360)
+                    ListaDiasBase.Add("TipoBase", "360/365")
+                End If
+
+            End If
+
+
+
+        Else
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+            Dim FechaInicial = dtpFechaLiquidacion
+            Dim FechaFinal = dtpFechaVencimiento
+
+
+
+            Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
+
+            Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
+            Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+            If (Not CambioDeFecha = 0) Then
+
+
+                If CambioDeFecha = 1 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    Dias1 = DiasSegundaFecha
+
+                    Dias2 = DiasPrimeraFecha
+
+
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    Dias1 = DiasPrimeraFecha
+                    Dias2 = DiasSegundaFecha
+                End If
+
+                ListaDiasBase.Add("DiasNormales", Dias1)
+                ListaDiasBase.Add("DiasEspeciales", Dias2)
+                ListaDiasBase.Add("TipoBase", "365/360")
+
+            Else
+
+
+
+                ListaDiasBase.Add("DiasNormales", Dias365)
+                ListaDiasBase.Add("DiasEspeciales", 0)
+                ListaDiasBase.Add("TipoBase", "365/360")
+
+
+            End If
+
+        End If
+
+
+        Return ListaDiasBase
+
+    End Function
+
+
+    Sub AgregarValoresCamposdgvVacios(ByRef dgvTabla As DataGridView, ByVal index As Integer, ByVal NombreCampo As String, ByVal ValorAgregar As String)
+        Dim value As String = dgvTabla.Rows(index).Cells(NombreCampo).Value
+        If String.IsNullOrEmpty(value) Then
+            dgvTabla.Rows(index).Cells(NombreCampo).Value = ValorAgregar
+        End If
+
+    End Sub
+
+
+
+    Function EmpaquetarTablaBaseDatos(ByRef dgvTabla As DataGridView)
+
+        Dim ColumnasRegistro As New Dictionary(Of Integer, Collection)
+
+
+        Dim IndexFilas As Integer = dgvTabla.Rows.Count - 1
+        Dim IndexColumnas As Integer = dgvTabla.Columns.GetColumnCount(DataGridViewElementStates.Visible) - 1
+
+        Dim IndexVertical As Integer = 0
+        Dim IndexHorizontal As Integer = 0
+
+        While IndexFilas >= IndexVertical
+            Dim FilasRegistros As New Collection
+            IndexHorizontal = 0
+
+            While IndexColumnas >= IndexHorizontal
+                FilasRegistros.Add(dgvTabla.Rows(IndexVertical).Cells(IndexHorizontal).Value)
+
+                IndexHorizontal += 1
+            End While
+            ColumnasRegistro.Add(IndexVertical, FilasRegistros)
+            IndexVertical += 1
+        End While
+        Return ColumnasRegistro
+    End Function
+
+End Class

+ 14 - 2
ENTI/Operaciones.vb

@@ -526,7 +526,7 @@
         Return Dias
     End Function
 
-    Function DiasDespuesCambioPrimeraFecha360(ByVal FechaIncial As Date, ByVal FechaFinal As Date, ByVal CambioDeFecha As Integer)
+    Function DiasDespuesCambioPrimeraFecha360(ByVal FechaInicial As Date, ByVal FechaFinal As Date, ByVal CambioDeFecha As Integer)
         Dim Dias As Integer
 
         Dias = Base360(FechaInicial, FechaFinal)
@@ -1080,13 +1080,25 @@
 
     Function ConvertirEntero(ByVal Int As String)
         Dim value As Integer = 0
+        Dim TemporaCadena As String = Int
+        Dim TemporalNumero As Integer = 0
         If Int Is Nothing Then
             Int = 0
         End If
 
 
         Int = Int.ToString.Trim("%")
-        If (Integer.TryParse(Int, value)) Then Return value Else Return 0
+
+        If Integer.TryParse(Int, value) Then
+            Return value
+        Else
+            Try
+                TemporalNumero = TemporaCadena
+                Return TemporalNumero
+            Catch ex As Exception
+                Return 0
+            End Try
+        End If
     End Function
 
     Function ConvertirCadena(ByVal Cadena As Object)

+ 18 - 18
FRM/frmFOIN.resx

@@ -139,29 +139,29 @@
   <data name="navNuevo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHbSURBVDhPnZFPSNtQHMezHdzV6WVXr/O2sycVT24edurS
-        6qyV2Che6tncJkPGEHaalylWZxUxRVDBk6CuVIy6WEtb1z9KNdG0TW3zh47+zHu01RYjxS98+PFLfu/z
-        kvcIlDT3vTHBTzfFuR+t8ZOlVp73NOAX9SQUmnqVOZ54nQ5OtkT9PYVcgOmlnaM+apASHXZKHKjBbkB9
-        Hk5aLfZtLEjsfmuSA1+7tT+doPs/gM59AlWRQNVuTcnlZUASLLjwfWnO+LuUrcn2on40/E7b6wDtgIRw
-        qmgKkpAkJZYEM81Znnmr738EbacNVN97EARB5yJJmHP/hlXWW2FpeQWOotfVAnRgAu95M9jv+K8ZEnad
-        PUcDUakAEVGBsEFEVCtEU4VqQTm9tgFFTMvAetfwQPBcgp/Tv2B21l1hfsEDoaRsLpCyefypaCB2nQP+
-        3yUcn1UTu1HqEwSSOeAil3BggGqZ0ysTga1GcJKQwD2/WDlABOpPLzImAmu1IHxTgKCg3GPsHLxS8fO6
-        BIePXCPq/8ZqrrEcK9mfeihIyEVMvFQf8qjAYhnKpw3B+sYmHngKRc1CX98IX1pKEADwwvgF1uUaB+eQ
-        C2jnGK5m0DSt20iHl2GYlyXFc0MQd5/FbCxY99uJAAAAAElFTkSuQmCC
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHcSURBVDhPnZE7TNtQFIZdBrryWLqywsbMVCqmtgxMwQmP
+        EGRiqi7pXG9UgKoKiQkWQCSUgBCOKgHqVgnaKBUu1IQoSckDFLDBSRwSP5QqB9+rJJAIV1F/6dPRsc/9
+        rn0vgZLhPrUk+cW2BDfflTjZ6OJ5bzN+0UjC4bmn2eMPrZnQbEcs0F/MB5kh2vnWT41TosNOiWN12A2o
+        kcmU1WL/hgXJg49tcnD6pfbjBeiB16Bzg6AqEqjarSn5ggxIggUX/qn2bKBP+TrzvKQfTXZr33tBOyQh
+        ki6ZgiQkSYllwXJ7jmc69Z8DoO33gOp/BYIg6Fw0Bavuz7DN+qpsbG7BUey6VoAOTOC9z8ZHHX81Q8Lu
+        sOdoICYVISoqEDGIimqVWLpYK6hkyDamiBkZWN8XPBA6l2BhcQlWVtxVPGteCKdkc4GUK+BPRQPx6zzw
+        Z5dw/KeW+I3SmCCYygMXvYRDA1QrnF6ZCGx1gpOkBG7PevUAEag/vciaCKy1gshNEUKCco+xc+hKxc8b
+        Evx65BpR/zted42VWMnR9ENBUi5hEuX6kEcFFstEIWMIdnb38MC/UNQcDA+/4ctLCQIAnhi/wLpc78E5
+        4QLa+Q5XM2ia1m2kw8cwTFNZ8b8hiDuZPmwq6xyY/wAAAABJRU5ErkJggg==
 </value>
   </data>
   <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAG0SURBVDhPlZM7S8NQGIbTpv4AF3HwCg4iOCnZpFovmz9A
-        cRFFnBwcFF3ERVBxsCF0cnLRwQ5KsYJg6yIILg5u3kBSmrYmvaT39vV8oalVU60fPCQczvvk+84hXKXa
-        GAMM4Q+6GHbGjxpIp9NaIBAoFYtFWJHNZiGK4j7baykRKJxKpaDrepV4PA5VVREOhw1JKBSCJEk/JDaG
-        QBsymQxyuZzxJJLJJDRNg6IohoB1CfqIx+MxJUZVBRQ2IQEFEokEIpHIl3EIylSyn4JCoVDdQO80tzlK
-        NBo1OpFlub7gO7US6oTOIxaLNS4gTAmNQ2dCIlpvWEDk83njXEhC0Nq/BNTFy4kbN7N9uBxtQnC6E6Jg
-        k34VUMjk1SvifmUIGd8eyg9+6EfLuHL2ly6GHUt/Cqj965kepFkY7klgtRnY6kZkZxi+Ef6prqBWQm2X
-        77yoLXWjFZsuR7kqCAaDZSsJEZjqQOpgDmCh7AqHd8brIg//OP9GAqpBdj06k1j+TM/Hu7hd6IW82g1l
-        rQmP8zZcOh2l8zH7eiXPtTMGGXQ1lhxMtEinLl6mts+cfPhwiN/mOI77AHOJg+sKO6pQAAAAAElFTkSu
-        QmCC
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGzSURBVDhPlZM7S8NQGIbTpv4AF3HwCg4iOFm6SbVeNn+A
+        4iKKODk4WHTRSVBxsCF0cnLRwQ5KsYLQ6iIILg5u3kBSerPX9N68ni80sdrU1g8eEg7nffJ95xCuWl2M
+        EYatCX0MM6OuRrLZbMLv91fK5TKMyOfzEAThkO01lNgonMlkIMuyTjKZRDweRygUUiXBYBCiKNZJTAwb
+        bcjlcigUCuqTSKfTSCQSCIfDqoB1CfqI2+3WJGrpAgprkIACqVQKkUjkxzgEZarZb0GpVNI30DvNrY0S
+        jUbVTiRJaiz4Ta2EOqHziMVirQsITULj0JmQiNZbFhDFYlE9F5IQtPYvAXXxdubC3cIQrifacDPXC8Fm
+        Ev8UUEjj3SPgcX0UOe8BlCcf5JM1+O3Dlasxy2pTAbV/Oz+ALAvDNQM424GdfkT2xuAd518aCmol1Lby
+        4EFtxbc6se2wKLogEAgoRhIiMNuDzNEiwEL5dQ6fjPcVHr4p/oMEVFZ2PTKTGP5Mr6f7uF8ehOTsR3ij
+        Dc9LJlzbLZXLSfNmNc91M6wMuhpDjqY7xHMHL1HbF3Y+dDzK73Icx30BWVyD3W9se9YAAAAASUVORK5C
+        YII=
 </value>
   </data>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

+ 2 - 0
FRM/frmFOIN.vb

@@ -1249,5 +1249,7 @@
         End If
     End Sub
 
+    Private Sub dgvIngresos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellClick
 
+    End Sub
 End Class

+ 17 - 14
FRM/frmLetes.Designer.vb

@@ -80,11 +80,11 @@ Partial Class frmLetes
         Me.dtpRedencion = New System.Windows.Forms.DateTimePicker()
         Me.dgvIngresosVCN = New System.Windows.Forms.DataGridView()
         Me.Label18 = New System.Windows.Forms.Label()
-        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
+        Me.grpIngresosVCN = New System.Windows.Forms.GroupBox()
         CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).BeginInit()
         Me.BindingNavigator1.SuspendLayout()
         CType(Me.dgvIngresosVCN, System.ComponentModel.ISupportInitialize).BeginInit()
-        Me.GroupBox1.SuspendLayout()
+        Me.grpIngresosVCN.SuspendLayout()
         Me.SuspendLayout()
         '
         'lblBono
@@ -592,6 +592,8 @@ Partial Class frmLetes
         '
         'dgvIngresosVCN
         '
+        Me.dgvIngresosVCN.AllowUserToAddRows = False
+        Me.dgvIngresosVCN.AllowUserToDeleteRows = False
         Me.dgvIngresosVCN.BackgroundColor = System.Drawing.Color.White
         Me.dgvIngresosVCN.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
         Me.dgvIngresosVCN.Location = New System.Drawing.Point(6, 58)
@@ -609,15 +611,16 @@ Partial Class frmLetes
         Me.Label18.TabIndex = 142
         Me.Label18.Text = "Detalles de Ingresos"
         '
-        'GroupBox1
+        'grpIngresosVCN
         '
-        Me.GroupBox1.Controls.Add(Me.Label18)
-        Me.GroupBox1.Controls.Add(Me.dgvIngresosVCN)
-        Me.GroupBox1.Location = New System.Drawing.Point(387, 212)
-        Me.GroupBox1.Name = "GroupBox1"
-        Me.GroupBox1.Size = New System.Drawing.Size(586, 267)
-        Me.GroupBox1.TabIndex = 143
-        Me.GroupBox1.TabStop = False
+        Me.grpIngresosVCN.Controls.Add(Me.Label18)
+        Me.grpIngresosVCN.Controls.Add(Me.dgvIngresosVCN)
+        Me.grpIngresosVCN.Location = New System.Drawing.Point(387, 212)
+        Me.grpIngresosVCN.Name = "grpIngresosVCN"
+        Me.grpIngresosVCN.Size = New System.Drawing.Size(586, 267)
+        Me.grpIngresosVCN.TabIndex = 143
+        Me.grpIngresosVCN.TabStop = False
+        Me.grpIngresosVCN.Visible = False
         '
         'frmLetes
         '
@@ -628,7 +631,7 @@ Partial Class frmLetes
         Me.BackColor = System.Drawing.Color.WhiteSmoke
         Me.CancelButton = Me.btnCancelar
         Me.ClientSize = New System.Drawing.Size(985, 632)
-        Me.Controls.Add(Me.GroupBox1)
+        Me.Controls.Add(Me.grpIngresosVCN)
         Me.Controls.Add(Me.dtpRedencion)
         Me.Controls.Add(Me.lblRedencion)
         Me.Controls.Add(Me.btnRedencion)
@@ -686,8 +689,8 @@ Partial Class frmLetes
         Me.BindingNavigator1.ResumeLayout(False)
         Me.BindingNavigator1.PerformLayout()
         CType(Me.dgvIngresosVCN, System.ComponentModel.ISupportInitialize).EndInit()
-        Me.GroupBox1.ResumeLayout(False)
-        Me.GroupBox1.PerformLayout()
+        Me.grpIngresosVCN.ResumeLayout(False)
+        Me.grpIngresosVCN.PerformLayout()
         Me.ResumeLayout(False)
         Me.PerformLayout()
 
@@ -749,5 +752,5 @@ Partial Class frmLetes
     Friend WithEvents dtpRedencion As DateTimePicker
     Friend WithEvents dgvIngresosVCN As DataGridView
     Friend WithEvents Label18 As Label
-    Friend WithEvents GroupBox1 As GroupBox
+    Friend WithEvents grpIngresosVCN As GroupBox
 End Class

+ 11 - 11
FRM/frmLetes.resx

@@ -139,28 +139,28 @@
   <data name="navNuevo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHbSURBVDhPnZFNTNpgGMe7Hbar08uuu86b553mspPTgydW
-        PhQxlbp4YWd727Isy2LiSS/ODFQ0xhIT59VEN4Kx6ioSwPGhQVotUAb9CAuPfd8AE0IN8Z/88uRpn/f3
-        tu9LoOS5r11pfr47xc32pk5We3ne/wi/6CTR6MzjwvHHJ/nI52eJ0FClFGbstHsqSI1TostJiWMtOA2o
-        kcmM1eLcwYL03pduOfxpQPv1CvTQIOjcW1AVCVTtrymlsgxIggUXwQ89hdBrZY15WdWPJvu0n/2gHZAQ
-        y1VNQRKSpMSa4FtPkWee6/vDoO2+ADX4BgRB0Ll4Br57l2GDDTRYXVuHo8RVswAdmMD7n46Puv5phoTd
-        Ys/RQEKqQFxUIGYQF9UGiVylWVCP3TamiHkZ2MAmHoicSzA3vwCLi94GviU/RDOyuUAqlvGnooHkVQn4
-        P5dwfNZM8lrpTBDOlICLX8KBAap1TrMmAluL4CQtgde30jhABOpPLwomAmuzIHZdgYig/MfYOZJV8fOO
-        BIdtrhH1v5Mt11iPlRzN3Rak5SomVau3aSuwWCbKeUOw9WMbD9yFohbB4XjH15YSBAA8MH6B9XimwT3h
-        Adr9HlczaJrWbaQrwDDMw5riviGIG0RhbBComwuwAAAAAElFTkSuQmCC
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHaSURBVDhPnZE7TNtQFIYNA6wFFlZW2Dp3AsRUytApdQIl
+        BJkYxBJmvIEQQlWlTmVpUQMlIIQjJGBFgjZKhXmYECUpeYACNjiJ08QPBeXU9yoJJMIo4pc+HR373O/a
+        9xIoae7TqwS/2BrnvnTFz9a6eN7ThF/Uk1Doc3PmZLYlHZzviPoHCrkAM0g7J33UKCU67JQ4UoPdgPo4
+        nrRa7HtYkDhYaJUDc2+1372g+9+Bzn0AVZFA1f6ZksvLgCRYcOWbacv4+xQP013Uj8dfa796QDskIZwq
+        moIkJEmJJcH3tizPdOp/3oO2/wZUXz8IgqBzkST8cP+ETdZbYW19A46jt9UCdGAC72kfHXbca4aE3WYv
+        0UBUKkBEVCBsEBHVCtFUoVpQzqBtRBHTMrDeLTwQvJTg6+I3WFpyV1he8UAoKZsLpGwefyoaiN3mgL+4
+        hpO/1cTulPoEgWQOuMg1HBqgWub8xkRgqxGcJSRwL69WDhCB+vOrjInAWi0I3xUgKCgPGDsHb1T8vC7B
+        0RPXiPrTWM01lmMlh1OPBQm5iImX6mOeFFgsY/m0Idje2cUDz6GoWRgamuBLSwkCABqMX2BdrmlwjrmA
+        dk7hagZN07qNdHgZhmksKV4agvgPPdlsDr+ViZAAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
         YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGySURBVDhPlZM7S8NQGIbTpv4AF3HwCg4iOLV0K631svkD
-        FBdRxMnBoaKLm6DioCF06uSig4UqRQUh6iIILg5uXgqS0pu9pk2vr+cLTa221frBQ8LhvE++7xzCVauH
+        FBdRxMnBoaKLm6DioCF06uSigy0oRQUh6iIILg5uXgqS0pu9pk2vr+cLTa221frBQ8LhvE++7xzCVauH
         YWZY/2CAYWQ0lDmbzSYkSSqXSiU0Q1VVCIKwz/Y2lVgpnMlkoChKjWQyiXg8jlAopEmCwSBEUWyQGBhW
         2pDL5ZDP57UnkU6nkUgkEA6HNQHrEvQRt9utS7SqCSisQwIKpFIpRCKRb+MQlKlmvwTFYrG2gd5pbn2U
         aDSqdSLLcmvBT+ol1AmdRywWa19A6BIah86ERLTetoAoFArauZCEoLV/CaiLt5MD3M2P4Gq8Azez/RCs
         BvFXAYV0Al4Bjy4bcv49VJ4uoBytQrKPli8dppU/BdT+7dwQsiyMg2lgrRPYGkRkxwH/GP/SUlAvobYr
         D17UV3yzG5tOU6Um8Pl8lWYS4nqmDxnPAsBCqovDByOwzONikn8nAZWFXY/S6md6Pd7F/dIw5LVBhNc7
-        8LxowJXdVD6fMG5U81wvw8Kgq2mKZ6pLPHXyMrV9ZudDhzZ+m+M47hM2pIOrSi+qCgAAAABJRU5ErkJg
+        8LxowJXdVD6fMG5U81wvw8Kgq2mKZ6pLPHXyMrV9ZudDhzZ+m+M47hMyToOlHEECwQAAAABJRU5ErkJg
         gg==
 </value>
   </data>

+ 276 - 13
FRM/frmLetes.vb

@@ -7,8 +7,8 @@ Public Class frmLetes
     Dim IndexBase As Integer = 0
     Dim TipoTransaccion = "OK"
     Dim Operaciones As New Operaciones
-    Dim CalculosDias As New CalculosDias
-
+    Dim CalculosTablaDiasFecha As New CalculosTablaDiasFecha
+    Dim CargaCompletaInstrumento As Boolean = False
 
 
     Dim V_txtPrecio = 0.0, V_txtValorTransado = 0.0, V_txtComisionCasa = 0.0, V_txtComisionBolsa = 0.0, V_txtIngresoBruto = 0.0, V_txtTotalAPagar = 0.0, V_txtIngresoNeto = 0.0, V_txtRendimientoNeto = 0.0, V_txtDiasAcumulados = 0.0
@@ -199,7 +199,7 @@ Public Class frmLetes
     End Sub
 
     Sub CrearColumnasIngresosVCN()
-        Dim Correlativo, Plazo, Fecha, Monto, CostoCedeval, PorcentajeRenta,
+        Dim Correlativo, Plazo, Fecha, Monto, CostoCedeval, PorcentajeRenta, Renta,
         CostoTransferencia, CostoBanco, TotalRecibir As New DataGridViewTextBoxColumn
 
 
@@ -209,6 +209,7 @@ Public Class frmLetes
         Monto.Name = "Monto"
         CostoCedeval.Name = "CostoCedeval"
         PorcentajeRenta.Name = "PorcentajeRenta"
+        Renta.Name = "Renta"
         CostoTransferencia.Name = "CostoTransferencia"
         CostoBanco.Name = "CostoBanco"
         TotalRecibir.Name = "TotalRecibir"
@@ -222,6 +223,7 @@ Public Class frmLetes
         Monto.HeaderText = "Monto"
         CostoCedeval.HeaderText = "Costo de Cedeval"
         PorcentajeRenta.HeaderText = "Porcentaje de la Renta"
+        Renta.HeaderText = "Renta"
         CostoTransferencia.HeaderText = "Costo de Transferencia"
         CostoBanco.HeaderText = "Costo de Banco"
         TotalRecibir.HeaderText = "Total a Recibir"
@@ -232,6 +234,7 @@ Public Class frmLetes
         dgvIngresosVCN.Columns.Add(Monto)
         dgvIngresosVCN.Columns.Add(CostoCedeval)
         dgvIngresosVCN.Columns.Add(PorcentajeRenta)
+        dgvIngresosVCN.Columns.Add(Renta)
         dgvIngresosVCN.Columns.Add(CostoTransferencia)
         dgvIngresosVCN.Columns.Add(CostoBanco)
         dgvIngresosVCN.Columns.Add(TotalRecibir)
@@ -239,14 +242,198 @@ Public Class frmLetes
     End Sub
 
 
-    Sub CalculosIngresosVCN()
-        CalculosDias.AgregarFechaIngresos(dgvIngresosVCN, dtpFechaLiquidacion, "Fecha", DefinirBaseDias())
+    Sub CalculosIngresosVCN(ByRef TipoCalculo As String)
+        If TipoCalculo = "Global" Then
+
+
+            Dim AgregarFechasIndex As Integer = 0
+            Dim AgregarMasCamposIndex As Integer = 0
+            Dim IndexFilas As Integer = 0
+            dgvIngresosVCN.Rows.Clear()
+
+            While (True)
+                Dim FechaIngresos As Date = Date.Now.Date ''"Fecha"
+                Dim AgregarFechasInteriorIndex As Integer = 0
+                Dim Salir As Boolean = False
+                While AgregarFechasIndex >= AgregarFechasInteriorIndex
+                    If AgregarFechasIndex = 0 Then
+                        dgvIngresosVCN.Rows.Add()
+                    End If
+
+                    FechaIngresos = CalculosTablaDiasFecha.AgregarFechaIngresos(dgvIngresosVCN, dtpUltimaFecha, "Fecha", DefinirBaseDias(), DefinirPeriodicidad(),
+                                              "Mensual", AgregarFechasInteriorIndex)
+
+                    If FechaIngresos > dtpFechaVencimiento.Value Then
+                        Salir = True
+                        Exit While
+                    End If
+                    dgvIngresosVCN.Rows(AgregarFechasInteriorIndex).Cells("Fecha").Value = Format(FechaIngresos, "dd/MM/yyyy").ToString
+                    AgregarFechasInteriorIndex += 1
+                End While
+                AgregarFechasIndex += 1
+                If Salir Then
+                    Exit While
+                Else
+                    If FechaIngresos < dtpFechaVencimiento.Value Then
+                        dgvIngresosVCN.Rows.Add()
+                    End If
+                End If
+            End While
+
+            IndexFilas = dgvIngresosVCN.Rows.Count - 1
+
+            While IndexFilas >= AgregarMasCamposIndex
+
+                Dim Correlativo As Integer = 0 ''"Correlativo"
+                Dim Dias As Integer = 0 '' "Plazo"
+                Dim Monto As Double = 0
+                Dim PorcentajeRenta As String = "10 %"
+                Dim cero As Integer = "0"
+
+                Correlativo = CalculosTablaDiasFecha.AgregarCorrelativo(dgvIngresosVCN, AgregarMasCamposIndex)
+                dgvIngresosVCN.Rows(AgregarMasCamposIndex).Cells("Correlativo").Value = Correlativo
+
+
+
+
+
+                Dias = CalculosTablaDiasFecha.AgregarDias(dgvIngresosVCN, dtpUltimaFecha, DefinirBaseDias(), DefinirPeriodicidad(),
+                                               "Mensual", "Fecha", "Plazo", AgregarMasCamposIndex)
+                dgvIngresosVCN.Rows(AgregarMasCamposIndex).Cells("Plazo").Value = Dias
+                Monto = CalculoMontoVCN(AgregarMasCamposIndex)
+                dgvIngresosVCN.Rows(AgregarMasCamposIndex).Cells("Monto").Value = Monto
+
+                CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, AgregarMasCamposIndex, "PorcentajeRenta",
+                                        PorcentajeRenta)
+
+                CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, AgregarMasCamposIndex, "CostoTransferencia",
+                                        cero)
+
+
+                CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, AgregarMasCamposIndex, "CostoBanco",
+                                        cero)
+
+                CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, AgregarMasCamposIndex, "CostoCedeval",
+                                        cero)
+                CalcularRenta(AgregarMasCamposIndex)
+                CalcularTotalRecibir(AgregarMasCamposIndex)
+                AgregarMasCamposIndex += 1
+            End While
+        Else
+
+            Dim index As Integer = dgvIngresosVCN.CurrentRow.Index
+            Dim Monto As Double = 0
+            Dim PorcentajeRenta As String = "10 %"
+            Dim cero As Integer = "0"
+
+            Monto = CalculoMontoVCN(index)
+            dgvIngresosVCN.Rows(index).Cells("Monto").Value = Monto
+
+            CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, index, "PorcentajeRenta",
+                                    PorcentajeRenta)
+
+            CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, index, "CostoTransferencia",
+                                    cero)
+
+
+            CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, index, "CostoBanco",
+                                    cero)
+
+            CalculosTablaDiasFecha.AgregarValoresCamposdgvVacios(dgvIngresosVCN, index, "CostoCedeval",
+                                    cero)
+            CalcularRenta(index)
+            CalcularTotalRecibir(index)
+        End If
+
     End Sub
 
+    Sub CalcularRenta(ByVal index As Integer)
+        Dim Monto As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("Monto").Value)
+        Dim PorcentajeRenta As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("PorcentajeRenta").Value) / 100
+        dgvIngresosVCN.Rows(index).Cells("Renta").Value = Monto * PorcentajeRenta
+    End Sub
+    Sub CalcularTotalRecibir(ByVal index As Integer)
+        Dim Monto As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("Monto").Value)
+        Dim InteresAcumulado As Double = Operaciones.ConvertirDecimal(txtInteresAcumulado.Text)
+        Dim Cedeval As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("CostoCedeval").Value)
+        Dim Renta As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("Renta").Value)
+        Dim CostoTransferencia As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("CostoTransferencia").Value)
+        Dim CostoBanco As Double = Operaciones.ConvertirDecimal(dgvIngresosVCN.Rows(index).Cells("CostoBanco").Value)
+        Dim Total As Double = 0
+        If index = 0 Then
+            Total = Monto - InteresAcumulado - Cedeval - Renta - CostoTransferencia - CostoBanco
+        Else
+            Total = Monto - Cedeval - Renta - CostoTransferencia - CostoBanco
+        End If
+        dgvIngresosVCN.Rows(index).Cells("TotalRecibir").Value = Total
+    End Sub
+
+
+    Function CalculoMontoVCN(ByRef index As Integer)
+        Dim ListaDiasBase As New Dictionary(Of String, String)
+        Dim Fecha1 As Date = Date.Now.Date
+        Dim Fecha2 As Date = Date.Now.Date
+        Dim indexAnterior As Integer = index - 1
+        Dim TipoBase As String = String.Empty
+        Dim DiasNormales As Integer = 0
+        Dim DiasEspeciales As Integer = 0
+
+
+        Dim MontoInversion As Double = Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString)
+        Dim PorcentajeCupon As Double = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString) / 100
+        Dim Total As Double = 0
+        If index = 0 Then
+            Fecha1 = dtpUltimaFecha.Value
+            Fecha2 = Operaciones.ConvertirFecha(dgvIngresosVCN.Rows(index).Cells("Fecha").Value)
+            ListaDiasBase = CalculosTablaDiasFecha.CalcularFormulasDiasBase(Fecha1, Fecha2, DefinirBaseDias())
+        Else
+            Fecha1 = Operaciones.ConvertirFecha(dgvIngresosVCN.Rows(indexAnterior).Cells("Fecha").Value)
+            Fecha2 = Operaciones.ConvertirFecha(dgvIngresosVCN.Rows(index).Cells("Fecha").Value.ToString)
+            ListaDiasBase = CalculosTablaDiasFecha.CalcularFormulasDiasBase(Fecha1, Fecha2, DefinirBaseDias())
+
+        End If
+
+        TipoBase = ListaDiasBase.Item("TipoBase").ToString
+        DiasNormales = Operaciones.ConvertirEntero(ListaDiasBase.Item("DiasNormales").ToString)
+        DiasEspeciales = Operaciones.ConvertirEntero(ListaDiasBase.Item("DiasEspeciales").ToString)
+
+
+
+
+        If TipoBase = "360" Then
+            Total = MontoInversion * DiasNormales * PorcentajeCupon / 360
+
+        ElseIf TipoBase = "365" Then
+
+            Total = (MontoInversion * DiasNormales * PorcentajeCupon / 365) +
+                    (MontoInversion * DiasEspeciales * PorcentajeCupon / 366)
+
+
+        ElseIf TipoBase = "360/365" Then
+            Total = (MontoInversion * DiasNormales * PorcentajeCupon / 365) +
+         (MontoInversion * DiasEspeciales * PorcentajeCupon / 366)
+
+
+        ElseIf TipoBase = "365/360" Then
+
+            Total = (MontoInversion * DiasNormales * PorcentajeCupon / 360) +
+         (MontoInversion * DiasEspeciales * PorcentajeCupon / 360)
+
+
+        End If
+
+        Return Total
+
+    End Function
+
     Function DefinirBaseDias()
         Dim TipoBase As Integer = Operaciones.ConvertirEntero(cboBase.SelectedIndex)
         Return TipoBase
     End Function
+    Function DefinirPeriodicidad()
+        Dim Periodicidad As String = cboPeriodicidad.SelectedValue
+        Return Periodicidad
+    End Function
 
 
 
@@ -287,6 +474,7 @@ Public Class frmLetes
 
     Private Sub txtValorNominal_TextChanged(sender As Object, e As EventArgs) Handles txtValorNominal.TextChanged
         RellenarDatos()
+
     End Sub
 
     Private Sub txtPrecio_TextChanged(sender As Object, e As EventArgs) Handles txtPrecio.TextChanged
@@ -416,6 +604,7 @@ Public Class frmLetes
 
             ConfiguracionCETE()
         ElseIf Variables.Codigo.IndexOf("VCN") > -1 Then
+            grpIngresosVCN.Visible = True
             Instrumento = "VCN"
             lblBono.Text = "VALORES COMERCIALES"
             Me.Text = "VALORES COMERCIALES"
@@ -428,7 +617,9 @@ Public Class frmLetes
             chbValorPar.Visible = True
             dtpFechaVencimiento.Enabled = True
             txtPlazoInversion.ReadOnly = True
+            dgvIngresosVCN.Columns.Clear()
             CrearColumnasIngresosVCN()
+            CargarFilas()
         Else
             Instrumento = "NADA"
         End If
@@ -449,7 +640,7 @@ Public Class frmLetes
         Rellenar()
         ExisteInversion()
         ValidarExistencia()
-
+        CargaCompletaInstrumento = True
     End Sub
 
 
@@ -695,7 +886,9 @@ Public Class frmLetes
         If CET Or PBUR Or VCN Then
             coleccion.Add(IntAcumulado)
         End If
-        oDAOLetes.ActualizarLETE(coleccion, Instrumento)
+        Dim EmpaquetarTablaBaseDatos As New Dictionary(Of Integer, Collection)
+        EmpaquetarTablaBaseDatos = CalculosTablaDiasFecha.EmpaquetarTablaBaseDatos(dgvIngresosVCN)
+        oDAOLetes.ActualizarLETE(coleccion, Instrumento, EmpaquetarTablaBaseDatos)
     End Sub
 
     Public Function Nuevo(ByVal Instrumento As String)
@@ -798,10 +991,19 @@ Public Class frmLetes
     Sub NuevoRegistro(ByVal Instrumento As String)
         Dim Coleccion As New Collection
         Coleccion = Nuevo(Instrumento)
-        If Coleccion.Count > 0 Then
+        Dim EmpaquetarTablaBaseDatos As New Dictionary(Of Integer, Collection)
+        EmpaquetarTablaBaseDatos = CalculosTablaDiasFecha.EmpaquetarTablaBaseDatos(dgvIngresosVCN)
+        Dim Proceder As Boolean = True
+
+        If VCN Then
+            If EmpaquetarTablaBaseDatos.Count = 0 Then
+                Proceder = False
+            End If
+        End If
+        If Coleccion.Count > 0 And Proceder Then
 
 
-            oDAOLetes.NuevoIngreso(Coleccion, Instrumento)
+            oDAOLetes.NuevoIngreso(Coleccion, Instrumento, EmpaquetarTablaBaseDatos)
 
             Coleccion.Clear()
         End If
@@ -823,6 +1025,9 @@ Public Class frmLetes
             ValidarExistencia()
         ElseIf Not ExisteValidacion() Then
             Variables.ColeccionLETE = Nuevo(Instrumento)
+            If VCN Then
+                Variables.EmpaquetarTablaBaseDatos = CalculosTablaDiasFecha.EmpaquetarTablaBaseDatos(dgvIngresosVCN)
+            End If
             Close()
 
 
@@ -920,6 +1125,7 @@ Public Class frmLetes
     Function ValorTrasado()
         Return Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString) *
         (Operaciones.ConvertirDecimal(V_txtPrecio.ToString) / 100)
+
     End Function
     Function Precio()
 
@@ -1862,6 +2068,10 @@ Public Class frmLetes
 
         AgregarPorcentaje()
 
+        If VCN And CargaCompletaInstrumento Then
+
+            CalculosIngresosVCN("Global")
+        End If
     End Sub
 
     Private Sub Button1_Click_1(sender As Object, e As EventArgs)
@@ -1881,8 +2091,8 @@ Public Class frmLetes
 
 
         If (IndexBase = 0 Or IndexBase = 2) Then
-            If VCN Then
-                txtPlazoInversion.Text = Operaciones.Base360(Fechaliquidacion, FechaVencimiento) - 1
+            If VCN And CargaCompletaInstrumento Then
+                txtPlazoInversion.Text = Operaciones.Base360(Fechaliquidacion, FechaVencimiento)
             Else
                 dtpFechaVencimiento.Value = Operaciones.FechaDias360(Fechaliquidacion, Dias)
             End If
@@ -1891,7 +2101,7 @@ Public Class frmLetes
 
 
         ElseIf IndexBase = 1 Or IndexBase = 3 Then
-            If VCN Then
+            If VCN And CargaCompletaInstrumento Then
                 txtPlazoInversion.Text = Operaciones.Base365(Fechaliquidacion, FechaVencimiento)
             Else
 
@@ -2060,6 +2270,7 @@ Public Class frmLetes
 
     Private Sub cboCasasCorredoras_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCasasCorredoras.SelectedIndexChanged
         RellenarDatos()
+
     End Sub
 
     Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
@@ -2223,7 +2434,11 @@ Public Class frmLetes
     End Sub
 
     Private Sub dgvIngresosVCN_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresosVCN.CellClick
-        CalculosIngresosVCN()
+
+    End Sub
+
+    Private Sub dgvIngresosVCN_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresosVCN.CellEndEdit
+        CalculosIngresosVCN("UnRegistro")
     End Sub
 
     Private Sub btnReporto_Click(sender As Object, e As EventArgs)
@@ -2263,7 +2478,55 @@ Public Class frmLetes
 
 
 
+    Sub CargarFilas()
+
+        Dim Codigo As String = Variables.Codigo
+        Dim Tabla As DataTable = oDAOLetes.CargarFilas(Codigo)
+        Dim Correlativo As Integer = 0
+        Dim CantidadFilas As Integer = 0
+        Dim IndexFilas As Integer = 0
+        For Each rows As DataRow In Tabla.Rows
+            Dim Plazo As Integer = 0
+            Dim Fecha As String = Format(Date.Today.Date, "dd/MM/yyyy").ToString
+            Dim Monto As Double = 0
+            Dim Cedeval As Double = 0
+            Dim PorcentajeRenta As String = "10%"
+            Dim Renta As Double = 0
+            Dim CostoTransferencia As Double = 0
+            Dim CostoBanco As Double = 0
+            Dim TotalRecibir As Double = 0
+
+
+
+
+
+            Plazo = Operaciones.ConvertirEntero(rows("Plazo").ToString)
+            Fecha = Format(Operaciones.ConvertirFecha(rows("Fecha").ToString), "dd/MM/yyyy").ToString
+            Monto = Operaciones.ConvertirDecimal(rows("Monto").ToString)
+            Cedeval = Operaciones.ConvertirDecimal(rows("Cedeval").ToString)
+            PorcentajeRenta = (Operaciones.ConvertirDecimal(rows("PorcentajeRenta").ToString) * 100).ToString + "%"
+            Renta = Operaciones.ConvertirDecimal(rows("Renta").ToString)
+            CostoTransferencia = Operaciones.ConvertirDecimal(rows("CostoTransferencia").ToString)
+            CostoBanco = Operaciones.ConvertirDecimal(rows("CostoBanco").ToString)
+            TotalRecibir = Operaciones.ConvertirDecimal(rows("TotalRecibir").ToString)
+
+            dgvIngresosVCN.Rows.Add("", Plazo, Fecha, Monto, Cedeval, PorcentajeRenta, Renta, CostoTransferencia, CostoBanco, TotalRecibir)
+
+
 
 
 
+
+
+        Next
+        CantidadFilas = dgvIngresosVCN.Rows.Count - 1
+        While CantidadFilas >= IndexFilas
+            Correlativo = CalculosTablaDiasFecha.AgregarCorrelativo(dgvIngresosVCN, IndexFilas)
+            dgvIngresosVCN.Rows(IndexFilas).Cells("Correlativo").Value = Correlativo
+            IndexFilas += 1
+        End While
+
+    End Sub
+
+
 End Class

+ 1 - 1
Inversiones.vbproj

@@ -319,7 +319,7 @@
       <DependentUpon>dsInversiones.xsd</DependentUpon>
     </Compile>
     <Compile Include="ENTI\AccionesCE.vb" />
-    <Compile Include="ENTI\CalculosDias.vb" />
+    <Compile Include="ENTI\CalculosTablaDiasFecha.vb" />
     <Compile Include="ENTI\CambiarEstArbCE.vb" />
     <Compile Include="ENTI\Controldores.vb" />
     <Compile Include="ENTI\FondoInversionCE.vb" />

BIN
RPT/PrintPropuestaDeInversion.rpt


+ 1 - 0
Variables.vb

@@ -70,5 +70,6 @@
     Public CantFormAbierto As Boolean = False
 
 
+    Public EmpaquetarTablaBaseDatos As New Dictionary(Of Integer, Collection)
     Public TrasladarCMVTA As TrasladarDatosCMVTA
 End Module

+ 67 - 63
frmPIN.designer.vb

@@ -26,8 +26,6 @@ Partial Class frmPIN
         Dim navSiguienteRegistro As System.Windows.Forms.ToolStripButton
         Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmPIN))
         Me.cboCalificadoraDeRiesgo = New System.Windows.Forms.ComboBox()
-        Me.PIN0BindingSource4 = New System.Windows.Forms.BindingSource(Me.components)
-        Me.InversionesDEVDataSet5 = New Inversiones.InversionesDEVDataSet5()
         Me.cboEmisores = New System.Windows.Forms.ComboBox()
         Me.cboInstrumentosFinancieros = New System.Windows.Forms.ComboBox()
         Me.cboEmpresas = New System.Windows.Forms.ComboBox()
@@ -173,13 +171,13 @@ Partial Class frmPIN
         Me.pnlCambiarRec = New System.Windows.Forms.Panel()
         Me.btnCambiarRec = New System.Windows.Forms.Button()
         Me.lblCambiarRec = New System.Windows.Forms.Label()
-        Me.PIN0TableAdapter3 = New Inversiones.InversionesDEVDataSet5TableAdapters.PIN0TableAdapter()
-        Me.TableAdapterManager = New Inversiones.InversionesDEVDataSet5TableAdapters.TableAdapterManager()
         Me.TableLayoutPanel3 = New System.Windows.Forms.TableLayoutPanel()
         Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel()
+        Me.PIN0BindingSource4 = New System.Windows.Forms.BindingSource(Me.components)
+        Me.InversionesDEVDataSet5 = New Inversiones.InversionesDEVDataSet5()
+        Me.PIN0TableAdapter3 = New Inversiones.InversionesDEVDataSet5TableAdapters.PIN0TableAdapter()
+        Me.TableAdapterManager = New Inversiones.InversionesDEVDataSet5TableAdapters.TableAdapterManager()
         navSiguienteRegistro = New System.Windows.Forms.ToolStripButton()
-        CType(Me.PIN0BindingSource4, System.ComponentModel.ISupportInitialize).BeginInit()
-        CType(Me.InversionesDEVDataSet5, System.ComponentModel.ISupportInitialize).BeginInit()
         Me.pnlPie.SuspendLayout()
         CType(Me.Navegador, System.ComponentModel.ISupportInitialize).BeginInit()
         Me.Navegador.SuspendLayout()
@@ -223,6 +221,8 @@ Partial Class frmPIN
         Me.pnlCambiarRec.SuspendLayout()
         Me.TableLayoutPanel3.SuspendLayout()
         Me.FlowLayoutPanel1.SuspendLayout()
+        CType(Me.PIN0BindingSource4, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.InversionesDEVDataSet5, System.ComponentModel.ISupportInitialize).BeginInit()
         Me.SuspendLayout()
         '
         'navSiguienteRegistro
@@ -243,21 +243,11 @@ Partial Class frmPIN
         Me.cboCalificadoraDeRiesgo.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboCalificadoraDeRiesgo.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboCalificadoraDeRiesgo.FormattingEnabled = True
-        Me.cboCalificadoraDeRiesgo.Location = New System.Drawing.Point(893, 199)
+        Me.cboCalificadoraDeRiesgo.Location = New System.Drawing.Point(909, 198)
         Me.cboCalificadoraDeRiesgo.Name = "cboCalificadoraDeRiesgo"
-        Me.cboCalificadoraDeRiesgo.Size = New System.Drawing.Size(182, 26)
+        Me.cboCalificadoraDeRiesgo.Size = New System.Drawing.Size(167, 26)
         Me.cboCalificadoraDeRiesgo.TabIndex = 13
         '
-        'PIN0BindingSource4
-        '
-        Me.PIN0BindingSource4.DataMember = "PIN0"
-        Me.PIN0BindingSource4.DataSource = Me.InversionesDEVDataSet5
-        '
-        'InversionesDEVDataSet5
-        '
-        Me.InversionesDEVDataSet5.DataSetName = "InversionesDEVDataSet5"
-        Me.InversionesDEVDataSet5.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
-        '
         'cboEmisores
         '
         Me.cboEmisores.BackColor = System.Drawing.SystemColors.Menu
@@ -268,7 +258,7 @@ Partial Class frmPIN
         Me.cboEmisores.FormattingEnabled = True
         Me.cboEmisores.Location = New System.Drawing.Point(171, 343)
         Me.cboEmisores.Name = "cboEmisores"
-        Me.cboEmisores.Size = New System.Drawing.Size(182, 26)
+        Me.cboEmisores.Size = New System.Drawing.Size(215, 26)
         Me.cboEmisores.TabIndex = 11
         '
         'cboInstrumentosFinancieros
@@ -282,7 +272,7 @@ Partial Class frmPIN
         Me.cboInstrumentosFinancieros.Location = New System.Drawing.Point(171, 244)
         Me.cboInstrumentosFinancieros.MaxLength = 100000
         Me.cboInstrumentosFinancieros.Name = "cboInstrumentosFinancieros"
-        Me.cboInstrumentosFinancieros.Size = New System.Drawing.Size(142, 26)
+        Me.cboInstrumentosFinancieros.Size = New System.Drawing.Size(215, 26)
         Me.cboInstrumentosFinancieros.TabIndex = 3
         '
         'cboEmpresas
@@ -296,7 +286,7 @@ Partial Class frmPIN
         Me.cboEmpresas.FormattingEnabled = True
         Me.cboEmpresas.Location = New System.Drawing.Point(171, 184)
         Me.cboEmpresas.Name = "cboEmpresas"
-        Me.cboEmpresas.Size = New System.Drawing.Size(182, 26)
+        Me.cboEmpresas.Size = New System.Drawing.Size(215, 26)
         Me.cboEmpresas.TabIndex = 1
         '
         'cboEstadoDocumento
@@ -309,10 +299,10 @@ Partial Class frmPIN
         Me.cboEstadoDocumento.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboEstadoDocumento.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboEstadoDocumento.FormattingEnabled = True
-        Me.cboEstadoDocumento.Location = New System.Drawing.Point(532, 249)
+        Me.cboEstadoDocumento.Location = New System.Drawing.Point(575, 248)
         Me.cboEstadoDocumento.MaxLength = 100000
         Me.cboEstadoDocumento.Name = "cboEstadoDocumento"
-        Me.cboEstadoDocumento.Size = New System.Drawing.Size(183, 26)
+        Me.cboEstadoDocumento.Size = New System.Drawing.Size(166, 26)
         Me.cboEstadoDocumento.TabIndex = 17
         '
         'cboOrigenDeFondos
@@ -323,9 +313,9 @@ Partial Class frmPIN
         Me.cboOrigenDeFondos.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboOrigenDeFondos.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboOrigenDeFondos.FormattingEnabled = True
-        Me.cboOrigenDeFondos.Location = New System.Drawing.Point(893, 294)
+        Me.cboOrigenDeFondos.Location = New System.Drawing.Point(909, 293)
         Me.cboOrigenDeFondos.Name = "cboOrigenDeFondos"
-        Me.cboOrigenDeFondos.Size = New System.Drawing.Size(182, 26)
+        Me.cboOrigenDeFondos.Size = New System.Drawing.Size(167, 26)
         Me.cboOrigenDeFondos.TabIndex = 10
         '
         'cboCalificacionDeRiesgo
@@ -339,7 +329,7 @@ Partial Class frmPIN
         Me.cboCalificacionDeRiesgo.FormattingEnabled = True
         Me.cboCalificacionDeRiesgo.Location = New System.Drawing.Point(171, 394)
         Me.cboCalificacionDeRiesgo.Name = "cboCalificacionDeRiesgo"
-        Me.cboCalificacionDeRiesgo.Size = New System.Drawing.Size(182, 26)
+        Me.cboCalificacionDeRiesgo.Size = New System.Drawing.Size(215, 26)
         Me.cboCalificacionDeRiesgo.TabIndex = 12
         Me.cboCalificacionDeRiesgo.ValueMember = "Codigo"
         '
@@ -504,9 +494,9 @@ Partial Class frmPIN
         Me.cboTipoOperacion.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboTipoOperacion.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboTipoOperacion.FormattingEnabled = True
-        Me.cboTipoOperacion.Location = New System.Drawing.Point(532, 388)
+        Me.cboTipoOperacion.Location = New System.Drawing.Point(575, 387)
         Me.cboTipoOperacion.Name = "cboTipoOperacion"
-        Me.cboTipoOperacion.Size = New System.Drawing.Size(183, 26)
+        Me.cboTipoOperacion.Size = New System.Drawing.Size(166, 26)
         Me.cboTipoOperacion.TabIndex = 88
         '
         'cboAutorizacion
@@ -519,9 +509,9 @@ Partial Class frmPIN
         Me.cboAutorizacion.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboAutorizacion.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboAutorizacion.FormattingEnabled = True
-        Me.cboAutorizacion.Location = New System.Drawing.Point(893, 340)
+        Me.cboAutorizacion.Location = New System.Drawing.Point(909, 339)
         Me.cboAutorizacion.Name = "cboAutorizacion"
-        Me.cboAutorizacion.Size = New System.Drawing.Size(182, 26)
+        Me.cboAutorizacion.Size = New System.Drawing.Size(167, 26)
         Me.cboAutorizacion.TabIndex = 91
         '
         'btnActivar
@@ -548,7 +538,7 @@ Partial Class frmPIN
         Me.cboTipoMercado.FormattingEnabled = True
         Me.cboTipoMercado.Location = New System.Drawing.Point(171, 294)
         Me.cboTipoMercado.Name = "cboTipoMercado"
-        Me.cboTipoMercado.Size = New System.Drawing.Size(182, 26)
+        Me.cboTipoMercado.Size = New System.Drawing.Size(215, 26)
         Me.cboTipoMercado.TabIndex = 158
         Me.cboTipoMercado.ValueMember = "Codigo"
         '
@@ -601,9 +591,9 @@ Partial Class frmPIN
         Me.cboRenta.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboRenta.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboRenta.FormattingEnabled = True
-        Me.cboRenta.Location = New System.Drawing.Point(532, 343)
+        Me.cboRenta.Location = New System.Drawing.Point(575, 342)
         Me.cboRenta.Name = "cboRenta"
-        Me.cboRenta.Size = New System.Drawing.Size(183, 26)
+        Me.cboRenta.Size = New System.Drawing.Size(166, 26)
         Me.cboRenta.TabIndex = 164
         '
         'cboTasa
@@ -614,9 +604,9 @@ Partial Class frmPIN
         Me.cboTasa.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboTasa.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboTasa.FormattingEnabled = True
-        Me.cboTasa.Location = New System.Drawing.Point(893, 244)
+        Me.cboTasa.Location = New System.Drawing.Point(909, 243)
         Me.cboTasa.Name = "cboTasa"
-        Me.cboTasa.Size = New System.Drawing.Size(182, 26)
+        Me.cboTasa.Size = New System.Drawing.Size(167, 26)
         Me.cboTasa.TabIndex = 166
         '
         'cboPeriodicidad
@@ -627,9 +617,9 @@ Partial Class frmPIN
         Me.cboPeriodicidad.FlatStyle = System.Windows.Forms.FlatStyle.Flat
         Me.cboPeriodicidad.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboPeriodicidad.FormattingEnabled = True
-        Me.cboPeriodicidad.Location = New System.Drawing.Point(532, 295)
+        Me.cboPeriodicidad.Location = New System.Drawing.Point(575, 294)
         Me.cboPeriodicidad.Name = "cboPeriodicidad"
-        Me.cboPeriodicidad.Size = New System.Drawing.Size(183, 26)
+        Me.cboPeriodicidad.Size = New System.Drawing.Size(166, 26)
         Me.cboPeriodicidad.TabIndex = 167
         '
         'Navegador
@@ -1422,9 +1412,9 @@ Partial Class frmPIN
         Me.cboPaises.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.cboPaises.ForeColor = System.Drawing.SystemColors.InfoText
         Me.cboPaises.FormattingEnabled = True
-        Me.cboPaises.Location = New System.Drawing.Point(532, 199)
+        Me.cboPaises.Location = New System.Drawing.Point(575, 198)
         Me.cboPaises.Name = "cboPaises"
-        Me.cboPaises.Size = New System.Drawing.Size(183, 26)
+        Me.cboPaises.Size = New System.Drawing.Size(166, 26)
         Me.cboPaises.TabIndex = 156
         Me.cboPaises.ValueMember = "Codigo"
         '
@@ -1532,7 +1522,7 @@ Partial Class frmPIN
         '
         Me.btnDetalleIF.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
         Me.btnDetalleIF.ForeColor = System.Drawing.SystemColors.ControlDark
-        Me.btnDetalleIF.Location = New System.Drawing.Point(319, 244)
+        Me.btnDetalleIF.Location = New System.Drawing.Point(392, 247)
         Me.btnDetalleIF.Name = "btnDetalleIF"
         Me.btnDetalleIF.Size = New System.Drawing.Size(34, 26)
         Me.btnDetalleIF.TabIndex = 193
@@ -1543,7 +1533,7 @@ Partial Class frmPIN
         '
         Me.Label18.AutoSize = True
         Me.Label18.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label18.Location = New System.Drawing.Point(748, 252)
+        Me.Label18.Location = New System.Drawing.Point(764, 251)
         Me.Label18.Name = "Label18"
         Me.Label18.Size = New System.Drawing.Size(63, 18)
         Me.Label18.TabIndex = 192
@@ -1553,7 +1543,7 @@ Partial Class frmPIN
         '
         Me.Label17.AutoSize = True
         Me.Label17.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label17.Location = New System.Drawing.Point(748, 343)
+        Me.Label17.Location = New System.Drawing.Point(764, 342)
         Me.Label17.Name = "Label17"
         Me.Label17.Size = New System.Drawing.Size(81, 18)
         Me.Label17.TabIndex = 191
@@ -1563,7 +1553,7 @@ Partial Class frmPIN
         '
         Me.Label16.AutoSize = True
         Me.Label16.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label16.Location = New System.Drawing.Point(748, 297)
+        Me.Label16.Location = New System.Drawing.Point(764, 296)
         Me.Label16.Name = "Label16"
         Me.Label16.Size = New System.Drawing.Size(117, 18)
         Me.Label16.TabIndex = 190
@@ -1573,7 +1563,7 @@ Partial Class frmPIN
         '
         Me.Label15.AutoSize = True
         Me.Label15.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label15.Location = New System.Drawing.Point(389, 252)
+        Me.Label15.Location = New System.Drawing.Point(432, 251)
         Me.Label15.Name = "Label15"
         Me.Label15.Size = New System.Drawing.Size(47, 18)
         Me.Label15.TabIndex = 189
@@ -1583,7 +1573,7 @@ Partial Class frmPIN
         '
         Me.Label14.AutoSize = True
         Me.Label14.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label14.Location = New System.Drawing.Point(748, 202)
+        Me.Label14.Location = New System.Drawing.Point(764, 201)
         Me.Label14.Name = "Label14"
         Me.Label14.Size = New System.Drawing.Size(139, 18)
         Me.Label14.TabIndex = 188
@@ -1593,7 +1583,7 @@ Partial Class frmPIN
         '
         Me.Label13.AutoSize = True
         Me.Label13.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label13.Location = New System.Drawing.Point(389, 391)
+        Me.Label13.Location = New System.Drawing.Point(432, 390)
         Me.Label13.Name = "Label13"
         Me.Label13.Size = New System.Drawing.Size(112, 18)
         Me.Label13.TabIndex = 187
@@ -1603,7 +1593,7 @@ Partial Class frmPIN
         '
         Me.Label12.AutoSize = True
         Me.Label12.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label12.Location = New System.Drawing.Point(390, 346)
+        Me.Label12.Location = New System.Drawing.Point(433, 345)
         Me.Label12.Name = "Label12"
         Me.Label12.Size = New System.Drawing.Size(70, 18)
         Me.Label12.TabIndex = 186
@@ -1613,7 +1603,7 @@ Partial Class frmPIN
         '
         Me.Label11.AutoSize = True
         Me.Label11.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label11.Location = New System.Drawing.Point(389, 297)
+        Me.Label11.Location = New System.Drawing.Point(432, 296)
         Me.Label11.Name = "Label11"
         Me.Label11.Size = New System.Drawing.Size(79, 18)
         Me.Label11.TabIndex = 185
@@ -1623,11 +1613,12 @@ Partial Class frmPIN
         '
         Me.Label10.AutoSize = True
         Me.Label10.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
-        Me.Label10.Location = New System.Drawing.Point(389, 202)
+        Me.Label10.ForeColor = System.Drawing.Color.Maroon
+        Me.Label10.Location = New System.Drawing.Point(432, 201)
         Me.Label10.Name = "Label10"
-        Me.Label10.Size = New System.Drawing.Size(44, 18)
+        Me.Label10.Size = New System.Drawing.Size(53, 18)
         Me.Label10.TabIndex = 184
-        Me.Label10.Text = "Países"
+        Me.Label10.Text = "Países *"
         '
         'Label7
         '
@@ -1643,6 +1634,7 @@ Partial Class frmPIN
         '
         Me.Label6.AutoSize = True
         Me.Label6.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label6.ForeColor = System.Drawing.Color.Maroon
         Me.Label6.Location = New System.Drawing.Point(23, 247)
         Me.Label6.Name = "Label6"
         Me.Label6.Size = New System.Drawing.Size(94, 18)
@@ -1653,6 +1645,7 @@ Partial Class frmPIN
         '
         Me.Label5.AutoSize = True
         Me.Label5.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label5.ForeColor = System.Drawing.Color.Maroon
         Me.Label5.Location = New System.Drawing.Point(23, 297)
         Me.Label5.Name = "Label5"
         Me.Label5.Size = New System.Drawing.Size(113, 18)
@@ -1673,6 +1666,7 @@ Partial Class frmPIN
         '
         Me.Label2.AutoSize = True
         Me.Label2.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label2.ForeColor = System.Drawing.Color.Maroon
         Me.Label2.Location = New System.Drawing.Point(23, 202)
         Me.Label2.Name = "Label2"
         Me.Label2.Size = New System.Drawing.Size(73, 18)
@@ -1826,16 +1820,6 @@ Partial Class frmPIN
         Me.lblCambiarRec.TabIndex = 181
         Me.lblCambiarRec.Text = "Cambiar Rechazado"
         '
-        'PIN0TableAdapter3
-        '
-        Me.PIN0TableAdapter3.ClearBeforeFill = True
-        '
-        'TableAdapterManager
-        '
-        Me.TableAdapterManager.BackupDataSetBeforeUpdate = False
-        Me.TableAdapterManager.PIN0TableAdapter = Me.PIN0TableAdapter3
-        Me.TableAdapterManager.UpdateOrder = Inversiones.InversionesDEVDataSet5TableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete
-        '
         'TableLayoutPanel3
         '
         Me.TableLayoutPanel3.Anchor = System.Windows.Forms.AnchorStyles.None
@@ -1869,6 +1853,26 @@ Partial Class frmPIN
         Me.FlowLayoutPanel1.Size = New System.Drawing.Size(1157, 724)
         Me.FlowLayoutPanel1.TabIndex = 187
         '
+        'PIN0BindingSource4
+        '
+        Me.PIN0BindingSource4.DataMember = "PIN0"
+        Me.PIN0BindingSource4.DataSource = Me.InversionesDEVDataSet5
+        '
+        'InversionesDEVDataSet5
+        '
+        Me.InversionesDEVDataSet5.DataSetName = "InversionesDEVDataSet5"
+        Me.InversionesDEVDataSet5.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
+        '
+        'PIN0TableAdapter3
+        '
+        Me.PIN0TableAdapter3.ClearBeforeFill = True
+        '
+        'TableAdapterManager
+        '
+        Me.TableAdapterManager.BackupDataSetBeforeUpdate = False
+        Me.TableAdapterManager.PIN0TableAdapter = Me.PIN0TableAdapter3
+        Me.TableAdapterManager.UpdateOrder = Inversiones.InversionesDEVDataSet5TableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete
+        '
         'frmPIN
         '
         Me.AcceptButton = Me.btnAccion
@@ -1883,8 +1887,6 @@ Partial Class frmPIN
         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
         Me.Name = "frmPIN"
         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
-        CType(Me.PIN0BindingSource4, System.ComponentModel.ISupportInitialize).EndInit()
-        CType(Me.InversionesDEVDataSet5, System.ComponentModel.ISupportInitialize).EndInit()
         Me.pnlPie.ResumeLayout(False)
         CType(Me.Navegador, System.ComponentModel.ISupportInitialize).EndInit()
         Me.Navegador.ResumeLayout(False)
@@ -1949,6 +1951,8 @@ Partial Class frmPIN
         Me.TableLayoutPanel3.PerformLayout()
         Me.FlowLayoutPanel1.ResumeLayout(False)
         Me.FlowLayoutPanel1.PerformLayout()
+        CType(Me.PIN0BindingSource4, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.InversionesDEVDataSet5, System.ComponentModel.ISupportInitialize).EndInit()
         Me.ResumeLayout(False)
         Me.PerformLayout()
 

+ 4 - 1
frmPIN.resx

@@ -251,6 +251,9 @@
         xa6/pya51wn68k9imJ/nk4um5SINPQAAAABJRU5ErkJggg==
 </value>
   </data>
+  <metadata name="InversionesDEVDataSet5.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 95</value>
+  </metadata>
   <metadata name="PIN0TableAdapter3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>365, 95</value>
   </metadata>
@@ -258,6 +261,6 @@
     <value>523, 95</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>40</value>
+    <value>25</value>
   </metadata>
 </root>

+ 5 - 2
frmPIN.vb

@@ -1369,9 +1369,12 @@ Public Class frmPIN
             If Instrumento.IndexOf("VCN") > -1 Then
                 Dim oDAOLetes As New LETESDAO
                 Dim ColeccionLETE As Collection = Variables.ColeccionLETE
-                If ColeccionLETE.Count > 0 Then
-                    oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN")
+                Dim EmpaquetarTablaBaseDatos As New Dictionary(Of Integer, Collection)
+                EmpaquetarTablaBaseDatos = Variables.EmpaquetarTablaBaseDatos
+                If ColeccionLETE.Count > 0 And EmpaquetarTablaBaseDatos.Count > 0 Then
+                    oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN", EmpaquetarTablaBaseDatos)
                     ColeccionLETE.Clear()
+                    EmpaquetarTablaBaseDatos.Clear()
 
                 End If
             End If

+ 3 - 0
frmPrincipal.resx

@@ -123,6 +123,9 @@
   <metadata name="mnuPrincipal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>660, 17</value>
   </metadata>
+  <metadata name="mnuPrincipal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>660, 17</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="picLogo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 7 - 0
frmPrincipal.vb

@@ -407,5 +407,12 @@ Public Class frmPrincipal
 
     Private Sub pnlPrincipal_Paint(sender As Object, e As PaintEventArgs) Handles pnlPrincipal.Paint
 
+    End Sub
+
+    Private Sub Button2_Click_2(sender As Object, e As EventArgs)
+
+
+
+
     End Sub
 End Class