mina
This commit is contained in:
@@ -861,26 +861,41 @@
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
|
||||
<asp:LinkButton ID="LnkFormatocMasivaRegistroPatronal" CssClass="btn btn-default" OnClick="LnkFormatocMasivaRegistroPatronal_Click" runat="server"><i class="fa fa-ad-excel"></i> Formato Registro Patronal</asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkFormatocMasiva" CssClass="btn btn-default" OnClick="LnkFormatocMasiva_Click" runat="server"><i class="fa fa-ad-excel"></i> Formato Salario</asp:LinkButton>
|
||||
<div class="btn-group ">
|
||||
<a class="btn yellow-gold btn-sm" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"><i class="fa fa-ad-excel"></i> Formatos
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkFormatocMasivaRegistroPatronal" OnClick="LnkFormatocMasivaRegistroPatronal_Click" runat="server"> Registro Patronal</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkFormatocMasiva" OnClick="LnkFormatocMasiva_Click" runat="server"> Salario</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkFormatocMasivaTS" OnClick="LnkFormatocMasivaTS_Click" runat="server"> Tipo salario</asp:LinkButton>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding ">
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-1 compoonenlabel" style="line-height: 1; max-width: 65px;">Tipo:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="ddltipoCarga" runat="server" Style="width: 100% !important;" CssClass="select2me">
|
||||
<asp:ListItem Text="Salario" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Registro Patronal" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label ID="Label2" runat="server" CssClass="col-md-1 ">Fecha :</asp:Label>
|
||||
<div class="col-md-2" id="Div2" runat="server">
|
||||
|
||||
<label class="col-md-1 compoonenlabel" style="line-height: 1; max-width: 65px;">Tipo:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="ddltipoCarga" runat="server" Style="width: 100% !important;" CssClass="select2me">
|
||||
<asp:ListItem Text="Salario" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Tipo salario" Value="3"></asp:ListItem>
|
||||
<asp:ListItem Text="Registro Patronal" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label ID="Label2" runat="server" CssClass="col-md-2 ">Fecha :</asp:Label>
|
||||
<div class="col-md-4" id="Div2" runat="server">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtfechacargamasiva" runat="server" Text="01/03/2021" CssClass="form-control" CausesValidation="true" Width="90%" MaxLength="10"></asp:TextBox>
|
||||
<asp:TextBox ID="txtfechacargamasiva" runat="server" Text="01/03/2021" CssClass="form-control" CausesValidation="true" Width="100%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="lnkcargamasiva" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
@@ -911,6 +926,7 @@
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkFormatocMasiva" />
|
||||
<asp:PostBackTrigger ControlID="LnkFormatocMasivaTS" />
|
||||
<asp:PostBackTrigger ControlID="LnkFormatocMasivaRegistroPatronal" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -391,6 +391,75 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
Alert("Ocurrio un error al generar el Formato de nominas" + ex.ToString(), TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
protected void LnkFormatocMasivaTS_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool continuar = true;
|
||||
string msgerror = "";
|
||||
if (dtsalario == null || dtsalario.Rows.Count == 0)
|
||||
{
|
||||
msgerror = "favor de calcular primero";
|
||||
continuar = false;
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
|
||||
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
|
||||
|
||||
var libro = wb.AddWorksheet("Salario");
|
||||
int column = 1;
|
||||
libro.Cell(1, column).Value = "Codigo";
|
||||
column++;
|
||||
libro.Cell(1, column).Value = "Empleado";
|
||||
column++;
|
||||
libro.Cell(1, column).Value = "TipodeSalario";
|
||||
libro.Row(1).CellsUsed().Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
|
||||
libro.Row(1).CellsUsed().Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189));
|
||||
|
||||
int Fila = 1;
|
||||
foreach (DataRow erow in dtsalario.Rows)
|
||||
{
|
||||
Fila++;
|
||||
column = 1;
|
||||
libro.Cell(Fila, column).Value = string.Format("'{0}", erow["Codigo"]);
|
||||
column++;
|
||||
libro.Cell(Fila, column).Value = erow["Nombre"];
|
||||
|
||||
column++;
|
||||
libro.Cell(Fila, column).Value = erow["TipodeSalario"];
|
||||
}
|
||||
|
||||
libro.Columns().AdjustToContents();
|
||||
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}.xlsx", "Plantilla Salario "));
|
||||
Response.BinaryWrite(memoryStream.ToArray());
|
||||
Response.End();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(msgerror, TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Alert("Ocurrio un error al generar el Formato de nominas" + ex.ToString(), TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkProcesarArchvo_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -475,7 +544,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
|
||||
StringBuilder str = new StringBuilder();
|
||||
bool rollback = false;
|
||||
using (ClsClaseBase objNomina = new ClsClaseBase( ))
|
||||
using (ClsClaseBase objNomina = new ClsClaseBase())
|
||||
using (ClsRH objpersonal = new ClsRH())
|
||||
{
|
||||
|
||||
@@ -483,7 +552,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
{
|
||||
string Codigo = row["Codigo"].ToString();
|
||||
int CvePersonal = -1; // row["CvePersonal"].ToString().ToEntero();
|
||||
string RegistroPatronal = row["RegistroPatronal"].ToString() ;
|
||||
string RegistroPatronal = row["RegistroPatronal"].ToString();
|
||||
int CveMetodoPago = 0;
|
||||
if (Codigo != "-1" && objpersonal.GetPersonal(CvePersonal, Codigo, "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) &&
|
||||
objpersonal.DtResultados.Rows.Count == 1)
|
||||
@@ -501,7 +570,47 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
objNomina.runQuerystr(string.Format("EXEC PA_RH_PersonalRPUpdate {0},'{1}'", CvePersonal, RegistroPatronal));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (ddltipoCarga.SelectedValue.ToEntero() == 3)
|
||||
{
|
||||
|
||||
List<Archivo> Filesgral = TxtArchivoNomina.getfiles().Archivos;
|
||||
Archivo fileItem = Filesgral.Count > 0 ? Filesgral[0] : null;
|
||||
DataTable DTEXcel = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true);
|
||||
|
||||
StringBuilder str = new StringBuilder();
|
||||
bool rollback = false;
|
||||
using (ClsClaseBase objNomina = new ClsClaseBase())
|
||||
using (ClsRH objpersonal = new ClsRH())
|
||||
{
|
||||
|
||||
foreach (DataRow row in DTEXcel.FiltraParametros("LEN(Codigo)>0 ").Rows)
|
||||
{
|
||||
string Codigo = row["Codigo"].ToString();
|
||||
int CvePersonal = -1; // row["CvePersonal"].ToString().ToEntero();
|
||||
string TipodeSalario = row["TipodeSalario"].ToString();
|
||||
int CveMetodoPago = 0;
|
||||
if (Codigo != "-1" && objpersonal.GetPersonal(CvePersonal, Codigo, "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) &&
|
||||
objpersonal.DtResultados.Rows.Count == 1)
|
||||
{
|
||||
CvePersonal = objpersonal.CvePersonal;
|
||||
CveMetodoPago = objpersonal.CveMetodoPago;
|
||||
}
|
||||
else
|
||||
{
|
||||
CvePersonal = 0;
|
||||
str.AppendLine(string.Format("No se encontro el codigo {0}<br>", Codigo));
|
||||
}
|
||||
if (CvePersonal > 0)
|
||||
{
|
||||
objNomina.runQuerystr(string.Format("EXEC PA_RH_PersonalTSUpdate {0},'{1}'", CvePersonal, TipodeSalario));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAsistenciasInasistencias,Tipo,AplicaAsistencia,AplicaFalta,AplicaVacacion,AplicaIncapacidad,AplicaRetardo,AplicaAguinaldo,AplicaUtilidades,Estatus" EmptyDataText="No se encontraron AsistenciasInasistenciass Registrados" ToolTip="Listado de AsistenciasInasistenciass" CssClass="table table-striped table-hover Widthall" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAsistenciasInasistencias,Tipo,AplicaAsistencia,AplicaFalta,AplicaVacacion,AplicaIncapacidad,AplicaRetardo,AplicaAguinaldo,AplicaUtilidades,AplicaPago,AplicaPagoDoble,AplicaPrimaVac,Estatus" EmptyDataText="No se encontraron AsistenciasInasistenciass Registrados" ToolTip="Listado de AsistenciasInasistenciass" CssClass="table table-striped table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Tipo" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
@@ -86,6 +86,16 @@
|
||||
<asp:Literal ID="LtlAplicaUtilidades" runat="server" Text='<%# Eval("AplicaUtilidades") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aplica Pago" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAplicapago" runat="server" Text='<%# Eval("AplicaPago") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aplica Pago Doble" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAplicapagoDoble" runat="server" Text='<%# Eval("AplicaPagoDoble") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
@@ -174,6 +184,10 @@
|
||||
<label for="AplicaRetardo">Aplica Retardo:</label><br />
|
||||
<asp:CheckBox ID="AplicaRetardo" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="ChkAplicaPrimaVac">Aplica Prima Vacacional:</label><br />
|
||||
<asp:CheckBox ID="ChkAplicaPrimaVac" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@@ -184,12 +198,22 @@
|
||||
<label for="AplicaUtilidades">Aplica Utilidades:</label><br />
|
||||
<asp:CheckBox ID="AplicaUtilidades" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
</div>
|
||||
<div id="CheckActiveSection" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Activo:</label><br />
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label for="ChkAplicaPago">Aplica Pago:</label><br />
|
||||
<asp:CheckBox ID="ChkAplicaPago" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="ChkAplicaPagoDoble">Aplica Pago doble:</label><br />
|
||||
<asp:CheckBox ID="ChkAplicaPagoDoble" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="CheckActiveSection" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Activo:</label><br />
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="chksino" data-size="small" Text=" " Checked="true" />
|
||||
<div class="row">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -85,10 +85,13 @@ Partial Class RH_CatAsistenciasInasistencias
|
||||
Dim chkAplicaRetardo As Boolean = AplicaRetardo.Checked
|
||||
Dim chkAplicaAguinaldo As Boolean = AplicaAguinaldo.Checked
|
||||
Dim chkAplicaUtilidades As Boolean = AplicaUtilidades.Checked
|
||||
Dim aplicaPago As Integer = If(ChkAplicaPago.Checked, 1, 0)
|
||||
Dim aplicaPagoDoble As Integer = If(ChkAplicaPagoDoble.Checked, 1, 0)
|
||||
Dim aplicaPrimaVac As Integer = If(ChkAplicaPrimaVac.Checked, 1, 0)
|
||||
|
||||
|
||||
If ObjAsistenciasInasistencias.AddAsistenciasInasistencias(TipoTxt.Text.Trim, chkAplicaFalta, chkAplicaNoAplica, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades) Then
|
||||
chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades, aplicaPago, aplicaPagoDoble, aplicaPrimaVac) Then
|
||||
TipoTxt.Text = ""
|
||||
Alert("El nuevo Tipo Asistencias/Inasistencias se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
@@ -129,6 +132,11 @@ chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, c
|
||||
AplicaAguinaldo.Checked = If(GvRow.DataKey("AplicaAguinaldo") = "Aplica", True, False)
|
||||
AplicaUtilidades.Checked = If(GvRow.DataKey("AplicaUtilidades") = "Aplica", True, False)
|
||||
|
||||
ChkAplicaPago.Checked = If(GvRow.DataKey("AplicaPago") = "Aplica", True, False)
|
||||
ChkAplicaPagoDoble.Checked = If(GvRow.DataKey("AplicaPagoDoble") = "Aplica", True, False)
|
||||
ChkAplicaPrimaVac.Checked = If(GvRow.DataKey("AplicaPrimaVac") = "Aplica", True, False)
|
||||
|
||||
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
|
||||
CveTipoAsisAEditar = Convert.ToInt32(GvRow.DataKey("CveAsistenciasInasistencias")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating"
|
||||
|
||||
@@ -156,9 +164,16 @@ chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, c
|
||||
Dim chkAplicaAguinaldo As Boolean = AplicaAguinaldo.Checked
|
||||
Dim chkAplicaUtilidades As Boolean = AplicaUtilidades.Checked
|
||||
|
||||
Dim aplicaPago As Integer = If(ChkAplicaPago.Checked, 1, 0)
|
||||
Dim aplicaPagoDoble As Integer = If(ChkAplicaPagoDoble.Checked, 1, 0)
|
||||
Dim aplicaPrimaVac As Integer = If(ChkAplicaPrimaVac.Checked, 1, 0)
|
||||
|
||||
|
||||
|
||||
|
||||
If ObjAsistenciasInasistencias.UpdateAsistenciasInasistencias(Tipo, ckAplicaFalta, AplicaAsistencia, Estatus, CveAsistenciasInasistencias,
|
||||
chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades) Then
|
||||
chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades, aplicaPago, aplicaPagoDoble,
|
||||
aplicaPrimaVac) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTAsistenciasInasistencias") = ObjAsistenciasInasistencias.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTAsistenciasInasistencias = ObjAsistenciasInasistencias.DtResultados
|
||||
|
||||
Reference in New Issue
Block a user