ahernandez 6 år sedan
förälder
incheckning
99dca26143

+ 1 - 1
DAO/DAOGeneral.vb

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

+ 5 - 6
ENTI/PrestamoPersonalCE.vb

@@ -11,18 +11,17 @@
             numero = 2
         ElseIf (Periodicidad = "A") Then
             numero = 1
+        Else
+            numero = 12
         End If
-        If (numero = 0) Then
 
-            Return 0
-        Else
 
-            i = i / numero
+        i = i / numero
             Dim ValorTIR As Double = VP * ((((1 + i) ^ n) * i) / (((1 + i) ^ n) - 1))
 
             Return ValorTIR
 
-        End If
+
     End Function
 
     Public Function SumarCuota(ByVal Cuota As Double, ByVal Seguro As Double)
@@ -31,7 +30,7 @@
         Return Suma
     End Function
 
-    Public Function Periodo(ByVal FechaPago As Date, ByVal Fecha As Date)
+    Public Function Periodo(ByVal FechaPago As Date, ByVal Fecha As Date) As Integer
 
         Dim Dias = DateDiff(DateInterval.Day, FechaPago, Fecha)
         Return Dias

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 132 - 491
FRM/frmAcciones.vb


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 175 - 699
FRM/frmCertificadosDeInversion.vb


+ 1 - 1
FRM/frmColaTitulos.Designer.vb

@@ -91,7 +91,7 @@ Partial Class frmColaTitulos
         Me.lblTitulo.BackColor = System.Drawing.Color.WhiteSmoke
         Me.lblTitulo.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
         Me.lblTitulo.ForeColor = System.Drawing.Color.Maroon
-        Me.lblTitulo.Location = New System.Drawing.Point(14, 9)
+        Me.lblTitulo.Location = New System.Drawing.Point(6, 9)
         Me.lblTitulo.Name = "lblTitulo"
         Me.lblTitulo.Size = New System.Drawing.Size(256, 24)
         Me.lblTitulo.TabIndex = 81

+ 17 - 17
FRM/frmDepositosAPlazo.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
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHdSURBVDhPnZFNTNpgGMe7HdzV6cXrruO2807OeJrusBMr
-        +IGYSjW7sPN6mzHLspjsNC+bGX7gsqzExI+jiU6CsQMrEsDxIUFbLVAG/QiGx75vAIVYQ/wnvzx52uf9
-        ve37Eih57nNnmp/rSnFfLKnDFQvPezvwi3YSjc4+KoSmH+cjH58kAq8qpTAzRLve+qlxSnQ6KHGsBYcB
-        NTKZtVkdW1iQ3vnUJYdnXmq7faAHBkHn3oCqSKBq/00plWVAEizI+D90FwL9yuZMb1UPTj7T/rwAbZ+E
-        WK5qCpKQJCXWBN+7izzzVN97Ddr2c1D9AyAIgs7Fs/DDswS/WV+DlZ+/IJg4bxagAxN4b8/4qPNSMyTs
-        GnuCBhJSBeKiAjGDuKg2SOQqzYJ6huxjipiXgfWt4oHIiQRf577B/LynwcKiF6JZ2VwgFcv4U9FA8rwE
-        /L9TCB03k7xQ2hOEsyXg4qewb4BqnaMzE4G9RXCYlsCzsNw4QATqjzIFE4GtWRC7qEBEUK4xdo6cqfh5
-        W4K/t1wj6g+SLddYj40czd0UpOUqJlWrN7lVYLVOlPOGYG19Aw/chaIWYXh4iq8tJQgAeGD8Aut2vwfX
-        hBto1ztczaBpWreTTh/DMA9rivuGIK4AkrdsKPO6lN4AAAAASUVORK5CYII=
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHbSURBVDhPnZFPTNpQHMe7Hdx104tXr/O28066eJp68MQK
+        OhFSKWYXdl5vbstizBJPetnMcIrGWGKCXpdMRzB0akUCbPzRoK0WKIP+CYaffS+AQqwh+yaf/PJrf+/z
+        2vcIlDw3+zjDL3Smubne9NFqL8/7OvCLdhKLfX5UOHj/JB/91JMMDVdKEWaUdr0JUk5KdNgpcaIFuwH1
+        2p21Wuw/sCCzM9MpRz6+1H69AD00BDr3ClRFAlX7Z0qpLAOSYMFpcLqrEBpQtj/0VfV99zNttx+0MAnx
+        XNUUJCFJSqwJvnYVeeapvjcC2s/noAYHQRAEnUtk4Zt3GTZYf4PVtXXYT140C9CBCbyv2znuuNIMCRtg
+        T9BAUqpAQlQgbpAQ1QbJXKVZUM+obUIR8zKw/k08ED2RYH7hCywuehssffdBLCubC6RiGX8qGkhdlID/
+        ewYHf5pJXSrtCSLZEnCJMwgboFrn+NxEYGsRHGUk8C6tNA4Qgfrj04KJwNosiF9WICooNxg7R89V/Lwt
+        we87rhH1h6mWa6zHSo7nbgsychWTrtXb3CmwWCbLeUMQ2NrGA/ehqEUYG5via0sJAgAeGL/AejzvwDXp
+        Adr1FlczaJrWbaTDzzDMw5rif0MQ14wwbCY+RNEUAAAAAElFTkSuQmCC
 </value>
   </data>
   <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGxSURBVDhPlZM7S8NgFIZT0/4AF3HwCg4iOLVkK/W++QMU
-        F1HEycGhRRc3QcVBQ+jUyUUHHZRihULVRRBcHNy8FCSlSWt6S+/t63dCU6u2Xg48JHx875NzviRcrboY
-        dobwC32MNsa3smez2UQoFKqUy2U0I5/PQxTFPba3qUSgcCaTga7rdZLJJDRNQzQaNSSRSASSJH2TWBgC
-        bcjlcigUCsaVSKfTSCQSUBTFELAuQQ/xer2mxKi6gMImJKBAKpWCqqqfxiEoU8t+CEqlUn0D3dPc5iix
-        WMzoRJbl1oKvNEqoEzqPeDz+dwFhSmgcOhMS0fqfBUSxWDTOhSQErf1LQF28HO/jZn4IwXEbrmZ7IQoW
-        6UcBhUzCJyLu3U7k/LuoPgSgH64i5BquXIxYV34VUPvXcwPIsjD2pwFPO7DZD3V7BP5R/qmloFFCbVfv
-        TtBY2kYnNsas1bqAfcrVZhLicqYHGd8CwEJ5N4c3RniZR2CSfyUBlYO9Hr3Vz/R8tIPbpUHInn4oazY8
-        LloQdFkr5xNt67U8181wMOjVNMU31SGdjvEytX3m4qMHTn6L4zjuHVT+g9XSi1zlAAAAAElFTkSuQmCC
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGxSURBVDhPlZM7S8NQGIbTpv4AF3HwVnAQwUnpJvW++QMU
+        F1HEycFB0cVNUHHQEDo5uehgB6WoII26CIKLg5s3kJTeTHrJpdfX84WmVm2tfvCQcDjvk+87h3ClamH0
+        Mjx16GA4GT+qV9d1VZKkQj6fRzVM04QgCDtsb1WJh8LpdBqappVJJBJQFAXhcNiShEIhiKL4Q+JgeGiD
+        YRjIZDLWk0ilUlBVFZFIxBKwLkEf8fl8tsSqsoDCNiSgQDKZRDQa/TIOQZlS9lOQy+XKG+id5rZHicVi
+        VieyLNcWfKdSQp3QecTj8b8LCFtC49CZkIjW/ywgstmsdS4kIWjtXwLq4uVoFzfT3bgYbsDVZDsEj0P8
+        VUAhm1e/gPulfhiBbRQfzqAdLELy9hTOB1wLdQXU/vVUJ3QWxu44sNwIrLsR3RxAYJB/qimolFDbxTs/
+        KktZa8bakKtYFgSDwWI1CXE50Yb03gzAQuYSh3fG6zyPs1H+jQRUfex6tFo/0/PhFm7nuiAvuxFZacDj
+        rAMXXlfhdMS5WspzrYw+Bl1NVfbGmsTjIV6mtk+8fHi/n9/gOI77AFLTg9ItGsa4AAAAAElFTkSuQmCC
 </value>
   </data>
 </root>

+ 37 - 49
FRM/frmDepositosAPlazo.vb

@@ -359,7 +359,7 @@
             Me.txtRendimientoNeto.Text = oDAPCE.RendimientoNeto.ToString(Configuraciones.CodigoTXTMontos)
 
             For Each item As DataRow In oDAPCE.dtIntereses.Rows
-                Me.txtImpuesto.Text = item("PorcImp") * 100
+                Me.txtImpuesto.Text = Operaciones.ConvertirDecimal(item("PorcImp").ToString) * 100
             Next
 
 
@@ -448,17 +448,17 @@
     Function ColeccionDatos()
         Dim Coleccion As New Collection
         Dim MontoInv, FOper, FVenc, Tasa, Plazo, Periodic, RendBr, RendNet, IngrBrutoTot, IngrNetoTot, Renta As String
-        MontoInv = CDec(txtMontoInversion.Text)
-        FOper = CDate(dtpFechaOperacion.Value)
-        FVenc = CDate(dtpFechaVencimiento.Value)
-        Tasa = CDec(txtTasa.Text.ToString.Trim("%"))
-        Plazo = CInt(txtPlazo.Text)
+        MontoInv = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
+        FOper = dtpFechaOperacion.Value
+        FVenc = dtpFechaVencimiento.Value
+        Tasa = Operaciones.ConvertirDecimal(txtTasa.Text.ToString)
+        Plazo = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
         Periodic = cboPeriodicidad.SelectedValue
-        RendBr = CDec(txtRendimientoBruto.Text.ToString.Trim("%")) / 100
-        RendNet = CDec(txtRendimientoNeto.Text.ToString.Trim("%")) / 100
-        IngrBrutoTot = txtIngresoBruto.Text
-        IngrNetoTot = txtIngresoNeto.Text
-        Renta = txtRenta.Text
+        RendBr = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString) / 100
+        RendNet = Operaciones.ConvertirDecimal(txtRendimientoNeto.Text.ToString) / 100
+        IngrBrutoTot = Operaciones.ConvertirDecimal(txtIngresoBruto.Text.ToString)
+        IngrNetoTot = Operaciones.ConvertirDecimal(txtIngresoNeto.Text.ToString)
+        Renta = Operaciones.ConvertirDecimal(txtRenta.Text.ToString)
 
 
 
@@ -480,13 +480,13 @@
     Function ColeccionElementos(ByVal Index As Integer)
         Dim Coleccion As New Collection
         Dim Correlativo, plazo, Fecha, IngBruto, PorcImp, MontoImp, IngrNeto As String
-        Correlativo = dgvIntereses.Rows(Index).Cells("Correlativo").Value.ToString
-        plazo = dgvIntereses.Rows(Index).Cells("Plazo").Value.ToString
-        Fecha = dgvIntereses.Rows(Index).Cells("Fecha").Value.ToString
-        IngBruto = dgvIntereses.Rows(Index).Cells("Ingreso Bruto").Value.ToString
-        PorcImp = dgvIntereses.Rows(Index).Cells("% Impuesto").Value.ToString.Trim("%")
-        MontoImp = dgvIntereses.Rows(Index).Cells("Monto del Impuesto").Value.ToString
-        IngrNeto = dgvIntereses.Rows(Index).Cells("Ingreso Neto").Value.ToString
+        Correlativo = Operaciones.ConvertirEntero(dgvIntereses.Rows(Index).Cells("Correlativo").Value.ToString)
+        plazo = Operaciones.ConvertirEntero(dgvIntereses.Rows(Index).Cells("Plazo").Value.ToString)
+        Fecha = Operaciones.ConvertirFecha(dgvIntereses.Rows(Index).Cells("Fecha").Value.ToString)
+        IngBruto = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("Ingreso Bruto").Value.ToString)
+        PorcImp = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("% Impuesto").Value.ToString)
+        MontoImp = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("Monto del Impuesto").Value.ToString)
+        IngrNeto = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("Ingreso Neto").Value.ToString)
 
 
         Coleccion.Add(Correlativo)
@@ -506,9 +506,8 @@
 
     Sub Calculo()
         Dim Plazo As Integer = 0
-        If Not String.IsNullOrEmpty(txtPlazo.Text.ToString) Then
-            Plazo = txtPlazo.Text
-        End If
+
+        Plazo = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
         dtpFechaVencimiento.Value = dtpFechaOperacion.Value.AddDays(Plazo)
 
 
@@ -522,9 +521,9 @@
 
 
             Dim Total = TotalIngreso()
-            Dim MontoInv = CDec(txtMontoInversion.Text)
+            Dim MontoInv = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
             Dim Base = 365
-            Dim pla = CDec(txtPlazo.Text)
+            Dim pla = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
             Dim tot As Double = 0
             If (Not MontoInv = 0 And Not pla = 0) Then
 
@@ -542,9 +541,9 @@
     Sub CalcularRendNeto()
         If (Not String.IsNullOrEmpty(txtMontoInversion.Text.ToString) And Not txtMontoInversion.Text.ToString = "0.0" And Not String.IsNullOrEmpty(txtPlazo.Text.ToString) And Not txtPlazo.Text.ToString = "0.0") Then
             Dim Total = TotalIngresoNeto()
-            Dim MontoInv = CDec(txtMontoInversion.Text)
+            Dim MontoInv = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
             Dim Base = 365
-            Dim pla = CDec(txtPlazo.Text)
+            Dim pla = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
             Dim tot As Double = 0
             If (Not MontoInv = 0 And Not pla = 0) Then
 
@@ -564,7 +563,7 @@
 
         For i As Integer = 0 To Cantidad
 
-            TotalIngr = TotalIngr + CDec(dgvIntereses.Rows(i).Cells("Ingreso Bruto").Value)
+            TotalIngr = TotalIngr + Operaciones.ConvertirDecimal(dgvIntereses.Rows(i).Cells("Ingreso Bruto").Value)
         Next
         Return TotalIngr
     End Function
@@ -575,7 +574,7 @@
         Dim TotalIngr As Double = 0
         For i As Integer = 0 To Cantidad
 
-            TotalIngr = TotalIngr + CDec(dgvIntereses.Rows(i).Cells("Ingreso Neto").Value)
+            TotalIngr = TotalIngr + Operaciones.ConvertirDecimal(dgvIntereses.Rows(i).Cells("Ingreso Neto").Value)
 
         Next
 
@@ -710,11 +709,9 @@
         Dim PlazoGlobal As Integer = 0
 
 
-        If String.IsNullOrEmpty(txtPlazo.Text) Then
-            PlazoGlobal = 0
-        Else
-            PlazoGlobal = CDec(txtPlazo.Text)
-        End If
+
+        PlazoGlobal = Operaciones.ConvertirDecimal(txtPlazo.Text.ToString)
+
 
         Dim Periodicidad As String = String.Empty
 
@@ -730,26 +727,13 @@
         Dim FechaInicial As Date = dtpFechaOperacion.Value
         Dim IngrBruto As Double = 0.0
         Dim Monto
-
-
-        If String.IsNullOrEmpty(txtMontoInversion.Text) Then
-            Monto = 0
-        Else
-            Monto = txtMontoInversion.Text
-        End If
-
         Dim Tasa As Double = 0
-
-        If (Not String.IsNullOrEmpty(txtTasa.Text.ToString.Trim("%")) And Not txtTasa.Text.ToString.Trim("%") = "0") Then
-            Tasa = (txtTasa.Text.Trim("%") / 100)
-        End If
-
-
         Dim Impuesto As Double = 0
 
-        If (Not String.IsNullOrEmpty(txtImpuesto.Text.ToString.Trim("%")) And Not txtImpuesto.Text.ToString.Trim("%") = "0") Then
-            Impuesto = (txtImpuesto.Text.Trim("%") / 100)
-        End If
+        Monto = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
+        Tasa = Operaciones.ConvertirDecimal(txtTasa.Text.ToString) / 100
+        Impuesto = Operaciones.ConvertirDecimal(txtImpuesto.Text.ToString) / 100
+
 
         Dim Renta As Double = 0.0
         Dim FechaAnterior As Date
@@ -902,4 +886,8 @@
     Private Sub txtRendimientoNeto_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoNeto.TextChanged
 
     End Sub
+
+    Private Sub BindingNavigator1_RefreshItems(sender As Object, e As EventArgs) Handles BindingNavigator1.RefreshItems
+
+    End Sub
 End Class

