agregado procesos y bd clases
This commit is contained in:
708
guia/Extensiones/cuentas.vb
Normal file
708
guia/Extensiones/cuentas.vb
Normal file
@@ -0,0 +1,708 @@
|
||||
|
||||
|
||||
Imports tsl5.Extensiones
|
||||
Imports tsl5.Extensiones.DoubleExtensions
|
||||
|
||||
|
||||
Partial Public Class cuentas
|
||||
Public Shared LongitudCuentaFinal As Integer = 8
|
||||
Public Const CUENTA_PERDIDAS_Y_GANANCIAS As String = "12900000"
|
||||
Public Property ApuntesTemporales As List(Of apuntes)
|
||||
Public ReadOnly Property Descripcion As String
|
||||
Get
|
||||
Return Me.NumeroCuenta & " " & Me.Denominacion
|
||||
End Get
|
||||
End Property
|
||||
Public Sub RellenaApuntesTemporales(IncluirAsientoCierre As Boolean)
|
||||
|
||||
If Me.Nivel = LongitudCuentaFinal Then
|
||||
Dim apap = Me.apuntes.Where(Function(x) x.asientos.Tipo = asientos.TipoAsiento.APERTURA).ToList
|
||||
If apap.Count = 0 Then
|
||||
Me.SaldoInicialTmp = 0
|
||||
Else
|
||||
Me.SaldoInicialTmp = Math.Round(apap.Sum(Function(x) x.Debe - x.Haber), 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
|
||||
If IncluirAsientoCierre Then
|
||||
ApuntesTemporales = Me.apuntes.Where(Function(x) x.asientos.Tipo <> asientos.TipoAsiento.APERTURA).ToList
|
||||
Else
|
||||
ApuntesTemporales = Me.apuntes.Where(Function(x) x.asientos.Tipo <> asientos.TipoAsiento.APERTURA And x.asientos.Tipo <> asientos.TipoAsiento.REGULARIZACION).ToList
|
||||
End If
|
||||
Else
|
||||
Dim bd As bdGestionAsegasa.gestionasegasaEntities = Me.ObtieneContexto
|
||||
Dim apap = bd.apuntes.Where(Function(x) x.cuentas.NumeroCuenta.StartsWith(Me.NumeroCuenta) And x.asientos.Tipo = asientos.TipoAsiento.APERTURA).ToList
|
||||
If apap.Count = 0 Then
|
||||
Me.SaldoInicialTmp = 0
|
||||
Else
|
||||
Me.SaldoInicialTmp = Math.Round(apap.Sum(Function(x) x.Debe - x.Haber), 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
If IncluirAsientoCierre Then
|
||||
ApuntesTemporales = bd.apuntes.Where(Function(x) x.asientos.idEjercicio = Me.idEjercicio And x.cuentas.NumeroCuenta.StartsWith(Me.NumeroCuenta) And x.asientos.Tipo <> asientos.TipoAsiento.APERTURA).ToList
|
||||
Else
|
||||
ApuntesTemporales = bd.apuntes.Where(Function(x) x.asientos.idEjercicio = Me.idEjercicio And x.cuentas.NumeroCuenta.StartsWith(Me.NumeroCuenta) And x.asientos.Tipo <> asientos.TipoAsiento.REGULARIZACION And x.asientos.Tipo <> asientos.TipoAsiento.APERTURA).ToList
|
||||
End If
|
||||
End If
|
||||
If ApuntesTemporales.Count = 0 Then
|
||||
Me.SaldoDebeTmp = 0
|
||||
Me.SaldoHaberTmp = 0
|
||||
Else
|
||||
Me.SaldoDebeTmp = Math.Round(ApuntesTemporales.Sum(Function(x) x.Debe), 2, MidpointRounding.AwayFromZero)
|
||||
Me.SaldoHaberTmp = Math.Round(ApuntesTemporales.Sum(Function(x) x.Haber), 2, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
Me.SaldoFinalTmp = Me.SaldoInicialTmp + Me.SaldoDebeTmp - Me.SaldoHaberTmp
|
||||
|
||||
End Sub
|
||||
Public Property SaldoInicialTmp As Double
|
||||
Public Property SaldoDebeTmp As Double
|
||||
Public Property SaldoHaberTmp As Double
|
||||
Public Property SaldoFinalTmp As Double
|
||||
|
||||
|
||||
Public Shared Function CreaCuenta(bd As gestionasegasaEntities, idEjercicio As Integer, NumeroCuenta As String, Descripcion As String, Optional Observaciones As String = "") As cuentas
|
||||
Dim cta = bd.cuentas.FirstOrDefault(Function(x) x.NumeroCuenta = NumeroCuenta And x.idEjercicio = idEjercicio)
|
||||
If cta Is Nothing Then
|
||||
cta = New cuentas
|
||||
With cta
|
||||
.NumeroCuenta = NumeroCuenta
|
||||
.idEjercicio = idEjercicio
|
||||
.Denominacion = Descripcion.Acortar(150)
|
||||
.EsCuentaFinal = True
|
||||
.Observaciones = Observaciones
|
||||
End With
|
||||
bd.cuentas.AddObject(cta)
|
||||
bd.SaveChanges()
|
||||
End If
|
||||
Return cta
|
||||
End Function
|
||||
Public Shared Function CreaCuenta(bd As gestionasegasaEntities, Fecha As Date, NumeroCuenta As String, Descripcion As String, Optional Observaciones As String = "") As cuentas
|
||||
Dim ej = bd.ejercicioscontables.FirstOrDefault(Function(x) x.FechaInicio <= Fecha And x.FechaFin >= Fecha)
|
||||
If ej Is Nothing Then Throw New Exception("No existe ningún ejercicio abierto para la fecha " & Fecha.ToString)
|
||||
Return CreaCuenta(bd, ej.idEjercicio, NumeroCuenta, Descripcion, Observaciones)
|
||||
End Function
|
||||
|
||||
|
||||
Public ReadOnly Property TotalSaldoAntesCierre As Double
|
||||
Get
|
||||
Dim ac = Me.ejercicioscontables.asientos.FirstOrDefault(Function(x) x.Tipo = asientos.TipoAsiento.REGULARIZACION)
|
||||
If ac Is Nothing Then
|
||||
Return TotalSaldo
|
||||
Else
|
||||
Dim tdac = ac.apuntes.Where(Function(x) x.cuentas.NumeroCuenta.StartsWith(Me.NumeroCuenta)).Sum(Function(x) x.Debe)
|
||||
Dim thac = ac.apuntes.Where(Function(x) x.cuentas.NumeroCuenta.StartsWith(Me.NumeroCuenta)).Sum(Function(x) x.Haber)
|
||||
Return TotalSaldo - tdac + thac
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Grupo1 As String
|
||||
Get
|
||||
If Me.NumeroCuenta.Length > 1 Then
|
||||
Dim nc = Me.NumeroCuenta.Substring(0, 1)
|
||||
Return nc & " - " & Me.ejercicioscontables.cuentas.First(Function(x) x.NumeroCuenta = nc).Denominacion
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Grupo2 As String
|
||||
Get
|
||||
If Me.NumeroCuenta.Length > 2 Then
|
||||
Dim nc = Me.NumeroCuenta.Substring(0, 2)
|
||||
Return nc & " - " & Me.ejercicioscontables.cuentas.First(Function(x) x.NumeroCuenta = nc).Denominacion
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Grupo3 As String
|
||||
Get
|
||||
If Me.NumeroCuenta.Length > 3 Then
|
||||
Dim nc = Me.NumeroCuenta.Substring(0, 3)
|
||||
Return nc & " - " & Me.ejercicioscontables.cuentas.First(Function(x) x.NumeroCuenta = nc).Denominacion
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Grupo4 As String
|
||||
Get
|
||||
If Me.NumeroCuenta.Length > 4 Then
|
||||
Dim nc = Me.NumeroCuenta.Substring(0, 4)
|
||||
Return nc & " - " & Me.ejercicioscontables.cuentas.First(Function(x) x.NumeroCuenta = nc).Denominacion
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private _bd As gestionasegasaEntities
|
||||
Public ReadOnly Property bd As gestionasegasaEntities
|
||||
Get
|
||||
If _bd Is Nothing Then
|
||||
_bd = Me.ObtieneContexto
|
||||
End If
|
||||
Return _bd
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public ReadOnly Property CuentaSuperior1 As cuentas
|
||||
Get
|
||||
If Me.NumeroCuenta.Length = 1 Then
|
||||
Return Nothing
|
||||
Else
|
||||
Dim CuentaSuperior = Me.NumeroCuenta.Substring(0, 1)
|
||||
Return bd.cuentas.First(Function(x) x.NumeroCuenta = CuentaSuperior And x.idEjercicio = Me.idEjercicio)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CuentaSuperior2 As cuentas
|
||||
Get
|
||||
If Me.NumeroCuenta.Length < 3 Then
|
||||
Return Nothing
|
||||
Else
|
||||
Dim CuentaSuperior = Me.NumeroCuenta.Substring(0, 2)
|
||||
Return bd.cuentas.First(Function(x) x.NumeroCuenta = CuentaSuperior And x.idEjercicio = Me.idEjercicio)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CuentaSuperior3 As cuentas
|
||||
Get
|
||||
If Me.NumeroCuenta.Length < 4 Then
|
||||
Return Nothing
|
||||
Else
|
||||
Dim CuentaSuperior = Me.NumeroCuenta.Substring(0, 3)
|
||||
Return bd.cuentas.First(Function(x) x.NumeroCuenta = CuentaSuperior And x.idEjercicio = Me.idEjercicio)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CuentaSuperior4 As cuentas
|
||||
Get
|
||||
If Me.NumeroCuenta.Length < 5 Then
|
||||
Return Nothing
|
||||
Else
|
||||
Dim CuentaSuperior = Me.NumeroCuenta.Substring(0, 4)
|
||||
Return bd.cuentas.First(Function(x) x.NumeroCuenta = CuentaSuperior And x.idEjercicio = Me.idEjercicio)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Nivel As Integer
|
||||
Get
|
||||
Return NumeroCuenta.NothingAVacio.Length
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private _ValoresExtendidos As vf_cuentas
|
||||
Public ReadOnly Property ValoresExtendidos As vf_cuentas
|
||||
Get
|
||||
If _ValoresExtendidos Is Nothing Then
|
||||
_ValoresExtendidos = Obtiene_vf_cuenta()
|
||||
End If
|
||||
Return _ValoresExtendidos
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function Obtiene_vf_cuenta() As vf_cuentas
|
||||
Try
|
||||
Dim bd As gestionasegasaEntities = Me.ObtieneContexto
|
||||
Dim ct As vf_cuentas
|
||||
If Me.Nivel = 8 Then
|
||||
ct = bd.vf_cuentas.First(Function(x) x.idCuenta = Me.idCuenta)
|
||||
Else
|
||||
If Nivel = 0 Then
|
||||
ct = New vf_cuentas
|
||||
With ct
|
||||
.idCuenta = 0
|
||||
.idEjercicio = 0
|
||||
.Mote = ""
|
||||
.Denominacion = ""
|
||||
.idEmpresaAmortizacion = 0
|
||||
.NumeroCuenta = ""
|
||||
.Observaciones = ""
|
||||
.PresupuestoEnero = 0
|
||||
.PresupuestoFebrero = 0
|
||||
.PresupuestoMarzo = 0
|
||||
.PresupuestoAbril = 0
|
||||
.PresupuestoMayo = 0
|
||||
.PresupuestoJunio = 0
|
||||
.PresupuestoJulio = 0
|
||||
.PresupuestoAgosto = 0
|
||||
.PresupuestoSeptiembre = 0
|
||||
.PresupuestoOctubre = 0
|
||||
.PresupuestoNoviembre = 0
|
||||
.PresupuestoDiciembre = 0
|
||||
|
||||
.DebeEnero = 0
|
||||
.DebeFebrero = 0
|
||||
.DebeMarzo = 0
|
||||
.DebeAbril = 0
|
||||
.DebeMayo = 0
|
||||
.DebeJunio = 0
|
||||
.DebeJulio = 0
|
||||
.DebeAgosto = 0
|
||||
.DebeSeptiembre = 0
|
||||
.DebeOctubre = 0
|
||||
.DebeNoviembre = 0
|
||||
.DebeDiciembre = 0
|
||||
|
||||
.HaberEnero = 0
|
||||
.HaberFebrero = 0
|
||||
.HaberMarzo = 0
|
||||
.HaberAbril = 0
|
||||
.HaberMayo = 0
|
||||
.HaberJunio = 0
|
||||
.HaberJulio = 0
|
||||
.HaberAgosto = 0
|
||||
.HaberSeptiembre = 0
|
||||
.HaberOctubre = 0
|
||||
.HaberNoviembre = 0
|
||||
.HaberDiciembre = 0
|
||||
.TotalDebe = 0
|
||||
.TotalHaber = 0
|
||||
End With
|
||||
Else
|
||||
Dim sumatorio = bd.vf_cuentas.Where(Function(x) x.NumeroCuenta.StartsWith(Me.NumeroCuenta) And x.idEjercicio = Me.idEjercicio).ToList
|
||||
ct = New vf_cuentas
|
||||
With ct
|
||||
.idCuenta = Me.idCuenta
|
||||
.idEjercicio = Me.idEjercicio
|
||||
.Mote = Me.Mote
|
||||
.Denominacion = Me.Denominacion
|
||||
.idEmpresaAmortizacion = Me.idEmpresaAmortizacion
|
||||
.NumeroCuenta = Me.NumeroCuenta
|
||||
.Observaciones = Me.Observaciones
|
||||
.PresupuestoEnero = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoFebrero = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoMarzo = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoAbril = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoMayo = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoJunio = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoJulio = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoAgosto = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoOctubre = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoNoviembre = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero)
|
||||
.PresupuestoDiciembre = Math.Round(sumatorio.Sum(Function(x) x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero)
|
||||
|
||||
.DebeEnero = Math.Round(sumatorio.Sum(Function(x) x.DebeEnero.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeFebrero = Math.Round(sumatorio.Sum(Function(x) x.DebeEnero.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeMarzo = Math.Round(sumatorio.Sum(Function(x) x.DebeMarzo.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeAbril = Math.Round(sumatorio.Sum(Function(x) x.DebeAbril.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeMayo = Math.Round(sumatorio.Sum(Function(x) x.DebeMayo.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeJunio = Math.Round(sumatorio.Sum(Function(x) x.DebeJunio.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeJulio = Math.Round(sumatorio.Sum(Function(x) x.DebeJulio.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeAgosto = Math.Round(sumatorio.Sum(Function(x) x.DebeAgosto.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeSeptiembre = Math.Round(sumatorio.Sum(Function(x) x.DebeSeptiembre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeOctubre = Math.Round(sumatorio.Sum(Function(x) x.DebeOctubre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeNoviembre = Math.Round(sumatorio.Sum(Function(x) x.DebeNoviembre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.DebeDiciembre = Math.Round(sumatorio.Sum(Function(x) x.DebeDiciembre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
|
||||
.HaberEnero = Math.Round(sumatorio.Sum(Function(x) x.HaberEnero.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberFebrero = Math.Round(sumatorio.Sum(Function(x) x.HaberEnero.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberMarzo = Math.Round(sumatorio.Sum(Function(x) x.HaberMarzo.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberAbril = Math.Round(sumatorio.Sum(Function(x) x.HaberAbril.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberMayo = Math.Round(sumatorio.Sum(Function(x) x.HaberMayo.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberJunio = Math.Round(sumatorio.Sum(Function(x) x.HaberJunio.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberJulio = Math.Round(sumatorio.Sum(Function(x) x.HaberJulio.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberAgosto = Math.Round(sumatorio.Sum(Function(x) x.HaberAgosto.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberSeptiembre = Math.Round(sumatorio.Sum(Function(x) x.HaberSeptiembre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberOctubre = Math.Round(sumatorio.Sum(Function(x) x.HaberOctubre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberNoviembre = Math.Round(sumatorio.Sum(Function(x) x.HaberNoviembre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.HaberDiciembre = Math.Round(sumatorio.Sum(Function(x) x.HaberDiciembre.NothingA0), 2, MidpointRounding.AwayFromZero)
|
||||
.TotalDebe = Math.Round(sumatorio.Sum(Function(x) x.TotalDebe), 2, MidpointRounding.AwayFromZero)
|
||||
.TotalHaber = Math.Round(sumatorio.Sum(Function(x) x.TotalHaber), 2, MidpointRounding.AwayFromZero)
|
||||
End With
|
||||
End If
|
||||
End If
|
||||
Try
|
||||
If Nivel > 0 Then
|
||||
Dim cta1 = bd.cuentas.First(Function(x) x.NumeroCuenta = ct.NumeroCuenta.Substring(0, 1) And x.idEjercicio = Me.idEjercicio)
|
||||
ct.Grupo1 = cta1.NumeroCuenta & " " & cta1.Denominacion
|
||||
If ct.Nivel > 1 Then
|
||||
Dim cta2 = bd.cuentas.First(Function(x) x.NumeroCuenta = ct.NumeroCuenta.Substring(0, 2) And x.idEjercicio = Me.idEjercicio)
|
||||
ct.Grupo2 = cta2.NumeroCuenta & " " & cta2.Denominacion
|
||||
If ct.Nivel > 2 Then
|
||||
Dim cta3 = bd.cuentas.First(Function(x) x.NumeroCuenta = ct.NumeroCuenta.Substring(0, 3) And x.idEjercicio = Me.idEjercicio)
|
||||
ct.Grupo3 = cta3.NumeroCuenta & " " & cta3.Denominacion
|
||||
If ct.Nivel > 3 Then
|
||||
Dim cta4 = bd.cuentas.First(Function(x) x.NumeroCuenta = ct.NumeroCuenta.Substring(0, 4) And x.idEjercicio = Me.idEjercicio)
|
||||
ct.Grupo4 = cta4.NumeroCuenta & " " & cta4.Denominacion
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Throw New Exception("Error obteniendo cuentas intermedia de la cuenta " & Me.NumeroCuenta & " " & ex.Message, ex)
|
||||
End Try
|
||||
Return ct
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region "Saldos"
|
||||
Public ReadOnly Property SaldoEnero As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoEnero
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoFebrero As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoFebrero
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoMarzo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoMarzo
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoAbril As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoAbril
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoMayo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoMayo
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoJunio As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoJunio
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoJulio As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoJulio
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoAgosto As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoAgosto
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoSeptiembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoSeptiembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoOctubre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoOctubre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaldoNoviembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoNoviembre
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SaldoDiciembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.SaldoDiciembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalSaldo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.TotalSaldo
|
||||
End Get
|
||||
End Property
|
||||
#End Region
|
||||
#Region "Presupuestos"
|
||||
Public ReadOnly Property TotalPresupuestado As Double
|
||||
Get
|
||||
Return Math.Round(PresupuestoEnero + PresupuestoFebrero + PresupuestoMarzo + PresupuestoAbril + PresupuestoMayo + PresupuestoJunio + PresupuestoJulio + PresupuestoAgosto + PresupuestoSeptiembre + PresupuestoOctubre + PresupuestoNoviembre + PresupuestoDiciembre, 2, MidpointRounding.AwayFromZero)
|
||||
End Get
|
||||
End Property
|
||||
Public Sub ActualizaTotalPresupuestado()
|
||||
OnPropertyChanged("TotalPresupuestado")
|
||||
End Sub
|
||||
Public ReadOnly Property DesvioPresupuestoEnero As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoEnero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DesvioPresupuestoFebrero As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoFebrero
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoMarzo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoMarzo
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoAbril As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoAbril
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoMayo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoMayo
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoJunio As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoJunio
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoJulio As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoJulio
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoAgosto As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoAgosto
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoSeptiembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoSeptiembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoOctubre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoOctubre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoNoviembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoNoviembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoDiciembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoDiciembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DesvioPresupuestoTotal As Double
|
||||
Get
|
||||
Return ValoresExtendidos.DesvioPresupuestoTotal
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoEnero As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoEnero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoFebrero As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoFebrero
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoMarzo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoMarzo
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoAbril As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoAbril
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoMayo As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoMayo
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoJunio As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoJunio
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoJulio As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoJulio
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoAgosto As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoAgosto
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoSeptiembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoSeptiembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoOctubre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoOctubre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoNoviembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoNoviembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoDiciembre As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoDiciembre
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PorcentajeDesvioPresupuestoTotal As Double
|
||||
Get
|
||||
Return ValoresExtendidos.PorcentajeDesvioPresupuestoTotal
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
Public Shared Function ListadoGruposCuentas() As List(Of GrupoCuenta)
|
||||
Dim lGrupos As New List(Of GrupoCuenta)
|
||||
lGrupos.Add(New GrupoCuenta With {.Nivel = 1, .Descripcion = "GRUPO INICIAL 1 DÍGITO"})
|
||||
lGrupos.Add(New GrupoCuenta With {.Nivel = 2, .Descripcion = "GRUPO INTERMEDIO 2 DÍGITOS"})
|
||||
lGrupos.Add(New GrupoCuenta With {.Nivel = 3, .Descripcion = "GRUPO INTERMEDIO 3 DÍGITOS"})
|
||||
lGrupos.Add(New GrupoCuenta With {.Nivel = 4, .Descripcion = "GRUPO INTERMEDIO 4 DÍGITOS"})
|
||||
lGrupos.Add(New GrupoCuenta With {.Nivel = 8, .Descripcion = "GRUPO FINAL 8 DÍGITOS"})
|
||||
Return lGrupos
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Public Class GrupoCuenta
|
||||
Property Nivel As Integer
|
||||
Property Descripcion As String
|
||||
End Class
|
||||
|
||||
'Public Class ve_cuentas
|
||||
' Property idCuenta As Integer
|
||||
' Property Mote As String
|
||||
' Property Denominacion As String
|
||||
|
||||
' Property DebeEnero As Double
|
||||
' Property DebeFebrero As Double
|
||||
' Property DebeMarzo As Double
|
||||
' Property DebeAbril As Double
|
||||
' Property DebeMayo As Double
|
||||
' Property DebeJunio As Double
|
||||
' Property DebeJulio As Double
|
||||
' Property DebeAgosto As Double
|
||||
' Property DebeSeptiembre As Double
|
||||
' Property DebeOctubre As Double
|
||||
' Property DebeNoviembre As Double
|
||||
' Property DebeDiciembre As Double
|
||||
|
||||
' Property HaberEnero As Double
|
||||
' Property HaberFebrero As Double
|
||||
' Property HaberMarzo As Double
|
||||
' Property HaberAbril As Double
|
||||
' Property HaberMayo As Double
|
||||
' Property HaberJunio As Double
|
||||
' Property HaberJulio As Double
|
||||
' Property HaberAgosto As Double
|
||||
' Property HaberSeptiembre As Double
|
||||
' Property HaberOctubre As Double
|
||||
' Property HaberNoviembre As Double
|
||||
' Property HaberDiciembre As Double
|
||||
' Property TotalDebe As Double
|
||||
' Property TotalHaber As Double
|
||||
|
||||
|
||||
' Property PresupuestoEnero As Double
|
||||
' Property PresupuestoFebrero As Double
|
||||
' Property PresupuestoMarzo As Double
|
||||
' Property PresupuestoAbril As Double
|
||||
' Property PresupuestoMayo As Double
|
||||
' Property PresupuestoJunio As Double
|
||||
' Property PresupuestoJulio As Double
|
||||
' Property PresupuestoAgosto As Double
|
||||
' Property PresupuestoSeptiembre As Double
|
||||
' Property PresupuestoOctubre As Double
|
||||
' Property PresupuestoNoviembre As Double
|
||||
' Property PresupuestoDiciembre As Double
|
||||
' Property Observaciones As String
|
||||
' Property NumeroCuenta As String
|
||||
' Property idEjercicio As Integer
|
||||
' Property idEmpresaAmortizacion As Integer?
|
||||
' Property EsCuentaFinal As Boolean
|
||||
' Public Property Grupo1 As String
|
||||
' Public Property Grupo2 As String
|
||||
' Public Property Grupo3 As String
|
||||
' Public Property Grupo4 As String
|
||||
|
||||
|
||||
|
||||
'#Region "Saldos"
|
||||
' Public ReadOnly Property SaldoEnero As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeEnero - HaberEnero, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoFebrero As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeFebrero - HaberFebrero, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoMarzo As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeMarzo - HaberMarzo, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoAbril As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeAbril - HaberAbril, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoMayo As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeMayo - HaberMayo, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoJunio As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeJunio - HaberJunio, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoJulio As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeJulio - HaberJulio, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoAgosto As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeAgosto - HaberAgosto, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoSeptiembre As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeSeptiembre - HaberSeptiembre, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoOctubre As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeOctubre - HaberOctubre, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property SaldoNoviembre As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeNoviembre - HaberNoviembre, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public ReadOnly Property SaldoDiciembre As Double
|
||||
' Get
|
||||
' Return Math.Round(DebeDiciembre - HaberDiciembre, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
' Public ReadOnly Property TotalSaldo As Double
|
||||
' Get
|
||||
' Return Math.Round(TotalDebe - TotalHaber, 2, MidpointRounding.AwayFromZero)
|
||||
' End Get
|
||||
' End Property
|
||||
'#End Region
|
||||
|
||||
|
||||
'End Class
|
||||
Reference in New Issue
Block a user