From e0db97e3c7b7d1af0c48eb779018ab8b5cacf5da Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 13 Dec 2021 05:33:04 -0700 Subject: [PATCH 1/2] --- App_Code/ClsEdocumentacion.vb | 93 ++++ App_Code/ClsNominas.vb | 39 +- App_Code/ClsPaginas.vb | 3 + App_Code/ClsRH.vb | 7 +- Ashx/SIGWeb.ashx | 27 +- Documentacion/TableroMaterialidad.aspx | 266 ++++++++++ Documentacion/TableroMaterialidad.aspx.cs | 97 ++++ Documentacion/TableroMaterialidadDetalle.aspx | 114 ++++ .../TableroMaterialidadDetalle.aspx.cs | 70 +++ Nomina/Aguinaldo.aspx | 4 +- Nomina/Aguinaldo.aspx.cs | 136 +++-- Nomina/ChecadorAsistencia.aspx | 22 +- Nomina/ChecadorAsistencia.aspx.cs | 6 +- Nomina/Nomina.aspx | 54 +- Nomina/Nomina.aspx.cs | 14 +- RH/CatPersonal.aspx.vb | 2 +- Ventas/Clientes.aspx | 489 ++++++++++-------- Ventas/Clientes.aspx.vb | 36 +- vwd.webinfo | 2 + 19 files changed, 1189 insertions(+), 292 deletions(-) create mode 100644 Documentacion/TableroMaterialidad.aspx create mode 100644 Documentacion/TableroMaterialidad.aspx.cs create mode 100644 Documentacion/TableroMaterialidadDetalle.aspx create mode 100644 Documentacion/TableroMaterialidadDetalle.aspx.cs diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index dd22807c3..08b2a0361 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -71,6 +71,7 @@ Public Class ClsEdocumentacion End With If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc Data = New DataTable + DSet = New DataSet() End Sub #Region "Conexiones" @@ -515,6 +516,98 @@ Public Class ClsEdocumentacion #End Region + Public Sub addParameters(varsql As String, sqltipe As SqlDbType, valor As Object) + SqlAdapter.SelectCommand.Parameters.Add(varsql, sqltipe).Value = valor + End Sub + Public Function RunQuery(errormsg As String) As Boolean + Dim retorno As Boolean = False + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + retorno = False + OnError(errormsg, ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function RunQueryds(errormsg As String) As Boolean + Dim retorno As Boolean = False + Try + SqlAdapter.Fill(DSet) + retorno = True + Catch ex As Exception + retorno = False + OnError(errormsg, ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + + +#Region "CRUD_Edoc_Materialidad" + + Public Function TableroMaterialidadGET(cveEmpresa As Integer, anio As Integer, mes As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_TableroMaterialidad", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + retorno = RunQueryds("Ocurrió un error al obtener el PA_Edoc_TableroMaterialidad.") + Return retorno + End Function + Public Function TableroMaterialidadDetalleGET(cveEmpresa As Integer, anio As Integer, mes As Integer, cveCliente As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_TableroMaterialidadDetalle", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + retorno = RunQueryds("Ocurrió un error al obtener el PA_Edoc_TableroMaterialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadGet(cveDocMaterialidad As Int32, cveDocumentacion As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadGet", CommandType.StoredProcedure) + addParameters("@CveDocMaterialidad", SqlDbType.Int, cveDocMaterialidad) + addParameters("@CveDocumentacion", SqlDbType.Int, cveDocumentacion) + retorno = RunQuery("Ocurrió un error al obtener el Edoc_Materialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadAdd(cveDocumentacion As Int32, adjunto As String, cveCliente As Integer, anio As Int32, mes As Int32, cveUsuario As Int32, fechaingreso As DateTime) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadAdd", CommandType.StoredProcedure) + addParameters("@CveDocumentacion", SqlDbType.Int, cveDocumentacion) + addParameters("@Adjunto", SqlDbType.VarChar, adjunto) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + retorno = RunQuery("Ocurrió un error al agregar el Edoc_Materialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadUp(cveDocMaterialidad As Int32, cveDocumentacion As Int32, adjunto As String, cveCliente As Integer, anio As Int32, mes As Int32, cveUsuario As Int32, fechaingreso As DateTime) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadUp", CommandType.StoredProcedure) + addParameters("@CveDocMaterialidad", SqlDbType.Int, cveDocMaterialidad) + addParameters("@Adjunto", SqlDbType.VarChar, adjunto) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + retorno = RunQuery("Ocurrió un error al actualizar el Edoc_Materialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadRemove(cveDocMaterialidad As Int32, CveEmpresa As Integer) As Boolean + + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadRemove", CommandType.StoredProcedure) + addParameters("@CveDocMaterialidad", SqlDbType.Int, cveDocMaterialidad) + addParameters("@CveEmpresa", SqlDbType.Int, CveEmpresa) + retorno = RunQuery("Ocurrió un error al eliminar el Edoc_Materialidad.") + Return retorno + End Function +#End Region + + #Region " P A R A M E T R O S " Public Function AddDocumentacionParametros(CveDocumentacion As Integer, Parametro As String, Descripcion As String, CveEmpresa As Integer, CveUsaurio As Integer) As Boolean diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 54d9be053..c77386aac 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -8,9 +8,9 @@ Public Class ClsNominas #Region "Campos" 'SQL ClsNominas_Nominas Private SqlConexion As SqlConnection - Private SqlAdapter As SqlDataAdapter + Public SqlAdapter As SqlDataAdapter Private SqlCommand As SqlCommand - Private SqlTransacc As SqlTransaction + Public SqlTransacc As SqlTransaction Private Data As DataTable Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Protected DTSet As DataSet @@ -86,9 +86,12 @@ Public Class ClsNominas Public Property FechaPago As Date #End Region - Public Sub IniciaTransacSQL() - SqlTransacc = SqlConexion.BeginTransaction() - End Sub + + + Public Function IniciaTransacSQL() As SqlTransaction + If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() + Return SqlTransacc + End Function Public Sub Commit() SqlTransacc.Commit() End Sub @@ -2258,10 +2261,32 @@ Public Class ClsNominas retorno = True Catch sqEx As SqlException retorno = False - OnError("Ocurrió un error al Realizar el calculo de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al realizar el calculo de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception retorno = False - OnError("Ocurrió un error al Realizar el calculo de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al realizar el calculo de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetNominasSinTimbrar(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + Try + DTSet = New DataSet() + DataAdapter("PA_Nom_NominaSinTimbrar", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + + SqlAdapter.Fill(DTSet) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener la nomina sin timbrar.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener la nomina sin timbrar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7ff070146..0c17c3763 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5148,6 +5148,9 @@ Public Class ClsPaginas PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422) PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427) PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428) + PaginaDict.Add("/Documentacion/TableroMaterialidad.aspx".ToUpper(), -1) + PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628) PaginaDict.Add("/RH/CatCaptaciones.aspx".ToUpper(), 629) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index cce1984f6..bf54663e5 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1966,10 +1966,13 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo _CvePersonal = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero Retorno = True Catch Ex1 As SqlException + 'dbo.Vw_Val_Nom_Curps If Ex1.Message.Contains("Número: 2627;") Then - Alert("El Nuevo Personal no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) + Alert("El nuevo personal no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) ElseIf Ex1.Message.Contains("Chk_RH_PersonalSalarioIMSS") Then - Alert("El Nuevo Personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) + Alert("El nuevo personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("dbo.Vw_Val_Nom_Curps") Then + Alert(String.Format("El nuevo personal no se guardo, ya existe un personal con esta curp '{0}'", CURP), TipoMensaje.MsgAdvertencia) Else Me.OnError("Ocurrió un error al guardar el nuevo Personal.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 4c8ad31ac..38951930a 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -116,7 +116,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Case "sendMailLPM" context.Response.Write(sendMailLPM(context)) Case "getSATColomias" - getSatColonias(context) + getSATColonias(context) + Case "GetFilesDirectory" + GetFilesDirectory(context) End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -1358,7 +1360,30 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End Function #End Region + Private Function GetFilesDirectory(ByVal context As HttpContext) As String + Dim retorno As String = "" + Dim urlhost As String = context.Request.Url.Host.ToUpper() + If (urlhost = "LOCALHOST") Then + Dim directorio As String = IfNull(context.Request("directorio"), "").ToString() + Dim xmlarchivos As System.Xml.Linq.XDocument = New System.Xml.Linq.XDocument() + Dim xfolder As XElement = New XElement("folder") + For Each urfile In System.IO.Directory.GetFiles(directorio) + Dim xfile As New XElement("archivo", urfile) + xfile.SetAttributeValue("EXT", Path.GetExtension(urfile)) + xfolder.Add(xfile) + + Next + xmlarchivos.Add(xfolder) + retorno = xmlarchivos.ToString() + context.Response.ContentType = "text/xml" + context.Response.Write(retorno) + context.Response.StatusCode = 200 + Else + context.Response.StatusCode = 500 + End If + Return retorno + End Function #Region "Get SAT Colonmias" Private Function getSATColonias(ByVal context As HttpContext) As String diff --git a/Documentacion/TableroMaterialidad.aspx b/Documentacion/TableroMaterialidad.aspx new file mode 100644 index 000000000..967e0483e --- /dev/null +++ b/Documentacion/TableroMaterialidad.aspx @@ -0,0 +1,266 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TableroMaterialidad.aspx.cs" Inherits="Documentacion_TableroMaterialidad" %> + + + + + + + + Materialidad + + + + + + +
  • + Cargar Doctos + <%--Cargar Doctos--%> +
  • +
  • + Cargar XML PDF + <%--Cargar XML PDF--%> +
  • +
    +
    +
    + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    Año:
    +
    + +
    + +
    Mes:
    +
    + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +
    +
    + +
    + + + + + + + + + + + + + <%-- + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Cliente<%# DataBinder.Eval(Container.DataItem, "Documentacion") %>
    <%# String.Format("{0:dd/MM/yyyy} - {1:dd/MM/yyyy}", DataBinder.Eval(Container.DataItem, "InicioPeriodo"), DataBinder.Eval(Container.DataItem, "FinPeriodo")) %> <%# DataBinder.Eval(Container.DataItem, "Antiguedad") %> <%# DataBinder.Eval(Container.DataItem, "DiasVacaciones") %> <%# DataBinder.Eval(Container.DataItem, "Dias") %> <%# DataBinder.Eval(Container.DataItem, "DiasDisfrutados") %> <%# DataBinder.Eval(Container.DataItem, "DiasPrima") %>
    XML TimbradosPDF Timbrados
    <%# DataBinder.Eval(Container.DataItem, "NombreComercial") %><%# + DataBinder.Eval( ((RepeaterItem)Container.Parent.Parent).DataItem ,string.Format("V_{0}",DataBinder.Eval(Container.DataItem, "CveDocumentacion"))).ToString() =="-1" ? "N/A": + string.Format("{0}", + (DataBinder.Eval( ((RepeaterItem)Container.Parent.Parent).DataItem ,string.Format("V_{0}",DataBinder.Eval(Container.DataItem, "CveDocumentacion"))).ToString() =="0"? + + + "No": + + + "Si") + + ,DataBinder.Eval(Container.DataItem, "CveDocumentacion"),DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "CveCliente") + ,DataBinder.Eval(Container.DataItem, "Documentacion"),DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "NombreComercial") + ) + + + %> + <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalXML"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> + + <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> + + <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> +
    + + + + + + +
    +
    +
    + + + + diff --git a/Documentacion/TableroMaterialidad.aspx.cs b/Documentacion/TableroMaterialidad.aspx.cs new file mode 100644 index 000000000..85549a974 --- /dev/null +++ b/Documentacion/TableroMaterialidad.aspx.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Documentacion_TableroMaterialidad :ClsPaginas +{ + #region "Propiedades" + + public int anio + { + get { return ViewState["anio"] != null ? ViewState["anio"].ToString().ToEntero() : 0; } + set { ViewState["anio"] = value; } + } + public int mes + { + get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; } + set { ViewState["mes"] = value; } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + cargadatos(); + } + } + DataTable dt; + public void cargadatos() + { + using (ClsEdocumentacion edoc = new ClsEdocumentacion()) + { + if(edoc.TableroMaterialidadGET(UsuarioActual.CveEmpresa,(anio= Txtanio.Text.ToEntero()), (mes= ddlMes.SelectedValue.ToEntero())) && edoc.DSResultados.Tables.Count >1) + { + RptDatos.DataSource = edoc.DSResultados.Tables[0]; + dt = edoc.DSResultados.Tables[1]; + RPTTableroHeader.DataSource = edoc.DSResultados.Tables[1]; + RPTTableroHeader.DataBind(); + RptDatos.DataBind(); + DdlDocumentacion.DataSource = dt; + DdlDocumentacion.DataBind(); + + } + + } + } + + protected void RptDatos_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + DataRowView item = (DataRowView)(e.Item.DataItem); + Repeater rpt =((Repeater)e.Item.FindControl("rptdocumentacion")); + rpt.DataSource = dt; + rpt.DataBind(); + } + + + + protected void BtnAddClienteDocumento_Click(object sender, EventArgs e) + { + + } + + protected void BtnEnviarDoctos_Click(object sender, EventArgs e) + { + Alert("El correo se ha enviado."); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + cargadatos(); + } + + protected void BtnAddClienteDocumentoxmlpd_Click(object sender, EventArgs e) + { + + } + + protected void LckOpModalDoctos_Click(object sender, EventArgs e) + { + DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime(); + LtlPeriodo.Text = fecha.ToString("MMMM yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX"));//string.Format(""); + UpModalDoctos.Update(); + RegistraScript("$('#ModalDoctos').modal();"); + } + + protected void LckOpModalDoctosPDFXML_Click(object sender, EventArgs e) + { + DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime(); + LtlPeriodoXMLPDF.Text = fecha.ToString("MMMM yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX")); + RegistraScript("$('#ModalDoctos').modal();"); + Upxmlpdf.Update(); + } +} \ No newline at end of file diff --git a/Documentacion/TableroMaterialidadDetalle.aspx b/Documentacion/TableroMaterialidadDetalle.aspx new file mode 100644 index 000000000..1f5d39474 --- /dev/null +++ b/Documentacion/TableroMaterialidadDetalle.aspx @@ -0,0 +1,114 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TableroMaterialidadDetalle.aspx.cs" Inherits="Documentacion_TableroMaterialidadDetalle" %> + + + + + + + + + Materialidad personal + + + + + + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    Cliente:
    +
    + +
    +
    Año:
    +
    + +
    +
    MES:
    +
    + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + diff --git a/Documentacion/TableroMaterialidadDetalle.aspx.cs b/Documentacion/TableroMaterialidadDetalle.aspx.cs new file mode 100644 index 000000000..450e86419 --- /dev/null +++ b/Documentacion/TableroMaterialidadDetalle.aspx.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Documentacion_TableroMaterialidadDetalle : ClsPaginas +{ + #region "Propiedades" + public int CveCliente + { + get { return ViewState["CveCliente"] != null ? ViewState["CveCliente"].ToString().ToEntero() : 0; } + set { ViewState["CveCliente"] = value; } + } + + public int anio + { + get { return ViewState["anio"] != null ? ViewState["anio"].ToString().ToEntero() : 0; } + set { ViewState["anio"] = value; } + } + public int mes + { + get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; } + set { ViewState["mes"] = value; } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + if (Request["CveCliente"] != null && Request["CveCliente"].ToString().ToEntero() > 0) + { + CveCliente = Request["CveCliente"].ToString().ToEntero(); + DdlCliente.SelectedValue = CveCliente.ToString(); + } + if (Request["anio"] != null && Request["anio"].ToString().ToEntero() > 0) + { + anio = Request["anio"].ToString().ToEntero(); + Txtanio.Text = anio.ToString(); + } + if (Request["mes"] != null && Request["mes"].ToString().ToEntero() > 0) + { + mes = Request["mes"].ToString().ToEntero(); + ddlMes.SelectedValueExist(mes.ToString()); + } + cargadatos(); + } + } + public void cargadatos() + { + using (ClsEdocumentacion edoc = new ClsEdocumentacion()) + { + if (edoc.TableroMaterialidadDetalleGET(UsuarioActual.CveEmpresa, (anio = Txtanio.Text.ToEntero()), (mes = ddlMes.SelectedValue.ToEntero()), CveCliente) && edoc.DSResultados.Tables.Count > 0) + { + GVData.DataSource = edoc.DSResultados.Tables[0]; + GVData.DataBind(); + + } + + } + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + cargadatos(); + } +} \ No newline at end of file diff --git a/Nomina/Aguinaldo.aspx b/Nomina/Aguinaldo.aspx index 1c1547ed8..253f827c4 100644 --- a/Nomina/Aguinaldo.aspx +++ b/Nomina/Aguinaldo.aspx @@ -147,7 +147,7 @@ Fecha
    ingreso - + @@ -183,7 +183,7 @@ Días
    aguinaldo - + diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs index 9aefd8cc2..fb00e4e89 100644 --- a/Nomina/Aguinaldo.aspx.cs +++ b/Nomina/Aguinaldo.aspx.cs @@ -174,7 +174,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas { CveConceptoISR = rowcz["CveConcepto"].ToString().ToEntero(); } - DataRow rowcy = objNomina.DtResultados.FiltroPrimero("CveConceptoContable=174"); + DataRow rowcy = objNomina.DtResultados.FiltroPrimero("CveConceptoContable=174 AND Tipo ='D'"); if ((rowcz != null)) { CveConceptoDescuento = rowcy["CveConcepto"].ToString().ToEntero(); @@ -201,15 +201,15 @@ public partial class Nomina_Aguinaldo : ClsPaginas Importe = gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text.ToDecimal(); ImporteGravado = gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal(); ImporteExento = Importe - ImporteGravado; - ImporteValor = gvrow.FCLabel("diasPropAgui").Text.ToEntero(); + ImporteValor = gvrow.FCLabel("lbldiasAguinaldoprop").Text.ToEntero(); ImporteDescuento = gvrow.FCTextBox("TxtDescuento").Text.ToDecimal(); ImporteISR = gvrow.FCLabel("lblISRAguinaldo").Text.ToDecimal(); - - // foreach (DataRow row in DTAguinaldos.Rows) - //{ + + // foreach (DataRow row in DTAguinaldos.Rows) + //{ //DiasLaborados = row["DiasLaborados"].ToString().ToEntero(); CvePeriodo = CvePeriodoSeleccionado; /* @@ -237,7 +237,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas else { if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, Importe.ToString().ToDouble(), 0, 0, Importe.ToString().ToDouble(), CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina", - "", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + "", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, false)) { CveNomina = objNomina.CveNomina; } @@ -254,15 +254,15 @@ public partial class Nomina_Aguinaldo : ClsPaginas if (CveNomina > 0) { - if (continuar &&!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, ImporteValor, UsuarioActual.CveUsuario, false, 1, 1, 1)) + if (continuar && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, ImporteValor, UsuarioActual.CveUsuario, false, 1, 1, 1)) { continuar = false; } - if (continuar && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConceptoISR, ImporteISR, 0, 0, ImporteGravado, UsuarioActual.CveUsuario, false, 1, 1, 1)) + if (continuar && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConceptoISR, ImporteISR, 0, ImporteISR, ImporteGravado, UsuarioActual.CveUsuario, false, 1, 1, 1)) { continuar = false; } - if (continuar && ImporteDescuento >0 && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConceptoDescuento, ImporteDescuento, 0, 0, 0, UsuarioActual.CveUsuario, false, 1, 1, 1)) + if (continuar && ImporteDescuento > 0 && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConceptoDescuento, ImporteDescuento, 0, ImporteDescuento, 0, UsuarioActual.CveUsuario, false, 1, 1, 1)) { continuar = false; } @@ -283,14 +283,20 @@ public partial class Nomina_Aguinaldo : ClsPaginas //{ // continuar = objNomina.CambiaEstatusPeriodo(CvePeriodoSeleccionado, (int)enumNominasEstatus.Activa, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); //} + if (continuar) { objNomina.Commit(); + //objNomina.Commit(); } else { + mensaje = string.Format(" {0} ", mensaje); objNomina.RollBack(); } + + + objNomina.Dispose(); } } @@ -302,7 +308,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas if (continuar) { RegistraScript("$('#ModalAutorizar').modal('hide');"); - Alert("Se ha generado el aguinaldo"); + Alert("Se ha generado el aguinaldo."); BtnCalcular_Click(null, null); } } @@ -503,7 +509,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas } if (gvrowTotal != null) { - gvrowTotal.FCLabel("lblISRAguinaldo").Text = string.Format("${0:N2}", ISRTOTAL ); + gvrowTotal.FCLabel("lblISRAguinaldo").Text = string.Format("${0:N2}", ISRTOTAL); gvrowTotal.FCLabel("lblAguinaldoGravado").Text = string.Format("${0:N2}", aguinaldogravadoTotal); gvrowTotal.FCLabel("lblDescuento").Text = string.Format("${0:N2}", descuentoTotal); gvrowTotal.FCLabel("lblsueldoAguinaldoCompleto").Text = string.Format("${0:N2}", aguinaldoTotal); @@ -527,35 +533,69 @@ public partial class Nomina_Aguinaldo : ClsPaginas int filatitulo = fila; libro.SheetView.Freeze(filatitulo, 1); libro.Cell(fila, 1).Value = "Empleado"; - libro.Cell(fila, 2).Value = "Salario diario"; - libro.Cell(fila, 3).Value = "Días laborados"; - libro.Cell(fila, 4).Value = "Días aguinaldo"; - libro.Cell(fila, 5).Value = "Aguinaldo completo"; - libro.Cell(fila, 6).Value = "Aguinaldo gravado"; - libro.Cell(fila, 7).Value = "Aguinaldo exento"; - libro.Cell(fila, 8).Value = "I.S.R."; - libro.Cell(fila, 9).Value = "Aguinaldo por pagar"; + libro.Cell(fila, 2).Value = "Fecha ingreso";//lblfechaingreso + libro.Cell(fila, 3).Value = "Salario diario"; + libro.Cell(fila, 4).Value = "Días laborados"; + libro.Cell(fila, 5).Value = "Días base"; + libro.Cell(fila, 6).Value = "Días aguinaldo";//lbldiasAguinaldoprop + libro.Cell(fila, 7).Value = "Aguinaldo completo"; + libro.Cell(fila, 8).Value = "Aguinaldo gravado"; + libro.Cell(fila, 9).Value = "Aguinaldo exento"; + libro.Cell(fila, 10).Value = "Fraccion I"; //lblFraccion1 + libro.Cell(fila, 11).Value = "Fraccion II"; //lblFraccion2 + libro.Cell(fila, 12).Value = "Fraccion III"; //lblFraccion3 + libro.Cell(fila, 13).Value = "Fraccion IV"; //lblFraccion4 + libro.Cell(fila, 14).Value = "I.S.R."; + libro.Cell(fila, 15).Value = "Descuento"; //TxtDescuento + libro.Cell(fila, 16).Value = "Aguinaldo por pagar"; - libro.Range(fila, 1, fila, 8).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; - libro.Range(fila, 1, fila, 8).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); + libro.Range(fila, 1, fila, 16).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(fila, 1, fila, 16).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows) { fila = fila + 1; + + + if (!(gvrow.DataKey("CvePersonal").ToEntero() > 0)) + { + if (gvrow.DataKey("CveSubProyecto").ToEntero() > 0) + { + libro.Range(fila, 1, fila, 16).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 217, 217)); + } + else + { + libro.Range(fila, 1, fila, 16).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(fila, 1, fila, 16).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 128, 128)); + } + + } + + libro.Cell(fila, 1).Value = gvrow.FCLabel("lblnombreCompleto").Text; - libro.Cell(fila, 2).Value = gvrow.FCLabel("TxtsueldoDiario").Text.ToDecimal(); - libro.Cell(fila, 3).Value = gvrow.FCLabel("TxtdiasLaborados").Text.ToDecimal(); - libro.Cell(fila, 4).Value = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal(); - libro.Cell(fila, 5).Value = gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text.ToDecimal(); - libro.Cell(fila, 6).Value = gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal(); - libro.Cell(fila, 7).Value = gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text.ToDecimal() - gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal(); - libro.Cell(fila, 8).Value = gvrow.FCLabel("lblISRAguinaldo").Text.ToDecimal(); - libro.Cell(fila, 9).Value = gvrow.FCLabel("lblAguinaldo").Text.ToDecimal(); + libro.Cell(fila, 2).Value = gvrow.FCLabel("lblfechaingreso").Text; + libro.Cell(fila, 3).Value = gvrow.FCLabel("TxtsueldoDiario").Text.ToDecimal(); + libro.Cell(fila, 4).Value = gvrow.FCLabel("TxtdiasLaborados").Text.ToDecimal(); + libro.Cell(fila, 5).Value = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal(); + libro.Cell(fila, 6).Value = gvrow.FCLabel("lbldiasAguinaldoprop").Text.ToDecimal(); + libro.Cell(fila, 7).Value = gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text.ToDecimal(); + libro.Cell(fila, 8).Value = gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal(); + libro.Cell(fila, 9).Value = gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text.ToDecimal() - gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal(); + + libro.Cell(fila, 10).Value = gvrow.FCLabel("lblFraccion1").Text.ToDecimal(); + libro.Cell(fila, 11).Value = gvrow.FCLabel("lblFraccion2").Text.ToDecimal(); + libro.Cell(fila, 12).Value = gvrow.FCLabel("lblFraccion3").Text.ToDecimal(); + libro.Cell(fila, 13).Value = gvrow.FCLabel("lblFraccion4").Text.ToDecimal(); + + + libro.Cell(fila, 14).Value = gvrow.FCLabel("lblISRAguinaldo").Text.ToDecimal(); + libro.Cell(fila, 15).Value = gvrow.FCTextBox("TxtDescuento").Text.ToDecimal(); + libro.Cell(fila, 16).Value = gvrow.FCLabel("lblAguinaldo").Text.ToDecimal(); } - libro.Range(filatitulo, 1, fila, 9).Columns(); - libro.Range(filatitulo + 1, 2, fila + 1, 8).DataType = ClosedXML.Excel.XLDataType.Number; - libro.Range(filatitulo + 1, 2, fila + 1, 2).Style.NumberFormat.Format = "$###,###,###,##0.00"; - libro.Range(filatitulo + 1, 5, fila + 1, 9).Style.NumberFormat.Format = "$###,###,###,##0.00"; + libro.Range(filatitulo, 1, fila, 16).Columns(); + libro.Range(filatitulo + 1, 3, fila + 1, 16).DataType = ClosedXML.Excel.XLDataType.Number; + libro.Range(filatitulo + 1, 3, fila + 1, 3).Style.NumberFormat.Format = "$###,###,###,##0.00"; + libro.Range(filatitulo + 1, 7, fila + 1, 16).Style.NumberFormat.Format = "$###,###,###,##0.00"; libro.ColumnsUsed().AdjustToContents(); System.IO.Stream fs = new System.IO.MemoryStream(); @@ -605,8 +645,10 @@ class ClsClaseBaseD : IDisposable // REGISTRAR CONEXIÓN private int CveConexion = 0; - public ClsClaseBaseD(ClsClaseBaseD adsObj = null) + public ClsClaseBaseD(ClsClaseBaseD adsObj = null, SqlTransaction sqlTransacc = null, SqlDataAdapter sqlAdapter =null) { + + if (adsObj != null && adsObj.SqlAdapter != null && adsObj.SqlAdapter.SelectCommand != null && adsObj.SqlAdapter.SelectCommand.Transaction != null) { SqlConexion = adsObj.SqlConexion; @@ -615,19 +657,29 @@ class ClsClaseBaseD : IDisposable } else { - SqlConexion = new SqlConnection(); - SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString; - try + if (sqlTransacc != null) { - SqlConexion.Open(); - SqlAdapter = new SqlDataAdapter("", SqlConexion); - ConexionAdd(); + SqlConexion = sqlTransacc.Connection; + SqlAdapter = sqlAdapter; + EsTransaccion = true; } - catch (Exception ex) + else { - this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex); + SqlConexion = new SqlConnection(); + SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString; + try + { + SqlConexion.Open(); + SqlAdapter = new SqlDataAdapter("", SqlConexion); + ConexionAdd(); + } + catch (Exception ex) + { + this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex); + } } } + } public void SqlDataAdapter(string StrSQL, CommandType TipoComando = CommandType.StoredProcedure) diff --git a/Nomina/ChecadorAsistencia.aspx b/Nomina/ChecadorAsistencia.aspx index 166febbb3..2ec3b595b 100644 --- a/Nomina/ChecadorAsistencia.aspx +++ b/Nomina/ChecadorAsistencia.aspx @@ -405,7 +405,7 @@
    - +
    @@ -421,6 +421,26 @@
    + + +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    diff --git a/Nomina/ChecadorAsistencia.aspx.cs b/Nomina/ChecadorAsistencia.aspx.cs index afcd74f96..4c87b32f5 100644 --- a/Nomina/ChecadorAsistencia.aspx.cs +++ b/Nomina/ChecadorAsistencia.aspx.cs @@ -28,8 +28,8 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas DdlTurno.DataBind(); CargaTiposPeriodo(); - TxtRpdFechaInicio.Text = "01/09/2021"; - TxtRpdFechaFin.Text = "15/09/2021"; + TxtRpdFechaInicio.Text = string.Format("{0:dd/MM/yyyy}",DateTime.Now ); + TxtRpdFechaFin.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now); DdlTipoAsistencias.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)); DdlTipoAsistencias.DataBind(); @@ -359,9 +359,11 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas protected void LnkAgregarRegistro_Click(object sender, EventArgs e) { DateTime fechaing = string.Format("{0:dd-MM-yyyy} {0:HH}:{0:mm}:{1:00}", TxtFechaIngreso.Text.ToDateTimeExcat(), TxtSegundos.Text.ToEntero()).ToDateTimeExcat("dd-MM-yyyy HH:mm:ss"); + DateTime fechasal = string.Format("{0:dd-MM-yyyy} {0:HH}:{0:mm}:{1:00}", TxtFechaSalida.Text.ToDateTimeExcat(), TxtSegundosFechaSalida.Text.ToEntero()).ToDateTimeExcat("dd-MM-yyyy HH:mm:ss"); bool continuar = false; List items = new List(); items.Add(new RequestAddChecadorRegistro() { CveChecador = DdlChecador.SelectedValue.ToEntero(), CvePersonal = DdlmcPersonal.SelectedValue.ToEntero(), ChecadorID = -1, Fecha = fechaing }); + items.Add(new RequestAddChecadorRegistro() { CveChecador = DdlChecador.SelectedValue.ToEntero(), CvePersonal = DdlmcPersonal.SelectedValue.ToEntero(), ChecadorID = -1, Fecha = fechasal }); using (ClsRH objrh = new ClsRH()) { objrh.IniciaTransacSQL(); diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 2d54f52ad..6b39f3345 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1848,8 +1848,58 @@
    + + +
    - + @@ -793,7 +793,7 @@
    - @@ -1067,7 +1067,7 @@
    -
    +
    El cliente No desglosa IVA:
    @@ -2084,7 +2084,7 @@ - +
    @@ -3427,7 +3427,7 @@ -