125 lines
5.1 KiB
VB.net
125 lines
5.1 KiB
VB.net
Imports bdGestionAsegasa.gestionasegasaEntities
|
|
Imports tsl5.Extensiones
|
|
Imports tsl5.Extensiones.StringExtensions
|
|
Partial Public Class vf_recibosextendidos_ti
|
|
Private Shared TiposPago As List(Of enumeraciones)
|
|
Public ReadOnly Property Situacion_Web As String
|
|
Get
|
|
Return ObtieneSituacionWeb(Me.idSituacion, Me.idTipoPago)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CiaNumeroPoliza As String
|
|
Get
|
|
Return Me.Compania & "/" & Me.NumeroPoliza
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Estado As recibos.EstadoRecibo
|
|
Get
|
|
Dim est As recibos.EstadoRecibo = recibos.EstadoRecibo.PENDIENTE
|
|
If Me.idRemesa.HasValue Then est = recibos.EstadoRecibo.REMESADO
|
|
If Me.idTipoPago = gestionasegasaEntities.TipoPagoCia OrElse Me.idTipoPago = gestionasegasaEntities.TipoPagoFAE Then est = recibos.EstadoRecibo.GESTION_COBRO_CIA
|
|
If Me.FechaLiquidacionAgente.HasValue Then est = recibos.EstadoRecibo.LIQUIDADO
|
|
If Me.FechaBaja.HasValue AndAlso Me.idCausaBaja <> gestionasegasaEntities.CabaSupl AndAlso Me.idCausaBaja <> gestionasegasaEntities.CabaSust Then est = recibos.EstadoRecibo.BAJA
|
|
If Me.FechaDevolucionBanco.HasValue Then est = recibos.EstadoRecibo.DEVUELTO_BANCO
|
|
' If Me.FechaDevolucionCompania.HasValue Then est = recibos.EstadoRecibo.DEVUELTO_CIA
|
|
Return est
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property EstadoRecibo As String
|
|
Get
|
|
Return Estado.ToString.Replace("_", " ")
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property TipoPago As String
|
|
Get
|
|
If Me.idTipoPago.HasValue Then
|
|
If TiposPago Is Nothing Then
|
|
Dim bdtmp = bdGestionAsegasa.gestionasegasaEntities.NuevoContextoCN
|
|
TiposPago = bdtmp.enumeraciones.Where(Function(x) x.gruposenumeraciones.Grupo = "TIPP").ToList
|
|
End If
|
|
Dim tp = TiposPago.FirstOrDefault(Function(x) x.idEnumeracion = Me.idTipoPago)
|
|
If tp Is Nothing Then
|
|
Return "* DESCONOCIDO *"
|
|
Else
|
|
Return tp.Descripcion
|
|
End If
|
|
Else
|
|
Return "* NO ASIGNADO *"
|
|
End If
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property IBANCorrecto As Boolean
|
|
Get
|
|
Return tsl5.Bancos.Genericas.IBANCorrecto(Me.IBAN.NothingAVacio)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property idSubAgente_Especial As Integer?
|
|
Get
|
|
If Me.idSubagente.HasValue AndAlso Me.CodigoAgente = "000047002186" Then
|
|
Dim bd As gestionasegasaEntities = Me.ObtieneContexto
|
|
Dim Codigo = Me.CodigoSubAgente.Substring(0, 2) & "00"
|
|
Dim subage = bd.subagentes.FirstOrDefault(Function(x) x.idAgente = Me.idAgente And x.Codigo = Codigo)
|
|
If subage IsNot Nothing Then
|
|
Return subage.idSubagente
|
|
Else
|
|
Return idSubagente
|
|
End If
|
|
Else
|
|
Return idSubagente
|
|
End If
|
|
End Get
|
|
End Property
|
|
'Public ReadOnly Property SubAgenteSuperior As String
|
|
' Get
|
|
' If Me.idSubagente.HasValue AndAlso Me.CodigoAgente = "000047002186" Then
|
|
' Dim bd As gestionasegasaEntities = Me.ObtieneContexto
|
|
' Dim Codigo = Me.CodigoSubAgente.Substring(0, 2) & "00"
|
|
' Dim subage = bd.subagentes.FirstOrDefault(Function(x) x.idAgente = Me.idAgente And x.Codigo = Codigo)
|
|
' If subage IsNot Nothing Then
|
|
' Return subage.Nombre
|
|
' Else
|
|
' Return SubAgente
|
|
' End If
|
|
' Else
|
|
' Return SubAgente
|
|
' End If
|
|
' End Get
|
|
'End Property
|
|
Public ReadOnly Property NumeroPolizaSuplementoLargo As String
|
|
Get
|
|
If Me.NumeroSuplemento = 0 Then
|
|
Return Me.NumeroPoliza
|
|
Else
|
|
Return Me.NumeroPoliza & " (" & Me.NumeroSuplemento.ToString & ")"
|
|
End If
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property NumeroPolizaSuplemento As String
|
|
Get
|
|
If Me.NumeroSuplemento = 0 Then
|
|
Return Me.NumeroPoliza
|
|
Else
|
|
Return Me.NumeroPoliza & "#" & Me.NumeroSuplemento.ToString
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property PrimeraDevolucionCia As liquidacionescompaniasrecibos
|
|
Get
|
|
Dim bd As gestionasegasaEntities = Me.ObtieneContexto
|
|
Return bd.liquidacionescompaniasrecibos.FirstOrDefault(Function(x) x.idRecibo = Me.idRecibo And x.liquidacionescompanias.enumeraciones.Codigo = "TIPLIQ.DEVUELTO")
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property FechaAsientoDevueltoCia As Date?
|
|
Get
|
|
If PrimeraDevolucionCia IsNot Nothing Then
|
|
Return PrimeraDevolucionCia.liquidacionescompanias.Fecha
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Get
|
|
End Property
|
|
End Class
|