diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index e4b936d10..a2129f8a1 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1718,9 +1718,9 @@ Public Class ClsBancos Return Retorno End Function - Public Function CancelarBancos_IE(CveUsuario As Integer, CveIE As Integer, MesAnterior As Boolean, IdPoliza As Integer, FolioPoliza As Integer, Optional FechaCancelacion As Date = MinFecha, Optional TipoMovimiento As Integer = 1) As Boolean + Public Function CancelarBancos_IE(CveUsuario As Integer, CveIE As Integer, MesAnterior As Boolean, IdPoliza As Integer, FolioPoliza As Integer, Optional FechaCancelacion As Date = MinFecha, Optional TipoMovimiento As Integer = 1) As Integer - Dim Retorno As Boolean = False + Dim Retorno As Integer = 0 DataAdapter("PA_Banc_IECancelar") With SqlAdapter.SelectCommand.Parameters @@ -1731,11 +1731,12 @@ Public Class ClsBancos .Add("@FolioPoliza", SqlDbType.Int).Value = FolioPoliza .Add("@FechaCancelacion", SqlDbType.Date).Value = FechaCancelacion .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento + .Add("@CvePrePoliza", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) - Retorno = True + Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePoliza").Value.ToString.ToEntero Catch ex As Exception OnError("Ocurrió un error al cancelar el movimiento en bancos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index bc906fcd4..61f19b032 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -360,7 +360,7 @@ Public Class ClsInventarios End Function - Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean + Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_AlmacenesAdd") @@ -377,7 +377,7 @@ Public Class ClsInventarios .Add("@Orden", SqlDbType.SmallInt).Value = Orden .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza - + .Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual End With Try @@ -396,7 +396,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean + Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_AlmacenesUpdate") @@ -413,6 +413,7 @@ Public Class ClsInventarios .Add("@Orden", SqlDbType.SmallInt).Value = Orden .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza + .Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual End With diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index b7729c3f2..de7538cf9 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -41,36 +41,36 @@ Public Class ClsRH Public Sub Commit() SqlTransacc.Commit() - End Sub - + End Sub + #End Region - + #Region "Propiedades" Public ReadOnly Property DSResultados() As DataSet Get DSResultados = DSet End Get - End Property - + End Property + #End Region - Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) - - If TransaccionCompartida Is Nothing Then - SqlConexion = New SqlConnection - SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString - Try - SqlConexion.Open() - Catch ex As Exception - OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) - End Try - Else - SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida - EsTransaccionCompartida = True - End If - - SqlAdapter = New SqlDataAdapter("", SqlConexion) - ConexionAdd() + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) + + If TransaccionCompartida Is Nothing Then + SqlConexion = New SqlConnection + SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString + Try + SqlConexion.Open() + Catch ex As Exception + OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) + End Try + Else + SqlConexion = TransaccionCompartida.Connection + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True + End If + + SqlAdapter = New SqlDataAdapter("", SqlConexion) + ConexionAdd() End Sub Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) With SqlAdapter.SelectCommand @@ -80,23 +80,23 @@ Public Class ClsRH End With Data = New DataTable End Sub - Private CveConexion As Integer = 0 - Private EsTransaccionCompartida As Boolean = False - - + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + + #Region "Conexiones" - + Private Sub ConexionAdd() - If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then - - 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo - - Try - DataAdapter("PA_Sis_RegistrarConexion") - With SqlAdapter.SelectCommand.Parameters - .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name - .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) - .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + + 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo + + Try + DataAdapter("PA_Sis_RegistrarConexion") + With SqlAdapter.SelectCommand.Parameters + .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name + .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) + .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output End With SqlAdapter.Fill(Data) CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero @@ -141,7 +141,7 @@ Public Class ClsRH Return Retorno End Function - Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer, + Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer, chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean Dim Retorno As Boolean = False @@ -178,7 +178,7 @@ Public Class ClsRH Return Retorno End Function - Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer, + Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer, chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean Dim Retorno As Boolean = False @@ -1549,7 +1549,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer, CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, - FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer, + FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer, CveEmpresa As Integer, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False @@ -1820,8 +1820,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CelularPersonal", SqlDbType.VarChar).Value = CelularPersonal .Add("@TelefonoMarcadoRapido", SqlDbType.VarChar).Value = TelefonoMarcadoRapido .Add("@ContactoAlterno", SqlDbType.VarChar).Value = ContactoAlterno - .Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario - + .Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario + .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -1937,8 +1937,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@FechaActivo", SqlDbType.Date).Value = FechaActivo .Add("@FechaReingreso", SqlDbType.Date).Value = FechaReingreso - .Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario - + .Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario + End With Try @@ -1955,16 +1955,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function - - Public Function UpdateSalariointegrado(CvePersonal As Integer, CveEmpresa As Integer, SDI As Double, SalarioDiario As Double) As Boolean + End Function + + Public Function UpdateSalariointegrado(CvePersonal As Integer, CveEmpresa As Integer, SDI As Double, SalarioDiario As Double) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_PersonalUpdateSalarioIntegrado") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@SDI", SqlDbType.Money).Value = SDI - .Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario + .Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario End With Try SqlAdapter.Fill(Data) @@ -1973,8 +1973,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno - End Function - Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double, Optional CalcularSDI As Boolean = False) As Boolean + End Function + Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double, Optional CalcularSDI As Boolean = False) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_PersonalUpdateSalarios") With SqlAdapter.SelectCommand.Parameters @@ -1985,7 +1985,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario .Add("@SDI", SqlDbType.Money).Value = SDI .Add("@SalarioDiarioSS", SqlDbType.Money).Value = SalarioDiarioSS - .Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI + .Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI End With Try SqlAdapter.Fill(Data) @@ -1994,16 +1994,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno - End Function - - - Public Function GetMovimientosToSUA(CveEmpresa As Integer, FechaI As String, FechaF As String) As Boolean + End Function + + + Public Function GetMovimientosToSUA(CveEmpresa As Integer, FechaI As String, FechaF As String) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_MovimientosToSUA") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaF", SqlDbType.VarChar).Value = FechaF End With Try SqlAdapter.Fill(Data) @@ -2012,17 +2012,17 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno - End Function - - - - Public Function UpdateRFCValidado(RFC As String, CveEmpresa As Integer, RFCValidadoisok As Boolean) As Boolean + End Function + + + + Public Function UpdateRFCValidado(RFC As String, CveEmpresa As Integer, RFCValidadoisok As Boolean) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_PersonalUpdateRFCValidado") With SqlAdapter.SelectCommand.Parameters .Add("@RFC", SqlDbType.VarChar).Value = RFC .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@isOk", SqlDbType.Bit).Value = RFCValidadoisok + .Add("@isOk", SqlDbType.Bit).Value = RFCValidadoisok End With Try SqlAdapter.Fill(Data) @@ -2031,14 +2031,14 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno - End Function - Public Function Updateestemporal(CvePersonal As Integer, CveEmpresa As Integer, estemporal As Boolean) As Boolean + End Function + Public Function Updateestemporal(CvePersonal As Integer, CveEmpresa As Integer, estemporal As Boolean) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_PersonalUpdateesTemporal") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@isOk", SqlDbType.Bit).Value = estemporal + .Add("@isOk", SqlDbType.Bit).Value = estemporal End With Try SqlAdapter.Fill(Data) @@ -2052,8 +2052,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, CvePersonal As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - + Dim Retorno As Boolean = False + SqlDataAdapter("PA_RH_PersonalUpdateMasivo") With SqlAdapter.SelectCommand.Parameters .Add("@CveTurno", SqlDbType.Int).Value = CveTurno @@ -2391,8 +2391,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function - + End Function + Public Function AddAsistenciaMasiva2(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -2418,9 +2418,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function + End Function #End Region - + #Region "Asistencias Detalles" Public Function GetAsistenciasDetalle() As Boolean Dim Retorno As Boolean = False @@ -3442,7 +3442,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CveTurno", SqlDbType.Int).Value = RHRequerido.CveTurno .Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad .Add("@CveUsuario", SqlDbType.Int).Value = RHRequerido.CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa .Add("@CveDepartamento", SqlDbType.Int).Value = RHRequerido.CveDepartamento End With @@ -3464,8 +3464,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CveRequerimiento", SqlDbType.Int).Value = RHRequerido.CveRequerimiento .Add("@CveSubProyecto", SqlDbType.Int).Value = RHRequerido.CveSubProyecto .Add("@CveTurno", SqlDbType.Int).Value = RHRequerido.CveTurno - .Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad - .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa + .Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad + .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa .Add("@CveDepartamento", SqlDbType.Int).Value = RHRequerido.CveDepartamento End With @@ -3480,13 +3480,13 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Function Public Function RemovePersonalRequerido(CveRequerimiento As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False - - DataAdapter("PA_RH_PersonalRequeridoRemove") - + + DataAdapter("PA_RH_PersonalRequeridoRemove") + With SqlAdapter.SelectCommand.Parameters - .Add("@CveRequerimiento", SqlDbType.Int).Value = CveRequerimiento - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - + .Add("@CveRequerimiento", SqlDbType.Int).Value = CveRequerimiento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With @@ -3504,10 +3504,10 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function - + End Function + #End Region - + #Region "ClsRHReportePersonalNecesidades" Public Function GetReportePersonalNecesidades(CveTurno As Integer, CveProyecto As Integer, tCveSubProyeto As Integer, Estatus As Integer, CveEmpresa As Integer, CveDepartamento As Integer) As Boolean Dim Retorno As Boolean = False @@ -3529,9 +3529,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al obtener el Reporte de Necesidades de Personal", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function + End Function #End Region - + #Region "ClsRHReporteRotacionPersonal" Public Function GetReporteRotacionPersonal(FechaInicio As Date, FechaFin As Date, CveTurno As Integer, CveProyecto As Integer, CveSubProyeto As Integer, CveEmpresa As Integer) As Boolean @@ -3634,92 +3634,6 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo #Region "C H E C A D O R E S T A C I O N E S" - Public Function ChecadorEstacionesAdd(CveChecadorTipo As Integer, CveZonaHoraria As Integer, CveUsuario As Integer, CveEmpresa As Integer, ChecadorEstacion As String, Ip As String, Puerto As Integer, Estatus As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_RH_ChecadorEstacionesAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveChecadorTipo", SqlDbType.Int).Value = CveChecadorTipo - .Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@ChecadorEstacion", SqlDbType.VarChar).Value = ChecadorEstacion - .Add("@Ip", SqlDbType.VarChar).Value = Ip - .Add("@Puerto", SqlDbType.Int).Value = Puerto - .Add("@Estatus", SqlDbType.Int).Value = Estatus - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function ChecadorEstacionesUpdate(CveChecadorEstacion As Integer, CveChecadorTipo As Integer, CveZonaHoraria As Integer, CveUsuario As Integer, CveEmpresa As Integer, ChecadorEstacion As String, Ip As String, Puerto As Integer, Estatus As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_RH_ChecadorEstacionesUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion - .Add("@CveChecadorTipo", SqlDbType.Int).Value = CveChecadorTipo - .Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@ChecadorEstacion", SqlDbType.VarChar).Value = ChecadorEstacion - .Add("@Ip", SqlDbType.VarChar).Value = Ip - .Add("@Puerto", SqlDbType.Int).Value = Puerto - .Add("@Estatus", SqlDbType.Int).Value = Estatus - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function ChecadorEstacionesRemove(CveChecadorEstacion As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_RH_ChecadorEstacionesRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion - - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function ChecadorEstacionesGet(CveChecadorEstacion As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_RH_ChecadorEstacionesGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function DdlChecadorTipoGet(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_DdlChecadorTipoGet") @@ -4158,16 +4072,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Try SqlAdapter.Fill(Data) Retorno = True - Catch exs As SqlException - - - If exs.Message.Contains("Número: 547;") Then + Catch exs As SqlException + + + If exs.Message.Contains("Número: 547;") Then OnError("El Tema no se puede eliminar porque tiene registros relacionados..", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) Else OnError("El Tema no se puede eliminar porque tiene registros relacionados. TemasRemove.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - - + End If + + 'If exs.ErrorCode = -2146232060 Then ' OnError("Ocurrió al Eliminar el Tema Existen registros relacionadados.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) 'Else @@ -4463,7 +4377,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Beneficiario", SqlDbType.Bit).Value = Beneficiario End With @@ -4498,9 +4412,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Telefono", SqlDbType.VarChar).Value = Telefono .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones - .Add("@Beneficiario", SqlDbType.Int).Value = Beneficiario - - + .Add("@Beneficiario", SqlDbType.Int).Value = Beneficiario + + End With Try @@ -6747,9 +6661,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual)) ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF)) - ListaTagsDocumentost.Add(New TagsDocumentos("{HoraInicioJornada}", DtResultados(0)("HorarioDe").ToString)) - ListaTagsDocumentost.Add(New TagsDocumentos("{HoraFinJornada}", DtResultados(0)("HorarioA").ToString)) - ListaTagsDocumentost.Add(New TagsDocumentos("{Salario}", "")) + ListaTagsDocumentost.Add(New TagsDocumentos("{HoraInicioJornada}", DtResultados(0)("HorarioDe").ToString)) + ListaTagsDocumentost.Add(New TagsDocumentos("{HoraFinJornada}", DtResultados(0)("HorarioA").ToString)) + ListaTagsDocumentost.Add(New TagsDocumentos("{Salario}", "")) ListaTagsDocumentost.Add(New TagsDocumentos("{MetodoPago}", DtResultados(0)("MetodoPago").ToString)) End If @@ -6875,11 +6789,11 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al obtener los pagos de factura de personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function - + End Function + #End Region - -#Region "Checador" + +#Region "Checador" Public Function GetChecadores(CveChecador As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_ChecadorGet") @@ -6894,18 +6808,18 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function - + End Function + Public Function AddChecadores(Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, CveUsuario As Integer, Optional CveModelo As Integer = 1, Optional Estatus As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_ChecadorAdd") With SqlAdapter.SelectCommand.Parameters - .Add("@Checador", SqlDbType.NVarChar).Value = Checador - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal - .Add("@Puerto", SqlDbType.NVarChar).Value = Puerto - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveModelo", SqlDbType.Int).Value = CveModelo + .Add("@Checador", SqlDbType.NVarChar).Value = Checador + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal + .Add("@Puerto", SqlDbType.NVarChar).Value = Puerto + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveModelo", SqlDbType.Int).Value = CveModelo .Add("@Estatus", SqlDbType.Int).Value = Estatus End With Try @@ -6915,18 +6829,18 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al agregar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function - + End Function + Public Function UpdateChecadores(CveChecador As Integer, Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, Optional CveModelo As Integer = 1, Optional Estatus As Boolean = True) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_ChecadorUpdate") With SqlAdapter.SelectCommand.Parameters - .Add("@CveChecador", SqlDbType.Int).Value = CveChecador - .Add("@Checador", SqlDbType.NVarChar).Value = Checador - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal - .Add("@Puerto", SqlDbType.NVarChar).Value = Puerto - .Add("@CveModelo", SqlDbType.Int).Value = CveModelo + .Add("@CveChecador", SqlDbType.Int).Value = CveChecador + .Add("@Checador", SqlDbType.NVarChar).Value = Checador + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal + .Add("@Puerto", SqlDbType.NVarChar).Value = Puerto + .Add("@CveModelo", SqlDbType.Int).Value = CveModelo .Add("@Estatus", SqlDbType.Bit).Value = Estatus End With Try @@ -6936,8 +6850,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al actualizar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function - + End Function + Public Function RemoveChecadores(CveChecador As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_ChecadorDelete") @@ -6951,21 +6865,21 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function -#End Region - - - 'Public msgsError As New StringBuilder() - 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") - ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - ' msgsError.AppendLine(Mensaje) - ' msgsError.Append("
") - ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) - ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - 'End Sub - + End Function +#End Region + + + 'Public msgsError As New StringBuilder() + 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") + ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + ' msgsError.AppendLine(Mensaje) + ' msgsError.Append("
") + ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) + ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + 'End Sub + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) 'If msgsError.ToString().Length > 0 Then ' Alert(msgsError.ToString(), TipoMensaje.MsgError) diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 574ec5150..38f89fdc3 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1180,7 +1180,10 @@
- + +
+
+
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 716f86cfc..63a198a2d 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4391,7 +4391,7 @@ Partial Class Bancos_IE Dim IdPolizaNueva = -1 Dim FolioPolizaNueva = -1 - If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then + If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then If ObjAC Is Nothing Then ErrorCancelar = True @@ -4427,7 +4427,7 @@ Partial Class Bancos_IE 'CANCELA IE If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If @@ -4458,7 +4458,7 @@ Partial Class Bancos_IE 'CANCELA IE If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If @@ -4479,22 +4479,42 @@ Partial Class Bancos_IE Else ' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then - If TxtFechaDocumento.Text.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then + Dim GeneraCancelacionEnCero As Boolean = True + If TxtFechaDocumento.Text.ToDate >= TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero + GeneraCancelacionEnCero = True + End If + + If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then + GeneraCancelacionEnCero = False + End If + Dim CvePrePolizaCancelacion As Integer = 0 + + If Not GeneraCancelacionEnCero Then 'CANCELA IE MES ANTERIOR - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) + If CvePrePolizaCancelacion <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ANTERIOR" End If Else 'CANCELA IE MES ACTUAL - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) + If CvePrePolizaCancelacion <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ACTUAL" End If End If + + If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then + ErrorCancelar = True + MensajeError = "Error al contabilizar poliza" + End If + End If + End If - If Not ErrorCancelar Then + If Not ErrorCancelar Then If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then @@ -4656,7 +4676,7 @@ Partial Class Bancos_IE 'genera nuevo IE contrario If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then ErrorCancelar = True End If End If @@ -4672,7 +4692,7 @@ Partial Class Bancos_IE Else 'siempre se hace una cancelación - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then ErrorCancelar = True End If diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index 7374d32e0..7dc726ae8 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -1584,7 +1584,7 @@ Partial Class Bancos_PagoElectronico Else 'Cuando salio NO exitoso cancelamos el IE - If Not ObjIE.CancelarBancos_IE(UsuarioActual.CveUsuario, ArrayCveIEs(index).ToEntero, False, -1, -1) Then + If ObjIE.CancelarBancos_IE(UsuarioActual.CveUsuario, ArrayCveIEs(index).ToEntero, False, -1, -1) <= 0 Then ErrorDB = True End If End If diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 94f711266..0a49c92e3 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -2818,7 +2818,7 @@ Partial Class Bancos_PagoElectronicoGrupos 'CANCELA IE If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If @@ -2849,7 +2849,7 @@ Partial Class Bancos_PagoElectronicoGrupos 'CANCELA IE If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If @@ -2872,13 +2872,13 @@ Partial Class Bancos_PagoElectronicoGrupos ' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then If FechaDocumento < FechaCancelacion.FirstDayOfMonth Then 'CANCELA IE MES ANTERIOR - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ANTERIOR" End If Else 'CANCELA IE MES ACTUAL - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ACTUAL" End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index da0b58856..b67198e7a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2688,77 +2688,88 @@ Partial Class Compras_Compras TmpDT.Columns.Add("CveContrato", GetType(Integer)) TmpDT.Columns.Add("DifPSSat", GetType(Integer)) - TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) - TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) + + If Not TmpDT.Columns.Contains("CveContratoDetalle") Then + TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) + End If + + + If Not TmpDT.Columns.Contains("CveCultivoCuadroDetalle") Then + TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) + End If + + + + GvPS.DataSource = TmpDT - GvPS.DataBind() - - If UsuarioActual.Empresa.UsaAC Then - CargaHidendsAC() - End If - - CalculaTotales(True) - - If UsuarioActual.Empresa.UsaInventarios Then - DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy - - If dr("Inventario").ToString = "1" Then - - CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero - - Dim Inv As New ClsInventarios - If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - 'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento"))) - 'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros) - - ImgImprimirAlmacen.Visible = True - ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento")) - - Dim drt As DataRow - 'actualizo el almacen - For Each dri As DataRow In DtInv.Rows - - drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) - If drt IsNot Nothing Then - Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie - TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie - - dri("CveAlmacen") = drt("CveAlmacen") - - End If - - Next - - End If - - 'Proceso Super Tramposo de Charlie - If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then - Dim drt As DataRow - For Each dri As DataRow In DtInv.Rows - drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) - If drt IsNot Nothing Then - Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) - TmpDr("CveAlmacen") = drt("CveAlmacen") - End If - Next - End If - - Inv.Dispose() + GvPS.DataBind() + If UsuarioActual.Empresa.UsaAC Then + CargaHidendsAC() End If - CargaGvInv() + CalculaTotales(True) - 'Ocultamos "Recibir Aqui" - GvInv.Columns(6).Visible = False - GvInv.Columns(7).Visible = False + If UsuarioActual.Empresa.UsaInventarios Then + DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy + If dr("Inventario").ToString = "1" Then + + CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero + + Dim Inv As New ClsInventarios + If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then + 'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento"))) + 'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros) + + ImgImprimirAlmacen.Visible = True + ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento")) + + Dim drt As DataRow + 'actualizo el almacen + For Each dri As DataRow In DtInv.Rows + + drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) + If drt IsNot Nothing Then + Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie + TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie + + dri("CveAlmacen") = drt("CveAlmacen") + + End If + + Next + + End If + + 'Proceso Super Tramposo de Charlie + If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then + Dim drt As DataRow + For Each dri As DataRow In DtInv.Rows + drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) + If drt IsNot Nothing Then + Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) + TmpDr("CveAlmacen") = drt("CveAlmacen") + End If + Next + End If + + Inv.Dispose() + + End If + + CargaGvInv() + + 'Ocultamos "Recibir Aqui" + GvInv.Columns(6).Visible = False + GvInv.Columns(7).Visible = False + + End If End If - End If - DdlTipoComprobante.Enabled = False + DdlTipoComprobante.Enabled = False DdlTipoComprobante.SelectedValue = dr("TipoDocto").ToString If dr("TipoDocto").ToString = "Fac" Then ChkAplicaNotaCredito.Enabled = True @@ -3958,6 +3969,7 @@ Partial Class Compras_Compras Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click + '------------------INICIA VALIDACIONES------------------ Dim EstatusCredito As Integer = 0 Dim CveSubProyecto As Integer = 0 @@ -6795,6 +6807,19 @@ Partial Class Compras_Compras importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora + + Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable() + Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS") + Select New With + { + .Total = dr2.Field(Of Double)("Total") + }).Sum(Function(item) item.Total) + + importeMovimiento += Valor.ToDecimal + importeMN = importeMovimiento * tipoCambioActual * Multiplicador + End If + Dim ConceptoContabilizacionNC = 225 Dim CveMovimientoDevolucion As Integer = -1 diff --git a/Contratos/ContratoAvance.aspx b/Contratos/ContratoAvance.aspx index f52875650..c3960ce15 100644 --- a/Contratos/ContratoAvance.aspx +++ b/Contratos/ContratoAvance.aspx @@ -37,208 +37,222 @@ + + Avance de Contrato + + - + + + + +
+
+
+ +
+
+ + + +
+
+ + +
+
+
+ + +
+
+
+
+
+
+ + +
+ +
+ Fecha: +
+
+
+ + + + + + + + + + +
+
+ + +
+
+ " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" /> + " class="btn btn-circle btn-sm label-info"> +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
Producto / ServicioAvanceUltimo AvanceLevantamientoAnexo
+ +
+
+ + + + + + + + + + + + + <%# Eval("Abreviatura")%> + + + + + + <%# Eval("Cantidad", "{0:N2}")%> + + + + + + <%# Eval("Importe", "{0:N2}")%> + + + + + <%# Eval("Cantidad_Ultima", "{0:N2}")%> + + + + + <%# Eval("Importe_Ultima", "{0:N2}")%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + +
+
+ + + + +<%-- - - -
-
-
- -
-
- - - -
-
- - -
-
-
- - -
-
-
-
-
-
- - -
- -
- Fecha: -
-
-
- - - - - - - - - - -
-
- - -
- -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
Producto / ServicioAvanceUltimo AvanceLevantamientoAnexo
- -
-
- - - - - - - - - - - - - <%# Eval("Abreviatura")%> - - - - - - <%# Eval("Cantidad", "{0:N2}")%> - - - - - - <%# Eval("Importe", "{0:N2}")%> - - - - - <%# Eval("Cantidad_Ultima", "{0:N2}")%> - - - - - <%# Eval("Importe_Ultima", "{0:N2}")%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
- - -
-
+
@@ -341,7 +355,7 @@ -
+
--%> diff --git a/Contratos/ContratoAvance.aspx.vb b/Contratos/ContratoAvance.aspx.vb index 66c961842..15d5ccce3 100644 --- a/Contratos/ContratoAvance.aspx.vb +++ b/Contratos/ContratoAvance.aspx.vb @@ -138,8 +138,8 @@ Partial Class Contratos_ContratoAvance DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) DdlContratos.DataBind() - DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) - DDlContratosEstimaciones.DataBind() + 'DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) + 'DDlContratosEstimaciones.DataBind() End Sub @@ -207,7 +207,7 @@ Partial Class Contratos_ContratoAvance If e.Row.DataKey("CveContratoDetalle").ToEntero > 0 Then Dim LnkAnexo As LinkButton = e.Row.FCLinkButton("LnkModalDropzone") - 'LnkAnexo.Visible = True + Dim DVAnexo As Control = DirectCast(e.Row.FindControl("ModalAnexoEvidencia"), Control) LnkAnexo.OnClientClick = $" $('#{DVAnexo.ClientID}').modal('show'); return false;" @@ -220,9 +220,20 @@ Partial Class Contratos_ContratoAvance Dim LnkGuardarAvance As LinkButton = e.Row.FCLinkButton("LnkGuardarAvance") LnkGuardarAvance.Visible = True + + If e.Row.DataKey("CantidadMax").ToDouble = 0 Then + LnkAnexo.Visible = False + e.Row.FCTextBox("TxtCantidad").Visible = False + LnkGuardarAvance.Visible = False + + End If + End If + + + End If End Sub Protected Sub GetAnexos(sender As Object, e As System.EventArgs) @@ -432,120 +443,120 @@ Partial Class Contratos_ContratoAvance #Region "ESTIMACION" - Private Sub CargaAvancesParaEstimar() - CveContratoEstimacion = -1 + 'Private Sub CargaAvancesParaEstimar() + ' CveContratoEstimacion = -1 - Dim ObjContratos As New ClsContratos() - Dim DTEstimaciones As New DataTable - Dim NumeroEstimacionActual As Integer = 0 + ' Dim ObjContratos As New ClsContratos() + ' Dim DTEstimaciones As New DataTable + ' Dim NumeroEstimacionActual As Integer = 0 - If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then - DTEstimaciones = ObjContratos.DtResultados + ' If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then + ' DTEstimaciones = ObjContratos.DtResultados - CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero + ' CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero - End If + ' End If - ObjContratos.Dispose() + ' ObjContratos.Dispose() - If DTEstimaciones.Rows.Count > 0 Then - GvEstimaciones.DataSource = DTEstimaciones - BtnGuardarEstimacion.Visible = True - Else - GvEstimaciones.DataSource = Nothing - BtnGuardarEstimacion.Visible = False - End If - GvEstimaciones.DataBind() + ' If DTEstimaciones.Rows.Count > 0 Then + ' GvEstimaciones.DataSource = DTEstimaciones + ' BtnGuardarEstimacion.Visible = True + ' Else + ' GvEstimaciones.DataSource = Nothing + ' BtnGuardarEstimacion.Visible = False + ' End If + ' GvEstimaciones.DataBind() - UpEstimaciones.Update() - End Sub + ' UpEstimaciones.Update() + 'End Sub - Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click + 'Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click - CargaAvancesParaEstimar() + ' CargaAvancesParaEstimar() - End Sub + 'End Sub - Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound + 'Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then + ' If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then - If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then - If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then - e.Row.CssClass = "SubTotales" - Else - e.Row.CssClass = "SubTotales2" - End If - Else - e.Row.CssClass = "SubTotales3" - End If - End If - End If + ' If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then + ' If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then + ' e.Row.CssClass = "SubTotales" + ' Else + ' e.Row.CssClass = "SubTotales2" + ' End If + ' Else + ' e.Row.CssClass = "SubTotales3" + ' End If + ' End If + ' End If - End Sub + 'End Sub - Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click + 'Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click - CveEstimacionNueva = -1 - NuemeroEstimacionNuevo = -1 + ' CveEstimacionNueva = -1 + ' NuemeroEstimacionNuevo = -1 - Dim ObjContratos As New ClsContratos() - Dim ErrorProceso As Boolean = False + ' Dim ObjContratos As New ClsContratos() + ' Dim ErrorProceso As Boolean = False - ObjContratos.IniciaTransacSQL() + ' ObjContratos.IniciaTransacSQL() - If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ' If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - CveEstimacionNueva = ObjContratos.CveEstimacionNueva - NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva + ' CveEstimacionNueva = ObjContratos.CveEstimacionNueva + ' NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva - For Each GvRow As GridViewRow In GvEstimaciones.Rows + ' For Each GvRow As GridViewRow In GvEstimaciones.Rows - If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then - If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then - ErrorProceso = True - Exit For - End If - End If - Next + ' If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then + ' If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then + ' ErrorProceso = True + ' Exit For + ' End If + ' End If + ' Next - Else - ErrorProceso = True - End If + ' Else + ' ErrorProceso = True + ' End If - 'AddContratosAvanceEstimacion - 'UpdateContratosAvanceEstimacion + ' 'AddContratosAvanceEstimacion + ' 'UpdateContratosAvanceEstimacion - If Not ErrorProceso Then - ObjContratos.Commit() - Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.") + ' If Not ErrorProceso Then + ' ObjContratos.Commit() + ' Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.") - BtnGuardarEstimacion.Visible = False - BtnDescargarGenerado.Visible = True + ' BtnGuardarEstimacion.Visible = False + ' BtnDescargarGenerado.Visible = True - Else - ObjContratos.RollBack() - End If + ' Else + ' ObjContratos.RollBack() + ' End If - ObjContratos.Dispose() + ' ObjContratos.Dispose() - UpEstimaciones.Update() - End Sub + ' UpEstimaciones.Update() + 'End Sub - Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click + 'Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click - GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text) + ' GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text) - End Sub + 'End Sub Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String) diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index 86f5165e3..0b57d21c6 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -320,24 +320,20 @@
Datos del Contrato
-
- - - - +
- -
+ +
- -
+ +
@@ -345,16 +341,16 @@
- -
+ +
-