From 679463df7280d74d1c8cebed43d2a89c53922e77 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 20 Jul 2022 17:00:22 -0700 Subject: [PATCH] Inicio PS por caducar y RSCO Por Vencer, Avance descarga Ingresos --- App_Code/ClsInventarios.vb | 4 +- App_Code/ClsPaginas.vb | 2 + Compras/ReembolsosComprobaciones.aspx.vb | 5 + Compras/eFacturas.aspx | 6 +- Compras/eFacturas.aspx.vb | 243 +++++++---- CxC/RepCxCDetalle.aspx | 12 +- CxC/RepCxCDetalle.aspx.vb | 18 +- Empresas/119/Formatos/Nomina.rdlc | 23 +- Inicio.aspx | 135 ++++++ Inicio.aspx.vb | 57 +++ Inventarios/RepExistenciasCostos.aspx | 3 +- Inventarios/RepExistenciasCostos.aspx.vb | 29 +- SAT/SolicitudesIngresoSat.aspx | 515 ++++++++++++++++++++++ SAT/SolicitudesIngresoSat.aspx.cs | 534 +++++++++++++++++++++++ 14 files changed, 1472 insertions(+), 114 deletions(-) create mode 100644 SAT/SolicitudesIngresoSat.aspx create mode 100644 SAT/SolicitudesIngresoSat.aspx.cs diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 81a59e8f0..6bc4d1389 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5963,7 +5963,7 @@ Public Class ClsInventarios - Public Function RepCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer) As Boolean + Public Function RepCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer, Optional ConCaducidad As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CompuestosVigenciaRep") @@ -5976,6 +5976,8 @@ Public Class ClsInventarios .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@VigenciaIndeterminada", SqlDbType.Int).Value = VigenciaIndeterminada .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@ConCaducidad", SqlDbType.Bit).Value = ConCaducidad + End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 618a4b02b..22e5718a3 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5393,7 +5393,9 @@ Public Class ClsPaginas PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder PaginaDict.Add("/RH/CatChecadores.aspx".ToUpper(), 694) PaginaDict.Add("/RH/CatRegistroPatronal.aspx".ToUpper(), 1324) + PaginaDict.Add("/SAT/SolicitudesNominaSat.aspx".ToUpper(), 545) + PaginaDict.Add("/SAT/SolicitudesIngresoSat.aspx".ToUpper(), -1) #End Region #Region "Sistema" 'Cargo las páginas que deben tener restricción diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 0b6f58bdc..adea81f2d 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -852,6 +852,11 @@ Partial Class Compras_ReembolsosComprobaciones ConceptoContableRetIVAAcreditable = 249 CveFunc = 313 CveFuncAcreditable = 314 + Case 5 + ConceptoContableRetIVAXAcreditar = 285 + ConceptoContableRetIVAAcreditable = 286 + CveFunc = 578 + CveFuncAcreditable = 578 End Select If UsuarioActual.Empresa.TipoContabilidad = 2 Then diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index 153b98772..a113abc55 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -59,10 +59,10 @@
  • Validación Masiva
  • -
  • - <%----%> + <%--
  • + Descarga Facturas SAT -
  • + --%>
  • Solicitudes SAT
  • diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index cbe08a479..ca4dcbbd6 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -6,6 +6,10 @@ Imports System.Diagnostics Imports System.Globalization Imports System.IO Imports System.IO.Compression +Imports System.Net.Http +Imports System.Net.Http.Headers +Imports System.Threading +Imports System.Threading.Tasks Imports System.Xml Imports ADSistemaLibrary.SatXml Imports ADSistemaLibrary.SatXml.XmlSatCFDI @@ -760,7 +764,7 @@ Partial Class Compras_eFacturas If UsuarioActual.Sesion("eFact-Proveedor").ToString <> "" Then TxtProveedor.Text = UsuarioActual.Sesion("eFact-Proveedor").ToString.Trim If UsuarioActual.Sesion("eFact-FI").ToString <> "" Then txtFechaI.Text = UsuarioActual.Sesion("eFact-FI").ToString.Trim If UsuarioActual.Sesion("eFact-FF").ToString <> "" Then txtFechaF.Text = UsuarioActual.Sesion("eFact-FF").ToString.Trim - If UsuarioActual.CveUsuario = 100 Then lbDescargar.Visible = True + 'If UsuarioActual.CveUsuario = 100 Then lbDescargar.Visible = True 'If UsuarioActual.TienePermisoProceso(81) Then GvD.Columns(11).Visible = True : GvD.Columns(12).Visible = True 'If UsuarioActual.TienePermisoProceso(206) Then GvD.Columns(10).Visible = False @@ -2575,9 +2579,9 @@ Partial Class Compras_eFacturas Using nom As ClsNominas = New ClsNominas() Continuar = nom.SolicitudesAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa, 2) - 'Dim api = New GeneralesAPI() - 'api.GeneraSolicitud() - 'api.VerificaSolicitudesNominas() + Dim api = New GeneralesAPIeFacturas() + api.GeneraSolicitud() + api.VerificaSolicitudesNominas() End Using If Continuar Then @@ -2590,99 +2594,71 @@ Partial Class Compras_eFacturas End Sub Protected Sub LnkverificarSolicitudes_Click(ByVal sender As Object, ByVal e As EventArgs) - 'Dim api = New GeneralesAPI() - 'api.GeneraSolicitud() - 'api.VerificaSolicitudesNominas() + Dim api = New GeneralesAPIeFacturas() + api.GeneraSolicitud() + api.VerificaSolicitudesNominas() cargasolicitudes() End Sub #End Region #Region "D E S C A R G A R - F A C T U R A " - Protected Sub lbDescargar_Click(sender As Object, e As EventArgs) Handles lbDescargar.Click + 'Protected Sub lbDescargar_Click(sender As Object, e As EventArgs) Handles lbDescargar.Click - Dim Retorno As Boolean = False + ' Dim Retorno As Boolean = False - Dim ObjProcess As Process = Nothing - Dim Mensajes As String = "" - Dim error1 As Boolean = False - Dim CountProcesados As Integer = 0 + ' Dim ObjProcess As Process = Nothing + ' Dim Mensajes As String = "" + ' Dim error1 As Boolean = False + ' Dim CountProcesados As Integer = 0 - Try - ObjProcess = New Process() - ObjProcess.StartInfo.RedirectStandardOutput = True - ObjProcess.StartInfo.FileName = Ejecutable - ObjProcess.StartInfo.Arguments = $"--mod dsat2 --cveemp {UsuarioActual.CveEmpresa} --rfc {UsuarioActual.Empresa.RFC} --ciec {UsuarioActual.Empresa.CIEC} --razon {UsuarioActual.Empresa.Empresa} --fi {txtFechaI.Text} --ff {txtFechaF.Text}" - ObjProcess.StartInfo.UseShellExecute = False - ObjProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal - ObjProcess.Start() + ' Try + ' ObjProcess = New Process() + ' ObjProcess.StartInfo.RedirectStandardOutput = True + ' ObjProcess.StartInfo.FileName = Ejecutable + ' ObjProcess.StartInfo.Arguments = $"--mod dsat2 --cveemp {UsuarioActual.CveEmpresa} --rfc {UsuarioActual.Empresa.RFC} --ciec {UsuarioActual.Empresa.CIEC} --razon {UsuarioActual.Empresa.Empresa} --fi {txtFechaI.Text} --ff {txtFechaF.Text}" + ' ObjProcess.StartInfo.UseShellExecute = False + ' ObjProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal + ' ObjProcess.Start() - Dim myStreamReader As StreamReader = ObjProcess.StandardOutput + ' Dim myStreamReader As StreamReader = ObjProcess.StandardOutput - 'Read the standard output of the spawned process. - Mensajes = myStreamReader.ReadLine() - If Mensajes.Length > 0 Then + ' 'Read the standard output of the spawned process. + ' Mensajes = myStreamReader.ReadLine() + ' If Mensajes.Length > 0 Then - Dim msgs As String() = Mensajes.Split("|"c) - Dim NFacturas As Integer = 0 + ' Dim msgs As String() = Mensajes.Split("|"c) + ' Dim NFacturas As Integer = 0 - If msgs.Length >= 2 Then - Try - NFacturas = msgs(0).ToEntero - CountProcesados = msgs(0).ToEntero - Mensajes = $"La actualización se realizó correctamente.
    Facturas agregadas: { NFacturas }" - Catch ex As Exception - NFacturas = 0 - Mensajes = "La actualización se realizó correctamente" - End Try - Else - Mensajes = "La descarga se realizó correctamente" - End If - End If - ObjProcess.WaitForExit() - ObjProcess.Close() - Retorno = True - Catch ex As Exception - error1 = True - OnError("Ocurrió un error al ejecutar el actualizador.", ex) - End Try + ' If msgs.Length >= 2 Then + ' Try + ' NFacturas = msgs(0).ToEntero + ' CountProcesados = msgs(0).ToEntero + ' Mensajes = $"La actualización se realizó correctamente.
    Facturas agregadas: { NFacturas }" + ' Catch ex As Exception + ' NFacturas = 0 + ' Mensajes = "La actualización se realizó correctamente" + ' End Try + ' Else + ' Mensajes = "La descarga se realizó correctamente" + ' End If + ' End If + ' ObjProcess.WaitForExit() + ' ObjProcess.Close() + ' Retorno = True + ' Catch ex As Exception + ' error1 = True + ' OnError("Ocurrió un error al ejecutar el actualizador.", ex) + ' End Try - If Retorno Then CargaDatos() + ' If Retorno Then CargaDatos() - 'Dim Retorno As Boolean = False - ''Codigo anterior no borrar puede hacer el paro - 'Dim ObjProcess As Process = Nothing - 'Dim Mensajes As String = "" - 'Dim EjecutableUtilerias = Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Utilerias\UtileriasAD.exe") - 'Dim Folder = Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas\") - 'Dim error1 As Boolean = False - 'Dim en As New CultureInfo("en-US") - 'Dim fechai = txtFechaI.Text.Trim.ToDate.ToString("d", en) - 'Dim fechaf = txtFechaF.Text.Trim.ToDate.ToString("d", en) - 'Try - ' ObjProcess = New Process() - ' ObjProcess.StartInfo.RedirectStandardOutput = True - ' ObjProcess.StartInfo.FileName = EjecutableUtilerias - ' ObjProcess.StartInfo.Verb = "runas" - ' ObjProcess.StartInfo.Arguments = $"{UsuarioActual.CveEmpresa} {Folder} 1 {fechai} {fechaf}" - ' ObjProcess.StartInfo.UseShellExecute = False - ' ObjProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal - ' ObjProcess.Start() - ' ObjProcess.WaitForExit() - ' ObjProcess.Close() - 'Catch ex As Exception - ' error1 = True - ' OnError("Ocurrió un error al ejecutar el actualizador.", ex) - 'End Try - - '' ProcesaBuzon() - - End Sub + 'End Sub 'Private Sub ProcesaBuzon() @@ -4626,18 +4602,123 @@ End Class -Public Class GeneralesAPI - Inherits ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI +Public Class GeneralesAPIeFacturas + + Inherits ADSNetLibraryzdE.HelpersE.ConexionesE.SIGAPIE.BaseSIGAPIeFacturas Public Sub New(ByVal Optional domainApi As String = "http://localhost:4001/", ByVal Optional token As String = "") MyBase.New(domainApi, token) End Sub Public Function GeneraSolicitud() As Object - Return getData(Of Object)("GeneraSolicitud", Nothing, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.[GET], False) + Return getData(Of Object)("GeneraSolicitud", Nothing, ADSNetLibraryzdE.HelpersE.ConexionesE.SIGAPIE.requestMethod.[GET], False) End Function Public Function VerificaSolicitudesNominas() As Object - Return getData(Of Object)("VerificaSolicitudesNominas", Nothing, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.[GET], False) + Return getData(Of Object)("VerificaSolicitudesNominas", Nothing, ADSNetLibraryzdE.HelpersE.ConexionesE.SIGAPIE.requestMethod.[GET], False) End Function End Class + + +Namespace ADSNetLibraryzdE.HelpersE.ConexionesE.SIGAPIE + Public Enum requestMethod + POST = 1 + [GET] = 2 + End Enum + + Public Class BaseSIGAPIeFacturas + Private Const tituloLog As String = "ADSNetLibrary.Helpers.Conexiones.SIGAPI" + Public domainApi As String + Public authorization As String + Protected RouteController As String = "" + Protected FullRoute As String = "" + + Public Function GetRoutbyclass() As String + Dim classname As String = Me.[GetType]().Name + Return classname.Substring(0, classname.Length - 12) + End Function + + Public Function GetRoute(ByVal path As String) As String + If String.IsNullOrEmpty(FullRoute) Then + Return String.Format("api/{0}/{1}", (If(String.IsNullOrEmpty(RouteController), GetRoutbyclass(), RouteController)), path) + Else + Return String.Format("{0}{1}", FullRoute, path) + End If + End Function + + Public Sub New(ByVal domainApi As String, ByVal Optional authorization As String = Nothing, ByVal Optional fullRoute As String = Nothing) + If String.IsNullOrEmpty(domainApi) Then + domainApi = "http://localhost:4001/" + End If + + Me.authorization = authorization + Me.domainApi = domainApi + Me.FullRoute = fullRoute + End Sub + + Public Async Function getDataAsync(Of T As {Class, New})(ByVal path As String, ByVal requestobject As Object, ByVal Optional reqmet As requestMethod = requestMethod.POST, ByVal Optional needauthorization As Boolean = True, ByVal Optional isfullpath As Boolean = False) As Task(Of T) + Dim objreturn As T = Nothing + + Using client As HttpClient = New HttpClient() + client.BaseAddress = New Uri(domainApi) + client.DefaultRequestHeaders.Accept.Add(New MediaTypeWithQualityHeaderValue("application/json")) + + If needauthorization Then + client.DefaultRequestHeaders.Authorization = New AuthenticationHeaderValue("Bearer", authorization) + End If + + client.Timeout = TimeSpan.FromMinutes(15) + Dim response As HttpResponseMessage = New HttpResponseMessage() + Dim strjsonreq = Newtonsoft.Json.JsonConvert.SerializeObject(requestobject) + Dim content As StringContent = New StringContent(strjsonreq, Encoding.UTF8, "application/json") + Dim route As String = If(isfullpath, path, GetRoute(path)) + + Try + + Select Case reqmet + Case requestMethod.POST + response = Await client.PostAsync(route, content) + Case requestMethod.[GET] + response = Await client.GetAsync(route) + End Select + + If response.IsSuccessStatusCode Then + Dim jsondata As String = Await response.Content.ReadAsStringAsync() + Dim settings As Newtonsoft.Json.JsonSerializerSettings = New Newtonsoft.Json.JsonSerializerSettings With { + .NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + .MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore + } + objreturn = Newtonsoft.Json.JsonConvert.DeserializeObject(Of T)(jsondata, settings) + Else + End If + + Catch e As Exception + End Try + End Using + + Return objreturn + End Function + + Public Function getData(Of T As {Class, New})(ByVal path As String, ByVal requestobject As Object, ByVal Optional reqmet As requestMethod = requestMethod.POST, ByVal Optional needauthorization As Boolean = True, ByVal Optional isfullpath As Boolean = False) As T + Return AsyncHelper.RunSync(Of T)(Function() getDataAsync(Of T)(path, requestobject, reqmet, needauthorization, isfullpath)) + End Function + End Class + + Friend Module AsyncHelper + Private ReadOnly _myTaskFactory As TaskFactory = New TaskFactory(CancellationToken.None, TaskCreationOptions.None, TaskContinuationOptions.None, TaskScheduler.[Default]) + + Function RunSync(Of TResult)(ByVal func As Func(Of Task(Of TResult))) As TResult + + 'Return AsyncHelper._myTaskFactory.StartNew(Of Task(Of TResult))(func).Unwrap(Of TResult)().GetAwaiter().GetResult() + Return AsyncHelper._myTaskFactory.StartNew(Of Task(Of TResult))(func).Unwrap().GetAwaiter().GetResult() + + + + End Function + + Sub RunSync(ByVal func As Func(Of Task)) + AsyncHelper._myTaskFactory.StartNew(Of Task)(func).Unwrap().GetAwaiter().GetResult() + End Sub + End Module +End Namespace + diff --git a/CxC/RepCxCDetalle.aspx b/CxC/RepCxCDetalle.aspx index b91380685..8f38e0930 100644 --- a/CxC/RepCxCDetalle.aspx +++ b/CxC/RepCxCDetalle.aspx @@ -331,12 +331,14 @@
    - + - - - - + + + +
    diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index ccc1b969a..e6a841ce5 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -236,7 +236,7 @@ Partial Class RepCxCDetalle CargaAsignarCobranza() TxtFechaCobranza.Text = Now.ToShortDateString - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.CveRol = 1 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DVCartera.Visible = True End If @@ -1068,9 +1068,17 @@ Partial Class RepCxCDetalle DdlClientesWS.DataBind() DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) End If - End Sub - - + End Sub + + Private Sub GvCartera_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCartera.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DataKey("Rango") = "Total" Then + e.Row.Font.Bold = True + End If + End If + End Sub + + #End Region - + End Class diff --git a/Empresas/119/Formatos/Nomina.rdlc b/Empresas/119/Formatos/Nomina.rdlc index 84d07c8ba..871861e56 100644 --- a/Empresas/119/Formatos/Nomina.rdlc +++ b/Empresas/119/Formatos/Nomina.rdlc @@ -1966,7 +1966,7 @@ Lugar de expedición: 83220 Hermosillo DsOC 9.86624cm 0.15979cm - 1.71208cm + 1.71209cm 19.89025cm 3 @@ -4674,14 +4674,14 @@ Lugar de expedición: 83220 Hermosillo - + true true - =Parameters!FormaPago.Value + @@ -4704,6 +4704,7 @@ Lugar de expedición: 83220 Hermosillo 2 + true @@ -5285,7 +5286,7 @@ Lugar de expedición: 83220 Hermosillo 2.51578cm 0.15979cm 5.0304cm - 19.84967cm + 19.84968cm 9 + + + Visor solicitudes Ingreso + + + + +
  • + Descargar +
  • + + +
  • + Solicitudes +
  • +
    +
    +
    + + + + + + +
    +
    +
    +
    + +
    + + + + +
    + +
    + <%----%> + +
    + + + + + + + + +
    +
    + +
    + <%----%> +
    + + + + + + + + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    + + + +
    +
    +
    + + Información timbre fiscal +
    + +
    + + +
    +
    + + +
    +
    +
    + + + + + + +
    +
    + +
    +
    + +