Nominas
This commit is contained in:
@@ -4071,6 +4071,44 @@ Public Class ClsNominas
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
#Region "CRUD_PersonalRefs"
|
||||
Public Function PersonalCamposValoresGet(cveReferencia As Int32, cvePersonal As Int32) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Nom_PersonalCamposValoresGet", CommandType.StoredProcedure)
|
||||
addParameters("@CveReferencia", SqlDbType.Int, cveReferencia)
|
||||
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
|
||||
retorno = RunQuery("Ocurrió un error al obtener el PersonalRefs.")
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function PersonalCamposValoresAddUp(cveReferencia As Int32, cvePersonal As Int32, valor As Decimal) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Nom_PersonalCamposValoresAddUp", CommandType.StoredProcedure)
|
||||
addParameters("@CveReferencia", SqlDbType.Int, cveReferencia)
|
||||
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
|
||||
addParameters("@Valor", SqlDbType.Money, valor)
|
||||
retorno = RunQuery("Ocurrió un error al actualizar el PersonalRefs.")
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function PersonalCamposValoresRemove(cveReferencia As Int32, cvePersonal As Int32) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Nom_PersonalCamposValoresRemove", CommandType.StoredProcedure)
|
||||
addParameters("@CveReferencia", SqlDbType.Int, cveReferencia)
|
||||
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
|
||||
retorno = RunQuery("Ocurrió un error al eliminar el PersonalRefs.")
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Public Function PersonalCamposGET() As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Nom_PersonalCamposGET", CommandType.StoredProcedure)
|
||||
retorno = RunQuery("Ocurrió un error al obtener el PersonalRefs.")
|
||||
Return retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub addParameters(varsql As String, sqltipe As SqlDbType, valor As Object)
|
||||
SqlAdapter.SelectCommand.Parameters.Add(varsql, sqltipe).Value = valor
|
||||
End Sub
|
||||
|
||||
@@ -7599,6 +7599,31 @@ Public Class ClsRH
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
Public Function ValidaFechaIngresoVSNominas(CvePersonal As Integer, CvePersonalAltas As Integer, CveEmpresa As Integer, FechaIngreso As String, FechaFin As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Data = New DataTable
|
||||
SqlDataAdapter("[PA_ValidaFechaIngresoVSNominas]")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@FechaIngreso", SqlDbType.VarChar).Value = FechaIngreso
|
||||
.Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin
|
||||
.Add("@CvePersonalAltas", SqlDbType.Int).Value = CvePersonalAltas
|
||||
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
If Data.Rows.Count > 0 Then
|
||||
Retorno = False
|
||||
Else
|
||||
Retorno = True
|
||||
End If
|
||||
Catch Ex1 As SqlException
|
||||
Me.OnError("Ocurrió un error al guardar correos nominas", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar correos nominas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function NomBitacoraCorreoGet(CvePeriodo As Integer, CvePersonal As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
/* .GVGetMovtoPermanenteRep .headerHide:not(Titulos) th:nth-child(2) {
|
||||
/* .GVGetMovtoPermanenteRep .headerHide:not(Titulos) th:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
*/
|
||||
@@ -15,17 +15,18 @@
|
||||
.GVGetMovtoPermanenteRep tr.cvetipo0 {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
|
||||
/*.GVGetMovtoPermanenteRep tr:not(.cvetipo0) td:nth-child(1) {
|
||||
display: none;
|
||||
}
|
||||
.GVGetMovtoPermanenteRep tr:.cvetipo0 td:nth-child(2) {
|
||||
display: none;
|
||||
}*/
|
||||
|
||||
|
||||
.GVGetMovtoPermanenteRep tr:not(.cvetipo0) td .lblconcepto {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVGetMovtoPermanenteRep tr.cvetipo0 td .lblcodigo {
|
||||
display: none;
|
||||
}
|
||||
@@ -51,8 +52,9 @@
|
||||
.GVGetMovtoPermanenteRep td:nth-child(14) {
|
||||
text-align: right
|
||||
}
|
||||
|
||||
.GVGetMovtoPermanenteRep td:nth-child(14) {
|
||||
white-space:nowrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
@@ -63,15 +65,15 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpAccciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkFormatoxls" OnClick="LnkFormatoxls_Click" CssClass="" runat="server"><i class="fa fa-file-excel"></i> Formato Excel</asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkFormatoxls" OnClick="LnkFormatoxls_Click" CssClass="" runat="server"><i class="fa fa-file-excel"></i> Formato Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkFormatoxls" />
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkFormatoxls" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
@@ -86,8 +88,8 @@
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 compoonenlabel" style="max-width: 65px; display:none;">Tipo: </label>
|
||||
<div class="col-md-1" style=" display:none;">
|
||||
<label class="col-md-1 compoonenlabel" style="max-width: 65px; display: none;">Tipo: </label>
|
||||
<div class="col-md-1" style="display: none;">
|
||||
<asp:DropDownList ID="DDlTipo" runat="server" Style="width: 100% !important;" CssClass="select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Movimientos Permanentes" Value="1"></asp:ListItem>
|
||||
@@ -95,16 +97,16 @@
|
||||
<asp:ListItem Text="Infonavit" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 compoonenlabel" style="max-width: 65px; display:none;">Saldo: </label>
|
||||
<div class="col-md-1" style=" display:none;">
|
||||
<label class="col-md-1 compoonenlabel" style="max-width: 65px; display: none;">Saldo: </label>
|
||||
<div class="col-md-1" style="display: none;">
|
||||
<asp:DropDownList ID="DDLSaldo" runat="server" Style="width: 100% !important;" CssClass="select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Pendiente" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Pagado" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 compoonenlabel" style="max-width: 65px; display:none;">Estatus: </label>
|
||||
<div class="col-md-1" style=" display:none;">
|
||||
<label class="col-md-1 compoonenlabel" style="max-width: 65px; display: none;">Estatus: </label>
|
||||
<div class="col-md-1" style="display: none;">
|
||||
<asp:DropDownList ID="DDLEstatus" runat="server" Style="width: 100% !important;" CssClass="select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
|
||||
@@ -125,7 +127,7 @@
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-md-1 mediocol">del:</label>
|
||||
<div class="col-md-1">
|
||||
<%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%>
|
||||
@@ -186,16 +188,16 @@
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblcodigo" runat="server" Text='<%# Eval("Codigo")%>'> </asp:Label>
|
||||
<asp:HyperLink ID="lblcodigo" runat="server" Text='<%# Eval("Codigo")%>' NavigateUrl='<%# string.Format("/RH/Personal.aspx?CvePersonal={0}",Eval("CvePersonal"))%>' ></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Nombre Completo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblnombreCompleto" CssClass="lblcodigo" runat="server" Text='<%# Eval("NombreCompleto")%>'> </asp:Label>
|
||||
<asp:Label ID="lblconcepto" CssClass="lblconcepto" runat="server" Text='<%# Eval("Concepto")%>'> </asp:Label>
|
||||
<asp:HyperLink ID="lblnombreCompleto" CssClass="lblcodigo" runat="server" Text='<%# Eval("NombreCompleto")%>' NavigateUrl='<%# string.Format("/RH/Personal.aspx?CvePersonal={0}",Eval("CvePersonal"))%>' ></asp:HyperLink>
|
||||
<asp:Label ID="lblconcepto" CssClass="lblconcepto" runat="server" Text='<%# Eval("Concepto")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Descuento Acordado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAcordado" runat="server" Text='<%# Eval("Valor","{0:N2}")%>'> </asp:Label>
|
||||
@@ -211,12 +213,12 @@
|
||||
<asp:Label ID="lblsaldo" runat="server" Text='<%# Eval("Acumulado","{0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="Tipo">
|
||||
<%-- <asp:TemplateField HeaderText="Tipo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbltipo" runat="server" Text='<%# Eval("Tipo")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<%-- <asp:TemplateField HeaderText="# Credito">
|
||||
<%-- <asp:TemplateField HeaderText="# Credito">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblnumeroCredito" runat="server" Text='<%# Eval("NumeroCredito")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using ClosedXML.Excel;
|
||||
using Extensiones;
|
||||
|
||||
public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
@@ -48,7 +51,7 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
{
|
||||
get { return TxtRpdFechaFin.Text; }
|
||||
set { TxtRpdFechaFin.Text = value; }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -60,7 +63,7 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
RcveEstatus = Request["cveEstatus"] != null ? Convert.ToInt32(Request["cveEstatus"]) : -1;
|
||||
RcveConcepto = Request["cveConcepto"] != null ? Convert.ToInt32(Request["cveConcepto"]) : -1;
|
||||
fechaInicio = DateTime.Now.ToString("01/MM/yyyy");
|
||||
fechaFin=DateTime.Now.ToString("01/MM/yyyy").ToDateTime().AddMonths(1).AddDays(1).ToString("01/MM/yyyy");
|
||||
fechaFin = DateTime.Now.ToString("01/MM/yyyy").ToDateTime().AddMonths(1).AddDays(1).ToString("01/MM/yyyy");
|
||||
CargaCombos();
|
||||
cargardatos();
|
||||
|
||||
@@ -85,11 +88,11 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
}
|
||||
DDLConcepto.DataBind();
|
||||
}
|
||||
DDlPersonal.SelectedValueExist( RcvePersonal.ToString());
|
||||
DDlTipo.SelectedValueExist( RcveTipo.ToString());
|
||||
DDLSaldo.SelectedValueExist( RcveSaldo.ToString());
|
||||
DDLEstatus.SelectedValueExist( RcveEstatus.ToString());
|
||||
DDLConcepto.SelectedValueExist( RcveConcepto.ToString());
|
||||
DDlPersonal.SelectedValueExist(RcvePersonal.ToString());
|
||||
DDlTipo.SelectedValueExist(RcveTipo.ToString());
|
||||
DDLSaldo.SelectedValueExist(RcveSaldo.ToString());
|
||||
DDLEstatus.SelectedValueExist(RcveEstatus.ToString());
|
||||
DDLConcepto.SelectedValueExist(RcveConcepto.ToString());
|
||||
}
|
||||
protected void cargardatos()
|
||||
{
|
||||
@@ -97,7 +100,7 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
{
|
||||
//string fechaInicio = "";
|
||||
//string fechaFin = "";
|
||||
ObjGetM.GetMovtoPermanenteRepFechas(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto, fechaInicio, fechaFin);
|
||||
ObjGetM.GetMovtoPermanenteRepFechas(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto, fechaInicio.ToDateTime().ToString("yyyy-MM-dd"), fechaFin.ToDateTime().ToString("yyyy-MM-dd"));
|
||||
GVGetMovtoPermanenteRep.DataSource = ObjGetM.DtResultados;
|
||||
GVGetMovtoPermanenteRep.DataBind();
|
||||
|
||||
@@ -119,8 +122,8 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
{
|
||||
|
||||
if (e.Row.RowType == DataControlRowType.Header)
|
||||
{
|
||||
e.Row.CssClass = "headerHide";
|
||||
{
|
||||
e.Row.CssClass = "headerHide";
|
||||
}
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
@@ -137,7 +140,7 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
//e.Row.Cells[1].Attributes.Add("colspan", "7");
|
||||
cssclass = string.Format("{0} cvetipo0", cssclass);
|
||||
}
|
||||
e.Row.CssClass = cssclass;
|
||||
e.Row.CssClass = cssclass;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +174,84 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
|
||||
|
||||
protected void LnkFormatoxls_Click(object sender, EventArgs e)
|
||||
{
|
||||
GVGetMovtoPermanenteRep.ExportToExcelX("Movimientos Permanente");
|
||||
using (ClsNominas ObjGetM = new ClsNominas())
|
||||
{
|
||||
//string fechaInicio = "";
|
||||
//string fechaFin = "";
|
||||
ObjGetM.GetMovtoPermanenteRepFechas(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto, fechaInicio.ToDateTime().ToString("yyyy-MM-dd"), fechaFin.ToDateTime().ToString("yyyy-MM-dd"));
|
||||
ExportarExcel(ObjGetM.DtResultados);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void ExportarExcel(DataTable dt)
|
||||
{
|
||||
using (var wb = new XLWorkbook())
|
||||
{
|
||||
var ws = wb.Worksheets.Add("Descuentos");
|
||||
|
||||
// Encabezados
|
||||
ws.Cell(1, 1).Value = "Código";
|
||||
ws.Cell(1, 2).Value = "Nombre Completo";
|
||||
ws.Cell(1, 3).Value = "Descuento Acordado";
|
||||
ws.Cell(1, 4).Value = "Descuento Aplicado";
|
||||
ws.Cell(1, 5).Value = "Acumulado";
|
||||
|
||||
// Estilo del encabezado
|
||||
var headerRange = ws.Range("A1:E1");
|
||||
headerRange.Style.Fill.BackgroundColor = XLColor.LightGray;
|
||||
headerRange.Style.Font.Bold = true;
|
||||
headerRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
|
||||
int row = 2;
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
int cveTipo = Convert.ToInt32(dr["CveTipo"]);
|
||||
|
||||
string codigo = dr["Codigo"].ToString();
|
||||
string nombre = cveTipo == 0 ? dr["Concepto"].ToString() : dr["NombreCompleto"].ToString();
|
||||
decimal valor = Convert.ToDecimal(dr["Valor"]);
|
||||
decimal aplicado = Convert.ToDecimal(dr["MontoAplicado"]);
|
||||
decimal acumulado = Convert.ToDecimal(dr["Acumulado"]);
|
||||
|
||||
ws.Cell(row, 1).Value = codigo;
|
||||
ws.Cell(row, 2).Value = nombre;
|
||||
ws.Cell(row, 3).Value = valor;
|
||||
ws.Cell(row, 4).Value = aplicado;
|
||||
ws.Cell(row, 5).Value = acumulado;
|
||||
|
||||
// Formato numérico a columnas de dinero
|
||||
ws.Cell(row, 3).Style.NumberFormat.Format = "#,##0.00";
|
||||
ws.Cell(row, 4).Style.NumberFormat.Format = "#,##0.00";
|
||||
ws.Cell(row, 5).Style.NumberFormat.Format = "#,##0.00";
|
||||
|
||||
// Color especial si CveTipo = 0
|
||||
if (cveTipo == 0)
|
||||
{
|
||||
var range = ws.Range(row, 1, row, 5);
|
||||
range.Style.Fill.BackgroundColor = XLColor.FromArgb(221, 221, 221);
|
||||
range.Style.Font.Bold = true;
|
||||
}
|
||||
|
||||
row++;
|
||||
}
|
||||
|
||||
// Ajustar columnas al contenido
|
||||
ws.Columns().AdjustToContents();
|
||||
|
||||
// Exportar el archivo
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
wb.SaveAs(ms);
|
||||
Response.Clear();
|
||||
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
Response.AddHeader("content-disposition", "attachment;filename=Movimietnospermanenetea.xlsx");
|
||||
Response.BinaryWrite(ms.ToArray());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -70,6 +70,9 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkMostrarCamposValores" OnClick="LnkMostrarCamposValor_Click" Visible="true" runat="server"> <i class="fa fa-sticky-note"></i> Mostrar Campos Valores</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<asp:UpdatePanel ID="UpBuzon" runat="server">
|
||||
<ContentTemplate>
|
||||
@@ -1689,7 +1692,87 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
|
||||
|
||||
<div id="DModalPersonalRefs" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalPers" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title"><asp:Literal ID="ltlPerstitulo" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:Panel runat="server" ID="PanelMostrarpersonalcampos">
|
||||
<div class="portlet light xspadding bordered " id="pnlListrefs">
|
||||
<div class="portlet-title">
|
||||
<div class="caption ">
|
||||
<i class="icon-pin font-yellow-gold"></i>
|
||||
<span class="caption-subject font-yellow-gold bold uppercase">Referenca Nomina</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:LinkButton ID="LnkAgregarPersonalRefs" OnClick="LnkAgregarPers_Click" CssClass="btn yellow-gold" runat="server">Agregar</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body ">
|
||||
<asp:GridView ID="GVPersonalRefs" runat="server" GridLines="None" CssClass ="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False" ShowHeaderWhenEmpty ="True"
|
||||
datakeynames="CveReferencia,CvePersonal,Valor">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Referencia">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblreferencia" runat="server" Text='<%# Eval("Referencia")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Valor">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblvalor" runat="server" Text='<%# Eval("Valor")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="36">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEliminarPers" runat="server" OnClick="LnkEliminarPers_Click" CssClass="btn btn-circle btn-sm btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el PersonalRefs?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="PanelADDpersonalcampos">
|
||||
<div class="row">
|
||||
<div class="col-md-4 truncate ">Referencia</div>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlPersreferencia" CssClass="form-control input-sm select2me " runat="server" DataTextField="Referencia" DataValueField="CveReferencia" style="width: 100%" ></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 truncate ">Valor</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtPersvalor" CssClass="form-control input-sm " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvPersvalor" runat="server" ControlToValidate="TxtPersvalor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Valor''</b> es necesario, por favor ingréselo." ValidationGroup="VGMPers"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoPersvalor" runat="server" HighlightCssClass="vco" TargetControlID="RfvPersvalor"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div class="modal-footer ">
|
||||
<div class="modal-btn">
|
||||
<asp:Button ID="BtnPersADD" OnClick="BtnPersADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMPers" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpMovtosPermanentes" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
@@ -971,7 +971,7 @@ Partial Class RH_Personal
|
||||
CargaPaises()
|
||||
CargaRegistroPatronal()
|
||||
CargaOutSourcing()
|
||||
|
||||
CargaDDlPersonalRefsReference()
|
||||
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero() > 0 Then
|
||||
ViewState("CvePersonal") = Request("CvePersonal")
|
||||
DdlFormapagovacaciones_SelectedIndexChanged(Nothing, Nothing)
|
||||
@@ -1007,6 +1007,7 @@ Partial Class RH_Personal
|
||||
CargaGvBitacora()
|
||||
CarcaConceptosNomina()
|
||||
CargaFonacot()
|
||||
CargaPersonalRefs()
|
||||
End If
|
||||
|
||||
ValidaDeudorAcreedor()
|
||||
@@ -2193,41 +2194,41 @@ Partial Class RH_Personal
|
||||
Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal, TipoSangre:=DdlTipoSangre.SelectedValue, CveSubTipoPeriodo:=CveSubTipoPeriodo,
|
||||
AreaGeografica:=DdlAreageografica.SelectedValue, CodigoDispersionVale:=TxtCodigoDispersionVale.Text.Trim) Then
|
||||
|
||||
'Funcion usa RH Familiares
|
||||
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
|
||||
ProcesaDTFamiliares(ObjPersonal)
|
||||
End If
|
||||
|
||||
ObjPersonal.AgroDepartamentoPersonalUp(UsuarioActual.CveEmpresa, DDlAgroDepartamento.SelectedValue.ToEntero(), CvePersonal, If(ChkCharolaForanea.Checked, 1, 0))
|
||||
|
||||
If Archivo.Exists Then
|
||||
|
||||
If Not Directory.Exists(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta)) Then Directory.CreateDirectory(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
|
||||
File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
|
||||
'Funcion usa RH Familiares
|
||||
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
|
||||
ProcesaDTFamiliares(ObjPersonal)
|
||||
End If
|
||||
System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
|
||||
|
||||
End If
|
||||
ObjPersonal.AgroDepartamentoPersonalUp(UsuarioActual.CveEmpresa, DDlAgroDepartamento.SelectedValue.ToEntero(), CvePersonal, If(ChkCharolaForanea.Checked, 1, 0))
|
||||
|
||||
Mensaje = "Los cambios se guardaron correctamente."
|
||||
'If ViewState("CveEstatusOriginal").ToString() <> DdlEstatusPersonal.SelectedValue Then
|
||||
' 'Manda Mail con bajas
|
||||
'End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
'GUARDA ORGANIGRAMA
|
||||
If Not TieneError Then
|
||||
If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero() = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero())) Then
|
||||
If Archivo.Exists Then
|
||||
|
||||
If Not Directory.Exists(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta)) Then Directory.CreateDirectory(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
|
||||
File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
|
||||
End If
|
||||
System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
|
||||
|
||||
End If
|
||||
|
||||
Mensaje = "Los cambios se guardaron correctamente."
|
||||
'If ViewState("CveEstatusOriginal").ToString() <> DdlEstatusPersonal.SelectedValue Then
|
||||
' 'Manda Mail con bajas
|
||||
'End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
'GUARDA ORGANIGRAMA
|
||||
If Not TieneError Then
|
||||
If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero() = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero())) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
If TieneError Then
|
||||
ObjPersonal.RollBack()
|
||||
Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.ToastAdventencia)
|
||||
Else
|
||||
@@ -7320,8 +7321,14 @@ Partial Class RH_Personal
|
||||
strfin = String.Format(",[FechaFin]='{0:yyyy-MM-dd}'", fechafin)
|
||||
|
||||
End If
|
||||
Dim finicio As String = TxtFechaInicioUA.Text.ToDateTime().ToString("yyyy-MM-dd")
|
||||
Dim ffin As String = TxtFechaFinUA.Text.ToDateTime().ToString("yyyy-MM-dd")
|
||||
Using objrh As New ClsRH()
|
||||
If (objrh.PersonalAltasUpFechas(CvePersonalAltas, TxtFechaInicioUA.Text.ToDateTime().ToString("yyyy-MM-dd"), TxtFechaFinUA.Text.ToDateTime().ToString("yyyy-MM-dd"), CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
|
||||
If Not (objrh.ValidaFechaIngresoVSNominas(CvePersonal, CvePersonalAltas, 0, finicio, ffin)) Then
|
||||
Alert("La fecha de ingreso o de fin no puede ser modificada, ya que existen registros de nómina autorizados que se encuentran dentro del periodo definido.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
End If
|
||||
If (objrh.PersonalAltasUpFechas(CvePersonalAltas, finicio, ffin, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
|
||||
If objrh.GetPersonalAltas(CvePersonal) Then
|
||||
GvPersonalAltas.DataSource = objrh.DtResultados
|
||||
GvPersonalAltas.DataBind()
|
||||
@@ -8307,7 +8314,70 @@ Partial Class RH_Personal
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaPersonalRefs()
|
||||
Dim ObjPers As New ClsNominas()
|
||||
ObjPers.PersonalCamposValoresGet(-1, CvePersonal)
|
||||
GVPersonalRefs.DataSource = ObjPers.DtResultados
|
||||
ObjPers.Dispose()
|
||||
GVPersonalRefs.DataBind()
|
||||
UPModalPers.Update()
|
||||
End Sub
|
||||
Protected Sub CargaDDlPersonalRefsReference()
|
||||
Dim ObjPers As New ClsNominas()
|
||||
ObjPers.PersonalCamposGET()
|
||||
DdlPersreferencia.DataSource = ObjPers.DtResultados
|
||||
ObjPers.Dispose()
|
||||
DdlPersreferencia.DataBind()
|
||||
UPModalPers.Update()
|
||||
End Sub
|
||||
Protected Sub LimpiaPersonalRefs()
|
||||
DdlPersreferencia.SelectedIndex = 0
|
||||
TxtPersvalor.Text = ""
|
||||
UPModalPers.Update()
|
||||
End Sub
|
||||
Protected Sub LnkMostrarCamposValor_Click(sender As Object, e As EventArgs)
|
||||
ltlPerstitulo.Text = "Campos valores"
|
||||
LimpiaPersonalRefs()
|
||||
|
||||
RegistraScript("$('#DModalPersonalRefs').modal()")
|
||||
BtnPersADD.Visible = False
|
||||
PanelMostrarpersonalcampos.Visible = True
|
||||
PanelADDpersonalcampos.Visible = False
|
||||
UPModalPers.Update()
|
||||
End Sub
|
||||
Protected Sub LnkAgregarPers_Click(sender As Object, e As EventArgs)
|
||||
'RegistraScript("$('#DModalPersonalRefs').modal()")
|
||||
ltlPerstitulo.Text = "Agregar Campos Valores"
|
||||
LimpiaPersonalRefs()
|
||||
BtnPersADD.Visible = True
|
||||
PanelADDpersonalcampos.Visible = True
|
||||
PanelMostrarpersonalcampos.Visible = False
|
||||
UPModalPers.Update()
|
||||
End Sub
|
||||
Protected Sub BtnPersADD_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim cveReferencia As Int32 = DdlPersreferencia.SelectedValue.ToEntero()
|
||||
Dim valor As Decimal = TxtPersvalor.Text.ToDecimal()
|
||||
Dim ObjPers As New ClsNominas()
|
||||
Dim Continuar As Boolean = ObjPers.PersonalCamposValoresAddUp(cveReferencia, CvePersonal, valor)
|
||||
ObjPers.Dispose()
|
||||
If (Continuar) Then
|
||||
LimpiaPersonalRefs()
|
||||
UPModalPers.Update()
|
||||
Alert("El campo valor se ha agregado")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LnkEliminarPers_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
Dim CcveReferencia As Integer = gvRow.DataKey("CveReferencia").ToEntero()
|
||||
Dim ObjPers As New ClsNominas()
|
||||
Dim Continuar As Boolean = ObjPers.PersonalCamposValoresRemove(CcveReferencia, CvePersonal)
|
||||
ObjPers.Dispose()
|
||||
If (Continuar) Then
|
||||
CargaPersonalRefs()
|
||||
Alert("El campo valor se ha eliminado")
|
||||
End If
|
||||
End Sub
|
||||
'Protected Sub ChkPagoElectronicoGrupos_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
' If ChkPagoElectronicoGrupos.Checked Then
|
||||
|
||||
Reference in New Issue
Block a user