From 7b13acd7d73edc2ad1ed3765f7815869debf42d0 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 11 Feb 2021 15:12:50 -0700 Subject: [PATCH 1/7] No duplicar empresas en listado --- Sistemas/PopUpSeleccionarEmpresa.aspx.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb index 32de18d83..c097bc7a7 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb @@ -22,7 +22,8 @@ Partial Class PopUpSeleccionarEmpresa If Dt IsNot Nothing Then If Dt.Rows.Count > 0 Then Dim NumRegistros As Integer = 0 - GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") + GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa", {"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"}) + 'GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa") From d3e892d8cd3b934fc94f08b1992f97ef8878812e Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Feb 2021 15:16:36 -0700 Subject: [PATCH 2/7] =?UTF-8?q?msg=20validaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsValidaCFDi.vb | 51 ++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/App_Code/ClsValidaCFDi.vb b/App_Code/ClsValidaCFDi.vb index 4707619ca..b946465f8 100644 --- a/App_Code/ClsValidaCFDi.vb +++ b/App_Code/ClsValidaCFDi.vb @@ -83,18 +83,18 @@ Public Class ClsValidaCFDi Return Me.EsValida End Function - Private Sub VerificaCFDI() - + Private Sub VerificaCFDI() + Dim Importe As String = LImporte.ToString("F6").PadLeft(17, "0") + Dim MsgError As String = "" + Dim MsgError2 As String = "" Try Dim wsConsultaCFDI As New wsValidaCFDi2.ConsultaCFDIServiceClient - Dim oAcuse As New wsValidaCFDi2.Acuse - - 'oAcuse = wsConsultaCFDI.Consulta("?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075") - '?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075 - - Dim Importe As String = LImporte.ToString("F6").PadLeft(17, "0") - + Dim oAcuse As New wsValidaCFDi2.Acuse + + 'oAcuse = wsConsultaCFDI.Consulta("?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075") + '?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075 + oAcuse = wsConsultaCFDI.Consulta(String.Format("?re={0}&rr={1}&tt={2}&id={3}", LRFCEmisor, LRFCReceptor, Importe, LFolioFiscal.ToUpper)) 'oAcuse = wsConsultaCFDI.Consulta("?re=LESA6211234B2&rr=GCO890418M56&tt=0000001360.000000&id=0C8BAD9C-A8C6-4A48-8FF5-0687AC6F1581") 'Alert(oAcuse.Estado) @@ -106,12 +106,19 @@ Public Class ClsValidaCFDi End If If oAcuse.ValidacionEFOS = "100" Then - EnListaEFOS = True + EnListaEFOS = True Else EnListaEFOS = False - End If - - 'SI NO PUEDE ENCONTRAR EL ESTATUS UTILIZA EL SERVICIO PARA ESTATUS DE CANCELACION + End If + Catch ex As Exception + MsgError = "Op1. No se pudo validar la vigencia ante el SAT " + GuardaLog(ex.Message) + End Try + + Try + + + 'SI NO PUEDE ENCONTRAR EL ESTATUS UTILIZA EL SERVICIO PARA ESTATUS DE CANCELACION If EsValida = 0 Then Dim Vigencia = Timbrado.VerificarVigenciaSAT(LFolioFiscal.ToUpper, LRFCEmisor, LRFCReceptor, Importe, True) @@ -132,18 +139,24 @@ Public Class ClsValidaCFDi End If Else EsValida = 0 + End If Else EsValida = 0 End If - End If - - Catch ex As Exception - OnError("Ocurrió un error al consultar la vigencia ante el SAT", ex) - End Try + End If + Catch ex As Exception + MsgError2 = "Op2. No se pudo validar la vigencia ante el SAT " + GuardaLog(ex.Message) + End Try + 'sino se pudo validar, que muestre el mensaje de error, pero solo un mensaje + If EsValida = 0 AndAlso (MsgError <> "" OrElse MsgError2 <> "") Then + If MsgError <> "" Then Alert(MsgError, TipoMensaje.MsgError) Else If MsgError2 <> "" Then Alert(MsgError2, TipoMensaje.MsgError) + End If + End Sub - Private Sub Verificar() + Private Sub VerificaWeb() Try Dim URL As String = "https://verificacfdi.facturaelectronica.sat.gob.mx/" From 16eabbea8bc8e4991ba9ab18e9739955ef1a8a8c Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Feb 2021 15:16:49 -0700 Subject: [PATCH 3/7] -- parametro de empresa, en entregaalmacen --- App_Code/ClsInventarios.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 0fd71e90d..c4c0b3881 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2918,11 +2918,12 @@ Public Class ClsInventarios #End Region #Region " INVENTARIOS - VENTAS " - Public Function EntregaAlmacenGet(CveVenta As Integer) As Boolean + Public Function EntregaAlmacenGet(CveVenta As Integer, Optional CveAlmacen As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_EntregaAlmacenGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen End With Try SqlAdapter.Fill(Data) From 0d9cc827be741a3497e7335adeeda0868b17ed40 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Feb 2021 15:17:05 -0700 Subject: [PATCH 4/7] - msg --- CRM/CatEmpresasCRM.aspx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/CatEmpresasCRM.aspx.cs b/CRM/CatEmpresasCRM.aspx.cs index 7a539f16b..61451a357 100644 --- a/CRM/CatEmpresasCRM.aspx.cs +++ b/CRM/CatEmpresasCRM.aspx.cs @@ -221,7 +221,7 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas } else { - Alert(String.Format("El Giro de Empresa '{0}'", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia); + Alert(String.Format("El Giro de Empresa '{0}', No está especificado", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia); TieneError = true; break; } From f367897bdc9b9c52d7b73ecf3a10276790417018 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Feb 2021 15:17:38 -0700 Subject: [PATCH 5/7] -- cambio de round --- Inventarios/EntregaAlmacen.aspx.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 2cac3b0ce..150e711f8 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2884,7 +2884,7 @@ Partial Class Inventarios_EntregaAlmacen Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero() Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString() Dim Serie As String = ObjVentas.DtResultados(0)("SerieFolio").ToString() - Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL() + Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD() Dim TotalCostoAcumulado As Decimal = 0 Dim cont As Integer = 1 @@ -2898,13 +2898,13 @@ Partial Class Inventarios_EntregaAlmacen ValorMultiplicador = -1 End If - Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/EntregaAlmacen", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) 'Se agrega movimiento separado por la cuenta de ventas (ER) If CvePrePoliza > 0 Then For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL() + ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD() TotalCostoAcumulado += ValorInventario 'cuando es el último movimiento y hay diferencias en los importes From 6f83deba2a4f485f2ed788ba786ce4156010a7c6 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Feb 2021 15:18:00 -0700 Subject: [PATCH 6/7] - liberacion con serie --- RH/Personal.aspx | 6 +++--- RH/Personal.aspx.vb | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index f98389e8e..7470dab84 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -833,7 +833,7 @@ - @@ -1302,7 +1302,7 @@
- + @@ -1311,7 +1311,7 @@
- + diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 0224875e2..c54647919 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -5183,6 +5183,10 @@ Partial Class RH_Personal If row.DataKey("AplicaSerie").ToString = "True" Then divSerie.Visible = True + TxtLiberarSerie.Text = row.DataKey("Serie") + TxtLiberarSerie.Enabled = False + TxtCantidadResguardo.Enabled = False + TxtCantidadResguardo.Text = "1" End If From 0c5087eee61d5489a0220951891097e530f6653a Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Feb 2021 15:20:06 -0700 Subject: [PATCH 7/7] -- acceso de usuarios de portales --- LogIn.aspx.vb | 101 ++++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/LogIn.aspx.vb b/LogIn.aspx.vb index e82ce6868..0adbb361c 100644 --- a/LogIn.aspx.vb +++ b/LogIn.aspx.vb @@ -199,71 +199,74 @@ Partial Class LogIn 'Dim UsuarioAsignaciones As Usuario = Nothing Dim isgps = Request.Url.Host.ToUpper().Contains("SIGNALSGPS".ToUpper()) - Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI, CvePlataforma:=If(isgps, 3, 1)) + Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI, CvePlataforma:=If(isgps, 3, -1)) 'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa) + If Not isgps AndAlso Usuario IsNot Nothing AndAlso Usuario.CvePlataforma = 3 Then ' SI ES de la plataforma 3(GPS), no debe de entar por liga normal + Usuario = Nothing + End If ADSSessionConfig.sessionUser = Usuario - ADSSessionConfig.sessionDpage = False - ObjUsuario.Dispose() - If Usuario IsNot Nothing Then - If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then + ADSSessionConfig.sessionDpage = False + ObjUsuario.Dispose() + If Usuario IsNot Nothing Then + If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then - CreaObjetoEmpresa(Usuario) - ADSSessionConfig.sessionUser.MultipleEmpresa = True + CreaObjetoEmpresa(Usuario) + ADSSessionConfig.sessionUser.MultipleEmpresa = True - Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa) - Dim _sessionid = Encripta(String.Format("{0}|{1}", Usuario.CveUsuario, x.SessionID)) - x = ADSSessionConfig.SessionManager(OpcionSession.agregarSession, x) + Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa) + Dim _sessionid = Encripta(String.Format("{0}|{1}", Usuario.CveUsuario, x.SessionID)) + x = ADSSessionConfig.SessionManager(OpcionSession.agregarSession, x) - If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then - 'PLATAFORMA PORTAL CLIENTE - 'FormsAuthentication.RedirectFromLoginPage(_sessionid, False) - 'Response.Redirect("/PortalCliente/PortalCliente.aspx", True) + If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then + 'PLATAFORMA PORTAL CLIENTE + 'FormsAuthentication.RedirectFromLoginPage(_sessionid, False) + 'Response.Redirect("/PortalCliente/PortalCliente.aspx", True) - ReturnUrl = "/PortalCliente/PortalCliente.aspx" - ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then - 'PLATAFORMA PORTAL PROVEEDOR - 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False) - 'Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True) + ReturnUrl = "/PortalCliente/PortalCliente.aspx" + ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then + 'PLATAFORMA PORTAL PROVEEDOR + 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False) + 'Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True) - ReturnUrl = "/PortalProveedor/PortalProveedor.aspx" - ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then - 'PLATAFORMA GPS - Usuario.CvePlataforma = 3 - 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False) - 'Response.Redirect("/PortalGPS/InicioGPS.aspx", True) - ReturnUrl = "/PortalGPS/InicioGPS.aspx" - Else - 'PLATAFORMA SIG - CType(Session("UsuarioSIG"), Usuario).CvePlataforma = 1 - Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario) - If dt IsNot Nothing Then - If dt.Rows.Count >= 1 Then - If dt.Rows.Count > 1 Then - Usuario.MultipleEmpresa = True + ReturnUrl = "/PortalProveedor/PortalProveedor.aspx" + ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then + 'PLATAFORMA GPS + Usuario.CvePlataforma = 3 + 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False) + 'Response.Redirect("/PortalGPS/InicioGPS.aspx", True) + ReturnUrl = "/PortalGPS/InicioGPS.aspx" + Else + 'PLATAFORMA SIG + CType(Session("UsuarioSIG"), Usuario).CvePlataforma = 1 + Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario) + If dt IsNot Nothing Then + If dt.Rows.Count >= 1 Then + If dt.Rows.Count > 1 Then + Usuario.MultipleEmpresa = True + End If + 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False) End If - 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False) End If + dt.Dispose() End If - dt.Dispose() + + Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False) + Response.Cookies.Add(cookie) + RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, "")) + 'Response.Redirect(ReturnUrl, True) + Else + Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia) End If + 'If Usuario.Acceso > 0 Then - Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False) - Response.Cookies.Add(cookie) - RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, "")) - 'Response.Redirect(ReturnUrl, True) + 'Else + ' Alert("Usuario con acceso limitado.", TipoMensaje.MsgAdvertencia) + 'End If Else - Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia) + Alert("Usuario y/o Contraseña incorrectos.", TipoMensaje.MsgAdvertencia) End If - 'If Usuario.Acceso > 0 Then - - 'Else - ' Alert("Usuario con acceso limitado.", TipoMensaje.MsgAdvertencia) - 'End If - Else - Alert("Usuario y/o Contraseña incorrectos.", TipoMensaje.MsgAdvertencia) End If - End If End Sub Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)