diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 78f93277e..d49f390ca 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -21,11 +21,13 @@ Public Class ClsClasificaciones Private Data As DataTable Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN - Private CveConexion As Integer = 0 + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + #End Region - + #Region "Propiedades" - + Public ReadOnly Property DtResultados() As DataTable Get DtResultados = Data @@ -46,7 +48,8 @@ Public Class ClsClasificaciones End Try Else SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -67,7 +70,7 @@ Public Class ClsClasificaciones #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 2db192a9c..f2506fff7 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1506,7 +1506,7 @@ Public Class ClsGenerales Return Retorno End Function - Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Boolean) As Boolean + Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Boolean, CveSATBanco As Integer, BBVAAlias As String) As Boolean Dim Retorno As Boolean = False @@ -1515,6 +1515,8 @@ Public Class ClsGenerales With SqlAdapter.SelectCommand.Parameters .Add("@CveCuentaDeposito", SqlDbType.VarChar).Value = CveCuentaDeposito .Add("@EstatusPagoElectronicoGrupos", SqlDbType.Bit).Value = EstatusPagoElectronicoGrupos + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco + .Add("@BBVAAlias", SqlDbType.VarChar).Value = BBVAAlias End With @@ -2724,7 +2726,8 @@ Public Class ClsGenerales Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1", - Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1) As Boolean + Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1, + Optional EsEntregaInterna As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -2744,6 +2747,7 @@ Public Class ClsGenerales .Add("@FechaIngFin", SqlDbType.VarChar).Value = FechaIngFin .Add("@Filtro", SqlDbType.Int).Value = Filtro .Add("@CveUsuarioEntrega", SqlDbType.Int).Value = CveUsuarioEntrega + .Add("@EsEntregaInterna", SqlDbType.Bit).Value = EsEntregaInterna End With Try SqlAdapter.Fill(Data) @@ -2833,7 +2837,7 @@ Public Class ClsGenerales DataAdapter("PA_Gral_AsignarEntregasPorRealizar") With SqlAdapter.SelectCommand.Parameters .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CvePersonal End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index fe4714eff..7849671d9 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -542,7 +542,10 @@ Public Class ClsMovimientos End With - Try + + Try + SqlAdapter.SelectCommand.CommandTimeout = 0 + SqlAdapter.Fill(Data) Retorno = True Catch ex As SqlException diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a7b7a4a24..c856c52ed 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1730,7 +1730,7 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable + Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable Get Dim Str As New StringBuilder @@ -1738,6 +1738,7 @@ Public Class ClsPaginas If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) + If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) GlobalDTAlmacen = Dv.ToTable diff --git a/App_Code/ClsUnidadesMedida.vb b/App_Code/ClsUnidadesMedida.vb index 5df5ed959..69e51e5f8 100644 --- a/App_Code/ClsUnidadesMedida.vb +++ b/App_Code/ClsUnidadesMedida.vb @@ -19,6 +19,7 @@ Public Class ClsUnidadesMedida Private disposedValue As Boolean = False 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -69,6 +70,7 @@ Public Class ClsUnidadesMedida Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -86,7 +88,7 @@ Public Class ClsUnidadesMedida #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f78d1e3bf..e9f7496a6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -341,7 +341,7 @@ Public Class ClsVentas Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, - Optional CorreoNotificacion As String = "") As Boolean + Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -431,6 +431,7 @@ Public Class ClsVentas .Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion .Add("@CveTipoRetencion", SqlDbType.TinyInt).Value = CveTipoRetencion .Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion + .Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With diff --git a/App_Code/Thalamus.vb b/App_Code/Thalamus.vb new file mode 100644 index 000000000..575b897b8 --- /dev/null +++ b/App_Code/Thalamus.vb @@ -0,0 +1,179 @@ +Imports System.IO +Imports System.Net +Imports System.Web +Imports System.Web.Services +Imports System.Web.Services.Protocols +Imports Extensiones.ModExtensiones +Imports GemBox.Spreadsheet +Imports System.Data + +' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. +' _ + + _ + _ +Public Class Thalamus + Inherits System.Web.Services.WebService + + + Public Function GenerarArchivos(CveEmpresa As Integer) As Boolean + + Dim RutaArchivoVentas As String = $"C:\Temp\Ventas{Now.ToString("yyyyMMdd")}.xlsx" + + Dim DTVentas As New DataTable + DTVentas.Columns.Add("systemId") + DTVentas.Columns.Add("Branch") + DTVentas.Columns.Add("Code") + DTVentas.Columns.Add("Sale Date") + DTVentas.Columns.Add("Quantity") + DTVentas.Columns.Add("Amount") + DTVentas.Columns.Add("Transaction ID") + + + For x = 0 To 50 + Dim dr As DataRow = DTVentas.NewRow + + dr(0) = $"systemId {x}" + dr(1) = $"Branch {x}" + dr(2) = $"{x}" + dr(3) = $"{Now.ToString("yyyy-MM-dd")}" + dr(4) = $"{x}" + dr(5) = $"{x}.00" + dr(6) = $"{x}" + + DTVentas.Rows.Add(dr) + + Next + + SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet()) + + Dim workbook = New ExcelFile + Dim worksheet = workbook.Worksheets.Add("Ventas") + + worksheet.InsertDataTable(DTVentas, + New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0 + }) + + workbook.Save(RutaArchivoVentas) + + Dim FTPServer As String = "ftp://127.0.0.1/" + Dim TFPUsr As String = "Toor" + Dim FTPPass As String = "agj-3500" + + + Dim FInfo As New FileInfo(RutaArchivoVentas) + + + Dim Carga As Boolean = CargarArchivos(FInfo.FullName, FTPServer, TFPUsr, FTPPass) + If Carga Then + Carga = VerificarArchivo(FInfo.Name, FInfo.Length, FTPServer, TFPUsr, FTPPass) + End If + + + + Return Carga + + End Function + + Private Function CargarArchivos(RutaArchivo As String, FTPServer As String, FTPUsr As String, FTPPass As String) As Boolean + + Dim Respuesta As Boolean + + Dim FInfo As New FileInfo(RutaArchivo) + + If FInfo.Exists Then + + Dim request As FtpWebRequest = DirectCast(WebRequest.Create($"{FTPServer}/{FInfo.Name}"), FtpWebRequest) + request.Method = WebRequestMethods.Ftp.UploadFile + + Dim tamanio As Integer = 1024 + Dim buffer As Byte() = New Byte(tamanio) {} + Dim byteRead As Integer = 0 + + Dim Conected As Boolean = False + + + + request.Credentials = New NetworkCredential(FTPUsr, FTPPass) + + Try + request.GetResponse() + Conected = True + Catch ex As Exception + + End Try + + + If Conected Then + + Dim ftpStream As Stream + Dim f As FileStream + + ftpStream = request.GetRequestStream + f = File.OpenRead(FInfo.FullName) + + Try + Do + byteRead = f.Read(buffer, 0, tamanio) + ftpStream.Write(buffer, 0, byteRead) + + Loop While byteRead <> 0 + + Respuesta = True + 'validar si existe archivo si coincide en tamaño + Catch ex As Exception + Respuesta = False + End Try + + + If f IsNot Nothing Then + f.Close() + End If + + If ftpStream IsNot Nothing Then + ftpStream.Close() + End If + + Else + Respuesta = False + 'no se conecto al ftp probablemente credenciales erroneas + End If + Else + Respuesta = False + 'El archivo no existe en el disco local + End If + + Return Respuesta + + End Function + + Private Function VerificarArchivo(Archivo As String, Tamanio As Long, FTPServer As String, FTPUsr As String, FTPPass As String) As Boolean + + Dim Respuesta As Boolean = False + + Dim reqSize As FtpWebRequest = DirectCast(FtpWebRequest.Create(New Uri(FTPServer & Archivo)), FtpWebRequest) + reqSize.Credentials = New NetworkCredential(FTPUsr, FTPPass) + reqSize.Method = WebRequestMethods.Ftp.GetFileSize + reqSize.UseBinary = True + + Dim loginresponse As FtpWebResponse = DirectCast(reqSize.GetResponse(), FtpWebResponse) + Dim respSize As FtpWebResponse = DirectCast(reqSize.GetResponse(), FtpWebResponse) + respSize = DirectCast(reqSize.GetResponse(), FtpWebResponse) + Dim size As Long = respSize.ContentLength + + respSize.Close() + + + If Tamanio = size Then + Respuesta = True + End If + + Return Respuesta + + + End Function + +End Class \ No newline at end of file diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 25ce1b6b2..c8a70dd0d 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4653,6 +4653,26 @@ Partial Class Bancos_IE Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + + If Dep.DtResultados.Rows.Count > 0 Then + + DdlCuentaDeposito.DataSource = Dep.DtResultados + trCuentaDeposito.Visible = True + BtnGuardar.ToolTip = "" + + Else + + BtnGuardar.Enabled = False + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + End If + + + UpGuardar.Update() + Else DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'") If Dep.DtResultados.Rows.Count > 0 Then @@ -4663,6 +4683,19 @@ Partial Class Bancos_IE End If + Else + + If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + + BtnGuardar.Enabled = False + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + Else + trCuentaDeposito.Visible = True + BtnGuardar.Enabled = True + End If + + UpGuardar.Update() End If diff --git a/Bancos/PagoElectronicoGrupos.aspx b/Bancos/PagoElectronicoGrupos.aspx index b82c69218..a79a95981 100644 --- a/Bancos/PagoElectronicoGrupos.aspx +++ b/Bancos/PagoElectronicoGrupos.aspx @@ -11,6 +11,9 @@ Pago Electrónico + + + @@ -255,6 +258,17 @@ + + + + + + + + + <%----%> @@ -480,6 +494,15 @@
  • Cuenta
  • + +
  • Tipo: + + + + + + +
  • Estatus @@ -556,7 +579,7 @@ @@ -682,7 +705,7 @@