mina
This commit is contained in:
@@ -330,7 +330,8 @@ Public Class ClsRH
|
||||
End Function
|
||||
|
||||
Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer,
|
||||
chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean
|
||||
chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean,
|
||||
chkAplicaUtilidades As Boolean, aplicaPago As Integer, aplicaPagoDoble As Integer, aplicaPrimaVac As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_RH_AsistenciasInasistenciasAdd")
|
||||
@@ -347,6 +348,9 @@ Public Class ClsRH
|
||||
.Add("@AplicaRetardo", SqlDbType.Bit).Value = chkAplicaRetardo
|
||||
.Add("@AplicaAguinaldo", SqlDbType.Bit).Value = chkAplicaAguinaldo
|
||||
.Add("@AplicaUtilidades", SqlDbType.Bit).Value = chkAplicaUtilidades
|
||||
.Add("@AplicaPago", SqlDbType.Int).Value = aplicaPago
|
||||
.Add("@AplicaPagoDoble", SqlDbType.Int).Value = aplicaPagoDoble
|
||||
.Add("@AplicaPrimaVac", SqlDbType.Int).Value = aplicaPrimaVac
|
||||
|
||||
End With
|
||||
|
||||
@@ -367,7 +371,8 @@ Public Class ClsRH
|
||||
End Function
|
||||
|
||||
Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer,
|
||||
chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean
|
||||
chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean,
|
||||
aplicaPago As Integer, aplicaPagoDoble As Integer, aplicaPrimaVac As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_RH_AsistenciasInasistenciasUpdate")
|
||||
@@ -384,6 +389,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
||||
.Add("@AplicaRetardo", SqlDbType.Bit).Value = chkAplicaRetardo
|
||||
.Add("@AplicaAguinaldo", SqlDbType.Bit).Value = chkAplicaAguinaldo
|
||||
.Add("@AplicaUtilidades", SqlDbType.Bit).Value = chkAplicaUtilidades
|
||||
.Add("@AplicaPago", SqlDbType.Int).Value = aplicaPago
|
||||
.Add("@AplicaPagoDoble", SqlDbType.Int).Value = aplicaPagoDoble
|
||||
.Add("@AplicaPrimaVac", SqlDbType.Int).Value = aplicaPrimaVac
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -144,7 +144,8 @@ Public Class LogicNominas
|
||||
Dim SalarioDiarioSS As Double = 0
|
||||
Dim ClaveEstado As String = ""
|
||||
Dim MetodoPagoFijo As Boolean
|
||||
|
||||
Dim totalDb As Decimal
|
||||
Dim subTotalDb As Decimal
|
||||
Dim CodigoPostal As String = ""
|
||||
|
||||
Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades)
|
||||
@@ -157,6 +158,8 @@ Public Class LogicNominas
|
||||
Dim drow As DataRow = objNomina.DtResultados.Rows(0)
|
||||
CvePersonal = drow("CvePersonal").ToString().ToEntero()
|
||||
CvePeriodo = drow("CvePeriodo").ToString().ToEntero()
|
||||
totalDb = drow("Total").ToString().ToDecimal()
|
||||
subTotalDb = drow("SubTotal").ToString().ToDecimal()
|
||||
cfdi.Nomina.Antiguedad = drow("Antiguedad").ToString().ToEntero()
|
||||
cfdi.Nomina.UltimoSueldoOrdinario = drow("UltimoSueldoOrdinario").ToString().ToDecimal()
|
||||
Serie = objNomina.Serie
|
||||
@@ -438,9 +441,9 @@ Public Class LogicNominas
|
||||
cfdi.Comprobante.Serie = Serie
|
||||
cfdi.Comprobante.Folio = Folio
|
||||
cfdi.Comprobante.Fecha = Now
|
||||
cfdi.Comprobante.SubTotal = cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal()
|
||||
cfdi.Comprobante.SubTotal = subTotalDb 'cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal()
|
||||
cfdi.Comprobante.Descuentos = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()
|
||||
cfdi.Comprobante.Total = cfdi.Comprobante.SubTotal - cfdi.Comprobante.Descuentos 'cfdi.Nomina.TotalPercepciones + cfdi.Nomina.TotalOtrosPagos - cfdi.Nomina.TotalDeducciones
|
||||
cfdi.Comprobante.Total = totalDb 'cfdi.Comprobante.SubTotal - cfdi.Comprobante.Descuentos 'cfdi.Nomina.TotalPercepciones + cfdi.Nomina.TotalOtrosPagos - cfdi.Nomina.TotalDeducciones
|
||||
cfdi.Comprobante.MotivoDescuento = "" '"Deducciones nómina"
|
||||
cfdi.Comprobante.Moneda = "MXN"
|
||||
cfdi.Comprobante.TipoComprobante = "N"
|
||||
|
||||
@@ -75,12 +75,12 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
}
|
||||
|
||||
set { ViewState["dtempleados"] = value; }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
{
|
||||
GvFinOrdinario.DataSource = new DataTable();
|
||||
GVFinIndemnizacion.DataSource = new DataTable();
|
||||
GvFinOrdinario.DataBind();
|
||||
@@ -154,22 +154,20 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
FechaInicio = LblFechaAlta.Text.ToDateTime();
|
||||
TxtObservaciones.Text = da["Observaciones"].ToString();
|
||||
TxtFechaBaja.Text = string.Format("{0:dd/MM/yyyy}", da["FechaFin"]);
|
||||
if (da["CveMotivoBaja"].ToString() == "")
|
||||
{
|
||||
if (da["CveMotivoBaja"].ToString() == "")
|
||||
{
|
||||
chkIndemnizacion.Checked = true;
|
||||
chkSeparacionUnica.Checked = true;
|
||||
chkPrimaantiguedad.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
chkIndemnizacion.Checked = da["ValIndemnizacion"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
|
||||
chkSeparacionUnica.Checked = da["ValSeparacionunica"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
|
||||
chkPrimaantiguedad.Checked = da["ValPrimadeantiguedad"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
|
||||
}
|
||||
chkIndemnizacion.Checked = true;
|
||||
chkSeparacionUnica.Checked = true;
|
||||
chkPrimaantiguedad.Checked = true;
|
||||
}
|
||||
|
||||
DdlTipoPeriodo.SelectedValueExist(((da["CveTipoPeriodo"]).ToString()=="6"?"-2":"-1"));
|
||||
else
|
||||
{
|
||||
chkIndemnizacion.Checked = da["ValIndemnizacion"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
|
||||
chkSeparacionUnica.Checked = da["ValSeparacionunica"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
|
||||
chkPrimaantiguedad.Checked = da["ValPrimadeantiguedad"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
|
||||
}
|
||||
|
||||
DdlTipoPeriodo.SelectedValueExist(((da["CveTipoPeriodo"]).ToString() == "6" ? "-2" : "-1"));
|
||||
DdlMotivoBaja.SelectedValueExist(da["CveMotivoBaja"]);
|
||||
TxtSalarioMinimo.Text = $"{da["SalarioMinimo"]:N2}";
|
||||
ChkesLiquidacion.Checked = (da["esLiquidacion"].ToString() == "1" || da["esLiquidacion"].ToString().ToUpper() == "TRUE");
|
||||
@@ -183,6 +181,30 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
{
|
||||
loadsobrerecibo(onom);
|
||||
}
|
||||
|
||||
if (da["Autorizado"].ToString().ToEntero() == 1)
|
||||
{
|
||||
|
||||
LnkAutorizar.Visible = false;
|
||||
LnkTimbrar.Visible = true;
|
||||
|
||||
LnkGuardarDatos.Enabled = false;
|
||||
|
||||
LnkGuardarDatos.CssClass = "btn btn-default";
|
||||
LnkGuardarDatos.ToolTip = "el finiquito ha sido capturado.";
|
||||
}
|
||||
|
||||
if (da["SeTimbro"].ToString().ToEntero() == 1)
|
||||
{
|
||||
LnkAutorizar.Visible = false;
|
||||
LnkTimbrar.Visible = false;
|
||||
|
||||
LnkGuardarDatos.Enabled = false;
|
||||
|
||||
LnkGuardarDatos.CssClass = "btn btn-default";
|
||||
LnkGuardarDatos.ToolTip = "el finiquito ha sido capturado.";
|
||||
}
|
||||
UpAcciones.Update();
|
||||
}
|
||||
}
|
||||
CamposCalculados();
|
||||
@@ -537,13 +559,13 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
|
||||
string[] getcolumnas = new string[] { "CvePersonal", "CveMetodoPago", "CveNomina", "Total", "SalarioDiario", "SalarioDiarioIMSS", "SalarioDiarioIntegrado", "DiasLaborados", "DiasFaltados", "DiasVacaciones", "DiasIncapacidad" };
|
||||
|
||||
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0", CvePersonal), "", getcolumnas);
|
||||
DataTable dtr = dtempleados.FiltraParametros(string.Format(" CvePersonal={0} ", CvePersonal), "", getcolumnas);
|
||||
int CveNomina = dtr.Rows[0]["CveNomina"].ToString().ToEntero();
|
||||
LogicNominas lognom = new LogicNominas();
|
||||
|
||||
|
||||
string Msg = "";
|
||||
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual,versionTimbre:(UsuarioActual.CveEmpresa == 119? VersionTimbradoEnum.PorDefectoEmpresa: VersionTimbradoEnum.Version3_3));
|
||||
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, versionTimbre: (UsuarioActual.CveEmpresa == 119 ? VersionTimbradoEnum.PorDefectoEmpresa : VersionTimbradoEnum.Version3_3));
|
||||
|
||||
if (Msg != null && Msg.Length > 0)
|
||||
{ Alert(Msg, TipoMensaje.MsgAdvertencia); }
|
||||
@@ -738,7 +760,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
DiasFaltados = string.Format("{0}", drow["DiasFaltados"].ToString().ToEntero());
|
||||
DiasVacaciones = string.Format("{0}", drow["DiasVacaciones"].ToString().ToEntero());
|
||||
FechaInicio = string.Format("{0:dd/MM/yyyy}", drow["FechaInicio"]);
|
||||
FechaFin = string.Format("{0:dd/MM/yyyy}", drow["FechaFin"]);
|
||||
//FechaFin = string.Format("{0:dd/MM/yyyy}", drow["FechaFin"]);
|
||||
DiasRetardos = string.Format("{0}", drow["DiasRetardos"].ToString().ToEntero());
|
||||
DiasIncapacidad = string.Format("{0}", drow["DiasIncapacidad"].ToString().ToEntero());
|
||||
}
|
||||
@@ -753,6 +775,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
NombreCompleto = drow["NombreCompleto"].ToString();
|
||||
RFC = drow["RFC"].ToString();
|
||||
CURP = drow["CURP"].ToString();
|
||||
FechaFin = string.Format("{0:dd/MM/yyyy}", drow["FechaFin"]);
|
||||
TipoPeriodo = drow["TipoPeriodo"].ToString();
|
||||
NSS = drow["NSS"].ToString();
|
||||
}
|
||||
@@ -1087,7 +1110,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
using (ClsRH ObjPersonal = new ClsRH())
|
||||
using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL()))
|
||||
{
|
||||
if (continuar = ObjPersonal.UpPersonalAltas(CvePersonal, UsuarioActual.CveUsuario, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlTipoPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked,TxtObservaciones.Text ) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
||||
if (continuar = ObjPersonal.UpPersonalAltas(CvePersonal, UsuarioActual.CveUsuario, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlTipoPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked, TxtObservaciones.Text) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow da = ObjPersonal.DtResultados.Rows[0];
|
||||
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
||||
@@ -1136,7 +1159,8 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
}*/
|
||||
dtempleadosConceptos = null;
|
||||
dtempleados = null;
|
||||
if (objnom.GetNominaEmpleado(-1, -1, -1, CvePeriodoFiniquito, UsuarioActual.CveEmpresa, 1, 3, CvePersonal) && objnom.DTSetResultados.Tables.Count > 1)
|
||||
LnkAutorizar.Visible = true;
|
||||
if (objnom.GetNominaEmpleado(-1, -1, -1, CvePeriodoFiniquito, UsuarioActual.CveEmpresa, 1, 3, CvePersonal,Neto:1) && objnom.DTSetResultados.Tables.Count > 1)
|
||||
{
|
||||
dtempleados = objnom.DTSetResultados.Tables[3];
|
||||
LnkAutorizar.Visible = (dtempleados.COUNT("CvePersonal", "NomAutorizado =0") > 0);
|
||||
@@ -1164,7 +1188,6 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
LnkGuardarDatos.CssClass = "btn btn-default";
|
||||
LnkGuardarDatos.ToolTip = "el finiquito ha sido capturado.";
|
||||
}
|
||||
LnkAutorizar.Visible = true;
|
||||
}
|
||||
|
||||
protected void LnkAutorizar_Click(object sender, EventArgs e)
|
||||
@@ -1350,7 +1373,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
if (continuar)
|
||||
{
|
||||
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa, diasindemnizacion: Txtdiasindemnizacion.Text.ToEntero());
|
||||
if(onom.DtResultados.Rows.Count > 0)
|
||||
if (onom.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow drow = onom.DtResultados.Rows[0];
|
||||
|
||||
@@ -1358,7 +1381,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
||||
LtlSFSDI.Text = string.Format("<pre>{0:##,###,###.00##}</pre>", drow["SDI"]);
|
||||
LtlSFDias.Text = string.Format("<pre>{0:##,###,###}</pre>", drow["diasMesAnterior"]);
|
||||
LtlSFPercepciones.Text = string.Format("<pre>{0:##,###,###.00##}</pre>", drow["TotalPercepciones"]);
|
||||
LtlSFVar.Text = string.Format("<pre>(Percepciones /días)\r\n{0:##,###,###.00##}</pre>", drow["TotalPercepciones"].ToString().ToDecimal() / drow["diasMesAnterior"].ToString().ToDecimal() );
|
||||
LtlSFVar.Text = string.Format("<pre>(Percepciones /días)\r\n{0:##,###,###.00##}</pre>", drow["TotalPercepciones"].ToString().ToDecimal() / drow["diasMesAnterior"].ToString().ToDecimal());
|
||||
LtlSF.Text = string.Format("<pre>Si((Tipo de salario ='Fijo'),SDI,(Salario Variable + SDI))\r\n{0:##,###,###.00##}</pre>", drow["SalarioBC"]);
|
||||
}
|
||||
GVSDF.DataSource = onom.DTSetResultados.Tables[1];
|
||||
|
||||
@@ -106,6 +106,16 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
set { ViewState["DtSuaProcesado"] = value; }
|
||||
}
|
||||
|
||||
protected bool enviarCorreoEnTimbrado
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["enviarCorreoEnTimbrado"] == null) { return false; }
|
||||
else { return (bool)ViewState["enviarCorreoEnTimbrado"]; }
|
||||
}
|
||||
|
||||
set { ViewState["enviarCorreoEnTimbrado"] = value; }
|
||||
}
|
||||
protected bool PermisoCancelarEmitido
|
||||
{
|
||||
get
|
||||
@@ -249,6 +259,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
enviarCorreoEnTimbrado = (UsuarioActual.CveEmpresa == 141 ? false : true);
|
||||
LnkCargaNetos.Visible = (UsuarioActual.Empresa.Funcionalidad(267) == "1") || (UsuarioActual.CveRol == 1);
|
||||
if (UsuarioActual.CveEmpresa == 141) { ddlfiniquito.SelectedValueExist("2"); }
|
||||
using (ClsRH objrh = new ClsRH())
|
||||
@@ -556,7 +567,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
LnkFormatoTabular.Visible = true;
|
||||
HypPDFSTimbrados.Visible = true;
|
||||
if (objnom.GetNominaEmpleado(FiltCveProyecto, FiltCveSubProyecto, FiltCveTurno, FiltCvePeriodo, CveEmpresa, FiltAgrupador, DdlRegimenContratacion.SelectedValue.ToEntero(), CveTipoTrabajador: CveTipoTrabajador,Neto: ddlfiniquito.SelectedValue.ToEntero()) && objnom.DTSetResultados.Tables.Count > 4)
|
||||
if (objnom.GetNominaEmpleado(FiltCveProyecto, FiltCveSubProyecto, FiltCveTurno, FiltCvePeriodo, CveEmpresa, FiltAgrupador, DdlRegimenContratacion.SelectedValue.ToEntero(), CveTipoTrabajador: CveTipoTrabajador, Neto: ddlfiniquito.SelectedValue.ToEntero()) && objnom.DTSetResultados.Tables.Count > 4)
|
||||
{
|
||||
dtempleados = objnom.DTSetResultados.Tables[3];
|
||||
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
|
||||
@@ -1237,9 +1248,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
if (pdf != null)
|
||||
{
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = "Nomina.pdf" });
|
||||
|
||||
if (ObjNomina.GetNom_Nominas(-1, TxtCvePersonal.Text.ToEntero(), TxtCvePeriodo.Text.ToEntero(), -1, UsuarioActual.CveEmpresa))
|
||||
if (ObjNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
string Ruta = "";
|
||||
string PathXML = "";
|
||||
@@ -1252,7 +1262,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
Xmlname = $"{ObjNomina.SerieFolio}.xml";
|
||||
XmlnameF = $"{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = $"{ObjNomina.SerieFolio}.pdf" });
|
||||
//this.GuardaLog(PathXML);
|
||||
if (!string.IsNullOrEmpty(PathXML) && System.IO.File.Exists(PathXML))
|
||||
{
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { Ruta = PathXML, NombreArchivo = Xmlname });
|
||||
@@ -1326,96 +1337,97 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
objrh.GetPersonal(-1, UsuarioActual.CveEmpresa);
|
||||
dtpersonal = objrh.DtResultados.FiltraParametros("", "", new string[] { "CvePersonal", "Correo", "NombreCompleto", "RFC", "CURP" });
|
||||
}
|
||||
using (ClsNominas ObjNomina = new ClsNominas()) {
|
||||
foreach (GridViewRow gvRow in GvNominas.Rows)
|
||||
using (ClsNominas ObjNomina = new ClsNominas())
|
||||
{
|
||||
CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
|
||||
int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
|
||||
int CveNomina = gvRow.DataKey("CveNomina").ToEntero();
|
||||
LinkButton LnkTimbrar = gvRow.FCLinkButton("LnkTimbrar");
|
||||
string Correo = string.Empty;
|
||||
string NombreCompleto = string.Empty;
|
||||
string RFC = string.Empty;
|
||||
string CURP = string.Empty;
|
||||
if (dtpersonal.Rows.Count > 0 && (drow = dtpersonal.FiltroPrimero(string.Format("CvePersonal = {0}", CvePersonal))) != null)
|
||||
foreach (GridViewRow gvRow in GvNominas.Rows)
|
||||
{
|
||||
Correo = drow["Correo"].ToString();
|
||||
NombreCompleto = drow["NombreCompleto"].ToString();
|
||||
RFC = drow["RFC"].ToString();
|
||||
CURP = drow["CURP"].ToString();
|
||||
}
|
||||
if (CvePersonal > 0 && LnkTimbrar.Visible)
|
||||
{
|
||||
LogicNominas lognom = new LogicNominas();
|
||||
|
||||
string Msg = "";
|
||||
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, versionTimbre: (UsuarioActual.CveEmpresa == 119 ? VersionTimbradoEnum.PorDefectoEmpresa : VersionTimbradoEnum.Version3_3));
|
||||
|
||||
if (Msg != null && Msg.Length > 0)
|
||||
CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
|
||||
int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
|
||||
int CveNomina = gvRow.DataKey("CveNomina").ToEntero();
|
||||
LinkButton LnkTimbrar = gvRow.FCLinkButton("LnkTimbrar");
|
||||
string Correo = string.Empty;
|
||||
string NombreCompleto = string.Empty;
|
||||
string RFC = string.Empty;
|
||||
string CURP = string.Empty;
|
||||
if (dtpersonal.Rows.Count > 0 && (drow = dtpersonal.FiltroPrimero(string.Format("CvePersonal = {0}", CvePersonal))) != null)
|
||||
{
|
||||
Msg = msgCorregidoSat(Msg, CvePersonal, RFC, CURP);
|
||||
msggral = string.Format("{0}<tr><td>{3}</td><td>{2}</td><td><pre>{1}</pre></td></tr>", msggral, Msg, gvRow.DataKey("Nombre"), gvRow.DataKey("Codigo"));
|
||||
Correo = drow["Correo"].ToString();
|
||||
NombreCompleto = drow["NombreCompleto"].ToString();
|
||||
RFC = drow["RFC"].ToString();
|
||||
CURP = drow["CURP"].ToString();
|
||||
}
|
||||
else
|
||||
if (CvePersonal > 0 && LnkTimbrar.Visible)
|
||||
{
|
||||
LnkTimbrar.Visible = false;
|
||||
gvRow.CssClass = "success";
|
||||
gvRow.FindControl("ImgDelete").Visible = false;
|
||||
gvRow.FindControl("Imgdesautorizar").Visible = false;
|
||||
LogicNominas lognom = new LogicNominas();
|
||||
|
||||
gvRow.FindControl("LnkCancelar").Visible = true;
|
||||
gvRow.FindControl("HypXml").Visible = true;
|
||||
gvRow.FindControl("HypPDF").Visible = true;
|
||||
string Msg = "";
|
||||
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, versionTimbre: (UsuarioActual.CveEmpresa == 119 ? VersionTimbradoEnum.PorDefectoEmpresa : VersionTimbradoEnum.Version3_3));
|
||||
|
||||
gvRow.ForeColor = Color.Green;
|
||||
|
||||
if (Correo.Trim().Length > 0)
|
||||
if (Msg != null && Msg.Length > 0)
|
||||
{
|
||||
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
|
||||
if (pdf != null)
|
||||
Msg = msgCorregidoSat(Msg, CvePersonal, RFC, CURP);
|
||||
msggral = string.Format("{0}<tr><td>{3}</td><td>{2}</td><td><pre>{1}</pre></td></tr>", msggral, Msg, gvRow.DataKey("Nombre"), gvRow.DataKey("Codigo"));
|
||||
}
|
||||
else
|
||||
{
|
||||
LnkTimbrar.Visible = false;
|
||||
gvRow.CssClass = "success";
|
||||
gvRow.FindControl("ImgDelete").Visible = false;
|
||||
gvRow.FindControl("Imgdesautorizar").Visible = false;
|
||||
|
||||
gvRow.FindControl("LnkCancelar").Visible = true;
|
||||
gvRow.FindControl("HypXml").Visible = true;
|
||||
gvRow.FindControl("HypPDF").Visible = true;
|
||||
|
||||
gvRow.ForeColor = Color.Green;
|
||||
|
||||
if (enviarCorreoEnTimbrado && Correo.Trim().Length > 0)
|
||||
{
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = "Nomina.pdf" });
|
||||
|
||||
if (ObjNomina.GetNom_Nominas(-1, TxtCvePersonal.Text.ToEntero(), TxtCvePeriodo.Text.ToEntero(), -1, UsuarioActual.CveEmpresa))
|
||||
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
|
||||
if (pdf != null)
|
||||
{
|
||||
string Ruta = "";
|
||||
string PathXML = "";
|
||||
string PathXMLF = "";
|
||||
string Xmlname = "";
|
||||
string XmlnameF = "";
|
||||
string empleado = "";
|
||||
Ruta = UsuarioActual.Empresa.Ruta;
|
||||
PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml";
|
||||
PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
Xmlname = $"{ObjNomina.SerieFolio}.xml";
|
||||
XmlnameF = $"{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
|
||||
if (!string.IsNullOrEmpty(PathXML) && System.IO.File.Exists(PathXML))
|
||||
if (ObjNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { Ruta = PathXML, NombreArchivo = Xmlname });
|
||||
string Ruta = "";
|
||||
string PathXML = "";
|
||||
string PathXMLF = "";
|
||||
string Xmlname = "";
|
||||
string XmlnameF = "";
|
||||
string empleado = "";
|
||||
Ruta = UsuarioActual.Empresa.Ruta;
|
||||
PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml";
|
||||
PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
Xmlname = $"{ObjNomina.SerieFolio}.xml";
|
||||
XmlnameF = $"{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = $"{ObjNomina.SerieFolio}.pdf" });
|
||||
|
||||
if (!string.IsNullOrEmpty(PathXML) && System.IO.File.Exists(PathXML))
|
||||
{
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { Ruta = PathXML, NombreArchivo = Xmlname });
|
||||
}
|
||||
if (!string.IsNullOrEmpty(PathXMLF) && System.IO.File.Exists(PathXMLF))
|
||||
{
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { Ruta = PathXMLF, NombreArchivo = XmlnameF });
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(PathXMLF) && System.IO.File.Exists(PathXMLF))
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Correo.Trim(), string.Format("Empleado {0} Nomina del {1:dd/MM/yyyy} al {2:dd/MM/yyyy}", NombreCompleto, FechaInicioPeriodo, FechaFinPeriodo), "", "", objarch);
|
||||
//Mail.SendMail(ClsPaginas.EmpresaNotificaciones, "caudillo.90d@gmail.com", string.Format("Empleado {0} Nomina del {1:dd/MM/yyyy} al {2:dd/MM/yyyy} ", NombreCompleto, FechaInicioPeriodo, FechaFinPeriodo), Correo.Trim(), "", objarch);
|
||||
using (ClsRH objrh = new ClsRH())
|
||||
{
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { Ruta = PathXMLF, NombreArchivo = XmlnameF });
|
||||
objrh.NomBitacoraCorreoAdd(CvePeriodoSeleccionado, CvePersonal, Correo.Trim(), UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario);
|
||||
}
|
||||
}
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Correo.Trim(), string.Format("Empleado {0} Nomina del {1:dd/MM/yyyy} al {2:dd/MM/yyyy}", NombreCompleto, FechaInicioPeriodo, FechaFinPeriodo), "", "", objarch);
|
||||
//Mail.SendMail(ClsPaginas.EmpresaNotificaciones, "caudillo.90d@gmail.com", string.Format("Empleado {0} Nomina del {1:dd/MM/yyyy} al {2:dd/MM/yyyy} ", NombreCompleto, FechaInicioPeriodo, FechaFinPeriodo), Correo.Trim(), "", objarch);
|
||||
using (ClsRH objrh = new ClsRH())
|
||||
{
|
||||
objrh.NomBitacoraCorreoAdd(CvePeriodoSeleccionado, CvePersonal, Correo.Trim(), UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (msggral.Length > 0)
|
||||
{
|
||||
|
||||
@@ -1492,16 +1504,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
if (Correo.Trim().Length > 0)
|
||||
{
|
||||
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
|
||||
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
|
||||
if (pdf != null)
|
||||
{
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = "Nomina.pdf" });
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
|
||||
using (ClsNominas ObjNomina = new ClsNominas())
|
||||
{
|
||||
|
||||
if (ObjNomina.GetNom_Nominas(-1, TxtCvePersonal.Text.ToEntero(), TxtCvePeriodo.Text.ToEntero(), -1, UsuarioActual.CveEmpresa))
|
||||
if (ObjNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
string Ruta = "";
|
||||
string PathXML = "";
|
||||
@@ -1514,6 +1525,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
Xmlname = $"{ObjNomina.SerieFolio}.xml";
|
||||
XmlnameF = $"{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = $"{ObjNomina.SerieFolio}.pdf" });
|
||||
|
||||
if (!string.IsNullOrEmpty(PathXML) && System.IO.File.Exists(PathXML))
|
||||
{
|
||||
@@ -1597,18 +1609,17 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
ClsNominas ObjPeriodo = new ClsNominas();
|
||||
ObjPeriodo.CambiaEstatusPeriodo(CvePeriodo, (int)enumNominasEstatus.Timbrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
ObjPeriodo.Dispose();
|
||||
if (Correo.Trim().Length > 0)
|
||||
if (enviarCorreoEnTimbrado && Correo.Trim().Length > 0)
|
||||
{
|
||||
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
|
||||
if (pdf != null)
|
||||
{
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = "Nomina.pdf" });
|
||||
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
|
||||
|
||||
using (ClsNominas ObjNomina = new ClsNominas())
|
||||
{
|
||||
|
||||
if (ObjNomina.GetNom_Nominas(-1, TxtCvePersonal.Text.ToEntero(), TxtCvePeriodo.Text.ToEntero(), -1, UsuarioActual.CveEmpresa))
|
||||
if (ObjNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
string Ruta = "";
|
||||
string PathXML = "";
|
||||
@@ -1621,6 +1632,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
Xmlname = $"{ObjNomina.SerieFolio}.xml";
|
||||
XmlnameF = $"{ObjNomina.Serie}F-{ObjNomina.Folio}.xml";
|
||||
objarch.Add(new ClsSisMail.ArchivoMail() { ArchivoBinario = pdf, NombreArchivo = $"{ObjNomina.SerieFolio}.pdf" });
|
||||
|
||||
if (!string.IsNullOrEmpty(PathXML) && System.IO.File.Exists(PathXML))
|
||||
{
|
||||
@@ -7057,7 +7069,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
while (Neto != NetoSimulado && continuarV)
|
||||
{
|
||||
|
||||
if (objnom.GetNominaEmpleado(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, CveEmpresa, Agrupador, -1, 1, Neto,ddlfiniquito.SelectedValue.ToEntero())
|
||||
if (objnom.GetNominaEmpleado(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, CveEmpresa, Agrupador, -1, 1, Neto, ddlfiniquito.SelectedValue.ToEntero())
|
||||
&& objnom.DTSetResultados.Tables.Count > 1)
|
||||
{
|
||||
dtempleadosSimula = objnom.DTSetResultados.Tables[3];
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<label class="col-md-1 truncate">Estatus:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlMotivoBaja" runat="server" Width="100%" CssClass="select2me" AppendDataBoundItems="true" DataTextField="MotivoBaja" DataValueField="CveMotivoBaja" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlEstatusFiniquito" runat="server" Width="100%" CssClass="select2me" AppendDataBoundItems="true" DataTextField="MotivoBaja" DataValueField="CveMotivoBaja" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Pendientes" Value="0" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Guardados" Value="1"></asp:ListItem>
|
||||
|
||||
@@ -29,10 +29,10 @@ public partial class Nomina_RepFiniquito : ClsPaginas
|
||||
int diafin = DateTime.DaysInMonth(dnow.Year, dnow.Month);
|
||||
TxtFechaInicio.Text = string.Format("01/{0:MM/yyyy}", dnow);
|
||||
TxtFechaFin.Text = string.Format("{1}/{0:MM/yyyy}", dnow,diafin);
|
||||
RcveEstatusFiniquito = Request["cveEstatusFiniquito"] == null ? 0 : Request["cveEstatusFiniquito"].ToString().ToEntero();
|
||||
RcveEstatusFiniquito = Request["cveEstatusFiniquito"] == null ? -1 : Request["cveEstatusFiniquito"].ToString().ToEntero();
|
||||
RcveSubProyecto = Request["cveSubProyecto"] == null ? 0 : Request["cveSubProyecto"].ToString().ToEntero();
|
||||
|
||||
|
||||
DdlEstatusFiniquito.SelectedValueExist(RcveEstatusFiniquito);
|
||||
RcveEstatusFiniquito = DdlEstatusFiniquito.SelectedValue.ToEntero();
|
||||
CargaRepFiniquitos();
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,7 @@ public partial class Nomina_RepFiniquito : ClsPaginas
|
||||
}
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
RcveEstatusFiniquito = DdlEstatusFiniquito.SelectedValue.ToEntero();
|
||||
CargaRepFiniquitos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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