|
|
|
|
@@ -516,10 +516,10 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
AltaProveedores(1)
|
|
|
|
|
AltaProveedores()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub AltaProveedores(TipoAlta As Integer, Optional DtCuentasPendientesTemp As DataTable = Nothing)
|
|
|
|
|
Private Sub AltaProveedores(Optional DtCuentasPendientesTemp As DataTable = Nothing)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NombreArchivo = ""
|
|
|
|
|
@@ -646,7 +646,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
|
|
|
|
|
SBTmpInterbancarias.Append("0999999999999.99")
|
|
|
|
|
|
|
|
|
|
If dRow("RazonSocial").ToString.Trim.Length <31 Then 'Tamaño maximo 30
|
|
|
|
|
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))
|
|
|
|
|
@@ -1091,124 +1091,124 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub GeneraPagoViejo(DTTemp As DataTable, CveBLE As Integer)
|
|
|
|
|
If DTTemp.Rows.Count <= 0 Then
|
|
|
|
|
Alert("No hay registros para generar", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
'Private Sub GeneraPagoViejo(DTTemp As DataTable, CveBLE As Integer)
|
|
|
|
|
' If DTTemp.Rows.Count <= 0 Then
|
|
|
|
|
' Alert("No hay registros para generar", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
' Exit Sub
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
'For Each gvr As DataRow In DTTemp.Rows
|
|
|
|
|
' If gvr("EstatusPagoElectronico").ToString.ToEntero <= 0 Then
|
|
|
|
|
' Alert("Los proveedores tienen que estar dados de alta. Primero de alta a los proveedores")
|
|
|
|
|
' Exit Sub
|
|
|
|
|
' End If
|
|
|
|
|
'Next
|
|
|
|
|
' 'For Each gvr As DataRow In DTTemp.Rows
|
|
|
|
|
' ' If gvr("EstatusPagoElectronico").ToString.ToEntero <= 0 Then
|
|
|
|
|
' ' Alert("Los proveedores tienen que estar dados de alta. Primero de alta a los proveedores")
|
|
|
|
|
' ' Exit Sub
|
|
|
|
|
' ' End If
|
|
|
|
|
' 'Next
|
|
|
|
|
|
|
|
|
|
'Comprobamos la cuenta deposito y moneda de las cuentas deposito
|
|
|
|
|
For Each dr As DataRow In DTTemp.Rows
|
|
|
|
|
If dr("BancoNombre").ToString = "" Then
|
|
|
|
|
Alert(String.Format("El Pago <b>'{0}'</b> no tiene Cuenta Deposito Asociada.", dr("Observaciones")), TipoMensaje.MsgError)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
' 'Comprobamos la cuenta deposito y moneda de las cuentas deposito
|
|
|
|
|
' For Each dr As DataRow In DTTemp.Rows
|
|
|
|
|
' If dr("BancoNombre").ToString = "" Then
|
|
|
|
|
' Alert(String.Format("El Pago <b>'{0}'</b> no tiene Cuenta Deposito Asociada.", dr("Observaciones")), TipoMensaje.MsgError)
|
|
|
|
|
' Exit Sub
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
If dr("MonedaCtaDeposito").ToString = "" Or dr("MonedaCtaDeposito").ToString.ToEntero <= 0 Then
|
|
|
|
|
Alert(String.Format("La cuenta deposito <b>'{0}'</b> del proveedor <b>'{1}'</b> no tiene Moneda especificada.", dr("CuentaDeposito"), dr("RazonSocial")), TipoMensaje.MsgError)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
' If dr("MonedaCtaDeposito").ToString = "" Or dr("MonedaCtaDeposito").ToString.ToEntero <= 0 Then
|
|
|
|
|
' Alert(String.Format("La cuenta deposito <b>'{0}'</b> del proveedor <b>'{1}'</b> no tiene Moneda especificada.", dr("CuentaDeposito"), dr("RazonSocial")), TipoMensaje.MsgError)
|
|
|
|
|
' Exit Sub
|
|
|
|
|
' End If
|
|
|
|
|
' Next
|
|
|
|
|
|
|
|
|
|
'Excluimos los registros que no tengan cuenta deposito dada de alta
|
|
|
|
|
'DTTemp = DTTemp.FiltraParametros("EstatusPagoElectronico = 0")
|
|
|
|
|
' 'Excluimos los registros que no tengan cuenta deposito dada de alta
|
|
|
|
|
' 'DTTemp = DTTemp.FiltraParametros("EstatusPagoElectronico = 0")
|
|
|
|
|
|
|
|
|
|
HeaderTexto = ""
|
|
|
|
|
DetalleTexto = ""
|
|
|
|
|
TrailerTexto = ""
|
|
|
|
|
TotalAcumulado = 0
|
|
|
|
|
' HeaderTexto = ""
|
|
|
|
|
' DetalleTexto = ""
|
|
|
|
|
' TrailerTexto = ""
|
|
|
|
|
' TotalAcumulado = 0
|
|
|
|
|
|
|
|
|
|
'Insertar en LayoutEnvios
|
|
|
|
|
Dim ObjBancos As New ClsBancos
|
|
|
|
|
ObjBancos.IniciaTransacSQL()
|
|
|
|
|
Dim ErrorLayout = False
|
|
|
|
|
' 'Insertar en LayoutEnvios
|
|
|
|
|
' Dim ObjBancos As New ClsBancos
|
|
|
|
|
' ObjBancos.IniciaTransacSQL()
|
|
|
|
|
' Dim ErrorLayout = False
|
|
|
|
|
|
|
|
|
|
Dim TotalDetalles As Integer = 0
|
|
|
|
|
' Dim TotalDetalles As Integer = 0
|
|
|
|
|
|
|
|
|
|
'CREA CARPETA SI NO EXISTE
|
|
|
|
|
Dim path As String = Server.MapPath(String.Format("~/Empresas/{0}/Layout/", UsuarioActual.CveEmpresa))
|
|
|
|
|
Dim exists = System.IO.Directory.Exists(path)
|
|
|
|
|
If Not exists Then
|
|
|
|
|
System.IO.Directory.CreateDirectory(path)
|
|
|
|
|
End If
|
|
|
|
|
' 'CREA CARPETA SI NO EXISTE
|
|
|
|
|
' Dim path As String = Server.MapPath(String.Format("~/Empresas/{0}/Layout/", UsuarioActual.CveEmpresa))
|
|
|
|
|
' Dim exists = System.IO.Directory.Exists(path)
|
|
|
|
|
' If Not exists Then
|
|
|
|
|
' System.IO.Directory.CreateDirectory(path)
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
Dim CveIEs = ""
|
|
|
|
|
CreaDtPago()
|
|
|
|
|
' Dim CveIEs = ""
|
|
|
|
|
' CreaDtPago()
|
|
|
|
|
|
|
|
|
|
For Each gvr As DataRow In DTTemp.Rows
|
|
|
|
|
If gvr("CveCuentaDeposito").ToString <> "" Then
|
|
|
|
|
DTPendienteActual = DTTemp.FiltraParametros(String.Format("CveIE = {0}", gvr("CveIE").ToString))
|
|
|
|
|
' For Each gvr As DataRow In DTTemp.Rows
|
|
|
|
|
' If gvr("CveCuentaDeposito").ToString <> "" Then
|
|
|
|
|
' DTPendienteActual = DTTemp.FiltraParametros(String.Format("CveIE = {0}", gvr("CveIE").ToString))
|
|
|
|
|
|
|
|
|
|
'ACTUALIZA FECHADOCUMENTO DEL IE
|
|
|
|
|
'If CveBLE > 0 Then
|
|
|
|
|
' ObjBancos.UpdateBancos_IE(Date.Now, Date.Now, DTPendienteActual(0)("CveIE").ToString.ToEntero)
|
|
|
|
|
'End If
|
|
|
|
|
' 'ACTUALIZA FECHADOCUMENTO DEL IE
|
|
|
|
|
' 'If CveBLE > 0 Then
|
|
|
|
|
' ' ObjBancos.UpdateBancos_IE(Date.Now, Date.Now, DTPendienteActual(0)("CveIE").ToString.ToEntero)
|
|
|
|
|
' 'End If
|
|
|
|
|
|
|
|
|
|
If TotalDetalles > 0 Then
|
|
|
|
|
DetalleTexto &= vbCrLf
|
|
|
|
|
End If
|
|
|
|
|
CrearDetallePagos()
|
|
|
|
|
TotalDetalles += 1
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
' If TotalDetalles > 0 Then
|
|
|
|
|
' DetalleTexto &= vbCrLf
|
|
|
|
|
' End If
|
|
|
|
|
' CrearDetallePagos()
|
|
|
|
|
' TotalDetalles += 1
|
|
|
|
|
' End If
|
|
|
|
|
' Next
|
|
|
|
|
|
|
|
|
|
FormarTextoPagos(TotalDetalles, TotalAcumulado.ToString.FormatoNumero.Replace(",", "").Replace(".", ""))
|
|
|
|
|
CreaArchivo(1)
|
|
|
|
|
' FormarTextoPagos(TotalDetalles, TotalAcumulado.ToString.FormatoNumero.Replace(",", "").Replace(".", ""))
|
|
|
|
|
' CreaArchivo(1)
|
|
|
|
|
|
|
|
|
|
If CveBLE > 0 Then
|
|
|
|
|
'ACTUALIZAMOS EL ENVIO SI ES REGENERACION
|
|
|
|
|
If Not ObjBancos.UpdateLayoutEnvios(CveBLE, Date.Now) Then
|
|
|
|
|
ErrorLayout = True
|
|
|
|
|
End If
|
|
|
|
|
' If CveBLE > 0 Then
|
|
|
|
|
' 'ACTUALIZAMOS EL ENVIO SI ES REGENERACION
|
|
|
|
|
' If Not ObjBancos.UpdateLayoutEnvios(CveBLE, Date.Now) Then
|
|
|
|
|
' ErrorLayout = True
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
'GUARDAMOS EL ENVIO SI NO ES REGENERACION
|
|
|
|
|
Else
|
|
|
|
|
' 'GUARDAMOS EL ENVIO SI NO ES REGENERACION
|
|
|
|
|
' Else
|
|
|
|
|
|
|
|
|
|
Dim CveLayoutEnvio = ObjBancos.AddLayoutEnvios(NombreArchivo, Date.Now, CveCuenta)
|
|
|
|
|
' Dim CveLayoutEnvio = ObjBancos.AddLayoutEnvios(NombreArchivo, Date.Now, CveCuenta)
|
|
|
|
|
|
|
|
|
|
If CveLayoutEnvio > 0 Then
|
|
|
|
|
For Each dr As DataRow In DTTemp.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
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Else
|
|
|
|
|
ErrorLayout = True
|
|
|
|
|
End If
|
|
|
|
|
' If CveLayoutEnvio > 0 Then
|
|
|
|
|
' For Each dr As DataRow In DTTemp.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
|
|
|
|
|
' End If
|
|
|
|
|
' End If
|
|
|
|
|
' Next
|
|
|
|
|
' Else
|
|
|
|
|
' ErrorLayout = True
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If Not ErrorLayout Then
|
|
|
|
|
ObjBancos.Commit()
|
|
|
|
|
ObjBancos.Dispose()
|
|
|
|
|
' If Not ErrorLayout Then
|
|
|
|
|
' ObjBancos.Commit()
|
|
|
|
|
' ObjBancos.Dispose()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dim Des = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
|
|
|
|
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=""fncp();"">Descargar Reporte</a></li>", NombreArchivo)
|
|
|
|
|
' Dim Des = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
|
|
|
|
' 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=""fncp();"">Descargar Reporte</a></li>", NombreArchivo)
|
|
|
|
|
|
|
|
|
|
Alert(String.Format("<br />El Layout fue creado satisfactoriamente.<br /><br /><br />Descargas:<ul>{0}</ul>", Descargas), TipoMensaje.MsgInformacion)
|
|
|
|
|
'Alert("El Layout fue creado satisfactoriamente")
|
|
|
|
|
Else
|
|
|
|
|
ObjBancos.RollBack()
|
|
|
|
|
ObjBancos.Dispose()
|
|
|
|
|
Alert("Ocurrio un problema al registrar la creacion del Layout. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
|
|
|
End If
|
|
|
|
|
' Alert(String.Format("<br />El Layout fue creado satisfactoriamente.<br /><br /><br />Descargas:<ul>{0}</ul>", Descargas), TipoMensaje.MsgInformacion)
|
|
|
|
|
' 'Alert("El Layout fue creado satisfactoriamente")
|
|
|
|
|
' Else
|
|
|
|
|
' ObjBancos.RollBack()
|
|
|
|
|
' ObjBancos.Dispose()
|
|
|
|
|
' Alert("Ocurrio un problema al registrar la creacion del Layout. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
|
|
|
' End If
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
'End Sub
|
|
|
|
|
|
|
|
|
|
Protected Sub CrearDetallePagos()
|
|
|
|
|
'Dim Resultado = True
|
|
|
|
|
@@ -1895,10 +1895,220 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
|
|
|
|
|
'FUNCIONARIO O EMPLEADO
|
|
|
|
|
#Region " ALTA FUNCIONARIO "
|
|
|
|
|
|
|
|
|
|
Private Sub AltaFyE(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 = ""
|
|
|
|
|
|
|
|
|
|
Dim CeroRelleno As Char = "0"c
|
|
|
|
|
Dim EspacioRelleno As Char = Chr(32)
|
|
|
|
|
Dim ErrorLayout = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If DtCuentasPendientesTemp Is Nothing Then
|
|
|
|
|
DtCuentasPendientesTemp = DTFyE.Copy
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DtCuentasPendientesTemp.CaseSensitive = False
|
|
|
|
|
|
|
|
|
|
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' ) ", "", {"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%' ) ", "", {"BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "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
|
|
|
|
|
|
|
|
|
|
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("CLABEDestino").ToString.Trim = "" Then
|
|
|
|
|
SBErroresBancomer.Append("La cuenta beneficiaria no puede ser nula,")
|
|
|
|
|
ErrorLineaBancomer = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
SBTmpBancomer.Append("0999999999999.99")
|
|
|
|
|
|
|
|
|
|
If dRow("RazonSocial").ToString.Trim.Length < 31 Then 'Tamaño maximo 30
|
|
|
|
|
SBTmpBancomer.Append(dRow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
|
|
|
|
|
Else
|
|
|
|
|
SBTmpBancomer.Append(dRow("RazonSocial").ToString.Trim.Substring(0, 30))
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'ALIAS DE LA CUENTA PENDIENTE TAMAÑO MAXIMO 30
|
|
|
|
|
SBTmpBancomer.Append(dRow("BBVAAlias").ToString.PadRight(30, EspacioRelleno))
|
|
|
|
|
|
|
|
|
|
'CORREO OPCIONAL TAMAÑO MAXIMO 80
|
|
|
|
|
'RegistrosAlta.Append("".ToString.PadLeft(80, EspacioRelleno))
|
|
|
|
|
|
|
|
|
|
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, True) Then
|
|
|
|
|
NombreArchivoBancomer = NombreArchivo
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If DtCuentasPendientesInterbancarias.Rows.Count > 0 Then
|
|
|
|
|
|
|
|
|
|
For Each dRow As DataRow In DtCuentasPendientesInterbancarias.Rows
|
|
|
|
|
|
|
|
|
|
Dim SBTmpInterbancarias As New StringBuilder
|
|
|
|
|
Dim SBErroresInterBancario As New StringBuilder
|
|
|
|
|
Dim ErrorLineaInterbancaria As Boolean = False
|
|
|
|
|
|
|
|
|
|
SBErroresInterBancario.Append($"{dRow("RazonSocial").ToString } ")
|
|
|
|
|
SBErroresInterBancario.Append($"Cuenta: {dRow("Cuenta").ToString } ")
|
|
|
|
|
|
|
|
|
|
If dRow("CveBanco").ToString.Trim.Length = 3 Then
|
|
|
|
|
SBTmpInterbancarias.Append(dRow("CveBanco").ToString.Trim)
|
|
|
|
|
Else
|
|
|
|
|
SBErroresInterBancario.Append("clave ABM(Clave SAT) incorrecta, ")
|
|
|
|
|
ErrorLineaInterbancaria = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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("CLABEDestino").ToString.Trim = "" Then
|
|
|
|
|
SBErroresInterBancario.Append("La cuenta beneficiaria no puede ser nula,")
|
|
|
|
|
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))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'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
|
|
|
|
|
|
|
|
|
|
If RegistrosAltaInterbancario.Length > 0 Then
|
|
|
|
|
TextoCompleto = RegistrosAltaInterbancario.ToString
|
|
|
|
|
If CreaArchivo(2, False) Then
|
|
|
|
|
NombreArchivoInterbancario = NombreArchivo
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dim Mensaje As New StringBuilder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>")
|
|
|
|
|
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> <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
|
|
|
|
|
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub CargaFyE()
|
|
|
|
|
Dim ObjBancos As New ClsBancos
|
|
|
|
|
|
|
|
|
|
If ObjBancos.GetLayoutFyE(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
|
|
|
If ObjBancos.GetLayoutFyE(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, PorGrupos:=True) Then
|
|
|
|
|
DTFyE = ObjBancos.DtResultados.FiltraParametros("LEN(RFC) IN (13)")
|
|
|
|
|
Else
|
|
|
|
|
DTFyE = Nothing
|
|
|
|
|
@@ -1912,6 +2122,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
|
|
|
|
|
UpProveedores.Update()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub GeneraAltaFyE()
|
|
|
|
|
Dim DtTemp As DataTable = Nothing
|
|
|
|
|
|
|
|
|
|
@@ -2017,6 +2228,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub GeneraAltaDetalleFyE()
|
|
|
|
|
Dim Resultado = True
|
|
|
|
|
Dim CuentaDeposito As String = ""
|
|
|
|
|
@@ -2100,6 +2312,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
Row("Cuenta") = String.Format("{0}", CuentaDeposito)
|
|
|
|
|
DtAlta.Rows.Add(Row)
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Protected Sub FormarTextoAltaFyE(Registros As Integer)
|
|
|
|
|
'''''' LLENADO HEADER
|
|
|
|
|
Dim convenio As String = DTPendienteActual(0)("ConvenioPagoElectronico").ToString
|
|
|
|
|
@@ -2118,6 +2331,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
TextoCompleto = String.Format("{1}{0}{2}{0}{3}{0}", vbCrLf, HeaderTexto, DetalleTexto, TrailerTexto)
|
|
|
|
|
'TxtAltas.Text = TextoCompleto
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2188,9 +2402,9 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If TipoMasiva = 1 Then
|
|
|
|
|
AltaProveedores(2, DTProveedores)
|
|
|
|
|
AltaProveedores(DTProveedores)
|
|
|
|
|
Else
|
|
|
|
|
GeneraAltaFyE()
|
|
|
|
|
AltaFyE()
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|