+ 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
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHcSURBVDhPnZE9TNtAFMfdDnSlsHRlLVtnJkBMtAydUidQ
-        QpCJQSxhxltRVaEKqVNZCiJQAkI4QgIWBiSgURAGakKUhOYDFLDBSRwSfyhVHr5TEkiEUcRf+unp2e9+
-        Z98RKGnue2OCn26Kcz9a4ydLrTzvacAv6kkoNPUqczzxOh381hL19xRyAaaXdo76qEFKdNgpcaAGuwH1
-        eThptdi3sSCxO9kkB752a386Qfd/AJ37BKoigardmpLLy4AkWHDh+9Kc8XcpW5PtRf1o+J221wHaAQnh
-        VNEUJCFJSiwJZpqzPPNW3/8I2k4bqL73IAiCzkWSMOf+Daust8LS8gocRa+rBejABN7zZrDf8V8zJOw6
-        e44GolIBIqICYYOIqFaIpgrVgnJ6bQOKmJaB9a7hgeC5BD+nf8HsrLvC/IIHQknZXCBl8/hT0UDsOgf8
-        v0s4PqsmdqPUJwgkc8BFLuHAANUyp1cmAluN4CQhgXt+sXKACNSfXmRMBNZqQfimAEFBucfYOXil4ud1
-        CQ4fuUbU/43VXGM5VrI/9VCQkIuYeKk+5FGBxTKUTxuC9Y1NPPAUipqFvr4RvrSUIADghfELrMs1Ds4h
-        F9DOMVzNoGlat5EOL8MwL0uK54Yg7gCs02wwGPYHzgAAAABJRU5ErkJggg==
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHdSURBVDhPnZE7TNtQFIZdBrryWLqywsbMVCqmtgxMwQmP
+        EGRiqi7pXG9UCKoKiQkWQCSUgBCOKgFDl0rQRqlwoSZESUoeoIANTuKQ+KFUOfheJYFEuIr6S5+Ojn3u
+        d+17CZQM96klyS+2Jbj5rsTJRhfPe5vxi0YSDs89zR5/aM2EZjpigf5iPsgM0c63fmqcEh12Shyrw25A
+        jUymrBb7NyxIHnxsk4PTL7UfL0APvAadGwRVkUDVbk3JF2RAEiy48E+1ZwN9ytfZ5yX9aLJb+94L2iEJ
+        kXTJFCQhSUosC5bbczzTqf8cAG2/B1T/KxAEQeeiKVh1f4Zt1ldlY3MLjmLXtQJ0YALvfTY+6virGRJ2
+        hz1HAzGpCFFRgYhBVFSrxNLFWkElQ7YxRczIwPq+4IHQuQQLi0uwsuKu4lnzQjglmwukXAF/KhqIX+eB
+        P7uE4z+1xG+UxgTBVB646CUcGqBa4fTKRGCrE5wkJXB71qsHiED96UXWRGCtFURuihASlHuMnUNXKn7e
+        kODXI9eI+t/xumusxEqOph8KknIJkyjXhzwqsFgmChlDsLO7hwf+haLmYHj4DV9eShAA8MT4Bdbleg/O
+        CRfQzne4mkHTtG4jHT6GYZrKiv8NQdwBpkxsLsblvHAAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAG1SURBVDhPlZM7S8NQGIbTpv4AF3HwCg4iOFm6ldZ62fwB
-        ioso4uTg0KKLgyCoONgQOjm56GAHpVhBUNtBEFwc3LwUJKU3e0t6b1/PF5paNfXywUPC4bxPvu8cwtWr
-        izHCsPxCH8PI+FYjuVwuFQgEqpVKBXoUCgUIgrDH9upKLBSWZRmKojRIp9NIJpOIRCKqJBwOQxTFbxID
-        w0Ib8vk8isWi+iSy2SxSqRSi0agqYF2CPuLxeDSJWg0BhTVIQIFMJoNYLPZpHIIy9eyHoFwuNzbQO82t
-        jRKPx9VOJElqLfhKs4Q6ofNIJBJ/FxCahMahMyERrf9ZQJRKJfVcSELQ2r8E1MXLsRs3c0O4GGvD9Uwv
-        BItB/FFAIY2QV8C904q8bxe1Bz+UwxVc2oar53bT8q8Caj8wO4AcC8M9Bbjagc1+xLbt8I3yTy0FzRJq
-        u3bnRXMl1zux4TDVGoJgMFjTkxBX0z2Q9+cBFio4ObwxQks8/BP8KwmozOx6FCbR/Zmej3ZwuzgIydWP
-        6GobHhcMuLCZqmfjxrV6nutmmBl0NbrsT3aIJw5eorZPbXzkwMpvcRzHvQOn44QHuJ9J8wAAAABJRU5E
-        rkJggg==
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGzSURBVDhPlZM7S8NQGIbTpv4AF3HwCg4iOFm6SbVeNn+A
+        4iKKODk4WHQRHAQVBxtCJycXHeygFCsI2i6C4OLg5g0kpTd7Te/N6/lCE6tNbf3gIeFw3iffdw7hqtXF
+        GGHYmtDHMDPqaiSbzSb8fn+lXC7DiHw+D0EQDtleQ4mNwplMBrIs6ySTScTjcYRCIVUSDAYhimKdxMSw
+        0YZcLodCoaA+iXQ6jUQigXA4rApYl6CPuN1uTaKWLqCwBgkokEqlEIlEfoxDUKaa/RaUSiV9A73T3Noo
+        0WhU7USSpMaC39RKqBM6j1gs1rqA0CQ0Dp0JiWi9ZQFRLBbVcyEJQWv/ElAXb2cu3C0M4XqiDf65Xgg2
+        k/ingEIa7x4Bj+ujyHkPoDz5IJ+s4cY+XLkas6w2FVD7gfkBZFkYrhnA2Q7s9COyNwbvOP/SUFArobaV
+        Bw9qK77ViW2HRdEFgUBAMZIQt7M9yBwtAiyUX+fwyXhf4eGb4j9IQGVl1yMzieHP9Hq6j/vlQUjOfoQ3
+        2vC8ZMK13VK5nDRvVvNcN8PKoKsx5Gi6Qzx38BK1fWHnQ8ej/C7HcdwXjbaD+a99aYcAAAAASUVORK5C
+        YII=
 </value>
   </data>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

+ 36 - 63
FRM/frmFOIN.vb

@@ -202,29 +202,19 @@
     Sub AgregarFecha()
         Dim Index As Integer = dgvIngresos.CurrentRow.Index
         Dim IndexAnterior As Integer = Index - 1
-        Dim FechaAnterior As String = String.Empty
-        Dim FechaActual As String = String.Empty
+        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 = dgvIngresos.Rows(IndexAnterior).Cells("Fecha de Corte").Value.ToString
-            If String.IsNullOrEmpty(FechaAnterior) Then
-                MsgBox("Error de Formato en Fecha")
-                Exit Sub
-            Else
-                FechaActual = CalcularFecha(CDate(FechaAnterior), DiaFijo)
-            End If
+            FechaAnterior = Operaciones.ConvertirFecha(dgvIngresos.Rows(IndexAnterior).Cells("Fecha de Corte").Value.ToString)
+            FechaActual = CalcularFecha(FechaAnterior, DiaFijo)
+            dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value = Format((FechaActual), "dd/MM/yyyy").ToString
 
-            If String.IsNullOrEmpty(FechaActual) Then
-                MsgBox("Error de Formato en Fecha")
-                Exit Sub
-            Else
-                dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value = Format(CDate(FechaActual), "dd/MM/yyyy").ToString
-            End If
         Else
 
-            FechaActual = CalcularFecha(CDate(FechaLiquidacion), DiaFijo)
-            dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value = Format(CDate(FechaActual), "dd/MM/yyyy").ToString
+            FechaActual = CalcularFecha(Operaciones.ConvertirFecha(FechaLiquidacion), DiaFijo)
+            dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value = Format(FechaActual, "dd/MM/yyyy").ToString
         End If
 
 
@@ -276,12 +266,11 @@
         End If
 
         If Index > 0 Then
-            FechaAnterior = dgvIngresos.Rows(IndexAnterior).Cells("Fecha de Corte").Value.ToString
-            FechaActual = dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value.ToString
+            FechaAnterior = Operaciones.ConvertirFecha(dgvIngresos.Rows(IndexAnterior).Cells("Fecha de Corte").Value.ToString)
+            FechaActual = Operaciones.ConvertirFecha(dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value.ToString)
 
-            If Not String.IsNullOrEmpty(FechaAnterior) And Not String.IsNullOrEmpty(FechaActual) Then
 
-                If BaseCalculo = 360 Then
+            If BaseCalculo = 360 Then
                     If TipoCalculo = "FinMes" Then
                         DiasFinales = Operaciones.Base360(FechaAnterior, FechaActual)
                     ElseIf TipoCalculo = "Mensual" Then
@@ -294,19 +283,18 @@
 
 
                 End If
-            End If
 
 
-        Else
+
+            Else
             'Primera Fecha'
 
 
 
-            FechaActual = dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value.ToString
+            FechaActual = Operaciones.ConvertirFecha(dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value.ToString)
 
-            If Not String.IsNullOrEmpty(FechaLiquidacion) And Not String.IsNullOrEmpty(FechaActual) Then
 
-                If BaseCalculo = 360 Then
+            If BaseCalculo = 360 Then
                     If TipoCalculo = "FinMes" Then
                         DiasFinales = Operaciones.Base360(FechaLiquidacion, FechaActual)
                     ElseIf TipoCalculo = "Mensual" Then
@@ -319,10 +307,10 @@
 
 
                 End If
-            End If
 
 
-        End If
+
+            End If
         dgvIngresos.Rows(Index).Cells("Dias").Value = DiasFinales
     End Sub
 
@@ -356,14 +344,12 @@
         Dim Dias As Integer = 0
         Dim Calculo As Double = 0
         If Index > 0 Then
-            If Not String.IsNullOrEmpty(txtCuotasDeParticipacion.Text.ToString) Then
-                CuotasParticipacion = txtCuotasDeParticipacion.Text
-            End If
+
+            CuotasParticipacion = Operaciones.ConvertirDecimal(txtCuotasDeParticipacion.Text.ToString)
+
             If Not dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
+                Dividendo = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString)
 
-                If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) Then
-                    Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
-                End If
 
             End If
 
@@ -371,24 +357,22 @@
 
 
         Else
-            If Not String.IsNullOrEmpty(txtCuotasDeParticipacion.Text.ToString) Then
-                CuotasParticipacion = txtCuotasDeParticipacion.Text
-            End If
+
+            CuotasParticipacion = Operaciones.ConvertirDecimal(txtCuotasDeParticipacion.Text.ToString)
+
 
             If Not dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
 
-                If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) Then
-                    Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
-                End If
+                Dividendo = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString)
+
 
             End If
 
 
             If Not dgvIngresos.Rows(Index).Cells("Dias").Value Is Nothing Then
 
-                If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dias").Value.ToString) Then
-                    Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
-                End If
+                Dias = Operaciones.ConvertirEntero(dgvIngresos.Rows(Index).Cells("Dias").Value)
+
 
             End If
 
@@ -423,29 +407,18 @@
             ValorNominal = txtValorNominal.Text
         End If
         If Not dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
-
-            If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) Then
-                Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
-            End If
-
+            Dividendo = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString)
         End If
 
 
         If Not dgvIngresos.Rows(Index).Cells("Ingresos").Value Is Nothing Then
-
-            If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Ingresos").Value.ToString) Then
-                Ingreso = dgvIngresos.Rows(Index).Cells("Ingresos").Value
-            End If
-
+            Ingreso = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Ingresos").Value)
         End If
 
 
 
         If Not dgvIngresos.Rows(Index).Cells("Dias").Value Is Nothing Then
-
-            If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dias").Value.ToString) Then
-                Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
-            End If
+            Dias = Operaciones.ConvertirEntero(dgvIngresos.Rows(Index).Cells("Dias").Value)
 
         End If
 
@@ -839,12 +812,12 @@
         While Index <= Cantidad
             Dim coleccion As New Collection
             Dim FechaCorte, Dias, Dividendo, Ingreso, RendMensual, NumDiv
-            NumDiv = dgvIngresos.Rows(Index).Cells("NumDiv").Value
-            FechaCorte = dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value
-            Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
-            Dividendo = (CDec(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) / 100)
-            Ingreso = dgvIngresos.Rows(Index).Cells("Ingresos").Value
-            RendMensual = (dgvIngresos.Rows(Index).Cells("Rendimiento Mensual").Value.ToString.Trim("%") / 100)
+            NumDiv = Operaciones.ConvertirEntero(dgvIngresos.Rows(Index).Cells("NumDiv").Value)
+            FechaCorte = Operaciones.ConvertirFecha(dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value)
+            Dias = Operaciones.ConvertirEntero(dgvIngresos.Rows(Index).Cells("Dias").Value)
+            Dividendo = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString) / 100
+            Ingreso = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Ingresos").Value)
+            RendMensual = Operaciones.ConvertirDecimal(dgvIngresos.Rows(Index).Cells("Rendimiento Mensual").Value.ToString) / 100
 
             coleccion.Add(NumDiv)
             coleccion.Add(FechaCorte)

+ 53 - 128
FRM/frmFuturos.vb

@@ -69,14 +69,14 @@
 
 
             If Not Variables.TrasladarCMVTA Is Nothing Then
-                txtCantidadContratosCompra.Text = Variables.TrasladarCMVTA.CantidadContratosFUTU
-                txtComisionBrokerCompra.Text = Variables.TrasladarCMVTA.ComisionBrokerFUTU
-                dtpLiquidacionCompra.Value = Variables.TrasladarCMVTA.FechaLiquidacionFUTU
-                dtpOperacionCompra.Value = Variables.TrasladarCMVTA.FechaOperacionFUTU
-                dtpVencimientoCompra.Value = Variables.TrasladarCMVTA.FechaVencimientoFUTU
+                txtCantidadContratosCompra.Text = Operaciones.ConvertirEntero(Variables.TrasladarCMVTA.CantidadContratosFUTU.ToString)
+                txtComisionBrokerCompra.Text = Operaciones.ConvertirDecimal(Variables.TrasladarCMVTA.ComisionBrokerFUTU.ToString)
+                dtpLiquidacionCompra.Value = Operaciones.ConvertirFecha(Variables.TrasladarCMVTA.FechaLiquidacionFUTU.ToString)
+                dtpOperacionCompra.Value = Operaciones.ConvertirFecha(Variables.TrasladarCMVTA.FechaOperacionFUTU.ToString)
+                dtpVencimientoCompra.Value = Operaciones.ConvertirFecha(Variables.TrasladarCMVTA.FechaVencimientoFUTU.ToString)
                 txtIdentificacionContratoCompra.Text = Variables.TrasladarCMVTA.IdContratoFUTU
-                txtValorUnidadCompra.Text = Variables.TrasladarCMVTA.PrecioUnitarioFUTU
-                txtUnidadesContratoCompra.Text = Variables.TrasladarCMVTA.UnidadesPorContratoFUTU
+                txtValorUnidadCompra.Text = Operaciones.ConvertirDecimal(Variables.TrasladarCMVTA.PrecioUnitarioFUTU.ToString)
+                txtUnidadesContratoCompra.Text = Operaciones.ConvertirEntero(Variables.TrasladarCMVTA.UnidadesPorContratoFUTU.ToString)
             End If
         End If
     End Sub
@@ -201,27 +201,15 @@
 
 
 
-        If String.IsNullOrEmpty(txtCantidadContratosCompra.Text.ToString) Then
-            CantContCompra = 0
-        Else
-            CantContCompra = txtCantidadContratosCompra.Text
-        End If
-        If String.IsNullOrEmpty(txtUnidadesContratoCompra.Text.ToString) Then
-            UnidadContratoCompra = 0
-        Else
-            UnidadContratoCompra = txtUnidadesContratoCompra.Text
-        End If
-        If String.IsNullOrEmpty(txtValorUnidadCompra.Text.ToString) Then
-            ValorUnidadCompra = 0
-        Else
-            ValorUnidadCompra = txtValorUnidadCompra.Text
-        End If
-        If String.IsNullOrEmpty(txtComisionBrokerCompra.Text.ToString) Then
-            ComisionBrokerCompra = 0
-        Else
-            ComisionBrokerCompra = txtComisionBrokerCompra.Text
-        End If
 
