Pago Grupos Liberacion General
This commit is contained in:
@@ -60,6 +60,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
ViewState("NombreArchivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTPendientes As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTPendientes"), DataTable)
|
||||
@@ -67,7 +68,17 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPendientes") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTAltasPendientes As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTAltasPendientes"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTAltasPendientes") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTProveedores As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTProveedores"), DataTable)
|
||||
@@ -214,7 +225,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
DTPendientes = Nothing
|
||||
End If
|
||||
|
||||
If ObjBancos.GetLayoutPagosEnviados(CveCuenta, 1, DdlTipoGeneracion.SelectedValue, "-1", "-1") Then
|
||||
If ObjBancos.GetLayoutPagosEnviados(CveCuenta, 1, DdlTipoGeneracion.SelectedValue, "-1", "-1", PorGrupos:=True) Then
|
||||
DTEnviadas = ObjBancos.DtResultados
|
||||
Else
|
||||
DTEnviadas = Nothing
|
||||
@@ -237,7 +248,13 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
UpGVDatos.Update()
|
||||
|
||||
If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then
|
||||
CargaDatosInformativos()
|
||||
CargaDatosInformativos()
|
||||
Else
|
||||
|
||||
LbNumeroMovimientos.Text = "0"
|
||||
LbImporteMovimientos.Text = "0"
|
||||
|
||||
UpComandosGeneracion.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -331,13 +348,23 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
Response.ContentType = "application/zip"
|
||||
Response.End()
|
||||
End Sub
|
||||
Private Function CreaArchivo(Tipo As Integer) As Boolean
|
||||
Private Function CreaArchivo(Tipo As Integer, Optional MismoBanco As Boolean = True) As Boolean
|
||||
|
||||
|
||||
System.Threading.Thread.Sleep(1000) 'Un segundo de diferencia Para doferentes tipos de bancos
|
||||
|
||||
DirectoryExistsCreate(String.Format("{0}Layout", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
NombreArchivo = String.Format("{2}{1}{0}.txt", UsuarioActual.CveUsuario, Date.Now.ToString("yyyyMMdd-HH-mm"), If(Tipo = 1, "LAYOUTPAGO", "LAYOUTALTA"))
|
||||
|
||||
NombreArchivo = String.Format("{2}{1}{0}.txt", UsuarioActual.CveUsuario, Date.Now.ToString("yyyyMMdd-HH-mm-ss"), If(Tipo = 1, "LAYOUTPAGO", "LAYOUTALTA"))
|
||||
|
||||
If Tipo = 1 Then
|
||||
NombreArchivo = String.Format("{2}{1}{0}.txt", UsuarioActual.CveUsuario, Date.Now.ToString("yyyyMMdd-HH-mm-ss"), "LAYOUTPAGO")
|
||||
Else
|
||||
NombreArchivo = String.Format("{2}{1}{0}{3}.txt", UsuarioActual.CveUsuario, Date.Now.ToString("yyyyMMdd-HH-mm-ss"), "LAYOUTALTA", If(MismoBanco, "BANCOMER", "INTERBANCARIO"))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
||||
Dim fs As FileStream = File.Create(path)
|
||||
|
||||
@@ -442,7 +469,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
Dim DtRegenerar As New DataTable
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetLayoutPagos(CveCuenta, CveBLE, "-1") Then
|
||||
If ObjBancos.GetLayoutPagos(CveCuenta, CveBLE, "-1", PorGrupos:=True) Then
|
||||
DtRegenerar = ObjBancos.DtResultados
|
||||
Else
|
||||
DtRegenerar = Nothing
|
||||
@@ -450,7 +477,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If DtRegenerar IsNot Nothing Then
|
||||
GeneraPago(DtRegenerar)
|
||||
GeneraPago(DtRegenerar, False)
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
@@ -492,13 +519,14 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
AltaProveedores(1)
|
||||
End Sub
|
||||
|
||||
Private Sub AltaProveedores(TipoAlta As Integer)
|
||||
Private Sub AltaProveedores(TipoAlta As Integer, Optional DtCuentasPendientesTemp As DataTable = Nothing)
|
||||
|
||||
|
||||
NombreArchivo = ""
|
||||
|
||||
Dim RegistrosAltaBancomer As New StringBuilder
|
||||
Dim RegistrosAltaInterbancario As New StringBuilder
|
||||
Dim SBErrores As New StringBuilder
|
||||
|
||||
Dim NombreArchivoBancomer As String = ""
|
||||
Dim NombreArchivoInterbancario As String = ""
|
||||
@@ -508,46 +536,72 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
Dim ErrorLayout = False
|
||||
|
||||
|
||||
Dim DtCuentasPendientesTemp As DataTable = DTPendientes.Copy
|
||||
If DtCuentasPendientesTemp Is Nothing Then
|
||||
DtCuentasPendientesTemp = DTPendientes.Copy
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DtCuentasPendientesTemp.CaseSensitive = False
|
||||
|
||||
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (CuentaPago like '%BBVA%' OR CuentaPago like '%BANCOMER%' ) ", "", {"CuentaPago", "NumCuenta", "AbreviaturaMon", "RazonSocial", "CveProveedor", "CveBanco"})
|
||||
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND NOT (CuentaPago like '%BBVA%' OR CuentaPago like '%BANCOMER%' ) ", "", {"CuentaPago", "NumCuenta", "AbreviaturaMon", "RazonSocial", "CveProveedor", "CveBanco"})
|
||||
|
||||
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' ) ", "", {"BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "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%' ) ", "", {"BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias"})
|
||||
'CLABEDestino
|
||||
|
||||
If DtCuentasPendientesBancomer.Rows.Count > 0 Then
|
||||
For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows
|
||||
|
||||
Dim SBTmpBancomer As New StringBuilder
|
||||
Dim SBErroresBancomer As New StringBuilder
|
||||
Dim ErrorLineaBancomer As Boolean = False
|
||||
|
||||
If dRow("NumCuenta").ToString.Length < 19 Then 'Tamaño maximo 18
|
||||
RegistrosAltaBancomer.Append(dRow("NumCuenta").ToString.PadLeft(18, CeroRelleno))
|
||||
SBErroresBancomer.Append($"{dRow("RazonSocial").ToString } ")
|
||||
SBErroresBancomer.Append($"Cuenta: {dRow("Cuenta").ToString } ")
|
||||
|
||||
If dRow("CLABEDestino").ToString.Length <= 18 Then 'Tamaño maximo 18
|
||||
SBTmpBancomer.Append(dRow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
|
||||
Else
|
||||
SBErroresBancomer.Append("La cuenta beneficiaria no puede ser mayor a 18 caracteres, ")
|
||||
ErrorLineaBancomer = True
|
||||
End If
|
||||
|
||||
If dRow("AbreviaturaMon").ToString.Length = 3 AndAlso dRow("AbreviaturaMon").ToString.Contiene("MXN", "USD", "EUR") Then
|
||||
RegistrosAltaBancomer.Append(dRow("AbreviaturaMon"))
|
||||
If dRow("Abreviatura").ToString.Length = 3 Then
|
||||
SBTmpBancomer.Append(dRow("Abreviatura"))
|
||||
Else
|
||||
SBErroresBancomer.Append("El tamaño de la divisa es incorrecto, ")
|
||||
ErrorLineaBancomer = True
|
||||
End If
|
||||
|
||||
RegistrosAltaBancomer.Append("0999999999999.99")
|
||||
SBTmpBancomer.Append("0999999999999.99")
|
||||
|
||||
If dRow("RazonSocial").ToString.Trim.Length < 31 Then 'Tamaño maximo 30
|
||||
RegistrosAltaBancomer.Append(dRow("RazonSocial").ToString.PadLeft(30, EspacioRelleno))
|
||||
SBTmpBancomer.Append(dRow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
|
||||
Else
|
||||
RegistrosAltaBancomer.Append(dRow("RazonSocial").ToString.Trim.Substring(0, 30))
|
||||
SBTmpBancomer.Append(dRow("RazonSocial").ToString.Trim.Substring(0, 30))
|
||||
End If
|
||||
|
||||
'ALIAS DE LA CUENTA PENDIENTE TAMAÑO MAXIMO 30
|
||||
RegistrosAltaBancomer.Append(dRow("CveProveedor").ToString.PadLeft(30, EspacioRelleno))
|
||||
SBTmpBancomer.Append(dRow("BBVAAlias").ToString.PadRight(30, EspacioRelleno))
|
||||
|
||||
'CORREO OPCIONAL TAMAÑO MAXIMO 80
|
||||
'RegistrosAlta.Append("".ToString.PadLeft(80, EspacioRelleno))
|
||||
|
||||
RegistrosAltaBancomer.Append(vbCrLf)
|
||||
SBTmpBancomer.Append(vbCrLf)
|
||||
|
||||
|
||||
If Not ErrorLineaBancomer Then
|
||||
RegistrosAltaBancomer.Append(SBTmpBancomer.ToString)
|
||||
Else
|
||||
SBErroresBancomer.Append("<br>")
|
||||
SBErrores.AppendLine(SBErroresBancomer.ToString)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
TextoCompleto = RegistrosAltaBancomer.ToString
|
||||
|
||||
If CreaArchivo(2) Then
|
||||
If CreaArchivo(2, True) Then
|
||||
NombreArchivoBancomer = NombreArchivo
|
||||
End If
|
||||
|
||||
@@ -561,53 +615,70 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
|
||||
For Each dRow As DataRow In DtCuentasPendientesInterbancarias.Rows
|
||||
|
||||
If Not (dRow("CuentaPago").ToString.ToUpper.Contains("BBVA") Or dRow("CuentaPago").ToString.ToUpper.Contains("BANCOMER")) Then
|
||||
Dim SBTmpInterbancarias As New StringBuilder
|
||||
Dim SBErroresInterBancario As New StringBuilder
|
||||
Dim ErrorLineaInterbancaria As Boolean = False
|
||||
|
||||
If dRow("CveBanco").ToString = "" Then
|
||||
RegistrosAltaInterbancario.Append(dRow("CveBanco").ToString)
|
||||
Else
|
||||
Alert("La cuenta deposito no tiene clave ABM(Clave SAT) asignada", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
SBErroresInterBancario.Append($"{dRow("RazonSocial").ToString } ")
|
||||
SBErroresInterBancario.Append($"Cuenta: {dRow("Cuenta").ToString } ")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If dRow("NumCuenta").ToString.Length < 19 Then 'Tamaño maximo 18
|
||||
RegistrosAltaInterbancario.Append(dRow("NumCuenta").ToString.PadLeft(18, CeroRelleno))
|
||||
End If
|
||||
|
||||
If dRow("AbreviaturaMon").ToString.Length = 3 AndAlso dRow("AbreviaturaMon").ToString.Contiene("MXN", "USD", "EUR") Then
|
||||
RegistrosAltaInterbancario.Append(dRow("AbreviaturaMon"))
|
||||
End If
|
||||
|
||||
RegistrosAltaInterbancario.Append("0999999999999.99")
|
||||
|
||||
If dRow("RazonSocial").ToString.Trim.Length < 31 Then 'Tamaño maximo 30
|
||||
RegistrosAltaInterbancario.Append(dRow("RazonSocial").ToString.PadLeft(30, EspacioRelleno))
|
||||
If dRow("CveBanco").ToString.Trim.Length = 3 Then
|
||||
SBTmpInterbancarias.Append(dRow("CveBanco").ToString.Trim)
|
||||
Else
|
||||
RegistrosAltaInterbancario.Append(dRow("RazonSocial").ToString.Trim.Substring(0, 30))
|
||||
SBErroresInterBancario.Append("clave ABM(Clave SAT) incorrecta, ")
|
||||
ErrorLineaInterbancaria = True
|
||||
End If
|
||||
|
||||
'ALIAS DE LA CUENTA PENDIENTE TAMAÑO MAXIMO 30
|
||||
RegistrosAltaInterbancario.Append(dRow("CveProveedor").ToString.PadLeft(30, EspacioRelleno))
|
||||
|
||||
If dRow("CLABEDestino").ToString.Length <= 18 Then 'Tamaño maximo 18
|
||||
SBTmpInterbancarias.Append(dRow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
|
||||
Else
|
||||
SBErroresInterBancario.Append("La cuenta beneficiaria no puede ser mayor a 18 caracteres, ")
|
||||
ErrorLineaInterbancaria = True
|
||||
End If
|
||||
|
||||
If dRow("Abreviatura").ToString.Length = 3 Then
|
||||
SBTmpInterbancarias.Append(dRow("Abreviatura").ToString.Trim)
|
||||
Else
|
||||
SBErroresInterBancario.Append("El tamaño de la divisa es incorrecto, ")
|
||||
ErrorLineaInterbancaria = True
|
||||
End If
|
||||
|
||||
SBTmpInterbancarias.Append("0999999999999.99")
|
||||
|
||||
If dRow("RazonSocial").ToString.Trim.Length <31 Then 'Tamaño maximo 30
|
||||
SBTmpInterbancarias.Append(dRow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
|
||||
Else
|
||||
SBTmpInterbancarias.Append(dRow("RazonSocial").ToString.Trim.Substring(0, 30))
|
||||
End If
|
||||
|
||||
' ALIAS DE LA CUENTA PENDIENTE TAMAÑO MAXIMO 30
|
||||
SBTmpInterbancarias.Append(dRow("BBVAAlias").ToString.PadRight(30, EspacioRelleno))
|
||||
|
||||
'CORREO OPCIONAL TAMAÑO MAXIMO 80
|
||||
'RegistrosAlta.Append("".ToString.PadLeft(80, EspacioRelleno))
|
||||
|
||||
If Not (dRow("CuentaPago").ToString.ToUpper.Contains("BBVA") Or dRow("CuentaPago").ToString.ToUpper.Contains("BANCOMER")) Then
|
||||
RegistrosAltaInterbancario.Append("40")
|
||||
End If
|
||||
|
||||
RegistrosAltaInterbancario.Append(vbCrLf)
|
||||
'Tipo de cuenta
|
||||
SBTmpInterbancarias.Append("40")
|
||||
|
||||
SBTmpInterbancarias.Append(vbCrLf)
|
||||
|
||||
|
||||
If Not ErrorLineaInterbancaria Then
|
||||
RegistrosAltaInterbancario.Append(SBTmpInterbancarias.ToString)
|
||||
Else
|
||||
SBErroresInterBancario.Append("<br>")
|
||||
SBErrores.AppendLine(SBErroresInterBancario.ToString)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
TextoCompleto = RegistrosAltaInterbancario.ToString
|
||||
If CreaArchivo(2) Then
|
||||
NombreArchivoInterbancario = NombreArchivo
|
||||
If RegistrosAltaInterbancario.Length > 0 Then
|
||||
TextoCompleto = RegistrosAltaInterbancario.ToString
|
||||
If CreaArchivo(2, False) Then
|
||||
NombreArchivoInterbancario = NombreArchivo
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -616,15 +687,23 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
Dim Mensaje As New StringBuilder
|
||||
|
||||
|
||||
Mensaje.Append("Descarga Layouts<br>")
|
||||
Mensaje.Append("Descarga Layouts<br><br>")
|
||||
|
||||
If NombreArchivoBancomer.Trim.Length > 0 Then
|
||||
Mensaje.Append($"Cuentas Bancomer <a class='texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoBancomer}' download>Descarga Archivo cuentas Bancomer<a> <br><br>")
|
||||
Mensaje.Append($"Cuentas Bancomer <a class='Texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoBancomer}' download > Descarga Archivo cuentas Bancomer</a> <br><br>")
|
||||
End If
|
||||
|
||||
|
||||
If NombreArchivoInterbancario.Trim.Length > 0 Then
|
||||
Mensaje.Append($"Cuentas Interbancarias <a class='texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoInterbancario}' download>Descarga Archivo cuentas Bancomer<a>")
|
||||
Mensaje.Append($"Cuentas Interbancarias <a class='Texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoInterbancario}' download >Descarga Archivo cuentas Bancomer</a> <br><br>")
|
||||
End If
|
||||
|
||||
|
||||
If SBErrores.ToString.Length > 0 Then
|
||||
Mensaje.Append("<a class='Texto' data-toggle='collapse' data-target='#ErroresCuentas'>Errores Cuentas</a><br>")
|
||||
Mensaje.Append("<div id='ErroresCuentas' Class='collapse'")
|
||||
Mensaje.Append(SBErrores.ToString)
|
||||
Mensaje.Append("</div>")
|
||||
End If
|
||||
|
||||
If NombreArchivoBancomer.Length > 0 Or NombreArchivoInterbancario.Length > 0 Then
|
||||
@@ -637,239 +716,86 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
|
||||
|
||||
|
||||
Private Sub AltaProveedoresViejo(TipoAlta As Integer)
|
||||
Dim DtTemp As DataTable = Nothing
|
||||
CreaDtAlta()
|
||||
|
||||
|
||||
'TIPO ALTA
|
||||
'1 = Alta comun
|
||||
'2 = Alta masiva
|
||||
If TipoAlta = 1 Then
|
||||
If DTPendientes Is Nothing OrElse DTPendientes.FiltraParametros("EstatusCtaDeposito = 'True'").Rows.Count <= 0 Then
|
||||
Alert("No hay registros para generar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
Else
|
||||
DtTemp = DTPendientes.FiltraParametros("EstatusCtaDeposito = 'True'").Copy
|
||||
End If
|
||||
ElseIf TipoAlta = 2 Then
|
||||
If DTProveedores Is Nothing OrElse DTProveedores.Rows.Count <= 0 Then
|
||||
Alert("No hay registros para generar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
Else
|
||||
DtTemp = DTProveedores.Copy
|
||||
End If
|
||||
ElseIf TipoAlta = 3 Then
|
||||
If DTFyE Is Nothing OrElse DTFyE.Rows.Count <= 0 Then
|
||||
Alert("No hay registros para generar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
Else
|
||||
DtTemp = DTProveedores.Copy
|
||||
End If
|
||||
End If
|
||||
|
||||
'REINICIA PROPIEDAS
|
||||
HeaderTexto = ""
|
||||
DetalleTexto = ""
|
||||
TrailerTexto = ""
|
||||
TotalAcumulado = 0
|
||||
|
||||
''VALIDA CUENTAS DEPOSITOS
|
||||
Dim ErrorCuenta = False
|
||||
Dim ProveedoresError As StringBuilder = New StringBuilder
|
||||
ProveedoresError.AppendFormat("<table width='600px'><thead><tr><td width='300px'>Proveedor</td><td width='150px'>Cuenta</td><td width='150px'>Error</td></tr></thead><tbody>")
|
||||
Dim TotalDetalles As Integer = 0
|
||||
Dim EsBancomer = False
|
||||
For Each gvr As DataRow In DtTemp.Rows
|
||||
If gvr("CveCuentaDeposito").ToString <> "" AndAlso gvr("EstatusPagoElectronico").ToString <> "True" AndAlso gvr("AltaCuenta").ToString = "1" Then
|
||||
DTPendienteActual = DtTemp.FiltraParametros(String.Format("CveCuentaDeposito = {0}", gvr("CveCuentaDeposito").ToString))
|
||||
ErrorCuenta = False
|
||||
EsBancomer = False
|
||||
|
||||
If DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BBVA") Or DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Or (DTPendienteActual(0)("CLABE").ToString.Length = 18 AndAlso DTPendienteActual(0)("CLABE").ToString.Substring(0, 3) = "012") Then
|
||||
EsBancomer = True
|
||||
End If
|
||||
|
||||
''COMENTADO PARA PERMITIR ENTRADA DE UNA CUENTA A PROVEEDOR, 22 DE SEPTIEMBRE, ISRAEL PIÑA
|
||||
'If Not ErrorCuenta Then
|
||||
' If EsBancomer AndAlso (DTPendienteActual(0)("CLABE").ToString.Length = 18 AndAlso Not DTPendienteActual(0)("CLABE").ToString.Substring(0, 3) = "012") Then
|
||||
' ProveedoresError.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>CLABE NO PERTENECE A BANCOMER</td></tr>", DTPendienteActual(0)("RazonSocial").ToString, DTPendienteActual(0)("BancoNombre").ToString)
|
||||
' ErrorCuenta = True
|
||||
' End If
|
||||
'End If
|
||||
|
||||
''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE
|
||||
'If (DTPendienteActual(0)("CLABE").ToString.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And TxtConvenioCIE.Text.Trim.Length <> 6 And DTPendienteActual(0)("CLABE").ToString.Trim.Length <> 18) Then
|
||||
' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER
|
||||
If Not ErrorCuenta Then
|
||||
If DTPendienteActual(0)("CLABE").ToString.Trim.Length <> 18 And DTPendienteActual(0)("CLABE").ToString.Trim.Length = 0 And Not EsBancomer Then
|
||||
ProveedoresError.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>CLABE ES OBLIGATORIA</td></tr>", DTPendienteActual(0)("RazonSocial").ToString, DTPendienteActual(0)("BancoNombre").ToString)
|
||||
ErrorCuenta = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10
|
||||
If Not ErrorCuenta Then
|
||||
If DTPendienteActual(0)("Cuenta").ToString.Trim.Length <> 0 AndAlso DTPendienteActual(0)("Cuenta").ToString.Trim.Length <> 10 AndAlso EsBancomer Then
|
||||
ProveedoresError.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>NUMERO DE CUENTA CON FORMATO INCORRECTO</td></tr>", DTPendienteActual(0)("RazonSocial").ToString, DTPendienteActual(0)("BancoNombre").ToString)
|
||||
ErrorCuenta = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18
|
||||
If Not ErrorCuenta Then
|
||||
If DTPendienteActual(0)("CLABE").ToString.Trim.Length <> 0 AndAlso DTPendienteActual(0)("CLABE").ToString.Trim.Length <> 18 Then
|
||||
ProveedoresError.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>CLABE CON FORMATO INCORRECTO</td></tr>", DTPendienteActual(0)("RazonSocial").ToString, DTPendienteActual(0)("BancoNombre").ToString)
|
||||
ErrorCuenta = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI CIE TIENE ALGO DEBE TENER REFERENCIA OBLIGATORIA
|
||||
If Not ErrorCuenta Then
|
||||
If DTPendienteActual(0)("CIE").ToString.Trim.Length <> 0 And DTPendienteActual(0)("Referencia").ToString.Trim.Length < 3 Then
|
||||
ProveedoresError.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>CIE CON FORMATO INCORRECTO</td></tr>", DTPendienteActual(0)("RazonSocial").ToString, DTPendienteActual(0)("BancoNombre").ToString)
|
||||
ErrorCuenta = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA"
|
||||
If Not ErrorCuenta Then
|
||||
If EsBancomer AndAlso Not (DTPendienteActual(0)("Cuenta").ToString.Trim.Length = 10 Or DTPendienteActual(0)("CIE").ToString.Trim.Length <> 0) Then
|
||||
ProveedoresError.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>CUENTA BANCOMER SIN CUENTA O CIE</td></tr>", DTPendienteActual(0)("RazonSocial").ToString, DTPendienteActual(0)("BancoNombre").ToString)
|
||||
ErrorCuenta = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'DTPendienteActual(0)("").ToString
|
||||
|
||||
'VALDIACION ANTIGUA
|
||||
'If Not (DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BBVA") Or DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BANCOMER")) Then
|
||||
' If Not DTPendienteActual(0)("CLABE").ToString.Length = 18 Then
|
||||
' ProveedoresError.AppendFormat("Proveedor: {0}", DTPendienteActual(0)("RazonSocial").ToString)
|
||||
' ErrorCuenta = True
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If Not ErrorCuenta Then
|
||||
If TotalDetalles > 0 Then
|
||||
DetalleTexto &= vbCrLf
|
||||
End If
|
||||
CrearDetalle()
|
||||
TotalDetalles += 1
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
ProveedoresError.AppendFormat("</tbody></table>")
|
||||
|
||||
|
||||
If TotalDetalles > 0 Then
|
||||
FormarTexto(TotalDetalles)
|
||||
CreaArchivo(2)
|
||||
|
||||
Dim Descargas As New StringBuilder()
|
||||
Descargas.AppendFormat("<li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?File={0}"" target='_blank'>TXT</a></li>", NombreArchivo)
|
||||
'Descargas.AppendFormat("<li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?REPORTE=S"" target='_blank'>Reporte</a></li>", NombreArchivo)
|
||||
Descargas.AppendFormat("<li><a href=""#"" class=""Texto"" onclick=""fncg();"">Descargar Reporte</a></li>", NombreArchivo)
|
||||
|
||||
|
||||
Dim TextoErrorProveedores = ""
|
||||
If ProveedoresError.Length > 160 Then TextoErrorProveedores = String.Format("<br /><br /><br />Proveedores con Error: <br/><br/>------------------------------------------------------------------<br/>{0}<br /><br />", ProveedoresError.ToString)
|
||||
|
||||
Alert(String.Format("<br />El Layout fue creado satisfactoriamente.{1}<br />Descargas:<ul>{0}</ul>", Descargas, TextoErrorProveedores), TipoMensaje.MsgInformacion)
|
||||
|
||||
'NombreArchivo = "LayoutAltaProveedores"
|
||||
'DescargarArchivo()
|
||||
Else
|
||||
Alert("No hay proveedores que dar de alta", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub CrearDetalle()
|
||||
Dim Resultado = True
|
||||
Dim CuentaDeposito As String = ""
|
||||
Dim TipoCuentaDeposito As String = ""
|
||||
Dim TipoCuenta As String = ""
|
||||
'Protected Sub CrearDetalle()
|
||||
' Dim Resultado = True
|
||||
' Dim CuentaDeposito As String = ""
|
||||
' Dim TipoCuentaDeposito As String = ""
|
||||
' Dim TipoCuenta As String = ""
|
||||
|
||||
''''' LLENADO DE DETALLE
|
||||
'Campos #1-4 del Detalle
|
||||
DetalleTexto &= String.Format("DA{0}N ", DTPendienteActual(0)("CveCuentaDeposito").ToString.ToUpper.PadLeft(30, PadCeros))
|
||||
' ''''' LLENADO DE DETALLE
|
||||
' 'Campos #1-4 del Detalle
|
||||
' DetalleTexto &= String.Format("DA{0}N ", DTPendienteActual(0)("CveCuentaDeposito").ToString.ToUpper.PadLeft(30, PadCeros))
|
||||
|
||||
'Banco BBVA
|
||||
If DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BBVA") Or DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Then
|
||||
'Llenamos datos de BBVA
|
||||
'Campo #5-7 del detalle
|
||||
' 'Banco BBVA
|
||||
' If DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BBVA") Or DTPendienteActual(0)("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Then
|
||||
' 'Llenamos datos de BBVA
|
||||
' 'Campo #5-7 del detalle
|
||||
|
||||
'Busca que cuenta sera la asignada para el proveedor
|
||||
If DTPendienteActual(0)("CIE").ToString <> "" Then
|
||||
CuentaDeposito = String.Format("02{0}", DTPendienteActual(0)("CIE").ToString.PadLeft(8, PadCeros))
|
||||
TipoCuenta = "50"
|
||||
TipoCuentaDeposito = "CIE"
|
||||
ElseIf DTPendienteActual(0)("Cuenta").ToString.Length = 10 Then
|
||||
CuentaDeposito = DTPendienteActual(0)("Cuenta").ToString
|
||||
TipoCuenta = "99"
|
||||
TipoCuentaDeposito = "Cuenta"
|
||||
ElseIf DTPendienteActual(0)("CLABE").ToString.Length = 18 Then
|
||||
CuentaDeposito = DTPendienteActual(0)("CLABE").ToString
|
||||
TipoCuenta = "40"
|
||||
TipoCuentaDeposito = "CLABE"
|
||||
End If
|
||||
' 'Busca que cuenta sera la asignada para el proveedor
|
||||
' If DTPendienteActual(0)("CIE").ToString <> "" Then
|
||||
' CuentaDeposito = String.Format("02{0}", DTPendienteActual(0)("CIE").ToString.PadLeft(8, PadCeros))
|
||||
' TipoCuenta = "50"
|
||||
' TipoCuentaDeposito = "CIE"
|
||||
' ElseIf DTPendienteActual(0)("Cuenta").ToString.Length = 10 Then
|
||||
' CuentaDeposito = DTPendienteActual(0)("Cuenta").ToString
|
||||
' TipoCuenta = "99"
|
||||
' TipoCuentaDeposito = "Cuenta"
|
||||
' ElseIf DTPendienteActual(0)("CLABE").ToString.Length = 18 Then
|
||||
' CuentaDeposito = DTPendienteActual(0)("CLABE").ToString
|
||||
' TipoCuenta = "40"
|
||||
' TipoCuentaDeposito = "CLABE"
|
||||
' End If
|
||||
|
||||
|
||||
DetalleTexto &= String.Format("{0}{1}{2}", DTPendienteActual(0)("Abreviatura").ToString, TipoCuenta, CuentaDeposito.PadLeft(35, PadCeros))
|
||||
' DetalleTexto &= String.Format("{0}{1}{2}", DTPendienteActual(0)("Abreviatura").ToString, TipoCuenta, CuentaDeposito.PadLeft(35, PadCeros))
|
||||
|
||||
'Llenamos en blanco datos de otros bancos
|
||||
'Campos 8-17 del detalle --- 64 de otros bancos y 45 para FILLER --- Fecha de Alta
|
||||
DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), DateTime.Now().ToString("yyyy-MM-dd"))
|
||||
' 'Llenamos en blanco datos de otros bancos
|
||||
' 'Campos 8-17 del detalle --- 64 de otros bancos y 45 para FILLER --- Fecha de Alta
|
||||
' DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), DateTime.Now().ToString("yyyy-MM-dd"))
|
||||
|
||||
|
||||
'Otros Bancos NACIONAL!!
|
||||
Else
|
||||
' 'Otros Bancos NACIONAL!!
|
||||
' Else
|
||||
|
||||
CuentaDeposito = DTPendienteActual(0)("CLABE").ToString
|
||||
TipoCuentaDeposito = "CLABE"
|
||||
' CuentaDeposito = DTPendienteActual(0)("CLABE").ToString
|
||||
' TipoCuentaDeposito = "CLABE"
|
||||
|
||||
'Llenamos en blanco datos de BBVA
|
||||
DetalleTexto &= Vacio.PadRight(40)
|
||||
' 'Llenamos en blanco datos de BBVA
|
||||
' DetalleTexto &= Vacio.PadRight(40)
|
||||
|
||||
'Llenamos datos de otros bancos
|
||||
'Campos 8- 17 del detalle --- 44 de otros bancos --- 20 de internacional --- 45 Filler -- Fecha de Alta
|
||||
DetalleTexto &= String.Format("{0}40{1}{2}{3}{4}{5}", DTPendienteActual(0)("Abreviatura").ToString, DTPendienteActual(0)("CLABE").ToString.PadLeft(35, PadCeros), DTPendienteActual(0)("CLABE").ToString.Substring(0, 3).PadLeft(4, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), DateTime.Now().ToString("yyyy-MM-dd"))
|
||||
End If
|
||||
' 'Llenamos datos de otros bancos
|
||||
' 'Campos 8- 17 del detalle --- 44 de otros bancos --- 20 de internacional --- 45 Filler -- Fecha de Alta
|
||||
' DetalleTexto &= String.Format("{0}40{1}{2}{3}{4}{5}", DTPendienteActual(0)("Abreviatura").ToString, DTPendienteActual(0)("CLABE").ToString.PadLeft(35, PadCeros), DTPendienteActual(0)("CLABE").ToString.Substring(0, 3).PadLeft(4, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), DateTime.Now().ToString("yyyy-MM-dd"))
|
||||
' End If
|
||||
|
||||
'Llenamos datos de Tipo de Persona - Fisica o Moral
|
||||
TipoPersona()
|
||||
' 'Llenamos datos de Tipo de Persona - Fisica o Moral
|
||||
' TipoPersona()
|
||||
|
||||
'Campos 27-32 --- Fillers --- datos de otros bancos (internacional)
|
||||
DetalleTexto &= Vacio.PadLeft(153)
|
||||
' 'Campos 27-32 --- Fillers --- datos de otros bancos (internacional)
|
||||
' DetalleTexto &= Vacio.PadLeft(153)
|
||||
|
||||
'Campos 33-36 --- Datos de confirmacion
|
||||
DetalleTexto &= String.Format("{0}02{1}", Vacio.PadRight(40), CorreoNotificacionesEmpresa.ToUpper.PadRight(50))
|
||||
' 'Campos 33-36 --- Datos de confirmacion
|
||||
' DetalleTexto &= String.Format("{0}02{1}", Vacio.PadRight(40), CorreoNotificacionesEmpresa.ToUpper.PadRight(50))
|
||||
|
||||
'If DTPendienteActual(0)("ContactoMail").ToString.Length > 0 Then
|
||||
' 'DetalleTexto &= String.Format("{0}02{1}", Vacio.PadRight(40), DTPendienteActual(0)("ContactoMail").ToString.ToUpper.PadRight(50))
|
||||
'ElseIf DTPendienteActual(0)("ContactoMail").ToString.Length <= 0 Then
|
||||
' DetalleTexto &= String.Format("{0}00{1}", Vacio.PadRight(40), Vacio.PadRight(50))
|
||||
'End If
|
||||
' 'If DTPendienteActual(0)("ContactoMail").ToString.Length > 0 Then
|
||||
' ' 'DetalleTexto &= String.Format("{0}02{1}", Vacio.PadRight(40), DTPendienteActual(0)("ContactoMail").ToString.ToUpper.PadRight(50))
|
||||
' 'ElseIf DTPendienteActual(0)("ContactoMail").ToString.Length <= 0 Then
|
||||
' ' DetalleTexto &= String.Format("{0}00{1}", Vacio.PadRight(40), Vacio.PadRight(50))
|
||||
' 'End If
|
||||
|
||||
'Campos 37-39 -- FILLER
|
||||
DetalleTexto &= String.Format("00{0}", Vacio.PadRight(38))
|
||||
' 'Campos 37-39 -- FILLER
|
||||
' DetalleTexto &= String.Format("00{0}", Vacio.PadRight(38))
|
||||
|
||||
|
||||
''LLENA DT PARA REPORTE
|
||||
Dim Row = DtAlta.NewRow()
|
||||
Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString
|
||||
Row("Banco") = DTPendienteActual(0)("BancoNombre").ToString
|
||||
Row("TipoCuenta") = TipoCuentaDeposito
|
||||
Row("Cuenta") = String.Format("{0}", CuentaDeposito)
|
||||
DtAlta.Rows.Add(Row)
|
||||
End Sub
|
||||
' ''LLENA DT PARA REPORTE
|
||||
' Dim Row = DtAlta.NewRow()
|
||||
' Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString
|
||||
' Row("Banco") = DTPendienteActual(0)("BancoNombre").ToString
|
||||
' Row("TipoCuenta") = TipoCuentaDeposito
|
||||
' Row("Cuenta") = String.Format("{0}", CuentaDeposito)
|
||||
' DtAlta.Rows.Add(Row)
|
||||
'End Sub
|
||||
|
||||
Protected Sub TipoPersona()
|
||||
'Persona Moral
|
||||
@@ -985,7 +911,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
|
||||
If DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing Then
|
||||
|
||||
GeneraPago(DTPendientes.FiltraParametros("EstatusPagoElectronico > 0 AND EstatusCtaDeposito > 0"))
|
||||
GeneraPago(DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0"))
|
||||
|
||||
Else
|
||||
|
||||
@@ -994,10 +920,10 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GeneraPago(DTPendientesTemp As DataTable)
|
||||
Private Sub GeneraPago(DTPendientesTemp As DataTable, Optional InsertaEnDB As Boolean = True)
|
||||
|
||||
Dim RegistrosPago As New StringBuilder
|
||||
Dim MENSAJE As New StringBuilder
|
||||
Dim MENSAJEError As New StringBuilder
|
||||
|
||||
|
||||
Dim CeroRelleno As Char = "0"c
|
||||
@@ -1008,6 +934,12 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
For Each drow As DataRow In DTPendientesTemp.Rows
|
||||
|
||||
|
||||
MENSAJEError.Clear()
|
||||
|
||||
MENSAJEError.AppendLine($"Error al generar pago <br>")
|
||||
MENSAJEError.AppendLine($" Proveedor: {drow("RazonSocial").ToString} detalle: { drow("Observaciones").ToString} <br>")
|
||||
|
||||
|
||||
If drow("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Or drow("BancoNombre").ToString.ToUpper.Contains("BBVA") Then
|
||||
RegistrosPago.Append("PTC")
|
||||
Else
|
||||
@@ -1018,31 +950,144 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
RegistrosPago.Append(drow("CLABEOrigen").ToString)
|
||||
Else
|
||||
ErrorLayout = True
|
||||
MENSAJE.AppendLine("ERROR EN CLABE")
|
||||
MENSAJEError.AppendLine("ERROR EN CLABE cuenta origen")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If drow("CLABEDestino").ToString.Trim.Length <> 18 Then
|
||||
If drow("CLABEDestino").ToString.Trim.Length = 18 Then
|
||||
RegistrosPago.Append(drow("CLABEDestino").ToString)
|
||||
Else
|
||||
ErrorLayout = True
|
||||
MENSAJE.AppendLine("ERROR EN CLABE")
|
||||
MENSAJEError.AppendLine("ERROR EN CLABE cuenta destino")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
RegistrosPago.Append("Abreviatura")
|
||||
|
||||
RegistrosPago.Append(drow("Abreviatura").ToString)
|
||||
RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00"))
|
||||
|
||||
RegistrosPago.Append(drow("CveIE").ToString.PadRight(30, EspacioRelleno))
|
||||
|
||||
If drow("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Or drow("BancoNombre").ToString.ToUpper.Contains("BBVA") Then
|
||||
|
||||
If drow("Observaciones").ToString.Trim.Length > 30 Then
|
||||
RegistrosPago.Append(drow("Observaciones").ToString.Substring(0, 30))
|
||||
Else
|
||||
RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno))
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If drow("RazonSocial").ToString.Length <= 30 Then
|
||||
RegistrosPago.Append(drow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
|
||||
Else
|
||||
RegistrosPago.Append(drow("RazonSocial").ToString.Substring(0, 30))
|
||||
End If
|
||||
|
||||
RegistrosPago.Append("40") '03 tarjeta debito 40 Clabe
|
||||
|
||||
If drow("CveBanco").ToString.Trim.Length = 3 Then
|
||||
RegistrosPago.Append(drow("CveBanco").ToString.Trim)
|
||||
Else
|
||||
ErrorLayout = True
|
||||
MENSAJEError.AppendLine("Error tamaño clave banco")
|
||||
End If
|
||||
|
||||
'Motivo de pago
|
||||
If drow("Observaciones").ToString.Trim.Length > 30 Then
|
||||
RegistrosPago.Append(drow("Observaciones").ToString.Substring(0, 30))
|
||||
Else
|
||||
RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno))
|
||||
End If
|
||||
|
||||
If drow("Referencia").ToString.Trim.Length > 7 Then
|
||||
RegistrosPago.Append(drow("Referencia").ToString.Substring(0, 7))
|
||||
Else
|
||||
RegistrosPago.Append(drow("Referencia").ToString.PadRight(7, EspacioRelleno))
|
||||
End If
|
||||
|
||||
RegistrosPago.Append("H")
|
||||
|
||||
End If
|
||||
|
||||
If ErrorLayout Then
|
||||
Alert(MENSAJEError.ToString(), TipoMensaje.MsgAdvertencia)
|
||||
Exit For
|
||||
End If
|
||||
|
||||
RegistrosPago.Append(vbCrLf)
|
||||
|
||||
'CveIE
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If Not ErrorLayout Then
|
||||
|
||||
Dim NombreArchivoPago As String = ""
|
||||
|
||||
TextoCompleto = RegistrosPago.ToString
|
||||
If CreaArchivo(1) Then
|
||||
NombreArchivoPago = NombreArchivo
|
||||
End If
|
||||
|
||||
|
||||
If InsertaEnDB Then
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
ObjBancos.IniciaTransacSQL()
|
||||
|
||||
|
||||
Dim CveLayoutEnvio = ObjBancos.AddLayoutEnvios(NombreArchivo, Date.Now, CveCuenta, PorGrupos:=True)
|
||||
|
||||
If CveLayoutEnvio > 0 Then
|
||||
For Each dr As DataRow In DTPendientesTemp.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
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If ErrorLayout = False And RegistrosPago.Length > 0 Then
|
||||
|
||||
Dim Mensaje As New StringBuilder
|
||||
|
||||
Mensaje.Append("Descarga Layout<br>")
|
||||
|
||||
If NombreArchivoPago.Trim.Length > 0 Then
|
||||
Mensaje.Append($"Pagos Descarga <a class='Texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoPago}' download> {NombreArchivoPago}<a> <br><br>")
|
||||
End If
|
||||
|
||||
If NombreArchivoPago.Length > 0 Then
|
||||
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1263,6 +1308,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
TextoCompleto = String.Format("{1}{0}{2}{0}{3}{0}", vbCrLf, HeaderTexto, DetalleTexto, TrailerTexto)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CARGA ALTA PROVEEDORES"
|
||||
@@ -2082,12 +2128,13 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
CargaReporte()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaReporte()
|
||||
Private Sub CargaReporte()
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
Dim FechaF = 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) 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
|
||||
Else
|
||||
DTReportes = Nothing
|
||||
@@ -2141,7 +2188,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
End If
|
||||
|
||||
If TipoMasiva = 1 Then
|
||||
AltaProveedores(2)
|
||||
AltaProveedores(2, DTProveedores)
|
||||
Else
|
||||
GeneraAltaFyE()
|
||||
End If
|
||||
@@ -2150,7 +2197,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
Private Sub CargaProveedores()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
If ObjBancos.GetLayoutProveedores(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
If ObjBancos.GetLayoutProveedores(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, PorGrupos:=True) Then
|
||||
DTProveedores = ObjBancos.DtResultados.FiltraParametros("LEN(RFC) IN (12,13)")
|
||||
Else
|
||||
DTProveedores = Nothing
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="row">
|
||||
<label class="col-md-2">Cuenta:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="250px" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="250px" ValidationGroup="GrpGuardar" >
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
@@ -211,10 +211,37 @@ Partial Class Bancos_PolizaCheque
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuenta()
|
||||
DdlCuenta.Items.Clear()
|
||||
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
DdlCuenta.Items.Clear()
|
||||
|
||||
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
|
||||
|
||||
|
||||
|
||||
If DdlTipoTransaccion.SelectedValue.ToEntero = 3 Then
|
||||
dt = dt.FiltraParametros("CveTipoCuenta = 7")
|
||||
End If
|
||||
|
||||
'cuando es layout
|
||||
If DdlTipoTransaccion.SelectedValue.ToEntero = 9 Then
|
||||
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1))
|
||||
dt = dt.FiltraParametros("UsaLayout = 1")
|
||||
End If
|
||||
|
||||
'cuando es layout Por Grupos
|
||||
If DdlTipoTransaccion.SelectedValue.ToEntero = 17 Then
|
||||
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1))
|
||||
dt = dt.FiltraParametros("UsaLayoutGrupos = 1")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
DdlCuenta.DataSource = dt 'GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
DdlCuenta.DataBind()
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
UPPDocumento.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoTransaccion(TipoPlantilla As Integer)
|
||||
@@ -240,7 +267,8 @@ Partial Class Bancos_PolizaCheque
|
||||
'End Sub
|
||||
|
||||
Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged
|
||||
CargaFolio()
|
||||
'CargaFolio()
|
||||
CargaCuenta()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaFolio()
|
||||
@@ -1184,8 +1212,9 @@ Partial Class Bancos_PolizaCheque
|
||||
End If
|
||||
End If
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user