|
|
@@ -1,11 +1,15 @@
|
|
|
Imports System.Globalization
|
|
|
Public Class frmLetes
|
|
|
+
|
|
|
Dim oCELetes As LETESCE
|
|
|
Dim oDAOLetes As New LETESDAO
|
|
|
Dim oDAOGeneral As New DAOGeneral
|
|
|
Dim IndexBase As Integer = 0
|
|
|
Dim TipoTransaccion = "OK"
|
|
|
Dim Operaciones As New Operaciones
|
|
|
+ Dim CalculosDias As New CalculosDias
|
|
|
+
|
|
|
+
|
|
|
|
|
|
Dim V_txtPrecio = 0.0, V_txtValorTransado = 0.0, V_txtComisionCasa = 0.0, V_txtComisionBolsa = 0.0, V_txtIngresoBruto = 0.0, V_txtTotalAPagar = 0.0, V_txtIngresoNeto = 0.0, V_txtRendimientoNeto = 0.0, V_txtDiasAcumulados = 0.0
|
|
|
Dim DecimalesRedondeo As Integer = 4
|
|
|
@@ -194,10 +198,56 @@ Public Class frmLetes
|
|
|
Me.txtTotalAPagar.Text = CalcularValorApagar()
|
|
|
End Sub
|
|
|
|
|
|
+ Sub CrearColumnasIngresosVCN()
|
|
|
+ Dim Correlativo, Plazo, Fecha, Monto, CostoCedeval, PorcentajeRenta,
|
|
|
+ CostoTransferencia, CostoBanco, TotalRecibir As New DataGridViewTextBoxColumn
|
|
|
+
|
|
|
+
|
|
|
+ Correlativo.Name = "Correlativo"
|
|
|
+ Plazo.Name = "Plazo"
|
|
|
+ Fecha.Name = "Fecha"
|
|
|
+ Monto.Name = "Monto"
|
|
|
+ CostoCedeval.Name = "CostoCedeval"
|
|
|
+ PorcentajeRenta.Name = "PorcentajeRenta"
|
|
|
+ CostoTransferencia.Name = "CostoTransferencia"
|
|
|
+ CostoBanco.Name = "CostoBanco"
|
|
|
+ TotalRecibir.Name = "TotalRecibir"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ Correlativo.HeaderText = "Correlativo"
|
|
|
+ Plazo.HeaderText = "Plazo"
|
|
|
+ Fecha.HeaderText = "Fecha"
|
|
|
+ Monto.HeaderText = "Monto"
|
|
|
+ CostoCedeval.HeaderText = "Costo de Cedeval"
|
|
|
+ PorcentajeRenta.HeaderText = "Porcentaje de la Renta"
|
|
|
+ CostoTransferencia.HeaderText = "Costo de Transferencia"
|
|
|
+ CostoBanco.HeaderText = "Costo de Banco"
|
|
|
+ TotalRecibir.HeaderText = "Total a Recibir"
|
|
|
+
|
|
|
+ dgvIngresosVCN.Columns.Add(Correlativo)
|
|
|
+ dgvIngresosVCN.Columns.Add(Plazo)
|
|
|
+ dgvIngresosVCN.Columns.Add(Fecha)
|
|
|
+ dgvIngresosVCN.Columns.Add(Monto)
|
|
|
+ dgvIngresosVCN.Columns.Add(CostoCedeval)
|
|
|
+ dgvIngresosVCN.Columns.Add(PorcentajeRenta)
|
|
|
+ dgvIngresosVCN.Columns.Add(CostoTransferencia)
|
|
|
+ dgvIngresosVCN.Columns.Add(CostoBanco)
|
|
|
+ dgvIngresosVCN.Columns.Add(TotalRecibir)
|
|
|
+
|
|
|
+ End Sub
|
|
|
+
|
|
|
+
|
|
|
+ Sub CalculosIngresosVCN()
|
|
|
+ CalculosDias.AgregarFechaIngresos(dgvIngresosVCN, dtpFechaLiquidacion, "Fecha", DefinirBaseDias())
|
|
|
+ End Sub
|
|
|
+
|
|
|
+ Function DefinirBaseDias()
|
|
|
+ Dim TipoBase As Integer = Operaciones.ConvertirEntero(cboBase.SelectedIndex)
|
|
|
+ Return TipoBase
|
|
|
+ End Function
|
|
|
+
|
|
|
|
|
|
|
|
|
'EVENTOS
|
|
|
@@ -378,6 +428,7 @@ Public Class frmLetes
|
|
|
chbValorPar.Visible = True
|
|
|
dtpFechaVencimiento.Enabled = True
|
|
|
txtPlazoInversion.ReadOnly = True
|
|
|
+ CrearColumnasIngresosVCN()
|
|
|
Else
|
|
|
Instrumento = "NADA"
|
|
|
End If
|
|
|
@@ -880,111 +931,110 @@ Public Class frmLetes
|
|
|
|
|
|
If (IndexBase = 0) Then
|
|
|
|
|
|
- Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 360)) * Plazo / 360)) * 100
|
|
|
- Return Pr
|
|
|
+ Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 360)) * Plazo / 360)) * 100
|
|
|
+ Return Pr
|
|
|
|
|
|
- ElseIf (IndexBase = 1) Then
|
|
|
+ ElseIf (IndexBase = 1) Then
|
|
|
|
|
|
|
|
|
- Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
- Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
+ Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
+ Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
|
|
|
- Dim PrOpc1 = 0.0, PrOpc2 = 0.0
|
|
|
+ Dim PrOpc1 = 0.0, PrOpc2 = 0.0
|
|
|
|
|
|
- Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
+ Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
|
|
|
- Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
|
|
|
- Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
|
|
|
- Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
+ Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
|
|
|
+ Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
|
|
|
+ Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
|
|
|
|
|
|
- If (Not CambioDeFecha = 0) Then
|
|
|
+ If (Not CambioDeFecha = 0) Then
|
|
|
|
|
|
|
|
|
- If CambioDeFecha = 1 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
- PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 366)) * DiasPrimeraFecha / 366))
|
|
|
- PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 365)) * DiasSegundaFecha / 365))
|
|
|
+ If CambioDeFecha = 1 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 366)) * DiasPrimeraFecha / 366))
|
|
|
+ PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 365)) * DiasSegundaFecha / 365))
|
|
|
|
|
|
|
|
|
- ElseIf CambioDeFecha = 2 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
- PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 365)) * DiasPrimeraFecha / 365))
|
|
|
- PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 366)) * DiasSegundaFecha / 366))
|
|
|
- End If
|
|
|
+ ElseIf CambioDeFecha = 2 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 365)) * DiasPrimeraFecha / 365))
|
|
|
+ PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 366)) * DiasSegundaFecha / 366))
|
|
|
+ End If
|
|
|
|
|
|
- Pr = (1 - (PrOpc1 + PrOpc2)) * 100
|
|
|
+ Pr = (1 - (PrOpc1 + PrOpc2)) * 100
|
|
|
|
|
|
- Else
|
|
|
+ Else
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
|
|
|
- Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 365)) * Plazo / 365)) * 100
|
|
|
+ Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 365)) * Plazo / 365)) * 100
|
|
|
|
|
|
- End If
|
|
|
-
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
+ End If
|
|
|
|
|
|
- Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 366)) * Plazo / 366)) * 100
|
|
|
- End If
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
|
|
|
+ Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 366)) * Plazo / 366)) * 100
|
|
|
End If
|
|
|
- Return Pr
|
|
|
|
|
|
- ElseIf (IndexBase = 2) Then
|
|
|
- ''''''''''''''''''
|
|
|
- Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
- Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
+ End If
|
|
|
+ Return Pr
|
|
|
|
|
|
- Dim PrOpc1 = 0.0, PrOpc2 = 0.0
|
|
|
+ ElseIf (IndexBase = 2) Then
|
|
|
+ ''''''''''''''''''
|
|
|
+ Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
+ Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
|
|
|
- Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
+ Dim PrOpc1 = 0.0, PrOpc2 = 0.0
|
|
|
|
|
|
- Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase360(FechaInicial)
|
|
|
- Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase360(FechaFinal)
|
|
|
- Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 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 (Not CambioDeFecha = 0) Then
|
|
|
|
|
|
- If CambioDeFecha = 1 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
- PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 366)) * DiasPrimeraFecha / 366))
|
|
|
- PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 365)) * DiasSegundaFecha / 365))
|
|
|
|
|
|
+ If CambioDeFecha = 1 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 366)) * DiasPrimeraFecha / 366))
|
|
|
+ PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 365)) * DiasSegundaFecha / 365))
|
|
|
|
|
|
- ElseIf CambioDeFecha = 2 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
- PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 365)) * DiasPrimeraFecha / 365))
|
|
|
- PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 366)) * DiasSegundaFecha / 366))
|
|
|
- End If
|
|
|
|
|
|
- Pr = (1 - (PrOpc1 + PrOpc2)) * 100
|
|
|
+ ElseIf CambioDeFecha = 2 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 365)) * DiasPrimeraFecha / 365))
|
|
|
+ PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 366)) * DiasSegundaFecha / 366))
|
|
|
+ End If
|
|
|
|
|
|
- Else
|
|
|
+ Pr = (1 - (PrOpc1 + PrOpc2)) * 100
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
+ Else
|
|
|
|
|
|
- Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 365)) * Plazo / 365)) * 100
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
|
|
|
- End If
|
|
|
+ Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 365)) * Plazo / 365)) * 100
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
+ End If
|
|
|
|
|
|
- Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 366)) * Plazo / 366)) * 100
|
|
|
- End If
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
|
|
|
+ Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 366)) * Plazo / 366)) * 100
|
|
|
End If
|
|
|
- Return Pr
|
|
|
|
|
|
+ End If
|
|
|
+ Return Pr
|
|
|
|
|
|
- Else
|
|
|
|
|
|
+ Else
|
|
|
|
|
|
|
|
|
|
|
|
@@ -998,47 +1048,48 @@ Public Class frmLetes
|
|
|
|
|
|
|
|
|
|
|
|
- Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
- Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
|
|
|
- Dim PrOpc1 = 0.0, PrOpc2 = 0.0
|
|
|
+ Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
+ Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
|
|
|
- Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
+ Dim PrOpc1 = 0.0, PrOpc2 = 0.0
|
|
|
|
|
|
- Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
|
|
|
- Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
|
|
|
- Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
+ Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
|
|
|
+ Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
|
|
|
+ Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
|
|
|
+ Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
|
|
|
- If (Not CambioDeFecha = 0) Then
|
|
|
|
|
|
+ If (Not CambioDeFecha = 0) Then
|
|
|
|
|
|
- If CambioDeFecha = 1 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
- PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 360)) * DiasPrimeraFecha / 360))
|
|
|
- PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 360)) * DiasSegundaFecha / 360))
|
|
|
|
|
|
+ If CambioDeFecha = 1 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 360)) * DiasPrimeraFecha / 360))
|
|
|
+ PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 360)) * DiasSegundaFecha / 360))
|
|
|
|
|
|
- ElseIf CambioDeFecha = 2 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
- PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 360)) * DiasPrimeraFecha / 360))
|
|
|
- PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 360)) * DiasSegundaFecha / 360))
|
|
|
- End If
|
|
|
|
|
|
- Pr = (1 - (PrOpc1 + PrOpc2)) * 100
|
|
|
+ ElseIf CambioDeFecha = 2 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ PrOpc1 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasPrimeraFecha / 360)) * DiasPrimeraFecha / 360))
|
|
|
+ PrOpc2 = ((((Rendimiento / 100) / (1 + (Rendimiento / 100) * DiasSegundaFecha / 360)) * DiasSegundaFecha / 360))
|
|
|
+ End If
|
|
|
|
|
|
- Else
|
|
|
+ Pr = (1 - (PrOpc1 + PrOpc2)) * 100
|
|
|
|
|
|
+ Else
|
|
|
|
|
|
|
|
|
- Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 360)) * Plazo / 360)) * 100
|
|
|
+
|
|
|
+ Pr = ((1 - ((Rendimiento / 100) / (1 + (Rendimiento / 100) * Plazo / 360)) * Plazo / 360)) * 100
|
|
|
|
|
|
|
|
|
- End If
|
|
|
- Return Pr
|
|
|
End If
|
|
|
+ Return Pr
|
|
|
+ End If
|
|
|
|
|
|
|
|
|
Return 0
|
|
|
@@ -1072,111 +1123,111 @@ Public Class frmLetes
|
|
|
Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 360)
|
|
|
Return Comision
|
|
|
|
|
|
- ElseIf IndexBase = 1 Then
|
|
|
+ ElseIf IndexBase = 1 Then
|
|
|
|
|
|
|
|
|
- Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
- Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
+ Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
+ Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
|
|
|
- Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
|
|
|
+ Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
|
|
|
|
|
|
- Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
+ Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
|
|
|
- Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
|
|
|
- Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
|
|
|
- Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
+ Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
|
|
|
+ Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
|
|
|
+ Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
|
|
|
|
|
|
- If (Not CambioDeFecha = 0) Then
|
|
|
+ If (Not CambioDeFecha = 0) Then
|
|
|
|
|
|
|
|
|
- If CambioDeFecha = 1 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ If CambioDeFecha = 1 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
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)
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
ComisionOpc1 = (ValorTras * ComisionDeCasa / 100) * (DiasPrimeraFecha / 365)
|
|
|
ComisionOpc2 = (ValorTras * ComisionDeCasa / 100) * (DiasSegundaFecha / 366)
|
|
|
End If
|
|
|
|
|
|
- Comision = ComisionOpc1 + ComisionOpc2
|
|
|
+ Comision = ComisionOpc1 + ComisionOpc2
|
|
|
|
|
|
- Else
|
|
|
+ Else
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
|
|
|
Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 365)
|
|
|
|
|
|
End If
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
|
|
|
Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 366)
|
|
|
End If
|
|
|
|
|
|
- End If
|
|
|
- Return Comision
|
|
|
+ End If
|
|
|
+ Return Comision
|
|
|
|
|
|
- ElseIf IndexBase = 2 Then
|
|
|
+ ElseIf IndexBase = 2 Then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
- Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
+ Dim FechaInicial = dtpFechaLiquidacion.Value
|
|
|
+ Dim FechaFinal = dtpFechaVencimiento.Value
|
|
|
|
|
|
- Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
|
|
|
+ Dim ComisionOpc1 = 0.0, ComisionOpc2 = 0.0
|
|
|
|
|
|
- Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
+ Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
|
|
|
|
|
|
- Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase360(FechaInicial)
|
|
|
- Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase360(FechaFinal)
|
|
|
- Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
+ Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase360(FechaInicial)
|
|
|
+ Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase360(FechaFinal)
|
|
|
+ Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
|
|
|
|
|
|
|
|
|
- If (Not CambioDeFecha = 0) Then
|
|
|
+ If (Not CambioDeFecha = 0) Then
|
|
|
|
|
|
|
|
|
- If CambioDeFecha = 1 Then
|
|
|
- DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
- DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
+ If CambioDeFecha = 1 Then
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
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)
|
|
|
+ DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
|
|
|
+ DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
|
|
|
ComisionOpc1 = (ValorTras * ComisionDeCasa / 100) * (DiasPrimeraFecha / 365)
|
|
|
ComisionOpc2 = (ValorTras * ComisionDeCasa / 100) * (DiasSegundaFecha / 366)
|
|
|
End If
|
|
|
|
|
|
- Comision = ComisionOpc1 + ComisionOpc2
|
|
|
+ Comision = ComisionOpc1 + ComisionOpc2
|
|
|
|
|
|
- Else
|
|
|
+ Else
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
|
|
|
|
|
|
Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 365)
|
|
|
|
|
|
End If
|
|
|
|
|
|
- If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
+ If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
|
|
|
|
|
|
Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 366)
|
|
|
End If
|
|
|
|
|
|
- End If
|
|
|
- Return Comision
|
|
|
+ End If
|
|
|
+ Return Comision
|
|
|
|
|
|
|
|
|
- Else
|
|
|
+ Else
|
|
|
Comision = (ValorTras * ComisionDeCasa / 100) * (PlazoInversion / 360)
|
|
|
Return Comision
|
|
|
- End If
|
|
|
+ End If
|
|
|
|
|
|
Return 0
|
|
|
|
|
|
@@ -2171,6 +2222,10 @@ Public Class frmLetes
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
+ Private Sub dgvIngresosVCN_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresosVCN.CellClick
|
|
|
+ CalculosIngresosVCN()
|
|
|
+ End Sub
|
|
|
+
|
|
|
Private Sub btnReporto_Click(sender As Object, e As EventArgs)
|
|
|
|
|
|
End Sub
|