+        CantContCompra = Operaciones.ConvertirEntero(txtCantidadContratosCompra.Text.ToString)
+        UnidadContratoCompra = Operaciones.ConvertirDecimal(txtUnidadesContratoCompra.Text.ToString)
+        ValorUnidadCompra = Operaciones.ConvertirDecimal(txtValorUnidadCompra.Text.ToString)
+        ComisionBrokerCompra = Operaciones.ConvertirDecimal(txtComisionBrokerCompra.Text.ToString)
+        CantContVenta = Operaciones.ConvertirEntero(txtCantidadContratosVenta.Text.ToString)
+        UnidadContratoVenta = Operaciones.ConvertirDecimal(txtUnidadesContratoVenta.Text.ToString)
+        ValorUnidadVenta = Operaciones.ConvertirDecimal(txtValorUnidadVenta.Text.ToString)
+        ComisionBrokerVenta = Operaciones.ConvertirDecimal(txtComisionBrokerVenta.Text.ToString)
 
 
 
@@ -229,89 +217,32 @@
 
 
 
-        If String.IsNullOrEmpty(txtCantidadContratosVenta.Text.ToString) Then
-            CantContVenta = 0
-        Else
-            CantContVenta = txtCantidadContratosVenta.Text
-
-        End If
-        If String.IsNullOrEmpty(txtUnidadesContratoVenta.Text.ToString) Then
-            UnidadContratoVenta = 0
-        Else
-            UnidadContratoVenta = txtUnidadesContratoVenta.Text
-        End If
-        If String.IsNullOrEmpty(txtValorUnidadVenta.Text.ToString) Then
-            ValorUnidadVenta = 0
-        Else
-            ValorUnidadVenta = txtValorUnidadVenta.Text
-        End If
-        If String.IsNullOrEmpty(txtComisionBrokerVenta.Text.ToString) Then
-            ComisionBrokerVenta = 0
-        Else
-            ComisionBrokerVenta = txtComisionBrokerVenta.Text
-        End If
-
-
-
-
-
-
 
         Dim ValorTransadoCompra = ValorTransado(CantContCompra, UnidadContratoCompra, ValorUnidadCompra)
         Dim ValorTransadoVenta = ValorTransado(CantContVenta, UnidadContratoVenta, ValorUnidadVenta)
         Dim ValorRecibidoCompra = ValorRecibido(ValorTransadoCompra, ComisionBrokerCompra)
         Dim ValorRecibidoVenta = ValorPagado(ValorTransadoVenta, ComisionBrokerVenta)
-        If Double.IsInfinity(ValorTransadoCompra) Or Double.IsNaN(ValorTransadoCompra) Then
-            txtValorTransadoCompra.Text = 0
-        Else
 
-            txtValorTransadoCompra.Text = ValorTransadoCompra
-        End If
-
-        If Double.IsInfinity(ValorTransadoVenta) Or Double.IsNaN(ValorTransadoVenta) Then
-            txtValorTransadoVenta.Text = 0
-        Else
-            txtValorTransadoVenta.Text = ValorTransadoVenta
-        End If
+        txtValorTransadoCompra.Text = Operaciones.ConvertirDecimal(ValorTransadoCompra.ToString)
+        txtValorTransadoVenta.Text = Operaciones.ConvertirDecimal(ValorTransadoVenta.ToString)
+        txtValorRecibidoCompra.Text = Operaciones.ConvertirDecimal(ValorRecibidoCompra.ToString)
+        txtValorRecibidoVenta.Text = Operaciones.ConvertirDecimal(ValorRecibidoVenta.ToString)
 
 
 
 
-        If Double.IsInfinity(ValorRecibidoCompra) Or Double.IsNaN(ValorRecibidoCompra) Then
-            txtValorRecibidoCompra.Text = 0
-        Else
-            txtValorRecibidoCompra.Text = ValorRecibidoCompra
-        End If
-
-        If Double.IsInfinity(ValorRecibidoVenta) Or Double.IsNaN(ValorRecibidoVenta) Then
-            txtValorRecibidoVenta.Text = 0
-        Else
-            txtValorRecibidoVenta.Text = ValorRecibidoVenta
-        End If
-
-
-
         If (cboOperacionVenta.SelectedIndex = 0) Then
             Dim GananciaPerdida = Format(Me.GananciaPerdida(txtValorRecibidoVenta.Text, txtValorRecibidoCompra.Text), "0.0000")
 
-            If Double.IsInfinity(GananciaPerdida) Or Double.IsNaN(GananciaPerdida) Then
-                txtGananciaPerdida.Text = 0
-            Else
-                txtGananciaPerdida.Text = GananciaPerdida
-            End If
+            txtGananciaPerdida.Text = Operaciones.ConvertirDecimal(GananciaPerdida.ToString)
+
 
 
 
 
         ElseIf (cboOperacionVenta.SelectedIndex = 1) Then
             Dim GananciaPerdida = Format(Me.GananciaPerdida(txtValorRecibidoCompra.Text, txtValorRecibidoVenta.Text), "0.0000")
-            If Double.IsInfinity(GananciaPerdida) Or Double.IsNaN(GananciaPerdida) Then
-                txtGananciaPerdida.Text = 0
-            Else
-                txtGananciaPerdida.Text = GananciaPerdida
-            End If
-
-
+            txtGananciaPerdida.Text = Operaciones.ConvertirDecimal(GananciaPerdida.ToString)
         Else
             txtGananciaPerdida.Text = "0.0"
         End If
@@ -325,14 +256,8 @@
         Dim Rendimientos = Format((Rendimiento(txtGananciaPerdida.Text, txtValorRecibidoVenta.Text, Dias) * 100), "0.0000")
 
 
-        If Double.IsInfinity(Rendimientos) Or Double.IsNaN(Rendimientos) Then
-            txtRendimiento.Text = "0.0%"
-        Else
-            txtRendimiento.Text = CStr(Rendimientos) + "%"
-        End If
-
-
 
+        txtRendimiento.Text = Operaciones.ConvertirDecimal(Rendimientos.ToString).ToString + "%"
 
     End Sub
 
@@ -340,13 +265,9 @@
 
     Function ValorTransado(ByVal CantidadContratos As Double, ByVal UnidadesContrato As Double, ByVal ValorUnidad As Double)
         Dim ValorTrans As Double = 0
-        If (String.IsNullOrEmpty(CantidadContratos.ToString) And String.IsNullOrEmpty(UnidadesContrato.ToString) And String.IsNullOrEmpty(ValorUnidad.ToString)) Then
-            ValorTrans = 0
-        Else
-            ValorTrans = CantidadContratos * UnidadesContrato * ValorUnidad
-
-        End If
-
+        ValorTrans = Operaciones.ConvertirEntero(CantidadContratos.ToString) *
+        Operaciones.ConvertirDecimal(UnidadesContrato.ToString) *
+        Operaciones.ConvertirDecimal(ValorUnidad.ToString)
         Return ValorTrans
     End Function
 
@@ -613,29 +534,33 @@
             If (InstrumentoFinanciero = "FUTU" Or InstrumentoFinanciero = "OPC") Then
 
 
-                dtpOperacionCompra.Value = CDate(coleccion(1))
-                dtpLiquidacionCompra.Value = CDate(coleccion(2))
-                dtpVencimientoCompra.Value = CDate(coleccion(3))
-                txtValorUnidadCompra.Text = CDec(coleccion(4))
-                txtValorTransadoCompra.Text = CDec(coleccion(5))
-                txtComisionBrokerCompra.Text = CDec(coleccion(6))
-                txtValorRecibidoCompra.Text = CDec(coleccion(7))
-                txtIdentificacionContratoCompra.Text = CStr(coleccion(8))
-                txtCantidadContratosCompra.Text = CInt(coleccion(9))
-                txtUnidadesContratoCompra.Text = CInt(coleccion(10))
-
-                dtpOperacionVenta.Value = CDate(coleccion(11))
-                dtpLiquidacionVenta.Value = CDate(coleccion(12))
-                dtpVencimientoVenta.Value = CDate(coleccion(13))
-                txtValorUnidadVenta.Text = CDec(coleccion(14))
-                txtValorTransadoVenta.Text = CDec(coleccion(15))
-                txtComisionBrokerVenta.Text = CDec(coleccion(16))
-                txtValorRecibidoVenta.Text = CDec(coleccion(17))
-                txtIdentificacionContratoVenta.Text = CStr(coleccion(18))
-                txtCantidadContratosVenta.Text = CInt(coleccion(19))
-                txtUnidadesContratoVenta.Text = CInt(coleccion(20))
-                txtGananciaPerdida.Text = CDec(coleccion(21))
-                txtRendimiento.Text = CDec(coleccion(22))
+                dtpOperacionCompra.Value = Operaciones.ConvertirFecha(coleccion(1).ToString)
+                dtpLiquidacionCompra.Value = Operaciones.ConvertirFecha(coleccion(2).ToString)
+                dtpVencimientoCompra.Value = Operaciones.ConvertirFecha(coleccion(3).ToString)
+                txtValorUnidadCompra.Text = Operaciones.ConvertirDecimal(coleccion(4).ToString)
+                txtValorTransadoCompra.Text = Operaciones.ConvertirDecimal(coleccion(5).ToString)
+                txtComisionBrokerCompra.Text = Operaciones.ConvertirDecimal(coleccion(6).ToString)
+                txtValorRecibidoCompra.Text = Operaciones.ConvertirDecimal(coleccion(7).ToString)
+                txtIdentificacionContratoCompra.Text = coleccion(8).ToString
+                txtCantidadContratosCompra.Text = Operaciones.ConvertirEntero(coleccion(9).ToString)
+                txtUnidadesContratoCompra.Text = Operaciones.ConvertirDecimal(coleccion(10).ToString)
+
+                dtpOperacionVenta.Value = Operaciones.ConvertirFecha(coleccion(11).ToString)
+                dtpLiquidacionVenta.Value = Operaciones.ConvertirFecha(coleccion(12).ToString)
+                dtpVencimientoVenta.Value = Operaciones.ConvertirFecha(coleccion(13).ToString)
+                txtValorUnidadVenta.Text = Operaciones.ConvertirDecimal(coleccion(14).ToString)
+                txtValorTransadoVenta.Text = Operaciones.ConvertirDecimal(coleccion(15).ToString)
+                txtComisionBrokerVenta.Text = Operaciones.ConvertirDecimal(coleccion(16).ToString)
+                txtValorRecibidoVenta.Text = Operaciones.ConvertirDecimal(coleccion(17).ToString)
+                txtIdentificacionContratoVenta.Text = coleccion(18).ToString
+                txtCantidadContratosVenta.Text = Operaciones.ConvertirEntero(coleccion(19).ToString)
+                txtUnidadesContratoVenta.Text = Operaciones.ConvertirDecimal(coleccion(20).ToString)
+                txtGananciaPerdida.Text = Operaciones.ConvertirDecimal(coleccion(21).ToString)
+                txtRendimiento.Text = Operaciones.ConvertirDecimal(coleccion(22).ToString)
+
+
+
+
                 If (coleccion(23).ToString = "Corto") Then
 
                     cboOperacionVenta.SelectedIndex = 0

+ 202 - 418
FRM/frmLetes.vb

@@ -85,18 +85,7 @@ Public Class frmLetes
 
 
 
-    Function GetPlazoInversion() As Integer
-        Dim valor As Integer
 
-        If Me.txtPlazoInversion.Text.Length = 0 Then
-            valor = 0
-        Else
-            valor = Me.txtPlazoInversion.Text
-        End If
-
-
-        Return valor
-    End Function
 
     Function GetValorNominal() As Double
         Dim valor As Double
@@ -179,57 +168,8 @@ Public Class frmLetes
         Return valor
     End Function
 
-    Function GetPeriodicidad() As String
-        Dim valor As String
-
-        Try
-            valor = Me.cboPeriodicidad.SelectedValue
-        Catch ex As Exception
-            valor = ""
-        End Try
-
-        Return valor
-    End Function
-
-
-    Function GetCasa() As String
-        Dim valor As String
-
-        valor = Me.cboCasasCorredoras.SelectedValue
-
-        Return valor
-    End Function
-
-
     'CALCULOS
 
-
-
-
-    Function CalcularFechaLiquidacion() As Date
-        Dim valor As Date
-        valor = GetFechaOperacion()
-        Return valor
-    End Function
-
-    Function CalcularFechaVencimiento() As Date
-        Dim valor As Date
-        valor = GetFechaLiquidacion()
-        Return valor
-    End Function
-
-    Function CalcularValorTransado() As Double
-        Dim valor As Double
-        valor = GetValorNominal() * GetPrecio()
-        valor = Math.Round(valor, DecimalesRedondeo)
-
-        Return valor
-    End Function
-
-
-
-
-
     Function CalcularValorApagar() As Double
         Dim valor As Double
 
@@ -240,27 +180,6 @@ Public Class frmLetes
     End Function
 
 
-
-    Function CalcularIngresoBruto() As Double
-        Dim valor As Double
-
-        valor = GetValorNominal() - GetValorTransado()
-        valor = Math.Round(valor, DecimalesRedondeo)
-
-        Return valor
-    End Function
-
-    Function CalcularIngresoNeto() As Double
-        Dim valor As Double
-
-        valor = GetValorNominal() - GetTotalAPagar()
-        valor = Math.Round(valor, DecimalesRedondeo)
-
-        Return valor
-    End Function
-
-
-
     'AUTO
     Sub RefrescarPlazoInversion()
         Me.txtPlazoInversion.Text = 0
@@ -271,11 +190,6 @@ Public Class frmLetes
     End Sub
 
 
-
-
-
-
-
     Sub RefrescarTotalAPagar()
         Me.txtTotalAPagar.Text = CalcularValorApagar()
     End Sub
@@ -303,8 +217,6 @@ Public Class frmLetes
 
     Private Sub txtPlazoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoBruto.TextChanged, txtPlazoInversion.TextChanged
 
-
-
         RellenarDatos()
     End Sub
 
@@ -577,60 +489,40 @@ Public Class frmLetes
         If (Not dat(1).ToString = "False") Then
 
 
-            txtValorNominal.Text = dat(1)
-
-            dtpFechaOperacion.Value = dat(2)
-
-            dtpFechaLiquidacion.Value = dat(3)
+            txtValorNominal.Text = Operaciones.ConvertirDecimal(dat(1).ToString)
+            dtpFechaOperacion.Value = Operaciones.ConvertirFecha(dat(2).ToString)
+            dtpFechaLiquidacion.Value = Operaciones.ConvertirFecha(dat(3).ToString)
+            txtPlazoInversion.Text = Operaciones.ConvertirEntero(dat(4).ToString)
 
 
-
-            txtPlazoInversion.Text = dat(4)
             If (String.IsNullOrEmpty(txtRendimientoBruto.Text)) Then
-                txtRendimientoBruto.Text = 0
                 txtRendimientoBruto.Text = CStr(Format((txtRendimientoBruto.Text), "0.00")) + "%"
             Else
-                txtRendimientoBruto.Text = CStr(dat(5) * 100) + "%"
+                txtRendimientoBruto.Text = CStr(Operaciones.ConvertirDecimal(dat(5).ToString) * 100) + "%"
             End If
 
 
-            cboCasasCorredoras.SelectedValue = dat(6)
+            cboCasasCorredoras.SelectedValue = dat(6).ToString
+            cboPeriodicidad.SelectedValue = dat(7).ToString
 
-            cboPeriodicidad.SelectedValue = dat(7)
-
-            If (dat(8) = 0) Then
-                Base = 0
-            ElseIf (dat(8) = 1) Then
-                Base = 1
-            ElseIf (dat(8) = 2) Then
-                Base = 2
-            ElseIf (dat(8) = 3) Then
-                Base = 3
-            End If
 
+            Base = Operaciones.ConvertirEntero(dat(8).ToString)
             cboBase.SelectedIndex = Base
 
             If (String.IsNullOrEmpty(dat(9).ToString)) Then
-
-                txtPorcentajeComisionCasa.Text = 0
                 txtPorcentajeComisionCasa.Text = Format(((txtPorcentajeComisionCasa.Text.Trim("%")) * 100), "0.00").ToString + "%"
             Else
-
-                txtPorcentajeComisionCasa.Text = CStr(dat(9) * 100) + "%"
+                txtPorcentajeComisionCasa.Text = CStr(Operaciones.ConvertirDecimal(dat(9).ToString) * 100) + "%"
             End If
 
             If (String.IsNullOrEmpty(dat(10).ToString)) Then
-                txtPorcentajeComisionBolsa.Text = "0.0"
                 txtPorcentajeComisionBolsa.Text = Format((txtPorcentajeComisionBolsa.Text.Trim("%")) * 100, "0.00").ToString + "%"
             Else
-                txtPorcentajeComisionBolsa.Text = CStr(dat(10) * 100) + "%"
+                txtPorcentajeComisionBolsa.Text = CStr(Operaciones.ConvertirDecimal(dat(10).ToString) * 100) + "%"
             End If
 
