diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index c78db8b2b..be04003c1 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -2568,9 +2568,6 @@ Partial Class AF_AF End If - - - End If End If @@ -2581,7 +2578,7 @@ Partial Class AF_AF 'Dim CveCuentaInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={AFInvCveAlmacen}").ToEntero If Not ErrorGuardar Then Dim CvePrePoliza As Integer = ObjContabilidad.AddPrePolizas("AF/ImportadoInv", 4, TxtValorCompra.Text.ToDouble, TxtValorCompra.Text.ToDouble, 1, Now, $"AF importado de Almacén {TxtCodigo.Text.Trim}", UsuarioActual.CveUsuario, CveEmpresaActual) - If ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, False, TxtValorCompra.Text.ToDecimal, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", 49, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", Now, DdlCtaContable.SelectedValue.Trim.ToEntero, -1, CveActivoFijo:=CveActivoFijo, ImporteMX:=TxtValorCompra.Text.ToDecimal, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(DdlCtaContable.SelectedValue.Trim.ToEntero, UsuarioActual.CveEmpresa), -1)) Then + If ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, False, TxtValorCompra.Text.ToDecimal, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", 49, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", Now, DdlCtaContable.SelectedValue.Trim.ToEntero, -1, CveActivoFijo:=CveActivoFijo, ImporteMX:=TxtValorCompra.Text.ToDecimal) Then If Not ErrorGuardar Then If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, True, TxtValorCompra.Text.ToDecimal, TxtCodigo.Text.Trim, 68, TxtCodigo.Text.Trim, Now, IDCtaContableInv, -1, CveMovimientoAlmacen:=CveMovimientoSalidaInv, ImporteMX:=TxtValorCompra.Text.ToDecimal) Then ErrorGuardar = True diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index 50c928d51..866c58dfa 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -1173,7 +1173,7 @@ Public Class ClsCRM - Public Function RepAgendasBitacoras(CveEmpresa As Integer, CveVendedor As Integer, CveTipoProceso As Integer, FechaInicio As Date, FechaFin As Date) As Boolean + Public Function RepAgendasBitacoras(CveEmpresa As Integer, CveVendedor As Integer, CveTipoProceso As Integer, FechaInicio As Date, FechaFin As Date, Optional CveTipoEvento As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAgendasBitacoras", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -1183,6 +1183,7 @@ Public Class ClsCRM .Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveTipoEvento", SqlDbType.Int).Value = CveTipoEvento End With diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e0a31b773..9531d6855 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3770,7 +3770,7 @@ Public Class ClsContabilidad End Function - Public Function GetAnexoCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, OpcionCuentas As Integer, CveSubProyecto As String, CveEmpresa As Integer, Optional TipoMovtos As Integer = -1, Optional SAT As Integer = 0) As Boolean + Public Function GetAnexoCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, OpcionCuentas As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional TipoMovtos As Integer = -1, Optional SAT As Integer = 0) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoGet") @@ -3781,6 +3781,7 @@ Public Class ClsContabilidad .Add("@IdCuentaPadre", SqlDbType.Int).Value = IdCuenta .Add("@Tipo", SqlDbType.Int).Value = TipoMovtos .Add("@OpcionCuentas", SqlDbType.Int).Value = OpcionCuentas + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@SAT", SqlDbType.Int).Value = SAT @@ -3797,7 +3798,7 @@ Public Class ClsContabilidad End Function - Public Function GetMovimientosAuxiliaresCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, CveSubProyecto As String, CveEmpresa As Integer, TipoReporte As String) As Boolean + Public Function GetMovimientosAuxiliaresCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, TipoReporte As String) As Boolean Dim Retorno = False DataAdapter("PA_Conta_MovimientosAuxiliaresCatalogoGet") @@ -3806,6 +3807,7 @@ Public Class ClsContabilidad .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@IdCuentaPadre", SqlDbType.Int).Value = IdCuenta + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Tipo", SqlDbType.Int).Value = TipoReporte @@ -3841,7 +3843,7 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetEstadoActividades(FechaI As Date, FechaF As Date, TipoMovtos As Integer, CveSubProyecto As String, CveEmpresa As Integer, Optional SAT As Integer = 0) As Boolean + Public Function GetEstadoActividades(FechaI As Date, FechaF As Date, TipoMovtos As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional SAT As Integer = 0) As Boolean Dim Retorno = False DataAdapter("PA_Conta_EstadoActividadesGet") @@ -3850,6 +3852,7 @@ Public Class ClsContabilidad .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@Tipo", SqlDbType.Int).Value = TipoMovtos + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@SAT", SqlDbType.Int).Value = SAT diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 6d6d28caf..714db7d74 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1299,9 +1299,14 @@ Public Class ClsOC #End Region #Region " O R D E N E S - D E - C O M P R A - E S T A T U S" - Public Function GetEstatus() As Boolean + Public Function GetEstatus(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_EstatusGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index cad410eeb..1f3aec036 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -357,9 +357,14 @@ Public Class ClsOS '#End Region #Region "ClsOSEstatusOrdenServicio" - Public Function GetEstatusOrdenServicio() As Boolean + Public Function GetEstatusOrdenServicio(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_EstatusOrdenServicioGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a54f105bb..3ee4bfbb3 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1268,21 +1268,12 @@ Public Class ClsPaginas Public Shared Property GlobalDTProyectos(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTProyectos-{CveEmpresa}" - 'sino existe, recarga los datos If HttpContext.Current.Application(AppNombre) Is Nothing OrElse DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0 Then Dim ObjProyectos As New ClsProyectos If ObjProyectos.GetProyectos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProyectos.DtResultados ObjProyectos.Dispose() - Dim msg As String = "aqui no se carga proyectos" - If HttpContext.Current.Request IsNot Nothing Then - msg += HttpContext.Current.Request.ServerVariables("URL") - End If - msg.GuardaLog() End If - If Estatus <> -1 Then 'OrElse CveProyecto <> -1 - 'Dim StrSQL As New StringBuilder - 'If Estatus <> -1 Then StrSQL.Append($"Estatus = {Estatus}") - 'If CveProyecto <> -1 Then StrSQL.Append(" {If(StrSQL.Length > 0, "AND", "")} CveProyecto = {CveProyecto}") + If Estatus <> -1 Then Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEstatus = {Estatus}", "", DataViewRowState.CurrentRows) GlobalDTProyectos = Dv.ToTable Dv.Dispose() @@ -1291,13 +1282,6 @@ Public Class ClsPaginas End If End Get Set(value As DataTable) - If value Is Nothing OrElse value.Rows.Count = 0 Then - Dim msg As String = "aqui no se carga proyectos" - If HttpContext.Current.Request IsNot Nothing Then - msg += HttpContext.Current.Request.ServerVariables("URL") - End If - msg.GuardaLog() - End If Dim AppNombre As String = $"GlobalDTProyectos-{CveEmpresa}" HttpContext.Current.Application(AppNombre) = value End Set @@ -1336,11 +1320,10 @@ Public Class ClsPaginas If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados ObjSubProyectos.Dispose() End If - If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then + If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEstatus <> -1 Then Dim StrSQL As New StringBuilder If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) - If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario) If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", CveEstatus) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) @@ -1363,10 +1346,9 @@ Public Class ClsPaginas If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) ObjSubProyectos.Dispose() End If - If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then + If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEstatus <> -1 Then Dim StrSQL As New StringBuilder If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) - If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario) If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatusProyecto = {0}", CveEstatus) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) @@ -1405,12 +1387,20 @@ Public Class ClsPaginas ' Application("GlobalDTMesas") = value ' End Set 'End Property - Property GlobalDTTipoOrdenServicios(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTTipoOrdenServicios(CveEmpresa As Integer) As DataTable Get - GlobalDTTipoOrdenServicios = DirectCast(Application("GlobalDTTipoOrdenServicios"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) + Dim AppNombre As String = $"GlobalDTTipoOrdenServicios-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjOS As New ClsOS + If ObjOS.GetTipoOrdenesServicios(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjOS.DtResultados + ObjOS.Dispose() + End If + GlobalDTTipoOrdenServicios = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoOrdenServicios") = value + Dim AppNombre As String = $"GlobalDTTipoOrdenServicios-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTSubTipoOrdenServicios() As DataTable @@ -1722,20 +1712,36 @@ Public Class ClsPaginas Application("GlobalDTAFCaracteristicasOpciones") = value End Set End Property - Property GlobalDTAFCaracteristicas() As DataTable + Public Shared Property GlobalDTAFCaracteristicas(CveEmpresa As Integer) As DataTable Get - GlobalDTAFCaracteristicas = DirectCast(Application("GlobalDTAFCaracteristicas"), DataTable) + Dim AppNombre As String = $"GlobalDTAFCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjActivosFijos As New ClsAF + If ObjActivosFijos.GetCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjActivosFijos.DtResultados + ObjActivosFijos.Dispose() + End If + GlobalDTAFCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAFCaracteristicas") = value + Dim AppNombre As String = $"GlobalDTAFCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAFCaracteristicasClasificaciones() As DataTable + Public Shared Property GlobalDTAFCaracteristicasClasificaciones(CveEmpresa As Integer) As DataTable Get - GlobalDTAFCaracteristicasClasificaciones = DirectCast(Application("GlobalDTAFCaracteristicasClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTAFCaracteristicasClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjActivosFijos As New ClsAF + If ObjActivosFijos.GetCaracteristicasClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjActivosFijos.DtResultados + ObjActivosFijos.Dispose() + End If + GlobalDTAFCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAFCaracteristicasClasificaciones") = value + Dim AppNombre As String = $"GlobalDTAFCaracteristicasClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As DataTable @@ -1915,7 +1921,7 @@ Public Class ClsPaginas 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjClientes As New ClsClientes - If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados + If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados.Copy() ObjClientes.Dispose() End If If CveEmpresa <> -1 Then @@ -1957,18 +1963,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTEstatusOrdenServicios"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTEstatusOrdenServicios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTEstatusOrdenServicios = DirectCast(Application("GlobalDTEstatusOrdenServicios"), DataTable) + Dim AppNombre As String = $"GlobalDTEstatusOrdenServicios-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjOS As New ClsOS + If ObjOS.GetEstatusOrdenServicio(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjOS.DtResultados + ObjOS.Dispose() End If + GlobalDTEstatusOrdenServicios = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTEstatusOrdenServicios") = value + Dim AppNombre As String = $"GlobalDTEstatusOrdenServicios-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property 'Variables para Ventas @@ -2446,87 +2454,94 @@ Public Class ClsPaginas Application("GlobalDTActivoFijos") = value End Set End Property - Property GlobalDTEstadoActivoFijo() As DataTable + Public Shared Property GlobalDTEstadoActivoFijo() As DataTable Get - GlobalDTEstadoActivoFijo = DirectCast(Application("GlobalDTEstadoActivoFijo"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTEstadoActivoFijo") = value - End Set - End Property - Property GlobalDTMarcaActivoFijo(CveEmpresa As Integer) As DataTable - Get - Dim dt As DataTable = Nothing - Dim ObjAF As New ClsAF - If ObjAF.GetMarcasActivosFijos(CveEmpresa) Then - dt = ObjAF.DtResultados + Dim AppNombre As String = "GlobalDTEstadoActivoFijo" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjActivosFijos As New ClsAF + If ObjActivosFijos.GetEstatusActivoFijo() Then HttpContext.Current.Application(AppNombre) = ObjActivosFijos.DtResultados + ObjActivosFijos.Dispose() End If - ObjAF.Dispose() - GlobalDTMarcaActivoFijo = dt + GlobalDTEstadoActivoFijo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTMarcaActivoFijo") = value + Dim AppNombre As String = "GlobalDTEstadoActivoFijo" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTModeloActivoFijo(CveEmpresa As Integer, CveMarca As Integer) As DataTable + Public Shared Property GlobalDTMarcaActivoFijo(CveEmpresa As Integer) As DataTable Get - Dim dt As DataTable = Nothing - Dim ObjAF As New ClsAF - If ObjAF.GetModelosActivosFijos(CveEmpresa, CveMarca) Then - dt = ObjAF.DtResultados + Dim AppNombre As String = $"GlobalDTMarcaActivoFijo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjActivosFijos As New ClsAF + If ObjActivosFijos.GetMarcasActivosFijos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjActivosFijos.DtResultados + ObjActivosFijos.Dispose() End If - ObjAF.Dispose() - GlobalDTModeloActivoFijo = dt + GlobalDTMarcaActivoFijo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTModeloActivoFijo") = value + Dim AppNombre As String = $"GlobalDTMarcaActivoFijo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer, Optional CveTipoActivoFijo As Integer = -1) As DataTable + Public Shared Property GlobalDTModeloActivoFijo(CveEmpresa As Integer, CveMarca As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTModeloActivoFijo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjActivosFijos As New ClsAF + If ObjActivosFijos.GetModelosActivosFijos(CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjActivosFijos.DtResultados + ObjActivosFijos.Dispose() + End If + If CveMarca > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveMarca = {CveMarca}", "", DataViewRowState.CurrentRows) + GlobalDTModeloActivoFijo = Dv.ToTable + Dv.Dispose() + Else + GlobalDTModeloActivoFijo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTModeloActivoFijo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + Public Shared Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer, Optional CveTipoActivoFijo As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTSubTipoActivoFijo-{CveEmpresa}" 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjSubTipos As New ClsAF - If ObjSubTipos.GetSubTiposActivosFijos(CveEmpresa) Then Application(AppNombre) = ObjSubTipos.DtResultados + If ObjSubTipos.GetSubTiposActivosFijos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubTipos.DtResultados ObjSubTipos.Dispose() End If Dim Str As New StringBuilder If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) If CveTipoActivoFijo > 0 Then Str.AppendFormat("AND CveTipoActivoFijo = {0}", CveTipoActivoFijo) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) GlobalDTSubTipoActivoFijo = Dv.ToTable Dv.Dispose() End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTSubTipoActivoFijo-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set - 'Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTSubTipoActivoFijo = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable) - ' End If - 'End Get - 'Set(value As DataTable) - ' Application("GlobalDTSubTipoActivoFijo") = value - 'End Set End Property - Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoActivoFijo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoActivoFijo = DirectCast(Application("GlobalDTTipoActivoFijo"), DataTable) + Dim AppNombre As String = $"GlobalDTTipoActivoFijo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim GetTiposActivosFijos As New ClsAF + If GetTiposActivosFijos.GetCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = GetTiposActivosFijos.DtResultados + GetTiposActivosFijos.Dispose() End If + GlobalDTTipoActivoFijo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoActivoFijo") = value + Dim AppNombre As String = $"GlobalDTTipoActivoFijo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region @@ -3220,18 +3235,20 @@ Public Class ClsPaginas End Property #End Region #Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" - Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTOCEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatus = DirectCast(Application("GlobalDTOCEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTOCEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjOC As New ClsOC + If ObjOC.GetEstatus(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + ObjOC.Dispose() End If + GlobalDTOCEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTOCEstatus") = value + Dim AppNombre As String = $"GlobalDTOCEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable @@ -4276,7 +4293,7 @@ Public Class ClsPaginas ObjUsuario.Dispose() Return Retorno End Function - Public Sub CargarCentrosDeCosto(DdlProyecto As ListControl, DdlSubProyecto As ListControl, LthProyectoP As Label, LblSubProyecto As Label, Optional AplicaTodos As String = "Todos", Optional DdlSubProyectoMultiple As ListBox = Nothing) + Public Sub CargarCentrosDeCosto(DdlProyecto As ListControl, DdlSubProyecto As ListControl, LthProyectoP As Label, LblSubProyecto As Label, Optional AplicaTodos As String = "Todos", Optional DdlSubProyectoMultiple As ListControl = Nothing) Select Case UsuarioActual.Empresa.Tipo_CentroCosto Case 1 If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False @@ -4308,9 +4325,20 @@ Public Class ClsPaginas If AplicaTodos <> "" Then DdlSubProyectoMultiple.Items.Insert(0, New ListItem(AplicaTodos, "-1")) End If If DdlSubProyecto IsNot Nothing Then - DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) - DdlSubProyecto.DataBind() - If AplicaTodos <> "" Then DdlSubProyecto.Items.Insert(0, New ListItem(AplicaTodos, "-1")) + CargarSubProyecto(DdlSubProyecto, "-1", AplicaTodos) + End If + End Sub + Public Sub CargarSubProyecto(DdlSubProyecto As ListControl, CveProyecto As String, Optional AplicaTodos As String = "Seleccione") + DdlSubProyecto.Items.Clear() + DdlSubProyecto.ClearSelection() + DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto.ToEntero(), UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(CveProyecto.ToEntero(), -1, UsuarioActual.CveEmpresa, 1)) + DdlSubProyecto.DataBind() + If AplicaTodos <> "" Then + If DdlSubProyecto.GetType() Is GetType(ListBox) Then + 'DdlSubProyecto.Text = "Seleccione" + Else + DdlSubProyecto.Items.Insert(0, New ListItem(If(CveProyecto <> "-1", AplicaTodos, "Todos"), "-1")) + End If End If End Sub Public Sub CargaSeccionesAlmacen(ByRef DdlSeccionAlmacen As DropDownList, CveAlmacen As Integer, CvePS As Integer, CveEmpresa As Integer, Optional IncluyeSeleccione As Boolean = False) @@ -7611,7 +7639,7 @@ Public Class ClsPaginas If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 235, Pago.Referencia, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=Pago.CveCompraAmortizacion, CveVentaAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True Else 'Agregamos Nacional - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 60, Pago.Referencia, Concepto, CompraActual.IdCtaContableProv, CveCompra:=Pago.CveCompraAmortizacion, CveVentaAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 60, Pago.Referencia, Concepto, CompraActual.IdCtaContableProv, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True End If End If If Pago.TipoPago = "DD" AndAlso Not ErrorMovtos Then ' D E U D O R D I V E R S O @@ -8074,7 +8102,7 @@ Public Class ClsPaginas End Class #End Region -#Region "GlobalSIGAppPaginas" +#Region "Diccionario de páginas" Private Function Obt_ClavePagina(Pagina As String) As Integer Dim Retorno As Integer Dim PaginaDict As System.Collections.Hashtable diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index c6570ec94..c516288de 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1483,8 +1483,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Public Property CveMotivoBaja As Integer Public Property FechaBaja As Date Public Property CveEstatusPersonal As Integer - Public Property IdCtaContPrestamos As Integer - Public Property CveCuentaPrestamos As Integer + Public Property IdCtaContPrestamos As Integer Public Property CtaContPrestamos As String Public Property TelefonoExtension As String Public Property CelularPersonal As String @@ -1538,8 +1537,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Public Property CveUsuario As Integer Public Property Usuario As String Public Property CveEmpresa As Integer - Public Property IdCtaContPersonal As Integer - Public Property CveCuentaPersonal As Integer + Public Property IdCtaContPersonal As Integer Public Property CtaContPersonal As String Public Property CvePersonalPadre As Integer @@ -1700,10 +1698,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Me.Jornada = Data.Rows(0)("Jornada").ToString Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero IdCtaContPrestamos = Data.Rows(0)("IdCtaContPrestamos").ToString.ToEntero - CveCuentaPrestamos = Data.Rows(0)("IdCtaContPrestamosSIG").ToString.ToEntero CtaContPrestamos = Data.Rows(0)("CtaContPrestamos").ToString IdCtaContPersonal = Data.Rows(0)("IdCtaContPersonal").ToString.ToEntero - CveCuentaPersonal = Data.Rows(0)("IdCtaContPersonalSIG").ToString.ToEntero CtaContPersonal = Data.Rows(0)("CtaContPersonal").ToString CvePersonalPadre = Data.Rows(0)("CvePersonalPadre").ToString.ToEntero CveUsuarioNomina = Data.Rows(0)("CveUsuarioNomina").ToString.ToEntero @@ -1880,16 +1876,12 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Me.Jornada = Data.Rows(0)("Jornada").ToString Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero IdCtaContPrestamos = Data.Rows(0)("IdCtaContPrestamos").ToString.ToEntero - CveCuentaPrestamos = Data.Rows(0)("IdCtaContPrestamosSIG").ToString.ToEntero CtaContPrestamos = Data.Rows(0)("CtaContPrestamos").ToString IdCtaContPersonal = Data.Rows(0)("IdCtaContPersonal").ToString.ToEntero - CveCuentaPersonal = Data.Rows(0)("IdCtaContPersonalSIG").ToString.ToEntero CtaContPersonal = Data.Rows(0)("CtaContPersonal").ToString CvePersonalPadre = Data.Rows(0)("CvePersonalPadre").ToString.ToEntero - CvePersonalPadre = Data.Rows(0)("CvePersonalPadre").ToString.ToEntero CveUsuarioNomina = Data.Rows(0)("CveUsuarioNomina").ToString.ToEntero - End If Retorno = True Catch ex As SqlException diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index c1b5f590c..2ca94fb56 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -384,7 +384,6 @@ Public Class ClsSisEmpresas _Empresa.FacturaProduccion = If(Data.Rows(0)("FacturaProduccion").ToString = "", False, CBool(Data.Rows(0)("FacturaProduccion").ToString)) _Empresa.EstatusFacturacion = Data.Rows(0)("EstatusFacturacion").ToString <> "No" _Empresa.UsaContabilidad = Data.Rows(0)("UsaContabilidad").ToString <> "No" - _Empresa.UsaContabilidadSIG = Data.Rows(0)("UsaContabilidadSIG").ToString <> "No" _Empresa.UsaBancos = Data.Rows(0)("UsaBancos").ToString <> "No" _Empresa.UsaVentas = Data.Rows(0)("UsaVentas").ToString <> "No" _Empresa.UsaCxC = Data.Rows(0)("UsaCxC").ToString <> "No" diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 1752b34e4..c64f9bbda 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2152,7 +2152,7 @@ Public Class ClsVentas End Function Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String, - Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional CvePromocionPadre As Integer = -1) As Integer + Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1) As Integer Dim Retorno = -1 DataAdapter("PA_Vta_PromocionesAdd") @@ -2170,7 +2170,6 @@ Public Class ClsVentas .Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor - .Add("@CvePromocionPadre", SqlDbType.Int).Value = CvePromocionPadre .Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -5529,12 +5528,13 @@ Public Class ClsVentas End Function - Public Function GetLineasAdicionales(CveCliente As Integer, TipoLinea As Integer, CveMoneda As Integer, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer) As Boolean + Public Function GetLineasAdicionales(CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, CveMoneda As Integer, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_LineasAdicionalesGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveLineaAdicionalEstatus", SqlDbType.Int).Value = CveLineaAdicionalEstatus diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb index c55637868..666880f07 100644 --- a/App_Code/Empresa.vb +++ b/App_Code/Empresa.vb @@ -68,8 +68,7 @@ Public Class Empresa Public Property RegimenFiscal As String Public Property EstatusFacturacion As Boolean Public Property Estatus As Boolean - Public Property UsaContabilidad As Boolean - Public Property UsaContabilidadSIG As Boolean + Public Property UsaContabilidad As Boolean Public Property UsaBancos As Boolean Public Property UsaVentas As Boolean Public Property UsaCompras As Boolean diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 654ec873e..47d5bf7b6 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2756,6 +2756,8 @@ Namespace Modelos End If ImporteAcumulado91 += (ImporteMN91).RoundSQL + Dim tCveConcepto As Integer = 251 + If Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then tCveConcepto = 301 If UsaComplementariaClientes = True AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then Dim ImporteComplementarioNC As Decimal = ((Importe251 * Dr("TCCambioValuacion").ToString.ToDecimal) - Importe251).RoundSQL If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 207, Concepto, FechaMovimiento, IdCtaContableClienteComplementaria, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteComplementarioNC, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal) Then @@ -2763,7 +2765,7 @@ Namespace Modelos Exit For End If End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=Importe251, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, tCveConcepto, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=Importe251, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then ErrorPrepoliza = True Exit For End If @@ -3381,8 +3383,8 @@ Namespace Modelos 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "20242") Then - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then - TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveClasificacion").ToString + If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then + TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString End If End If @@ -8916,13 +8918,6 @@ Namespace Modelos Public Property CuentaInventario As String Public Property IdCuentaIngresos As Integer? Public Property CuentaIngresos As String - Public Property IdCuentaContableSIG As Integer? - Public Property IdCuentaCostosSIG As Integer? - Public Property IdCuentaGastoSIG As Integer? - Public Property IdCuentaIngresosSIG As Integer? - Public Property IdCuentaInventarioSIG As Integer? - Public Property IdCuentaRetIVASIG As Integer? - Public Property IdCuentaRetISRSIG As Integer? Public Property Estado As Boolean Public Property Estatus As String Public Property RequiereSerieLote As Boolean? diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 78e3472d1..01c04feba 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -48,6 +48,7 @@ Partial Class Bancos_DepositosCaja DdlCajaChica.Items.Add(New ListItem("Todas", "-1")) DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Solidaridad", "7850")) DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Obregón", "7853")) + DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Matriz", "7861")) divFolio.Visible = True End If diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index dad351faf..5ba9b918a 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1020,6 +1020,12 @@ Partial Class Bancos_IE DdlPersonal.Enabled = False End If + 'SI TIENE EL DATO DEBE MOSTRALO + If UsuarioActual.CveEmpresa = 119 AndAlso LblPagueseA.Text = "Beneficiario" AndAlso Not String.IsNullOrEmpty(ObjIE.PagueseA) Then + LblPagarA.Visible = True + LblPagarA.Text = ObjIE.PagueseA + End If + IDPoliza = ObjIE.IDPoliza IDCtaContable = ObjIE.IdCtaContable @@ -2773,7 +2779,7 @@ Partial Class Bancos_IE End If End If Dim UsaComplementariaBancos As Boolean = False - UsaComplementariaBancos = True + UsaComplementariaBancos = If(UsuarioActual.CveEmpresa.Contiene(13, 83), False, True) If MsgError = "" Then @@ -3706,8 +3712,16 @@ Partial Class Bancos_IE IDCtaBeneficiario = IdCtaAnticipoExtranjera End If + + Dim Importe30 As Decimal = TxtImporte.Text.ToDecimal + + If Not UsaComplementariaBancos AndAlso tCveMoneda > 1 Then + Importe30 = TxtImporte.Text.ToDecimal + (TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal - TxtImporte.Text.ToDecimal).RoundSQL() + End If + + 'MOVIMIENTOS EGRESOS - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=Importe30, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then @@ -3725,7 +3739,7 @@ Partial Class Bancos_IE End If 'BANCOS COMPLEMENTARIA - If tCveMoneda > 1 Then + If tCveMoneda > 1 And UsaComplementariaBancos Then Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL() If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 25d3d9559..33211d3ff 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -954,7 +954,7 @@ Partial Class Bancos_PolizaCheque Importe = Importe * TC End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(gvr.DataKey("IDCuenta").ToEntero, UsuarioActual.CveEmpresa), -1), TipoCambio:=TC) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, TipoCambio:=TC) Then MsgError = "no se pudo insertar el detalle de la póliza2" End If diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 1ee92c84d..b9eaf92c1 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -3442,7 +3442,7 @@ Partial Class Bancos_PopIECompras Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs) - Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace(",", "").ToDecimal + Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace("MXN", "").Replace(",", "").ToDecimal Dim ImportePagado As Decimal = TxtImporte.Text.ToDecimal If ChkPagarPesos.Checked Then diff --git a/Bancos/ProductosFinancieros.aspx.vb b/Bancos/ProductosFinancieros.aspx.vb index ec2761da3..dc17b77df 100644 --- a/Bancos/ProductosFinancieros.aspx.vb +++ b/Bancos/ProductosFinancieros.aspx.vb @@ -366,7 +366,7 @@ Partial Class Bancos_ProductosFinancieros idCuentaContabilizacion = 0 End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, "", If(DdlTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 AndAlso ConceptoContable = 30, 42, ConceptoContable), DdlTipoMovimiento.SelectedItem.Text & If(TxtConcepto.Text.Trim.Length > 0, " - " & TxtConcepto.Text.Trim, ""), FechaMovimiento, If(DdlTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 AndAlso ConceptoContable = 30, DdlTarjeta.SelectedValue.ToEntero, IdCtaContablePP), -1, CveIE, ImporteMX:=importeMovimiento, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(If(DdlTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 AndAlso ConceptoContable = 30, DdlTarjeta.SelectedValue.ToEntero, IdCtaContablePP), UsuarioActual.CveEmpresa), -1)) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, "", If(DdlTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 AndAlso ConceptoContable = 30, 42, ConceptoContable), DdlTipoMovimiento.SelectedItem.Text & If(TxtConcepto.Text.Trim.Length > 0, " - " & TxtConcepto.Text.Trim, ""), FechaMovimiento, If(DdlTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 AndAlso ConceptoContable = 30, DdlTarjeta.SelectedValue.ToEntero, IdCtaContablePP), -1, CveIE, ImporteMX:=importeMovimiento) Then ErrorTransaccion = True End If End If diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 8941c6e1b..27467a8c7 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -887,7 +887,7 @@ Partial Class Bancos_ProveedoresAbonar If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then Dim ObjCreditos As New ClsBancos ObjCreditos.GetTarjetasCreditos(DdlCuenta.SelectedValue.ToEntero, DdlTarjeta.SelectedValue.ToEntero) - If ObjCreditos.DtResultados.Rows.Count > 0 AndAlso (ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero > 0 Or ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjetaSIG").ToString.ToEntero > 0) Then + If ObjCreditos.DtResultados.Rows.Count > 0 AndAlso (ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero > 0) Then IdCuenta = ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero End If diff --git a/Bancos/RepProgramarRecursos.aspx.vb b/Bancos/RepProgramarRecursos.aspx.vb index f0720faa8..07f3fd648 100644 --- a/Bancos/RepProgramarRecursos.aspx.vb +++ b/Bancos/RepProgramarRecursos.aspx.vb @@ -170,7 +170,7 @@ Partial Class Bancos_RepProgramarRecursos DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) DdlSubProyecto.DataBind() ' DdlEstatusCompra.SelectedValue = "2" 'las programadas - DdlAgrupador.SelectedValue = "2" + 'DdlAgrupador.SelectedValue = "2" 'Gv.Columns(8).Visible = True DdlSubProyecto.Items.Insert(1, New ListItem("Sin Proyecto", "-2")) diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index cc60528a8..ab44c7dd8 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -253,7 +253,8 @@ Partial Class Bancos_Transferencias If CveMonedaOrigen = 1 AndAlso CveMonedaDestino <> 1 Then 'pesos a otra moneda se divide - ImporteMXDestino = Math.Round(TxtImporte.Text.Trim.ToDouble / TxtTipoCambio.Text.ToDouble, 2) + ImporteDestino = Math.Round(TxtImporte.Text.Trim.ToDouble / TxtTipoCambio.Text.ToDouble, 2) + ImporteMXDestino = TxtImporte.Text.Trim.ToDouble ElseIf CveMonedaOrigen <> 1 AndAlso CveMonedaDestino = 1 Then 'de otra moneda a pesos se multiplica ImporteDestino = Math.Round(TxtImporte.Text.Trim.ToDouble * TxtTipoCambio.Text.ToDouble, 2) @@ -269,6 +270,7 @@ Partial Class Bancos_Transferencias TipoCambio = TxtTipoCambio.Text.ToDouble 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate) End If + Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/Transferencias", 13, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TxtFechaDocumento.Text.ToDate, $"Transferencia entre cuentas {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If UsuarioActual.CveEmpresa = 48 Then @@ -363,11 +365,21 @@ Partial Class Bancos_Transferencias If RBLOpcion.SelectedValue = "2" Then TipoMovtoDetalle = False ' cuando sea un reembolso/devolución, es ingreso a bancos Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle, TxtImporte.Text.ToDouble, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableOrigen, -1, CveIE, ImporteMX:=If(UsuarioActual.CveEmpresa = 119, TxtImporte.Text.ToDouble, ImporteMXOrigen), ImporteME:=If(CveMonedaOrigen > 1, TxtImporte.Text.ToDouble * TC, 0), CveCuenta:=CveCuentaOrigen, CveIEDevolucion:=CveIEDevolucion) Then - If CveMonedaOrigen > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle, + TxtImporte.Text.ToDouble, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableOrigen, -1, CveIE, + ImporteMX:=If(Not UsuarioActual.CveEmpresa.Contiene(13, 83), TxtImporte.Text.ToDouble, ImporteMXOrigen), + ImporteME:=If(CveMonedaOrigen > 1, TxtImporte.Text.ToDouble * TC, 0), + CveCuenta:=CveCuentaOrigen, + CveIEDevolucion:=CveIEDevolucion) Then + + If CveMonedaOrigen > 1 AndAlso Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'Agregamos complementaria - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle, 0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaOrigen, -1, CveIE:=CveIE, ImporteMX:=(TxtImporte.Text.ToDouble * TC - TxtImporte.Text.ToDouble).RoundSQL, ImporteME:=TxtImporte.Text.ToDouble, TipoCambio:=TC) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle, + 0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaOrigen, -1, CveIE:=CveIE, + ImporteMX:=(TxtImporte.Text.ToDouble * TC - TxtImporte.Text.ToDouble).RoundSQL, + ImporteME:=TxtImporte.Text.ToDouble, + TipoCambio:=TC) Then MsgError = "Ocurrió un error al registrar el asiento del ingreso." End If @@ -378,20 +390,27 @@ Partial Class Bancos_Transferencias For Each row As GridViewRow In GvTC.Rows - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, row.FCTextBox("TxtAbono").Text.ToDouble, $"Transferencia entre cuentas {TxtObservaciones.Text}", 41, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, If(row.DataKey("IdCtaContableTarjeta").ToEntero > 0, row.DataKey("IdCtaContableTarjeta").ToEntero, row.DataKey("IdCtaContable").ToEntero), -1, CveIEDestino, ImporteMX:=row.FCTextBox("TxtAbono").Text.ToDouble, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(If(row.DataKey("IdCtaContableTarjeta").ToEntero > 0, row.DataKey("IdCtaContableTarjeta").ToEntero, row.DataKey("IdCtaContable").ToEntero), UsuarioActual.CveEmpresa), -1)) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, row.FCTextBox("TxtAbono").Text.ToDouble, $"Transferencia entre cuentas {TxtObservaciones.Text}", 41, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, If(row.DataKey("IdCtaContableTarjeta").ToEntero > 0, row.DataKey("IdCtaContableTarjeta").ToEntero, row.DataKey("IdCtaContable").ToEntero), -1, CveIEDestino, ImporteMX:=row.FCTextBox("TxtAbono").Text.ToDouble) Then MsgError = "Ocurrio un error al ingresar la prepoliza" End If Next 'Agregamos la contraria a bancos cuando es cuenta Else - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, ImporteDestino, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableDestino, -1, CveIEDestino, ImporteMX:=If(UsuarioActual.CveEmpresa = 119, ImporteDestino, ImporteMXDestino), ImporteME:=If(CveMonedaDestino > 1, TxtImporte.Text.ToDouble * TC, 0), CveCuenta:=CveCuentaDestino) Then + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, + ImporteDestino, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableDestino, -1, CveIEDestino, + ImporteMX:=If(Not UsuarioActual.CveEmpresa.Contiene(13, 83), ImporteDestino, ImporteMXDestino), + ImporteME:=If(CveMonedaDestino > 1, ImporteDestino, 0), CveCuenta:=CveCuentaDestino) Then MsgError = "Ocurrio un error al ingresar la prepoliza" End If - If CveMonedaDestino > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then + If CveMonedaDestino > 1 AndAlso Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'Agregamos complementaria - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, 0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=(TxtImporte.Text.ToDouble * TC - TxtImporte.Text.ToDouble).RoundSQL, ImporteME:=TxtImporte.Text.ToDouble, TipoCambio:=TC) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, + 0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaDestino, -1, CveIE:=CveIEDestino, + ImporteMX:=(ImporteMXDestino - ImporteDestino).RoundSQL, + ImporteME:=ImporteDestino, TipoCambio:=TC) Then MsgError = "Ocurrió un error al registrar el asiento del ingreso." End If diff --git a/CGame/CatEstatus.aspx.VB b/CGame/CatEstatus.aspx.VB index 4dbf3cd54..710c68a21 100644 --- a/CGame/CatEstatus.aspx.VB +++ b/CGame/CatEstatus.aspx.VB @@ -1,7 +1,6 @@ Option Strict On Imports System.Data Imports System.Collections.Generic Imports System.Linq Imports System.Web Imports System.Web.UI.WebControls Imports Extensiones Partial Class CATEstatus Inherits ClsPaginas - #Region "Propiedades" Property CveEstatus As Integer Get If Not ViewState("CveEstatus") Is Nothing Then @@ -19,7 +18,9 @@ #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - CargaEstatus() End If End Sub Protected Sub CargaEstatus() Dim ObjEsta As New ClsCGame() If ObjEsta.GetEstatus(UsuarioActual.CveEmpresa) Then + CargaEstatus() + 'CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + End If End Sub Protected Sub CargaEstatus() Dim ObjEsta As New ClsCGame() If ObjEsta.GetEstatus(UsuarioActual.CveEmpresa) Then GVEstatus.DataSource = ObjEsta.DtResultados GVEstatus.DataBind() End If diff --git a/CRM/RepAgendasBitacoras.aspx b/CRM/RepAgendasBitacoras.aspx index 0ea6824c0..edbe65404 100644 --- a/CRM/RepAgendasBitacoras.aspx +++ b/CRM/RepAgendasBitacoras.aspx @@ -71,6 +71,15 @@ + +
+ + Todos + Bitácora + Agenda + +
+ diff --git a/CRM/RepAgendasBitacoras.aspx.cs b/CRM/RepAgendasBitacoras.aspx.cs index 8f2242b97..8b725b80c 100644 --- a/CRM/RepAgendasBitacoras.aspx.cs +++ b/CRM/RepAgendasBitacoras.aspx.cs @@ -38,7 +38,7 @@ public partial class CRM_AgendasBitacoras : ClsPaginas ClsCRM ObjCRM = new ClsCRM(); //nt CveEmpresa, int CveVendedor, int CveTipoProceso, DateTime FechaInicio, DateTime FechaFin - if (ObjCRM.RepAgendasBitacoras(UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(),DdlTipoProceso.SelectedValue.ToEntero(), TxtFechaInicio.Text.ToDate(), TxtFechaFin.Text.ToDate())) + if (ObjCRM.RepAgendasBitacoras(UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(),DdlTipoProceso.SelectedValue.ToEntero(), TxtFechaInicio.Text.ToDate(), TxtFechaFin.Text.ToDate(), CveTipoEvento:DdlTipoEvento.SelectedValue.ToEntero())) { GVDatos.DataSource = ObjCRM.DtResultados; GVDatos.DataBind(); diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index b42713ae4..be2e48980 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -873,7 +873,10 @@
- + + Anticipos/NC Vinculados + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 2c13b4900..0de6f650c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1667,17 +1667,14 @@ Partial Class Compras_Compras 'RegistraScript("ScrollVentanaAddProducto();") - If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(267) = "1" Then 'cuando es llantera. y citrícola divImportacion.Visible = True chkImportacion.Attributes.Add("onclick", "ChkImportacion(this);") End If - - MostrarOcultarColumnaIEPS() - End Sub #Region "C A R G A S" @@ -3125,6 +3122,10 @@ Partial Class Compras_Compras GvAnticiposSel.DataSource = dtnc GvAnticiposSel.DataBind() + If dtnc IsNot Nothing AndAlso dtnc.Rows.Count > 0 Then + LtlGvAnticiposSel.Visible = True + End If + '' VALIDA ELIMINAR COMPRA, QUE NO TENGA PAGOS CONCILIADOS If (UsuarioActual.TienePermisoProceso(77) OrElse UsuarioActual.TienePermisoProceso(135)) AndAlso dr("NumPagosConciliados").ToString.ToEntero = 0 Then ' Eliminar compra @@ -3198,13 +3199,12 @@ Partial Class Compras_Compras End If 'Tiene Importacion - If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then - If dr("EsImportacion").ToString = "True" Then + + If dr("EsImportacion").ToString = "True" Then chkImportacion.Checked = True Else chkImportacion.Checked = False End If - End If CargaComplementosPago() CargaGvBitacora() InventarioMov() @@ -7416,11 +7416,12 @@ Partial Class Compras_Compras Else Dim usacomplementariaAnticipo As Boolean = False - usacomplementariaAnticipo = If(Ant.TCCompra > 1, True, False) + usacomplementariaAnticipo = If(Ant.TCCompra > 1 And not UsuarioActual.CveEmpresa.Contiene(13,83), True, False) Dim TipoCambioAnt As Decimal = Ant.TCCompra Dim ImporteAnt As Decimal = importeMovimiento Dim ImporteAntMN As Decimal = ImporteAnt * TipoCambioAnt + If usacomplementariaAnticipo Then IdCtaContable = CtaProveedorAnticiposComplementaria ImporteAntMN = TipoCambioAnt * ImporteAnt - ImporteAnt @@ -7440,6 +7441,11 @@ Partial Class Compras_Compras 'Dim ImporComisionAnticipo As Decimal = Ant.ImporteComision 'Dim importeMNComision As Decimal = ImporComisionAnticipo * tipoCambioActual * Multiplicador + + If Not usacomplementariaAnticipo Then + ImporteAntMN = TipoCambioAnt * ImporteAnt + End If + If ImporComisionAnticipo = 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAnt, Referencia, ConceptoContableAnticipo, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteMX:=ImporteAntMN, ImporteME:=If(tipoCambioActual = 1, 0, ImporteAnt), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -12280,6 +12286,7 @@ Partial Class Compras_Compras End Select romCreditosTabla.Visible = False Case "4" + EsContado = False CargaCreditosDisponibles() Exit Select End Select diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 9283bbf74..975465cb7 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -697,7 +697,7 @@ Partial Class Compras_Proveedores DtCuentasContables = Nothing End If ObjContabilidad.Dispose() - ElseIf UsuarioActual.Empresa.UsaContabilidadSIG Then + ElseIf UsuarioActual.Empresa.TipoContabilidad = 1 Then Dim ObjContabilidad As New ClsContabilidad If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then DtCuentasContables = ObjContabilidad.DtResultados @@ -904,7 +904,7 @@ Partial Class Compras_Proveedores End If 'Contable - If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaContabilidadSIG Then + If UsuarioActual.Empresa.UsaContabilidad Then DdlCtaContAcreedores.AutoPostBack = True DdlCtaContProveedores.AutoPostBack = True DdlCtaContAnticipos.AutoPostBack = True @@ -943,29 +943,6 @@ Partial Class Compras_Proveedores DdlCtaContRetISRAcreditable.Attributes.Add("onclick", "CargaCuentas(19);") DdlCtaContRetIVAAcreditable.Attributes.Add("onclick", "CargaCuentas(20);") - If UsuarioActual.Empresa.UsaContabilidadSIG = True And UsuarioActual.Empresa.UsaContabilidad = False Then - DdlCtaContAcreedores.DataTextField = "Cuenta" : DdlCtaContAcreedores.DataValueField = "CveCuenta" - DdlCtaContProveedores.DataTextField = "Cuenta" : DdlCtaContProveedores.DataValueField = "CveCuenta" - DdlCtaContAnticipos.DataTextField = "Cuenta" : DdlCtaContAnticipos.DataValueField = "CveCuenta" - DdlCtaContFondoGarantia.DataTextField = "Cuenta" : DdlCtaContFondoGarantia.DataValueField = "CveCuenta" - DdlCtaContRetIVA.DataTextField = "Cuenta" : DdlCtaContRetIVA.DataValueField = "CveCuenta" - DdlCtaContRetIVAAcreditable.DataTextField = "Cuenta" : DdlCtaContRetIVAAcreditable.DataValueField = "CveCuenta" - DdlCtaContRetISR.DataTextField = "Cuenta" : DdlCtaContRetISR.DataValueField = "CveCuenta" - DdlCtaContComplementaria.DataTextField = "Cuenta" : DdlCtaContComplementaria.DataValueField = "CveCuenta" - DdlCtaContExtranjera.DataTextField = "Cuenta" : DdlCtaContExtranjera.DataValueField = "CveCuenta" - DdlCtaContDeudor.DataTextField = "Cuenta" : DdlCtaContDeudor.DataValueField = "CveCuenta" - DdlCtaContDeudorExtranjera.DataTextField = "Cuenta" : DdlCtaContDeudorExtranjera.DataValueField = "CveCuenta" - DdlCtaContDocsXPagar.DataTextField = "Cuenta" : DdlCtaContDocsXPagar.DataValueField = "CveCuenta" - DdlCtaContDeudorComplementaria.DataTextField = "Cuenta" : DdlCtaContDeudorComplementaria.DataValueField = "CveCuenta" - DdlCtaContDocsXPagarComplementaria.DataTextField = "Cuenta" : DdlCtaContDocsXPagarComplementaria.DataValueField = "CveCuenta" - DdlCtaContRetISRAcreditable.DataTextField = "Cuenta" : DdlCtaContRetISRAcreditable.DataValueField = "CveCuenta" - DdlCtaContAcreedoresExtranjera.DataTextField = "Cuenta" : DdlCtaContAcreedoresExtranjera.DataValueField = "CveCuenta" - DdlCtaContAcreedoresComplementaria.DataTextField = "Cuenta" : DdlCtaContAcreedoresComplementaria.DataValueField = "CveCuenta" - DdlCtaContAnticiposExtranjera.DataTextField = "Cuenta" : DdlCtaContAnticiposExtranjera.DataValueField = "CveCuenta" - DdlCtaContAnticiposComplementaria.DataTextField = "Cuenta" : DdlCtaContAnticiposComplementaria.DataValueField = "CveCuenta" - DdlCtaContDocsXPagarExtranjera.DataTextField = "Cuenta" : DdlCtaContDocsXPagarExtranjera.DataValueField = "CveCuenta" - End If - 'Proveedores If ObjProveedor.IdCtaContProveedores > 0 Then DdlCtaContProveedores.Items.Add(New ListItem(ObjProveedor.CtaContProveedores, ObjProveedor.IdCtaContProveedores.ToString)) : DdlCtaContProveedores.SelectedValueExist(ObjProveedor.IdCtaContProveedores.ToString) If ObjProveedor.IdCtaContProveedoresExtranjera > 0 Then DdlCtaContExtranjera.Items.Add(New ListItem(ObjProveedor.CtaContProveedoresExtranjera, ObjProveedor.IdCtaContProveedoresExtranjera.ToString)) : DdlCtaContExtranjera.SelectedValue = ObjProveedor.IdCtaContProveedoresExtranjera.ToString @@ -4542,92 +4519,92 @@ Partial Class Compras_Proveedores ObjProveedores.Dispose() - ElseIf UsuarioActual.Empresa.UsaContabilidadSIG = True Then + 'ElseIf UsuarioActual.Empresa.UsaContabilidadSIG = True Then - Dim ObjContabilidad As New ClsContabilidad - Dim ObjProveedores As New ClsCompProveedores() - ObjContabilidad.IniciaTransacSQL() - ObjProveedores.IniciaTransacSQL() - Dim CuentaPadre = -1 - Dim IdCuentaContable = -1 - Dim CtaCodigo As String = "" - Dim TieneError = False - Dim IdCtaContableProveedores As Integer = -1, IdCtaContableAcreedores As Integer = -1, IdCtaContableDocsXPagar As Integer = -1, IdCtaContableAnticipos As Integer = -1, IdCtaContableDeudor As Integer = -1 - Dim CtaCodigoProveedores As String = "-1", CtaCodigoAcreedores As String = "-1", CtaCodigoDocsXPagar As String = "-1", CtaCodigoAnticipos As String = "-1", CtaCodigoDeudor As String = "-1" + ' Dim ObjContabilidad As New ClsContabilidad + ' Dim ObjProveedores As New ClsCompProveedores() + ' ObjContabilidad.IniciaTransacSQL() + ' ObjProveedores.IniciaTransacSQL() + ' Dim CuentaPadre = -1 + ' Dim IdCuentaContable = -1 + ' Dim CtaCodigo As String = "" + ' Dim TieneError = False + ' Dim IdCtaContableProveedores As Integer = -1, IdCtaContableAcreedores As Integer = -1, IdCtaContableDocsXPagar As Integer = -1, IdCtaContableAnticipos As Integer = -1, IdCtaContableDeudor As Integer = -1 + ' Dim CtaCodigoProveedores As String = "-1", CtaCodigoAcreedores As String = "-1", CtaCodigoDocsXPagar As String = "-1", CtaCodigoAnticipos As String = "-1", CtaCodigoDeudor As String = "-1" - Select Case btn.CommandArgument.ToString - Case "Proveedores" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(232).ToEntero - Case "Acreedores" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(235).ToEntero - Case "DocsXPagar" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(236).ToEntero - Case "Anticipos" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(238).ToEntero - Case "Deudores" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(234).ToEntero + ' Select Case btn.CommandArgument.ToString + ' Case "Proveedores" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(232).ToEntero + ' Case "Acreedores" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(235).ToEntero + ' Case "DocsXPagar" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(236).ToEntero + ' Case "Anticipos" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(238).ToEntero + ' Case "Deudores" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(234).ToEntero - End Select + ' End Select - Dim NombreCuenta = If(TxtRazonSocial.Text.Trim.Length > 50, TxtRazonSocial.Text.Trim.Substring(0, 50), TxtRazonSocial.Text.Trim) - IdCuentaContable = ObjContabilidad.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, UsuarioActual.CveEmpresa) - If IdCuentaContable > 0 Then + ' Dim NombreCuenta = If(TxtRazonSocial.Text.Trim.Length > 50, TxtRazonSocial.Text.Trim.Substring(0, 50), TxtRazonSocial.Text.Trim) + ' IdCuentaContable = ObjContabilidad.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, UsuarioActual.CveEmpresa) + ' If IdCuentaContable > 0 Then - ObjContabilidad.GetCuentas(IdCuentaContable, "-1", -1, UsuarioActual.CveEmpresa) - Dim dt = ObjContabilidad.DtResultados + ' ObjContabilidad.GetCuentas(IdCuentaContable, "-1", -1, UsuarioActual.CveEmpresa) + ' Dim dt = ObjContabilidad.DtResultados - If dt.Rows.Count = 1 Then + ' If dt.Rows.Count = 1 Then - Dim row As DataRow = dt.Rows(0) - CtaCodigo = CStr(row("CtaCodigo")) + ' Dim row As DataRow = dt.Rows(0) + ' CtaCodigo = CStr(row("CtaCodigo")) - Select Case btn.CommandArgument.ToString - Case "Proveedores" - IdCtaContableProveedores = IdCuentaContable - CtaCodigoProveedores = CtaCodigo - Case "Acreedores" - IdCtaContableAcreedores = IdCuentaContable - CtaCodigoAcreedores = CtaCodigo - Case "DocsXPagar" - IdCtaContableDocsXPagar = IdCuentaContable - CtaCodigoDocsXPagar = CtaCodigo - Case "Anticipos" - IdCtaContableAnticipos = IdCuentaContable - CtaCodigoAnticipos = CtaCodigo - Case "Deudores" - IdCtaContableDeudor = IdCuentaContable - CtaCodigoDeudor = CtaCodigo - End Select + ' Select Case btn.CommandArgument.ToString + ' Case "Proveedores" + ' IdCtaContableProveedores = IdCuentaContable + ' CtaCodigoProveedores = CtaCodigo + ' Case "Acreedores" + ' IdCtaContableAcreedores = IdCuentaContable + ' CtaCodigoAcreedores = CtaCodigo + ' Case "DocsXPagar" + ' IdCtaContableDocsXPagar = IdCuentaContable + ' CtaCodigoDocsXPagar = CtaCodigo + ' Case "Anticipos" + ' IdCtaContableAnticipos = IdCuentaContable + ' CtaCodigoAnticipos = CtaCodigo + ' Case "Deudores" + ' IdCtaContableDeudor = IdCuentaContable + ' CtaCodigoDeudor = CtaCodigo + ' End Select - If Not ObjProveedores.VincularCuentasContables(IdCtaContableProveedores, CtaCodigoProveedores, IdCtaContableAcreedores, CtaCodigoAcreedores, IdCtaContableAnticipos, CtaCodigoAnticipos, IdCtaContableDeudor, CtaCodigoDeudor, IdCtaContableDocsXPagar, CtaCodigoDocsXPagar, CveProveedor) Then - TieneError = True - End If - Else - TieneError = True - End If - Else - TieneError = True - End If + ' If Not ObjProveedores.VincularCuentasContables(IdCtaContableProveedores, CtaCodigoProveedores, IdCtaContableAcreedores, CtaCodigoAcreedores, IdCtaContableAnticipos, CtaCodigoAnticipos, IdCtaContableDeudor, CtaCodigoDeudor, IdCtaContableDocsXPagar, CtaCodigoDocsXPagar, CveProveedor) Then + ' TieneError = True + ' End If + ' Else + ' TieneError = True + ' End If + ' Else + ' TieneError = True + ' End If - If Not TieneError Then - Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion)) - ddl.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : ddl.SelectedValueExist(IdCuentaContable.ToString) - btn.Visible = False - ddl.Width = 206 - ObjProveedores.Commit() - ObjContabilidad.Commit() - Else - Alert("Esta cuenta no puede tener Sub Cuentas.", TipoMensaje.MsgError) - ObjProveedores.RollBack() - ObjContabilidad.RollBack() - End If + ' If Not TieneError Then + ' Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion)) + ' ddl.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : ddl.SelectedValueExist(IdCuentaContable.ToString) + ' btn.Visible = False + ' ddl.Width = 206 + ' ObjProveedores.Commit() + ' ObjContabilidad.Commit() + ' Else + ' Alert("Esta cuenta no puede tener Sub Cuentas.", TipoMensaje.MsgError) + ' ObjProveedores.RollBack() + ' ObjContabilidad.RollBack() + ' End If - ObjProveedores.Dispose() - ObjContabilidad.Dispose() + ' ObjProveedores.Dispose() + ' ObjContabilidad.Dispose() End If UPPContable.Update() diff --git a/Compras/RepCompras.aspx b/Compras/RepCompras.aspx index f094031ad..2b3afe529 100644 --- a/Compras/RepCompras.aspx +++ b/Compras/RepCompras.aspx @@ -162,9 +162,7 @@ Proyecto:
- - - +
SubProyecto:
diff --git a/Compras/RepCompras.aspx.vb b/Compras/RepCompras.aspx.vb index d8d4d8561..192b4ee23 100644 --- a/Compras/RepCompras.aspx.vb +++ b/Compras/RepCompras.aspx.vb @@ -63,65 +63,13 @@ Partial Class Compras_RepCompras DdlGrupo.DataBind() DdlGrupo.SelectedValueExist("3") End Sub - Private Sub CargaTipoCentroCosto() - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - DivLblProyecto.Visible = False - LblSubProyecto.Text = "Sucursal:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Sucursal", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Sucursal", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - DivLblProyecto.Visible = False - LblSubProyecto.Text = "Proyecto:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then - DdlGrupo.Items.Insert(10, New ListItem("Remesa-SubProyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("SubProyecto", "12")) - DdlGrupo.Items.Insert(12, New ListItem("Proyecto", "13")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.Text = "Sucursal:" - LblSubProyecto.Text = "Proyecto:" - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.Items.Insert(12, New ListItem("Sucursal", "13")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - LblProyecto.Text = "Proyecto:" - LblSubProyecto.Text = "Sucursal:" - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Sucursal", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Sucursal", "12")) - DdlGrupo.Items.Insert(12, New ListItem("Proyecto", "13")) - DdlGrupo.DataBind() - End If - DdlGrupo.Items.Add(New ListItem("Tipo Proveedor", "14")) - DdlGrupo.Items.Add(New ListItem("Tipo Gasto", "15")) - End Sub Private Sub CargaCombos() - txtFechaI.Text = $"01/01/{Now.Year}" + txtFechaI.Text = $"01/01/{Now.Year}" + + 'Carga Tipo Centro de Costo + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + 'CargaProveedores DdlProveedores.setEsWebService(True) DdlProveedores.Attributes.Add("data-metodo", "getproveedores") @@ -144,38 +92,22 @@ Partial Class Compras_RepCompras DdlMonedas.DataSource = GlobalDTMonedas() DdlMonedas.DataBind() - 'CargaProyecto - DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"})) - DdlProyecto.DataBind() - 'Carga Grupo CargaGrupo() - - 'Carga Tipo Centro de Costo - CargaTipoCentroCosto() End Sub - - Private Sub ConfiguraEmpresa() ChkIVA.Checked = True If Not UsuarioActual.Empresa.MostrarRetIVA Then GvDatos.Columns(7).Visible = False If Not UsuarioActual.Empresa.MostrarRetISR Then GvDatos.Columns(8).Visible = False - End Sub - - Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros(String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue.ToEntero)) - DdlSubProyecto.DataBind() - 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - + End Sub + #End Region - + #Region "SELECTED INDEX CHANGE" - + Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - CargaSubProyecto() + CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue) End Sub Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged diff --git a/Compras/RepComprasAF.aspx.vb b/Compras/RepComprasAF.aspx.vb index 82331aa84..de5fb0b0a 100644 --- a/Compras/RepComprasAF.aspx.vb +++ b/Compras/RepComprasAF.aspx.vb @@ -50,16 +50,6 @@ Partial Class Compras_RepComprasAF If Not IsPostBack Then CargaCombos() 'DdlPS.ddl.Visible = False - If UsuarioActual.Empresa.GralSoloProyecto Then - LblSubProyecto.Text = "Proyecto:" - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlProyecto.Visible = False - DdlProyecto.Items(0).Text = "" - LblProyecto.Visible = False - End If End If End Sub @@ -110,19 +100,7 @@ Partial Class Compras_RepComprasAF End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - If DdlProyecto.SelectedValue = "-1" Then - DdlProyecto.Items.Clear() - DdlSubProyecto.Items.Clear() - CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) - Else - CargaSubProyecto() - End If - End Sub - Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros(String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue), "SubProyecto") - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue) End Sub Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click CargaDatos() diff --git a/Compras/RepComprasAFDetalle.aspx.vb b/Compras/RepComprasAFDetalle.aspx.vb index 7b8a4c1d0..2a49b588f 100644 --- a/Compras/RepComprasAFDetalle.aspx.vb +++ b/Compras/RepComprasAFDetalle.aspx.vb @@ -149,21 +149,6 @@ Partial Class Compras_RepComprasAFDetalle Dim asd As Integer = 1 End Try - If UsuarioActual.Empresa.GralSoloProyecto Then - - LblSubProyecto.Text = "Proyecto:" - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlSubProyecto.SelectedValue = "-1" - DdlSubProyecto.DataBind() - 'DdlSubProyecto.SelectedValueExist(Request.QueryString("CveSubProyecto").ToString) - DdlProyecto.Visible = False - DdlProyecto.Items(0).Text = "" - LblProyecto.Visible = False - - End If - If UsuarioActual.CveEmpresa = 72 Then GvDatos.FBColumn("NoSerie").Visible = True End If @@ -175,6 +160,8 @@ Partial Class Compras_RepComprasAFDetalle Private Sub CargaCombos() + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedores.DataBind() @@ -182,13 +169,9 @@ Partial Class Compras_RepComprasAFDetalle DdlProveedores.Items.Add(New ListItem("Consumo Interno", "-3")) End If - DdlMonedas.DataSource = GlobalDTMonedas() DdlMonedas.DataBind() - DdlProyecto.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) - DdlProyecto.DataBind() - DdlTipoActivoFijo.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo") DdlTipoActivoFijo.DataBind() @@ -206,14 +189,12 @@ Partial Class Compras_RepComprasAFDetalle DdlClasificacion2.DataSource = Nothing End If - ObjClasificacion.Dispose() DdlClasificacion2.DataBind() DdlClasificacion2.Items.Insert(0, New ListItem("Todas", "-1")) DdlClasificacion2.Items.Insert(1, New ListItem("Sin Clasificación", "-2")) DdlClasificacion2.SelectedValueExist(-1) - DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlActivoFijo.DataBind() DdlActivoFijo.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -230,33 +211,17 @@ Partial Class Compras_RepComprasAFDetalle DdlPS.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) End If - CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) - End Sub Private Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoActivoFijo.SelectedIndexChanged - DdlSubTipoActivoFijo.Items.Clear() - DdlSubTipoActivoFijo.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo") + DdlSubTipoActivoFijo.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoActivoFijo = {DdlTipoActivoFijo.SelectedValue}", "SubTipoActivoFijo") DdlSubTipoActivoFijo.DataBind() DdlSubTipoActivoFijo.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlSubTipoActivoFijo.SelectedIndex = 0 - End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - If DdlProyecto.SelectedValue = "-1" Then - DdlProyecto.Items.Clear() - DdlSubProyecto.Items.Clear() - CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) - Else - CargaSubProyecto() - End If - End Sub - Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros(String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue), "SubProyecto") - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue) End Sub Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click CargaDatos() diff --git a/Compras/RepComprasDetalle.aspx b/Compras/RepComprasDetalle.aspx index 7810abe27..58be7e6ed 100644 --- a/Compras/RepComprasDetalle.aspx +++ b/Compras/RepComprasDetalle.aspx @@ -201,9 +201,7 @@ Proyecto:
- - - +
SubProyecto:
diff --git a/Compras/RepComprasDetalle.aspx.vb b/Compras/RepComprasDetalle.aspx.vb index 0e99ed183..9cc0a6ffd 100644 --- a/Compras/RepComprasDetalle.aspx.vb +++ b/Compras/RepComprasDetalle.aspx.vb @@ -134,7 +134,6 @@ Partial Class Compras_RepComprasDetalle End If DdlProyecto.SelectedValueExist(CveProyecto) - If DivProyecto.Visible Then CargaSubProyecto() 'CARGA LISTBOXs DdlSubProyecto.SelectedValuesIfExistM(SubProyecto) @@ -177,62 +176,11 @@ Partial Class Compras_RepComprasDetalle DdlGrupo.DataBind() DdlGrupo.SelectedValueExist("3") End Sub - Private Sub CargaTipoCentroCosto() - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - DivLblProyecto.Visible = False - LblSubProyecto.Text = "Sucursal:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Sucursal", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Sucursal", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - DivLblProyecto.Visible = False - LblSubProyecto.Text = "Proyecto:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then - DdlGrupo.Items.Insert(10, New ListItem("Remesa-SubProyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("SubProyecto", "12")) - DdlGrupo.Items.Insert(12, New ListItem("Proyecto", "13")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.Text = "Sucursal:" - LblSubProyecto.Text = "Proyecto:" - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.Items.Insert(12, New ListItem("Sucursal", "13")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - LblProyecto.Text = "Proyecto:" - LblSubProyecto.Text = "Sucursal:" - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Sucursal", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Sucursal", "12")) - DdlGrupo.Items.Insert(12, New ListItem("Proyecto", "13")) - DdlGrupo.DataBind() - End If - DdlGrupo.Items.Add(New ListItem("Tipo Proveedor", "14")) - DdlGrupo.Items.Add(New ListItem("Tipo Gasto", "15")) - End Sub Private Sub CargaCombos() + 'Carga Tipo Centro de Costo + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + 'Carga Tipo de Gasto DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() @@ -252,23 +200,11 @@ Partial Class Compras_RepComprasDetalle DDlUsuarioCaptura.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) DDlUsuarioCaptura.DataBind() - 'CargaProyecto - DdlProyecto.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) - DdlProyecto.DataBind() - 'Carga Grupos CargaGrupo() - 'Carga Tipo Centro de Costo - CargaTipoCentroCosto() - End Sub - Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - End Sub Private Sub CargaDatos() Dim ObjCompras As New ClsCompras() @@ -321,7 +257,7 @@ Partial Class Compras_RepComprasDetalle #Region "SELECTED INDEX CHANGE" Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - CargaSubProyecto() + CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue) End Sub Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged diff --git a/Compras/RepComprasPeriodo.aspx b/Compras/RepComprasPeriodo.aspx index 2dc04cc9f..62b480594 100644 --- a/Compras/RepComprasPeriodo.aspx +++ b/Compras/RepComprasPeriodo.aspx @@ -100,15 +100,11 @@ Proyecto:
- - - +
SubProyecto:
- - - +
Fecha I. Captura
diff --git a/Compras/RepComprasPeriodo.aspx.vb b/Compras/RepComprasPeriodo.aspx.vb index 6a1d06779..813fc67d0 100644 --- a/Compras/RepComprasPeriodo.aspx.vb +++ b/Compras/RepComprasPeriodo.aspx.vb @@ -48,60 +48,11 @@ Partial Class Compras_RepComprasPeriodo DdlGrupo.SelectedValueExist("3") End Sub - Private Sub CargaTipoCentroCosto() - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - DivLblProyecto.Visible = False - LblSubProyecto.Text = "Sucursal:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Sucursal", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Sucursal", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.Items.Clear() - DivProyecto.Visible = False - DivLblProyecto.Visible = False - LblSubProyecto.Text = "Proyecto:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.Text = "Sucursal:" - LblSubProyecto.Text = "Proyecto:" - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Sucursal", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Sucursal", "12")) - DdlGrupo.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - LblProyecto.Text = "Proyecto:" - LblSubProyecto.Text = "Sucursal:" - - DdlGrupo.Items.Insert(10, New ListItem("Remesa-Proyecto", "11")) - DdlGrupo.Items.Insert(11, New ListItem("Proyecto", "12")) - DdlGrupo.DataBind() - End If - End Sub - Private Sub CargaCombos() + 'Carga Tipo Centro de Costo + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + 'Carga Proveedores DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedores.DataBind() @@ -122,15 +73,9 @@ Partial Class Compras_RepComprasPeriodo DdlMonedas.DataSource = GlobalDTMonedas() DdlMonedas.DataBind() - 'CargaProyecto - DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"})) - DdlProyecto.DataBind() - 'Carga Grupo CargaGrupo() - 'Carga Tipo Centro de Costo - CargaTipoCentroCosto() End Sub Private Sub CargaDatos() @@ -167,18 +112,12 @@ Partial Class Compras_RepComprasPeriodo End Sub - Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros(String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue.ToEntero)) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub #End Region #Region "SELECTED INDEX CHANGE" Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - CargaSubProyecto() + CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue) End Sub Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged diff --git a/Compras/RepPagado.aspx b/Compras/RepPagado.aspx index 621d4d3ec..71c5c4018 100644 --- a/Compras/RepPagado.aspx +++ b/Compras/RepPagado.aspx @@ -98,12 +98,12 @@