Layout Scotia correciones cambios de cuenta validacion
This commit is contained in:
@@ -1044,35 +1044,35 @@ Partial Class Bancos_PagoElectronico
|
||||
Dim NombreArchivo As String = $"pagos_{NowADS.ToString("ddMMyyyy")}_001.txt"
|
||||
'"pagos_03062025_001.txt"
|
||||
|
||||
'If InsertaEnDB Then
|
||||
If InsertaEnDB Then
|
||||
|
||||
' Dim ObjBancos As New ClsBancos
|
||||
' ObjBancos.IniciaTransacSQL()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
ObjBancos.IniciaTransacSQL()
|
||||
|
||||
' Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True)
|
||||
Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True)
|
||||
|
||||
' If CveLayoutEnvio > 0 Then
|
||||
' For Each dr As DataRow In DTPendientes.Rows
|
||||
' If dr("CveProveedor").ToString <> "" Or dr("CvePersonal").ToString <> "" Then
|
||||
' If Not ObjBancos.AddLayoutEnviosDetalle(CveLayoutEnvio, dr("CveIE").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, 1, "Observaciones") Then
|
||||
' ErrorLayout = True
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Else
|
||||
' ErrorLayout = True
|
||||
' End If
|
||||
If CveLayoutEnvio > 0 Then
|
||||
For Each dr As DataRow In DTPendientes.Rows
|
||||
If dr("CveProveedor").ToString <> "" Or dr("CvePersonal").ToString <> "" Then
|
||||
If Not ObjBancos.AddLayoutEnviosDetalle(CveLayoutEnvio, dr("CveIE").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, 1, "Observaciones") Then
|
||||
ErrorLayout = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ErrorLayout = True
|
||||
End If
|
||||
|
||||
' If ErrorLayout Then
|
||||
' ObjBancos.RollBack()
|
||||
' ObjBancos.Dispose()
|
||||
' Else
|
||||
' ObjBancos.Commit()
|
||||
' ObjBancos.Dispose()
|
||||
' End If
|
||||
If ErrorLayout Then
|
||||
ObjBancos.RollBack()
|
||||
ObjBancos.Dispose()
|
||||
Else
|
||||
ObjBancos.Commit()
|
||||
ObjBancos.Dispose()
|
||||
End If
|
||||
|
||||
'End If
|
||||
End If
|
||||
|
||||
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
||||
Dim pathDirectorio As String = String.Format("{0}Layout\", UsuarioActual.Empresa.Ruta)
|
||||
@@ -1499,11 +1499,23 @@ Partial Class Bancos_PagoElectronico
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If DtRegenerar IsNot Nothing Then
|
||||
GeneraPago(DtRegenerar, CveBLE)
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
If OpBancos = 1 Then
|
||||
If DtRegenerar IsNot Nothing Then
|
||||
GeneraPago(DtRegenerar, CveBLE)
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
If OpBancos = 3 Then
|
||||
If DtRegenerar IsNot Nothing Then
|
||||
GeneraPagoScotiaBank(DtRegenerar, False)
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -1900,8 +1912,9 @@ Partial Class Bancos_PagoElectronico
|
||||
ElseIf OpBancos = 2 Then
|
||||
|
||||
ElseIf OpBancos = 3 Then
|
||||
If DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing Then
|
||||
GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronico > 0 AND EstatusCtaDeposito > 0"), False)
|
||||
If DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing AndAlso
|
||||
DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'").Rows.Count > 0 Then
|
||||
GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'"), True)
|
||||
Else
|
||||
Alert("No hay registros para generar pagos en ScotiaBank", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
@@ -2370,6 +2383,8 @@ Partial Class Bancos_PagoElectronico
|
||||
|
||||
If OpBancos = 3 Then
|
||||
|
||||
TextoArreglo = File.ReadAllLines(path:=NombreArchivo) ' Texto.Split(CChar(vbCrLf))
|
||||
|
||||
Dim SBCuentasAltas As New StringBuilder
|
||||
Dim SBErrores As New StringBuilder
|
||||
Dim ErrorArchivoScotia As Boolean = False
|
||||
@@ -2399,6 +2414,7 @@ Partial Class Bancos_PagoElectronico
|
||||
End If
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
ObjBancos.IniciaTransacSQL()
|
||||
|
||||
For i As Integer = 1 To TextoArreglo.Length - 2 Step 1
|
||||
|
||||
@@ -2406,12 +2422,17 @@ Partial Class Bancos_PagoElectronico
|
||||
|
||||
If Linea.Length = 140 Then
|
||||
|
||||
Dim CodigoRespuesta As String = Linea.Substring(0, 3)
|
||||
Dim CodigoRespuesta As String = Linea.Substring(109, 3)
|
||||
Dim DTipoArchivo As String = Linea.Substring(0, 2)
|
||||
Dim Cuenta As String = Linea.Substring(12, 20)
|
||||
'Dim FechaEliminacion As Date = Linea.Substring(32, 8).ToDate
|
||||
|
||||
Dim FechaEliminacion As Date = Date.ParseExact(Linea.Substring(32, 8), "yyyyMMdd", Globalization.CultureInfo.InvariantCulture)
|
||||
|
||||
If DTipoArchivo <> "SP" Then
|
||||
SBErrores.Append($"Error Linea {i} el tipo de archivo no es un archivo de respuesta (SP), inicia con codigo {DTipoArchivo}.</br>")
|
||||
ErrorArchivoScotia = True
|
||||
End If
|
||||
|
||||
If CodigoRespuesta = "000" Or CodigoRespuesta = " " Then
|
||||
|
||||
Dim CveCuentaDeposito As Integer = Linea.Substring(40, 50).Trim.ToEntero
|
||||
@@ -2439,11 +2460,16 @@ Partial Class Bancos_PagoElectronico
|
||||
Next
|
||||
|
||||
If ErrorArchivoScotia Then
|
||||
Alert($"El archivo presento errores en su procesamiento({SBErrores.Length}). Se dieron de alta {SBCuentasAltas.Length} cuentas.</br>Altas:</br>{SBCuentasAltas.ToString}.<br> <br>Errores:<br> {SBErrores.ToString}", TipoMensaje.MsgAdvertencia)
|
||||
ObjBancos.RollBack()
|
||||
Alert($"El archivo presento errores en su procesamiento({SBErrores.Length}). Correctos {SBCuentasAltas.Length} cuentas.</br>Altas:</br>{SBCuentasAltas.ToString}.<br> <br>Errores:<br> {SBErrores.ToString}", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
ObjBancos.Commit()
|
||||
Alert($"El archivo se analizo correctamente y se efectuaron todos los cambios en el sistema. cuentas procesadas: </BR>{SBCuentasAltas.ToString}", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
End If
|
||||
@@ -2944,6 +2970,8 @@ Partial Class Bancos_PagoElectronico
|
||||
|
||||
If OpBancos = 3 Then
|
||||
|
||||
TextoArreglo = File.ReadAllLines(NombreArchivo) 'Texto.Split(CChar(vbCrLf))
|
||||
|
||||
Dim CveIES As List(Of Integer) = New List(Of Integer)
|
||||
Dim LienasCount As Integer = TextoArreglo.Length
|
||||
Dim SBErrores As New StringBuilder
|
||||
@@ -2956,8 +2984,9 @@ Partial Class Bancos_PagoElectronico
|
||||
End If
|
||||
|
||||
Dim Header As String = TextoArreglo(0)
|
||||
Dim HCodigo As String = TextoArreglo(0).Substring(0, 3).Trim
|
||||
If HCodigo <> "SVH" Then
|
||||
Dim HCodigo As String = TextoArreglo(0).Substring(35, 3).Trim
|
||||
Dim HTipoArchivo As String = TextoArreglo(0).Substring(0, 3).Trim
|
||||
If HTipoArchivo <> "SVH" Then
|
||||
Alert("El archivo no es un archivo de respuesta, debe tener un encabezado con SVH.", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -3130,13 +3159,14 @@ Partial Class Bancos_PagoElectronico
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al enviar los correos de notificación.", TipoMensaje.MsgError)
|
||||
Alert("Ocurrió un error al enviar los correos de notificación.", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
|
||||
|
||||
Alert(Respuesta.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al procesar el archivo.", TipoMensaje.MsgAdvertencia)
|
||||
objIE.RollBack()
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user