-            If (Not String.IsNullOrEmpty(dat(12).ToString)) Then
-                cboCasasCorredoras.SelectedValue = dat(12)
-
+            cboCasasCorredoras.SelectedValue = dat(12).ToString
 
-            End If
             If (PBUR Or VCN) Then
 
                 If (Not String.IsNullOrEmpty(dat(13).ToString)) Then
@@ -639,13 +531,13 @@ Public Class frmLetes
 
                 End If
                 If (Not String.IsNullOrEmpty(dat(14).ToString)) Then
-                    dtpUltimaFecha.Value = CDate(dat(14))
+                    dtpUltimaFecha.Value = Operaciones.ConvertirFecha(dat(14).ToString)
 
 
                 End If
             ElseIf CET Then
                 If (Not String.IsNullOrEmpty(dat(13).ToString)) Then
-                    dtpUltimaFecha.Value = CDate(dat(13))
+                    dtpUltimaFecha.Value = Operaciones.ConvertirFecha(dat(13).ToString)
 
 
                 End If
@@ -653,13 +545,10 @@ Public Class frmLetes
             End If
 
             If VCN Then
-                If (String.IsNullOrEmpty(dat(15).ToString)) Then
-                    txtOtrosCostos.Text = "0.0"
-                Else
 
-                    txtOtrosCostos.Text = CDec(dat(15))
 
-                End If
+                txtOtrosCostos.Text = Operaciones.ConvertirDecimal(dat(15).ToString)
+
             End If
         End If
 
@@ -667,39 +556,39 @@ Public Class frmLetes
     End Sub
 
     Private Sub Modificar(ByVal Instrumento As String)
-        Dim ValNom = txtValorNominal.Text
-        Dim FOpe = dtpFechaOperacion.Value
-        Dim FLiq = dtpFechaLiquidacion.Value
-        Dim RendBruto = txtRendimientoBruto.Text.Trim("%") / 100
-        Dim Plazo = txtPlazoInversion.Text
-        Dim PorcentajeComisionCasa = txtPorcentajeComisionCasa.Text.Trim("%") / 100
-        Dim PorcentajeComisionBolsa = txtPorcentajeComisionBolsa.Text.Trim("%") / 100
-        Dim ValTrans As Double = txtValorTransado.Text
-        Dim Precio As Double = CDec(txtPrecio.Text.ToString.Trim("%") / 100)
-        Dim TotPagar As Double = txtTotalAPagar.Text
-        Dim RendNeto As Double = CDec(txtRendimientoNeto.Text.ToString.Trim("%")) / 100
-        Dim IngrBruto As Double = txtIngresoBruto.Text
-        Dim IngrNeto As Double = txtIngresoNeto.Text
-        Dim ComisionCasaValor As Double = txtComisionCasa.Text
-        Dim ComisionBolsaValor As Double = txtComisionBolsa.Text
-        Dim FUlt As Date = dtpUltimaFecha.Value
-        Dim FRed As Date = dtpRedencion.Value
-        Dim FVenc As Date = dtpFechaVencimiento.Value
-        Dim IntAcumulado As Double = CDec(txtInteresAcumulado.Text.ToString.Trim("%") / 100)
-        Dim OtrosCostos As Double = txtOtrosCostos.Text
-        Dim periodo
+        Dim ValNom As Double = Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString)
+        Dim FOpe As Date = Operaciones.ConvertirFecha(dtpFechaOperacion.Value.ToString)
+        Dim FLiq As Date = Operaciones.ConvertirFecha(dtpFechaLiquidacion.Value.ToString)
+        Dim RendBruto As Double = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString) / 100
+        Dim Plazo As Integer = Operaciones.ConvertirEntero(txtPlazoInversion.Text.ToString)
+        Dim PorcentajeComisionCasa As Double = Operaciones.ConvertirDecimal(txtPorcentajeComisionCasa.Text.ToString) / 100
+        Dim PorcentajeComisionBolsa As Double = Operaciones.ConvertirDecimal(txtPorcentajeComisionBolsa.Text.ToString) / 100
+        Dim ValTrans As Double = Operaciones.ConvertirDecimal(txtValorTransado.Text.ToString)
+        Dim Precio As Double = Operaciones.ConvertirDecimal(txtPrecio.Text.ToString.ToString) / 100
+        Dim TotPagar As Double = Operaciones.ConvertirDecimal(txtTotalAPagar.Text.ToString)
+        Dim RendNeto As Double = Operaciones.ConvertirDecimal(txtRendimientoNeto.Text.ToString) / 100
+        Dim IngrBruto As Double = Operaciones.ConvertirDecimal(txtIngresoBruto.Text.ToString)
+        Dim IngrNeto As Double = Operaciones.ConvertirDecimal(txtIngresoNeto.Text.ToString)
+        Dim ComisionCasaValor As Double = Operaciones.ConvertirDecimal(txtComisionCasa.Text.ToString)
+        Dim ComisionBolsaValor As Double = Operaciones.ConvertirDecimal(txtComisionBolsa.Text.ToString)
+        Dim FUlt As Date = Operaciones.ConvertirFecha(dtpUltimaFecha.Value.ToString)
+        Dim FRed As Date = Operaciones.ConvertirFecha(dtpRedencion.Value.ToString)
+        Dim FVenc As Date = Operaciones.ConvertirFecha(dtpFechaVencimiento.Value.ToString)
+        Dim IntAcumulado As Double = Operaciones.ConvertirDecimal(txtInteresAcumulado.Text.ToString.ToString) / 100
+        Dim OtrosCostos As Double = Operaciones.ConvertirDecimal(txtOtrosCostos.Text.ToString)
+
+        Dim periodo As String = String.Empty
+
         If Not cboPeriodicidad.SelectedIndex = -1 Then
             periodo = cboPeriodicidad.SelectedValue
-        Else
-            periodo = DBNull.Value
         End If
-        Dim Casas
+        Dim Casas As String = String.Empty
 
         If Not cboCasasCorredoras.SelectedIndex = -1 Then
             Casas = cboCasasCorredoras.SelectedValue
-        Else
-            Casas = DBNull.Value
         End If
+
+
         Dim ValorPar As Boolean = chbValorPar.Checked
         Dim Base As Integer
         Dim FechaUltima As Date = dtpUltimaFecha.Value
@@ -727,6 +616,7 @@ Public Class frmLetes
         coleccion.Add(periodo)
         coleccion.Add(Base)
         coleccion.Add(Casas)
+
         If (PBUR Or VCN) Then
             coleccion.Add(ValorPar)
             coleccion.Add(FechaUltima)
@@ -738,6 +628,7 @@ Public Class frmLetes
         If VCN Then
             coleccion.Add(OtrosCostos)
         End If
+
         coleccion.Add(ValTrans)
         coleccion.Add(Precio)
         coleccion.Add(TotPagar)
@@ -756,43 +647,37 @@ Public Class frmLetes
     End Sub
 
     Public Function Nuevo(ByVal Instrumento As String)
-        Dim ValNom = txtValorNominal.Text
-        Dim FOpe = dtpFechaOperacion.Value
-        Dim FLiq = dtpFechaLiquidacion.Value
-        Dim RendBruto = txtRendimientoBruto.Text.Trim("%") / 100
-        Dim Plazo = txtPlazoInversion.Text
-        Dim PorcentajeComisionCasa = txtPorcentajeComisionCasa.Text.Trim("%") / 100
-        Dim PorcentajeComisionBolsa = txtPorcentajeComisionBolsa.Text.Trim("%") / 100
-
-        Dim ValTrans As Double = txtValorTransado.Text
-        Dim Precio As Double = CDec(txtPrecio.Text.ToString.Trim("%") / 100)
-        Dim TotPagar As Double = txtTotalAPagar.Text
-        Dim RendNeto As Double = CDec(txtRendimientoNeto.Text.ToString.Trim("%")) / 100
-        Dim IngrBruto As Double = txtIngresoBruto.Text
-        Dim IngrNeto As Double = txtIngresoNeto.Text
-        Dim ComisionCasaValor As Double = txtComisionCasa.Text
-        Dim ComisionBolsaValor As Double = txtComisionBolsa.Text
-        Dim FUlt As Date = dtpUltimaFecha.Value
-        Dim FRed As Date = dtpRedencion.Value
-        Dim FVenc As Date = dtpFechaVencimiento.Value
-        Dim IntAcumulado As Double = CDec(txtInteresAcumulado.Text.ToString.Trim("%") / 100)
-
-
-
-
-
-        Dim periodo
+        Dim ValNom As Double = Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString)
+        Dim FOpe As Date = Operaciones.ConvertirFecha(dtpFechaOperacion.Value.ToString)
+        Dim FLiq As Date = Operaciones.ConvertirFecha(dtpFechaLiquidacion.Value.ToString)
+        Dim RendBruto As Double = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString) / 100
+        Dim Plazo As Integer = Operaciones.ConvertirEntero(txtPlazoInversion.Text.ToString)
+        Dim PorcentajeComisionCasa As Double = Operaciones.ConvertirDecimal(txtPorcentajeComisionCasa.Text.ToString) / 100
+        Dim PorcentajeComisionBolsa As Double = Operaciones.ConvertirDecimal(txtPorcentajeComisionBolsa.Text.ToString) / 100
+        Dim ValTrans As Double = Operaciones.ConvertirDecimal(txtValorTransado.Text.ToString)
+        Dim Precio As Double = Operaciones.ConvertirDecimal(txtPrecio.Text.ToString.ToString) / 100
+        Dim TotPagar As Double = Operaciones.ConvertirDecimal(txtTotalAPagar.Text.ToString)
+        Dim RendNeto As Double = Operaciones.ConvertirDecimal(txtRendimientoNeto.Text.ToString) / 100
+        Dim IngrBruto As Double = Operaciones.ConvertirDecimal(txtIngresoBruto.Text.ToString)
+        Dim IngrNeto As Double = Operaciones.ConvertirDecimal(txtIngresoNeto.Text.ToString)
+        Dim ComisionCasaValor As Double = Operaciones.ConvertirDecimal(txtComisionCasa.Text.ToString)
+        Dim ComisionBolsaValor As Double = Operaciones.ConvertirDecimal(txtComisionBolsa.Text.ToString)
+        Dim FUlt As Date = Operaciones.ConvertirFecha(dtpUltimaFecha.Value.ToString)
+        Dim FRed As Date = Operaciones.ConvertirFecha(dtpRedencion.Value.ToString)
+        Dim FVenc As Date = Operaciones.ConvertirFecha(dtpFechaVencimiento.Value.ToString)
+        Dim IntAcumulado As Double = Operaciones.ConvertirDecimal(txtInteresAcumulado.Text.ToString.ToString) / 100
+
+
+
+        Dim periodo As String = String.Empty
         If Not cboPeriodicidad.SelectedIndex = -1 Then
             periodo = cboPeriodicidad.SelectedValue
-        Else
-            periodo = DBNull.Value
         End If
-        Dim Casas
+        Dim Casas As String = String.Empty
 
         If Not cboCasasCorredoras.SelectedIndex = -1 Then
             Casas = cboCasasCorredoras.SelectedValue
-        Else
-            Casas = DBNull.Value
+
         End If
 
 
@@ -981,20 +866,18 @@ Public Class frmLetes
 
 
     Function ValorTrasado()
-        If (Double.TryParse(txtValorNominal.Text, Nothing) And Double.TryParse(V_txtPrecio.TrimEnd("%"), Nothing)) Then
-
-            Return CDec(txtValorNominal.Text) * CDec((V_txtPrecio.TrimEnd("%")) / 100)
-
-        End If
-        Return 0
+        Return Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString) *
+        (Operaciones.ConvertirDecimal(V_txtPrecio.ToString) / 100)
     End Function
     Function Precio()
-        If (Double.TryParse(txtRendimientoBruto.Text.TrimEnd("%"), Nothing) And Double.TryParse(txtPlazoInversion.Text.TrimEnd("%"), Nothing)) Then
-            Dim Rendimiento = CDec(txtRendimientoBruto.Text.TrimEnd("%"))
-            Dim Plazo = CDec((txtPlazoInversion.Text))
-            Dim Pr = 0.0
 
-            If (IndexBase = 0) Then
+        Dim Rendimiento As Double = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString)
+        Dim Plazo As Integer = Operaciones.ConvertirDecimal(txtPlazoInversion.Text.ToString)
+
+
+        Dim Pr = 0.0
+
+        If (IndexBase = 0) Then
 
                 Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 360)) * Plazo / 360)) * 100
                 Return Pr
@@ -1155,7 +1038,7 @@ Public Class frmLetes
                 End If
                 Return Pr
             End If
-        End If
+
 
         Return 0
 
@@ -1175,19 +1058,18 @@ Public Class frmLetes
 
 
     Function ComisionCasa()
-        Dim ValorTras = ValorTrasado()
-        Dim ComisionDeCasa = txtPorcentajeComisionCasa.Text.TrimEnd("%")
-        Dim PlazoInversion = txtPlazoInversion.Text
+        Dim ValorTras As Double = ValorTrasado()
+        Dim ComisionDeCasa As Double = Operaciones.ConvertirDecimal(txtPorcentajeComisionCasa.Text.ToString)
+        Dim PlazoInversion As Integer = Operaciones.ConvertirEntero(txtPlazoInversion.Text.ToString)
         Dim Comision = 0.0
 
 
-        If (Double.TryParse(ValorTras, Nothing) And Double.TryParse(ComisionDeCasa, Nothing) And Double.TryParse(PlazoInversion, Nothing)) Then
 
 
-            If (IndexBase = 0) Then
+        If (IndexBase = 0) Then
 
-                Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 360)
-                Return Comision
+            Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 360)
+            Return Comision
 
             ElseIf IndexBase = 1 Then
 
@@ -1210,14 +1092,14 @@ Public Class frmLetes
                     If CambioDeFecha = 1 Then
                         DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
                         DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasPrimeraFecha) / 366)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasSegundaFecha) / 365)
-                    ElseIf CambioDeFecha = 2 Then
+                    ComisionOpc1 = (ValorTras * ComisionDeCasa / 100) * (DiasPrimeraFecha / 366)
+                    ComisionOpc2 = (ValorTras * ComisionDeCasa / 100) * (DiasSegundaFecha / 365)
+                ElseIf CambioDeFecha = 2 Then
                         DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
                         DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasPrimeraFecha) / 365)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasSegundaFecha) / 366)
-                    End If
+                    ComisionOpc1 = (ValorTras * ComisionDeCasa / 100) * (DiasPrimeraFecha / 365)
+                    ComisionOpc2 = (ValorTras * ComisionDeCasa / 100) * (DiasSegundaFecha / 366)
+                End If
 
                     Comision = ComisionOpc1 + ComisionOpc2
 
@@ -1225,14 +1107,14 @@ Public Class frmLetes
 
                     If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 365)
+                    Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 365)
 
-                    End If
+                End If
 
                     If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 366)
-                    End If
+                    Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 366)
+                End If
 
                 End If
                 Return Comision
@@ -1262,14 +1144,14 @@ Public Class frmLetes
                     If CambioDeFecha = 1 Then
                         DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
                         DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasPrimeraFecha) / 366)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasSegundaFecha) / 365)
-                    ElseIf CambioDeFecha = 2 Then
+                    ComisionOpc1 = (ValorTras * ComisionDeCasa / 100) * (DiasPrimeraFecha / 366)
+                    ComisionOpc2 = (ValorTras * ComisionDeCasa / 100) * (DiasSegundaFecha / 365)
+                ElseIf CambioDeFecha = 2 Then
                         DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
                         DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasPrimeraFecha) / 365)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(DiasSegundaFecha) / 366)
-                    End If
+                    ComisionOpc1 = (ValorTras * ComisionDeCasa / 100) * (DiasPrimeraFecha / 365)
+                    ComisionOpc2 = (ValorTras * ComisionDeCasa / 100) * (DiasSegundaFecha / 366)
+                End If
 
                     Comision = ComisionOpc1 + ComisionOpc2
 
@@ -1277,189 +1159,162 @@ Public Class frmLetes
 
                     If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 365)
+                    Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 365)
 
-                    End If
+                End If
 
                     If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 366)
-                    End If
+                    Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 366)
+                End If
 
                 End If
                 Return Comision
 
 
             Else
-                Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 360)
-                Return Comision
+            Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 360)
+            Return Comision
             End If
-        End If
+
         Return 0
 
     End Function
 
     Function ComisionBolsa()
