This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-12-11 06:32:06 -07:00
parent a6dbf9aed8
commit d5b50b5f78
8 changed files with 592 additions and 54 deletions

View File

@@ -93,6 +93,17 @@ public partial class Nomina_Nomina2 : ClsPaginas
set { ViewState["CvePeriodoSeleccionado"] = value; }
}
protected int CcveMovtoPermanente
{
get
{
if (ViewState["CcveMovtoPermanente"] == null) { return 0; }
else { return ViewState["CcveMovtoPermanente"].ToString().ToEntero(); }
}
set { ViewState["CcveMovtoPermanente"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
@@ -912,6 +923,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
LblEmpleado.Text = Nombre;
TabPersonal.ActiveTabIndex = 0;
mostrarConceptos();
pnlAddupMovto.Visible = false;
CargaMovtoPermanente();
RegistraScript("$('#ModalConceptos').modal();");
}
private void mostrarConceptos()
@@ -1461,7 +1474,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
string strFechaFin = "";
string strTipo = "";
string strPeriodoNum = "";
string strUbicacion = string.Format ("{0}, {1}, {2}, {3}",UsuarioActual.Empresa.Direccion, UsuarioActual.Empresa.Colonia, UsuarioActual.Empresa.Ciudad, UsuarioActual.Empresa.Estado );
string strUbicacion = string.Format("{0}, {1}, {2}, {3}", UsuarioActual.Empresa.Direccion, UsuarioActual.Empresa.Colonia, UsuarioActual.Empresa.Ciudad, UsuarioActual.Empresa.Estado);
string strRegPatImss = "";
string strRFC = UsuarioActual.Empresa.RFC;
string strfecha = DateTime.Now.ToString("dd/MMM/yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX"));
@@ -1472,11 +1485,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataRow rperiodo = dtPeriodos.FiltroPrimero(string.Format("CvePeriodo = {0}", CvePeriodo));
if (rperiodo != null)
{
strFechaInicio =string.Format("{0:dd/MM/yyyy}", rperiodo["FechaInicio"]);
strFechaInicio = string.Format("{0:dd/MM/yyyy}", rperiodo["FechaInicio"]);
strFechaFin = string.Format("{0:dd/MM/yyyy}", rperiodo["FechaFin"]);
strPeriodoNum = rperiodo["Numero"].ToString();
strTipo = DdlTipoPeriodo.SelectedItem.Text ;
strTipo = DdlTipoPeriodo.SelectedItem.Text;
}
listaTags.Add(new TagsDocumentos("[Empresa]", strEmpresa));
listaTags.Add(new TagsDocumentos("[FechaInicio]", strFechaInicio));
@@ -1526,7 +1539,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
string SalarioDiariop = "";
string FechaIngreso = "", Nombre = "", DiasLaborados = "";*/
paragraphh = new GemBox.Document.Paragraph(document,string.Format("{1} : {0}", drow2["Nombre"].ToString(), drow2["Codigo"].ToString())); cell.Blocks.Add(paragraphh);
paragraphh = new GemBox.Document.Paragraph(document, string.Format("{1} : {0}", drow2["Nombre"].ToString(), drow2["Codigo"].ToString())); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilostrong;
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Fecha Ingr:{0:dd/MM/yyyy}, S.D.:{1:N2} ", drow2["FechaIngreso"], drow2["SalarioDiario"])); cell.Blocks.Add(paragraphh);
@@ -1625,7 +1638,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero();
importe = string.Format("${0:N2}", rowconcept["Importe"]);
valor = string.Format("{0:#,###.##}", rowconcept["Valor"]);
Concepto = "";
rowconcept = dtConceptos.FiltroPrimero(string.Format("CveConcepto={0}", CveConcepto));
@@ -1668,7 +1681,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
CveConcepto = 0; Concepto = ""; importe = ""; Codigo = "";valor = "";
CveConcepto = 0; Concepto = ""; importe = ""; Codigo = ""; valor = "";
rowconcept = dtempleadosConceptos.FiltroPrimero(string.Format("CvePersonal={0} AND Tipo =2 AND Fila ={1}", CvePersonal, cindex));
@@ -2122,7 +2135,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
paragraphh = new GemBox.Document.Paragraph(document, string.Format("{0:N0}", dtempleados.COUNT("CvePersonal", string.Format("CveDepartamento={0}", CveDepartamento)))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right;
paragraphh.ParagraphFormat.Style = styilo;
}
{
cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx);
cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage);
@@ -2556,7 +2569,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
//basura para espacio
{
rowx = new GemBox.Document.Tables.TableRow(document);
tconeptos.Rows.Add(rowx);
tconeptos.Rows.Add(rowx);
{
cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx);
cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage);
@@ -2852,4 +2865,164 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
ImprimirReporte();
}
#region Movtos Permanentes
protected void CargaTipoConcepto()
{
//DdlTipo.Items.Insert(0, new ListItem("Percepciones", "P"));
//DdlTipo.Items.Insert(1, new ListItem("Deducciones", "D"));
//DdlTipo.Items.Insert(2, new ListItem("Obligaciones", "O"));
//DdlTipo.SelectedValueExist("-1");
CargaConcepto();
}
protected void CargaConcepto()
{
DdlConcepto.Items.Clear();
if (DdlTipo.SelectedValue == "-1")
{
DdlConcepto.DataSource = get_GlobalDTNomConceptos(UsuarioActual.CveEmpresa);
}
else
{
DdlConcepto.DataSource = get_GlobalDTNomConceptos(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("Tipo ='{0}'", DdlTipo.SelectedValue));
}
DdlConcepto.DataBind();
DdlConcepto.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlConcepto.SelectedValueExist("-1");
}
private void CargaMovtoPermanente()
{
using (ClsNominas ObjMovt = new ClsNominas())
{
ObjMovt.GetMovtoPermanente(UsuarioActual.CveEmpresa, SRCvePersonal);
GVMovtoPermanente.DataSource = ObjMovt.DtResultados;
}
GVMovtoPermanente.DataBind();
UpMovtosPermanentes.Update();
}
protected void DdlTipo_SelectedIndexChanged(object sender, EventArgs e)
{
CargaConcepto();
}
protected void LnkAddMovtoPermanente_Click(object sender, EventArgs e)
{
CargaConcepto();
DdlTipoDescto_SelectedIndexChanged(null, null);
pnlAddupMovto.Visible = true;
LnkAddMovto.Visible = true;
LnkUpMovto.Visible = false;
LtlMovtoPermanenteaddup.Text = "Agregar Movimiento";
TxtDescripcion.Text = "";
TxtValor.Text = "";
TxtVecesAplicar.Text = "";
TxtMontoLimite.Text = "";
TxtFechaAplicacion.Text = "";
ChkEstatus.Visible = true;
}
protected void LnkAddMovto_Click(object sender, EventArgs e)
{
int cveConcepto = DdlConcepto.SelectedValue.ToEntero();
string descripcion = TxtDescripcion.Text;
int tipoDescuento = DdlTipoDescto.SelectedValue.ToEntero();
double valor = TxtValor.Text.ToDouble();
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
bool estatus = ChkEstatus.Checked;
bool Continuar;
using (ClsNominas ObjMovt = new ClsNominas())
{
Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus);
}
if (Continuar)
{
this.RegistraScript("$('#DModalMovtoPermanente').modal('hide');");
CargaMovtoPermanente();
UpMovtosPermanentes.Update();
this.Alert("El Movto_Permanente Se ha agregado");
}
}
protected void LnkUpMovto_Click(object sender, EventArgs e)
{
int cveConcepto = DdlConcepto.SelectedValue.ToEntero();
string descripcion = TxtDescripcion.Text;
int tipoDescuento = DdlTipoDescto.SelectedValue.ToEntero();
double valor = TxtValor.Text.ToDouble();
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
bool estatus = ChkEstatus.Checked;
bool Continuar;
using (ClsNominas ObjMovt = new ClsNominas())
{
Continuar = ObjMovt.UpMovtoPermanente(CcveMovtoPermanente, cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus);
}
if (Continuar)
{
this.RegistraScript("$('#DModalMovtoPermanente').modal('hide');");
CargaMovtoPermanente();
UpMovtosPermanentes.Update();
this.Alert("El Movto_Permanente Se ha agregado");
}
}
protected void DdlTipoDescto_SelectedIndexChanged(object sender, EventArgs e)
{
pnlMonto.Visible = DdlTipoDescto.SelectedValue.ToEntero() > 2;
pnlVecesAplicar.Visible = DdlTipoDescto.SelectedValue.ToEntero() < 3;
}
protected void LnkEditarMovtoPermanente_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CcveMovtoPermanente = gvRow.DataKey("CveMovtoPermanente").ToEntero();
int cveConcepto = gvRow.DataKey("CveConcepto").ToEntero();
int cvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
string descripcion = gvRow.DataKey("Descripcion");
int tipoDescuento = gvRow.DataKey("TipoDescuento").ToEntero();
double valor = gvRow.DataKey("Valor").ToDouble();
int vecesAplicar = gvRow.DataKey("VecesAplicar").ToEntero();
decimal montoLimite = gvRow.DataKey("MontoLimite").ToDecimal();
DateTime fechaInicioAplicacion = gvRow.DataKey("FechaInicioAplicacion").ToDate();
bool estatus = gvRow.DataKey("Estatus") == "1" || gvRow.DataKey("Estatus").ToUpper() == "TRUE";
DateTime fechaRegistro = gvRow.DataKey("FechaRegistro").ToDateTime();
string tipo = "P";
DataRow drow = get_GlobalDTNomConceptos(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("Tipo ='{0}'", cveConcepto));
if (drow != null)
{
tipo = drow["Tipo"].ToString();
DdlTipo.SelectedValueExist(tipo);
DdlTipo_SelectedIndexChanged(null, null);
}
DdlConcepto.SelectedValueExist(cveConcepto);
TxtDescripcion.Text = descripcion.ToString();
DdlTipoDescto.SelectedValueExist(tipoDescuento.ToString());
DdlTipoDescto_SelectedIndexChanged(null, null);
TxtValor.Text = valor.ToString();
TxtVecesAplicar.Text = vecesAplicar.ToString();
TxtMontoLimite.Text = montoLimite.ToString();
TxtFechaAplicacion.Text = $"{fechaInicioAplicacion:dd/MM/yyyy}";
ChkEstatus.Checked = estatus;
this.RegistraScript("$('#DModalMovtoPermanente').modal();");
pnlAddupMovto.Visible = true;
LnkAddMovto.Visible = false;
LnkUpMovto.Visible = true;
UpMovtosPermanentes.Update();
}
#endregion
}