diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 767eee53e..57b45d695 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3266,6 +3266,25 @@ Public Class ClsNominas #End Region #Region "MovtosPermanentes" + Public Function GetMovtoPermanenteRep(CveEmpresa As Int32, CvePersonal As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_GetMovtoPermanenteRep", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function GetMovtoPermanente(CveEmpresa As Int32, CvePersonal As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_GetMovtoPermanente", CommandType.StoredProcedure) @@ -3305,7 +3324,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 +3340,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 +3355,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 +3370,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 3f05b8931..76e571b5f 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8135,6 +8135,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 @@ -8165,8 +8166,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 @@ -8408,6 +8419,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 @@ - + -