79 lines
3.1 KiB
C#
79 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using bdAsegasa.dbcontext;
|
|
|
|
namespace bdAsegasa.db
|
|
{
|
|
public partial class vf_recibosextendidos_ti
|
|
{
|
|
private static List<enumeraciones> _tiposPago;
|
|
|
|
public string Situacion_Web => gestionasegasaEntities.ObtieneSituacionWeb(this.idSituacion, this.idTipoPago);
|
|
public string CiaNumeroPoliza => $"{this.Compania}/{this.NumeroPoliza}";
|
|
|
|
public recibos.EstadoRecibo Estado
|
|
{
|
|
get
|
|
{
|
|
var est = recibos.EstadoRecibo.PENDIENTE;
|
|
if (this.idRemesa.HasValue) est = recibos.EstadoRecibo.REMESADO;
|
|
if (this.idTipoPago == 1 /* TipoPagoCia */ || this.idTipoPago == 2 /* TipoPagoFAE */) est = recibos.EstadoRecibo.GESTION_COBRO_CIA;
|
|
if (this.FechaLiquidacionAgente.HasValue) est = recibos.EstadoRecibo.LIQUIDADO;
|
|
if (this.FechaBaja.HasValue && this.idCausaBaja != 10 && this.idCausaBaja != 11) est = recibos.EstadoRecibo.BAJA;
|
|
if (this.FechaDevolucionBanco.HasValue) est = recibos.EstadoRecibo.DEVUELTO_BANCO;
|
|
return est;
|
|
}
|
|
}
|
|
|
|
public string EstadoRecibo => Estado.ToString().Replace("_", " ");
|
|
|
|
public string TipoPago
|
|
{
|
|
get
|
|
{
|
|
if (this.idTipoPago.HasValue)
|
|
{
|
|
if (_tiposPago == null)
|
|
{
|
|
var bdtmp = tscgestionasegasa.NuevoContexto();
|
|
_tiposPago = bdtmp.enumeraciones
|
|
.Where(x => x.idGrupoEnumeracionNavigation.Grupo == "TIPP")
|
|
.ToList();
|
|
}
|
|
|
|
var tp = _tiposPago.FirstOrDefault(x => x.idEnumeracion == this.idTipoPago);
|
|
|
|
return tp == null ? "* DESCONOCIDO *" : tp.Descripcion;
|
|
}
|
|
else
|
|
{
|
|
return "* NO ASIGNADO *";
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool IBANCorrecto => tsUtilidades.Bancos.Genericas.IBANCorrecto(this.IBAN);
|
|
|
|
public int? idSubAgente_Especial
|
|
{
|
|
get
|
|
{
|
|
if (this.idSubagente.HasValue && this.CodigoAgente == "000047002186")
|
|
{
|
|
using (var bd = tscgestionasegasa.NuevoContexto())
|
|
{
|
|
var codigoBase = this.CodigoSubAgente.Substring(0, 2) + "00";
|
|
var subage = bd.subagentes.FirstOrDefault(x => x.idAgente == this.idAgente && x.Codigo == codigoBase);
|
|
return subage?.idSubagente ?? this.idSubagente;
|
|
}
|
|
}
|
|
return this.idSubagente;
|
|
}
|
|
}
|
|
|
|
public string NumeroPolizaSuplementoLargo => (this.NumeroSuplemento == 0) ? this.NumeroPoliza : $"{this.NumeroPoliza} ({this.NumeroSuplemento})";
|
|
public string NumeroPolizaSuplemento => (this.NumeroSuplemento == 0) ? this.NumeroPoliza : $"{this.NumeroPoliza}#{this.NumeroSuplemento}";
|
|
}
|
|
}
|