-        Dim ValorTras = ValorTrasado()
-        Dim ComisionDeBolsa = txtPorcentajeComisionBolsa.Text.TrimEnd("%")
-        Dim PlazoInversion = txtPlazoInversion.Text
-        Dim Comision = 0.0
-        If (Double.TryParse(ValorTras, Nothing) And Double.TryParse(ComisionDeBolsa, Nothing) And Double.TryParse(PlazoInversion, Nothing)) Then
-
-
-
-            If (IndexBase = 0) Then
+        Dim ValorTras As Double = ValorTrasado()
+        Dim ComisionDeBolsa As Double = Operaciones.ConvertirDecimal(txtPorcentajeComisionBolsa.Text.ToString)
+        Dim PlazoInversion As Integer = Operaciones.ConvertirEntero(txtPlazoInversion.Text.ToString)
+        Dim Comision As Double = 0.0
 
-                Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 360)
 
-                Return Comision
-            ElseIf (IndexBase = 1) Then
-
-
-
-                Dim FechaInicial = dtpFechaLiquidacion.Value
-                Dim FechaFinal = dtpFechaVencimiento.Value
-
-                Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
+        If (IndexBase = 0) Then
 
-                Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
-
-                Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
-                Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
-                Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            Comision = (ValorTras * ComisionDeBolsa / 100) * (PlazoInversion / 360)
+            Return Comision
 
+        ElseIf IndexBase = 1 Then
 
-                If (Not CambioDeFecha = 0) Then
-
-
-                    If CambioDeFecha = 1 Then
-                        DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
-                        DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasPrimeraFecha) / 366)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasSegundaFecha) / 365)
-                    ElseIf CambioDeFecha = 2 Then
-                        DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
-                        DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasPrimeraFecha) / 365)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasSegundaFecha) / 366)
-                    End If
 
-                    Comision = ComisionOpc1 + ComisionOpc2
+            Dim FechaInicial = dtpFechaLiquidacion.Value
+            Dim FechaFinal = dtpFechaVencimiento.Value
 
-                Else
+            Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
 
-                    If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
+            Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 365)
+            Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
+            Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
 
-                    End If
 
-                    If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
+            If (Not CambioDeFecha = 0) Then
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 366)
-                    End If
 
+                If CambioDeFecha = 1 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    ComisionOpc1 = (ValorTras * ComisionDeBolsa / 100) * (DiasPrimeraFecha / 366)
+                    ComisionOpc2 = (ValorTras * ComisionDeBolsa / 100) * (DiasSegundaFecha / 365)
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    ComisionOpc1 = (ValorTras * ComisionDeBolsa / 100) * (DiasPrimeraFecha / 365)
+                    ComisionOpc2 = (ValorTras * ComisionDeBolsa / 100) * (DiasSegundaFecha / 366)
                 End If
-                Return Comision
-
-            ElseIf (IndexBase = 2) Then
-                Dim FechaInicial = dtpFechaLiquidacion.Value
-                Dim FechaFinal = dtpFechaVencimiento.Value
-
-                Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
-
-                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)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasPrimeraFecha) / 366)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasSegundaFecha) / 365)
-                    ElseIf CambioDeFecha = 2 Then
-                        DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
-                        DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
-                        ComisionOpc1 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasPrimeraFecha) / 365)
-                        ComisionOpc2 = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(DiasSegundaFecha) / 366)
-                    End If
 
-                    Comision = ComisionOpc1 + ComisionOpc2
+                Comision = ComisionOpc1 + ComisionOpc2
 
-                Else
-
-                    If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
+            Else
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 365)
+                If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
 
-                    End If
+                    Comision = (ValorTras * ComisionDeBolsa / 100) * (PlazoInversion / 365)
 
-                    If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
+                End If
 
-                        Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 366)
-                    End If
+                If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
 
+                    Comision = (ValorTras * ComisionDeBolsa / 100) * (PlazoInversion / 366)
                 End If
-                Return Comision
-            Else
-                Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 360)
 
-                Return Comision
             End If
+            Return Comision
 
+        ElseIf IndexBase = 2 Then
 
 
 
 
 
 
+            Dim FechaInicial = dtpFechaLiquidacion.Value
+            Dim FechaFinal = dtpFechaVencimiento.Value
 
+            Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
 
+            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)
+                    ComisionOpc1 = (ValorTras * ComisionDeBolsa / 100) * (DiasPrimeraFecha / 366)
+                    ComisionOpc2 = (ValorTras * ComisionDeBolsa / 100) * (DiasSegundaFecha / 365)
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    ComisionOpc1 = (ValorTras * ComisionDeBolsa / 100) * (DiasPrimeraFecha / 365)
+                    ComisionOpc2 = (ValorTras * ComisionDeBolsa / 100) * (DiasSegundaFecha / 366)
+                End If
 
+                Comision = ComisionOpc1 + ComisionOpc2
 
+            Else
 
+                If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
 
+                    Comision = (ValorTras * ComisionDeBolsa / 100) * (PlazoInversion / 365)
 
+                End If
 
+                If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
 
+                    Comision = (ValorTras * ComisionDeBolsa / 100) * (PlazoInversion / 366)
+                End If
 
+            End If
+            Return Comision
 
 
-
-
-
-
-
-
+        Else
+            Comision = (ValorTras * ComisionDeBolsa / 100) * (PlazoInversion / 360)
+            Return Comision
         End If
+
         Return 0
     End Function
 
     Function RendimientoNeto()
 
-        Dim ValorNominal = txtValorNominal.Text
-        Dim TotalPagar = V_txtTotalAPagar
-        Dim PlazoInversion As Integer = 0
-        If Not String.IsNullOrEmpty(txtPlazoInversion.Text) Then
-            PlazoInversion = txtPlazoInversion.Text
-        End If
-
-
+        Dim ValorNominal As Double = Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString)
+        Dim TotalPagar As Double = Operaciones.ConvertirDecimal(V_txtTotalAPagar.ToString)
+        Dim PlazoInversion As Integer = Operaciones.ConvertirEntero(txtPlazoInversion.Text.ToString)
         Dim RendBruto As Double = 0
         Dim ComisionCasa As Double = 0
         Dim ComisionBolsa As Double = 0
 
+
+
+
+
         If Not String.IsNullOrEmpty(txtRendimientoBruto.Text.ToString.Trim("%")) Then
             RendBruto = txtRendimientoBruto.Text.ToString.Trim("%")
         End If
@@ -1614,24 +1469,16 @@ Public Class frmLetes
         Dim ValorNominal As Double = 0
         Dim ValorTrasado As Double = 0
 
-        If Not String.IsNullOrEmpty(txtValorNominal.Text) Then
-            ValorNominal = txtValorNominal.Text
-        End If
 
-        If Not String.IsNullOrEmpty(V_txtValorTransado) Then
-            ValorTrasado = V_txtValorTransado
-        End If
+        ValorNominal = Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString)
+        ValorTrasado = Operaciones.ConvertirDecimal(V_txtValorTransado.ToString)
+        Dim TasaPeriodo = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString)
 
 
 
 
+        TasaPeriodo = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString) / 100
 
-        Dim TasaPeriodo = txtRendimientoBruto.Text.ToString.Trim("%")
-        If String.IsNullOrEmpty(TasaPeriodo) Then
-            TasaPeriodo = 0
-        Else
-            TasaPeriodo = CDec(txtRendimientoBruto.Text.ToString.Trim("%")) / 100
-        End If
 
 
 
@@ -1639,9 +1486,9 @@ Public Class frmLetes
         Dim Bruto As Double = 0
         Dim Plazo As Integer = 0
 
-        If Not String.IsNullOrEmpty(txtPlazoInversion.Text) Then
-            Plazo = txtPlazoInversion.Text
-        End If
+
+        Plazo = Operaciones.ConvertirEntero(txtPlazoInversion.Text.ToString)
+
 
         If (chbValorPar.Checked Or CET) Then
             Dim PlazoDias As Integer = 0
@@ -1717,67 +1564,6 @@ Public Class frmLetes
                 Return Valor
 
             End If
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
         Else
 
             If (Double.TryParse(ValorNominal, Nothing) And Double.TryParse(ValorTrasado, Nothing)) Then
@@ -1789,13 +1575,15 @@ Public Class frmLetes
     End Function
 
     Function IngresoNeto()
-        Dim ValorNominal = txtValorNominal.Text
-        Dim TotalPagar = V_txtTotalAPagar
+        Dim ValorNominal As Double = Operaciones.ConvertirDecimal(txtValorNominal.Text.ToString)
+        Dim TotalPagar As Double = Operaciones.ConvertirDecimal(V_txtTotalAPagar.ToString)
         Dim Neto As Double = 0
 
+
+
         If chbValorPar.Checked Or CET Then
-            Dim IngBruto = txtIngresoBruto.Text
-            Dim Descuentos = (CDec(txtComisionBolsa.Text) + CDec(txtComisionCasa.Text))
+            Dim IngBruto = Operaciones.ConvertirDecimal(txtIngresoBruto.Text.ToString)
+            Dim Descuentos = (Operaciones.ConvertirDecimal(txtComisionBolsa.Text.ToString) + Operaciones.ConvertirDecimal(txtComisionCasa.Text.ToString))
             Neto = (IngBruto * 0.9) - Descuentos
 
             Return Neto
@@ -1809,20 +1597,16 @@ Public Class frmLetes
     End Function
 
     Function TotalPagar()
-        Dim ValorTrasado = V_txtValorTransado
-        Dim ComisionCasa = V_txtComisionCasa.TrimEnd("%")
-        Dim ComisionBolsa = V_txtComisionBolsa.TrimEnd("%")
-        Dim OtrCost As Double = 0.0
-        If (Not String.IsNullOrEmpty(txtOtrosCostos.Text.ToString)) Then
-            OtrCost = CDec(txtOtrosCostos.Text)
-        End If
+        Dim ValorTrasado As Double = Operaciones.ConvertirDecimal(V_txtValorTransado.ToString)
+        Dim ComisionCasa As Double = Operaciones.ConvertirDecimal(V_txtComisionCasa.ToString)
+        Dim ComisionBolsa As Double = Operaciones.ConvertirDecimal(V_txtComisionBolsa.ToString)
+        Dim OtrCost As Double = Operaciones.ConvertirDecimal(txtOtrosCostos.Text.ToString)
+        txtInteresAcumulado.Text = Operaciones.ConvertirDecimal(txtInteresAcumulado.Text.ToString)
+        Dim InteresAcumulado = Operaciones.ConvertirDecimal(txtInteresAcumulado.Text.ToString)
+
 
 
-        If (String.IsNullOrEmpty(txtInteresAcumulado.Text.ToString)) Then
-            txtInteresAcumulado.Text = 0
-        End If
 
-        Dim InteresAcumulado = CDec(txtInteresAcumulado.Text.ToString.Trim("%"))
         If (PBUR Or CET) Then
             If (Double.TryParse(ValorTrasado, Nothing) And Double.TryParse(ComisionCasa, Nothing) And Double.TryParse(ComisionBolsa, Nothing)) Then
                 Dim Total = CDec(ValorTrasado) + CDec(ComisionCasa) + CDec(ComisionBolsa) + InteresAcumulado

+ 47 - 96
FRM/frmNotaEstructurada.vb

@@ -37,24 +37,6 @@
             _TipoTransaccion = value
         End Set
     End Property
-    Private Property IdDocumento As Integer
-        Get
-            Return _IdDocumento
-        End Get
-        Set(value As Integer)
-            _IdDocumento = value
-        End Set
-    End Property
-    Private Property TipoDocumento As String
-        Get
-            Return _TipoDocumento
-        End Get
-        Set(value As String)
-            _TipoDocumento = value
-        End Set
-    End Property
-
-
 
     Private Sub frmNotaEstructurada_Load(sender As Object, e As EventArgs) Handles MyBase.Load
 
@@ -457,17 +439,19 @@
     Function ColeccionDatos()
         Dim Coleccion As New Collection
         Dim MontoInv, FOper, FVenc, Tasa, Plazo, Periodic, RendBr, RendNet, IngrBrutoTot, IngrNetoTot, Renta As String
-        MontoInv = CDec(txtMontoInversion.Text)
-        FOper = CDate(dtpFechaOperacion.Value)
-        FVenc = CDate(dtpFechaVencimiento.Value)
-        Tasa = CDec(txtTasa.Text.ToString.Trim("%"))
-        Plazo = CInt(txtPlazo.Text)
+
+
+        MontoInv = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
+        FOper = Operaciones.ConvertirFecha(dtpFechaOperacion.Value.ToString)
+        FVenc = Operaciones.ConvertirFecha(dtpFechaVencimiento.Value.ToString)
+        Tasa = Operaciones.ConvertirDecimal(txtTasa.Text.ToString)
+        Plazo = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
         Periodic = cboPeriodicidad.SelectedValue
-        RendBr = CDec(txtRendimientoBruto.Text.ToString.Trim("%")) / 100
-        RendNet = CDec(txtRendimientoNeto.Text.ToString.Trim("%")) / 100
-        IngrBrutoTot = txtIngresoBruto.Text
-        IngrNetoTot = txtIngresoNeto.Text
-        Renta = txtRenta.Text
+        RendBr = Operaciones.ConvertirDecimal(txtRendimientoBruto.Text.ToString) / 100
+        RendNet = Operaciones.ConvertirDecimal(txtRendimientoNeto.Text.ToString) / 100
+        IngrBrutoTot = Operaciones.ConvertirDecimal(txtIngresoBruto.Text.ToString)
+        IngrNetoTot = Operaciones.ConvertirDecimal(txtIngresoNeto.Text.ToString)
+        Renta = Operaciones.ConvertirDecimal(txtRenta.Text.ToString)
 
 
 
@@ -489,13 +473,14 @@
     Function ColeccionElementos(ByVal Index As Integer)
         Dim Coleccion As New Collection
         Dim Correlativo, plazo, Fecha, IngBruto, PorcImp, MontoImp, IngrNeto As String
-        Correlativo = dgvIntereses.Rows(Index).Cells("Correlativo").Value.ToString
-        plazo = dgvIntereses.Rows(Index).Cells("Plazo").Value.ToString
-        Fecha = dgvIntereses.Rows(Index).Cells("Fecha").Value.ToString
-        IngBruto = dgvIntereses.Rows(Index).Cells("Ingreso Bruto").Value.ToString
-        PorcImp = dgvIntereses.Rows(Index).Cells("% Impuesto").Value.ToString.Trim("%")
-        MontoImp = dgvIntereses.Rows(Index).Cells("Monto del Impuesto").Value.ToString
-        IngrNeto = dgvIntereses.Rows(Index).Cells("Ingreso Neto").Value.ToString
+
+        Correlativo = Operaciones.ConvertirEntero(dgvIntereses.Rows(Index).Cells("Correlativo").Value.ToString)
+        plazo = Operaciones.ConvertirEntero(dgvIntereses.Rows(Index).Cells("Plazo").Value.ToString)
+        Fecha = Operaciones.ConvertirFecha(dgvIntereses.Rows(Index).Cells("Fecha").Value.ToString)
+        IngBruto = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("Ingreso Bruto").Value.ToString)
+        PorcImp = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("% Impuesto").Value.ToString)
+        MontoImp = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("Monto del Impuesto").Value.ToString)
+        IngrNeto = Operaciones.ConvertirDecimal(dgvIntereses.Rows(Index).Cells("Ingreso Neto").Value.ToString)
 
 
         Coleccion.Add(Correlativo)
@@ -515,9 +500,8 @@
 
     Sub Calculo()
         Dim Plazo As Integer = 0
-        If Not String.IsNullOrEmpty(txtPlazo.Text.ToString) Then
-            Plazo = txtPlazo.Text
-        End If
+
+        Plazo = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
         dtpFechaVencimiento.Value = dtpFechaOperacion.Value.AddDays(Plazo)
 
 
@@ -527,13 +511,11 @@
     End Sub
 
     Sub CalcularRendBruto()
-        If (Not String.IsNullOrEmpty(txtMontoInversion.Text.ToString) And Not txtMontoInversion.Text.ToString = "0.0" And Not String.IsNullOrEmpty(txtPlazo.Text.ToString) And Not txtPlazo.Text.ToString = "0.0") Then
 
-
-            Dim Total = TotalIngreso()
-            Dim MontoInv = CDec(txtMontoInversion.Text)
+        Dim Total As Double = TotalIngreso()
+        Dim MontoInv As Double = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
             Dim Base = 365
-            Dim pla = CDec(txtPlazo.Text)
+            Dim pla As Double = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
             Dim tot As Double = 0
             If (Not MontoInv = 0 And Not pla = 0) Then
 
