-option explcit

This commit is contained in:
2023-11-01 16:03:05 -07:00
parent 7074b5e5d3
commit 46d9e8b5d6

View File

@@ -382,13 +382,13 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub End Sub
Private Sub CargaDatosInformativos() Private Sub CargaDatosInformativos()
Dim Altas = 0 Dim Altas As Integer = 0
Dim Interbancarias = 0 Dim Interbancarias As Integer = 0
Dim Bancomer = 0 Dim Bancomer As Integer = 0
Dim Movimientos = 0
Dim Importe = 0.0
Dim Movimientos As Integer = 0
Dim Importe As Decimal = 0
For Each dr As DataRow In DTPendientes.Rows For Each dr As DataRow In DTPendientes.Rows
If dr("EstatusCtaDeposito").ToString <> "True" Then If dr("EstatusCtaDeposito").ToString <> "True" Then
@@ -405,7 +405,7 @@ Partial Class Bancos_PagoElectronicoGrupos
ElseIf dr("CveCuentaDeposito").ToString.ToEntero > 0 Then ElseIf dr("CveCuentaDeposito").ToString.ToEntero > 0 Then
Movimientos += 1 Movimientos += 1
Importe += dr("Abonado").ToString.ToDouble Importe += dr("Abonado").ToString.ToDecimal
End If End If
Next Next
@@ -650,8 +650,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveBLE As Integer = CType(sender, LinkButton).CommandArgument.ToEntero
Dim CveBLE = CType(sender, LinkButton).CommandArgument.ToEntero
Dim Cvecuenta As Integer = GvRow.DataKey("CveCuenta").ToEntero Dim Cvecuenta As Integer = GvRow.DataKey("CveCuenta").ToEntero
Dim CveLayoutEnvio As Integer = GvRow.DataKey("CveLayoutEnvio").ToEntero Dim CveLayoutEnvio As Integer = GvRow.DataKey("CveLayoutEnvio").ToEntero
@@ -735,28 +734,18 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim RegistrosAltaBancomerCIE As New StringBuilder Dim RegistrosAltaBancomerCIE As New StringBuilder
Dim RegistrosAltaInterbancario As New StringBuilder Dim RegistrosAltaInterbancario As New StringBuilder
Dim SBErrores As New StringBuilder Dim SBErrores As New StringBuilder
Dim CeroRelleno As Char = "0"c Dim CeroRelleno As Char = "0"c
Dim EspacioRelleno As Char = Chr(32) Dim EspacioRelleno As Char = Chr(32)
Dim ErrorLayout = False Dim ErrorLayout As Boolean = False
If DtCuentasPendientesTemp Is Nothing Then If DtCuentasPendientesTemp Is Nothing Then
DtCuentasPendientesTemp = DTPendientes.Copy DtCuentasPendientesTemp = DTPendientes.Copy
End If End If
DtCuentasPendientesTemp.CaseSensitive = False DtCuentasPendientesTemp.CaseSensitive = False
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' AND CveBanco = '012' AND LEN(CIE) = 0) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"}) Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' AND CveBanco = '012' AND LEN(CIE) = 0) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"})
Dim DtCuentasPendientesCIE As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' AND LEN(CIE) > 0 AND CveBanco = '012') ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"}) Dim DtCuentasPendientesCIE As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' AND LEN(CIE) > 0 AND CveBanco = '012') ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"})
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"}) Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"})
'Cuentas bancomer 'Cuentas bancomer
If DtCuentasPendientesBancomer.Rows.Count > 0 Then If DtCuentasPendientesBancomer.Rows.Count > 0 Then
For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows
@@ -1078,7 +1067,7 @@ Partial Class Bancos_PagoElectronicoGrupos
'Persona Moral 'Persona Moral
If DTPendienteActual(0)("RFC").ToString.Length = 12 Then If DTPendienteActual(0)("RFC").ToString.Length = 12 Then
Dim fecha As String = DTPendienteActual(0)("FechaIng").ToString Dim fecha As String = DTPendienteActual(0)("FechaIng").ToString
Dim NombreProveedor = DTPendienteActual(0)("RazonSocial").ToString.Replace("‚"c, Vacio).Replace("‚"c, Vacio).ToUpper.PadRight(50) Dim NombreProveedor As String = DTPendienteActual(0)("RazonSocial").ToString.Replace("‚"c, Vacio).Replace("‚"c, Vacio).ToUpper.PadRight(50)
NombreProveedor = If(NombreProveedor.Length > 50, NombreProveedor.Substring(0, 50), NombreProveedor) NombreProveedor = If(NombreProveedor.Length > 50, NombreProveedor.Substring(0, 50), NombreProveedor)
'Campo 18-20 del detalle 'Campo 18-20 del detalle
@@ -1115,7 +1104,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim NombreComplejo As New List(Of String) Dim NombreComplejo As New List(Of String)
'ignoramos cualquier palabra del nombre que tenga un length igual o menor a 2 'ignoramos cualquier palabra del nombre que tenga un length igual o menor a 2
For index = 0 To Nombre.Length - 1 For index As Integer = 0 To Nombre.Length - 1
If Nombre(index).Length > 2 Then If Nombre(index).Length > 2 Then
NombreComplejo.Add(Nombre(index)) NombreComplejo.Add(Nombre(index))
End If End If
@@ -1128,10 +1117,10 @@ Partial Class Bancos_PagoElectronicoGrupos
ElseIf NombreComplejo.Count = 4 Then ElseIf NombreComplejo.Count = 4 Then
DetalleTexto &= String.Format("F{0}{1}{2}{3}", Vacio.PadRight(70), (NombreComplejo.Item(0) & " " & NombreComplejo.Item(1)).PadRight(20).Substring(0, 20), NombreComplejo.Item(2).PadRight(20).Substring(0, 20), NombreComplejo.Item(3).PadRight(20).Substring(0, 20)) DetalleTexto &= String.Format("F{0}{1}{2}{3}", Vacio.PadRight(70), (NombreComplejo.Item(0) & " " & NombreComplejo.Item(1)).PadRight(20).Substring(0, 20), NombreComplejo.Item(2).PadRight(20).Substring(0, 20), NombreComplejo.Item(3).PadRight(20).Substring(0, 20))
ElseIf NombreComplejo.Count > 4 Then ElseIf NombreComplejo.Count > 4 Then
Dim Nombres = "" Dim Nombres As String = ""
'todas las palabras menos las 2 ultimas forman parte del nombre 'todas las palabras menos las 2 ultimas forman parte del nombre
For index = 0 To NombreComplejo.Count - 3 For index As Integer = 0 To NombreComplejo.Count - 3
If Nombres <> "" Then Nombres += " " If Nombres <> "" Then Nombres += " "
Nombres += NombreComplejo.Item(index) Nombres += NombreComplejo.Item(index)
Next Next
@@ -1167,7 +1156,7 @@ Partial Class Bancos_PagoElectronicoGrupos
HeaderTexto &= String.Format("{0}{1}", IdentificadoUsuario, NowADS().ToString("yyyyMMdd")).PadRight(20) HeaderTexto &= String.Format("{0}{1}", IdentificadoUsuario, NowADS().ToString("yyyyMMdd")).PadRight(20)
'Campos #6-8 del Header 'Campos #6-8 del Header
HeaderTexto &= String.Format("00").PadRight(586) HeaderTexto &= String.Format("00").PadRight(586)
Dim HeaderLength = HeaderTexto.Length Dim HeaderLength As Integer = HeaderTexto.Length
''''' LLENADO DE TRAILER ''''' LLENADO DE TRAILER
TrailerTexto = String.Format("T{0}{1}{2}", Registros.ToString.PadLeft(10, PadCeros), Vacio.PadRight(50, PadCeros), Vacio.PadRight(575)) TrailerTexto = String.Format("T{0}{1}{2}", Registros.ToString.PadLeft(10, PadCeros), Vacio.PadRight(50, PadCeros), Vacio.PadRight(575))
@@ -1206,7 +1195,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim EsCIE As Boolean = False Dim EsCIE As Boolean = False
Dim CeroRelleno As Char = "0"c Dim CeroRelleno As Char = "0"c
Dim EspacioRelleno As Char = Chr(32) Dim EspacioRelleno As Char = Chr(32)
Dim ErrorLayout = False Dim ErrorLayout As Boolean = False
For Each drow As DataRow In DTPendientesTemp.Rows For Each drow As DataRow In DTPendientesTemp.Rows
@@ -1422,7 +1411,7 @@ Partial Class Bancos_PagoElectronicoGrupos
ObjBancos.IniciaTransacSQL() ObjBancos.IniciaTransacSQL()
Dim CveLayoutEnvio = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True) Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True)
If CveLayoutEnvio > 0 Then If CveLayoutEnvio > 0 Then
For Each dr As DataRow In DTPendientesTemp.Rows For Each dr As DataRow In DTPendientesTemp.Rows
@@ -1646,7 +1635,7 @@ Partial Class Bancos_PagoElectronicoGrupos
''CLAVE DE REGISTRO PARA CONTROL PROPIO ADSISTEMAS -- orita se esta guardando en el campo #9 ''CLAVE DE REGISTRO PARA CONTROL PROPIO ADSISTEMAS -- orita se esta guardando en el campo #9
Dim Cve = String.Format("CVEIE{0}", DTPendienteActual(0)("CveIE").ToString).ToUpper 'cveIE Dim Cve As String = String.Format("CVEIE{0}", DTPendienteActual(0)("CveIE").ToString).ToUpper 'cveIE
''''' LLENADO DE DETALLE ''''' LLENADO DE DETALLE
@@ -1670,17 +1659,15 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
'OBTENEMOS EL CORREO DEL PROVEEDOR 'OBTENEMOS EL CORREO DEL PROVEEDOR
Dim Correo = CorreoNotificacionesEmpresa.ToUpper.PadRight(50) Dim Correo As String = CorreoNotificacionesEmpresa.ToUpper.PadRight(50)
'Correo = If(Correo.Length > 0, Correo.ToUpper.PadRight(50), Vacio.PadRight(50)) 'Correo = If(Correo.Length > 0, Correo.ToUpper.PadRight(50), Vacio.PadRight(50))
'Campos 24-50 del Detalle 0 1 2 3 4 5 6 7 8 9 'Campos 24-50 del Detalle 0 1 2 3 4 5 6 7 8 9
DetalleTexto &= String.Format("{0}{1}FA{2}{3}01{4}N{5}{6}{7}{7}{7}{6}N {7}700{8}{9}{7}", Divisa, Vacio.PadLeft(20), Importe.FormatoNumero.Replace(",", "").Replace(".", "").PadLeft(15, PadCeros), Vacio.PadRight(15, PadCeros), Correo, Vacio.PadRight(12, PadCeros), NowADS().ToString("yyyy-MM-dd"), "0001-01-01", Observaciones.PadRight(700), Vacio.PadRight(52)) DetalleTexto &= String.Format("{0}{1}FA{2}{3}01{4}N{5}{6}{7}{7}{7}{6}N {7}700{8}{9}{7}", Divisa, Vacio.PadLeft(20), Importe.FormatoNumero.Replace(",", "").Replace(".", "").PadLeft(15, PadCeros), Vacio.PadRight(15, PadCeros), Correo, Vacio.PadRight(12, PadCeros), NowADS().ToString("yyyy-MM-dd"), "0001-01-01", Observaciones.PadRight(700), Vacio.PadRight(52))
TotalAcumulado += Importe.ToDouble TotalAcumulado += Importe.ToDouble
''LLENA DTPAGOS PARA REPORTE ''LLENA DTPAGOS PARA REPORTE
Dim Row = DtPago.NewRow() Dim Row As DataRow = DtPago.NewRow()
Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString
If DTPendienteActual(0)("CIE").ToString <> "" Then If DTPendienteActual(0)("CIE").ToString <> "" Then
@@ -1778,31 +1765,17 @@ Partial Class Bancos_PagoElectronicoGrupos
NombreArchivoBancomer = "" NombreArchivoBancomer = ""
NombreArchivoInterbancario = "" NombreArchivoInterbancario = ""
NombreArchivo = "" NombreArchivo = ""
Dim RegistrosAltaBancomer As New StringBuilder Dim RegistrosAltaBancomer As New StringBuilder
Dim RegistrosAltaInterbancario As New StringBuilder Dim RegistrosAltaInterbancario As New StringBuilder
Dim SBErrores As New StringBuilder Dim SBErrores As New StringBuilder
Dim CeroRelleno As Char = "0"c Dim CeroRelleno As Char = "0"c
Dim EspacioRelleno As Char = Chr(32) Dim EspacioRelleno As Char = Chr(32)
Dim ErrorLayout = False Dim ErrorLayout As Boolean = False
If DtCuentasPendientesTemp Is Nothing Then If DtCuentasPendientesTemp Is Nothing Then
DtCuentasPendientesTemp = DTFyE.Copy DtCuentasPendientesTemp = DTFyE.Copy
End If End If
DtCuentasPendientesTemp.CaseSensitive = False DtCuentasPendientesTemp.CaseSensitive = False
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "CveBanco", "Cuenta", "BBVAAlias"}) Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "CveBanco", "Cuenta", "BBVAAlias"})
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "CveBanco", "Cuenta", "BBVAAlias"}) Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "CveBanco", "Cuenta", "BBVAAlias"})
'CLABEDestino 'CLABEDestino
@@ -2041,8 +2014,8 @@ Partial Class Bancos_PagoElectronicoGrupos
Private Sub CargaReporte() Private Sub CargaReporte()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") Dim FechaI As String = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") Dim FechaF As String = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
If ObjBancos.GetLayoutPagosEnviados(DdlCuentaReportes.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlTipoReportes.SelectedValue, FechaI, DateAdd(DateInterval.Day, 1, FechaF.ToDate).ToShortDateString, PorGrupos:=True) Then If ObjBancos.GetLayoutPagosEnviados(DdlCuentaReportes.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlTipoReportes.SelectedValue, FechaI, DateAdd(DateInterval.Day, 1, FechaF.ToDate).ToShortDateString, PorGrupos:=True) Then
DTReportes = ObjBancos.DtResultados DTReportes = ObjBancos.DtResultados
@@ -2511,8 +2484,8 @@ Partial Class Bancos_PagoElectronicoGrupos
Private Sub CargaEnviados() Private Sub CargaEnviados()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
Dim FechaI = If(IsDate(txtFechaIEnviados.Text.Trim()), txtFechaIEnviados.Text.Trim(), "-1") Dim FechaI As String = If(IsDate(txtFechaIEnviados.Text.Trim()), txtFechaIEnviados.Text.Trim(), "-1")
Dim FechaF = If(IsDate(txtFechaFEnviados.Text.Trim()), txtFechaFEnviados.Text.Trim(), "-1") Dim FechaF As String = If(IsDate(txtFechaFEnviados.Text.Trim()), txtFechaFEnviados.Text.Trim(), "-1")
If ObjBancos.GetLayoutPagosEnviados(DdlCuentaEnviados.SelectedValue.ToEntero, DdlEstatusEnviados.SelectedValue.ToEntero, DdlTipoGeneracionEnviados.SelectedValue, FechaI, FechaF, PorGrupos:=True) Then If ObjBancos.GetLayoutPagosEnviados(DdlCuentaEnviados.SelectedValue.ToEntero, DdlEstatusEnviados.SelectedValue.ToEntero, DdlTipoGeneracionEnviados.SelectedValue, FechaI, FechaF, PorGrupos:=True) Then
DTEnviadas = ObjBancos.DtResultados DTEnviadas = ObjBancos.DtResultados
@@ -2779,10 +2752,10 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim FechaCancelacion As Date = NowADS() Dim FechaCancelacion As Date = NowADS()
Dim ErrorCancelar = False Dim ErrorCancelar As Boolean = False
Dim MensajeError = "" Dim MensajeError As String = ""
Dim IdPolizaNueva = -1 Dim IdPolizaNueva As Integer = -1
Dim FolioPolizaNueva = -1 Dim FolioPolizaNueva As Integer = -1
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then