|
@@ -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
|
|
Function GetValorNominal() As Double
|
|
|
Dim valor As Double
|
|
Dim valor As Double
|
|
@@ -179,57 +168,8 @@ Public Class frmLetes
|
|
|
Return valor
|
|
Return valor
|
|
|
End Function
|
|
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
|
|
'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
|
|
Function CalcularValorApagar() As Double
|
|
|
Dim valor As Double
|
|
Dim valor As Double
|
|
|
|
|
|
|
@@ -240,27 +180,6 @@ Public Class frmLetes
|
|
|
End Function
|
|
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
|
|
'AUTO
|
|
|
Sub RefrescarPlazoInversion()
|
|
Sub RefrescarPlazoInversion()
|
|
|
Me.txtPlazoInversion.Text = 0
|
|
Me.txtPlazoInversion.Text = 0
|
|
@@ -271,11 +190,6 @@ Public Class frmLetes
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
Sub RefrescarTotalAPagar()
|
|
Sub RefrescarTotalAPagar()
|
|
|
Me.txtTotalAPagar.Text = CalcularValorApagar()
|
|
Me.txtTotalAPagar.Text = CalcularValorApagar()
|
|
|
End Sub
|
|
End Sub
|
|
@@ -303,8 +217,6 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
Private Sub txtPlazoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoBruto.TextChanged, txtPlazoInversion.TextChanged
|
|
Private Sub txtPlazoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoBruto.TextChanged, txtPlazoInversion.TextChanged
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
RellenarDatos()
|
|
RellenarDatos()
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
@@ -577,60 +489,40 @@ Public Class frmLetes
|
|
|
If (Not dat(1).ToString = "False") Then
|
|
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
|
|
If (String.IsNullOrEmpty(txtRendimientoBruto.Text)) Then
|
|
|
- txtRendimientoBruto.Text = 0
|
|
|
|
|
txtRendimientoBruto.Text = CStr(Format((txtRendimientoBruto.Text), "0.00")) + "%"
|
|
txtRendimientoBruto.Text = CStr(Format((txtRendimientoBruto.Text), "0.00")) + "%"
|
|
|
Else
|
|
Else
|
|
|
- txtRendimientoBruto.Text = CStr(dat(5) * 100) + "%"
|
|
|
|
|
|
|
+ txtRendimientoBruto.Text = CStr(Operaciones.ConvertirDecimal(dat(5).ToString) * 100) + "%"
|
|
|
End If
|
|
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
|
|
cboBase.SelectedIndex = Base
|
|
|
|
|
|
|
|
If (String.IsNullOrEmpty(dat(9).ToString)) Then
|
|
If (String.IsNullOrEmpty(dat(9).ToString)) Then
|
|
|
-
|
|
|
|
|
- txtPorcentajeComisionCasa.Text = 0
|
|
|
|
|
txtPorcentajeComisionCasa.Text = Format(((txtPorcentajeComisionCasa.Text.Trim("%")) * 100), "0.00").ToString + "%"
|
|
txtPorcentajeComisionCasa.Text = Format(((txtPorcentajeComisionCasa.Text.Trim("%")) * 100), "0.00").ToString + "%"
|
|
|
Else
|
|
Else
|
|
|
-
|
|
|
|
|
- txtPorcentajeComisionCasa.Text = CStr(dat(9) * 100) + "%"
|
|
|
|
|
|
|
+ txtPorcentajeComisionCasa.Text = CStr(Operaciones.ConvertirDecimal(dat(9).ToString) * 100) + "%"
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
If (String.IsNullOrEmpty(dat(10).ToString)) Then
|
|
If (String.IsNullOrEmpty(dat(10).ToString)) Then
|
|
|
- txtPorcentajeComisionBolsa.Text = "0.0"
|
|
|
|
|
txtPorcentajeComisionBolsa.Text = Format((txtPorcentajeComisionBolsa.Text.Trim("%")) * 100, "0.00").ToString + "%"
|
|
txtPorcentajeComisionBolsa.Text = Format((txtPorcentajeComisionBolsa.Text.Trim("%")) * 100, "0.00").ToString + "%"
|
|
|
Else
|
|
Else
|
|
|
- txtPorcentajeComisionBolsa.Text = CStr(dat(10) * 100) + "%"
|
|
|
|
|
|
|
+ txtPorcentajeComisionBolsa.Text = CStr(Operaciones.ConvertirDecimal(dat(10).ToString) * 100) + "%"
|
|
|
End If
|
|
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 (PBUR Or VCN) Then
|
|
|
|
|
|
|
|
If (Not String.IsNullOrEmpty(dat(13).ToString)) Then
|
|
If (Not String.IsNullOrEmpty(dat(13).ToString)) Then
|
|
@@ -639,13 +531,13 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
End If
|
|
End If
|
|
|
If (Not String.IsNullOrEmpty(dat(14).ToString)) Then
|
|
If (Not String.IsNullOrEmpty(dat(14).ToString)) Then
|
|
|
- dtpUltimaFecha.Value = CDate(dat(14))
|
|
|
|
|
|
|
+ dtpUltimaFecha.Value = Operaciones.ConvertirFecha(dat(14).ToString)
|
|
|
|
|
|
|
|
|
|
|
|
|
End If
|
|
End If
|
|
|
ElseIf CET Then
|
|
ElseIf CET Then
|
|
|
If (Not String.IsNullOrEmpty(dat(13).ToString)) Then
|
|
If (Not String.IsNullOrEmpty(dat(13).ToString)) Then
|
|
|
- dtpUltimaFecha.Value = CDate(dat(13))
|
|
|
|
|
|
|
+ dtpUltimaFecha.Value = Operaciones.ConvertirFecha(dat(13).ToString)
|
|
|
|
|
|
|
|
|
|
|
|
|
End If
|
|
End If
|
|
@@ -653,13 +545,10 @@ Public Class frmLetes
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
If VCN Then
|
|
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
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
@@ -667,39 +556,39 @@ Public Class frmLetes
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub Modificar(ByVal Instrumento As String)
|
|
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
|
|
If Not cboPeriodicidad.SelectedIndex = -1 Then
|
|
|
periodo = cboPeriodicidad.SelectedValue
|
|
periodo = cboPeriodicidad.SelectedValue
|
|
|
- Else
|
|
|
|
|
- periodo = DBNull.Value
|
|
|
|
|
End If
|
|
End If
|
|
|
- Dim Casas
|
|
|
|
|
|
|
+ Dim Casas As String = String.Empty
|
|
|
|
|
|
|
|
If Not cboCasasCorredoras.SelectedIndex = -1 Then
|
|
If Not cboCasasCorredoras.SelectedIndex = -1 Then
|
|
|
Casas = cboCasasCorredoras.SelectedValue
|
|
Casas = cboCasasCorredoras.SelectedValue
|
|
|
- Else
|
|
|
|
|
- Casas = DBNull.Value
|
|
|
|
|
End If
|
|
End If
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
Dim ValorPar As Boolean = chbValorPar.Checked
|
|
Dim ValorPar As Boolean = chbValorPar.Checked
|
|
|
Dim Base As Integer
|
|
Dim Base As Integer
|
|
|
Dim FechaUltima As Date = dtpUltimaFecha.Value
|
|
Dim FechaUltima As Date = dtpUltimaFecha.Value
|
|
@@ -727,6 +616,7 @@ Public Class frmLetes
|
|
|
coleccion.Add(periodo)
|
|
coleccion.Add(periodo)
|
|
|
coleccion.Add(Base)
|
|
coleccion.Add(Base)
|
|
|
coleccion.Add(Casas)
|
|
coleccion.Add(Casas)
|
|
|
|
|
+
|
|
|
If (PBUR Or VCN) Then
|
|
If (PBUR Or VCN) Then
|
|
|
coleccion.Add(ValorPar)
|
|
coleccion.Add(ValorPar)
|
|
|
coleccion.Add(FechaUltima)
|
|
coleccion.Add(FechaUltima)
|
|
@@ -738,6 +628,7 @@ Public Class frmLetes
|
|
|
If VCN Then
|
|
If VCN Then
|
|
|
coleccion.Add(OtrosCostos)
|
|
coleccion.Add(OtrosCostos)
|
|
|
End If
|
|
End If
|
|
|
|
|
+
|
|
|
coleccion.Add(ValTrans)
|
|
coleccion.Add(ValTrans)
|
|
|
coleccion.Add(Precio)
|
|
coleccion.Add(Precio)
|
|
|
coleccion.Add(TotPagar)
|
|
coleccion.Add(TotPagar)
|
|
@@ -756,43 +647,37 @@ Public Class frmLetes
|
|
|
End Sub
|
|
End Sub
|
|
|
|
|
|
|
|
Public Function Nuevo(ByVal Instrumento As String)
|
|
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
|
|
If Not cboPeriodicidad.SelectedIndex = -1 Then
|
|
|
periodo = cboPeriodicidad.SelectedValue
|
|
periodo = cboPeriodicidad.SelectedValue
|
|
|
- Else
|
|
|
|
|
- periodo = DBNull.Value
|
|
|
|
|
End If
|
|
End If
|
|
|
- Dim Casas
|
|
|
|
|
|
|
+ Dim Casas As String = String.Empty
|
|
|
|
|
|
|
|
If Not cboCasasCorredoras.SelectedIndex = -1 Then
|
|
If Not cboCasasCorredoras.SelectedIndex = -1 Then
|
|
|
Casas = cboCasasCorredoras.SelectedValue
|
|
Casas = cboCasasCorredoras.SelectedValue
|
|
|
- Else
|
|
|
|
|
- Casas = DBNull.Value
|
|
|
|
|
|
|
+
|
|
|
End If
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
@@ -981,20 +866,18 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
|
|
|
|
|
Function ValorTrasado()
|
|
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
|
|
End Function
|
|
|
Function Precio()
|
|
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
|
|
Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 360)) * Plazo / 360)) * 100
|
|
|
Return Pr
|
|
Return Pr
|
|
@@ -1155,7 +1038,7 @@ Public Class frmLetes
|
|
|
End If
|
|
End If
|
|
|
Return Pr
|
|
Return Pr
|
|
|
End If
|
|
End If
|
|
|
- End If
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
Return 0
|
|
Return 0
|
|
|
|
|
|
|
@@ -1175,19 +1058,18 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
|
|
|
|
|
Function ComisionCasa()
|
|
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
|
|
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
|
|
ElseIf IndexBase = 1 Then
|
|
|
|
|
|
|
@@ -1210,14 +1092,14 @@ Public Class frmLetes
|
|
|
If CambioDeFecha = 1 Then
|
|
If CambioDeFecha = 1 Then
|
|
|
DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, 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)
|
|
DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, 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
|
|
Comision = ComisionOpc1 + ComisionOpc2
|
|
|
|
|
|
|
@@ -1225,14 +1107,14 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
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
|
|
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
|
|
End If
|
|
|
Return Comision
|
|
Return Comision
|
|
@@ -1262,14 +1144,14 @@ Public Class frmLetes
|
|
|
If CambioDeFecha = 1 Then
|
|
If CambioDeFecha = 1 Then
|
|
|
DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, 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)
|
|
DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, 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
|
|
Comision = ComisionOpc1 + ComisionOpc2
|
|
|
|
|
|
|
@@ -1277,189 +1159,162 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
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
|
|
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
|
|
End If
|
|
|
Return Comision
|
|
Return Comision
|
|
|
|
|
|
|
|
|
|
|
|
|
Else
|
|
Else
|
|
|
- Comision = (CDec(ValorTras) * (CDec(ComisionDeCasa)) / 100) * (CDec(PlazoInversion) / 360)
|
|
|
|
|
- Return Comision
|
|
|
|
|
|
|
+ Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 360)
|
|
|
|
|
+ Return Comision
|
|
|
End If
|
|
End If
|
|
|
- End If
|
|
|
|
|
|
|
+
|
|
|
Return 0
|
|
Return 0
|
|
|
|
|
|
|
|
End Function
|
|
End Function
|
|
|
|
|
|
|
|
Function ComisionBolsa()
|
|
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
|
|
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
|
|
End If
|
|
|
- Return Comision
|
|
|
|
|
- Else
|
|
|
|
|
- Comision = (CDec(ValorTras) * (CDec(ComisionDeBolsa)) / 100) * (CDec(PlazoInversion) / 360)
|
|
|
|
|
|
|
|
|
|
- Return Comision
|
|
|
|
|
End If
|
|
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
|
|
End If
|
|
|
|
|
+
|
|
|
Return 0
|
|
Return 0
|
|
|
End Function
|
|
End Function
|
|
|
|
|
|
|
|
Function RendimientoNeto()
|
|
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 RendBruto As Double = 0
|
|
|
Dim ComisionCasa As Double = 0
|
|
Dim ComisionCasa As Double = 0
|
|
|
Dim ComisionBolsa As Double = 0
|
|
Dim ComisionBolsa As Double = 0
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
If Not String.IsNullOrEmpty(txtRendimientoBruto.Text.ToString.Trim("%")) Then
|
|
If Not String.IsNullOrEmpty(txtRendimientoBruto.Text.ToString.Trim("%")) Then
|
|
|
RendBruto = txtRendimientoBruto.Text.ToString.Trim("%")
|
|
RendBruto = txtRendimientoBruto.Text.ToString.Trim("%")
|
|
|
End If
|
|
End If
|
|
@@ -1614,24 +1469,16 @@ Public Class frmLetes
|
|
|
Dim ValorNominal As Double = 0
|
|
Dim ValorNominal As Double = 0
|
|
|
Dim ValorTrasado 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 Bruto As Double = 0
|
|
|
Dim Plazo As Integer = 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
|
|
If (chbValorPar.Checked Or CET) Then
|
|
|
Dim PlazoDias As Integer = 0
|
|
Dim PlazoDias As Integer = 0
|
|
@@ -1717,67 +1564,6 @@ Public Class frmLetes
|
|
|
Return Valor
|
|
Return Valor
|
|
|
|
|
|
|
|
End If
|
|
End If
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
Else
|
|
Else
|
|
|
|
|
|
|
|
If (Double.TryParse(ValorNominal, Nothing) And Double.TryParse(ValorTrasado, Nothing)) Then
|
|
If (Double.TryParse(ValorNominal, Nothing) And Double.TryParse(ValorTrasado, Nothing)) Then
|
|
@@ -1789,13 +1575,15 @@ Public Class frmLetes
|
|
|
End Function
|
|
End Function
|
|
|
|
|
|
|
|
Function IngresoNeto()
|
|
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
|
|
Dim Neto As Double = 0
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
If chbValorPar.Checked Or CET Then
|
|
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
|
|
Neto = (IngBruto * 0.9) - Descuentos
|
|
|
|
|
|
|
|
Return Neto
|
|
Return Neto
|
|
@@ -1809,20 +1597,16 @@ Public Class frmLetes
|
|
|
End Function
|
|
End Function
|
|
|
|
|
|
|
|
Function TotalPagar()
|
|
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 (PBUR Or CET) Then
|
|
|
If (Double.TryParse(ValorTrasado, Nothing) And Double.TryParse(ComisionCasa, Nothing) And Double.TryParse(ComisionBolsa, Nothing)) 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
|
|
Dim Total = CDec(ValorTrasado) + CDec(ComisionCasa) + CDec(ComisionBolsa) + InteresAcumulado
|