From 942d9f2b8930503ca3356452564572fa314f9b16 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 2 Aug 2024 02:18:01 -0700 Subject: [PATCH 1/2] --- App_Code/ClsNominas.vb | 6 +- App_Code/ClsPaginas.vb | 15 + App_Code/modExtensiones.vb | 15 + Nomina/Nomina.aspx | 568 ++++++++------------ Nomina/Nomina.aspx.cs | 316 ++++++++--- Ventas/RepProductosServiciosDetalle.aspx | 15 +- Ventas/RepProductosServiciosDetalle.aspx.vb | 4 +- 7 files changed, 517 insertions(+), 422 deletions(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 767eee53e..1271c926b 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3305,7 +3305,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As Date, estatus As Boolean, CveCuenta As Integer, Optional CveIE As Integer = -1) As Integer + Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As Date, estatus As Boolean, CveCuenta As Integer, Optional CveIE As Integer = -1, Optional EsAcumulado As Integer = 0) As Integer Dim retorno As Integer = 0 DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure) @@ -3321,6 +3321,7 @@ Public Class ClsNominas .Add("@estatus", SqlDbType.Bit).Value = (estatus) .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) .Add("@CveIE", SqlDbType.Int).Value = (CveIE) + .Add("@EsAcumulado", SqlDbType.Int).Value = (EsAcumulado) .Add("@CveMovtoPermanente", SqlDbType.Int).Direction = ParameterDirection.Output End With Try @@ -3335,7 +3336,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As Date, estatus As Boolean, CveCuenta As Integer) As Boolean + Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As Date, estatus As Boolean, CveCuenta As Integer, Optional EsAcumulado As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_UpMovtoPermanente", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -3350,6 +3351,7 @@ Public Class ClsNominas .Add("@fechaInicioAplicacion", SqlDbType.Date).Value = (fechaInicioAplicacion) .Add("@estatus", SqlDbType.Bit).Value = (estatus) .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) + .Add("@EsAcumulado", SqlDbType.Int).Value = (EsAcumulado) End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c1ae046c4..c85797b27 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8141,6 +8141,7 @@ Public Class ClsPaginas Return Nothing End If Dim CveNomina As Integer = ObjNomina.CveNomina + Dim RFCPackCertifica As String = "" Dim DTPercepciones As Data.DataTable Dim DTDeducciones As Data.DataTable Dim DTDeducciones2 As New Data.DataTable @@ -8171,8 +8172,18 @@ Public Class ClsPaginas If System.IO.File.Exists(PathXML) Then Dim XmlDoc As New System.Xml.XmlDocument 'XmlDoc.Load(Ruta & "XML\\Nomina\NOM A-3845.xml") + + Dim timbreFiscal = (XDocument.Load(PathXML)).Descendants(). + Where(Function(e) e.Name.LocalName = "TimbreFiscalDigital"). + FirstOrDefault() + + If timbreFiscal IsNot Nothing Then + RFCPackCertifica = timbreFiscal.Attribute("RfcProvCertif")?.Value + Else + End If XmlDoc.Load(PathXML) + If ValorNodoXML(XmlDoc.DocumentElement, "version").Contiene("3.3", "4.0") Then FechaEmision = XmlDoc.DocumentElement.Attributes("Fecha").InnerText.ToDate NoSerieCertificadoContribuyente = XmlDoc.DocumentElement.Attributes("NoCertificado").InnerText @@ -8414,6 +8425,10 @@ Public Class ClsPaginas Dim Archivo As New System.IO.FileInfo(RutaFormato) If Not TieneError Then If Archivo.Exists Then + If Extensiones.ModExtensiones.HasReportParameter(RutaFormato, "RFCPackCertifica") Then + RptParametro.Add(New ReportParameter("RFCPackCertifica", RFCPackCertifica)) + + End If Retorno = StreamPDF(RutaFormato, LSRds, RptParametro, ObjNomina.SerieFolio, "PDF", MR:=Nothing) Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\\{1}.pdf", RutaEmpresa, ObjNomina.SerieFolio)) If Not ArchivoPDF.Exists Then diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 10d354956..4e5d0a0fb 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -30,6 +30,7 @@ Namespace Extensiones #Region "E X T E N S I O N E S" Public Module ModExtensiones + Public ReadOnly Property foreign_characters As Dictionary(Of String, String) Get Dim fgk As Dictionary(Of String, String) = New Dictionary(Of String, String) From { @@ -3771,6 +3772,20 @@ Namespace Extensiones text = str.Replace("&", "&") Return text + End Function + + + Function HasReportParameter(reportPath As String, parameterName As String) As Boolean + ' Leer el archivo .rdlc como XML + Dim rdlcDoc As XDocument = XDocument.Load(reportPath) + + ' Buscar el parámetro en el XML + Dim parameters = From e In rdlcDoc.Descendants() + Where e.Name.LocalName = "ReportParameter" + Select e.Attribute("Name").Value + + ' Verificar si existe el parámetro RFCPackCertifica + Return parameters.Contains(parameterName) End Function End Module #End Region diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 4b3d3ab11..49396092f 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -794,6 +794,8 @@ + +
@@ -814,11 +816,7 @@
@@ -1390,7 +1388,7 @@ + DataKeyNames="CveMovtoPermanente,CveConcepto,CveCuenta,CvePersonal,Descripcion,MontoLimiteV,TipoDescuento,Valor,VecesAplicar,MontoLimite,EsAcumulado,FechaInicioAplicacion,Estatus,FechaRegistro"> @@ -1419,7 +1417,7 @@ + CssClass="lnkMovotPermanente" runat="server" Text='<%# Eval("MontoLimiteV","{0:###,###.##}")%>'> @@ -1444,6 +1442,8 @@ + + @@ -2182,6 +2182,207 @@ + + <%----%> @@ -4359,132 +4560,7 @@ - <%-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - showResult - - --%> + @@ -5101,7 +5177,7 @@ - + -