agregado procesos y bd clases
This commit is contained in:
132
guia/informes/CarteraPerdida.vb
Normal file
132
guia/informes/CarteraPerdida.vb
Normal file
@@ -0,0 +1,132 @@
|
||||
Public Class CarteraPerdida
|
||||
|
||||
Public Shared Function GeneraExcelCarteraPerdidaEF(fi As Date, ff As Date) As Byte()
|
||||
Try
|
||||
Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContextoCN
|
||||
|
||||
Dim fai = fi.AddYears(-1)
|
||||
Dim faf = ff.AddYears(-1)
|
||||
' Dim idTippcia = bd.enumeraciones.First(Function(x) x.Codigo = "TIPP.CIA").idEnumeracion
|
||||
Dim idLiquidacion = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.LIQUIDACION").idEnumeracion
|
||||
Dim idLiquidacioncia = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.PGDO.CIA").idEnumeracion
|
||||
|
||||
Dim iddevuelto = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.DEVUELTO").idEnumeracion
|
||||
Dim idDescobro = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.DESCOBRO").idEnumeracion
|
||||
Dim idCabaPGO = bd.enumeraciones.First(Function(x) x.Codigo = "CABA.PGO").idEnumeracion
|
||||
Dim idCabaFP = bd.enumeraciones.First(Function(x) x.Codigo = "CABA.FP").idEnumeracion
|
||||
Dim idTrex = bd.enumeraciones.First(Function(x) x.Codigo = "TRC.EX").idEnumeracion
|
||||
Dim idTrcx = bd.enumeraciones.First(Function(x) x.Codigo = "TRC.CX").idEnumeracion
|
||||
Dim idDuru = bd.enumeraciones.First(Function(x) x.Codigo = "DUR.U").idEnumeracion
|
||||
' Dim idDura = bd.enumeraciones.First(Function(x) x.Codigo = "DUR.A").idEnumeracion
|
||||
' Dim cabas = bd.enumeraciones.Where(Function(x) x.Codigo = "CABA.AGEN" Or x.Codigo = "CABA.CIA" Or x.Codigo = "CABA.SIN" Or x.Codigo = "CABA.ASEG" Or x.Codigo = "CABA.VTA" Or x.Codigo = "CABA.BJA" Or x.Codigo = "CABA.ASFP" Or x.Codigo = "CABA.RPZO" Or x.Codigo = "CABA.SUPL").Select(Function(x) x.idEnumeracion).ToArray
|
||||
Dim lr As New List(Of ReciboCarteraPerdida)
|
||||
Dim ps = bd.polizassg.Select(Function(x) New With {.idpoliza = x.idPoliza, .idDuracion = x.idDuracion, .idCausaBaja = x.idCausaBaja, .FechaBaja = x.FechaBaja, .NumeroPoliza = x.NumeroPoliza, .idCompania = x.idCompania, .NumeroSuplemento = x.NumeroSuplemento, .FechaVencimiento = x.FechaVencimiento}).ToList
|
||||
' Dim POLS = (From p In ps Where p.NumeroPoliza IsNot Nothing Group By PolizaCia = New With {Key p.NumeroPoliza, Key p.idCompania} Into Gr = Group).Select(Function(x) x.Gr.OrderByDescending(Function(Y) Y.NumeroSuplemento).FirstOrDefault).Where(Function(X) X.FechaBaja.HasValue = False OrElse (X.idDuracion <> idDura And X.idCausaBaja.HasValue AndAlso X.idCausaBaja = idCabaFP) OrElse (X.idCausaBaja.HasValue AndAlso cabas.Contains(X.idCausaBaja) = False)).ToList
|
||||
Dim POLS = (From p In ps Where p.NumeroPoliza IsNot Nothing Group By PolizaCia = New With {Key p.NumeroPoliza, Key p.idCompania} Into Gr = Group).Select(Function(x) x.Gr.OrderByDescending(Function(Y) Y.NumeroSuplemento).FirstOrDefault).Where(Function(X) X.FechaBaja.HasValue = False OrElse (X.idCausaBaja.HasValue AndAlso X.idCausaBaja = idCabaFP)).ToList
|
||||
Dim recsex = bd.vf_recibosextendidos.Where(Function(x) x.FechaEfecto >= fai And x.FechaEfecto <= faf And x.idTipo <> idTrex And x.idTipo <> idTrcx And x.idDuracion <> idDuru).Select(Function(x) New With {.idRecibo = x.idRecibo, .Tomador = x.Tomador}).ToList
|
||||
Dim recsant = bd.recibos.Where(Function(x) x.FechaEfecto >= fai And x.FechaEfecto <= faf And x.idTipo <> idTrex And x.idTipo <> idTrcx And x.polizassg.idDuracion <> idDuru _
|
||||
And (x.liquidacionescompaniasrecibos.Any(Function(y) y.liquidacionescompanias.idTipoLiquidacion = idLiquidacion Or y.liquidacionescompanias.idTipoLiquidacion = idLiquidacioncia) _
|
||||
Or (x.liquidacionescompaniasrecibos.Any(Function(y) y.liquidacionescompanias.idTipoLiquidacion = iddevuelto And x.idCausaBaja = idCabaPGO)))) _
|
||||
.Select(Function(x) New ReciboCarteraPerdida With {.NumeroPoliza = x.polizassg.NumeroPoliza,
|
||||
.idRecibo = x.idRecibo,
|
||||
.idCompañia = x.polizassg.idCompania,
|
||||
.Compañía = x.polizassg.companias.Nombre,
|
||||
.Ramo = x.polizassg.ramos.Descripcion,
|
||||
.FechaEfecto = x.FechaEfecto,
|
||||
.Observaciones = x.polizassg.Observaciones}).ToList
|
||||
|
||||
|
||||
Dim recs = bd.recibos.Where(Function(x) x.FechaEfecto >= fi And x.FechaEfecto <= ff And x.TotalRecibo > 0 And x.polizassg.idDuracion <> idDuru).Select(Function(x) New ReciboCarteraPerdida With {.NumeroPoliza = x.polizassg.NumeroPoliza,
|
||||
.idRecibo = x.idRecibo,
|
||||
.idCompañia = x.polizassg.idCompania,
|
||||
.Compañía = x.polizassg.companias.Nombre,
|
||||
.Ramo = x.polizassg.ramos.Descripcion,
|
||||
.FechaEfecto = x.FechaEfecto,
|
||||
.Observaciones = x.polizassg.Observaciones}).ToList
|
||||
|
||||
Dim flim = Today.AddYears(-1)
|
||||
For Each r In recsant
|
||||
If lr.Any(Function(X) X.NumeroPoliza = r.NumeroPoliza And X.idCompañia = r.idCompañia) = False AndAlso recs.Any(Function(x) x.NumeroPoliza = r.NumeroPoliza And x.idCompañia = r.idCompañia) = False AndAlso POLS.Any(Function(x) x.NumeroPoliza = r.NumeroPoliza And x.idCompania = r.idCompañia And Not (x.idDuracion = idDuru And x.FechaVencimiento < flim)) Then
|
||||
r.Tomador = recsex.First(Function(x) x.idRecibo = r.idRecibo).Tomador
|
||||
lr.Add(r)
|
||||
End If
|
||||
Next
|
||||
If lr.Count > 0 Then
|
||||
Dim lrd = lr.OrderBy(Function(x) x.Compañía).ThenBy(Function(x) x.Ramo).Select(Function(x) New With {x.NumeroPoliza, x.Compañía, x.Ramo, x.Tomador, .FechaEfectoUltimoRecibo = x.FechaEfecto, .Observaciones = x.Observaciones}).ToList
|
||||
Dim b = tsWPF.Utilidades.Varias.IEnumerableAExcel(lrd)
|
||||
Return b
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GeneraExcelCarteraPerdida(fi As Date) As Byte()
|
||||
Try
|
||||
Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContextoCN
|
||||
Dim idLiquidacion = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.LIQUIDACION").idEnumeracion
|
||||
Dim idLiquidacioncia = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.PGDO.CIA").idEnumeracion
|
||||
|
||||
Dim iddevuelto = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.DEVUELTO").idEnumeracion
|
||||
Dim idDescobro = bd.enumeraciones.First(Function(x) x.Codigo = "TIPLIQ.DESCOBRO").idEnumeracion
|
||||
Dim idTrex = bd.enumeraciones.First(Function(x) x.Codigo = "TRC.EX").idEnumeracion
|
||||
Dim idTrcx = bd.enumeraciones.First(Function(x) x.Codigo = "TRC.CX").idEnumeracion
|
||||
Dim idDuru = bd.enumeraciones.First(Function(x) x.Codigo = "DUR.U").idEnumeracion
|
||||
Dim lr As New List(Of ReciboCarteraPerdida)
|
||||
Dim ps = bd.polizassg.Select(Function(x) New With {.idpoliza = x.idPoliza, .idDuracion = x.idDuracion, .idCausaBaja = x.idCausaBaja, .FechaBaja = x.FechaBaja, .NumeroPoliza = x.NumeroPoliza, .idCompania = x.idCompania, .NumeroSuplemento = x.NumeroSuplemento, .FechaVencimiento = x.FechaVencimiento}).ToList
|
||||
Dim POLS = (From p In ps Where p.NumeroPoliza IsNot Nothing Group By PolizaCia = New With {Key p.NumeroPoliza, Key p.idCompania} Into Gr = Group).Select(Function(x) x.Gr.OrderByDescending(Function(Y) Y.NumeroSuplemento).FirstOrDefault).Where(Function(X) X.FechaBaja.HasValue = False).ToList
|
||||
Dim recsex = bd.vf_recibosextendidos.Where(Function(x) x.FechaEfecto >= fi And x.idTipo <> idTrex And x.idTipo <> idTrcx And x.idDuracion <> idDuru).Select(Function(x) New With {.idRecibo = x.idRecibo, .Tomador = x.Tomador, .NumeroPoliza = x.NumeroPoliza, .idCompania = x.idCompania, .FechaVencimiento = x.FechaVencimiento}).ToList
|
||||
Dim recsant = bd.recibos.Where(Function(x) x.FechaEfecto >= fi And x.FechaVencimiento <= Today And x.idTipo <> idTrex And x.idTipo <> idTrcx And x.polizassg.idDuracion <> idDuru) _
|
||||
.Select(Function(x) New ReciboCarteraPerdida With {.NumeroPoliza = x.polizassg.NumeroPoliza,
|
||||
.idRecibo = x.idRecibo,
|
||||
.idCompañia = x.polizassg.idCompania,
|
||||
.Compañía = x.polizassg.companias.Nombre,
|
||||
.Ramo = x.polizassg.ramos.Descripcion,
|
||||
.FechaEfecto = x.FechaEfecto,
|
||||
.FechaVencimiento = x.FechaVencimiento,
|
||||
.Observaciones = x.polizassg.Observaciones}).ToList
|
||||
Dim DentroUnMes As Date = fi.AddMonths(13)
|
||||
Dim recs = bd.recibos.Where(Function(x) x.FechaVencimiento >= DentroUnMes And x.TotalRecibo > 0 And x.polizassg.idDuracion <> idDuru).Select(Function(x) New ReciboCarteraPerdida With {.NumeroPoliza = x.polizassg.NumeroPoliza,
|
||||
.idRecibo = x.idRecibo,
|
||||
.idCompañia = x.polizassg.idCompania,
|
||||
.Compañía = x.polizassg.companias.Nombre,
|
||||
.Ramo = x.polizassg.ramos.Descripcion,
|
||||
.FechaEfecto = x.FechaEfecto,
|
||||
.Observaciones = x.polizassg.Observaciones}).ToList
|
||||
|
||||
Dim flimduru = fi.AddYears(-1)
|
||||
For Each r In recsant
|
||||
If lr.Any(Function(X) X.NumeroPoliza = r.NumeroPoliza And X.idCompañia = r.idCompañia) = False AndAlso recs.Any(Function(x) x.NumeroPoliza = r.NumeroPoliza And x.idCompañia = r.idCompañia) = False AndAlso POLS.Any(Function(x) x.NumeroPoliza = r.NumeroPoliza And x.idCompania = r.idCompañia And Not (x.idDuracion = idDuru And x.FechaVencimiento < flimduru)) Then
|
||||
If recsex.Any(Function(x) x.NumeroPoliza = r.NumeroPoliza AndAlso x.idCompania = r.idCompañia AndAlso x.idRecibo <> r.idRecibo AndAlso x.FechaVencimiento > r.fechaVencimiento) = False Then
|
||||
r.Tomador = recsex.First(Function(x) x.idRecibo = r.idRecibo).Tomador
|
||||
lr.Add(r)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If lr.Count > 0 Then
|
||||
Dim lrd = lr.OrderBy(Function(x) x.Compañía).ThenBy(Function(x) x.Ramo).Select(Function(x) New With {x.NumeroPoliza, x.Compañía, x.Ramo, x.Tomador, .FechaEfectoUltimoRecibo = x.FechaEfecto, .Observaciones = x.Observaciones}).ToList
|
||||
Dim b = tsWPF.Utilidades.Varias.IEnumerableAExcel(lrd)
|
||||
Return b
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Class ReciboCarteraPerdida
|
||||
Public Property idRecibo As String
|
||||
Public Property NumeroPoliza As String
|
||||
Public Property idCompañia As Integer
|
||||
Public Property Compañía As String
|
||||
Public Property Ramo As String
|
||||
Public Property Tomador As String
|
||||
Public Property FechaEfecto As Date
|
||||
Public Property FechaVencimiento As Date
|
||||
Public Property Observaciones As String
|
||||
End Class
|
||||
End Class
|
||||
40
guia/informes/CartillaSeguroGenerales.vb
Normal file
40
guia/informes/CartillaSeguroGenerales.vb
Normal file
@@ -0,0 +1,40 @@
|
||||
Public Class CartillaSeguroGenerales
|
||||
Property Rso As String
|
||||
Property Cif As String
|
||||
Property PolizasEntidad As List(Of PolizaGeneral)
|
||||
Property NumDePolizas As Integer
|
||||
Property TotalPagados As Double
|
||||
Property TotalAnulados As Double
|
||||
Property TotalCia As Double
|
||||
Property TotalPendiente As Double
|
||||
Property Cia As String
|
||||
|
||||
End Class
|
||||
Public Class SiniestroGeneral
|
||||
Property IdSiniestro As Integer
|
||||
Property RefCompania As String
|
||||
Property DescripcionSiniestro As String
|
||||
Property DanoCliente As String
|
||||
Property DanoContrario As String
|
||||
Property Culpabilidad As String
|
||||
Property FechaSiniestro As String
|
||||
End Class
|
||||
Public Class PolizaGeneral
|
||||
Property NumeroPoliza As String
|
||||
Property Ramo As String
|
||||
Property Compañia As String
|
||||
Property RecibosPolizas As List(Of ReciboPoliza)
|
||||
Property SiniestrosEntidad As List(Of SiniestroGeneral)
|
||||
End Class
|
||||
Public Class ReciboPoliza
|
||||
Property FechaEfecto As Date
|
||||
Property FechaVencimiento As Date?
|
||||
Property Importe As Double
|
||||
Property Matricula As String
|
||||
Property Duracion As String
|
||||
Property TipoPago As String
|
||||
Property FechaPago As String
|
||||
Property CausaBaja As String
|
||||
Property FechaBaja As String
|
||||
Property BienesAsegurados As String
|
||||
End Class
|
||||
2684
guia/informes/CombinacionCorrespondencia.vb
Normal file
2684
guia/informes/CombinacionCorrespondencia.vb
Normal file
File diff suppressed because it is too large
Load Diff
14
guia/informes/CombinacionCorrespondenciaPagosTelematicos.vb
Normal file
14
guia/informes/CombinacionCorrespondenciaPagosTelematicos.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Public Class CombinacionCorrespondenciaPagosTelematicos
|
||||
|
||||
Property NumeroOperacion As String
|
||||
Property FechaOperacion As String
|
||||
Property Importe As String
|
||||
Property Referencia As String
|
||||
|
||||
Property RazonSocial As String
|
||||
|
||||
Property DNI As String
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
36
guia/informes/DetallesPoliza.vb
Normal file
36
guia/informes/DetallesPoliza.vb
Normal file
@@ -0,0 +1,36 @@
|
||||
Public Class DetallesPoliza
|
||||
Property NumeroPropuesta As String
|
||||
Property Compania As String
|
||||
Property NumeroPoliza As String
|
||||
Property NumeroSuplemento As String
|
||||
Property FechaEnvioCompania As String
|
||||
Property FechaRecibidoCompania As String
|
||||
Property Duracion As String
|
||||
Property FechaEfecto As String
|
||||
Property FechaVencimiento As String
|
||||
Property FechaBaja As String
|
||||
Property CausaBaja As String
|
||||
Property Ramo As String
|
||||
Property Agente As String
|
||||
Property SubAgente As String
|
||||
Property BienesAsegurados As String
|
||||
Property Matricula As String
|
||||
Property Coberturas As String
|
||||
Property Garantias As String
|
||||
Property DescripcionSumplemento As String
|
||||
Property FechaAceptacionPropuesta As String
|
||||
Property SuplementoRechazdoPorCompania As String
|
||||
Property Observaciones As String
|
||||
Property Usuario As String
|
||||
Property FechaAlta As String
|
||||
Property TipoPago As String
|
||||
Property IBAN As String
|
||||
Property FechaMandato As String
|
||||
Property TipoCobro As String
|
||||
Property Directorio As String
|
||||
Property Tomador As List(Of entidades)
|
||||
Property OtroAsegurado As List(Of entidades)
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
20
guia/informes/DifPolSup.vb
Normal file
20
guia/informes/DifPolSup.vb
Normal file
@@ -0,0 +1,20 @@
|
||||
Public Class DifPolSup
|
||||
Property Compania As String
|
||||
Property TomadorActual As String
|
||||
Property NumPoliza As String
|
||||
Property NumPropuesta As String
|
||||
Property Ramo As String
|
||||
Property Matricula As String
|
||||
Property NumSuplemento As String
|
||||
Property ModEnPoliza As List(Of Modificacion)
|
||||
Property ModEnAsegurados As List(Of Modificacion)
|
||||
Property Aclaracion1 As String
|
||||
Property Aclaracion2 As String
|
||||
|
||||
End Class
|
||||
Public Class Modificacion
|
||||
Property Concepto As String
|
||||
Property ValorNuevo As String
|
||||
|
||||
|
||||
End Class
|
||||
66
guia/informes/Informes.vb
Normal file
66
guia/informes/Informes.vb
Normal file
@@ -0,0 +1,66 @@
|
||||
Imports DevExpress.XtraReports.UI
|
||||
Imports DevExpress.Xpf.Printing
|
||||
Imports System.Data.Objects
|
||||
Imports System.IO
|
||||
|
||||
Public Class Informes
|
||||
Public Shared Sub ImprimeInforme(xr As XtraReport, Datos As Object, ImpresoraPredeterminada As Boolean)
|
||||
For Each pr In xr.Parameters
|
||||
pr.Visible = False
|
||||
Next
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument(True)
|
||||
If ImpresoraPredeterminada Then
|
||||
xr.Print()
|
||||
Else
|
||||
xr.PrintDialog()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Function GeneraXLSX(xr As XtraReport, Datos As Object) As IO.MemoryStream
|
||||
Dim ms As New IO.MemoryStream
|
||||
For Each pr In xr.Parameters
|
||||
pr.Visible = False
|
||||
Next
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument(True)
|
||||
xr.ExportToXlsx(ms)
|
||||
Return ms
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GeneraPDF(bd As bdGestionAsegasa.gestionasegasaEntities, idPlantilla As Integer, Datasource As Object) As MemoryStream
|
||||
Try
|
||||
If idPlantilla = 0 Then Throw New Exception("Seleccione primero la plantilla a imprimir")
|
||||
Dim xr As New XtraReport
|
||||
|
||||
Dim qr As ObjectQuery(Of plantillas) = bd.plantillas
|
||||
qr.MergeOption = MergeOption.OverwriteChanges
|
||||
|
||||
Dim pl = qr.Where(Function(x) x.idPlantilla = idPlantilla).First
|
||||
Dim s As String = System.Text.Encoding.UTF8.GetString(pl.ficheros.Fichero)
|
||||
Using sw As New StreamWriter(New MemoryStream())
|
||||
sw.Write(s)
|
||||
sw.Flush()
|
||||
xr = XtraReport.FromStream(sw.BaseStream, True)
|
||||
End Using
|
||||
Try
|
||||
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").First
|
||||
pr.Value = bdGestionAsegasa.Utilidades.AhoraMysql(bd)
|
||||
pr.Visible = False
|
||||
Catch
|
||||
End Try
|
||||
xr.DataSource = Datasource
|
||||
xr.CreateDocument(True)
|
||||
Dim ms As New IO.MemoryStream
|
||||
xr.ExportToPdf(ms)
|
||||
Return ms
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
19
guia/informes/InformesAgrarios.vb
Normal file
19
guia/informes/InformesAgrarios.vb
Normal file
@@ -0,0 +1,19 @@
|
||||
Public Class InformesAgrarios
|
||||
Property DatosLineas As List(Of LinInformesAgrarios)
|
||||
End Class
|
||||
Public Class LinInformesAgrarios
|
||||
Property CodLinea As String
|
||||
Property GruLinea As String
|
||||
Property DesLinea As String
|
||||
Property Compania As String
|
||||
Property NumPolizas As Integer
|
||||
Property PrimaNetaCalculo As Double
|
||||
Property ComAsegasa As Double
|
||||
Property ComAgentes As Double
|
||||
Property ComAsegasaPrev As Double
|
||||
Property ComAgentesPrev As Double
|
||||
Property TotComCob As Double
|
||||
Property TotComPrev As Double
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user