diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index b6ee28d2f..5fb4804f3 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2452,7 +2452,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Return Retorno End Function - Public Function UpPersonalAltas(CvePersonal As Integer, fechaInicio As String, fechaFin As String, CvePeriodoFiniquito As Integer, CveMotivoBaja As Integer, esLiquidacion As Boolean, ValIndemnizacion As Boolean, ValSeparacionunica As Boolean, ValPrimadeantiguedad As Boolean) As Boolean + Public Function UpPersonalAltas(CvePersonal As Integer, fechaInicio As String, fechaFin As String, CvePeriodoFiniquito As Integer, CveMotivoBaja As Integer, esLiquidacion As Boolean, ValIndemnizacion As Boolean, ValSeparacionunica As Boolean, ValPrimadeantiguedad As Boolean, Optional Observaciones As String = "") As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_PersonalAltasUp") @@ -2466,6 +2466,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@ValIndemnizacion", SqlDbType.Bit).Value = If(ValIndemnizacion, 1, 0) .Add("@ValSeparacionunica", SqlDbType.Bit).Value = If(ValSeparacionunica, 1, 0) .Add("@ValPrimadeantiguedad", SqlDbType.Bit).Value = If(ValPrimadeantiguedad, 1, 0) + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones End With Try SqlAdapter.Fill(Data) @@ -7397,7 +7398,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno End Function - Public Function estatusPersonalUp(Fecha As DateTime, CvePersonal As Integer, CveEstatusPersonal As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean + Public Function estatusPersonalUp(Fecha As DateTime, CvePersonal As Integer, CveEstatusPersonal As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional CveMotivoBaja As Integer = -1, Optional Observaciones As String = "") As Boolean Dim Retorno As Boolean = False Data = New DataTable SqlDataAdapter("PA_RH_EstatusPersonalUp") @@ -7407,6 +7408,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CveEstatusPersonal", SqlDbType.Int).Value = CveEstatusPersonal .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja ' + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones End With Try SqlAdapter.Fill(Data) diff --git a/General/CONTRATO.doc b/General/CONTRATO.doc new file mode 100644 index 000000000..47e90f754 Binary files /dev/null and b/General/CONTRATO.doc differ diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 7204fddf2..69b5b8280 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -2610,6 +2610,8 @@ public partial class Nomina_Nomina2 : ClsPaginas { if (objnom.GETPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, SRCvePersonal)) { + DdlVacPeriodo.DataSource = objnom.DtResultados; + DdlVacPeriodo.DataBind(); DataRow drow = objnom.DtResultados.FiltroPrimero("Selected =1"); if (drow != null) { @@ -2618,6 +2620,7 @@ public partial class Nomina_Nomina2 : ClsPaginas } } } + UPSRModalVacaciones.Update(); RegistraScript("$('#ModalSRVacaciones').modal()"); } diff --git a/RH/Personal.aspx b/RH/Personal.aspx index ca73980fd..3c308cc86 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -109,7 +109,14 @@
  • Modificar salario
  • + +
  • + Contrato +
  • + + + diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index b77a4883e..08b0b90ee 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -847,7 +847,7 @@ Partial Class RH_Personal If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then pnlSalarioIMSS.Visible = False End If - ' + LnkContratoAgropecuaria.Visible = (UsuarioActual.CveEmpresa.Contiene(1, 158)) Using objno = New ClsNominas objno.GetConceptos() dtNomConceptos = objno.DtResultados @@ -7478,6 +7478,68 @@ Partial Class RH_Personal Alert("Se guardo correctamente", TipoMensaje.MsgInformacion) CargaDatos() End If + End Sub + + Protected Sub LnkContratoAgropecuaria_Click(sender As Object, e As EventArgs) + Dim RutaArchivo As String = "C:\Proyectos\SIGGIT\General\CONTRATO.doc" + + Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo) + + Dim ObjRH As New ClsRH + + If ObjRH.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then + Dim Tags As New List(Of TagsDocumentos) + + Tags.Add(New TagsDocumentos("{NombreCompleto}", ObjRH.NombreCompleto)) + Tags.Add(New TagsDocumentos("{años}", (DateTime.Now.Year - ObjRH.FechaNacimiento.Year).ToString())) + Tags.Add(New TagsDocumentos("{SubProyecto}", DdlSubProyectoAsignado.SelectedItem.Text)) + Tags.Add(New TagsDocumentos("{EstadoCivil}", DdlEstadoCivil.SelectedItem.Text)) + + Tags.Add(New TagsDocumentos("{CiudadOrigen}", TxtCiudad.Text)) + Tags.Add(New TagsDocumentos("{RFC}", ObjRH.RFC)) + + Tags.Add(New TagsDocumentos("{NumeroDia}", String.Format("{0:dd}", ObjRH.FechaIngreso))) + Tags.Add(New TagsDocumentos("{MesLetra}", String.Format("{0:MMMM}", ObjRH.FechaIngreso))) + Tags.Add(New TagsDocumentos("{Ejercicio}", String.Format("{0:yyyy}", ObjRH.FechaIngreso))) + objGemBoxDocument.SustituirTags(Tags) + + End If + ObjRH.Dispose() + + + + + objGemBoxDocument.GuardarStreamPDF() + + + Dim objbyte = objGemBoxDocument.GetBytesDocumento + + + + + Try + Response.Buffer = True + Response.Clear() + Response.ContentType = "application/pdf" + Response.AddHeader("content-disposition", String.Format("{0}; filename={1}.{2}", "attachment", "Contrato.pdf", "pdf")) + Response.BinaryWrite(objbyte) ' create the file + Response.Flush() ' send it to the client to download + objbyte = Nothing + HttpContext.Current.Response.SuppressContent = True + HttpContext.Current.ApplicationInstance.CompleteRequest() + 'HttpContext.Current.Response.End() + Catch ex As Exception + + If UsuarioActual.CveRol = 1 Then + Alert($"Error: {ex.Message} | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))}", TipoMensaje.MsgAdvertencia) + Else + Alert("Ocurrió un error al generar la descarga. Favor de contactar a soporte tecnico cod:'IMPDFclspag'", TipoMensaje.MsgAdvertencia) + End If + End Try + + + + End Sub End Class