From 6236018745925498a0c371971595745dfcbc787a Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 23 Aug 2021 16:38:28 -0700 Subject: [PATCH 1/9] --- Nomina/Finiquito.aspx | 3 - Nomina/Nomina.aspx | 40 +++-- Nomina/Nomina.aspx.cs | 30 ++-- OC/OC.aspx.vb | 2 +- RH/Personal.aspx | 10 +- RH/Personal.aspx.vb | 359 +++++++++++++++++++++--------------------- vwd.webinfo | 6 + 7 files changed, 237 insertions(+), 213 deletions(-) diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index f49af60bd..ee03668bd 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -125,9 +125,6 @@
Área geográfica - - -Corregido con https://www.corrector.co/es/:
-- diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 8cc2656eb..06e0fac89 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -9,6 +9,10 @@ content: "\f1c1"; } + table.gvasistencia tr:hover { + background-color: #dddddd; + } + label.compoonenlabel { padding-top: 5px; } @@ -388,7 +392,7 @@
- @@ -553,7 +557,8 @@
- Asistencia + Asistencia +
@@ -594,9 +599,19 @@ -
- - +
+
+
+ + +
+
+
+
+ + +
+
@@ -1365,6 +1380,7 @@ + @@ -1695,37 +1711,37 @@
- +
- +
- +
- +
- +
- +
@@ -1949,7 +1965,7 @@
- +
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index ecedfe4b9..00600d37a 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -378,8 +378,7 @@ public partial class Nomina_Nomina2 : ClsPaginas { int CvePeriodo = DdlPeriodo.SelectedValue.ToEntero(); LnkConsultar.Visible = (CvePeriodo > 0); - UPFiltros.Update(); - UpDatos.Update(); + UPFiltros.Update(); } #endregion #region Datos @@ -390,10 +389,11 @@ public partial class Nomina_Nomina2 : ClsPaginas FiltCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero(); FiltCveTurno = DdlTurno.SelectedValue.ToEntero(); FiltCvePeriodo = DdlPeriodo.SelectedValue.ToEntero(); - LtlPeriodoseleccionado.Text = DdlPeriodo.SelectedItem.Text; FiltAgrupador = 1; HypPDFSTimbrados.Attributes.Add("onclick", string.Format("GETPDF({0},{1})", -1, FiltCvePeriodo)); cargaDatos(); + LtlPeriodoseleccionado.Text = string.Format("{0} ({1} Empleados)", DdlPeriodo.SelectedItem.Text, GvNominas.Rows.Count); + LtlPeriodoseleccionadoASis.Text = LtlPeriodoseleccionado.Text; } public void cargaDatos(bool cargaasistencia = true) @@ -1027,7 +1027,7 @@ public partial class Nomina_Nomina2 : ClsPaginas e.Row.FindControl("LnkTimbrar").Visible = false; if (Turno.Length == 0 && SubProyecto.Length > 0) { - LtlNombre.Text = String.Format("Centro de costos: {0}", SubProyecto); + LtlNombre.Text = String.Format("Centro de costos: {0}({1})", SubProyecto, e.Row.DataKey("CveSubProyecto").ToString()); } else if (Turno.Length > 0) { @@ -1092,7 +1092,7 @@ public partial class Nomina_Nomina2 : ClsPaginas if (msggral.Length > 0) { - Alert(string.Format("Ocurrieron los siguientes errores {0}
CódigoNombreError
", msggral), TipoMensaje.MsgAdvertencia); + Alert(string.Format("Los siguientes empleados no se timbraron por las siguiente situaciones: {0}
CódigoNombreMensaje SAT
", msggral), TipoMensaje.MsgAdvertencia); } UpDatos.Update(); } @@ -1126,16 +1126,16 @@ public partial class Nomina_Nomina2 : ClsPaginas int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero(); int CveNomina = gvRow.DataKey("CveNomina").ToEntero(); LogicNominas lognom = new LogicNominas(); - Usuario UsuarioActual = null; - using(ClsSisUsuarios ObjUsuario= new ClsSisUsuarios()) - { - UsuarioActual =ObjUsuario.ValidaUsuario("jcaudillo", Encripta("45makako45"), "-1", 1); - } - CreaObjetoEmpresa(ref UsuarioActual); - UsuarioActual.CveEmpresa = this.UsuarioActual.CveEmpresa; + //Usuario UsuarioActual = null; + //using(ClsSisUsuarios ObjUsuario= new ClsSisUsuarios()) + //{ + // UsuarioActual =ObjUsuario.ValidaUsuario("jcaudillo", Encripta("45makako45"), "-1", 1); + //} + //CreaObjetoEmpresa(ref UsuarioActual); + //UsuarioActual.CveEmpresa = this.UsuarioActual.CveEmpresa; string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual); if (Msg != null && Msg.Length > 0) - { Alert(Msg, TipoMensaje.MsgAdvertencia); } + { Alert(string.Format("El empleado no se pudo timbrar, el sat nos devolvio el siguiente mensaje:
{0}", Msg), TipoMensaje.MsgAdvertencia); } else { ClsNominas ObjPeriodo = new ClsNominas(); @@ -5003,9 +5003,10 @@ public partial class Nomina_Nomina2 : ClsPaginas if (objpersonal.AddAsistencia(CvePersonal, -1, DdlAsisSubProyecto.SelectedValue.ToEntero(), fecha, DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(), TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { + Alert(string.Format("se ha guardado la asistencia satisfactoriamente
{0}
{1:dd/MM/yyyy}", TxtPersonal.Text, TxtasisFecha.Text.ToDate()),TipoMensaje.ToastInformacion); + RegistraScript("$('#DModalModAsistencia').modal('hide');"); } - Alert("se ha guardado la asistencia satisfactoriamente"); } } @@ -5013,6 +5014,7 @@ public partial class Nomina_Nomina2 : ClsPaginas { int CvePersonal = TxtasiscvePersonal.Text.ToEntero(); DateTime fecha = TxtasisFecha.Text.ToDate(); + TxtfechaMostrar.Text = string.Format("{0:dd/MM/yyyy}", fecha); DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal={0}", CvePersonal)); TxtPersonal.Text = drow["nombre"].ToString(); DdlAsisSubProyecto.SelectedValueExist("-1"); diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 92af42596..71d1df391 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -579,7 +579,7 @@ Partial Class OC If Not Page.IsPostBack Then - + GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing CargaDatosAgregarPS() CveProveedorOriginal = -1 'MODALIDAD MULTIEMPRESA diff --git a/RH/Personal.aspx b/RH/Personal.aspx index f4d11b79a..fa4f253c5 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -645,20 +645,20 @@
- +
-<%--
+
-
--%> +
<%--
@@ -679,7 +679,7 @@
--%> -<%--
+
@@ -696,7 +696,7 @@ -
--%> +
<%--
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 7c3ca2caf..e6bb0c374 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -190,7 +190,7 @@ Partial Class RH_Personal If ViewState("CvePersonal") Is Nothing Then Return -1 Else - Return ViewState("CvePersonal").ToString().ToEntero + Return ViewState("CvePersonal").ToString().ToEntero() End If End Get End Property @@ -218,7 +218,7 @@ Partial Class RH_Personal If ViewState("CveUniforme") Is Nothing Then Return -1 Else - Return ViewState("CveUniforme").ToString().ToEntero + Return ViewState("CveUniforme").ToString().ToEntero() End If End Get End Property @@ -260,7 +260,7 @@ Partial Class RH_Personal If ViewState("CvePersonalEstatusInicial") Is Nothing Then Return -1 Else - Return ViewState("CvePersonalEstatusInicial").ToString().ToEntero + Return ViewState("CvePersonalEstatusInicial").ToString().ToEntero() End If End Get Set(value As Integer) @@ -475,7 +475,7 @@ Partial Class RH_Personal If ViewState("VacCveSupervisor") Is Nothing Then Return -1 Else - Return ViewState("VacCveSupervisor").ToString().ToEntero + Return ViewState("VacCveSupervisor").ToString().ToEntero() End If End Get Set(value As Integer) @@ -545,7 +545,7 @@ Partial Class RH_Personal If ViewState("CvePermiso") Is Nothing Then Return -1 Else - Return ViewState("CvePermiso").ToString().ToEntero + Return ViewState("CvePermiso").ToString().ToEntero() End If End Get Set(value As Integer) @@ -827,7 +827,7 @@ Partial Class RH_Personal CargaJornadas() CargaProyecto() CargaTiposAsistencia() - 'CargaMotivoHoraExtra() + CargaMotivoHoraExtra() CargaMotivosHorasExtras() CargaSupervisores() CargaMetodosPago() @@ -845,9 +845,9 @@ Partial Class RH_Personal CargaPermisosReemplazos() CargaPaises() - If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then + If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero() > 0 Then ViewState("CvePersonal") = Request("CvePersonal") - 'CvePersonal = ViewState("CvePersonal").ToString().ToEntero + 'CvePersonal = ViewState("CvePersonal").ToString().ToEntero() CargaDatos() CargaDocumentacionFirmaDecontratos() 'LnkAddLicencias.Visible = True @@ -861,7 +861,7 @@ Partial Class RH_Personal End If 'ImgAddObs.Attributes.Add("onclick", "javascript: PosicionaObjeto(this.id,'DivEventoBitacora',null,-250,-250); $('#DivEventoBitacora').show(1000); ") - If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero - 1 + If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero() - 1 'Inicia Permisos If UsuarioActual.TienePermisoProceso(228) Then @@ -876,6 +876,7 @@ Partial Class RH_Personal divBitacora.Visible = True CargaGvBitacora() Else + MostrarOcultarFechasEstatus() LoadDefaultValues() 'Configuración de Modalidad Insert @@ -995,7 +996,7 @@ Partial Class RH_Personal End If If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then - Dim DTSub As DataTable = GlobalDTSubProyectos(-1, Request("CveSubProyecto").ToEntero) 'Cambiame + Dim DTSub As DataTable = GlobalDTSubProyectos(-1, Request("CveSubProyecto").ToEntero()) 'Cambiame If DTSub.Rows.Count > 0 Then Dim DTProy As DataTable = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("CveProyecto = " & DTSub.Rows(0)("CveProyecto").ToString()) If DTProy.Rows.Count > 0 Then @@ -1054,10 +1055,10 @@ Partial Class RH_Personal DdlJornada.DataBind() End Sub - 'Private Sub CargaMotivoHoraExtra() - ' DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - ' DdlMotivoHoraExtra.DataBind() - 'End Sub + Private Sub CargaMotivoHoraExtra() + DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlMotivoHoraExtra.DataBind() + End Sub Private Sub CargaDepartamento() DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) @@ -1075,8 +1076,8 @@ Partial Class RH_Personal End Sub Private Sub CargaMotivoBaja() - 'DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - 'DdlMotivoBaja.DataBind() + DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlMotivoBaja.DataBind() End Sub Private Sub CargaEstatusPersonal() @@ -1141,7 +1142,7 @@ Partial Class RH_Personal DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Todos", "-1")) 'old 'DdlSubProyectoAsignado.Items.Clear() - 'DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectos(DdlProyectoAsignado.SelectedValue.ToEntero) + 'DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectos(DdlProyectoAsignado.SelectedValue.ToEntero()) 'DdlSubProyectoAsignado.DataBind() 'DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Sin SubProyecto asignado", "-1")) @@ -1150,7 +1151,7 @@ Partial Class RH_Personal Private Sub CargaSubProyectoAsistenciaC() DdlSubProyectoAsistenciasC.Items.Clear() - DdlSubProyectoAsistenciasC.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaC.SelectedValue.ToEntero) + DdlSubProyectoAsistenciasC.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaC.SelectedValue.ToEntero()) DdlSubProyectoAsistenciasC.DataBind() DdlSubProyectoAsistenciasC.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -1158,7 +1159,7 @@ Partial Class RH_Personal Private Sub CargaSubProyectoAsistenciaA() DdlSubProyectoAsistenciasA.Items.Clear() - DdlSubProyectoAsistenciasA.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaA.SelectedValue.ToEntero) + DdlSubProyectoAsistenciasA.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaA.SelectedValue.ToEntero()) DdlSubProyectoAsistenciasA.DataBind() DdlSubProyectoAsistenciasA.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -1299,7 +1300,7 @@ Partial Class RH_Personal Protected Sub LnkEliminarAsistencia_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) Dim ObjRH As New ClsRH - If ObjRH.RemovePersonalAsistencias(GvRow.DataKey("CveAsistencia").ToEntero) Then + If ObjRH.RemovePersonalAsistencias(GvRow.DataKey("CveAsistencia").ToEntero()) Then Alert("La asistencia ha sido eliminada correctamente.") CargaGvAsistencias() End If @@ -1317,7 +1318,7 @@ Partial Class RH_Personal If CveCliente <= 0 Then CveCliente = -1 End If - If objpersonal.GetAsistencias(CvePersonal, CveCliente, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then + If objpersonal.GetAsistencias(CvePersonal, CveCliente, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), DdlTurno.SelectedValue.ToEntero(), -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL") Else GVAsistencia.DataSource = Nothing @@ -1328,9 +1329,9 @@ Partial Class RH_Personal End Sub Protected Sub LbGuardarAsistencia_Click(sender As Object, e As System.EventArgs) Handles LbGuardarAsistencia.Click Dim ObjPersonal As New ClsRH() - If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero, DdlSubProyectoAsistenciasA.SelectedValue.ToEntero, TxtFechaAsistencia.Text.Trim.ToDate, - DdlTipoAsistencias.SelectedValue.ToEntero, TxtPorPago.Text.Trim.ToDouble, TxtHorasDobles.Text.Trim.ToDouble, - TxtHorasTriples.Text.Trim.ToDouble, DdlMotivoHoraExtra.SelectedValue.ToEntero, TxtObservaciones.Text.Trim, + If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasA.SelectedValue.ToEntero(), TxtFechaAsistencia.Text.Trim.ToDate, + DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim.ToDouble, TxtHorasDobles.Text.Trim.ToDouble, + TxtHorasTriples.Text.Trim.ToDouble, DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion) @@ -1387,9 +1388,9 @@ Partial Class RH_Personal Dim OcurrioError As Boolean = False For Each Row As GridViewRow In GVAsistencia.Rows - If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero, DdlClienteAsistenciaC.SelectedValue.ToEntero, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero, Row.FCLiteral("LtlFecha").Text.Trim.ToDate, - Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero, Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble, - Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero, Row.FCTextBox("TxtObservaciones").Text.Trim, + If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero(), DdlClienteAsistenciaC.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), Row.FCLiteral("LtlFecha").Text.Trim.ToDate, + Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero(), Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble, + Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero(), Row.FCTextBox("TxtObservaciones").Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then OcurrioError = True Exit For @@ -1524,7 +1525,9 @@ Partial Class RH_Personal DdlPuesto.SelectedValue = ObjPersonal.CvePuesto.ToString() DdlRuta.SelectedValue = ObjPersonal.CveRuta.ToString() - 'DdlMotivoBaja.SelectedValue = ObjPersonal.CveMotivoBaja.ToString() + DdlMotivoBaja.SelectedValue = ObjPersonal.CveMotivoBaja.ToString() + + TxtFechaBaja.Text = If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString) 'If ObjPersonal.DtResultados IsNot Nothing AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then @@ -1716,11 +1719,11 @@ Partial Class RH_Personal 'Dim FechaActivo As Date = MinFecha 'Dim FechaReingreso As Date = MinFecha - 'If DdlEstatusPersonal.SelectedValue.ToEntero <> CvePersonalEstatusInicial Then - ' If DdlEstatusPersonal.SelectedValue.ToEntero = 1 Then + 'If DdlEstatusPersonal.SelectedValue.ToEntero() <> CvePersonalEstatusInicial Then + ' If DdlEstatusPersonal.SelectedValue.ToEntero() = 1 Then ' FechaActivo = TxtFechaActivo.Text.ToDate - ' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero = 2 Then - ' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero = 5 Then + ' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero() = 2 Then + ' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero() = 5 Then ' FechaReingreso = TxtFechaReingreso.Text.ToDate ' End If 'End If @@ -1733,25 +1736,25 @@ Partial Class RH_Personal URL = "" If ObjPersonal.AddPersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate, - DdlTipoPeriodo.SelectedValue.ToEntero, TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, - TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero, - TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero, TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), - DdlTipoContrato.SelectedValue.ToEntero, TxtUbicacion.Text.Trim, - DdlTurno.SelectedValue.ToEntero, DdlPuesto.SelectedValue.ToEntero, - DdlDepartamento.SelectedValue.ToEntero, - DdlRuta.SelectedValue.ToEntero, - DdlEscolaridad.SelectedValue.ToEntero, - DdlEstadoCivil.SelectedValue.ToEntero, - DdlGenero.SelectedValue.ToEntero, + DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, + TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(), + TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), + DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim, + DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(), + DdlDepartamento.SelectedValue.ToEntero(), + DdlRuta.SelectedValue.ToEntero(), + DdlEscolaridad.SelectedValue.ToEntero(), + DdlEstadoCivil.SelectedValue.ToEntero(), + DdlGenero.SelectedValue.ToEntero(), -1, "-1", - DdlEstatusPersonal.SelectedValue.ToEntero, TxtFechaNacimiento.Text.ToDate, + DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate, TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim, - DdlEstados.SelectedValue.ToEntero, TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, - TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero, DdlRiesgoPuesto.SelectedValue.ToEntero, DdlRegimenContratacion.SelectedValue.ToEntero, - DdlClienteAsignado.SelectedValue.ToEntero, DdlSubProyectoAsignado.SelectedValue.ToEntero, URL, - DdlSupervisor.SelectedValue.ToEntero, TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero, DdlViaticos.SelectedValue.ToEntero, DdlViaticos.SelectedItem.Text, - DdlPrestamos.SelectedValue.ToEntero, DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero, DdlSubproyectoZona.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero, - TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=ChkSindicalizado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero) Then + DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, + TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(), + DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL, + DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text, + DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), + TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=ChkSindicalizado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero()) Then If Archivo.Exists Then @@ -1772,7 +1775,7 @@ Partial Class RH_Personal If TempDTCuentasBancos.Rows.Count > 0 Then For Each row As DataRow In TempDTCuentasBancos.Rows - If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), "", UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=row("BBVAAlias").ToString()) Then + If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), "", UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero(), CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=row("BBVAAlias").ToString()) Then TieneError = True Exit For End If @@ -1804,27 +1807,27 @@ Partial Class RH_Personal Else 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then If ObjPersonal.UpdatePersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate, - DdlTipoPeriodo.SelectedValue.ToEntero, TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, - TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero, - TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero, TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), - DdlTipoContrato.SelectedValue.ToEntero, TxtUbicacion.Text.Trim, - DdlTurno.SelectedValue.ToEntero, DdlPuesto.SelectedValue.ToEntero, - DdlDepartamento.SelectedValue.ToEntero, - DdlRuta.SelectedValue.ToEntero, - DdlEscolaridad.SelectedValue.ToEntero, - DdlEstadoCivil.SelectedValue.ToEntero, - DdlGenero.SelectedValue.ToEntero, - -1, "-1", - DdlEstatusPersonal.SelectedValue.ToEntero, TxtFechaNacimiento.Text.ToDate, + DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, + TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(), + TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), + DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim, + DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(), + DdlDepartamento.SelectedValue.ToEntero(), + DdlRuta.SelectedValue.ToEntero(), + DdlEscolaridad.SelectedValue.ToEntero(), + DdlEstadoCivil.SelectedValue.ToEntero(), + DdlGenero.SelectedValue.ToEntero(), + DdlMotivoBaja.SelectedValue.ToEntero(), If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"), + DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate, TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim, - DdlEstados.SelectedValue.ToEntero, TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, + DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, - DdlBanco.SelectedValue.ToEntero, DdlRiesgoPuesto.SelectedValue.ToEntero, DdlRegimenContratacion.SelectedValue.ToEntero, - DdlClienteAsignado.SelectedValue.ToEntero, DdlSubProyectoAsignado.SelectedValue.ToEntero, CvePersonal, - URL, DdlSupervisor.SelectedValue.ToEntero, TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero, DdlViaticos.SelectedValue.ToEntero, DdlViaticos.SelectedItem.Text, - DdlPrestamos.SelectedValue.ToEntero, DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero, DdlSubproyectoZona.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero, + DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(), + DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), CvePersonal, + URL, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text, + DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario, - CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), CvePais:=DdlPais.SelectedValue.ToEntero) Then + CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), CvePais:=DdlPais.SelectedValue.ToEntero()) Then 'Funsion usa RH Familiares If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then @@ -1856,7 +1859,7 @@ Partial Class RH_Personal 'GUARDA ORGANIGRAMA If Not TieneError Then - If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero)) Then + If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero() = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero())) Then TieneError = True End If End If @@ -2133,12 +2136,12 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - CvePersonalBuzon = GvRow.DataKey("CvePersonalBuzon").ToEntero + CvePersonalBuzon = GvRow.DataKey("CvePersonalBuzon").ToEntero() CargaBuzonCalidadSeguimiento() DdlClienteBuzon.SelectedValue = GvRow.DataKey("CveCliente") ' DdlClienteBuzon.Enabled = False - If GvRow.DataKey("CveClienteSucursal").ToEntero > 0 Then + If GvRow.DataKey("CveClienteSucursal").ToEntero() > 0 Then CargaClienteSucursal() DdlSucursalClienteBuzon.SelectedValueExist(GvRow.DataKey("CveClienteSucursal")) Else @@ -2151,7 +2154,7 @@ Partial Class RH_Personal DdlTipoBuzonCalidad.SelectedValueExist(GvRow.DataKey("CveTipoBuzon")) ChkSeAtendio.Visible = True - ChkSeAtendio.Checked = If(GvRow.DataKey("SeAtendioChk").ToString().ToEntero = 1, True, False) + ChkSeAtendio.Checked = If(GvRow.DataKey("SeAtendioChk").ToString().ToEntero() = 1, True, False) TxtFechaBuzonCalidad.Text = GvRow.DataKey("FechaQueja").ToDate.ToString("dd/MM/yyyy") TxtBuzonDescriptcion.Text = GvRow.DataKey("Descripcion") @@ -2187,7 +2190,7 @@ Partial Class RH_Personal If ViewState("CvePersonalBuzon") Is Nothing Then Return -1 Else - Return ViewState("CvePersonalBuzon").ToString().ToEntero + Return ViewState("CvePersonalBuzon").ToString().ToEntero() End If End Get Set(value As Integer) @@ -2200,11 +2203,11 @@ Partial Class RH_Personal Dim objRH As New ClsRH If CvePersonalBuzon = -1 Then - objRH.AddBuzonCalidad(CvePersonal, DdlClienteBuzon.SelectedValue.ToEntero, DdlSucursalClienteBuzon.SelectedValue.ToEntero, DdlTipoBuzonCalidad.SelectedValue.ToEntero, TxtFechaBuzonCalidad.Text.ToDate, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario) + objRH.AddBuzonCalidad(CvePersonal, DdlClienteBuzon.SelectedValue.ToEntero(), DdlSucursalClienteBuzon.SelectedValue.ToEntero(), DdlTipoBuzonCalidad.SelectedValue.ToEntero(), TxtFechaBuzonCalidad.Text.ToDate, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario) RegistraScript(" $('#ModalBuzonCalidad').modal('hide')", "HideModalCalidadAgregar") Else - objRH.UpdateBuzonCalidad(CvePersonalBuzon, If(ChkSeAtendio.Checked, 1, 0), DdlClienteBuzon.SelectedValue.ToEntero, DdlSucursalClienteBuzon.SelectedValue.ToEntero, DdlTipoBuzonCalidad.SelectedValue.ToEntero, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.CveUsuario) + objRH.UpdateBuzonCalidad(CvePersonalBuzon, If(ChkSeAtendio.Checked, 1, 0), DdlClienteBuzon.SelectedValue.ToEntero(), DdlSucursalClienteBuzon.SelectedValue.ToEntero(), DdlTipoBuzonCalidad.SelectedValue.ToEntero(), TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.CveUsuario) RegistraScript(" $('#ModalBuzonCalidad').modal('hide')", "HideModalCalidadAgregar") End If CargaBuzonCalidad() @@ -2316,7 +2319,7 @@ Partial Class RH_Personal Dim ObjCliente As New ClsClientes() - If ObjCliente.GetSucursales(DdlClienteBuzon.SelectedValue.ToEntero) Then + If ObjCliente.GetSucursales(DdlClienteBuzon.SelectedValue.ToEntero()) Then DdlSucursalClienteBuzon.DataSource = ObjCliente.DtResultados If ObjCliente.DtResultados.Rows.Count > 0 Then Divsucursalciente.Visible = True @@ -2354,7 +2357,7 @@ Partial Class RH_Personal ' Dim Observaciones As String = DirectCast(GvBuzonCalidad.Rows(e.RowIndex).FindControl("TxtObs"), TextBox).Text.Trim ' Dim SeAtendio As Boolean = GvBuzonCalidad.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked - ' Dim CveBuzonCalidad As Integer = GvBuzonCalidad.DataKeys(e.RowIndex).Value.ToString().ToEntero + ' Dim CveBuzonCalidad As Integer = GvBuzonCalidad.DataKeys(e.RowIndex).Value.ToString().ToEntero() ' If ObjBuzonCalidad.UpdateBuzonCalidad(SeAtendio, Observaciones, CveBuzonCalidad, UsuarioActual.CveUsuario) Then ' GvBuzonCalidad.EditIndex = -1 @@ -2436,7 +2439,7 @@ Partial Class RH_Personal TxtInfoValor.Text = String.Format("{0:###,###.##}", frow("Importe")) DdlInfoTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString()) - Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero + Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero() TxtInfoDescripcion.Text = String.Format("{0}", frow("Descripcion02")) TxtInfoNumCredito.Text = String.Format("{0}", frow("Descripcion01")) TxtInfoFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion")) @@ -2483,7 +2486,7 @@ Partial Class RH_Personal e.Row.Cells(5).Width = Unit.Pixel(160) - If e.Row.DBCampo("Aplica").ToEntero = 1 Then e.Row.FCCheckBox("ChkAplica").Checked = True + If e.Row.DBCampo("Aplica").ToEntero() = 1 Then e.Row.FCCheckBox("ChkAplica").Checked = True If e.Row.DBCampo("Formula") = "S" Then e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(3).Text = "Calculado" @@ -2508,7 +2511,7 @@ Partial Class RH_Personal End If - If e.Row.DBCampo("TipoAplicacion").ToEntero > 5 Then + If e.Row.DBCampo("TipoAplicacion").ToEntero() > 5 Then TipoAplicacion = "2600" End If e.Row.FCDropDownList("DdlTipoAplicacion").SelectedValueExist(TipoAplicacion) @@ -2518,7 +2521,7 @@ Partial Class RH_Personal ' e.Row.FCTextBox("TxtImporte").Visible = False ' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False 'Else - ' Select Case e.Row.DBCampo("TipoAplicacion").ToEntero + ' Select Case e.Row.DBCampo("TipoAplicacion").ToEntero() ' Case 1 ' 'Saldo ' e.Row.FCLiteral("LtlSaldo").Visible = True @@ -2537,7 +2540,7 @@ Partial Class RH_Personal Protected Sub BtnGuardarInfornavit_Click(sender As Object, e As EventArgs) Dim importe As Decimal = TxtInfoValor.Text.ToDecimal() - Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero + Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero() Dim NoPagos As Integer = 0 Dim SaldoIni As Decimal = 0 Dim descripcion02 As String = TxtInfoDescripcion.Text @@ -2569,10 +2572,10 @@ Partial Class RH_Personal Dim OcurrioError As Boolean = False For Each Row As GridViewRow In GVConceptos.Rows If Row.FCCheckBox("ChkAplica").Checked = True Then - Dim CveConcepto As Integer = Row.DataKey("CveConcepto").ToEntero + Dim CveConcepto As Integer = Row.DataKey("CveConcepto").ToEntero() Dim Importe As Double = Row.FCTextBox("TxtImporte").Text.ToDouble - Dim TipoAplicacion As Integer = Row.FCDropDownList("DdlTipoAplicacion").SelectedValue.ToEntero - Dim NoPagos As Integer = If(Row.FCTextBox("TxtNoPagos").Text.ToEntero = 0, -1, Row.FCTextBox("TxtNoPagos").Text.ToEntero) + Dim TipoAplicacion As Integer = Row.FCDropDownList("DdlTipoAplicacion").SelectedValue.ToEntero() + Dim NoPagos As Integer = If(Row.FCTextBox("TxtNoPagos").Text.ToEntero() = 0, -1, Row.FCTextBox("TxtNoPagos").Text.ToEntero()) Dim SaldoIni As Double = If(Row.FCTextBox("TxtSaldoIni").Text.ToDouble = 0, -1, Row.FCTextBox("TxtSaldoIni").Text.ToDouble) Select Case TipoAplicacion @@ -2597,7 +2600,7 @@ Partial Class RH_Personal Else 'Borrarlo If Row.DataKey("CvePersonalConcepto") <> "" Then - If Not ObjPersonal.RemoveConcepto(Row.DataKey("CvePersonalConcepto").ToEntero) Then + If Not ObjPersonal.RemoveConcepto(Row.DataKey("CvePersonalConcepto").ToEntero()) Then OcurrioError = True ObjPersonal.RollBack() Exit For @@ -2623,7 +2626,7 @@ Partial Class RH_Personal Dim gvr As GridViewRow = DirectCast(Ddl.NamingContainer, GridViewRow) - Select Case Ddl.SelectedValue.ToEntero + Select Case Ddl.SelectedValue.ToEntero() Case 1 'Descontar hasta pagar el saldo prestado GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = True @@ -2653,16 +2656,16 @@ Partial Class RH_Personal 'DivFechaReingreso.Visible = False 'DivFechaActivo.Visible = False - 'If DdlEstatusPersonal.SelectedValue.ToEntero.Contiene(1, 2, 5) Then - ' DivFechaActivo.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 1, True, False) - ' 'DivFechaBaja.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 2, True, False) - ' 'DivFechaReingreso.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 5, True, False) - 'Else - ' DivFechaActivo.Visible = False - ' 'DivFechaBaja.Visible = False - ' DivFechaReingreso.Visible = False - 'End If - + If DdlEstatusPersonal.SelectedValue.ToEntero().Contiene(1, 2, 5) Then + 'DivFechaActivo.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero() = 1, True, False) + DivFechaBaja.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero() = 2, True, False) + 'DivFechaReingreso.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero() = 5, True, False) + Else + 'DivFechaActivo.Visible = False + DivFechaBaja.Visible = False + 'DivFechaReingreso.Visible = False + End If + DivMotivoBaja.Visible = DivFechaBaja.Visible End Sub Protected Sub GvNominas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvNominas.RowDataBound @@ -2890,12 +2893,12 @@ Partial Class RH_Personal If e.Row.DBCampo("FechaDocumento") = "" Then e.Row.BackColor = Drawing.Color.LightGray - If e.Row.DBCampo("CveIE").ToEntero > 0 Then + If e.Row.DBCampo("CveIE").ToEntero() > 0 Then e.Row.FCHyperLink("HplRef").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) e.Row.FCLabel("LtlC").CssClass = "label label-sm label-success" e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White End If - If e.Row.DBCampo("CveCompra").ToEntero > 0 Then + If e.Row.DBCampo("CveCompra").ToEntero() > 0 Then e.Row.FCHyperLink("HplRef").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra")) e.Row.FCLabel("LtlC").CssClass = "label label-sm label-warning" e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White @@ -2945,7 +2948,7 @@ Partial Class RH_Personal Protected Sub LbActualizarCuentaBanco_Click(sender As Object, e As EventArgs) Using ObjCuentasBancos As New ClsGenerales Dim nombrebanco As String = DdlBancoSat.SelectedItem.Text - If ObjCuentasBancos.UpdateCuentasDepositosPersonal(CveCuentaDeposito, nombrebanco, TxtNumeroCuenta.Text, TxtCLABECB.Text, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, ChkEstatusPagoE.Checked, ChkEstatuscuenta.Checked, DdlBancoSat.SelectedValue.ToEntero()) Then + If ObjCuentasBancos.UpdateCuentasDepositosPersonal(CveCuentaDeposito, nombrebanco, TxtNumeroCuenta.Text, TxtCLABECB.Text, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, ChkEstatusPagoE.Checked, ChkEstatuscuenta.Checked, DdlBancoSat.SelectedValue.ToEntero()) Then 'UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer) As Boolean Alert("Cuenta actualizada") End If @@ -2974,9 +2977,9 @@ Partial Class RH_Personal 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER If TxtCLABECB.Text.Trim.Length <> 18 AndAlso TxtCLABECB.Text.Trim.Length = 0 AndAlso Not EsBancomer Then - Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18 If TxtCLABECB.Text.Trim.Length <> 0 AndAlso TxtCLABECB.Text.Trim.Length <> 18 Then Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) @@ -2998,7 +3001,7 @@ Partial Class RH_Personal ' Exit Sub 'End If - AgregarCuentaBanco(nombrebanco, "", TxtCLABECB.Text.Trim, "", "", TxtNumeroCuenta.Text.Trim, "", "", DdlMoneda.SelectedValue.ToEntero, DdlMoneda.SelectedItem.Text, "", DdlBancoSat.SelectedValue.ToEntero(), ChkEstatusPagoE.Checked) + AgregarCuentaBanco(nombrebanco, "", TxtCLABECB.Text.Trim, "", "", TxtNumeroCuenta.Text.Trim, "", "", DdlMoneda.SelectedValue.ToEntero(), DdlMoneda.SelectedItem.Text, "", DdlBancoSat.SelectedValue.ToEntero(), ChkEstatusPagoE.Checked) RegistraScript("$('#DivCuentasVancarias').modal('hide');") End Sub Private Sub CargaGridCuentasBancos(Orden As String) @@ -3157,7 +3160,7 @@ Partial Class RH_Personal Dim NumeroCuenta = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim Dim ConvenioCIE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim Dim Referencia = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim - Dim CveMoneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedValue.ToString().ToEntero + Dim CveMoneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedValue.ToString().ToEntero() Dim Estatus = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked Dim EstatusPagoElectronico = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatusPagoE").Checked @@ -3215,14 +3218,14 @@ Partial Class RH_Personal End If Dim ObjCuentasBancos As New ClsGenerales If CvePersonal > 0 Then - If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias, EstatusPagoElectronico:=EstatusPagoElectronico) Then + If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero(), NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias, EstatusPagoElectronico:=EstatusPagoElectronico) Then DTCuentasBancos.Clear() DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal))) Alert("Cuenta actualizada con exito.", TipoMensaje.MsgInformacion) End If Else - Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero - 1 + Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero() - 1 Dim Row As DataRow = TempDTCuentasBancos.Rows(index) Row("BancoNombre") = NombreBanco Row("Sucursal") = NumeroSucursal @@ -3246,14 +3249,14 @@ Partial Class RH_Personal Dim ObjCuentasBancos As New ClsGenerales If CvePersonal > 0 Then - If ObjCuentasBancos.RemoveCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + If ObjCuentasBancos.RemoveCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then DTCuentasBancos.Clear() DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal))) Alert("Cuenta Bancaria borrada con exito.", TipoMensaje.MsgInformacion) End If Else - Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero - 1 + Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero() - 1 TempDTCuentasBancos.Rows.RemoveAt(index) End If @@ -3276,7 +3279,7 @@ Partial Class RH_Personal Arg = CType(sender, LinkButton).CommandArgument().ToString().Split(";"c) Campo = Arg(0) - gvi = Arg(1).ToEntero + gvi = Arg(1).ToEntero() Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) Campo = Campo.Substring(0, Campo.Length - 1) @@ -3317,8 +3320,8 @@ Partial Class RH_Personal Protected Sub LbPDF_Click(sender As Object, e As EventArgs) Dim LB = CType(sender, LinkButton) - ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "recibo") - ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "recibo") + ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero(), UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "recibo") + ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero(), UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "recibo") End Sub @@ -3553,7 +3556,7 @@ Partial Class RH_Personal params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim))) params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text)) - params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero > 0, DdlPuesto.SelectedItem.Text, ""))) + params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero() > 0, DdlPuesto.SelectedItem.Text, ""))) params.Add(New ReportParameter("CURP", TxtCURP.Text)) params.Add(New ReportParameter("NoRegistro", "")) params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text)) @@ -3683,8 +3686,8 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim chkEstatus As CheckBox - CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero - CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString().ToEntero + CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero() + CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString().ToEntero() Documentacion = GvRow.DataKey("Documentacion") AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString() @@ -3711,10 +3714,10 @@ Partial Class RH_Personal For Each dRow As GridViewRow In GvDocumentosFirma.Rows - Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString().ToEntero + Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString().ToEntero() Dim _Adjunto As String = dRow.DataKey("Adjunto") 'Dim _Documentacion As String = dRow.DataKey("Documentacion") - Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero + Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero() Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones") Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite") Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia") @@ -3726,7 +3729,7 @@ Partial Class RH_Personal Dim _FechaVigencia As Date Dim _FechaLimite As Date - Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString().ToEntero + Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString().ToEntero() Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString() = "1", True, False) Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False) @@ -3844,8 +3847,8 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim activo As Boolean = False - Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero - Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero + Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero() + Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero() Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString() Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate @@ -3889,7 +3892,7 @@ Partial Class RH_Personal Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString() Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString() - Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString().ToEntero + Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString().ToEntero() Dim separado As Char() = ".".ToString().ToCharArray Dim array() As String = Adjunto.Split(separado) Dim extencion As String = "" @@ -3897,7 +3900,7 @@ Partial Class RH_Personal Dim TxtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia") ' FechaVigencia - Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString().ToEntero + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString().ToEntero() Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString() = "1", True, False) Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False) @@ -3912,7 +3915,7 @@ Partial Class RH_Personal extencion = array(array.Length - 1) End If - If e.Row.DBCampo("Estatus").ToString().ToEntero = 1 Then + If e.Row.DBCampo("Estatus").ToString().ToEntero() = 1 Then chkEstatus.Checked = True Else chkEstatus.Checked = False @@ -3960,7 +3963,7 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero + Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero() Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato") @@ -4382,7 +4385,7 @@ Partial Class RH_Personal Dim FolioFiscal = CType(sender, LinkButton).CommandArgument.ToString() Dim gvr As GridViewRow = CType(CType(sender, LinkButton).BindingContainer, GridViewRow) - Dim CveNomina As Integer = gvr.DataKey("CveNomina").ToString().ToEntero + Dim CveNomina As Integer = gvr.DataKey("CveNomina").ToString().ToEntero() Dim Total As Decimal = gvr.DataKey("Total").ToString().ToDecimal Dim RFCReceptor As String = gvr.DataKey("RFC").ToString() @@ -4410,7 +4413,7 @@ Partial Class RH_Personal GvVacaciones.DataSource = objRH.DtResultados If objRH.DtResultados.Rows.Count > 0 Then - VacFolioActual = objRH.DtResultados.Compute("Max(Folio)", String.Empty).ToString().ToEntero + VacFolioActual = objRH.DtResultados.Compute("Max(Folio)", String.Empty).ToString().ToEntero() Else VacFolioActual = 0 End If @@ -4476,7 +4479,7 @@ Partial Class RH_Personal For Each GvRow As GridViewRow In GvVacaciones.Rows 'Dim _Estatus As Boolean = Boolean.Parse(GvRow.DataKey("Estatus").ToString()) 'Dim _Documento As String = GvRow.DataKey("Documento") - 'Dim _CveAutoriza As Integer = GvRow.DataKey("CveAutoriza").ToEntero + 'Dim _CveAutoriza As Integer = GvRow.DataKey("CveAutoriza").ToEntero() 'Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento) Dim lnkDescargaFormato As LinkButton = GvRow.FCLinkButton("ImgDescargaFormato") Dim lnkDescargaAutorizacion As LinkButton = GvRow.FCLinkButton("ImgDescargaAutorizacion") @@ -4509,15 +4512,15 @@ Partial Class RH_Personal VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate - VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero - VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero - VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero - VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero - VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero + VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero() + VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero() + VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero() + VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero() + VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero() GvVacacionesResumen.DataSource = objRH.DtResultados VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString() VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString() - VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero + VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero() Else VacInicioPeriodo = Now @@ -4578,7 +4581,7 @@ Partial Class RH_Personal ' Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate ' Dim fFin As Date = TxtFechaFinVac.Text.ToDate ' Dim ErrorSolicitud As Boolean = True - ' Dim DiasSolicitados As Integer = (fFin - fInicio).TotalDays.ToString().ToEntero + ' Dim DiasSolicitados As Integer = (fFin - fInicio).TotalDays.ToString().ToEntero() ' If fInicio < fFin Or fInicio = fFin Then @@ -4689,7 +4692,7 @@ Partial Class RH_Personal ' For x As Integer = 1 To 8 - ' If DdlPermisoTipo.SelectedValue.ToEntero = x Then + ' If DdlPermisoTipo.SelectedValue.ToEntero() = x Then ' ListaTagsDocumentost.Add(New TagsDocumentos("{op" & x & "}", "X")) ' Else ' ListaTagsDocumentost.Add(New TagsDocumentos("{op" & x & "}", "")) @@ -4787,9 +4790,9 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero + CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero() 'ChkEstatusDiaVacacion.Checked = Boolean.Parse(GvRow.DataKey("Estatus")) - VacFolio = GvRow.DataKey("Folio").ToString().ToEntero + VacFolio = GvRow.DataKey("Folio").ToString().ToEntero() TxtFechaDiaVacacion.Text = GvRow.DataKey("FechaInicio").ToString().ToDate.ToString("dd/MM/yyyy") TxtFechaDiaVacacionFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate.ToString("dd/MM/yyyy") @@ -4846,7 +4849,7 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - 'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero + 'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero() 'DescarSolicitudVacaciones(Folio) Dim RutaFormato As String = String.Format("{0}Formatos\SolicitudVacaciones.docx", UsuarioActual.Empresa.Ruta) @@ -4920,7 +4923,7 @@ Partial Class RH_Personal Public Sub DownLoad_ClickSolicitudPermiso(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - 'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero + 'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero() 'DescarSolicitudVacaciones(Folio) Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta) @@ -5009,7 +5012,7 @@ Partial Class RH_Personal objRH.Dispose() objEdoc.Dispose() - _CveDocumentacion = DTVacaciones(0)("CveDocumentacion").ToString().ToEntero + _CveDocumentacion = DTVacaciones(0)("CveDocumentacion").ToString().ToEntero() _DocumentacionFormato = DTVacaciones(0)("DocumentacionFormato").ToString() _PathDocumento = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & _DocumentacionFormato @@ -5165,7 +5168,7 @@ Partial Class RH_Personal 'RutaDocumento = Path.Combine(RutaDocumento, "Empresas\Grales\FormatoDC3.docx") Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim _CveCurso As Integer = GvRow.DataKey("CveCurso").ToEntero + Dim _CveCurso As Integer = GvRow.DataKey("CveCurso").ToEntero() @@ -5219,7 +5222,7 @@ Partial Class RH_Personal If DdlUniforme.SelectedIndex > 0 Then Dim objRH As New ClsRH - If objRH.UniformeDetallePersonalGet(CvePersonal, DdlUniforme.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then + If objRH.UniformeDetallePersonalGet(CvePersonal, DdlUniforme.SelectedValue.ToEntero(), 1, UsuarioActual.CveEmpresa) Then GvUniforme.DataSource = objRH.DtResultados If objRH.DtResultados.Rows.Count > 0 Then @@ -5277,22 +5280,22 @@ Partial Class RH_Personal Dim row As GridViewRow = CType(lb.NamingContainer, GridViewRow) - CveAlmacenUniforme = row.DataKey("CveAlmacen").ToString().ToEntero + CveAlmacenUniforme = row.DataKey("CveAlmacen").ToString().ToEntero() DescripcionUniforme = row.DataKey("CodigoPS") PU = row.DataKey("PU").ToString().ToDecimal - CveSeccionAlmacenUniforme = row.DataKey("CveSeccionAlmacen").ToString().ToEntero - CveUM = row.DataKey("CveUM").ToString().ToEntero - CvePS = row.DataKey("CvePS").ToString().ToEntero - CveMovimientoUniforme = row.DataKey("CveMovimiento").ToString().ToEntero - CveMovimientoDetalleUniforme = row.DataKey("CveMovimientoDetalle").ToString().ToEntero - Dim Cantidad As Integer = row.DataKey("Cantidad").ToString().ToEntero + CveSeccionAlmacenUniforme = row.DataKey("CveSeccionAlmacen").ToString().ToEntero() + CveUM = row.DataKey("CveUM").ToString().ToEntero() + CvePS = row.DataKey("CvePS").ToString().ToEntero() + CveMovimientoUniforme = row.DataKey("CveMovimiento").ToString().ToEntero() + CveMovimientoDetalleUniforme = row.DataKey("CveMovimientoDetalle").ToString().ToEntero() + Dim Cantidad As Integer = row.DataKey("Cantidad").ToString().ToEntero() TxtCantidadResguardo.Text = Cantidad.ToString RvTxtCantidadResguardo.MaximumValue = Cantidad.ToString If row.DataKey("AplicaSeccion").ToString = "True" Then divSeccionAlmacen.Visible = True DdlSeccionAlmacen.Items.Clear() - CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePS, UsuarioActual.CveEmpresa) - DdlSeccionAlmacen.DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePS) + CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), CvePS, UsuarioActual.CveEmpresa) + DdlSeccionAlmacen.DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), CvePS) DdlSeccionAlmacen.DataBind() End If TxtLiberarSerie.Text = "" @@ -5325,10 +5328,10 @@ Partial Class RH_Personal Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble() Dim Serie As String = TxtLiberarSerie.Text.Trim - Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme) + Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme) Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=-3, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) - Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero - Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) + Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero() + Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) If ResultadoDetalleSalida And ResultadoDetalleEntrada Then @@ -5395,7 +5398,7 @@ Partial Class RH_Personal Public Sub CargaPermisos() Dim ObjRH As New ClsRH - Dim CvePersonal As Integer = If(IsNumeric(Request("CvePersonal")), Request("CvePersonal").ToString().ToEntero, -1) + Dim CvePersonal As Integer = If(IsNumeric(Request("CvePersonal")), Request("CvePersonal").ToString().ToEntero(), -1) If ObjRH.ChecadorPermisosGet(-1, "-1", CvePersonal, Now.AddMonths(-3), Now.AddMonths(2), -1, -1, UsuarioActual.CveEmpresa) Then GvPermisos.DataSource = ObjRH.DtResultados Else @@ -5467,7 +5470,7 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - CvePermiso = GvRow.DataKey("CvePermiso").ToString().ToEntero + CvePermiso = GvRow.DataKey("CvePermiso").ToString().ToEntero() TxtPermisoDescripcion.Text = GvRow.DataKey("Descripcion").ToString() TxtFechaInicioPer.Text = GvRow.DataKey("FechaInicio").ToString() TxtFechaFinPer.Text = GvRow.DataKey("FechaFin").ToString() @@ -5509,7 +5512,7 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim ObjRH As New ClsRH - Dim CvePermisoInterno As Integer = GvRow.DataKey("CvePermiso").ToEntero + Dim CvePermisoInterno As Integer = GvRow.DataKey("CvePermiso").ToEntero() If ObjRH.ChecadorPermisosRemove(CvePermisoInterno, UsuarioActual.CveEmpresa) Then End If @@ -5663,7 +5666,7 @@ Partial Class RH_Personal Dim Personal = gvr.DataKey("Nombre").ToString() Dim fechai = gvr.DataKey("FechaInicio").ToString().ToDate.ToShortDateString Dim fechaf = gvr.DataKey("FechaFin").ToString().ToDate.ToShortDateString - Dim cvePeriodo = gvr.DataKey("CvePeriodo").ToString().ToEntero + Dim cvePeriodo = gvr.DataKey("CvePeriodo").ToString().ToEntero() If UsuarioActual.CveRol = 1 Then Alert("Parametros:" + NombreComercial + " " + SerieFolio + " " + Destinatario + " " + Personal + " " + fechai + " " + fechaf) @@ -5750,7 +5753,7 @@ Partial Class RH_Personal Protected Sub LnkViaticoDetalle_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CveSolicitudViatico As Integer = GvRow.DataKey("CveSolicitudViatico").ToEntero + Dim CveSolicitudViatico As Integer = GvRow.DataKey("CveSolicitudViatico").ToEntero() CargaViaticosDetalle(CveSolicitudViatico) RegistraScript("$('#DivViaticoDetalle').modal({ backdrop: 'static', keyboard: false});") End Sub @@ -5881,14 +5884,14 @@ Partial Class RH_Personal If CvePersonal > 0 Then Dim ObjAF As New ClsAF() - If ObjAF.RemoveLicencia(HdnIDLicencia.Value.ToEntero) Then + If ObjAF.RemoveLicencia(HdnIDLicencia.Value.ToEntero()) Then CargaLicencias() Alert("La licencia se eliminó correctamente.", TipoMensaje.MsgInformacion) End If ObjAF.Dispose() Else If DTLicencias IsNot Nothing Then - Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero}")(0) + Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero()}")(0) DTLicencias.Rows.Remove(Row) GvLicencias.DataSource = DTLicencias GvLicencias.DataBind() @@ -5924,7 +5927,7 @@ Partial Class RH_Personal Alert("La licencia se agregó correctamente.", TipoMensaje.MsgInformacion) End If ElseIf HdnModalidadLicencia.Value = "U" Then - If ObjAF.UpdateLicencia(HdnIDLicencia.Value.ToEntero, TxtLicencia.Text.Trim, TxtFechaExpLicencia.Text.ToDateTime, TxtFechaVencLicencia.Text.ToDateTime, Estatus:=ChkModalLicenciaEstatus.Checked) Then + If ObjAF.UpdateLicencia(HdnIDLicencia.Value.ToEntero(), TxtLicencia.Text.Trim, TxtFechaExpLicencia.Text.ToDateTime, TxtFechaVencLicencia.Text.ToDateTime, Estatus:=ChkModalLicenciaEstatus.Checked) Then Alert("La licencia se actualizó correctamente.", TipoMensaje.MsgInformacion) End If End If @@ -5950,7 +5953,7 @@ Partial Class RH_Personal Alert("La licencia se agregó correctamente.", TipoMensaje.MsgInformacion) ElseIf HdnModalidadLicencia.Value = "U" Then Try - Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero}")(0) + Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero()}")(0) Row("Licencia") = TxtLicencia.Text.Trim() Row("FechaExpedicion") = TxtFechaExpLicencia.Text.ToDateTime() @@ -6005,17 +6008,17 @@ Partial Class RH_Personal 'End If Dim SBDomicilioSucursal As New StringBuilder() - Dim DRSucursal = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, CveSubProyecto:=dr("CveSubProyecto").ToString().ToEntero, Estatus:=1).FiltroPrimero("") + Dim DRSucursal = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, CveSubProyecto:=dr("CveSubProyecto").ToString().ToEntero(), Estatus:=1).FiltroPrimero("") If DRSucursal IsNot Nothing Then Dim CiudadSucursal As String = String.Format("{0},{1}", DRSucursal("Municipio"), DRSucursal("Estado")) Dim DomicilioSucursal As String = "" SBDomicilioSucursal.AppendFormat("{0}", DRSucursal("Calle")) - If DRSucursal("NoExt").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", DRSucursal("NoExt").ToString().ToEntero) - If DRSucursal("NoInt").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", DRSucursal("NoInt").ToString().ToEntero) + If DRSucursal("NoExt").ToString().ToEntero() > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", DRSucursal("NoExt").ToString().ToEntero()) + If DRSucursal("NoInt").ToString().ToEntero() > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", DRSucursal("NoInt").ToString().ToEntero()) If DRSucursal("Colonia").ToString().Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", DRSucursal("Colonia").ToString()) - If DRSucursal("CP").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", DRSucursal("CP").ToString()) + If DRSucursal("CP").ToString().ToEntero() > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", DRSucursal("CP").ToString()) If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal) If DRSucursal("Pais").ToString().Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", DRSucursal("Pais").ToString()) End If @@ -6140,10 +6143,10 @@ Partial Class RH_Personal 'DtRowFamiliar("CveFamiliar") = -1 DTFamiliares(IndexActual)("CvePersonal") = -1 DTFamiliares(IndexActual)("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text - DTFamiliares(IndexActual)("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero + DTFamiliares(IndexActual)("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero() DTFamiliares(IndexActual)("Nombre") = TxtNombreFamiliar4.Text.Trim DTFamiliares(IndexActual)("Domicilio") = TxtDomicilioFamiliar4.Text.Trim - DTFamiliares(IndexActual)("Edad") = TxtEdadFamiliar4.Text.ToEntero + DTFamiliares(IndexActual)("Edad") = TxtEdadFamiliar4.Text.ToEntero() DTFamiliares(IndexActual)("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim DTFamiliares(IndexActual)("Telefono") = TxtTelefonoFamiliar.Text.Trim DTFamiliares(IndexActual)("Observaciones") = TxtObservacionesFamiliar.Text.Trim @@ -6165,10 +6168,10 @@ Partial Class RH_Personal DtRowFamiliar("CveFamiliar") = -1 DtRowFamiliar("CvePersonal") = -1 DtRowFamiliar("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text - DtRowFamiliar("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero + DtRowFamiliar("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero() DtRowFamiliar("Nombre") = TxtNombreFamiliar4.Text.Trim DtRowFamiliar("Domicilio") = TxtDomicilioFamiliar4.Text.Trim - DtRowFamiliar("Edad") = TxtEdadFamiliar4.Text.ToEntero + DtRowFamiliar("Edad") = TxtEdadFamiliar4.Text.ToEntero() DtRowFamiliar("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim DtRowFamiliar("Telefono") = TxtTelefonoFamiliar.Text.Trim DtRowFamiliar("Observaciones") = TxtObservacionesFamiliar.Text.Trim @@ -6200,7 +6203,7 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim activo As Boolean = True - CveFamiliar = GvRow.DataKey("CveFamiliar").ToString().ToEntero + CveFamiliar = GvRow.DataKey("CveFamiliar").ToString().ToEntero() ActualizarFamiliar = True IndexActual = GvRow.RowIndex @@ -6229,7 +6232,7 @@ Partial Class RH_Personal Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) IndexActual = GvRow.RowIndex Dim activo As Boolean = False - Dim CveFamiliar As Integer = GvRow.DataKey("CveFamiliar").ToString().ToEntero + Dim CveFamiliar As Integer = GvRow.DataKey("CveFamiliar").ToString().ToEntero() If CveFamiliar > 0 Then @@ -6275,7 +6278,7 @@ Partial Class RH_Personal End If - objRH.PersonalFamiliaresUpdate(dRow("CveFamiliar").ToString().ToEntero, CvePersonal, dRow("CveParentesco").ToString().ToEntero, dRow("Nombre").ToString(), dRow("Domicilio").ToString(), dRow("Edad").ToString().ToEntero, dRow("Ocupacion").ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString(), If(dRow("Observaciones").ToString().Trim = "", "-1", dRow("Observaciones").ToString().Trim), Beneficiario) + objRH.PersonalFamiliaresUpdate(dRow("CveFamiliar").ToString().ToEntero(), CvePersonal, dRow("CveParentesco").ToString().ToEntero(), dRow("Nombre").ToString(), dRow("Domicilio").ToString(), dRow("Edad").ToString().ToEntero(), dRow("Ocupacion").ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString(), If(dRow("Observaciones").ToString().Trim = "", "-1", dRow("Observaciones").ToString().Trim), Beneficiario) End If If dRow("Accion").ToString() = "2" Then 'Inserta @@ -6285,20 +6288,20 @@ Partial Class RH_Personal - objRH.PersonalFamiliaresAdd(CvePersonal, dRow("CveParentesco").ToString().ToEntero, dRow("Nombre").ToString(), dRow("Domicilio").ToString(), dRow("Edad").ToString().ToEntero, dRow("Ocupacion").ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString(), If(dRow("Observaciones").ToString().Trim = "", "-1", dRow("Observaciones").ToString().Trim), Beneficiario) + objRH.PersonalFamiliaresAdd(CvePersonal, dRow("CveParentesco").ToString().ToEntero(), dRow("Nombre").ToString(), dRow("Domicilio").ToString(), dRow("Edad").ToString().ToEntero(), dRow("Ocupacion").ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString(), If(dRow("Observaciones").ToString().Trim = "", "-1", dRow("Observaciones").ToString().Trim), Beneficiario) End If - If dRow("CveParentesco").ToString().ToEntero = 1 Then + If dRow("CveParentesco").ToString().ToEntero() = 1 Then ValPadre = True End If - If dRow("CveParentesco").ToString().ToEntero = 2 Then + If dRow("CveParentesco").ToString().ToEntero() = 2 Then ValMadre = True End If If dRow("Accion").ToString() = "3" Then 'Borra - objRH.PersonalFamiliaresRemove(dRow("CveFamiliar").ToString().ToEntero, -1) + objRH.PersonalFamiliaresRemove(dRow("CveFamiliar").ToString().ToEntero(), -1) End If Next diff --git a/vwd.webinfo b/vwd.webinfo index 22ce5468d..567b3c80f 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -300,6 +300,12 @@ + + + + + + From d8b22cc73288a68cfa702ca526a8a2a77c2fa869 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Tue, 24 Aug 2021 07:51:47 -0700 Subject: [PATCH 2/9] --- OC/OC.aspx.vb | 8 ++++---- RH/CatPersonal.aspx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 71d1df391..8ebe5351e 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -813,7 +813,7 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then DVCultivosCuadro.Visible = True DdlSubProyecto.AutoPostBack = True - DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus =1") DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -3812,7 +3812,7 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then 'empresa agricola e.Row.FCDropDownList("DdlCultivosCuadroEdit").Visible = True - e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto").ToEntero}") + e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto").ToEntero()} AND Estatus =1") e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataBind() e.Row.FCDropDownList("DdlCultivosCuadroEdit").Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -6954,7 +6954,7 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then DdlCultivosCuadro.Items.Clear() - DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus =1") DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -8530,7 +8530,7 @@ Partial Class OC Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToString.ToEntero DdlCultivosCuadroEdit.Items.Clear() - DdlCultivosCuadroEdit.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoEdit.SelectedValue}") + DdlCultivosCuadroEdit.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoEdit.SelectedValue} AND Estatus =1") DdlCultivosCuadroEdit.DataBind() DdlCultivosCuadroEdit.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlCultivosCuadroEdit.SelectedValueExist(CveCultivoCuadroDetalle) diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx index 656147974..9ee8ec049 100644 --- a/RH/CatPersonal.aspx +++ b/RH/CatPersonal.aspx @@ -894,7 +894,6 @@
-
@@ -913,6 +912,7 @@
+
From 21ef7fa334881166ba86c8c887eade04ff4f2316 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 24 Aug 2021 19:50:06 -0700 Subject: [PATCH 3/9] Generacion automatica de PDF de traslado --- Compras/PopUpVerFactura.aspx.vb | 389 +++++++++++++++++--------------- 1 file changed, 208 insertions(+), 181 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 8ebb9c854..53ad84d4f 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -907,213 +907,240 @@ Partial Class PopUpVerFactura Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, Parametros("EXT").ToString, Parametros("TIPODOCTO").ToString, Parametros("FOLIO").ToString, Exten) Dim Archivo As New System.IO.FileInfo(Path) - If Archivo.Exists Then - HttpContext.Current.Response.Clear() - HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf") - HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) - HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) - HttpContext.Current.Response.TransmitFile(Path) - 'HttpContext.Current.Response.Flush() - HttpContext.Current.Response.End() + If Archivo.Exists Then + DescargarArchivoPDFTraslado(Archivo, Path) Else - + If Exten = "pdf" Then + GeneraPDFFactura(Parametros("CVEMOVIMIENTO").ToString.ToEntero) + Archivo = New System.IO.FileInfo(Path) + If Archivo.Exists Then + DescargarArchivoPDFTraslado(Archivo, Path) + End If + End If End If Archivo = Nothing End If End Sub + Private Sub DescargarArchivoPDFTraslado(Archivo As System.IO.FileInfo, path As String) + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf") + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(path) + 'HttpContext.Current.Response.Flush() + HttpContext.Current.Response.End() + End Sub - 'Protected Sub LnkGenerarPDF_Click(sender As Object, e As EventArgs) - ' GeneraPDFFactura() - 'End Sub - 'Private Sub GeneraPDFFactura() - ' Try - ' Dim objFactura = CreaObjetosVenta() - ' PdfFactura(objFactura) - ' objFactura.Dispose() - ' Catch ex As Exception - ' OnError("Ocurrió un error al generar el PDF", ex) - ' End Try - 'End Sub + Private Sub GeneraPDFFactura(CveMovimiento As Integer) + Try + Dim objFactura = CreaObjetosTraslado(CveMovimiento) + If objFactura IsNot Nothing Then + PdfFactura(objFactura) + objFactura.Dispose() + End If + Catch ex As Exception + OnError("Ocurrió un error al generar el PDF", ex) + End Try + End Sub - 'Private Function CreaObjetosTraslado() As Modelos.Factura - ' Dim ObjFactura = New Modelos.Factura - ' ObjFactura.Version = "3.3" - ' ObjFactura.CveUsuario = UsuarioActual.CveUsuario - ' ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa - ' ObjFactura.TipoCambio = 0 - ' ObjFactura.ConvertirPesos = False - ' ObjFactura.TipoCambio = 0 - ' ObjFactura.CveMoneda = 1 - ' ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ") - ' ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1") - ' ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ") - ' ObjFactura.TipoDocto = "Tra" - ' ObjFactura.RefDocto = "" - ' ObjFactura.Folio = Folio.ToEntero - ' ObjFactura.Serie = "Tra" - ' ObjFactura.CveMesa = -1 - ' ObjFactura.Fecha = Now - ' ObjFactura.CvePrePoliza = -1 - ' ObjFactura.FechaPago = Now - ' ObjFactura.MotivoDescuento = "" - ' ObjFactura.Observaciones = "" - ' ObjFactura.FechaEjecucion = Now - ' ObjFactura.UsuarioCreo = UsuarioActual.Usuario - ' ObjFactura.CveCondicionEntrega = -1 - ' ObjFactura.CondicionEntrega = "" - ' ObjFactura.NumeroCuenta = "" - ' ObjFactura.CondicionesPago = 0 - ' ObjFactura.FormaPago = 0 - ' ObjFactura.PedidoContrato = "" - ' ObjFactura.OrdenCompra = "" - ' ObjFactura.NumeroContrato = "" - ' ObjFactura.NumeroDescripcionContrato = "" - ' ObjFactura.DescripcionContrato = "" - ' ObjFactura.CveCorte = -1 - ' ObjFactura.TipoDocumento = "Traspaso" - ' ObjFactura.Alfa1 = "" - ' ObjFactura.Alfa2 = "" - ' ObjFactura.Alfa3 = "" - ' ObjFactura.Descuento = 0 - ' ObjFactura.Amortizacion = 0 - ' ObjFactura.CveContrato = 0 - ' ObjFactura.CveVendedor = 0 - ' ObjFactura.FechaVencimiento = Now - ' ObjFactura.TipoEstatus = 0 - ' ObjFactura.Det_OrdenCompra = "" - ' ObjFactura.Inv_CveEstatusEntrega = 0 - ' ObjFactura.FormaPago33 = "" - ' ObjFactura.MetodoPago33 = "" - ' ObjFactura.UsoCFDI = "" - ' ObjFactura.CveClienteSucursal = 0 - ' Dim CveSubProyecto As Integer = -1 - ' If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows.Count > 0 Then - ' CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero - ' End If - ' ObjFactura.CveSubProyecto = CveSubProyecto - ' ObjFactura.CveSubProyectoCobranza = CveSubProyecto - ' ObjFactura.CveSubProyectoEjecucion = CveSubProyecto + Private Function CreaObjetosTraslado(CveMovimiento As Integer) As Modelos.Factura + Dim Folio As Integer = -1 + Dim CveAlmacen As Integer = 0 + Dim DtDetalle As DataTable = Nothing - ' ObjFactura.SubTotal = 0 - ' ObjFactura.Descuento = 0 - ' ObjFactura.Amortizacion = 0 - ' ObjFactura.IVA = 0 - ' ObjFactura.RetIVA = 0 - ' ObjFactura.RetISR = 0 - ' ObjFactura.IEPS = 0 - ' ObjFactura.Total = 0 - ' ObjFactura.RFCReceptor = "XAXX010101000" + Using ObjMovimientos As New ClsInventarios + If ObjMovimientos.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjMovimientos.DtResultados.Rows.Count = 1 Then + Folio = ObjMovimientos.Folio + CveAlmacen = ObjMovimientos.CveAlmacen + End If - ' Dim dt As DataTable = DtMovimientos.Copy + If ObjMovimientos.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + DtDetalle = ObjMovimientos.DtResultados.Copy + End If + End Using - ' dt.Columns.Add("TotalImporte", Type.GetType("System.Double")) - ' dt.Columns.Add("Descuento", Type.GetType("System.Double")) - ' dt.Columns.Add("UM") - ' dt.Columns.Add("SATClaveUM") - ' dt.Columns.Add("SATClaveProdServ") - ' dt.Columns.Add("Noidentificacion") - ' dt.Columns.Add("CuentaPredial") - ' dt.Columns.Add("Obs") - ' dt.Columns.Add("ImporteIVA", Type.GetType("System.Double")) - ' dt.Columns.Add("PorcentajeIVA", Type.GetType("System.Double")) + If Folio > 0 AndAlso DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then + Dim ObjFactura = New Modelos.Factura + ObjFactura.Version = "3.3" + ObjFactura.CveUsuario = UsuarioActual.CveUsuario + ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa + ObjFactura.TipoCambio = 0 + ObjFactura.ConvertirPesos = False + ObjFactura.TipoCambio = 0 + ObjFactura.CveMoneda = 1 + ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ") + ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1") + ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ") + ObjFactura.TipoDocto = "Tra" + ObjFactura.RefDocto = "" + ObjFactura.Folio = Folio + ObjFactura.Serie = "Tra" + ObjFactura.CveMesa = -1 + ObjFactura.Fecha = Now + ObjFactura.CvePrePoliza = -1 + ObjFactura.FechaPago = Now + ObjFactura.MotivoDescuento = "" + ObjFactura.Observaciones = "" + ObjFactura.FechaEjecucion = Now + ObjFactura.UsuarioCreo = UsuarioActual.Usuario + ObjFactura.CveCondicionEntrega = -1 + ObjFactura.CondicionEntrega = "" + ObjFactura.NumeroCuenta = "" + ObjFactura.CondicionesPago = 0 + ObjFactura.FormaPago = 0 + ObjFactura.PedidoContrato = "" + ObjFactura.OrdenCompra = "" + ObjFactura.NumeroContrato = "" + ObjFactura.NumeroDescripcionContrato = "" + ObjFactura.DescripcionContrato = "" + ObjFactura.CveCorte = -1 + ObjFactura.TipoDocumento = "Traspaso" + ObjFactura.Alfa1 = "" + ObjFactura.Alfa2 = "" + ObjFactura.Alfa3 = "" + ObjFactura.Descuento = 0 + ObjFactura.Amortizacion = 0 + ObjFactura.CveContrato = 0 + ObjFactura.CveVendedor = 0 + ObjFactura.FechaVencimiento = Now + ObjFactura.TipoEstatus = 0 + ObjFactura.Det_OrdenCompra = "" + ObjFactura.Inv_CveEstatusEntrega = 0 + ObjFactura.FormaPago33 = "" + ObjFactura.MetodoPago33 = "" + ObjFactura.UsoCFDI = "" + ObjFactura.CveClienteSucursal = 0 + Dim CveSubProyecto As Integer = -1 + If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {CveAlmacen}").Rows.Count > 0 Then + CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {CveAlmacen}").Rows(0)("CveSubProyecto").ToString.ToEntero + End If + ObjFactura.CveSubProyecto = CveSubProyecto + ObjFactura.CveSubProyectoCobranza = CveSubProyecto + ObjFactura.CveSubProyectoEjecucion = CveSubProyecto + + ObjFactura.SubTotal = 0 + ObjFactura.Descuento = 0 + ObjFactura.Amortizacion = 0 + ObjFactura.IVA = 0 + ObjFactura.RetIVA = 0 + ObjFactura.RetISR = 0 + ObjFactura.IEPS = 0 + ObjFactura.Total = 0 + ObjFactura.RFCReceptor = "XAXX010101000" - ' For Each Row As DataRow In dt.Rows - ' Row("TotalImporte") = Row("Total") - ' Row("Descuento") = 0 - ' Row("UM") = Row("UnidadMedida") - ' Row("SATClaveUM") = Row("SATClaveUnidadMedida") - ' Row("SATClaveProdServ") = Row("SATClavePS") - ' Row("Noidentificacion") = Row("Codigo") - ' Row("CuentaPredial") = "" - ' Row("Obs") = Row("Observaciones") - ' Row("ImporteIVA") = 0 - ' Row("PorcentajeIVA") = 0 - ' Next - ' 'DETALLES - ' ObjFactura.DtDetalle = dt + DtDetalle.Columns.Add("TotalImporte", Type.GetType("System.Double")) + DtDetalle.Columns.Add("Descuento", Type.GetType("System.Double")) + DtDetalle.Columns.Add("UM") + DtDetalle.Columns.Add("SATClaveUM") + DtDetalle.Columns.Add("SATClaveProdServ") + DtDetalle.Columns.Add("Noidentificacion") + DtDetalle.Columns.Add("CuentaPredial") + DtDetalle.Columns.Add("Obs") + DtDetalle.Columns.Add("ImporteIVA", Type.GetType("System.Double")) + DtDetalle.Columns.Add("PorcentajeIVA", Type.GetType("System.Double")) - ' 'SUBPROYECTO - ' ObjFactura.SetSubProyectoMatriz(Me) - ' ObjFactura.SetSubProyecto(Me) - ' ObjFactura.Inv_CveMovimiento = Me.CveMovimiento + For Each Row As DataRow In DtDetalle.Rows + Row("TotalImporte") = Row("Total") + Row("Descuento") = 0 + Row("UM") = Row("UnidadMedida") + Row("SATClaveUM") = Row("SATClaveUnidadMedida") + Row("SATClaveProdServ") = Row("SATClavePS") + Row("Noidentificacion") = Row("Codigo") + Row("CuentaPredial") = "" + Row("Obs") = Row("Observaciones") + Row("ImporteIVA") = 0 + Row("PorcentajeIVA") = 0 + Next - ' ObjFactura.Timbre = PreParaTimbreTraslado(ObjFactura) + 'DETALLES + ObjFactura.DtDetalle = DtDetalle - ' Return ObjFactura - 'End Function - 'Private Function PreParaTimbreTraslado(Obj As Modelos.Factura) As CFDITimbre - ' Dim Timbre As New CFDITimbre - ' Timbre.Comprobante.TipoComprobante = "T" - ' Timbre.Comprobante.Folio = Obj.Folio.ToString - ' Timbre.Comprobante.Serie = Obj.Serie - ' Timbre.Comprobante.Fecha = Obj.Fecha - ' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 - ' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 - ' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT - ' Timbre.Comprobante.Subtotal = Obj.SubTotal - ' Timbre.Comprobante.Descuentos = Obj.Descuento - ' Timbre.Comprobante.Moneda = Obj.MonedaSAT - ' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString) - ' Timbre.Comprobante.Total = Obj.Total + 'SUBPROYECTO + ObjFactura.SetSubProyectoMatriz(Me) + ObjFactura.SetSubProyecto(Me) - ' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP - ' Timbre.Comprobante.Confirmacion = "" + ObjFactura.Inv_CveMovimiento = CveMovimiento - ' Timbre.Receptor.RFC = "XAXX010101000" - ' Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa - ' Timbre.Receptor.UsoCFDI = "P01" + ObjFactura.Timbre = PreParaTimbreTraslado(ObjFactura) + Return ObjFactura + End If - ' Dim totSubTotal As Decimal = Obj.SubTotal - ' Dim totIVA As Decimal = Obj.IVA - ' Dim totRetIVA As Decimal = Obj.RetIVA - ' Dim totRetISR As Decimal = Obj.RetISR - ' Dim i As Integer = 1 + Return Nothing - ' 'DETALLES - ' Dim tPS As String = "" + End Function + Private Function PreParaTimbreTraslado(Obj As Modelos.Factura) As CFDITimbre + Dim Timbre As New CFDITimbre + Timbre.Comprobante.TipoComprobante = "T" + Timbre.Comprobante.Folio = Obj.Folio.ToString + Timbre.Comprobante.Serie = Obj.Serie + Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 + Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 + Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT + Timbre.Comprobante.Subtotal = Obj.SubTotal + Timbre.Comprobante.Descuentos = Obj.Descuento + Timbre.Comprobante.Moneda = Obj.MonedaSAT + Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString) + Timbre.Comprobante.Total = Obj.Total - ' For Each drr As DataRow In Obj.DtDetalle.Rows - ' If drr("PS").ToString.Length = 1 Then - ' tPS = drr("Obs").ToString - ' Else - ' If drr("PS").ToString.Length = 0 Then - ' tPS = "" - ' Else - ' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) - ' End If - ' End If + Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP + Timbre.Comprobante.Confirmacion = "" - ' 'CONDICIONANTE, ESPECIAL - ' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO + Timbre.Receptor.RFC = "XAXX010101000" + Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa + Timbre.Receptor.UsoCFDI = "P01" - ' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal, - ' .Descripcion = tPS, - ' .ValorUnitario = drr("PU").ToString.ToDecimal, - ' .Importe = drr("TotalImporte").ToString.ToDecimal, - ' .Descuento = drr("Descuento").ToString.ToDecimal, - ' .Unidad = drr("UM").ToString, - ' .ClaveUnidad = drr("SATClaveUM").ToString, - ' .ClaveProdServ = drr("SATClaveProdServ").ToString, - ' .Noidentificacion = drr("Noidentificacion").ToString, - ' .CuentaPredial = drr("CuentaPredial").ToString} - ' 'VERIFICA SUMA SUBTOTALES - ' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES - ' concepto.Importe = totSubTotalW - ' End If - ' totSubTotal = totSubTotal - concepto.Importe + Dim totSubTotal As Decimal = Obj.SubTotal + Dim totIVA As Decimal = Obj.IVA + Dim totRetIVA As Decimal = Obj.RetIVA + Dim totRetISR As Decimal = Obj.RetISR + Dim i As Integer = 1 - ' 'SIEMPRE ESTAMOS AGREGANDO EL IVA - ' 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal}) + 'DETALLES + Dim tPS As String = "" - ' Timbre.Conceptos.Add(concepto) - ' i += 1 - ' Next - ' Return Timbre - 'End Function + For Each drr As DataRow In Obj.DtDetalle.Rows + If drr("PS").ToString.Length = 1 Then + tPS = drr("Obs").ToString + Else + If drr("PS").ToString.Length = 0 Then + tPS = "" + Else + tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) + End If + End If + + 'CONDICIONANTE, ESPECIAL + If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO + + Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal, + .Descripcion = tPS, + .ValorUnitario = drr("PU").ToString.ToDecimal, + .Importe = drr("TotalImporte").ToString.ToDecimal, + .Descuento = drr("Descuento").ToString.ToDecimal, + .Unidad = drr("UM").ToString, + .ClaveUnidad = drr("SATClaveUM").ToString, + .ClaveProdServ = drr("SATClaveProdServ").ToString, + .Noidentificacion = drr("Noidentificacion").ToString, + .CuentaPredial = drr("CuentaPredial").ToString} + 'VERIFICA SUMA SUBTOTALES + If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES + concepto.Importe = totSubTotal + End If + totSubTotal = totSubTotal - concepto.Importe + + 'SIEMPRE ESTAMOS AGREGANDO EL IVA + 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal}) + + Timbre.Conceptos.Add(concepto) + i += 1 + Next + Return Timbre + End Function #End Region From 4b446ee4df58e3dda60a755261364200b1a6eeba Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 24 Aug 2021 19:50:46 -0700 Subject: [PATCH 4/9] Correcion en validacion de facturacion de remisiones --- Ventas/Ventas.aspx.vb | 114 +++++++++++++++++++++++++----------------- 1 file changed, 67 insertions(+), 47 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index e0de4aa79..cb4716e0e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -11600,7 +11600,7 @@ Partial Class Ventas 'INVENTARIOS If ErrorList.Count = 0 Then If Not EsNCAmortizacion AndAlso Not NCDescuento Then - If GuardarVentaInventarios(ObjInventario, ObjConta, factura) Then + If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura) Then ErrorList.Add("Ocurrio un error al Guardar Inventario") End If End If @@ -13230,7 +13230,7 @@ Partial Class Ventas End Try End Function - Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, factura As Modelos.Factura) As Boolean + Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura) As Boolean Dim OcurrioError As Boolean = False Try @@ -13239,7 +13239,7 @@ Partial Class Ventas If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then For Each CveRemision As Integer In RemisionesLista 'El almacen general es el Primer Almacen de Material en la Sucursal - If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then + If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9) Then OcurrioError = True Exit For End If @@ -18665,7 +18665,7 @@ Partial Class Ventas gvr.FCDropDownList("DdlUnidadMedida").DataBind() End Sub - Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean + Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean Dim OcurrioError As Boolean = False Try Dim DtMovimientos As DataTable @@ -18747,9 +18747,9 @@ Partial Class Ventas MovDetalle = DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}") Else If TieneMovimientosContrato Then - MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}")) + MovDetalle = CuadrarFacturaMovimientos(ObjVentas, CveRemision, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}")) Else - MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)")) + MovDetalle = CuadrarFacturaMovimientos(ObjVentas, CveRemision, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)")) End If End If @@ -18761,26 +18761,12 @@ Partial Class Ventas Dim CveMovimientoSalidaPorTraspaso As Integer = -1 Dim CveConceptoSalidaAlmacen As Integer = 3 Dim CveAlmacenParaSalida As Integer = CveAlmacenEntrada + 'SALIDA DEFINITIVA DEL SISTEMA If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then CveConceptoSalidaAlmacen = 40 CveAlmacenParaSalida = CveAlmacenSalida AplicaMovimientoDetalleEntrada = True - ''Le damos salida normal - 'If ConSalida Then - ' GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveVenta, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0 - - ' If Not GeneroMovimientoAlmacen Then - ' OcurrioError = True - ' Exit For - ' End If - - ' If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then - ' If Not GeneroMovimientoAlmacen Then - ' OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura) - ' End If - ' End If - 'End If Else 'Le damos salida de apartado por traspaso CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada) @@ -18820,19 +18806,10 @@ Partial Class Ventas End If End If - - Else - OcurrioError = True - Alert("Error traspaso almacen(sin Movtos. Detalle). Por favor comuniquese con atención SIG.", TipoMensaje.ToastError) End If MovDetalle.Dispose() - 'VERIFICA QUE SE HAYA GENERADO MOVIMIENTO DE ALMACEN - If Not OcurrioError Then - OcurrioError = Not GeneroMovimientoAlmacen - End If - If OcurrioError Then Exit For End If @@ -18841,12 +18818,6 @@ Partial Class Ventas End If - ElseIf ObjInventario.GetMovimientos(dr("CveMovimiento").ToString().ToEntero(), 3, -1, UsuarioActual.CveEmpresa) Then - 'Esquema viejo, evitamos que aparezca por surtir - If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then - OcurrioError = True - Exit For - End If End If If OcurrioError Then @@ -18854,6 +18825,24 @@ Partial Class Ventas End If Next + 'VERIFICA QUE SE HAYA GENERADO MOVIMIENTO DE ALMACEN + If Not OcurrioError Then + OcurrioError = Not GeneroMovimientoAlmacen + End If + + 'VERIFICA SI YA SE GENERARON LAS SALIDAS DE ALMACEN NECESARIAS + If Not OcurrioError AndAlso RemisionesLista.Count > 0 AndAlso DtRemConceptosSurtidos IsNot Nothing Then + If DtRemConceptosSurtidos.SUMD("Surtido") <> DtRemConceptosSurtidos.SUMD("Cantidad") Then + OcurrioError = True + End If + End If + + If Not OcurrioError AndAlso ConSalida Then + 'Esquema viejo, evitamos que aparezca por surtir + If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then + OcurrioError = True + End If + End If End If @@ -18862,31 +18851,59 @@ Partial Class Ventas OcurrioError = True End If + 'LIMPIAR EL DT DE CONCEPTOS SURTIDOS + If DtRemConceptosSurtidos IsNot Nothing Then + DtRemConceptosSurtidos.Clear() + DtRemConceptosSurtidos = Nothing + End If + Catch ex As Exception OcurrioError = True OnError("Ocurrió un error al realizar el traspaso", ex) End Try Return Not OcurrioError End Function - Private Function CuadrarFacturaMovimientos(MovDetalle As DataTable) As DataTable + Private Function CuadrarFacturaMovimientos(ByRef ObjVentas As ClsVentas, CveRemision As Integer, MovDetalle As DataTable) As DataTable Dim MovDTCuadrados As New DataTable MovDTCuadrados = MovDetalle.Clone MovDTCuadrados.Clear() 'Llenamos el DT solo si es primera llamada If DtRemConceptosSurtidos Is Nothing Then - DtRemConceptosSurtidos = New DataTable - DtRemConceptosSurtidos.Columns.Add("CveVentaDetalle", GetType(Integer)) - DtRemConceptosSurtidos.Columns.Add("Cantidad", GetType(Decimal)) - DtRemConceptosSurtidos.Columns.Add("Surtido", GetType(Decimal)) + Dim DtDetalleRemision As DataTable = Nothing + Dim StrCveVentasDetalle As New StringBuilder() - For Each dr As DataRow In DtRemisionesTmpDT.Rows - Dim dtr As DataRow = DtRemConceptosSurtidos.NewRow - dtr("CveVentaDetalle") = dr("CveVentaDetalle") - dtr("Cantidad") = dr("Cantidad") - dtr("Surtido") = 0 - DtRemConceptosSurtidos.Rows.Add(dtr) + If ObjVentas.GetVentaDetalle(CveRemision) Then + DtDetalleRemision = ObjVentas.DtResultados.FiltraParametros("", DistinctColumns:={"CveVenta", "CveVentaDetalle"}) + End If + + For Each RowDetalle As DataRow In DtDetalleRemision.Rows + StrCveVentasDetalle.AppendFormat("{0},", RowDetalle("CveVentaDetalle")) Next + + If StrCveVentasDetalle.Length > 0 Then + StrCveVentasDetalle.Remove(StrCveVentasDetalle.Length - 1, 1) + End If + + If DtDetalleRemision IsNot Nothing Then + + DtRemConceptosSurtidos = New DataTable + DtRemConceptosSurtidos.Columns.Add("CveRemision", GetType(Integer)) + DtRemConceptosSurtidos.Columns.Add("CveVentaDetalle", GetType(Integer)) + DtRemConceptosSurtidos.Columns.Add("Cantidad", GetType(Decimal)) + DtRemConceptosSurtidos.Columns.Add("Surtido", GetType(Decimal)) + + 'VERIFICA SOLO LOS QUE SON TIPO PRODUCTOS + For Each dr As DataRow In DtRemisionesTmpDT.FiltraParametros($"CveTipoPS = 2 AND CveVentaDetalle IN ({StrCveVentasDetalle.ToString()})").Rows + Dim dtr As DataRow = DtRemConceptosSurtidos.NewRow + dtr("CveRemision") = CveRemision + dtr("CveVentaDetalle") = dr("CveVentaDetalle") + dtr("Cantidad") = dr("Cantidad") + dtr("Surtido") = 0 + DtRemConceptosSurtidos.Rows.Add(dtr) + Next + End If + End If For Each dr As DataRow In MovDetalle.Rows @@ -29633,6 +29650,9 @@ Partial Class Ventas LbAgregar.Enabled = True LnkAgregarPyME.Enabled = True + ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") + ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") + ImgDescTotal.Visible = False ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") TxtMotivoDescuento.Enabled = True From 12e3c7c07faca8edff6be3ac916c8c02567fffa4 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 25 Aug 2021 12:27:22 -0700 Subject: [PATCH 5/9] Error al dividir registro, cuando se esta registrando una factura nueva --- Compras/Compras.aspx.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8f680c62e..3f4ef0686 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -11383,6 +11383,7 @@ Partial Class Compras_Compras TmpDT.Columns.Add("DifPSSat", GetType(Integer)) + TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) @@ -12380,6 +12381,10 @@ Partial Class Compras_Compras Protected Sub DivirInsumo(sender As Object, e As EventArgs) Dim index2 As Integer = 0 + If Not TmpDT.Columns.Contains("Importe") Then + TmpDT.Columns.Add("Importe", GetType(Decimal)) + End If + 'LLena el AF vinculado para no perderlo For Each Row As DataRow In TmpDT.Rows If GvAFInsumos.Rows(index2).FCHiddenField("HdnCveAF").Value.ToEntero > 0 Then From f88b519507bf01162b998699dcbee7b25f1e5c83 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 25 Aug 2021 17:19:11 -0700 Subject: [PATCH 6/9] Correcion en configuracion de permisos de TipoDocto --- Ventas/Ventas.aspx.vb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index cb4716e0e..c18431878 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -18070,8 +18070,12 @@ Partial Class Ventas If Not UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing")) DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) - DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Egs")) - DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Dev")) + If Not UsuarioActual.TienePermisoProceso(175) Then + DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Egs")) + End If + If Not UsuarioActual.TienePermisoProceso(264) Then + DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Dev")) + End If End If 'Puede remisionar From 23581967cb4acf811fd7e460965e4be5f0653d02 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Thu, 26 Aug 2021 02:48:53 -0700 Subject: [PATCH 7/9] --- App_Code/ClsRH.vb | 3 +- Nomina/Nomina.aspx | 182 ++++++------- Nomina/Nomina.aspx.cs | 590 +++++++++++++++++++++++------------------- RH/CatPersonal.aspx | 2 +- vwd.webinfo | 2 + 5 files changed, 422 insertions(+), 357 deletions(-) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index b6867e5e6..c7f26d458 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -5660,7 +5660,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1, Optional CveTipoPago As Integer = 0, Optional diasExtras As Integer = 0, - Optional Ejercicio As Integer = 0, Optional PrimaVacacional As Integer = 1, Optional CobrarImss As Integer = 0) As Boolean + Optional Ejercicio As Integer = 0, Optional PrimaVacacional As Integer = 1, Optional CobrarImss As Integer = 0, Optional diasPago As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_SolicitudVacacionesAdd") @@ -5681,6 +5681,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio .Add("@PrimaVacacional", SqlDbType.Int).Value = PrimaVacacional .Add("@CobrarImss", SqlDbType.Int).Value = CobrarImss + .Add("@diasPago", SqlDbType.Int).Value = diasPago '.Add("@Motivo", SqlDbType.VarChar).Value = MotivoFechaPago As String = "", Optional diasinabiles End With diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 06e0fac89..edaa3a8d5 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1330,102 +1330,106 @@
-
-
-
- - Días feriados - - -
-
-
-
- - Fecha pago - - - - -
-
-
-
-
-
- - Fecha Inicio - - - - -
-
-
-
- - Fecha Fin - - - - -
-
-
-
-
-
- Forma de pago
- - - - - - - - - - -
-
-
-
- - Días extras -
-
-
-
-
-
- - Ejercicio -
-
-
-
-
- -
- ¿Prima Vacacional? -
- -
-
+ +
+
+ Forma de pago
+ + + + + + + + + + +
+
+
+
+ + Ejercicio +
+
+
+ +
+
+ + Fecha Inicio + + + + +
+
+
+
+ + Fecha Fin + + + + +
+
+
+ +
+
+ + Días feriados +
+
+
+
+ + Días extras +
+
+
+ +
+
+ + Fecha pago + + + + +
+
+ +
+ + Días pago +
+
+
+ -
+
+ +
+ ¿Prima Vacacional? +
+ +
+
+ +
¿Cobrar IMSS?
+ +
+ Actualizar + Guardar
-
-
- Actualizar - Guardar -
- +
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 00600d37a..a79653e07 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -1562,6 +1562,7 @@ public partial class Nomina_Nomina2 : ClsPaginas #region SobreRecibo + #region SobreRecibo propiedades protected int SRCvePersonal @@ -1680,6 +1681,17 @@ public partial class Nomina_Nomina2 : ClsPaginas RegistraScript("$('#ModalConceptos').modal();"); } + #region Vacaciones + protected int CvePersonalVacaciones + { + get + { + if (ViewState["CvePersonalVacaciones"] == null) { return 0; } + else { return ViewState["CvePersonalVacaciones"].ToString().ToEntero(); } + } + + set { ViewState["CvePersonalVacaciones"] = value; } + } private void CargaVacaciones() { ClsRH objRH = new ClsRH(); @@ -1692,10 +1704,322 @@ public partial class Nomina_Nomina2 : ClsPaginas else { GvVacaciones.DataSource = null; } objRH.Dispose(); + LnkSRVacacionesADD.Visible = false; + PnlVacacionesAdd.Visible = false; GvVacaciones.DataBind(); UpGvVacaciones.Update(); } + protected void LnkShowAddVacaciones_Click(object sender, EventArgs e) + { + LnkSRVacacionesADD.Visible = true; + PnlVacacionesAdd.Visible = true; + DdlFormapagovacaciones_SelectedIndexChanged(null, null); + ChkVacPrimaVacacional.Checked = true; + ChkVacCobrarIMSS.Checked = true; + } + + protected void DdlFormapagovacaciones_SelectedIndexChanged(object sender, EventArgs e) + { + PnlVacfechas.Visible = false; + PnlVacDias.Visible = false; + PnlVacFechapago.Visible = false; + PnlVacDiasPago.Visible = false; + PnlVacChecks.Visible = false; + switch (DdlFormapagovacaciones.SelectedValue.ToEntero()) + { + case 1://Pagar en fecha + PnlVacfechas.Visible = true; + PnlVacDias.Visible = true; + PnlVacFechapago.Visible = true; + PnlVacDiasPago.Visible = true; + PnlVacChecks.Visible = true; + break; + case 2://Pagar en periodo disfrutadas + PnlVacfechas.Visible = true; + PnlVacDias.Visible = true; + PnlVacChecks.Visible = true; + break; + case 3://Vacaciones trabajadas + PnlVacfechas.Visible = true; + PnlVacDias.Visible = true; + PnlVacDiasPago.Visible = false; + PnlVacFechapago.Visible = true; + //PnlVacChecks.Visible = true; + break; + case 4://Solo pagar + PnlVacFechapago.Visible = true; + PnlVacDiasPago.Visible = true; + PnlVacChecks.Visible = true; + break; + case 5://Solo disfrutar + PnlVacFechapago.Visible = true; + PnlVacDiasPago.Visible = true; + break; + case 6://Solo prima + PnlVacFechapago.Visible = true; + PnlVacDiasPago.Visible = true; + break; + } + /* + */ + } + + + protected void LnkSRVacacionesUP_Click(object sender, EventArgs e) + { + + } + + protected void LnkSRVacacionesADD_Click(object sender, EventArgs e) + { + + DateTime fInicio = TxtvacFechaInicio.Text.ToDate(); + DateTime fFin = TxtvacFechaFin.Text.ToDate(); + string fechapago = TxtvacFechaPago.Text.ToDate().ToString("yyyy/MM/dd"); + int diasinhabil = TxtvacDiasFeriados.Text.ToEntero(); + // Dim motivoVacaciones As String = TxtMotivoVacaciones.Text + int VacCveSupervisor = 0; + int VacFolioActual = 0; + if (fInicio <= fFin) + { + using (ClsRH objRHx = new ClsRH()) + { + + if (objRHx.VacacionesResumenGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa)) + { + if (objRHx.DtResultados.Rows.Count > 0) + { + VacCveSupervisor = objRHx.DtResultados.Rows[0]["SupervisorCorreo"].ToString().ToEntero(); + } + } + + if (objRHx.VacacionesGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa)) + { + if (objRHx.DtResultados.Rows.Count > 0) + { + VacFolioActual = objRHx.DtResultados.Compute("Max(Folio)", string.Empty).ToString().ToEntero(); + } + } + } + + VacFolioActual = VacFolioActual + 1; + ClsRH objRH = new ClsRH(); + // Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones) + bool continuar = objRH.SolicitudVacacionesAdd(SRCvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago: fechapago, + diasinabiles: diasinhabil, CveTipoPago: DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras: TxtVacDiasExtra.Text.ToEntero(), + Ejercicio: TxtVacEjercicio.Text.ToEntero(), PrimaVacacional:(ChkVacPrimaVacacional.Checked?1:0),CobrarImss: (ChkVacCobrarIMSS.Checked ? 1 : 0), diasPago: TxtVacDiasPago.Text.ToEntero() + ); + if (objRH.DtResultados.Rows.Count > 0) + { + string ShowError = objRH.DtResultados.Rows[0]["ShowError"].ToString(); + if (ShowError.Length > 0) + { + Alert(ShowError, TipoMensaje.MsgAdvertencia); + continuar = false; + } + } + objRH.Dispose(); + if (continuar) + { + + + TxtvacFechaInicio.Text = ""; + TxtvacFechaFin.Text = ""; + TxtvacFechaPago.Text = ""; + TxtvacDiasFeriados.Text = ""; + CargaVacaciones(); + //CargaVacacionesResumenPeriodoActual(); + //VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " + NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin); + Alert("Las vacaciones se han solicitado"); + } + } + else { Alert("La fecha Inicial debe ser inferior a la fecha final.", TipoMensaje.MsgAdvertencia); } + } + protected void GvVacaciones_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + bool _Estatus = bool.Parse(e.Row.DBCampo("Estatus").ToString()); + string _Documento = e.Row.DataKey("Documento"); + int _CveAutoriza = e.Row.DataKey("CveAutoriza").ToEntero(); + string RutaDocuemntoAutorizacion = string.Format(@"{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, SRCvePersonal, _Documento); + LinkButton lnkDescargaFormato = e.Row.FCLinkButton("ImgDescargaFormato"); + LinkButton lnkDescargaAutorizacion = e.Row.FCLinkButton("ImgDescargaAutorizacion"); + LinkButton lnkEditar = e.Row.FCLinkButton("ImgEditar"); + lnkEditar.Visible = true; + lnkDescargaFormato.Visible = true; + if (_CveAutoriza > 0 | !_Estatus) + { + lnkEditar.Visible = false; + lnkDescargaFormato.Visible = false; + + } + // ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lnkDescargaFormato) + if (File.Exists(RutaDocuemntoAutorizacion) & _Estatus) { lnkDescargaAutorizacion.Visible = true; } + else { lnkDescargaAutorizacion.Visible = false; } + + if (lnkDescargaAutorizacion != null && lnkDescargaAutorizacion.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaAutorizacion); } + if (lnkDescargaFormato != null && lnkDescargaFormato.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaFormato); } + + + } + } + protected void LnkEliminarSolicitud_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; + int CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero(); + + ClsRH objRH = new ClsRH(); + if (objRH.RemoverSolicitudVacaciones(CvePersonalVacaciones)) + { + CargaVacaciones(); + Alert("Las vacaciones se ha eliminado"); + } + objRH.Dispose(); + } + + public void Edit_ClickVacacionDia(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; + + CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero(); + //VacFolio = GvRow.DataKey("Folio").ToString().ToEntero; + + + TxtFechaDiaVacacion.Text = GvRow.DataKey("FechaInicio").ToString().ToDate().ToString("dd/MM/yyyy"); + TxtFechaDiaVacacionFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate().ToString("dd/MM/yyyy"); + + RegistraScript("$('#divEditarDiaVacacion').modal({ backdrop: 'static', keyboard: false});"); + UpModalEditarDiaVacacion.Update(); + } + protected void BtnEditarDiaVacacionModal_Click(object sender, EventArgs e) + { + using (ClsRH objRH = new ClsRH()) + { + + string FileExtension = "-1"; + List Filesgral = TxtFileFormatoVacaciones.getfiles().Archivos; + string Documento = ""; + + foreach (Archivo fileItem in Filesgral) + { + try + { + FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); + Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}"; + string[] tempArray; + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()); + + string rutaDestino = $@"{UsuarioActual.Empresa.Ruta}Personal\{SRCvePersonal}\Vacaciones\{Documento}"; + + if (!System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta + @"Personal\" + SRCvePersonal + @"\Vacaciones\")) + System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"Personal\" + SRCvePersonal + @"\Vacaciones\"); + + + if (System.IO.File.Exists(rutaDestino)) + System.IO.File.Delete(rutaDestino); + + System.IO.File.Move(fileItem.FileUrl, rutaDestino); + + TxtFileFormatoVacaciones.Text = ""; + } + catch (Exception ex) + { + this.OnError("Error al cargar Formato vacaciones", ex); + } + } + if (Documento.Length > 0) + { + if (objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, SRCvePersonal, UsuarioActual.CveUsuario, Documento)) + Alert("Las vacaciones se han autorizado."); + UpModalEditarDiaVacacion.Update(); + + + CargaVacaciones(); + // CargaVacacionesResumenPeriodoActual(); + RegistraScript("$('#divEditarDiaVacacion').modal('hide');"); + } + else { Alert("debe ingresar un documento para poder autorizar la solicitud", TipoMensaje.MsgAdvertencia); } + } + } + public void DownLoad_ClickSolicitudVacaciones(object sender, EventArgs e) + { + /* + GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer; + + // Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero + + // DescarSolicitudVacaciones(Folio) + string RutaFormato = string.Format(@"{0}Formatos\SolicitudVacaciones.docx", UsuarioActual.Empresa.Ruta); + + string NombreEmpleado = string.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text); + string Codigo = TxtCodigo.Text; + string Departamento = DdlDepartamento.SelectedItem.Text; + string JefeInmediato = DdlSupervisorOrganigrama.SelectedItem.Text; + DateTime fechaIngreso = TxtFechaIngreso.Text.ToDate(); + int Periodoingreso = fechaIngreso.ToString("MMdd").ToEntero(); + int PeriodoInicio = GvRow.DataKey("FechaInicio").ToDate().ToString("MMdd").ToEntero(); + string FechaInicio = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy"); + string FechaFin = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy"); + string diasPermiso = GvRow.DataKey("Dias"); + string MotivoPermiso = GvRow.DataKey("Motivo"); + string Puesto = DdlPuesto.SelectedItem.Value; + string Fecha = DateTime.Now.ToString("dd/MM/yyyy"); + string Solicitante = UsuarioActual.Nombre; + int anio = GvRow.DataKey("FechaInicio").ToDate().Year; + string FechaPeriodo = GvRow.DataKey("Periodo"); + + + + + if (Periodoingreso > PeriodoInicio) + anio = anio - 1; + + + + if (File.Exists(RutaFormato)) + { + clsGemBoxDocument objGemDocument = new clsGemBoxDocument(RutaFormato); + List ListaTags = new List(); + + ListaTags = GetDatosTagsDocumentos(); + + ListaTags.Add(new TagsDocumentos("{Solicitante}", Solicitante)); + ListaTags.Add(new TagsDocumentos("{Fecha}", Fecha)); + ListaTags.Add(new TagsDocumentos("{NombreEmpleado}", NombreEmpleado)); + ListaTags.Add(new TagsDocumentos("{Codigo}", Codigo)); + ListaTags.Add(new TagsDocumentos("{Departamento}", Departamento)); + ListaTags.Add(new TagsDocumentos("{JefeInmediato}", JefeInmediato)); + ListaTags.Add(new TagsDocumentos("{FechaInicio}", FechaInicio)); + ListaTags.Add(new TagsDocumentos("{FechaFin}", FechaFin)); + ListaTags.Add(new TagsDocumentos("{diasPermiso}", diasPermiso)); + ListaTags.Add(new TagsDocumentos("{MotivoPermiso}", MotivoPermiso)); + ListaTags.Add(new TagsDocumentos("{Puesto}", Puesto)); + ListaTags.Add(new TagsDocumentos("{anio}", anio.ToString())); + ListaTags.Add(new TagsDocumentos("{FechaPeriodo}", FechaPeriodo)); + + objGemDocument.SustituirTags(ListaTags); + + // objGemDocument.GuardarStream() + objGemDocument.GuardarStreamPDF(); + + byte[] bytesInStream = objGemDocument.GetBytesDocumento(); + // Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray + + objGemDocument.Dispose(); + + Response.Clear(); + Response.ContentType = "application/force-download"; + Response.AddHeader("content-disposition", "attachment; filename=" + CvePersonal + "_Solicitud_Vacaciones_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf"); + Response.BinaryWrite(bytesInStream); + Response.End(); + } + else + Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia);*/ + } + #endregion + protected void LnkImportexCalculo_Click(object sender, EventArgs e) { @@ -5741,266 +6065,6 @@ public partial class Nomina_Nomina2 : ClsPaginas #endregion - protected void LnkSRVacacionesUP_Click(object sender, EventArgs e) - { - - } - - protected void LnkSRVacacionesADD_Click(object sender, EventArgs e) - { - - DateTime fInicio = TxtvacFechaInicio.Text.ToDate(); - DateTime fFin = TxtvacFechaFin.Text.ToDate(); - string fechapago = TxtvacFechaPago.Text.ToDate().ToString("yyyy/MM/dd"); - int diasinhabil = TxtvacDiasFeriados.Text.ToEntero(); - // Dim motivoVacaciones As String = TxtMotivoVacaciones.Text - int VacCveSupervisor = 0; - int VacFolioActual = 0; - if (fInicio <= fFin) - { - using (ClsRH objRHx = new ClsRH()) - { - - if (objRHx.VacacionesResumenGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa)) - { - if (objRHx.DtResultados.Rows.Count > 0) - { - VacCveSupervisor = objRHx.DtResultados.Rows[0]["SupervisorCorreo"].ToString().ToEntero(); - } - } - - if (objRHx.VacacionesGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa)) - { - if (objRHx.DtResultados.Rows.Count > 0) - { - VacFolioActual = objRHx.DtResultados.Compute("Max(Folio)", string.Empty).ToString().ToEntero(); - } - } - } - - VacFolioActual = VacFolioActual + 1; - ClsRH objRH = new ClsRH(); - // Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones) - bool continuar = objRH.SolicitudVacacionesAdd(SRCvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago: fechapago, - diasinabiles: diasinhabil, CveTipoPago: DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras: TxtVacDiasExtra.Text.ToEntero()); - if (objRH.DtResultados.Rows.Count > 0) - { - string ShowError = objRH.DtResultados.Rows[0]["ShowError"].ToString(); - if (ShowError.Length > 0) - { - Alert(ShowError, TipoMensaje.MsgAdvertencia); - continuar = false; - } - } - objRH.Dispose(); - if (continuar) - { - - - TxtvacFechaInicio.Text = ""; - TxtvacFechaFin.Text = ""; - TxtvacFechaPago.Text = ""; - TxtvacDiasFeriados.Text = ""; - CargaVacaciones(); - //CargaVacacionesResumenPeriodoActual(); - //VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " + NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin); - Alert("Las vacaciones se han solicitado"); - } - } - else { Alert("La fecha Inicial debe ser inferior a la fecha final.", TipoMensaje.MsgAdvertencia); } - } - protected void GvVacaciones_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) - { - if (e.Row.RowType == DataControlRowType.DataRow) - { - bool _Estatus = bool.Parse(e.Row.DBCampo("Estatus").ToString()); - string _Documento = e.Row.DataKey("Documento"); - int _CveAutoriza = e.Row.DataKey("CveAutoriza").ToEntero(); - string RutaDocuemntoAutorizacion = string.Format(@"{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, SRCvePersonal, _Documento); - LinkButton lnkDescargaFormato = e.Row.FCLinkButton("ImgDescargaFormato"); - LinkButton lnkDescargaAutorizacion = e.Row.FCLinkButton("ImgDescargaAutorizacion"); - LinkButton lnkEditar = e.Row.FCLinkButton("ImgEditar"); - lnkEditar.Visible = true; - lnkDescargaFormato.Visible = true; - if (_CveAutoriza > 0 | !_Estatus) - { - lnkEditar.Visible = false; - lnkDescargaFormato.Visible = false; - - } - // ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lnkDescargaFormato) - if (File.Exists(RutaDocuemntoAutorizacion) & _Estatus) { lnkDescargaAutorizacion.Visible = true; } - else { lnkDescargaAutorizacion.Visible = false; } - - if (lnkDescargaAutorizacion != null && lnkDescargaAutorizacion.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaAutorizacion); } - if (lnkDescargaFormato != null && lnkDescargaFormato.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaFormato); } - - - } - } - protected void LnkEliminarSolicitud_Click(object sender, EventArgs e) - { - GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; - int CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero(); - - ClsRH objRH = new ClsRH(); - if (objRH.RemoverSolicitudVacaciones(CvePersonalVacaciones)) - { - CargaVacaciones(); - Alert("Las vacaciones se ha eliminado"); - } - objRH.Dispose(); - } - - protected int CvePersonalVacaciones - { - get - { - if (ViewState["CvePersonalVacaciones"] == null) { return 0; } - else { return ViewState["CvePersonalVacaciones"].ToString().ToEntero(); } - } - - set { ViewState["CvePersonalVacaciones"] = value; } - } - public void Edit_ClickVacacionDia(object sender, EventArgs e) - { - GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; - - CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero(); - //VacFolio = GvRow.DataKey("Folio").ToString().ToEntero; - - - TxtFechaDiaVacacion.Text = GvRow.DataKey("FechaInicio").ToString().ToDate().ToString("dd/MM/yyyy"); - TxtFechaDiaVacacionFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate().ToString("dd/MM/yyyy"); - - RegistraScript("$('#divEditarDiaVacacion').modal({ backdrop: 'static', keyboard: false});"); - UpModalEditarDiaVacacion.Update(); - } - protected void BtnEditarDiaVacacionModal_Click(object sender, EventArgs e) - { - using (ClsRH objRH = new ClsRH()) - { - - string FileExtension = "-1"; - List Filesgral = TxtFileFormatoVacaciones.getfiles().Archivos; - string Documento = ""; - - foreach (Archivo fileItem in Filesgral) - { - try - { - FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); - Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}"; - string[] tempArray; - tempArray = fileItem.filename.ToString().Split("-".ToCharArray()); - - string rutaDestino = $@"{UsuarioActual.Empresa.Ruta}Personal\{SRCvePersonal}\Vacaciones\{Documento}"; - - if (!System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta + @"Personal\" + SRCvePersonal + @"\Vacaciones\")) - System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"Personal\" + SRCvePersonal + @"\Vacaciones\"); - - - if (System.IO.File.Exists(rutaDestino)) - System.IO.File.Delete(rutaDestino); - - System.IO.File.Move(fileItem.FileUrl, rutaDestino); - - TxtFileFormatoVacaciones.Text = ""; - } - catch (Exception ex) - { - this.OnError("Error al cargar Formato vacaciones", ex); - } - } - if (Documento.Length > 0) - { - if (objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, SRCvePersonal, UsuarioActual.CveUsuario, Documento)) - Alert("Las vacaciones se han autorizado."); - UpModalEditarDiaVacacion.Update(); - - - CargaVacaciones(); - // CargaVacacionesResumenPeriodoActual(); - RegistraScript("$('#divEditarDiaVacacion').modal('hide');"); - } - else { Alert("debe ingresar un documento para poder autorizar la solicitud", TipoMensaje.MsgAdvertencia); } - } - } - public void DownLoad_ClickSolicitudVacaciones(object sender, EventArgs e) - { - /* - GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer; - - // Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero - - // DescarSolicitudVacaciones(Folio) - string RutaFormato = string.Format(@"{0}Formatos\SolicitudVacaciones.docx", UsuarioActual.Empresa.Ruta); - - string NombreEmpleado = string.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text); - string Codigo = TxtCodigo.Text; - string Departamento = DdlDepartamento.SelectedItem.Text; - string JefeInmediato = DdlSupervisorOrganigrama.SelectedItem.Text; - DateTime fechaIngreso = TxtFechaIngreso.Text.ToDate(); - int Periodoingreso = fechaIngreso.ToString("MMdd").ToEntero(); - int PeriodoInicio = GvRow.DataKey("FechaInicio").ToDate().ToString("MMdd").ToEntero(); - string FechaInicio = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy"); - string FechaFin = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy"); - string diasPermiso = GvRow.DataKey("Dias"); - string MotivoPermiso = GvRow.DataKey("Motivo"); - string Puesto = DdlPuesto.SelectedItem.Value; - string Fecha = DateTime.Now.ToString("dd/MM/yyyy"); - string Solicitante = UsuarioActual.Nombre; - int anio = GvRow.DataKey("FechaInicio").ToDate().Year; - string FechaPeriodo = GvRow.DataKey("Periodo"); - - - - - if (Periodoingreso > PeriodoInicio) - anio = anio - 1; - - - - if (File.Exists(RutaFormato)) - { - clsGemBoxDocument objGemDocument = new clsGemBoxDocument(RutaFormato); - List ListaTags = new List(); - - ListaTags = GetDatosTagsDocumentos(); - - ListaTags.Add(new TagsDocumentos("{Solicitante}", Solicitante)); - ListaTags.Add(new TagsDocumentos("{Fecha}", Fecha)); - ListaTags.Add(new TagsDocumentos("{NombreEmpleado}", NombreEmpleado)); - ListaTags.Add(new TagsDocumentos("{Codigo}", Codigo)); - ListaTags.Add(new TagsDocumentos("{Departamento}", Departamento)); - ListaTags.Add(new TagsDocumentos("{JefeInmediato}", JefeInmediato)); - ListaTags.Add(new TagsDocumentos("{FechaInicio}", FechaInicio)); - ListaTags.Add(new TagsDocumentos("{FechaFin}", FechaFin)); - ListaTags.Add(new TagsDocumentos("{diasPermiso}", diasPermiso)); - ListaTags.Add(new TagsDocumentos("{MotivoPermiso}", MotivoPermiso)); - ListaTags.Add(new TagsDocumentos("{Puesto}", Puesto)); - ListaTags.Add(new TagsDocumentos("{anio}", anio.ToString())); - ListaTags.Add(new TagsDocumentos("{FechaPeriodo}", FechaPeriodo)); - - objGemDocument.SustituirTags(ListaTags); - - // objGemDocument.GuardarStream() - objGemDocument.GuardarStreamPDF(); - - byte[] bytesInStream = objGemDocument.GetBytesDocumento(); - // Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray - - objGemDocument.Dispose(); - - Response.Clear(); - Response.ContentType = "application/force-download"; - Response.AddHeader("content-disposition", "attachment; filename=" + CvePersonal + "_Solicitud_Vacaciones_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf"); - Response.BinaryWrite(bytesInStream); - Response.End(); - } - else - Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia);*/ - } private List GetDatosTagsDocumentos() { var ListaTagsDocumentost = new List(); @@ -6782,10 +6846,4 @@ public partial class Nomina_Nomina2 : ClsPaginas Response.End(); } - protected void LnkShowAddVacaciones_Click(object sender, EventArgs e) - { - LnkSRVacacionesADD.Visible = true; - } - - } diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx index 9ee8ec049..bbc0f16ed 100644 --- a/RH/CatPersonal.aspx +++ b/RH/CatPersonal.aspx @@ -912,7 +912,7 @@
- +
diff --git a/vwd.webinfo b/vwd.webinfo index 567b3c80f..805171ec2 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -310,6 +310,8 @@ + + From d377739ac91738e5d7c2ddd86218dbda73604060 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 28 Aug 2021 11:19:27 -0700 Subject: [PATCH 8/9] Autorizacion de cotizaciones, saldo de almacen en refacturacion --- Ventas/Ventas.aspx.vb | 86 +++++++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 20 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index c18431878..d7df65f78 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1834,6 +1834,15 @@ Partial Class Ventas ViewState("CveEstatus") = value End Set End Property + + Private Property CveEstatusCotizacion As Integer + Get + Return (IfNull(ViewState("CveEstatusCotizacion"), "-1", ViewState("CveEstatusCotizacion"))).ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("CveEstatusCotizacion") = value + End Set + End Property Private Property DiasCredito As Integer Get Return ViewState("DiasCredito").ToString().ToEntero() @@ -2939,6 +2948,18 @@ Partial Class Ventas End If End If + If Request("CveCotizacion") IsNot Nothing AndAlso IfNull(Request("CveCotizacion"), 0).ToString().ToEntero() > 0 Then + If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then + 'VERIFICA SI NO ESTA AUTORIZADA + If CveEstatusCotizacion <> 8 Then + BtnEmitirImprimir.Enabled = False + BtnEmitirImprimir.Visible = False + Alert("La cotización no esta autorizada", TipoMensaje.MsgAdvertencia) + End If + End If + + End If + End If ''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ??? @@ -4426,6 +4447,8 @@ Partial Class Ventas ' BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) ' BtnsFacturar.Visible = True 'End If + ElseIf DbRowVenta("TipoDocto").ToString() = "Cot" AndAlso CveCotizacion > 0 Then + CveEstatusCotizacion = DbRowVenta("CveEstatusFactura").ToString().ToEntero() End If @@ -8207,33 +8230,56 @@ Partial Class Ventas If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") End If - End If - 'MARCAR VENTA ANTERIOR - If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then - ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") - End If - - 'MARCA LO PENDIENTE A NIVEL DETALLE - Dim DtMovDetalles As DataTable = Nothing - If ObjInventario.GetSaldoVentaDetalle(CveDevolucion, UsuarioActual.CveEmpresa) Then - DtMovDetalles = ObjInventario.DtResultados.Copy() + 'MARCAR VENTA ANTERIOR + If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then + ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") + End If Else - ErrorList.Add("No se pudo verificar los movimientos de almacen de la factura") - End If + 'MARCA LO PENDIENTE A NIVEL DETALLE + Dim DtMovDetalles As DataTable = Nothing + If ObjInventario.GetSaldoVentaDetalle(CveDevolucion, UsuarioActual.CveEmpresa) Then + DtMovDetalles = ObjInventario.DtResultados.Copy() + Else + ErrorList.Add("No se pudo verificar los movimientos de almacen de la factura") + End If - If DtMovDetalles IsNot Nothing Then - For Each Row As DataRow In DtMovDetalles.Rows - Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToDecimal() - If SaldoAlmacen < 0 Then - If Not ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalleNueva").ToString().ToEntero(), 1) Then - ErrorList.Add("No se pudo actualizar el movimiento de almacen de la factura") + 'MARCAR VENTA ANTERIOR + If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then + ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") + End If + + If DtMovDetalles IsNot Nothing Then + + Dim CantidadTotal As Decimal = 0 + Dim TotalSalida As Decimal = 0 + + For Each Row As DataRow In DtMovDetalles.Rows + Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() + Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToDecimal() + Cantidad += Cantidad + + If SaldoAlmacen < 0 AndAlso Cantidad = Math.Abs(SaldoAlmacen) Then + TotalSalida += Math.Abs(SaldoAlmacen) + If Not ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalleNueva").ToString().ToEntero(), 1) Then + ErrorList.Add("No se pudo actualizar el movimiento de almacen de la factura") + End If + End If + Next + + 'SI SE VERIFICA QUE TODO ESTA SURTIDO, SE MARCA TODA LA FACTURA + If CantidadTotal = Total Then + If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then + ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") End If End If - Next + End If + + DtMovDetalles.Dispose() + End If - DtMovDetalles.Dispose() + End If End If From 48c6f218d21686bca85a3da722844d4d29598314 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 28 Aug 2021 11:19:50 -0700 Subject: [PATCH 9/9] PV. mostrar solo clientes distribuidores --- Ashx/SIGWeb.ashx | 6 ++++++ Scripts/custom.js | 3 ++- Ventas/PV.aspx.vb | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index f191800c0..8875454bd 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -559,6 +559,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ColumnaNombre = "Nombre" End If + Dim EsDistribuidor As Integer = IfNull(context.Request("esdistribuidor"), "-1").ToString.ToEntero + Dim usuario As Usuario = UsuarioActual(context) Dim CveEmpresa As String If IsNothing(usuario) Then @@ -584,6 +586,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + If EsDistribuidor <> -1 Then + dt = dt.FiltraParametros(String.Format("EsDistribuidor = {0} ", CBool(EsDistribuidor))) + End If + DtRetorno = dt.FiltraParametros(String.Format("NombreComercial like '%{0}%' OR Nombre like '%{0}%' ", Name)) End If dt.Dispose() diff --git a/Scripts/custom.js b/Scripts/custom.js index 21e28bd1b..780aa440e 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1201,7 +1201,8 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) { Pagina: (!(DdlWS.data('pagina')) || DdlWS.data('pagina') == '') ? '-2' : DdlWS.data('pagina'), ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto'), aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa'), - cvemarca: (!(DdlWS.data('cvemarca')) || DdlWS.data('cvemarca') == '') ? -1 : DdlWS.data('cvemarca') + cvemarca: (!(DdlWS.data('cvemarca')) || DdlWS.data('cvemarca') == '') ? -1 : DdlWS.data('cvemarca'), + esdistribuidor: (!(DdlWS.data('esdistribuidor')) || DdlWS.data('esdistribuidor') == '') ? -1 : DdlWS.data('esdistribuidor') //Metodo: metodo }; diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 39a95f414..ac4b17e03 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -6432,6 +6432,7 @@ Partial Class PV CreaDTmpDTRecepcionUsados() CreaDTmpDTPolizaVirtual() DdlDistribuidor.setEsWebService(True) + DdlDistribuidor.ddlWS.Attributes.Add("data-esdistribuidor", "1") DivChkAjuste.Visible = True UpAjuste.Update()