diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ae2a6e5ca..e5ff86535 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -549,25 +549,34 @@ Public Class ClsPaginas Application("GlobalDTEmpresas") = value End Set End Property - Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1) As DataTable - Get + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTClasificaciones{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then Application(AppNombre) = ObjClasificaciones.DtResultados + ObjClasificaciones.Dispose() + End If If CveEmpresa <> -1 Then Dim Str As New StringBuilder Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) - Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificaciones"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) + If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTClasificaciones = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificaciones = DirectCast(Application("GlobalDTClasificaciones"), DataTable) + GlobalDTClasificaciones = DirectCast(Application(AppNombre), DataTable) End If End Get - Set(value As DataTable) - Application("GlobalDTClasificaciones") = value + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTClasificaciones{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable @@ -1507,7 +1516,7 @@ Public Class ClsPaginas 'Fin Ruta 'Cliente - Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable + Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional CveCliente As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa) 'sino existe, recarga los datos @@ -1523,10 +1532,11 @@ Public Class ClsPaginas Dim StrSQL As New StringBuilder StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) + If CveCliente >= 0 Then StrSQL.AppendFormat(" AND CveCliente = {0} ", CveCliente) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCliente = Dv.ToTable - Dv.Dispose() + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + GlobalDTCliente = Dv.ToTable + Dv.Dispose() Else GlobalDTCliente = DirectCast(Application(AppNombre), DataTable) diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index cfcca38dd..12fb16ca2 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -463,7 +463,7 @@ Public Class ClsSisEmpresas _Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero _Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero _Empresa.AsientoContableComprasContado = If(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString = "", False, CBool(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString)) - _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero + _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq _Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString)) _Empresa.CIEC = Data.Rows(0)("CIEC").ToString _Empresa.Localidad = Data.Rows(0)("Localidad").ToString diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 96498dc75..955f487b8 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1469,7 +1469,7 @@ Public Class ClsVentas FechaI As Date, FechaF As Date, Mes As Integer, FechaIEjec As Date, FechaFEjec As Date, MesEjec As Integer, CveCliente As Integer, CveSubProyectoEjecucion As Integer, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, - Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1) As Boolean + Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1, Optional CveClasificacionDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_GetRepPSDetalle") @@ -1500,6 +1500,7 @@ Public Class ClsVentas .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 52038c7cd..a85b009e2 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1257,7 +1257,7 @@ Namespace Modelos End If - If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta, ObjVentas) Then + If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta, ObjVentas, factura.TipoDocto) Then ErrorList.Add("Error al guardar usados") End If @@ -1785,10 +1785,10 @@ Namespace Modelos DtVentasNC.Rows.Add(Dr) End If End Sub - Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas) As Boolean + Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean Dim Resultado As Boolean = True - If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 Then + If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant") Then Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index d4594f75c..175b3bfb4 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -2046,7 +2046,7 @@ Partial Class Contratos_Default Row("LimitarCantidad") = If(ChkLimitar.Checked, 1, 0) Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Row("LimitarCantidad").ToString.ToEntero = 1, "") Then + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "") Then If Autorizado Then Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) guardarBitacora(msj) diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index c07b9ca77..83cf75375 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -71,7 +71,7 @@ Partial Class Inventarios_InventarioFisicoDetalle EsUsuarioActual = True End If - GvIFD.Columns(6).Visible = EsUsuarioActual + GvIFD.Columns(6).Visible = EsUsuarioActual OrElse UsuarioActual.TienePermisoProceso(283) ' si el usuario lo registro o si tiene permisos especial GvIFD.DataBind() If (GvIFD.Rows.Count > 0) Then diff --git a/Inventarios/KardexAlmacenHorizontal.aspx b/Inventarios/KardexAlmacenHorizontal.aspx index df303871d..397af66ab 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx +++ b/Inventarios/KardexAlmacenHorizontal.aspx @@ -146,7 +146,12 @@