This commit is contained in:
@@ -22,6 +22,28 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
get { return 5; }
|
||||
}
|
||||
|
||||
private DateTime FechaInicioPeriodo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["FechaInicioPeriodo"] == null) { return DateTime.Now; }
|
||||
else { return (DateTime)ViewState["FechaInicioPeriodo"]; }
|
||||
}
|
||||
|
||||
set { ViewState["FechaInicioPeriodo"] = value; }
|
||||
}
|
||||
private DateTime FechaFinPeriodo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["FechaFinPeriodo"] == null) { return DateTime.Now.AddDays(1); }
|
||||
else { return (DateTime)ViewState["FechaFinPeriodo"]; }
|
||||
}
|
||||
|
||||
set { ViewState["FechaFinPeriodo"] = value; }
|
||||
}
|
||||
|
||||
private DataTable dtNomConceptos
|
||||
{
|
||||
get
|
||||
@@ -422,7 +444,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dtempleados = null;
|
||||
dtConceptos = null;
|
||||
DataTable dtPeriodo = new DataTable();
|
||||
DataTable dtasistencia = new DataTable();
|
||||
LnkAutorizar.Visible = false;
|
||||
Estatus = 5;
|
||||
if (FiltCvePeriodo > 0)
|
||||
@@ -438,6 +459,10 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
int CvePrePolizaProvisionAsimilados = drow["CvePrePolizaAsimilables"].ToString().ToEntero();
|
||||
int CvePrePolizaProrrateo = drow["CvePrePolizaProrrateo"].ToString().ToEntero();
|
||||
|
||||
|
||||
FechaInicioPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaInicio"];
|
||||
FechaFinPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaFin"];
|
||||
|
||||
//LnkConceptoEmpleado.Visible = (Estatus == 1);
|
||||
LnkRegistrarProvision.Visible = (Estatus >= 2);//&& (CvePrePolizaProvision <= 0 || UsuarioActual.CveUsuario == 100);
|
||||
LnkRegistrarProvision.Text = CvePrePolizaProvision <= 0 ? "<i class=\"fa fa-thumbs-up\" aria-hidden=\"true\" ></i>Registrar provisión" : "<i class=\"fa fa-thumbs-up\" aria-hidden=\"true\" ></i>Regenerar provisión";
|
||||
@@ -466,7 +491,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
|
||||
dtConceptos = objnom.DTSetResultados.Tables[0];
|
||||
dtPeriodo = objnom.DTSetResultados.Tables[1];
|
||||
dtasistencia = objnom.DTSetResultados.Tables[2];
|
||||
//dtasistencia = objnom.DTSetResultados.Tables[2];
|
||||
CvePeriodoSeleccionado = FiltCvePeriodo;
|
||||
continuar = true;
|
||||
}
|
||||
@@ -826,74 +851,87 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
GvNominas.DataSource = null;
|
||||
GvNominas.DataBind();
|
||||
}
|
||||
if (cargaasistencia)
|
||||
{
|
||||
if (dtPeriodo != null && dtPeriodo.Rows.Count > 0)
|
||||
{
|
||||
|
||||
DateTime FechaInicio = (DateTime)dtPeriodo.Rows[0]["FechaInicio"];
|
||||
DateTime FechaFin = (DateTime)dtPeriodo.Rows[0]["FechaFin"];
|
||||
StringBuilder gvasistencia = new StringBuilder();
|
||||
gvasistencia.Append("<div><table class=\"table table-striped table-hover mysmallbtn Widthall ScrollAD gvasistencia \" data-rows=\"1\" data-heighterror=\"360\"><tbody>");
|
||||
if (true)
|
||||
{
|
||||
DateTime fecha = FechaInicio;
|
||||
|
||||
gvasistencia.Append("<tr class=\"Titulos ADtr\">");
|
||||
gvasistencia.Append("<th>Nombre</th>");
|
||||
while (fecha <= FechaFin)
|
||||
{
|
||||
gvasistencia.AppendFormat("<th>{0:dd/MM/yyyy}</th>", fecha);
|
||||
fecha = fecha.AddDays(1);
|
||||
}
|
||||
gvasistencia.Append("</tr>");
|
||||
}
|
||||
string tipo = "";
|
||||
foreach (DataRow rempl in dtempleados.FiltraParametros("CvePersonal>0").Rows)
|
||||
{
|
||||
int CvePersonal = rempl["CvePersonal"].ToString().ToEntero();
|
||||
string nombre = rempl["Nombre"].ToString();
|
||||
string Codigo = rempl["Codigo"].ToString();
|
||||
DateTime fecha = FechaInicio; int HorasDobles, HorasTriples;
|
||||
gvasistencia.Append("<tr>");
|
||||
gvasistencia.AppendFormat("<td><a class=\"Texto sline\" href=\"/RH/Personal.aspx?CvePersonal={0}\"><span style=\"display:inline-block;min-width:31px;\">{2}</span> <span style=\"display:inline-block;\">{1}</span></a></td>", CvePersonal, nombre, Codigo);
|
||||
while (fecha <= FechaFin)
|
||||
{
|
||||
DataRow drow = dtasistencia.FiltroPrimero(string.Format("Fecha='{0:yyyy/MM/dd}' AND CvePersonal={1}", fecha, CvePersonal));
|
||||
tipo = "-";
|
||||
if (drow != null)
|
||||
{
|
||||
tipo = string.Format("{0} ({1}%)", drow["Tipo"], drow["PorcentajePago"]);
|
||||
HorasDobles = drow["HorasDobles"].ToString().ToEntero();
|
||||
HorasTriples = drow["HorasTriples"].ToString().ToEntero();
|
||||
if (HorasDobles > 0)
|
||||
{
|
||||
|
||||
tipo = string.Format("{0}<br/>{1} horas dobles", tipo, HorasDobles);
|
||||
}
|
||||
if (HorasTriples > 0)
|
||||
{
|
||||
|
||||
tipo = string.Format("{0}<br/>{1} horas triple", tipo, HorasTriples);
|
||||
}
|
||||
drow.Delete();
|
||||
}
|
||||
gvasistencia.AppendFormat("<td> <a onclick=\"openasis({1},'{2}')\"> {0} </a></td>", tipo, CvePersonal, fecha);
|
||||
fecha = fecha.AddDays(1);
|
||||
}
|
||||
gvasistencia.Append("</tr>");
|
||||
}
|
||||
gvasistencia.Append("</tbody></table></div>");
|
||||
ltlGvAsistencia.Text = gvasistencia.ToString();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (cargaasistencia && dtPeriodo != null && dtPeriodo.Rows.Count > 0)
|
||||
{
|
||||
cargarasistencia();
|
||||
}
|
||||
if (dtempleados != null)
|
||||
{
|
||||
LnkAutorizar.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =0") > 0) || (Estatus < 2);
|
||||
LnkCancelarNomina.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =1 AND SeTimbro=0") > 0);
|
||||
}
|
||||
UpDatos.Update();
|
||||
}
|
||||
public void cargarasistencia()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
DateTime FechaInicio = FechaInicioPeriodo;
|
||||
DateTime FechaFin = FechaFinPeriodo;
|
||||
DataTable dtasistencia;
|
||||
using (ClsNominas objnom = new ClsNominas())
|
||||
{
|
||||
objnom.GetAsistenciabetweendate(UsuarioActual.CveEmpresa, FechaInicio, FechaFin);
|
||||
dtasistencia = objnom.DtResultados;
|
||||
}
|
||||
StringBuilder gvasistencia = new StringBuilder();
|
||||
gvasistencia.Append("<div><table class=\"table table-striped table-hover mysmallbtn Widthall ScrollAD gvasistencia \" data-rows=\"1\" data-heighterror=\"360\"><tbody>");
|
||||
if (true)
|
||||
{
|
||||
DateTime fecha = FechaInicio;
|
||||
|
||||
gvasistencia.Append("<tr class=\"Titulos ADtr\">");
|
||||
gvasistencia.Append("<th>Nombre</th>");
|
||||
while (fecha <= FechaFin)
|
||||
{
|
||||
gvasistencia.AppendFormat("<th>{0:dd/MM/yyyy}</th>", fecha);
|
||||
fecha = fecha.AddDays(1);
|
||||
}
|
||||
gvasistencia.Append("</tr>");
|
||||
}
|
||||
string tipo = "";
|
||||
foreach (DataRow rempl in dtempleados.FiltraParametros("CvePersonal>0").Rows)
|
||||
{
|
||||
int CvePersonal = rempl["CvePersonal"].ToString().ToEntero();
|
||||
string nombre = rempl["Nombre"].ToString();
|
||||
string Codigo = rempl["Codigo"].ToString();
|
||||
DateTime fecha = FechaInicio; int HorasDobles, HorasTriples;
|
||||
gvasistencia.Append("<tr>");
|
||||
gvasistencia.AppendFormat("<td><a class=\"Texto sline\" href=\"/RH/Personal.aspx?CvePersonal={0}\"><span style=\"display:inline-block;min-width:31px;\">{2}</span> <span style=\"display:inline-block;\">{1}</span></a></td>", CvePersonal, nombre, Codigo);
|
||||
while (fecha <= FechaFin)
|
||||
{
|
||||
DataRow drow = dtasistencia.FiltroPrimero(string.Format("Fecha='{0:yyyy/MM/dd}' AND CvePersonal={1}", fecha, CvePersonal));
|
||||
tipo = "-";
|
||||
if (drow != null)
|
||||
{
|
||||
tipo = string.Format("{0} ({1}%)", drow["Tipo"], drow["PorcentajePago"]);
|
||||
HorasDobles = drow["HorasDobles"].ToString().ToEntero();
|
||||
HorasTriples = drow["HorasTriples"].ToString().ToEntero();
|
||||
if (HorasDobles > 0)
|
||||
{
|
||||
|
||||
tipo = string.Format("{0}<br/>{1} horas dobles", tipo, HorasDobles);
|
||||
}
|
||||
if (HorasTriples > 0)
|
||||
{
|
||||
|
||||
tipo = string.Format("{0}<br/>{1} horas triple", tipo, HorasTriples);
|
||||
}
|
||||
drow.Delete();
|
||||
}
|
||||
gvasistencia.AppendFormat("<td> <a onclick=\"openasis({1},'{2}')\"> {0} </a></td>", tipo, CvePersonal, fecha);
|
||||
fecha = fecha.AddDays(1);
|
||||
}
|
||||
gvasistencia.Append("</tr>");
|
||||
}
|
||||
gvasistencia.Append("</tbody></table></div>");
|
||||
ltlGvAsistencia.Text = gvasistencia.ToString();
|
||||
|
||||
|
||||
}
|
||||
private void setGVNominas()
|
||||
{
|
||||
@@ -1240,7 +1278,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
if (CveNomina > 0)
|
||||
{
|
||||
|
||||
|
||||
|
||||
DdlMotivoCancelacion.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
using (ClsNominas Nom = new ClsNominas())
|
||||
{
|
||||
@@ -1256,7 +1294,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
string SerieFolio = Nom.SerieFolio;
|
||||
DataRow rowc = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveMotivoCancelacion={0}", DdlMotivoCancelacion.SelectedValue));
|
||||
int CveMotivoCancelacion = -1;
|
||||
if(rowc != null)
|
||||
if (rowc != null)
|
||||
{
|
||||
CveMotivoCancelacion = rowc["CveSATMotivoCancelacion"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user