@@ -541,39 +523,37 @@
                 tot = (Total / MontoInv) * (Base / pla)
             End If
             txtRendimientoBruto.Text = CStr((tot * 100)) + "%"
-        Else
-            txtRendimientoBruto.Text = "0.0%"
-        End If
+
 
     End Sub
 
 
     Sub CalcularRendNeto()
-        If (Not String.IsNullOrEmpty(txtMontoInversion.Text.ToString) And Not txtMontoInversion.Text.ToString = "0.0" And Not String.IsNullOrEmpty(txtPlazo.Text.ToString) And Not txtPlazo.Text.ToString = "0.0") Then
-            Dim Total = TotalIngresoNeto()
-            Dim MontoInv = CDec(txtMontoInversion.Text)
-            Dim Base = 365
-            Dim pla = CDec(txtPlazo.Text)
-            Dim tot As Double = 0
-            If (Not MontoInv = 0 And Not pla = 0) Then
+        Dim Total As Double = TotalIngresoNeto()
+        Dim MontoInv As Double = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
+        Dim Base = 365
+        Dim pla As Double = Operaciones.ConvertirDecimal(txtPlazo.Text.ToString)
+        Dim tot As Double = 0
+
+
+
+        If (Not MontoInv = 0 And Not pla = 0) Then
 
 
                 tot = (Total / MontoInv) * (Base / pla)
             End If
             txtRendimientoNeto.Text = CStr((tot * 100)) + "%"
-        Else
-            txtRendimientoNeto.Text = "0.0%"
-        End If
+
     End Sub
 
 
     Function TotalIngreso()
-        Dim Cantidad = CDec(dgvIntereses.Rows.Count - 1)
+        Dim Cantidad As Integer = CDec(dgvIntereses.Rows.Count - 1)
         Dim TotalIngr As Double = 0
 
         For i As Integer = 0 To Cantidad
 
-            TotalIngr = TotalIngr + CDec(dgvIntereses.Rows(i).Cells("Ingreso Bruto").Value)
+            TotalIngr = TotalIngr + Operaciones.ConvertirDecimal(dgvIntereses.Rows(i).Cells("Ingreso Bruto").Value)
         Next
         Return TotalIngr
     End Function
@@ -584,7 +564,7 @@
         Dim TotalIngr As Double = 0
         For i As Integer = 0 To Cantidad
 
-            TotalIngr = TotalIngr + CDec(dgvIntereses.Rows(i).Cells("Ingreso Neto").Value)
+            TotalIngr = TotalIngr + Operaciones.ConvertirDecimal(dgvIntereses.Rows(i).Cells("Ingreso Neto").Value)
 
         Next
 
@@ -610,7 +590,7 @@
         Return diccionario
     End Function
 
-    Function NuevoElementoGuardar()
+    Sub NuevoElementoGuardar()
 
         Dim Index As Integer = dgvIntereses.Rows.Count - 2
         For i As Integer = 0 To Index
@@ -620,7 +600,7 @@
         Next
 
 
-    End Function
+    End Sub
 
 
     Sub ModificarElemento()
@@ -716,56 +696,27 @@
 
     Sub CalcularPlazo()
         dgvIntereses.Rows.Clear()
-        Dim PlazoGlobal As Integer = 0
-
-
-        If String.IsNullOrEmpty(txtPlazo.Text) Then
-            PlazoGlobal = 0
-        Else
-            PlazoGlobal = CDec(txtPlazo.Text)
-        End If
-
+        Dim PlazoGlobal As Integer = Operaciones.ConvertirEntero(txtPlazo.Text.ToString)
         Dim Periodicidad As String = String.Empty
 
         If Not cboPeriodicidad.SelectedValue Is Nothing Then
             Try
-
-
                 Periodicidad = cboPeriodicidad.SelectedValue
             Catch ex As Exception
 
             End Try
         End If
-        Dim FechaInicial As Date = dtpFechaOperacion.Value
-        Dim IngrBruto As Double = 0.0
-        Dim Monto
-
-
-        If String.IsNullOrEmpty(txtMontoInversion.Text) Then
-            Monto = 0
-        Else
-            Monto = txtMontoInversion.Text
-        End If
-
-        Dim Tasa As Double = 0
-
-        If (Not String.IsNullOrEmpty(txtTasa.Text.ToString.Trim("%")) And Not txtTasa.Text.ToString.Trim("%") = "0") Then
-            Tasa = (txtTasa.Text.Trim("%") / 100)
-        End If
 
 
-        Dim Impuesto As Double = 0
-
-        If (Not String.IsNullOrEmpty(txtImpuesto.Text.ToString.Trim("%")) And Not txtImpuesto.Text.ToString.Trim("%") = "0") Then
-            Impuesto = (txtImpuesto.Text.Trim("%") / 100)
-        End If
-
+        Dim FechaInicial As Date = dtpFechaOperacion.Value
+        Dim IngrBruto As Double = 0.0
+        Dim Monto As Double = Operaciones.ConvertirDecimal(txtMontoInversion.Text.ToString)
+        Dim Tasa As Double = Operaciones.ConvertirDecimal(txtTasa.Text.ToString) / 100
+        Dim Impuesto As Double = Operaciones.ConvertirDecimal(txtImpuesto.Text.ToString) / 100
         Dim Renta As Double = 0.0
         Dim FechaAnterior As Date
         Dim IngresoNeto As Double = 0.0
         Dim SumaIngresoBruto, SumaRenta, SumaIngresoNeto As Double
-
-
         Dim Plazo = NotaCalcular.CalcularPlazo(Periodicidad)
         Dim Cantidad = NotaCalcular.CalcularIteraciones(PlazoGlobal, Plazo)
         Dim Fecha As String = String.Empty

+ 54 - 71
FRM/frmPrestamoEmpresariales.vb

@@ -215,19 +215,16 @@
 
     Sub Formato()
         If (String.IsNullOrEmpty(txtMonto.Text.ToString)) Then
-            txtMonto.Text = 0
             txtMonto.Text = Format(txtMonto.Text, "0.0")
 
         End If
 
         If (String.IsNullOrEmpty(txtTasa.Text.ToString.TrimEnd("%"))) Then
-            txtTasa.Text = 0
             txtTasa.Text = Format(txtTasa.Text, "0.0")
         End If
 
 
-        If (String.IsNullOrEmpty(txtComisionDesembolso.Text.ToString.TrimEnd("%"))) Then
-            txtComisionDesembolso.Text = 0
+        If (String.IsNullOrEmpty(txtComisionDesembolso.Text.ToString.Trim("%"))) Then
             txtComisionDesembolso.Text = Format(txtComisionDesembolso.Text, "0.0")
         End If
 
@@ -251,30 +248,15 @@
 
         Dim V_txtMonto = 0.0, V_txtTasa = 0.0, V_txtComisionDesembolso = 0.0
 
+        V_txtMonto = Operaciones.ConvertirDecimal(txtMonto.Text.ToString)
+        V_txtTasa = Operaciones.ConvertirDecimal(txtTasa.Text.ToString) / 100
+        V_txtComisionDesembolso = Operaciones.ConvertirDecimal(txtComisionDesembolso.Text.ToString) / 100
 
 
 
 
 
 
-        If Not String.IsNullOrEmpty(txtMonto.Text.Trim("%")) Then
-            V_txtMonto = txtMonto.Text.Trim("%")
-        End If
-
-
-        If Not String.IsNullOrEmpty(txtTasa.Text.ToString.Trim("%")) Then
-            V_txtTasa = (CDec(txtTasa.Text.ToString.Trim("%")) / 100)
-        End If
-
-
-        If Not String.IsNullOrEmpty(txtComisionDesembolso.Text.ToString.TrimEnd("%")) Then
-            V_txtComisionDesembolso = (CDec(txtComisionDesembolso.Text.ToString.TrimEnd("%")) / 100)
-        End If
-
-
-
-
-
         If (cboTipoTasa.SelectedIndex = -1) Then
             cboTipoTasa.SelectedIndex = 0
         End If
@@ -441,7 +423,7 @@
                     Else
                         For j As Integer = 0 To CantidadFilas - 1
 
-                            SumaAmortizado += dgvDetalles.Rows(j).Cells("Amortizacion").Value
+                            SumaAmortizado += Operaciones.ConvertirDecimal(dgvDetalles.Rows(j).Cells("Amortizacion").Value)
 
 
 
@@ -463,8 +445,8 @@
 
 
 
-                            Dim PagoPendienteAnterior = dgvDetalles.Rows(Index - 1).Cells("Saldo Pendiente").Value
-                                SaldoPendi = PagoPendienteAnterior
+                            Dim PagoPendienteAnterior = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index - 1).Cells("Saldo Pendiente").Value)
+                            SaldoPendi = PagoPendienteAnterior
 
                                 dgvDetalles.Rows(Index).Cells("Amortizacion").Value = SaldoPendi
 
@@ -591,8 +573,8 @@
             Saldo = Monto - Amortizado
         ElseIf (Index > 0) Then
             SaldoAnterior = Monto
-            PagoPendienteAnterior = dgvDetalles.Rows(Index - 1).Cells("Saldo Pendiente").Value
-            Amortizacion = dgvDetalles.Rows(Index - 1).Cells("Amortizacion").Value
+            PagoPendienteAnterior = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index - 1).Cells("Saldo Pendiente").Value)
+            Amortizacion = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index - 1).Cells("Amortizacion").Value)
 
 
             If (SaldoAnterior = Amortizado) Then
@@ -643,13 +625,8 @@
     Function IngresoComision(ByVal Index As Integer, ByVal V_txtComisionDesembolso As Double, ByVal V_txtMonto As Double)
         Dim Valor
         If (Index = 0) Then
-            If (Not String.IsNullOrEmpty(V_txtComisionDesembolso) And Not String.IsNullOrEmpty(V_txtMonto)) Then
-                Valor = V_txtComisionDesembolso * V_txtMonto
-            Else
-                Valor = 0
-            End If
-
-
+            Valor = Operaciones.ConvertirDecimal(V_txtComisionDesembolso.ToString) *
+                  Operaciones.ConvertirDecimal(V_txtMonto.ToString)
         Else
             Valor = 0
         End If
@@ -733,18 +710,15 @@
 
 
     Function CalculoIVA(ByVal Index As Integer, ByVal IngresoCom As Double, ByVal IngresoInteres As Double)
-        Dim Valor
+        Dim Valor As Double = 0
         If Index = 0 Then
-            If (Not String.IsNullOrEmpty(IngresoCom) And Not String.IsNullOrEmpty(IngresoInteres)) Then
-                Valor = IngresoCom - (IngresoCom / (1.13))
-            End If
+            Valor = Operaciones.ConvertirDecimal(IngresoCom.ToString) -
+                          (Operaciones.ConvertirDecimal(IngresoCom.ToString) / (1.13))
+
         Else
+            Valor = (Operaciones.ConvertirDecimal(IngresoCom.ToString) +
+                     Operaciones.ConvertirDecimal(IngresoInteres.ToString)) * 0.13
 
-            If (Not String.IsNullOrEmpty(IngresoCom) And Not String.IsNullOrEmpty(IngresoInteres)) Then
-                Valor = (IngresoCom + IngresoInteres) * 0.13
-            Else
-                Valor = 0
-            End If
         End If
         Return Valor
     End Function
@@ -762,12 +736,11 @@
     End Function
 
     Function MontoARecibir(ByVal IngresoComision As Double, ByVal IngresoInteres As Double, ByVal CalculoIVA As Double, ByVal Amortizacion As Double)
-        Dim Monto As Double = 0
-        If Not String.IsNullOrEmpty(txtMonto.Text) Then
-            Monto = txtMonto.Text
-        End If
+        Dim Monto As Double = Operaciones.ConvertirDecimal(txtMonto.Text.ToString)
         Dim Valor As Double = 0.0
+
         Valor = IngresoComision + IngresoInteres + CalculoIVA + Amortizacion
+
         If Amortizacion > Monto Then
             Valor = 0
         End If
@@ -780,15 +753,15 @@
     Function Coleccion()
         Dim colec As New Collection
         Dim fechaoper, fechaven, tasa, periodicidad, base, tipotasa, comisiondesembolso, plazodias, monto
-        monto = txtMonto.Text
+        monto = Operaciones.ConvertirDecimal(txtMonto.Text.ToString)
         fechaoper = dtpFechaOperacion.Value
         fechaven = dtpFechaVencimiento.Value
-        tasa = CDec(txtTasa.Text.ToString.Trim("%")) / 100
+        tasa = Operaciones.ConvertirDecimal(txtTasa.Text.ToString) / 100
         periodicidad = cboPeriodicidad.SelectedValue
         base = Me.Base
         tipotasa = cboTipoTasa.SelectedValue
-        comisiondesembolso = txtComisionDesembolso.Text.ToString.Trim("%") / 100
-        plazodias = txtPlazoDias.Text
+        comisiondesembolso = Operaciones.ConvertirDecimal(txtComisionDesembolso.Text.ToString) / 100
+        plazodias = Operaciones.ConvertirDecimal(txtPlazoDias.Text.ToString)
 
         colec.Add(monto)
         colec.Add(fechaoper)
@@ -835,16 +808,16 @@
     Function ColeccionDetalle(ByVal Index As Integer)
         Dim Coleccion As New Collection
         Dim plazo, fecha, fechacorte, ingresocomision, ingresointeres, IVA, amortizacion, montorecibir, saldopendiente, correlativo
-        correlativo = dgvDetalles.Rows(Index).Cells("Correlativo").Value
-        plazo = dgvDetalles.Rows(Index).Cells("Plazo (Desembolso)").Value
-        fecha = dgvDetalles.Rows(Index).Cells("Fechas de Pago").Value
-        ingresocomision = dgvDetalles.Rows(Index).Cells("Ingreso por Comision").Value
-        ingresointeres = dgvDetalles.Rows(Index).Cells("Ingreso por Interes").Value
-        IVA = dgvDetalles.Rows(Index).Cells("IVA").Value
-        amortizacion = dgvDetalles.Rows(Index).Cells("Amortizacion").Value
-        saldopendiente = dgvDetalles.Rows(Index).Cells("Saldo Pendiente").Value
-        montorecibir = dgvDetalles.Rows(Index).Cells("Monto a Recibir").Value
-        fechacorte = dgvDetalles.Rows(Index).Cells("Fecha de corte").Value
+        correlativo = Operaciones.ConvertirEntero(dgvDetalles.Rows(Index).Cells("Correlativo").Value)
+        plazo = Operaciones.ConvertirEntero(dgvDetalles.Rows(Index).Cells("Plazo (Desembolso)").Value)
+        fecha = Operaciones.ConvertirFecha(dgvDetalles.Rows(Index).Cells("Fechas de Pago").Value)
+        ingresocomision = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("Ingreso por Comision").Value)
+        ingresointeres = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("Ingreso por Interes").Value)
+        IVA = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("IVA").Value)
+        amortizacion = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("Amortizacion").Value)
+        saldopendiente = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("Saldo Pendiente").Value)
+        montorecibir = Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("Monto a Recibir").Value)
+        fechacorte = Operaciones.ConvertirFechaBaseDatos(dgvDetalles.Rows(Index).Cells("Fecha de corte").Value)
 
 
 
@@ -1010,15 +983,16 @@
         Else
             Index = 1
         End If
-        txtMonto.Text = coleccion(1)
-        dtpFechaOperacion.Value = coleccion(2)
-        dtpFechaVencimiento.Value = coleccion(3)
-        txtTasa.Text = (CDec(coleccion(4).ToString.Trim("%")) * 100).ToString + "%"
-        cboPeriodicidad.SelectedValue = coleccion(5)
+
+        txtMonto.Text = Operaciones.ConvertirDecimal(coleccion(1).ToString)
+        dtpFechaOperacion.Value = Operaciones.ConvertirFecha(coleccion(2).ToString)
+        dtpFechaVencimiento.Value = Operaciones.ConvertirFecha(coleccion(3).ToString)
+        txtTasa.Text = (Operaciones.ConvertirDecimal(coleccion(4).ToString) * 100).ToString + "%"
+        cboPeriodicidad.SelectedValue = coleccion(5).ToString
         cboBase.SelectedIndex = Index
-        cboTipoTasa.SelectedValue = coleccion(7)
-        txtComisionDesembolso.Text = (CDec(coleccion(8).Trim("%")) * 100).ToString + "%"
-        txtPlazoDias.Text = coleccion(9)
+        cboTipoTasa.SelectedValue = coleccion(7).ToString
+        txtComisionDesembolso.Text = (Operaciones.ConvertirDecimal(coleccion(8).ToString) * 100).ToString + "%"
+        txtPlazoDias.Text = Operaciones.ConvertirEntero(coleccion(9).ToString)
 
     End Sub
 
