This commit is contained in:
@@ -59,7 +59,14 @@
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<label class="col-md-1">Tipo vista:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipoVista" runat="server" CssClass="select2me" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
|
||||
<asp:ListItem Text="Asistencia" Value="1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Registros" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1">Tipo Período:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" CssClass="select2me" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
|
||||
@@ -209,6 +216,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList Width="100%" ID="DdlTurno" runat="server" AppendDataBoundItems="True" DataTextField="Turno" DataValueField="CveTurno" CssClass="form-control input-sm select2me" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label AssociatedControlID="DdlTurno" runat="server" Text="Turno:"></asp:Label>
|
||||
<asp:RequiredFieldValidator ID="RFVTurno" runat="server" ControlToValidate="DdlTurno" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Turno''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<asp:Panel ID="Panel1" Visible="false" runat="server">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox CssClass="form-control" ID="TxtPorPago" runat="server" Text="" type="number" min="0" max="100" step="0.01"></asp:TextBox>
|
||||
|
||||
@@ -23,6 +23,10 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
|
||||
DdlTurno.DataBind();
|
||||
|
||||
CargaTiposPeriodo();
|
||||
TxtRpdFechaInicio.Text = "01/09/2021";
|
||||
TxtRpdFechaFin.Text = "15/09/2021";
|
||||
@@ -66,6 +70,20 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
DataTable dtCon = new DataTable();
|
||||
dtCon.Columns.Add(new DataColumn("Codigo", typeof(string)));
|
||||
dtCon.Columns.Add(new DataColumn("Empleado", typeof(string)));
|
||||
string strasis = "<i class='fa fa-check-square' style=\"color:green;\"></i>";
|
||||
string strdescanso = "<i class='fa fa-sun-o' style=\"color:green;\"></i>";
|
||||
string strretardo = "<i class='fa fa-clock-o' style=\"color:orange;\" aria-hidden='true'></i>";
|
||||
string strfaltaretardo = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
|
||||
string strfalta = "<div style=\"color:red;\">❌</div>";
|
||||
|
||||
if (salto == "\r\n")
|
||||
{
|
||||
strasis = "✅";
|
||||
strdescanso = "🌣";
|
||||
strretardo = "🕖";
|
||||
strfaltaretardo = "❌";
|
||||
strfalta = "--";
|
||||
}
|
||||
DateTime CFecha = FechaI;
|
||||
while (FechaF > CFecha)
|
||||
{
|
||||
@@ -90,7 +108,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
{
|
||||
int Fecha = string.Format("{0:yyyyMMdd}", CFecha).ToEntero();
|
||||
string FechaCol = string.Format("{0:dd-MM-yyyy}", CFecha);
|
||||
if (UsuarioActual.CveEmpresa == 119)
|
||||
if (DdlTipoVista.SelectedValue == "2")
|
||||
{
|
||||
DataTable Dtb = objnom.DTSetResultados.Tables[4];
|
||||
StringBuilder str = new StringBuilder();
|
||||
@@ -109,7 +127,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
string TipoAsis = "(Faltó)";
|
||||
string TipoAsis = "--";
|
||||
DataRow drfec = dtASis.FiltroPrimero(string.Format("CvePersonal={0} AND Agrupador ={1}", item["CvePersonal"], Fecha), "Salida");
|
||||
if (drfec != null)
|
||||
{
|
||||
@@ -129,22 +147,22 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
switch (drf["Tipo"].ToString().ToEntero())
|
||||
{
|
||||
case 1:
|
||||
asistencia2 = "<i class='fa fa-check-square' style=\"color:green;\"></i>";
|
||||
asistencia2 = strasis;
|
||||
break;
|
||||
case 2:
|
||||
asistencia2 = "<i class='fa fa-clock-o' style=\"color:orange;\" aria-hidden='true'></i>";
|
||||
asistencia2 = strretardo;
|
||||
break;
|
||||
case 3:
|
||||
asistencia2 = "<i class='fa fa-clock-o' style=\"color:orange;\" aria-hidden='true'></i>";
|
||||
asistencia2 = strretardo;
|
||||
break;
|
||||
case 4:
|
||||
asistencia2 = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
|
||||
asistencia2 = strfaltaretardo;
|
||||
break;
|
||||
case 5:
|
||||
asistencia2 = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
|
||||
asistencia2 = strfaltaretardo;
|
||||
break;
|
||||
case 6:
|
||||
asistencia2 = "<div style=\"color:red;\">❌</div>";
|
||||
asistencia2 = strfalta;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -157,43 +175,58 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
switch (drfec["Tipo"].ToString().ToEntero())
|
||||
{
|
||||
case 1:
|
||||
asistencia = "<i class='fa fa-check-square' style=\"color:green;\"></i>";
|
||||
asistencia = strasis;
|
||||
break;
|
||||
case 2:
|
||||
asistencia = "<i class='fa fa-clock-o' style=\"color:orange;\" aria-hidden='true'></i>";
|
||||
asistencia = strretardo;
|
||||
break;
|
||||
case 3:
|
||||
asistencia = "<i class='fa fa-clock-o' style=\"color:orange;\" aria-hidden='true'></i>";
|
||||
asistencia = strretardo;
|
||||
break;
|
||||
case 4:
|
||||
asistencia = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
|
||||
asistencia = strfaltaretardo;
|
||||
break;
|
||||
case 5:
|
||||
asistencia = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
|
||||
asistencia = strfaltaretardo;
|
||||
break;
|
||||
case 6:
|
||||
asistencia = "<div style=\"color:red;\">❌</div>";
|
||||
asistencia = strfalta;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
drow[FechaCol] = string.Format("<div style='display:inline-block'>{0}<br>{1}{2}</div><div style='display:inline-block'>{3}<br>{4}{5}</div>", asistencia, drfec["Horas"], HoraExtraPorAutorizar, asistencia2, Horas2, HoraExtraPorAutorizar2);
|
||||
if (salto == "\r\n")
|
||||
{
|
||||
drow[FechaCol] = string.Format("{0}{1}", asistencia, asistencia2, salto);
|
||||
//drow[FechaCol] = string.Format("{0}{6}{1}{2}{3}{6}{4}{5}", asistencia, drfec["Horas"], HoraExtraPorAutorizar, asistencia2, Horas2, HoraExtraPorAutorizar2, salto);
|
||||
}
|
||||
else
|
||||
{
|
||||
drow[FechaCol] = string.Format("<div style='display:inline-block'>{0}{6}{1}{2}</div><div style='display:inline-block'>{3}{6}{4}{5}</div>", asistencia, drfec["Horas"], HoraExtraPorAutorizar, asistencia2, Horas2, HoraExtraPorAutorizar2, salto);
|
||||
}
|
||||
//drow[FechaCol] = string.Format("{0}<br>{1:HH}:{1:mm} - {2:HH}:{2:mm}", asistencia, drfec["Entrada"], drfec["Salida"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CFecha.DayOfWeek == DayOfWeek.Sunday)
|
||||
{
|
||||
drow[FechaCol] = "<i class='fa fa-sun-o' style=\"color:green;\"></i>";
|
||||
drow[FechaCol] = strdescanso;
|
||||
TipoAsis = "(Descanso)";
|
||||
}
|
||||
else
|
||||
{
|
||||
drow[FechaCol] = "<div style=\"color:red;\">❌</div>";
|
||||
drow[FechaCol] = salto; // "<div style=\"color:red;\">❌</div>";
|
||||
}
|
||||
}
|
||||
drow[FechaCol] = string.Format("<div class\" Widthall \" onclick=\"OpenModal('{2}',{3}) \">{0}<br>{1}</div>", drow[FechaCol], TipoAsis, FechaCol, item["CvePersonal"]);
|
||||
if (salto == "\r\n")
|
||||
{
|
||||
drow[FechaCol] = string.Format("{0}{4}{1}", drow[FechaCol], TipoAsis, FechaCol, item["CvePersonal"], salto);
|
||||
}
|
||||
else
|
||||
{
|
||||
drow[FechaCol] = string.Format("<div class\" Widthall \" onclick=\"OpenModal('{2}',{3}) \">{0}{4}{1}</div>", drow[FechaCol], TipoAsis, FechaCol, item["CvePersonal"], salto);
|
||||
}
|
||||
//dtCon.Columns.Add(new DataColumn(FechaCol, typeof(string)));Widthall
|
||||
|
||||
|
||||
@@ -275,6 +308,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
{
|
||||
TxtCodigolabel.Text = drow["Codigo"].ToString();
|
||||
TxtEmpleadolabel.Text = drow["NombreCompleto"].ToString();
|
||||
DdlTurno.SelectedValueExist(drow["CveTurno"].ToString());
|
||||
}
|
||||
TxtFechalabel.Text = string.Format("{0:dd/MM/yyyy}", fechai);
|
||||
DataTable dtTurno = GlobalDTTurno.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa));
|
||||
@@ -407,9 +441,16 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
DateTime fecha = TxtFecha.Text.ToDateTime();
|
||||
int CvePersonal = TxtCvePersonal.Text.ToEntero();
|
||||
List<RequestUpAsistenciaDetalle> registros = new List<RequestUpAsistenciaDetalle>();
|
||||
int CveTurnoNEW = DdlTurno.SelectedValue.ToEntero();
|
||||
using (ClsClaseBase objbase = new ClsClaseBase())
|
||||
{
|
||||
objbase.runQuerystr(string.Format("UPDATE RH_Personal SET CveTurno={1} WHERE CvePersonal ={0}", CvePersonal, CveTurnoNEW));
|
||||
|
||||
}
|
||||
foreach (GridViewRow row in GvAsistenciaUp.Rows)
|
||||
{
|
||||
|
||||
int CveTurno = row.DataKey("CveTurno").ToEntero();
|
||||
string Fecha = row.DataKey("Fecha");
|
||||
int CveAsistenciaDetalle = row.DataKey("CveAsistenciaDetalle").ToEntero();
|
||||
int CveAsistenciasInasistencias = row.DataKey("CveAsistenciasInasistencias").ToEntero();
|
||||
int CveProyecto = row.DataKey("CveProyecto").ToEntero();
|
||||
@@ -425,6 +466,15 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
obj.CvePersonal = CvePersonal;
|
||||
obj.Fecha = fecha;
|
||||
obj.Motivo = TxtMotivo.Text.Trim();
|
||||
if (CveTurno != CveTurnoNEW)
|
||||
{
|
||||
using (ClsClaseBase objbase = new ClsClaseBase())
|
||||
{
|
||||
objbase.runQuerystr(string.Format("UPDATE RH_PersonalAsistenciasDetalle SET CveTurno={1} WHERE CveAsistenciaDetalle ={0}", CveAsistenciaDetalle, CveTurnoNEW));
|
||||
objbase.runQuerystr(string.Format("UPDATE D SET CveTurno={1} FROM RH_PersonalAsistencias A INNER JOIN RH_PersonalAsistenciasDetalle D ON D.CveAsistencia =A.CveAsistencia AND D.CveTurno = {2} WHERE A.Fecha > '{0}' AND A.CvePersonal ={3}", Fecha, CveTurnoNEW, CveTurno, CvePersonal));
|
||||
|
||||
}
|
||||
}
|
||||
if (obj.Motivo.Length == 0 && CveAsistenciasInasistencias != obj.CveAsistenciasInasistencias)
|
||||
{
|
||||
continuar = false;
|
||||
@@ -468,6 +518,76 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
|
||||
{
|
||||
|
||||
DataTable dtCon = generateTable("\r\n");
|
||||
dtCon.ExportToExcel("Formato");
|
||||
|
||||
|
||||
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
|
||||
var libro = wb.AddWorksheet(dtCon, "Asistencia");
|
||||
|
||||
//string strinicio;
|
||||
//string strfin;
|
||||
//ClosedXML.Excel.IXLFontBase fini;
|
||||
//for (int r = 2; r < dtCon.Rows.Count + 2; r++)
|
||||
//{
|
||||
// for (int c = 3; c < dtCon.Columns.Count + 1; c++)
|
||||
// {
|
||||
// var ccell = libro.Cell(r, c);
|
||||
|
||||
// if (ccell.Value.ToString().Substring(0, 1) != "")
|
||||
// {
|
||||
// //ccell.RichText.Substring(0, 1).SetFontColor(ClosedXML.Excel.XLColor.Green);
|
||||
// strinicio = ccell.Value.ToString().Substring(0, 1);
|
||||
// switch (strinicio)
|
||||
// {
|
||||
// case "✅":
|
||||
// //ccell.RichText.Substring(0, 1).SetFontColor(ClosedXML.Excel.XLColor.Green);
|
||||
// //ccell.RichText.AddText(ccell.RichText);
|
||||
// //ClosedXML.Excel.IXLFontBase ffin = new ClosedXML.Excel.XLFontBase();
|
||||
// ccell.RichText.SetFontColor(ClosedXML.Excel.XLColor.Green);
|
||||
// break;
|
||||
// case "🌣":
|
||||
// //ccell.RichText.Substring(0, 1).SetFontColor(ClosedXML.Excel.XLColor.Green);
|
||||
// ccell.RichText.SetFontColor(ClosedXML.Excel.XLColor.Green);
|
||||
// break;
|
||||
// case "🕖":
|
||||
// //ccell.RichText.Substring(0, 1).SetFontColor(ClosedXML.Excel.XLColor.Orange);
|
||||
// ccell.RichText.SetFontColor(ClosedXML.Excel.XLColor.Orange);
|
||||
// break;
|
||||
// case "❌":
|
||||
// //ccell.RichText.Substring(0, 1).SetFontColor(ClosedXML.Excel.XLColor.Red);
|
||||
// ccell.RichText.SetFontColor(ClosedXML.Excel.XLColor.Red);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
libro.Tables.FirstOrDefault().ShowAutoFilter = false;
|
||||
libro.SheetView.Freeze(1, 2);
|
||||
libro.ColumnsUsed().AdjustToContents();
|
||||
libro.Range(1, 3, dtCon.Rows.Count, dtCon.Columns.Count).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center;
|
||||
|
||||
|
||||
|
||||
System.IO.Stream fs = new System.IO.MemoryStream();
|
||||
wb.SaveAs(fs);
|
||||
fs.Position = 0;
|
||||
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
|
||||
using (System.IO.Stream input = fs)
|
||||
|
||||
{
|
||||
input.CopyTo(memoryStream);
|
||||
}
|
||||
memoryStream.Position = 0;
|
||||
|
||||
Response.Clear();
|
||||
Response.Buffer = true;
|
||||
|
||||
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
Response.AddHeader("content-disposition", string.Format("attachment;filename={0} del {1} al {2}.xlsx", "Asistencia", TxtRpdFechaInicio.Text.Replace("/", "-"), TxtRpdFechaFin.Text.Replace("/", "-")));
|
||||
Response.BinaryWrite(memoryStream.ToArray());
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -147,6 +147,19 @@
|
||||
<asp:Label ID="LblSalario" runat="server" Text="--"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="True" DataTextField="MotivoBaja" DataValueField="CveMotivoBaja" Width="100%"
|
||||
CssClass="form-control select2me" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Text="Ordinario" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Extraordinario" Value="-2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label runat="server" Text="Tipo perdiodo" AssociatedControlID="DdlTipoPeriodo"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1077,7 +1077,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
using (ClsRH ObjPersonal = new ClsRH())
|
||||
using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL()))
|
||||
{
|
||||
if (continuar = ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
||||
if (continuar = ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlTipoPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow da = ObjPersonal.DtResultados.Rows[0];
|
||||
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
||||
@@ -1329,7 +1329,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
using (ClsRH ObjPersonal = new ClsRH())
|
||||
using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL()))
|
||||
{
|
||||
if (continuar = ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
||||
if (continuar = ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlTipoPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow da = ObjPersonal.DtResultados.Rows[0];
|
||||
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
||||
|
||||
Reference in New Issue
Block a user