|
|
|
|
@@ -36,11 +36,11 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
get { return ViewState["CvePersonalAltas"] != null ? ViewState["CvePersonalAltas"].ToString().ToEntero() : 0; }
|
|
|
|
|
set { ViewState["CvePersonalAltas"] = value; }
|
|
|
|
|
}
|
|
|
|
|
/*private int CvePeriodoIndemnizacion
|
|
|
|
|
private int CvePeriodoIndemnizacion
|
|
|
|
|
{
|
|
|
|
|
get { return ViewState["CvePeriodoIndemnizacion"] != null ? ViewState["CvePeriodoIndemnizacion"].ToString().ToEntero() : 0; }
|
|
|
|
|
set { ViewState["CvePeriodoIndemnizacion"] = value; }
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
private int CvePeriodoFiniquito
|
|
|
|
|
{
|
|
|
|
|
get { return ViewState["CvePeriodoFiniquito"] != null ? ViewState["CvePeriodoFiniquito"].ToString().ToEntero() : 0; }
|
|
|
|
|
@@ -88,6 +88,40 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
|
|
|
|
|
set { ViewState["dtempleados"] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DataTable dtConceptosIndemnizacion
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (ViewState["dtConceptosIndemnizacion"] == null) { return null; }
|
|
|
|
|
else { return (DataTable)ViewState["dtConceptosIndemnizacion"]; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set { ViewState["dtConceptosIndemnizacion"] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private DataTable dtempleadosConceptosIndemnizacion
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (ViewState["dtempleadosConceptosIndemnizacion"] == null) { return null; }
|
|
|
|
|
else { return (DataTable)ViewState["dtempleadosConceptosIndemnizacion"]; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set { ViewState["dtempleadosConceptosIndemnizacion"] = value; }
|
|
|
|
|
}
|
|
|
|
|
private DataTable dtempleadosIndemnizacion
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (ViewState["dtempleadosIndemnizacion"] == null) { return null; }
|
|
|
|
|
else { return (DataTable)ViewState["dtempleadosIndemnizacion"]; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set { ViewState["dtempleadosIndemnizacion"] = value; }
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
@@ -183,7 +217,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
DdlMotivoBaja.SelectedValueExist(da["CveMotivoBaja"]);
|
|
|
|
|
TxtSalarioMinimo.Text = $"{da["SalarioMinimo"]:N2}";
|
|
|
|
|
ChkesLiquidacion.Checked = (da["esLiquidacion"].ToString() == "1" || da["esLiquidacion"].ToString().ToUpper() == "TRUE");
|
|
|
|
|
//CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
|
|
|
|
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
|
|
|
|
CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero();
|
|
|
|
|
if (CvePeriodoFiniquito > 0)
|
|
|
|
|
{
|
|
|
|
|
@@ -720,7 +754,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
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();
|
|
|
|
|
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
|
|
|
|
CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero();
|
|
|
|
|
// Alert(string.Format("{0}: {1}", CvePeriodoIndemnizacion, CvePeriodoFiniquito));
|
|
|
|
|
}
|
|
|
|
|
@@ -763,7 +797,7 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
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) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
DataRow da = ObjPersonal.DtResultados.Rows[0];
|
|
|
|
|
//CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
|
|
|
|
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
|
|
|
|
|
CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero();
|
|
|
|
|
// Alert(string.Format("{0}: {1}", CvePeriodoIndemnizacion, CvePeriodoFiniquito));
|
|
|
|
|
}
|
|
|
|
|
@@ -822,6 +856,8 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
List<NConcepto> finindem = null;
|
|
|
|
|
dtempleadosConceptos = null;
|
|
|
|
|
dtempleados = null;
|
|
|
|
|
dtempleadosConceptos = null;
|
|
|
|
|
dtempleados = null;
|
|
|
|
|
LnkAutorizar.Visible = true;
|
|
|
|
|
if (objnom.GetNominaEmpleado(-1, -1, -1, CvePeriodoFiniquito, UsuarioActual.CveEmpresa, 1, 3, CvePersonal, Neto: 1) && objnom.DTSetResultados.Tables.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
@@ -835,13 +871,37 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
UpAcciones.Update();
|
|
|
|
|
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
|
|
|
|
|
dtConceptos = objnom.DTSetResultados.Tables[0];
|
|
|
|
|
LnkCancelar.Visible = !LnkAutorizar.Visible? false: LnkCancelar.Visible;
|
|
|
|
|
LnkGuardarDatos.Visible = !LnkAutorizar.Visible?false: LnkGuardarDatos.Visible;
|
|
|
|
|
LnkCancelar.Visible = !LnkAutorizar.Visible ? false : LnkCancelar.Visible;
|
|
|
|
|
LnkGuardarDatos.Visible = !LnkAutorizar.Visible ? false : LnkGuardarDatos.Visible;
|
|
|
|
|
LtlFiniquitoOrdinario.Text = $"";
|
|
|
|
|
DataRow dre = dtempleados.FiltroPrimero(string.Format(" CvePersonal ={0}", CvePersonal));
|
|
|
|
|
if (dre != null)
|
|
|
|
|
{
|
|
|
|
|
LtlFiniquitoOrdinario.Text = string.Format(" del {1:dd/MM/yyyy} al {2:dd/MM/yyyy} {0}", (dre["CveTipoPeriodo"].ToString()=="6"? "Extraordinario" : "Ordinario"), dre["FechaInicio"], dre["FechaFin"]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (objnom.GetNominaEmpleado(-1, -1, -1, CvePeriodoIndemnizacion, UsuarioActual.CveEmpresa, 1, 3, CvePersonal, Neto: 1) && objnom.DTSetResultados.Tables.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
dtempleadosIndemnizacion = objnom.DTSetResultados.Tables[3];
|
|
|
|
|
dtempleadosConceptosIndemnizacion = objnom.DTSetResultados.Tables[4];
|
|
|
|
|
dtConceptosIndemnizacion = objnom.DTSetResultados.Tables[0];
|
|
|
|
|
LnkAutorizar.Visible = (dtempleados.COUNT("CvePersonal", string.Format("NomAutorizado =0 AND CvePersonal ={0}", CvePersonal)) > 0);
|
|
|
|
|
NominaAutorizada = !LnkAutorizar.Visible;
|
|
|
|
|
LnkFormatoRenuncia.Visible = true;
|
|
|
|
|
LnkGuardarDatos.Enabled = LnkAutorizar.Visible;
|
|
|
|
|
LnkTimbrar.Visible = !(LnkAutorizar.Visible) && (dtempleados.COUNT("CvePersonal", string.Format("SeTimbro=0 AND CvePersonal ={0}", CvePersonal)) > 0);
|
|
|
|
|
LnkCancelarNomina.Visible = !LnkAutorizar.Visible && LnkTimbrar.Visible;
|
|
|
|
|
UpAcciones.Update();
|
|
|
|
|
LnkCancelar.Visible = !LnkAutorizar.Visible ? false : LnkCancelar.Visible;
|
|
|
|
|
LnkGuardarDatos.Visible = !LnkAutorizar.Visible ? false : LnkGuardarDatos.Visible;
|
|
|
|
|
}
|
|
|
|
|
if (dtConceptos != null && dtempleadosConceptos != null && dtempleados != null)
|
|
|
|
|
{
|
|
|
|
|
finordin = cargasobrericiboconceptos(dtConceptos, dtempleadosConceptos, dtempleados);
|
|
|
|
|
finindem = cargasobrericiboconceptosIndemnizacion(dtConceptos, dtempleadosConceptos, dtempleados);
|
|
|
|
|
finordin = cargasobrericiboconceptos(dtConceptos, dtempleadosConceptos, dtempleados);
|
|
|
|
|
}
|
|
|
|
|
if (dtConceptosIndemnizacion != null && dtempleadosConceptosIndemnizacion != null && dtempleadosIndemnizacion != null)
|
|
|
|
|
{
|
|
|
|
|
finindem = cargasobrericiboconceptosIndemnizacion(dtConceptosIndemnizacion, dtempleadosConceptosIndemnizacion, dtempleadosIndemnizacion);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GvFinOrdinario.DataSource = finordin;
|
|
|
|
|
@@ -860,30 +920,9 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
private List<NConcepto> cargasobrericiboconceptos(DataTable dtConceptos, DataTable dtempleadosConceptos, DataTable dtempleados)
|
|
|
|
|
{
|
|
|
|
|
int SRCvePersonal = this.CvePersonal;
|
|
|
|
|
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 And CveSistema NOT IN(10,11,32) ");
|
|
|
|
|
DataTable dtded = dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 AND CveSistema NOT IN( 47,101)");
|
|
|
|
|
double percepcionesindem = 0;
|
|
|
|
|
double deduccionesindem = 0;
|
|
|
|
|
foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 And CveSistema IN(10,11,32) ").Rows)
|
|
|
|
|
{
|
|
|
|
|
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
|
|
|
|
|
string Concepto = row["Concepto"].ToString();
|
|
|
|
|
string Codigo = row["Codigo"].ToString();
|
|
|
|
|
//bool visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0);
|
|
|
|
|
double Importe = dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
|
|
|
|
percepcionesindem += Importe;
|
|
|
|
|
}
|
|
|
|
|
foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 AND CveSistema =47").Rows)
|
|
|
|
|
{
|
|
|
|
|
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
|
|
|
|
|
string Concepto = row["Concepto"].ToString();
|
|
|
|
|
string Codigo = row["Codigo"].ToString();
|
|
|
|
|
//bool visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0);
|
|
|
|
|
double Importe = dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
|
|
|
|
deduccionesindem += Importe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 ");
|
|
|
|
|
DataTable dtded = dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 ");
|
|
|
|
|
|
|
|
|
|
dtper.Columns.Add("BorradoLogico", typeof(int));
|
|
|
|
|
dtded.Columns.Add("BorradoLogico", typeof(int));
|
|
|
|
|
|
|
|
|
|
@@ -967,14 +1006,14 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
SubTotales.CveConceptoP = 0;
|
|
|
|
|
SubTotales.ConceptoP = "Total Percepciones";
|
|
|
|
|
SubTotales.EstatusP = -2;
|
|
|
|
|
SubTotales.ImporteP = dtempleados.SUM("SumaPercepciones", string.Format("CvePersonal = {0}", SRCvePersonal)) - percepcionesindem;
|
|
|
|
|
SubTotales.ImporteP = dtempleados.SUM("SumaPercepciones", string.Format("CvePersonal = {0}", SRCvePersonal)) ;
|
|
|
|
|
///Alert(SubTotales.ImporteP.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SubTotales.CveConceptoD = 0;
|
|
|
|
|
SubTotales.ConceptoD = "Total Deducciones";
|
|
|
|
|
SubTotales.EstatusD = -2;
|
|
|
|
|
SubTotales.ImporteD = dtempleados.SUM("SumaDeducciones", string.Format("CvePersonal = {0}", SRCvePersonal)) - deduccionesindem;
|
|
|
|
|
SubTotales.ImporteD = dtempleados.SUM("SumaDeducciones", string.Format("CvePersonal = {0}", SRCvePersonal)) ;
|
|
|
|
|
|
|
|
|
|
double neto = SubTotales.ImporteP - SubTotales.ImporteD;
|
|
|
|
|
NConcepto Totales = new NConcepto();
|
|
|
|
|
@@ -992,28 +1031,9 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
private List<NConcepto> cargasobrericiboconceptosIndemnizacion(DataTable dtConceptos, DataTable dtempleadosConceptos, DataTable dtempleados)
|
|
|
|
|
{
|
|
|
|
|
int SRCvePersonal = this.CvePersonal;
|
|
|
|
|
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 AND CveSistema IN(10,11,32) ");
|
|
|
|
|
DataTable dtded = dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 AND CveSistema = 47");
|
|
|
|
|
double percepcionesindem = 0;
|
|
|
|
|
double deduccionesindem = 0;
|
|
|
|
|
foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 And CveSistema IN(10,11,32) ").Rows)
|
|
|
|
|
{
|
|
|
|
|
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
|
|
|
|
|
string Concepto = row["Concepto"].ToString();
|
|
|
|
|
string Codigo = row["Codigo"].ToString();
|
|
|
|
|
//bool visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0);
|
|
|
|
|
double Importe = dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
|
|
|
|
percepcionesindem += Importe;
|
|
|
|
|
}
|
|
|
|
|
foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 AND CveSistema =47").Rows)
|
|
|
|
|
{
|
|
|
|
|
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
|
|
|
|
|
string Concepto = row["Concepto"].ToString();
|
|
|
|
|
string Codigo = row["Codigo"].ToString();
|
|
|
|
|
//bool visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0);
|
|
|
|
|
double Importe = dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
|
|
|
|
deduccionesindem += Importe;
|
|
|
|
|
}
|
|
|
|
|
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1");
|
|
|
|
|
DataTable dtded = dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1");
|
|
|
|
|
|
|
|
|
|
dtper.Columns.Add("BorradoLogico", typeof(int));
|
|
|
|
|
dtded.Columns.Add("BorradoLogico", typeof(int));
|
|
|
|
|
|
|
|
|
|
@@ -1096,14 +1116,15 @@ public partial class Nomina_Finiquito : ClsPaginas
|
|
|
|
|
SubTotales.CveConceptoP = 0;
|
|
|
|
|
SubTotales.ConceptoP = "Total Percepciones";
|
|
|
|
|
SubTotales.EstatusP = -2;
|
|
|
|
|
SubTotales.ImporteP = percepcionesindem;
|
|
|
|
|
SubTotales.ImporteP = dtempleados.SUM("SumaPercepciones", string.Format("CvePersonal = {0}", SRCvePersonal));
|
|
|
|
|
///Alert(SubTotales.ImporteP.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SubTotales.CveConceptoD = 0;
|
|
|
|
|
SubTotales.ConceptoD = "Total Deducciones";
|
|
|
|
|
SubTotales.EstatusD = -2;
|
|
|
|
|
SubTotales.ImporteD = deduccionesindem;
|
|
|
|
|
SubTotales.ImporteD = dtempleados.SUM("SumaDeducciones", string.Format("CvePersonal = {0}", SRCvePersonal));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double neto = SubTotales.ImporteP - SubTotales.ImporteD;
|
|
|
|
|
NConcepto Totales = new NConcepto();
|
|
|
|
|
|