@@ -1031,8 +1005,17 @@
             Dim Iterador As Integer = 0
             Dim ConvertirString As String
             While dr.Read
-                ConvertirString = Format(dr("fechapago"), "dd/MM/yyyy")
-                dgvDetalles.Rows.Add(dr("correlativo"), dr("plazo"), dr("fechacorte"), ConvertirString, dr("ingresarcomision"), dr("ingresarinteres"), dr("IVA"), dr("amortizacion"), dr("saldopendiente"), dr("montorecibir"))
+                ConvertirString = Format(Operaciones.ConvertirFecha(dr("fechapago").ToString), "dd/MM/yyyy")
+                dgvDetalles.Rows.Add(Operaciones.ConvertirEntero(dr("correlativo").ToString),
+                                     Operaciones.ConvertirEntero(dr("plazo").ToString),
+                                     Operaciones.ConvertirFechaBaseDatos(dr("fechacorte").ToString),
+                                     Operaciones.ConvertirFecha(ConvertirString),
+                                    Operaciones.ConvertirDecimal(dr("ingresarcomision").ToString),
+                                     Operaciones.ConvertirDecimal(dr("ingresarinteres").ToString),
+                                    Operaciones.ConvertirDecimal(dr("IVA").ToString),
+                                     Operaciones.ConvertirDecimal(dr("amortizacion").ToString),
+                                    Operaciones.ConvertirDecimal(dr("saldopendiente").ToString),
+                                     Operaciones.ConvertirDecimal(dr("montorecibir").ToString))
             End While
             Datos = True
         End If

+ 17 - 18
FRM/frmPrestamoPersonal.resx

@@ -139,29 +139,28 @@
   <data name="navNuevo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHcSURBVDhPnZFNTNpgGMe7HdzV4WVXr3LbeSdnPDk97IQF
-        nYCp1MULO6/ZZcaYZTHxpJdphnO4GEtM1OuSbRIW60dFAkw+NGCrBYrQj7DwrO8bYEKsIf6TX5487fP+
-        3vZ9CZQ897EzzS9aUty8NXW8ZuV5fwd+0U6i0blHhcPpx/nIbHciNFQphZkR2jMVpMYp0e2kRFcLTgPq
-        1WTGbnN+x4L0zw8WOTwzoO32gR4aBJ0bBlWRQNWuTSmVZUASLDgPvu8qhPqVwLveqn4w+VT79Ry0PRJi
-        uaopSEKSlFgTLHUVeaZH//0StB/PQA2+AEEQdC6egc++VdhgAw3Wvq3DQeKyWYAOTOD9T8bH3H81Q8Ju
-        sWdoICFVIC4qEDOIi2qDRK7SLKhnxOFSxLwMbGATD0TOJFhY/ATLy74GK1/8EM3I5gKpWMafigaSlyXg
-        T7Nw+KeZ5JXSniCcKQEXz8KeAap1Ti5MBI4WwXFaAt/K18YBIlB/cl4wEdibBbGrCkQE5T/GzpELFT9v
-        S7B/yzWi/ijZco312Mmx3E1BWq5iUrV6k1sFNttEOW8ItrZ38MBdKGoRRkdf87WlBAEAD4xfYL3et+CZ
-        8ALteYOrGTRN6w7SHWAY5mFNcd8QxD9ef2wYhh+LtAAAAABJRU5ErkJggg==
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHbSURBVDhPnZE7TNtQFIbdDu1KYWFlha1zJ1p14jEwpU6g
+        hCATg1jSuWaiQhVCSEywFNQADRXCUSVgReIRBWEeJkRJaB6ggA1O4pD4oVQ5+F4lKYkwivilT0fHPve7
+        9r0ESpqbakjwc41xbqYtfrrSxvOeV/hFPQmFpl9njr+9SQe/t0T93YVcgOmlnaM+apASHXZKHKjBbkB9
+        Hk5aLfYtLEjsTDbKgYkObe8D6P4u0LlPoCoSqNqdKbm8DEiCBZe+8aaM/6PCjrUX9aPht9rue9AOSAin
+        iqYgCUlSYkkw35TlmVZ9vwe07Xeg+jpBEASdiyThp3sZ1lhvhZXfq3AUvakWoAMTeE/zYL/jn2ZI2HX2
+        Ag1EpQJERAXCBhFRrRBNFaoF5fTaBhQxLQPr/YMHghcSzM79gIUFd4XFJQ+EkrK5QMrm8aeigdhNDvi/
+        V3B8Xk3sVqlPEEjmgItcwYEBqmXOrk0EthrBaUIC9+KvygEiUH92mTERWKsF4dsCBAXlP8bOwWsVP69L
+        cPjINaL+JFZzjeVYyf7UQ0FCLmLipfqQRwUWy1A+bQjWNzbxwFMoahb6+kb40lKCAIAXxi+wLtdXcA65
+        gHZ+wdUMmqZ1G+nwMgzzsqR4bgjiHlf4bBajZA5bAAAAAElFTkSuQmCC
 </value>
   </data>
   <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGySURBVDhPlZM7S8NQGIZT0/4AF3HwCg4iOLV0k2q9bP4A
-        xUUUcXJwaNHFTVBx0BA6dXLRQQdFqlCougiCi4Obl4KkpGntLWl6fz1faGrV1uoHDwmH8z75vnMIV60u
-        hp3hbEEfo43xo+zZbDYZCoXKpVIJjcjlchAEYY/tbShxUlhVVWiaViOVSiGRSECWZUMSiUQgiuIPiYXh
-        pA26riOfzxtPIpPJIJlMIhqNGgLWJegjPp/PlBhVE1DYhAQUSKfTUBTlyzgEZarZT0GxWKxtoHea2xwl
-        FosZnUiS1FzwnXoJdULnEY/H/y4gTAmNQ2dCIlr/s4AoFArGuZCEoLV/CaiL1+N93M4PIThuw/VsLwSn
-        RfxVQCGT8ImAB88I9PNdVB4voB2uIuQaLl+OWldaCqj9m7kBZFkY+9OAtx3Y7IeyPYrzMf65qaBeQm1X
-        7k9QX4mNTmy4rZWaIBAIVBpJiKuZHqj+BYCFch4O74zwMo+LSf6NBFQOdj1as5/p5WgHd0uDkLz9iK7Z
-        8LRoQdBlLQcm2tarea6b4WDQ1TTEP9Uhnrp5ido+c/HywQi/xXEc9wFDpoO9i5iysQAAAABJRU5ErkJg
-        gg==
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGxSURBVDhPlZM7S8NQGIbTpv4AF3HwVnAQwUnpJvW++QMU
+        F1HEycFB0cVNUHHQEDo5uehgB6VVQYi6CIKLg5s3kJTeTHrJpdfX84WmVm2tfvCQcDjvk+87h3ClamH0
+        Mjx16GA4GT+qV9d1VZKkQj6fRzVM04QgCDtsb1WJh8LpdBqappVJJBJQFAXhcNiShEIhiKL4Q+JgeGiD
+        YRjIZDLWk0ilUlBVFZFIxBKwLkEf8fl8tsSqsoDCNiSgQDKZRDQa/TIOQZlS9lOQy+XKG+id5rZHicVi
+        VieyLNcWfKdSQp3QecTj8b8LCFtC49CZkIjW/ywgstmsdS4kIWjtXwLq4uVoFzfT3bgYbsDVZDsEj0P8
+        VUAhm1e/gPulfhiBbRQfzqAdLELy9hTOB1wLdQXU/vVUJ3QWxu44sNwIrLsR3RxAYJB/qimolFDbxTs/
+        KktZa8bakKtYFgSDwWI1CXE50Yb03gzAQuYSh3fG6zyPs1H+jQRUfex6tFo/0/PhFm7nuiAvuxFZacDj
+        rAMXXlfhdMS5WspzrYw+Bl1NVfbGmsTjIV6mtk+8fHi/n9/gOI77AEF7g7q6yTNgAAAAAElFTkSuQmCC
 </value>
   </data>
 </root>

+ 97 - 192
FRM/frmPrestamoPersonal.vb

@@ -12,18 +12,11 @@ Public Class frmPrestamoPersonal
     Private Sub frmPrestamoPersonal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
         dgvAmortizacion.Columns.Clear()
         AgregarCampos()
-
         CargarColecciones()
         CargarAmortizacion()
-
-
-
         FinCarga = True
-
         Formato()
         Calculos(False)
-
-
         ExisteInversion()
         ValidarExistencia()
         CargarTransladoNuevo()
@@ -71,32 +64,17 @@ Public Class frmPrestamoPersonal
 
     Private Sub LLenarCuotaSinSeguro()
         Dim MontoPrestamo As Double = 0
-        Dim CuotasMensuales As Integer = 0
+        Dim CuotasMensuales As Double = 0
         Dim TasaInteres As Double = 0
 
-        If Not String.IsNullOrEmpty(txtMontoPrestamo.Text) Then
-            MontoPrestamo = txtMontoPrestamo.Text
-        End If
-
-        If Not String.IsNullOrEmpty(txtCuotasMensuales.Text) Then
-            CuotasMensuales = txtCuotasMensuales.Text
-        End If
-
-        If Not String.IsNullOrEmpty(txtTasaInteres.Text.Trim("%")) Then
-            TasaInteres = txtTasaInteres.Text.Trim("%")
-        End If
+        MontoPrestamo = Operaciones.ConvertirDecimal(txtMontoPrestamo.Text.ToString)
+        CuotasMensuales = Operaciones.ConvertirDecimal(txtCuotasMensuales.Text.ToString)
+        TasaInteres = Operaciones.ConvertirDecimal(txtTasaInteres.Text.ToString)
+        txtCuotaSinSeguro.Text = Operaciones.ConvertirDecimal(Prestamo.TIR(MontoPrestamo, CuotasMensuales, TasaInteres / 100).ToString)
 
 
-        If (Not MontoPrestamo = 0 And Not CuotasMensuales = 0 And Not TasaInteres = 0) Then
-            txtCuotaSinSeguro.Text = Prestamo.TIR(MontoPrestamo, CuotasMensuales, TasaInteres / 100)
-        End If
-        If Not String.IsNullOrEmpty(txtCuotaSinSeguro.Text) Then
 
 
-            If Double.IsInfinity(txtCuotaSinSeguro.Text) Then
-                txtCuotaSinSeguro.Text = 0
-            End If
-        End If
     End Sub
 
     Private Sub txtTasaInteres_KeyUp(sender As Object, e As KeyEventArgs) Handles txtTasaInteres.KeyUp
@@ -132,13 +110,9 @@ Public Class frmPrestamoPersonal
 
         Dim CuotaSinSeguro As Double = 0
         Dim Seguro As Double = 0
-        If Not String.IsNullOrEmpty(txtCuotaSinSeguro.Text) Then
-            CuotaSinSeguro = txtCuotaSinSeguro.Text
-        End If
-        If Not String.IsNullOrEmpty(txtSeguro.Text) Then
-            Seguro = txtSeguro.Text
-        End If
 
+        CuotaSinSeguro = Operaciones.ConvertirDecimal(txtCuotaSinSeguro.Text.ToString)
+        Seguro = Operaciones.ConvertirDecimal(txtSeguro.Text.ToString)
         txtCuotaReal.Text = Prestamo.SumarCuota(CuotaSinSeguro, Seguro)
     End Sub
 
@@ -249,18 +223,6 @@ Public Class frmPrestamoPersonal
         If (String.IsNullOrEmpty(txtCuotaReal.Text.ToString) Or txtCuotaReal.Text.ToString = "0") Then
             txtCuotaReal.Text = "0.0"
         End If
-
-
-
-
-
-
-
-
-
-
-
-
         If (txtTasaInteres.Text.ToString.IndexOf("%") = -1) Then
             txtTasaInteres.Text = txtTasaInteres.Text.ToString + "%"
         End If
@@ -271,31 +233,20 @@ Public Class frmPrestamoPersonal
         If (FinCarga) Then
 
 
-            Dim FechaInicial = dtpFechaOtorgamiento.Value
-            Dim FechaFinal = dtpFechaOtorgamiento.Value
-            Dim FechaVencimiento = dtpFechaOtorgamiento.Value
-            Dim FechaVen = dtpFechaPago.Value
-            Dim FechaAux = dtpFechaOtorgamiento.Value
+            Dim FechaInicial As Date = dtpFechaOtorgamiento.Value
+            Dim FechaFinal As Date = dtpFechaOtorgamiento.Value
+            Dim FechaVencimiento As Date = dtpFechaOtorgamiento.Value
+            Dim FechaVen As Date = dtpFechaPago.Value
+            Dim FechaAux As Date = dtpFechaOtorgamiento.Value
             Dim Index = 0
             Dim Contador As Integer = 1
 
-            Dim BaseContador As Integer = 0
-
-            If Not String.IsNullOrEmpty(txtCuotasMensuales.Text) Then
-                BaseContador = txtCuotasMensuales.Text
-            End If
-
-
+            Dim BaseContador As Double = Operaciones.ConvertirDecimal(txtCuotasMensuales.Text.ToString)
             Dim V_txtTasaInteres As Double = 0.0
 
-
-
-
             If (String.IsNullOrEmpty(txtTasaInteres.Text.Trim("%"))) Then
 
                 V_txtTasaInteres = 0
-
-
             Else
                 V_txtTasaInteres = txtTasaInteres.Text.TrimEnd("%") / 100
             End If
@@ -307,10 +258,6 @@ Public Class frmPrestamoPersonal
 
 
             Dim Cantidad As Integer = dgvAmortizacion.Rows.Count
-
-
-
-
             Dim TipoCalculo As Integer = 0
             If (FechaInicial.Day = 31) Then
                 TipoCalculo = 1
@@ -326,9 +273,8 @@ Public Class frmPrestamoPersonal
 
             Dim Salir As Boolean = False
             Dim TotalCuotas As Double = 0
-            If Not String.IsNullOrEmpty(txtCuotasMensuales.Text) Then
-                TotalCuotas = txtCuotasMensuales.Text
-            End If
+
+            TotalCuotas = Operaciones.ConvertirDecimal(txtCuotasMensuales.Text.ToString)
 
 
 
@@ -343,9 +289,9 @@ Public Class frmPrestamoPersonal
 
                 Dim Eliminar As Integer = dgvAmortizacion.Rows.Count - 2
                 Dim CuotasMensuales As Integer = 0
-                If Not String.IsNullOrEmpty(txtCuotasMensuales.Text) Then
-                    CuotasMensuales = txtCuotasMensuales.Text
-                End If
+
+                CuotasMensuales = Operaciones.ConvertirDecimal(txtCuotasMensuales.Text.ToString)
+
 
                 If Eliminar > CuotasMensuales Then
 
@@ -656,54 +602,19 @@ Public Class frmPrestamoPersonal
                     If Agregar >= Index Then
 
 
