diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index d2f7e6a76..e08b9b811 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3052,6 +3052,27 @@ Public Class ClsNominas #End Region + Public Function GetAsistenciabetweendate(CveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime) As Boolean + Dim retorno As Boolean = False + Try + DTSet = New DataSet() + DataAdapter("PA_RH_AsistenciaBetweenDates", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + End With + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener la asistencia de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener la asistencia de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Sub addParameters(varsql As String, sqltipe As SqlDbType, valor As Object) SqlAdapter.SelectCommand.Parameters.Add(varsql, sqltipe).Value = valor diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 23b1710e4..67bf2bda2 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -7180,6 +7180,31 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo #End Region + + Public Function UpPersonalSupervisorMasiva(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpSupervisorMasiva)) As Boolean + Dim Retorno As Boolean = False + Dim xmlProductos As System.Xml.Linq.XDocument = Nothing + If registros IsNot Nothing AndAlso registros.Count > 0 Then + xmlProductos = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("registros", From x In registros Select New System.Xml.Linq.XElement("registro", New System.Xml.Linq.XElement("CvePersonal", x.CvePersonal), New System.Xml.Linq.XElement("CveUsuario", x.CveUsuario), New System.Xml.Linq.XElement("CveCliente", x.CveCliente)))) + End If + Data = New DataTable + SqlDataAdapter("PA_RH_PersonalSupervisorMasivaUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString() + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar los supervisores.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar los supervisores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + 'Public msgsError As New StringBuilder() 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) @@ -7236,3 +7261,8 @@ Public Class RequestUpAsistenciaDetalle Public Property CveSubProyecto As Integer Public Property Motivo As String End Class +Public Class RequestUpSupervisorMasiva + Public Property CvePersonal As Integer + Public Property CveUsuario As Integer + Public Property CveCliente As Integer +End Class \ No newline at end of file diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index df4a7914f..3f722b885 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1016,7 +1016,7 @@ Partial Class PopUpVerFactura Private Sub ImprimeFormatoCartaPorte(CveMovimiento As Integer) If CveMovimiento > 0 Then Dim ObjInv As New ClsInventarios - + Dim SerieFolio As String = "" Dim DomicilioSucursal As String = "" Dim LugarFecha As String = "" diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index f56d87ecc..77e8f2368 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -22,6 +22,28 @@ public partial class Nomina_Nomina2 : ClsPaginas { get { return 5; } } + + private DateTime FechaInicioPeriodo + { + get + { + if (ViewState["FechaInicioPeriodo"] == null) { return DateTime.Now; } + else { return (DateTime)ViewState["FechaInicioPeriodo"]; } + } + + set { ViewState["FechaInicioPeriodo"] = value; } + } + private DateTime FechaFinPeriodo + { + get + { + if (ViewState["FechaFinPeriodo"] == null) { return DateTime.Now.AddDays(1); } + else { return (DateTime)ViewState["FechaFinPeriodo"]; } + } + + set { ViewState["FechaFinPeriodo"] = value; } + } + private DataTable dtNomConceptos { get @@ -422,7 +444,6 @@ public partial class Nomina_Nomina2 : ClsPaginas dtempleados = null; dtConceptos = null; DataTable dtPeriodo = new DataTable(); - DataTable dtasistencia = new DataTable(); LnkAutorizar.Visible = false; Estatus = 5; if (FiltCvePeriodo > 0) @@ -438,6 +459,10 @@ public partial class Nomina_Nomina2 : ClsPaginas int CvePrePolizaProvisionAsimilados = drow["CvePrePolizaAsimilables"].ToString().ToEntero(); int CvePrePolizaProrrateo = drow["CvePrePolizaProrrateo"].ToString().ToEntero(); + + FechaInicioPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaInicio"]; + FechaFinPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaFin"]; + //LnkConceptoEmpleado.Visible = (Estatus == 1); LnkRegistrarProvision.Visible = (Estatus >= 2);//&& (CvePrePolizaProvision <= 0 || UsuarioActual.CveUsuario == 100); LnkRegistrarProvision.Text = CvePrePolizaProvision <= 0 ? "Registrar provisión" : "Regenerar provisión"; @@ -466,7 +491,7 @@ public partial class Nomina_Nomina2 : ClsPaginas dtempleadosConceptos = objnom.DTSetResultados.Tables[4]; dtConceptos = objnom.DTSetResultados.Tables[0]; dtPeriodo = objnom.DTSetResultados.Tables[1]; - dtasistencia = objnom.DTSetResultados.Tables[2]; + //dtasistencia = objnom.DTSetResultados.Tables[2]; CvePeriodoSeleccionado = FiltCvePeriodo; continuar = true; } @@ -826,74 +851,87 @@ public partial class Nomina_Nomina2 : ClsPaginas GvNominas.DataSource = null; GvNominas.DataBind(); } - if (cargaasistencia) - { - if (dtPeriodo != null && dtPeriodo.Rows.Count > 0) - { - - DateTime FechaInicio = (DateTime)dtPeriodo.Rows[0]["FechaInicio"]; - DateTime FechaFin = (DateTime)dtPeriodo.Rows[0]["FechaFin"]; - StringBuilder gvasistencia = new StringBuilder(); - gvasistencia.Append("
"); - if (true) - { - DateTime fecha = FechaInicio; - - gvasistencia.Append(""); - gvasistencia.Append(""); - while (fecha <= FechaFin) - { - gvasistencia.AppendFormat("", fecha); - fecha = fecha.AddDays(1); - } - gvasistencia.Append(""); - } - string tipo = ""; - foreach (DataRow rempl in dtempleados.FiltraParametros("CvePersonal>0").Rows) - { - int CvePersonal = rempl["CvePersonal"].ToString().ToEntero(); - string nombre = rempl["Nombre"].ToString(); - string Codigo = rempl["Codigo"].ToString(); - DateTime fecha = FechaInicio; int HorasDobles, HorasTriples; - gvasistencia.Append(""); - gvasistencia.AppendFormat("", CvePersonal, nombre, Codigo); - while (fecha <= FechaFin) - { - DataRow drow = dtasistencia.FiltroPrimero(string.Format("Fecha='{0:yyyy/MM/dd}' AND CvePersonal={1}", fecha, CvePersonal)); - tipo = "-"; - if (drow != null) - { - tipo = string.Format("{0} ({1}%)", drow["Tipo"], drow["PorcentajePago"]); - HorasDobles = drow["HorasDobles"].ToString().ToEntero(); - HorasTriples = drow["HorasTriples"].ToString().ToEntero(); - if (HorasDobles > 0) - { - - tipo = string.Format("{0}
{1} horas dobles", tipo, HorasDobles); - } - if (HorasTriples > 0) - { - - tipo = string.Format("{0}
{1} horas triple", tipo, HorasTriples); - } - drow.Delete(); - } - gvasistencia.AppendFormat("", tipo, CvePersonal, fecha); - fecha = fecha.AddDays(1); - } - gvasistencia.Append(""); - } - gvasistencia.Append("
Nombre{0:dd/MM/yyyy}
{2} {1} {0}
"); - ltlGvAsistencia.Text = gvasistencia.ToString(); - } - } #endregion + + if (cargaasistencia && dtPeriodo != null && dtPeriodo.Rows.Count > 0) + { + cargarasistencia(); + } if (dtempleados != null) { LnkAutorizar.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =0") > 0) || (Estatus < 2); LnkCancelarNomina.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =1 AND SeTimbro=0") > 0); } UpDatos.Update(); + } + public void cargarasistencia() + { + + + + + DateTime FechaInicio = FechaInicioPeriodo; + DateTime FechaFin = FechaFinPeriodo; + DataTable dtasistencia; + using (ClsNominas objnom = new ClsNominas()) + { + objnom.GetAsistenciabetweendate(UsuarioActual.CveEmpresa, FechaInicio, FechaFin); + dtasistencia = objnom.DtResultados; + } + StringBuilder gvasistencia = new StringBuilder(); + gvasistencia.Append("
"); + if (true) + { + DateTime fecha = FechaInicio; + + gvasistencia.Append(""); + gvasistencia.Append(""); + while (fecha <= FechaFin) + { + gvasistencia.AppendFormat("", fecha); + fecha = fecha.AddDays(1); + } + gvasistencia.Append(""); + } + string tipo = ""; + foreach (DataRow rempl in dtempleados.FiltraParametros("CvePersonal>0").Rows) + { + int CvePersonal = rempl["CvePersonal"].ToString().ToEntero(); + string nombre = rempl["Nombre"].ToString(); + string Codigo = rempl["Codigo"].ToString(); + DateTime fecha = FechaInicio; int HorasDobles, HorasTriples; + gvasistencia.Append(""); + gvasistencia.AppendFormat("", CvePersonal, nombre, Codigo); + while (fecha <= FechaFin) + { + DataRow drow = dtasistencia.FiltroPrimero(string.Format("Fecha='{0:yyyy/MM/dd}' AND CvePersonal={1}", fecha, CvePersonal)); + tipo = "-"; + if (drow != null) + { + tipo = string.Format("{0} ({1}%)", drow["Tipo"], drow["PorcentajePago"]); + HorasDobles = drow["HorasDobles"].ToString().ToEntero(); + HorasTriples = drow["HorasTriples"].ToString().ToEntero(); + if (HorasDobles > 0) + { + + tipo = string.Format("{0}
{1} horas dobles", tipo, HorasDobles); + } + if (HorasTriples > 0) + { + + tipo = string.Format("{0}
{1} horas triple", tipo, HorasTriples); + } + drow.Delete(); + } + gvasistencia.AppendFormat("", tipo, CvePersonal, fecha); + fecha = fecha.AddDays(1); + } + gvasistencia.Append(""); + } + gvasistencia.Append("
Nombre{0:dd/MM/yyyy}
{2} {1} {0}
"); + ltlGvAsistencia.Text = gvasistencia.ToString(); + + } private void setGVNominas() { @@ -1240,7 +1278,7 @@ public partial class Nomina_Nomina2 : ClsPaginas if (CveNomina > 0) { - + DdlMotivoCancelacion.Items.Insert(0, new ListItem("Seleccione", "-1")); using (ClsNominas Nom = new ClsNominas()) { @@ -1256,7 +1294,7 @@ public partial class Nomina_Nomina2 : ClsPaginas string SerieFolio = Nom.SerieFolio; DataRow rowc = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveMotivoCancelacion={0}", DdlMotivoCancelacion.SelectedValue)); int CveMotivoCancelacion = -1; - if(rowc != null) + if (rowc != null) { CveMotivoCancelacion = rowc["CveSATMotivoCancelacion"].ToString().ToEntero(); } diff --git a/RH/ActualizacionMasiva.aspx b/RH/ActualizacionMasiva.aspx index 8e3367d30..6b748fd11 100644 --- a/RH/ActualizacionMasiva.aspx +++ b/RH/ActualizacionMasiva.aspx @@ -3,6 +3,51 @@ + @@ -10,19 +55,37 @@ Cargas Masivas -
  • Carga Masiva
  • +
  • + Carga Masiva
  • -
    -
    -
    - - - -
    -
    +
    +
    +
    + +
    + Turno: +
    + + + +
    + + +
    + + + +
    + +
    + + + +
    +
      <%--
    • Cliente:
    • --%> -
    • Proyecto: - - - -
    • -
    • SubProyecto: - - - -
    • -
    •   Turno: - - - -
    + +
    + + + +
    - +
    diff --git a/Ventas/RepConciliacionEmitidosSat.aspx.cs b/Ventas/RepConciliacionEmitidosSat.aspx.cs index b318417ef..7cf8cc869 100644 --- a/Ventas/RepConciliacionEmitidosSat.aspx.cs +++ b/Ventas/RepConciliacionEmitidosSat.aspx.cs @@ -224,13 +224,14 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas ClsCGame ObjCGame = new ClsCGame(ObjVentas.IniciaTransacSQL()); ClsEdocumentacion ObjDocCliente = new ClsEdocumentacion(ObjVentas.IniciaTransacSQL()); ClsAcumuladores ObjAcum = new ClsAcumuladores(ObjVentas.IniciaTransacSQL()); - //ClsContPAQi ObjContPaq = null; + ClsContPAQi ObjContPaq = null; //StringBuilder MensajeAlert = new StringBuilder() ; Modelos.Factura.MMensajeFactura Resp = new Modelos.Factura.MMensajeFactura(); DataTable DtDetalle = objfact.DtDetalle; try { - // objfact.GuardarVenta(ref objfact, ref ObjVentas, ref ObjConta, ref ObjInventario, ref ObjContr, ref DtDetalle, objfact.CveNCaVincular, ref ObjContPaq, ref ObjBancos, ref ObjOS, ref ObjEventos, ref ObjCGame, ref ObjClientes, ref Resp, ObjAcum: ObjAcum); + objfact.GuardarVenta(ref objfact, ref ObjVentas, ref ObjConta, ref ObjInventario, ref ObjContr, ref DtDetalle, objfact.CveNCaVincular, ref ObjContPaq, + ref ObjBancos, ref ObjOS, ref ObjEventos, ref ObjCGame, ref ObjClientes, false, ObjAcum,ref Resp); } catch (Exception e) @@ -803,6 +804,28 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas } //String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) } + + protected void DdlClasificacion_SelectedIndexChanged(object sender, EventArgs e) + { + + int CveClasificacion = DdlClasificacion.SelectedValue.ToEntero(); + if (UsuarioActual.Empresa.Funcionalidad(141).ToString() == "1") + { + + DdlPS.setEsWebService(true); + DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString()); + DdlPS.ddlWS.Attributes.Add("data-pagina", "ventas/ventas"); + DdlPS.ddlWS.Attributes.Add("data-Estatus", "1"); + } + else + { + + DdlPS.setEsWebService(false); + DdlPS.ddl.DataSource = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion: CveClasificacion, Estatus: 1, AplicaParaVenta: 1); + DdlPS.ddl.DataBind(); + } + UpModalDefaults.Update(); + } } namespace ADSistemaLibrary2.SatXml { diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index e35a5f8a6..3dddaee0d 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2478,6 +2478,25 @@ Partial Class Ventas HlFacturasRelaciondas.Visible = True End If + If Request("CveOrdenProduccion") IsNot Nothing AndAlso IsNumeric(Request("CveOrdenProduccion")) AndAlso Request("CveOrdenProduccion").ToEntero() > 0 Then + DdlSubProyectoDatos.SelectedValueExist(11954) + Using ObjVentas As New ClsNominas + + If ObjVentas.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, "", -Request("CveOrdenProduccion").ToEntero()) Then + TmpDT = ObjVentas.DtResultados + TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) + TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) + TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer)) + TmpDT.Columns.Add("TieneProntoPago", GetType(String)) + TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal)) + GvPS.DataSource = ObjVentas.DtResultados + GvPS.DataBind() + + 'IEPS A NIVEL DETALLE + 'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text) + End If + End Using + End If If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then DdlMoneda.SelectedValueExist(2) Using ObjVentas As New ClsNominas diff --git a/vwd.webinfo b/vwd.webinfo index e457e81ff..f65beefe5 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -412,6 +412,8 @@ + +