-                        dgvAmortizacion.Rows(Index).Cells("Fecha").Value = FechaUltima
-                        dgvAmortizacion.Rows(Index).Cells("Periodo").Value = PeriodoDias
-                        If Double.IsInfinity(PagoIni) Then
-                            PagoIni = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Saldo Inicial").Value = PagoIni
-
-                        If Double.IsInfinity(PagoDeCuotaMensual) Then
-                            PagoDeCuotaMensual = 0
-                        End If
-
-
-                        dgvAmortizacion.Rows(Index).Cells("Pago Cuota Mensual").Value = PagoDeCuotaMensual
-
-                        If Double.IsInfinity(PagoIVA) Then
-                            PagoIVA = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Pago Interes(IVA)").Value = PagoIVA
-
-                        If Double.IsInfinity(IVAInteres) Then
-                            IVAInteres = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("IVA de Intereses").Value = IVAInteres
-                        If Double.IsInfinity(PagoInt) Then
-                            PagoInt = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Pago de Intereses").Value = PagoInt
-                        If Double.IsInfinity(AbonoDinero) Then
-                            AbonoDinero = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Abono a Capital").Value = AbonoDinero
-                        If Double.IsInfinity(PrestRemanente) Then
-                            PrestRemanente = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Prestamo Remanente").Value = PrestRemanente
-                        If Double.IsInfinity(SegDaños) Then
-                            SegDaños = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Daños").Value = SegDaños
-                        If Double.IsInfinity(SegVivienda) Then
-                            SegVivienda = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Vivienda").Value = SegVivienda
-                        If Double.IsInfinity(TotalPagado) Then
-                            TotalPagado = 0
-                        End If
-                        dgvAmortizacion.Rows(Index).Cells("Total Pagado").Value = TotalPagado
-                        dgvAmortizacion.Rows(Index).Cells("Total Cuota Mensual").Value = TotalPagado
+                        dgvAmortizacion.Rows(Index).Cells("Fecha").Value = Operaciones.ConvertirFecha(FechaUltima.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Periodo").Value = Operaciones.ConvertirEntero(PeriodoDias.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Saldo Inicial").Value = Operaciones.ConvertirDecimal(PagoIni.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Pago Cuota Mensual").Value = Operaciones.ConvertirDecimal(PagoDeCuotaMensual.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Pago Interes(IVA)").Value = Operaciones.ConvertirDecimal(PagoIVA.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("IVA de Intereses").Value = Operaciones.ConvertirDecimal(IVAInteres.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Pago de Intereses").Value = Operaciones.ConvertirDecimal(PagoInt.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Abono a Capital").Value = Operaciones.ConvertirDecimal(AbonoDinero.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Prestamo Remanente").Value = Operaciones.ConvertirDecimal(PrestRemanente.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Daños").Value = Operaciones.ConvertirDecimal(SegDaños.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Vivienda").Value = Operaciones.ConvertirDecimal(SegVivienda.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Total Pagado").Value = Operaciones.ConvertirDecimal(TotalPagado.ToString)
+                        dgvAmortizacion.Rows(Index).Cells("Total Cuota Mensual").Value = Operaciones.ConvertirDecimal(TotalPagado.ToString)
 
 
 
@@ -736,10 +647,7 @@ Public Class frmPrestamoPersonal
     End Sub
 
     Function Periodo(ByVal Index As Integer, ByVal Fech As Date, ByVal Fecha2 As Date)
-
-        Dim Valor
-
-
+        Dim Valor As Integer = 0
         Valor = Prestamo.Periodo(Fech, Fecha2)
 
         Return Valor
@@ -748,15 +656,12 @@ Public Class frmPrestamoPersonal
 
     Function PagoCuotaMensual(ByVal Index As Integer, ByVal Dias As Integer, ByVal V_txtTasaInteres As Double)
 
-        Dim MontoPrestamo As Integer = 0
+        Dim MontoPrestamo As Double = 0
         Dim CuotasMensuales As Integer = 0
-        If Not String.IsNullOrEmpty(txtMontoPrestamo.Text) Then
-            MontoPrestamo = txtMontoPrestamo.Text
-        End If
 
-        If Not String.IsNullOrEmpty(txtCuotasMensuales.Text) Then
-            CuotasMensuales = txtCuotasMensuales.Text
-        End If
+        MontoPrestamo = Operaciones.ConvertirDecimal(txtMontoPrestamo.Text.ToString)
+        CuotasMensuales = Operaciones.ConvertirEntero(txtCuotasMensuales.Text.ToString)
+
 
 
         Dim Pago As Double = Prestamo.TIR(MontoPrestamo, CuotasMensuales, V_txtTasaInteres)
@@ -779,7 +684,7 @@ Public Class frmPrestamoPersonal
             Total = 0
         ElseIf (Index > 0) Then
             Index = Index - 1
-            Total = dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Daños").Value
+            Total = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Daños").Value)
         End If
 
 
@@ -792,7 +697,7 @@ Public Class frmPrestamoPersonal
             Total = 0
         ElseIf (Index > 0) Then
             Index = Index - 1
-            Total = dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Vivienda").Value
+            Total = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Vivienda").Value)
         End If
 
 
@@ -810,12 +715,9 @@ Public Class frmPrestamoPersonal
         Dim Anterior As Integer = Index - 1
 
         If (Index = 0) Then
-            If Not String.IsNullOrEmpty(txtMontoPrestamo.Text) Then
-                Total = txtMontoPrestamo.Text
-            End If
-
+            Total = Operaciones.ConvertirDecimal(txtMontoPrestamo.Text.ToString)
         ElseIf (Index > 0) Then
-            Total = dgvAmortizacion.Rows(Anterior).Cells("Prestamo Remanente").Value
+            Total = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Anterior).Cells("Prestamo Remanente").Value)
         End If
 
 
@@ -828,7 +730,7 @@ Public Class frmPrestamoPersonal
 
 
         Dim CambioDeFecha As Integer = Operaciones.CambioBase(Fechainicial, FechaFinal)
-        Dim TasaInteres As New Double
+        Dim TasaInteres As Double = 0
         TasaInteres = V_txtTasaInteres
 
         Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(Fechainicial)
@@ -876,20 +778,20 @@ Public Class frmPrestamoPersonal
     End Function
 
     Function PagoIntereses(ByVal Index As Integer, ByVal PagoIVA As Double)
-        Dim Total = PagoIVA / 1.13
+        Dim Total As Double = PagoIVA / 1.13
 
         Return Total
     End Function
 
     Function IVAIntereses(ByVal Index As Integer, ByVal PagoIVA As Double, ByVal PagoIVAInt As Double)
-        Dim Total As Double
+        Dim Total As Double = 0
 
         Total = PagoIVA - PagoIVAInt
         Return Total
     End Function
 
     Function Abono(ByVal Index As Integer, ByVal TotalPagado As Double, ByVal PagoInteres As Double)
-        Dim Total As Double
+        Dim Total As Double = 0
         Total = TotalPagado - PagoInteres
         Return Total
     End Function
@@ -898,9 +800,9 @@ Public Class frmPrestamoPersonal
     Function PrestamoRemanente(ByVal Index As Integer, ByVal Abono As Double)
         Dim Total As Double = 0
         Dim Monto As Double = 0
-        If Not String.IsNullOrEmpty(txtMontoPrestamo.Text) Then
-            Monto = txtMontoPrestamo.Text
-        End If
+
+        Monto = Operaciones.ConvertirDecimal(txtMontoPrestamo.Text.ToString)
+
 
         Dim Anterior As Integer = Index - 1
 
@@ -912,9 +814,9 @@ Public Class frmPrestamoPersonal
 
             If (Index = 0) Then
 
-                Total = CDec(Monto) - CDec(Abono)
+                Total = Monto - Abono
             ElseIf (Index > 0) Then
-                Dim AnteriorValor = dgvAmortizacion.Rows(Anterior).Cells("Prestamo Remanente").Value
+                Dim AnteriorValor = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Anterior).Cells("Prestamo Remanente").Value)
                 Total = AnteriorValor - Abono
             End If
         Catch ex As Exception
@@ -973,12 +875,11 @@ Public Class frmPrestamoPersonal
             coleccion = PrestamoConsulta.CargarDeudor(codigo)
         End If
 
-        txtNombreDeudor.Text = coleccion(1)
-        txtNumeroDeudor.Text = coleccion(2)
-        dtpFechaPago.Value = coleccion(3)
-        dtpFechaOtorgamiento.Value = coleccion(4)
-
-        txtPeriodo.Text = coleccion(5)
+        txtNombreDeudor.Text = coleccion(1).ToString
+        txtNumeroDeudor.Text = coleccion(2).ToString
+        dtpFechaPago.Value = Operaciones.ConvertirFecha(coleccion(3).ToString)
+        dtpFechaOtorgamiento.Value = Operaciones.ConvertirFecha(coleccion(4).ToString)
+        txtPeriodo.Text = Operaciones.ConvertirDecimal(coleccion(5).ToString)
     End Sub
 
     Sub CargarDetalles()
@@ -991,11 +892,11 @@ Public Class frmPrestamoPersonal
         Else
             coleccion = PrestamoConsulta.CargarDetalles(codigo)
         End If
-        txtTasaInteres.Text = CDec(coleccion(1)) * 100
-        txtAñoPrestamo.Text = coleccion(2)
-        txtCuotasMensuales.Text = coleccion(3)
-        txtMontoPrestamo.Text = coleccion(4)
-        txtSeguro.Text = coleccion(5)
+        txtTasaInteres.Text = Operaciones.ConvertirDecimal(coleccion(1).ToString) * 100
+        txtAñoPrestamo.Text = Operaciones.ConvertirEntero(coleccion(2).ToString)
+        txtCuotasMensuales.Text = Operaciones.ConvertirEntero(coleccion(3).ToString)
+        txtMontoPrestamo.Text = Operaciones.ConvertirDecimal(coleccion(4).ToString)
+        txtSeguro.Text = Operaciones.ConvertirDecimal(coleccion(5).ToString)
     End Sub
 
 
@@ -1006,14 +907,8 @@ Public Class frmPrestamoPersonal
 
         Dim ConvertirString As String
         While dr.Read
-            ConvertirString = Format(dr("fecha"), "dd/MM/yyyy")
-
+            ConvertirString = Format(Operaciones.ConvertirFecha(dr("fecha").ToString), "dd/MM/yyyy")
             dgvAmortizacion.Rows.Add(dr("correlativo"), dr("fechacorte").ToString, ConvertirString, dr("periodo"), dr("saldoinicial"), dr("pagocuota"), dr("pagointeresIVA"), dr("IVAinteres"), dr("pagointeres"), dr("abono"), dr("prestamoremanente"), dr("pagodanos"), dr("pagovivienta"), dr("totalcuota"), dr("totalpagado"), dr("abonoextra"))
-
-
-
-
-
         End While
 
     End Sub
@@ -1132,11 +1027,13 @@ Public Class frmPrestamoPersonal
 
     Function ColeccionDeudor()
         Dim coleccion As New Collection
-        Dim NombreDeudor = txtNombreDeudor.Text
-        Dim NumeroDeudor = txtNumeroDeudor.Text
-        Dim fechaotor = dtpFechaOtorgamiento.Value
-        Dim fechapago = dtpFechaPago.Value
-        Dim periodogracias = txtPeriodo.Text
+        Dim NombreDeudor As String = txtNombreDeudor.Text.ToString
+        Dim NumeroDeudor As String = txtNumeroDeudor.Text.ToString
+        Dim fechaotor As Date = dtpFechaOtorgamiento.Value
+        Dim fechapago As Date = dtpFechaPago.Value
+        Dim periodogracias As Double = Operaciones.ConvertirDecimal(txtPeriodo.Text.ToString)
+
+
         coleccion.Add(NombreDeudor)
         coleccion.Add(NumeroDeudor)
         coleccion.Add(fechapago)
@@ -1148,13 +1045,14 @@ Public Class frmPrestamoPersonal
     End Function
     Function ColeccionDetalles()
         Dim coleccion As New Collection
-        Dim tasainteres = CDec(txtTasaInteres.Text.ToString.TrimEnd("%")) / 100
-        Dim duracionprestamo = txtAñoPrestamo.Text
-        Dim totalcuotas = txtCuotasMensuales.Text
-        Dim montoprestamo = txtMontoPrestamo.Text
-        Dim seguro = txtSeguro.Text
-        Dim CuotaSinSeguro = txtCuotaSinSeguro.Text
-        Dim CuotaReal = txtCuotaReal.Text
+
+        Dim tasainteres = Operaciones.ConvertirDecimal(txtTasaInteres.Text.ToString) / 100
+        Dim duracionprestamo = Operaciones.ConvertirEntero(txtAñoPrestamo.Text.ToString)
+        Dim totalcuotas = Operaciones.ConvertirEntero(txtCuotasMensuales.Text.ToString)
+        Dim montoprestamo = Operaciones.ConvertirDecimal(txtMontoPrestamo.Text.ToString)
+        Dim seguro = Operaciones.ConvertirDecimal(txtSeguro.Text.ToString)
+        Dim CuotaSinSeguro = Operaciones.ConvertirDecimal(txtCuotaSinSeguro.Text.ToString)
+        Dim CuotaReal = Operaciones.ConvertirDecimal(txtCuotaReal.Text.ToString)
 
 
         coleccion.Add(tasainteres)
@@ -1169,22 +1067,25 @@ Public Class frmPrestamoPersonal
     Function coleccionAmortizacion(ByVal Index As Integer)
         Dim coleccion As New Collection
 
-        Dim Posicion = dgvAmortizacion.Rows(Index).Cells("No. Cuota").Value
-        Dim fecha = dgvAmortizacion.Rows(Index).Cells("Fecha").Value
+        Dim Posicion As Integer = Operaciones.ConvertirEntero(dgvAmortizacion.Rows(Index).Cells("No. Cuota").Value)
+        Dim fecha As Date = Operaciones.ConvertirFecha(dgvAmortizacion.Rows(Index).Cells("Fecha").Value)
         Dim fechaCorte = dgvAmortizacion.Rows(Index).Cells("Fecha de Corte").Value
-        Dim Periodo = dgvAmortizacion.Rows(Index).Cells("Periodo").Value
-        Dim saldoinicial = dgvAmortizacion.Rows(Index).Cells("Saldo Inicial").Value
-        Dim pagocuota = dgvAmortizacion.Rows(Index).Cells("Pago Cuota Mensual").Value
-        Dim PagoInteresIVA = dgvAmortizacion.Rows(Index).Cells("Pago Interes(IVA)").Value
-        Dim IVAinteres = dgvAmortizacion.Rows(Index).Cells("IVA de Intereses").Value
-        Dim pagointeres = dgvAmortizacion.Rows(Index).Cells("Pago de Intereses").Value
-        Dim Abono = dgvAmortizacion.Rows(Index).Cells("Abono a Capital").Value
-        Dim PrestamoRemanente = dgvAmortizacion.Rows(Index).Cells("Prestamo Remanente").Value
-        Dim pagodanos = dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Daños").Value
-        Dim pagovivienta = dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Vivienda").Value
-        Dim TotalCuota = dgvAmortizacion.Rows(Index).Cells("Total Cuota Mensual").Value
-        Dim totalpagado = dgvAmortizacion.Rows(Index).Cells("Total Pagado").Value
-        Dim abonoextra = dgvAmortizacion.Rows(Index).Cells("Abono Extra a Capital").Value
+        Dim Periodo As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Periodo").Value)
+        Dim saldoinicial As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Saldo Inicial").Value)
+        Dim pagocuota As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago Cuota Mensual").Value)
+        Dim PagoInteresIVA As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago Interes(IVA)").Value)
+        Dim IVAinteres As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("IVA de Intereses").Value)
+        Dim pagointeres As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago de Intereses").Value)
+        Dim Abono As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Abono a Capital").Value)
+        Dim PrestamoRemanente As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Prestamo Remanente").Value)
+        Dim pagodanos As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Daños").Value)
+        Dim pagovivienta As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Pago de Seguro de Vivienda").Value)
+        Dim TotalCuota As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Total Cuota Mensual").Value)
+        Dim totalpagado As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Total Pagado").Value)
+        Dim abonoextra As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Abono Extra a Capital").Value)
+
+
+
         coleccion.Add(Posicion)
         coleccion.Add(fecha)
         coleccion.Add(Periodo)
@@ -1448,4 +1349,8 @@ Public Class frmPrestamoPersonal
             txtTasaInteres.Text = Variables.RetRendimiento
         End If
     End Sub
+
+    Private Sub txtNumeroDeudor_TextChanged(sender As Object, e As EventArgs) Handles txtNumeroDeudor.TextChanged
+
+    End Sub
 End Class

+ 22 - 5
frmINV.vb

@@ -1712,16 +1712,28 @@
 
     Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
         If Me.TipoOperacion = "B" Or Me.TipoOperacion = "M" Then
-            CargarRegistro(vBindingSource.Current("DocId").ToString)
+            Try
+                CargarRegistro(vBindingSource.Current("DocId").ToString)
+            Catch ex As Exception
+
+            End Try
+
+
+
         ElseIf Me.TipoOperacion = "C" Then
-            vBindingSource.MoveNext()
+                vBindingSource.MoveNext()
         End If
-        EstadoBoton()
+            EstadoBoton()
     End Sub
 
     Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
         If Me.TipoOperacion = "B" Or Me.TipoOperacion = "M" Then
-            CargarRegistro(vBindingSource.Current("DocId").ToString)
+            Try
+                CargarRegistro(vBindingSource.Current("DocId").ToString)
+            Catch ex As Exception
+
+            End Try
+
         ElseIf Me.TipoOperacion = "C" Then
             vBindingSource.MovePrevious()
         End If
@@ -1732,7 +1744,12 @@
         If Me.TipoOperacion = "B" Then
             Me.TipoOperacion = "C"
             vBindingSource.MoveFirst()
-            CargarRegistro(vBindingSource.Current("DocId").ToString)
+            Try
+                CargarRegistro(vBindingSource.Current("DocId").ToString)
+            Catch ex As Exception
+
+            End Try
+
         ElseIf Me.TipoOperacion = "C" Then
             vBindingSource.MoveFirst()
         End If

Vissa filer visades inte eftersom för många filer har ändrats