diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 59b3e072a..6045b7c57 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1113,12 +1113,19 @@ Public Class ClsPaginas Application("GlobalDTClasificacionesPresupuestos") = value End Set End Property - Property GlobalDTMetodosPago() As DataTable + Public Shared Property GlobalDTMetodosPago() As DataTable Get - GlobalDTMetodosPago = DirectCast(Application("GlobalDTMetodosPago"), DataTable) + Dim AppNombre As String = "GlobalDTMetodosPago" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjMetodoPago As New ClsMetodosPagos + If ObjMetodoPago.GetMetodosPago() Then HttpContext.Current.Application(AppNombre) = ObjMetodoPago.DtResultados + ObjMetodoPago.Dispose() + End If + GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTMetodosPago") = value + Dim AppNombre As String = "GlobalDTMetodosPago" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTModulos() As DataTable @@ -1337,67 +1344,72 @@ Public Class ClsPaginas Application("GlobalDTEstatusOrdenCompra") = value End Set End Property - Property GlobalDTLeyendasFiscales() As DataTable + Public Shared Property GlobalDTLeyendasFiscales() As DataTable Get - GlobalDTLeyendasFiscales = DirectCast(Application("GlobalDTLeyendasFiscales"), DataTable) + Dim AppNombre As String = "GlobalDTLeyendasFiscales" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjLeyendasFiscales As New ClsLeyendasFiscales + If ObjLeyendasFiscales.GetLeyendasFiscales() Then HttpContext.Current.Application(AppNombre) = ObjLeyendasFiscales.DtResultados + ObjLeyendasFiscales.Dispose() + End If + GlobalDTLeyendasFiscales = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTLeyendasFiscales") = value + Dim AppNombre As String = "GlobalDTLeyendasFiscales" + HttpContext.Current.Application(AppNombre) = value End Set End Property - - Property GlobalDTEstatusFactura() As DataTable + Public Shared Property GlobalDTEstatusFactura() As DataTable Get - GlobalDTEstatusFactura = DirectCast(Application("GlobalDTEstatusFactura"), DataTable) + Dim AppNombre As String = "GlobalDTEstatusFactura" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjEstatusFactura As New ClsEstatusFactura + If ObjEstatusFactura.GetEstatusFactura() Then HttpContext.Current.Application(AppNombre) = ObjEstatusFactura.DtResultados + ObjEstatusFactura.Dispose() + End If + GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTEstatusFactura") = value + Dim AppNombre As String = "GlobalDTEstatusFactura" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProyectos(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable + Public Shared Property GlobalDTProyectos(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable Get - - If DirectCast(Application("GlobalDTProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTProyectos"), DataTable).Rows.Count = 0) Then - Dim P As New ClsProyectos - If P.GetProyectos Then - Application("GlobalDTProyectos") = P.DtResultados - End If - P.Dispose() + 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 Request IsNot Nothing Then - msg = msg & Request.ServerVariables("URL") + If HttpContext.Current.Request IsNot Nothing Then + msg += HttpContext.Current.Request.ServerVariables("URL") End If msg.GuardaLog() - End If - - If CveEmpresa <> -1 OrElse Estatus <> -1 Then 'OrElse CveProyecto <> -1 - - Dim StrSQL As New StringBuilder - If CveEmpresa <> -1 Then StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) - ' If CveProyecto <> -1 Then StrSQL.AppendFormat(" {0} CveProyecto = {1}", If(StrSQL.Length > 0, "AND", ""), CveProyecto) - If Estatus <> -1 Then StrSQL.AppendFormat(" {0} CveEstatus = {1}", If(StrSQL.Length > 0, "AND", ""), Estatus) - - Dim Dv As New DataView(DirectCast(Application("GlobalDTProyectos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + 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}") + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEstatus = {Estatus}", "", DataViewRowState.CurrentRows) GlobalDTProyectos = Dv.ToTable Dv.Dispose() - Else - GlobalDTProyectos = DirectCast(Application("GlobalDTProyectos"), DataTable) + GlobalDTProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If - End Get - Set(ByVal value As DataTable) + Set(value As DataTable) If value Is Nothing OrElse value.Rows.Count = 0 Then Dim msg As String = "aqui no se carga proyectos" - If Request IsNot Nothing Then - msg = msg & Request.ServerVariables("URL") + If HttpContext.Current.Request IsNot Nothing Then + msg += HttpContext.Current.Request.ServerVariables("URL") End If msg.GuardaLog() - End If - Application("GlobalDTProyectos") = value + Dim AppNombre As String = $"GlobalDTProyectos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable @@ -1500,12 +1512,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTPrecioListas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTPrecioListas(CveEmpresa As Integer) As DataTable Get - GlobalDTPrecioListas = DirectCast(Application("GlobalDTPrecioListas"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) + Dim AppNombre As String = $"GlobalDTPrecioListas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetPrecioListas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + GlobalDTPrecioListas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTPrecioListas") = value + Dim AppNombre As String = $"GlobalDTPrecioListas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property 'Property GlobalDTMesas() As DataTable @@ -1738,16 +1758,14 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Public Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias-{0}", CveEmpresa) - If CveEmpresa <> -1 Then - 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados - ObjPS.Dispose() - End If + + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados + ObjPS.Dispose() End If If CvePS <> -1 OrElse CveUM <> -1 Then @@ -1756,16 +1774,16 @@ Public Class ClsPaginas If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM) If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) GlobalDTProductosServiciosEquivalencias = Dv.ToTable Dv.Dispose() Else - GlobalDTProductosServiciosEquivalencias = DirectCast(Application(AppNombre), DataTable) + GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias-{0}", CveEmpresa) - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property @@ -1918,12 +1936,19 @@ Public Class ClsPaginas End Set End Property 'Bancos - Property GlobalDTBancos() As DataTable + Public Shared Property GlobalDTBancos() As DataTable Get - GlobalDTBancos = DirectCast(Application("GlobalDTBancos"), DataTable) + Dim AppNombre As String = "GlobalDTBancos" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancos() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados + ObjBancos.Dispose() + End If + GlobalDTBancos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTBancos") = value + Dim AppNombre As String = "GlobalDTBancos" + HttpContext.Current.Application(AppNombre) = value End Set End Property 'Property GlobalDTBancosCuentas(CveUsuario As Integer) As DataTable @@ -1940,54 +1965,64 @@ Public Class ClsPaginas ' Application("GlobalDTBancosCuentas") = value ' End Set 'End Property - Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1, Optional CveTipoCuenta As Integer = -1) As DataTable + Public Shared Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1, Optional CveTipoCuenta As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) 'sino existe, recarga los datos If HttpContext.Current.Application(AppNombre) Is Nothing Then Using ObjBancos As New ClsBancos If ObjBancos.GetBancosCuentasUsuarios(-1, CveEmpresa) Then - Application(AppNombre) = ObjBancos.DtResultados + HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados Else - Application(AppNombre) = Nothing + HttpContext.Current.Application(AppNombre) = Nothing End If End Using End If - Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa) + Dim Str As String = String.Format("CveEmpresa = {0} ", CveEmpresa) If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario) If CveTipoCuenta > -1 Then Str = String.Format("{0} AND CveTipoCuenta = {1}", Str, CveTipoCuenta) If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta) If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo")) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows) GlobalDTBancosCuentas = Dv.ToTable Dv.Dispose() 'GlobalDTBancosCuentas = DirectCast(Application("GlobalDTBancosCuentas"), DataTable) End Get Set(value As DataTable) Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTTipoTransacciones() As DataTable + Public Shared Property GlobalDTTipoTransacciones() As DataTable Get - If UsuarioActual.CveEmpresa = 66 Then - GlobalDTTipoTransacciones = DirectCast(Application("GlobalDTTipoTransacciones"), DataTable).FiltraParametros("Estatus = 1") - Else - GlobalDTTipoTransacciones = DirectCast(Application("GlobalDTTipoTransacciones"), DataTable) + Dim AppNombre As String = "GlobalDTTipoTransacciones" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancos_TiposTransaccion(-1) Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados + ObjBancos.Dispose() End If + GlobalDTTipoTransacciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoTransacciones") = value + Dim AppNombre As String = "GlobalDTTipoTransacciones" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTBancosEstatusIE() As DataTable + Public Shared Property GlobalDTBancosEstatusIE() As DataTable Get - GlobalDTBancosEstatusIE = DirectCast(Application("GlobalDTBancosEstatusIE"), DataTable) + Dim AppNombre As String = "GlobalDTBancosEstatusIE" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancos_EstatusIE() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados + ObjBancos.Dispose() + End If + GlobalDTBancosEstatusIE = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTBancosEstatusIE") = value + Dim AppNombre As String = "GlobalDTBancosEstatusIE" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTBancosIE() As DataTable @@ -1998,12 +2033,19 @@ Public Class ClsPaginas Application("GlobalDTBancosIE") = value End Set End Property - Property GlobalDTTipoCuenta() As DataTable + Public Shared Property GlobalDTTipoCuenta() As DataTable Get - GlobalDTTipoCuenta = DirectCast(Application("GlobalDTTipoCuenta"), DataTable) + Dim AppNombre As String = "GlobalDTTipoCuenta" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados + ObjBancos.Dispose() + End If + GlobalDTTipoCuenta = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoCuenta") = value + Dim AppNombre As String = "GlobalDTTipoCuenta" + HttpContext.Current.Application(AppNombre) = value End Set End Property 'Fin Bancos @@ -2249,39 +2291,44 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoAlmacen = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoAlmacen = DirectCast(Application("GlobalDTTipoAlmacen"), DataTable) + Dim AppNombre As String = $"GlobalDTTipoAlmacen-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim Objinventarios As New ClsInventarios + If Objinventarios.GetTiposAlmacenes() Then HttpContext.Current.Application(AppNombre) = Objinventarios.DtResultados + Objinventarios.Dispose() End If - + GlobalDTTipoAlmacen = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoAlmacen") = value + Dim AppNombre As String = $"GlobalDTTipoAlmacen-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTInvConceptos() As DataTable + Public Shared Property GlobalDTInvConceptos() As DataTable Get - - Return DirectCast(Application("GlobalDTInvConceptos"), DataTable) - + Dim AppNombre As String = "GlobalDTInvConceptos" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim Objinventarios As New ClsInventarios + If Objinventarios.GetConceptos() Then HttpContext.Current.Application(AppNombre) = Objinventarios.DtResultados + Objinventarios.Dispose() + End If + GlobalDTInvConceptos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTInvConceptos") = value + Dim AppNombre As String = "GlobalDTInvConceptos" + HttpContext.Current.Application(AppNombre) = value End Set End Property - - Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable + Public Shared Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjUsr As New ClsInventarios - If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then Application(AppNombre) = ObjUsr.DtResultados + If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados ObjUsr.Dispose() End If @@ -2292,31 +2339,15 @@ Public Class ClsPaginas If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) - 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) GlobalDTAlmacen = Dv.ToTable Dv.Dispose() End Get Set(value As DataTable) Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set - 'Get - ' Dim Str As New StringBuilder - ' Str.Append("1=1 AND ") - ' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) - ' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) - ' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) - ' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) - - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - ' GlobalDTAlmacen = Dv.ToTable - ' Dv.Dispose() - - 'End Get - 'Set(value As DataTable) - ' Application("GlobalDTAlmacen") = value - 'End Set End Property Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1, Optional CveEstatus As Integer = 1) As DataTable Get @@ -2343,31 +2374,26 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTSeccionAlmacen(CveEmpresa As Integer, CveAlmacen As Integer) As DataTable + Public Shared Property GlobalDTSeccionAlmacen(CveEmpresa As Integer, CveAlmacen As Integer) As DataTable Get - Dim AppNombre As String = String.Format("GlobalDTSeccionAlmacen-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTSeccionAlmacen-{CveEmpresa}" 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjInv As New ClsInventarios - If ObjInv.GetSeccionesAlmacenes(CveEmpresa, -1) Then Application(AppNombre) = ObjInv.DtResultados + If ObjInv.GetSeccionesAlmacenes(CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjInv.DtResultados ObjInv.Dispose() End If - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - - If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) - If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + If CveAlmacen > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveAlmacen = {CveAlmacen}", "", DataViewRowState.CurrentRows) GlobalDTSeccionAlmacen = Dv.ToTable Dv.Dispose() Else - GlobalDTSeccionAlmacen = DirectCast(Application("GlobalDTSeccionAlmacen"), DataTable) + GlobalDTSeccionAlmacen = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If - End Get Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTSeccionAlmacen-{0}", CveEmpresa) - Application(AppNombre) = value + Dim AppNombre As String = $"GlobalDTSeccionAlmacen-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property @@ -2425,54 +2451,89 @@ Public Class ClsPaginas Application("GlobalDTNom_Periodos") = value End Set End Property - Public Property GlobalDTVtaFormaPago() As DataTable + Public Shared Property GlobalDTVtaFormaPago() As DataTable Get - GlobalDTVtaFormaPago = DirectCast(Application("GlobalDTVtaFormaPago"), DataTable) + Dim AppNombre As String = "GlobalDTVtaFormaPago" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetFormaPago() Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTVtaFormaPago") = value + Dim AppNombre As String = "GlobalDTVtaFormaPago" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTVtaMetodoPago() As DataTable + Public Shared Property GlobalDTVtaMetodoPago() As DataTable Get - GlobalDTVtaMetodoPago = DirectCast(Application("GlobalDTVtaMetodoPago"), DataTable) + Dim AppNombre As String = "GlobalDTVtaMetodoPago" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetMetodoPago() Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTVtaMetodoPago") = value + Dim AppNombre As String = "GlobalDTVtaMetodoPago" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTVtaTiposRelacion() As DataTable + Public Shared Property GlobalDTVtaTiposRelacion() As DataTable Get - GlobalDTVtaTiposRelacion = DirectCast(Application("GlobalDTVtaTiposRelacion"), DataTable) + Dim AppNombre As String = "GlobalDTVtaTiposRelacion" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetTiposRelacion() Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + GlobalDTVtaTiposRelacion = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTVtaTiposRelacion") = value + Dim AppNombre As String = "GlobalDTVtaTiposRelacion" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTTiposDocumentos() As DataTable + Public Shared Property GlobalDTTiposDocumentos() As DataTable Get - GlobalDTTiposDocumentos = DirectCast(Application("GlobalDTTiposDocumentos"), DataTable) + Dim AppNombre As String = "GlobalDTTiposDocumentos" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetTiposDocumentos() Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + GlobalDTTiposDocumentos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTiposDocumentos") = value + Dim AppNombre As String = "GlobalDTTiposDocumentos" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTCobranzaEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTVtaCobranzaEstatus(CveEmpresa As Integer, Optional CveCobranzaEstatus As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTVtaCobranzaEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTCobranzaEstatus = Dv.ToTable + Dim AppNombre As String = $"GlobalDTVtaCobranzaEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetCobranzaEstatus(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + If CveCobranzaEstatus <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCobranzaEstatus = {CveCobranzaEstatus}", "", DataViewRowState.CurrentRows) + GlobalDTVtaCobranzaEstatus = Dv.ToTable Dv.Dispose() Else - GlobalDTCobranzaEstatus = DirectCast(Application("GlobalDTVtaCobranzaEstatus"), DataTable) + GlobalDTVtaCobranzaEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTVtaCobranzaEstatus") = value + Dim AppNombre As String = $"GlobalDTVtaCobranzaEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - #Region "***********************************************************************DT EVENTOS****************************************************************************************" Property GlobalDTTiposEventos() As DataTable Get @@ -2492,21 +2553,48 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTOIEventoTarea() As DataTable + Public Shared Property GlobalDTOIEventoTarea(CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As DataTable Get - GlobalDTOIEventoTarea = DirectCast(Application("GlobalDTOIEventoTarea"), DataTable) + Dim AppNombre As String = $"GlobalDTOIEventoTarea-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjEventos As New ClsOIEventos + If ObjEventos.GetEventoTarea(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjEventos.DtResultados + ObjEventos.Dispose() + End If + If CveUsuario <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveUsuario = {CveUsuario}", "", DataViewRowState.CurrentRows) + GlobalDTOIEventoTarea = Dv.ToTable + Dv.Dispose() + Else + GlobalDTOIEventoTarea = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If End Get Set(value As DataTable) - Application("GlobalDTOIEventoTarea") = value + Dim AppNombre As String = $"GlobalDTOIEventoTarea-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTOIEstatusEventos() As DataTable + Public Shared Property GlobalDTOIEstatusEventos(Optional CveEventoEstatus As Integer = -1) As DataTable Get - GlobalDTOIEstatusEventos = DirectCast(Application("GlobalDTOIEstatusEventos"), DataTable) + Dim AppNombre As String = "GlobalDTOIEstatusEventos" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjEventos As New ClsOIEventos + If ObjEventos.GetEstatusEventos(-1) Then HttpContext.Current.Application(AppNombre) = ObjEventos.DtResultados + ObjEventos.Dispose() + End If + If CveEventoEstatus > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEventoEstatus = {CveEventoEstatus}", "", DataViewRowState.CurrentRows) + GlobalDTOIEstatusEventos = Dv.ToTable + Dv.Dispose() + Else + GlobalDTOIEstatusEventos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If End Get Set(value As DataTable) - Application("GlobalDTOIEstatusEventos") = value + Dim AppNombre As String = "GlobalDTOIEstatusEventos" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region @@ -4030,50 +4118,53 @@ Public Class ClsPaginas End Get End Property - Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTOIRevision"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTOIRevision = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOIRevision = DirectCast(Application("GlobalDTOIRevision"), DataTable) + Dim AppNombre As String = $"GlobalDTOIRevision-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjEventos As New ClsOIEventos + If ObjEventos.GetRevisionesEventos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjEventos.DtResultados + ObjEventos.Dispose() End If + GlobalDTOIRevision = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTOIRevision") = value + Dim AppNombre As String = $"GlobalDTOIRevision-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTOIAgendaTipo() As DataTable + + Public Shared Property GlobalDTOIAgendaTipo() As DataTable Get - GlobalDTOIAgendaTipo = DirectCast(Application("GlobalDTOIAgendaTipo"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTOIAgendaTipo") = value - End Set - End Property - Property GlobalDTOIAgenda() As DataTable - Get - GlobalDTOIAgenda = DirectCast(Application("GlobalDTOIAgenda"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTOIAgenda") = value - End Set - End Property - Property GlobalDTVtaCondicionesEntrega(Optional CveEmpresa As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTVtaCondicionesEntrega"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTVtaCondicionesEntrega = Dv.ToTable - Dv.Dispose() - Else - GlobalDTVtaCondicionesEntrega = DirectCast(Application("GlobalDTVtaCondicionesEntrega"), DataTable) + Dim AppNombre As String = "GlobalDTOIAgendaTipo" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjEventos As New ClsOIEventos + If ObjEventos.GetAgendaTipo() Then HttpContext.Current.Application(AppNombre) = ObjEventos.DtResultados + ObjEventos.Dispose() End If + GlobalDTOIAgendaTipo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTVtaCondicionesEntrega") = value + Dim AppNombre As String = "GlobalDTOIAgendaTipo" + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + + Public Shared Property GlobalDTVtaCondicionesEntrega(Optional CveEmpresa As Integer = -1) As DataTable + Get + Dim AppNombre As String = $"GlobalDTVtaCondicionesEntrega-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjVentas As New ClsVentas + If ObjVentas.GetCondicionesEntrega(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados + ObjVentas.Dispose() + End If + GlobalDTVtaCondicionesEntrega = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTVtaCondicionesEntrega-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTPaqueteriaGuiaTipos(CveEmpresa As Integer) As DataTable @@ -10362,7 +10453,7 @@ Public Class ClsPaginas Public Function AplicaPrePolizaPagoVenta(VentaActual As Venta, Pago As VentaPago, CvePrePoliza As Integer, ByRef ObjConta As ClsContabilidad) As Boolean Dim ErrorMovtos As Boolean = False - Dim PorcentajePago As Decimal = Pago.ImportePago / VentaActual.Total + Dim PorcentajePago As Decimal = Pago.ImportePagoVenta / VentaActual.Total Dim ImporteMovimiento As Decimal = 0 Dim ImporteMN As Decimal = 0 Dim ImporteME As Decimal = 0 @@ -10372,6 +10463,7 @@ Public Class ClsPaginas Dim tFechaUltimaFluctuacion As Date Dim tImportePago, tImporteVenta As Decimal Dim CveConceptoContableComplementaria As Integer = 207 + If PorcentajePago > 1 Then PorcentajePago = 1 Pago.CveConceptoPago = If(Pago.CveConceptoPago = -1, 2, Pago.CveConceptoPago) 'si viene en parametro lo toma com primera opcion, sino el 2 diff --git a/App_Code/ClsProyectos.vb b/App_Code/ClsProyectos.vb index 38f6a15dd..f26258873 100644 --- a/App_Code/ClsProyectos.vb +++ b/App_Code/ClsProyectos.vb @@ -128,11 +128,12 @@ Public Class ClsProyectos SqlTransacc = Nothing End Sub - Public Function GetProyectos(Optional Opcion As Integer = -1) As Boolean + Public Function GetProyectos(CveEmpresa As Integer, Optional Opcion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ProyectosGet") With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Opcion", SqlDbType.Int).Value = Opcion End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index d1a3e66b5..93bb76a17 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -332,7 +332,7 @@ Namespace Modelos Else IniciaValores() End If - SetMetodoPago(ObjsClsPaginas) + SetMetodoPago() Timbre = New CFDITimbre DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas End Sub @@ -2278,7 +2278,7 @@ Namespace Modelos If GenerarPrePoliza AndAlso CveMovimiento > 0 Then Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero + Dim tCveSubProyecto = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero Dim tCveConcepto As Integer = 278 Dim ValorInventario As Decimal = 0 Dim MovAlmacen As Boolean = False 'debe quedar como el anterior, pero negativo @@ -2503,7 +2503,7 @@ Namespace Modelos If ValorMultiplicador = -1 AndAlso ConceptoContable = 291 Then If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) + CuentasContablesInvalidas.Append("
" & ClsPaginas.GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If @@ -2599,7 +2599,7 @@ Namespace Modelos If ObjInventario.GetMovimientosDetalle(CveMovimientoReferencia, UsuarioActual.CveEmpresa) Then Dim Importe68 As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL * ValorMultiplicador - Dim IdCtaContable68 = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero + Dim IdCtaContable68 = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovto68, Importe68, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable68, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoReferencia, ImporteMX:=Importe68, Contabilizable:=False) Then ErrorPrepoliza = True @@ -2622,7 +2622,7 @@ Namespace Modelos If ObjInventario.GetMovimientosDetalle(CveMovimientoReferencia, UsuarioActual.CveEmpresa) Then Dim Importe68 As Decimal = 0 - Dim IdCtaContable68 = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero + Dim IdCtaContable68 = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovto68, Importe68, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable68, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoReferencia, ImporteMX:=Importe68, Contabilizable:=False) Then ErrorPrepoliza = True @@ -2687,7 +2687,7 @@ Namespace Modelos ImporteConcepto12 = importeMX.RoundSQL If importeMovimiento <> 0 Then If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) + CuentasContablesInvalidas.Append("
" & ClsPaginas.GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If @@ -3332,20 +3332,20 @@ Namespace Modelos importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador) importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago - Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" + Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" 'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas If ObjFactura.TipoDocto.Contiene("Egs") Then - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero Else - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero End If If importeMovimiento <> 0 Then If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}")) + CuentasContablesInvalidas.Append("
" & ClsPaginas.GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}")) idCuentaContabilizacion = 0 End If @@ -3407,14 +3407,14 @@ Namespace Modelos importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago - Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" + Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" 'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero Else - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero End If If UsuarioActual.CveEmpresa = 119 Then @@ -3425,7 +3425,7 @@ Namespace Modelos If importeMovimiento <> 0 Then If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}")) + CuentasContablesInvalidas.Append("
" & ClsPaginas.GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}")) idCuentaContabilizacion = 0 End If @@ -3463,20 +3463,20 @@ Namespace Modelos importeMovimiento = (TmpDTDetalle.SUM("Descuento", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString().ToDecimal) * ValorMultiplicador importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago - Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString().ToEntero() > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}"), "")} - {If(Row2("CveSubProyecto").ToString().ToEntero() > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString()}"), "Sin SubProyecto Asignado")}" + Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString().ToEntero() > 0, ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}"), "")} - {If(Row2("CveSubProyecto").ToString().ToEntero() > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString()}"), "Sin SubProyecto Asignado")}" If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" 'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas If ObjFactura.TipoDocto.Contiene("Egs") Then - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() Else - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() End If If importeMovimiento <> 0 Then If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString() + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}")) + CuentasContablesInvalidas.Append("
" & ClsPaginas.GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString() + ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}")) idCuentaContabilizacion = 0 End If @@ -3646,12 +3646,12 @@ Namespace Modelos Dim PorcentajeImpuestoPago As Decimal = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count = 1 Then - IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("IdCtaContable").ToString.ToEntero + If ClsPaginas.GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count = 1 Then + IdCtaContable = ClsPaginas.GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("IdCtaContable").ToString.ToEntero End If If IdCtaContable <= 0 Then - CuentasContablesInvalidas.AppendFormat("
{0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("NumCuentaMoneda").ToString.ToEntero) + CuentasContablesInvalidas.AppendFormat("
{0}", ClsPaginas.GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("NumCuentaMoneda").ToString.ToEntero) idCuentaContabilizacion = 0 End If @@ -3714,7 +3714,7 @@ Namespace Modelos If importeMovimiento <> 0 And Not ErrorPrepoliza Then If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) + CuentasContablesInvalidas.Append("
" & ClsPaginas.GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If @@ -3969,7 +3969,7 @@ Namespace Modelos Private Function GenerarMovimientoGarantia(CveConceptoMovimiento As Integer, ConceptoPoliza As String, FechaMovimiento As DateTime, factura As Factura, ByRef ObjAcum As ClsAcumuladores, ByRef ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, Optional Modulo As String = "Modelos/SDGA") As Boolean Dim OcurrioError As Boolean = False Try - Dim CveAlmacenGarantia As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={factura.CveSubProyecto}").ToEntero() + Dim CveAlmacenGarantia As Integer = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={factura.CveSubProyecto}").ToEntero() Dim DtGarantias As DataTable = Nothing If ObjAcum.GetGarantiasDetalle(factura.CveVenta) Then @@ -4248,7 +4248,7 @@ Namespace Modelos For Each RowInv As DataRow In DtCostosDistinct.Rows ValorInventario = DtCostos.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString.ToDecimal - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero Try If ValorInventario <> 0 Then If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, Me.SerieFolio, 69, Me.SerieFolio, Me.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=Me.CveSubProyecto) Then @@ -4262,7 +4262,7 @@ Namespace Modelos Next If Not OcurrioError Then - IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero + IdCtaContable = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero ValorInventario = (DtCostos.SUM("Total", "").ToDecimal).RoundSQL If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, True, ValorInventario, Me.SerieFolio, 68, Me.SerieFolio, Me.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=Me.CveSubProyecto) Then OcurrioError = True @@ -4346,7 +4346,7 @@ Namespace Modelos If UsuarioActual.CveEmpresa = 1 Then DtEquivalencias = New DataTable - DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa) + DtEquivalencias = ClsPaginas.GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa) Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'") @@ -4408,7 +4408,7 @@ Namespace Modelos End If 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString()) - IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() 'If ValorInventario <> 0 Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario) Then @@ -4418,7 +4418,7 @@ Namespace Modelos cont += 1 Next End If - IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() + IdCtaContable = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() 'If TotalCosto <> 0 Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveSubProyecto:=factura.CveSubProyecto) Then @@ -4547,7 +4547,7 @@ Namespace Modelos End If 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString()) - IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() 'If ValorInventario <> 0 Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario) Then @@ -4557,7 +4557,7 @@ Namespace Modelos cont += 1 Next End If - IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() + IdCtaContable = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() 'If TotalCosto <> 0 Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveSubProyecto:=factura.CveSubProyecto) Then @@ -5495,7 +5495,7 @@ Namespace Modelos DtCostos = ObjInventario.DtResultados Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) - Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero + Dim IdCtaContableAlmacen As Integer = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero Dim IdCtaContable As Integer = 0 If tmpCostos.Rows.Count > 0 Then @@ -5524,7 +5524,7 @@ Namespace Modelos ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado) End If - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + IdCtaContable = ClsPaginas.GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero If Not ErrorCancelar Then If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then @@ -6406,7 +6406,7 @@ Namespace Modelos Dim EsContabilizable As Boolean = False Dim Concepto As String = "Cancelación" Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancExAR1", 74, DtEntradaDetalle.SUMD("Total"), DtEntradaDetalle.SUMD("Total"), 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto").ToEntero + Dim tCveSubProyecto = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto").ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorInventario, Concepto, 68, Concepto, Fecha, 0, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoSalidaDevRem, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then ErrorCancelar = True @@ -7245,9 +7245,9 @@ Namespace Modelos End If End Sub Public Sub SetMetodoPago() - If CveMetodoPago > 0 AndAlso Not IsNothing(GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then - MetodoPago = GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() - ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() + If CveMetodoPago > 0 AndAlso Not IsNothing(ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then + MetodoPago = ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() + ClaveMetodoPagoSAT = ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() End If End Sub Public Sub SetMoneda(ObjClsPaginas As ClsPaginas) @@ -7262,9 +7262,9 @@ Namespace Modelos End Sub Public Sub SetMetodoPago(ObjClsPaginas As ClsPaginas) If Not IsNothing(ObjClsPaginas) Then - If Not IsNothing(ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then - MetodoPago = ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() - ClaveMetodoPagoSAT = ObjClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() + If Not IsNothing(ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))) Then + MetodoPago = ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("MetodoPago").ToString() + ClaveMetodoPagoSAT = ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago ={0}", CveMetodoPago))("ClaveSAT").ToString() End If End If End Sub @@ -7478,111 +7478,7 @@ Namespace Modelos End Set End Property - Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias-{0}", CveEmpresa) - - If CvePS <> -1 OrElse CveUM <> -1 Then - Dim StrSQL As New StringBuilder - If CvePS <> -1 Then StrSQL.AppendFormat(" AND CvePS = {0}", CvePS) - If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM) - If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosEquivalencias = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) - End If - End Get - - End Property - Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProveedorClasificacion"), DataTable), String.Format("CveEmpresa ={0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProveedorClasificacion = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProveedorClasificacion = DirectCast(HttpContext.Current.Application("GlobalDTProveedorClasificacion"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProveedorClasificacion") = value - End Set - End Property - Property GlobalDTProveedorSucursales(CveProveedor As Integer) As DataTable - Get - If CveProveedor <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProveedorSucursales"), DataTable), String.Format("CveProveedor = {0}", CveProveedor), "", DataViewRowState.CurrentRows) - GlobalDTProveedorSucursales = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProveedorSucursales = DirectCast(HttpContext.Current.Application("GlobalDTProveedorSucursales"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProveedorSucursales") = value - End Set - End Property - Property GlobalDTRoles(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTRoles"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTRoles = Dv.ToTable - Dv.Dispose() - Else - GlobalDTRoles = DirectCast(HttpContext.Current.Application("GlobalDTRoles"), DataTable) - End If - - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTRoles") = value - End Set - End Property - Property GlobalDTNomSatBancos() As DataTable - Get - GlobalDTNomSatBancos = DirectCast(HttpContext.Current.Application("GlobalDTNomSatBancos"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTNomSatBancos") = value - End Set - End Property - Property GlobalDTNomSatConceptos() As DataTable - Get - GlobalDTNomSatConceptos = DirectCast(HttpContext.Current.Application("GlobalDTNomSatConceptos"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTNomSatConceptos") = value - End Set - End Property - Property GlobalDTNomSatRegimenContratacion() As DataTable - Get - GlobalDTNomSatRegimenContratacion = DirectCast(HttpContext.Current.Application("GlobalDTNomSatRegimenContratacion"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTNomSatRegimenContratacion") = value - End Set - End Property - Property GlobalDTNomSatRiesgoPuesto() As DataTable - Get - GlobalDTNomSatRiesgoPuesto = DirectCast(HttpContext.Current.Application("GlobalDTNomSatRiesgoPuesto"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTNomSatRiesgoPuesto") = value - End Set - End Property - Property GlobalDTNomSatTipoIncapacidad() As DataTable - Get - GlobalDTNomSatTipoIncapacidad = DirectCast(HttpContext.Current.Application("GlobalDTNomSatTipoIncapacidad"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTNomSatTipoIncapacidad") = value - End Set - End Property Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable Get @@ -7598,236 +7494,8 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTEmpresas") = value End Set End Property - 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 HttpContext.Current.Application(AppNombre) Is Nothing Then - Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.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) - If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) - GlobalDTClasificaciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) - End If - - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - End Set - End Property - Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones2"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) - GlobalDTClasificaciones2 = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificaciones2 = DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones2"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClasificaciones2") = value - End Set - End Property - Property GlobalDTClasificacionesSubProyectos(Optional CveClasificacion As Integer = -1, Optional CveEmpresa As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesSubProyecto"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) - GlobalDTClasificacionesSubProyectos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionesSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesSubProyecto"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClasificacionesSubProyecto") = value - End Set - End Property - Property GlobalDTACClasificadorObjetoGasto(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTACClasificadorObjetoGasto"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) - GlobalDTACClasificadorObjetoGasto = Dv.ToTable - Dv.Dispose() - Else - GlobalDTACClasificadorObjetoGasto = DirectCast(HttpContext.Current.Application("GlobalDTACClasificadorObjetoGasto"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTACClasificadorObjetoGasto") = value - End Set - End Property - Property GlobalDTClasificacionesDetalle(Optional CveEmpresa As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesDetalle"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) - GlobalDTClasificacionesDetalle = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionesDetalle = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesDetalle"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClasificacionesDetalle") = value - End Set - End Property - Property GlobalDTSubFamilias(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubFamilias"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) - GlobalDTSubFamilias = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTSubFamilias = DirectCast(HttpContext.Current.Application("GlobalDTSubFamilias"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTSubFamilias") = value - End Set - End Property - Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTFamilias"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTFamilias = Dv.ToTable - Dv.Dispose() - Else - GlobalDTFamilias = DirectCast(HttpContext.Current.Application("GlobalDTFamilias"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFamilias") = value - End Set - End Property - Property GlobalDTClasificacionesPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesPresupuestos"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClasificacionesPresupuestos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionesPresupuestos = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionesPresupuestos"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClasificacionesPresupuestos") = value - End Set - End Property - Property GlobalDTMetodosPago() As DataTable - Get - GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application("GlobalDTMetodosPago"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMetodosPago") = value - End Set - End Property - Property GlobalDTModulos() As DataTable - Get - GlobalDTModulos = DirectCast(HttpContext.Current.Application("GlobalDTModulos"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTModulos") = value - End Set - End Property - - Property GlobalDTEstatusOrdenCompra() As DataTable - Get - GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable) - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTEstatusOrdenCompra") = value - End Set - End Property - Property GlobalDTLeyendasFiscales() As DataTable - Get - GlobalDTLeyendasFiscales = DirectCast(HttpContext.Current.Application("GlobalDTLeyendasFiscales"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value - End Set - End Property - Property GlobalDTEstatusFactura() As DataTable - Get - GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstatusFactura") = value - End Set - End Property - Property GlobalDTProyectos(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable - Get - - If DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable).Rows.Count = 0) Then - Dim P As New ClsProyectos - If P.GetProyectos Then - HttpContext.Current.Application("GlobalDTProyectos") = P.DtResultados - End If - P.Dispose() - - End If - - If CveEmpresa <> -1 OrElse Estatus <> -1 Then 'OrElse CveProyecto <> -1 - - Dim StrSQL As New StringBuilder - If CveEmpresa <> -1 Then StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) - ' If CveProyecto <> -1 Then StrSQL.AppendFormat(" {0} CveProyecto = {1}", If(StrSQL.Length > 0, "AND", ""), CveProyecto) - If Estatus <> -1 Then StrSQL.AppendFormat(" {0} CveEstatus = {1}", If(StrSQL.Length > 0, "AND", ""), Estatus) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProyectos = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTProyectos = DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) - End If - - End Get - Set(ByVal value As DataTable) - If value Is Nothing OrElse value.Rows.Count = 0 Then - - End If - HttpContext.Current.Application("GlobalDTProyectos") = value - End Set - End Property - Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa) @@ -7942,107 +7610,7 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTProyectosUsuarios") = value End Set End Property - Property GlobalDTPrecioListas(CveEmpresa As Integer) As DataTable - Get - GlobalDTPrecioListas = DirectCast(HttpContext.Current.Application("GlobalDTPrecioListas"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTPrecioListas") = value - End Set - End Property - 'Property GlobalDTMesas() As DataTable - ' Get - ' GlobalDTMesas = DirectCast(HttpContext.Current.Application("GlobalDTMesas"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTMesas") = value - ' End Set - 'End Property - 'Property GlobalDTTipoOrdenServicios(CveEmpresa As Integer) As DataTable - ' Get - ' GlobalDTTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTTipoOrdenServicios"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoOrdenServicios") = value - ' End Set - 'End Property - 'Property GlobalDTSubTipoOrdenServicios() As DataTable - ' Get - ' GlobalDTSubTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios") = value - ' End Set - 'End Property - 'Property GlobalDTCaracteristicasOrdenServicios() As DataTable - ' Get - ' GlobalDTCaracteristicasOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios") = value - ' End Set - 'End Property - 'Property GlobalDTOrdenesServiciosCaracteristicas() As DataTable - ' Get - ' GlobalDTOrdenesServiciosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas") = value - ' End Set - 'End Property - 'Property GlobalDTCaracteristicasOpciones() As DataTable - ' Get - ' GlobalDTCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOpciones"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTCaracteristicasOpciones") = value - ' End Set - 'End Property - 'Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTTipoCuentasEquipos = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTTipoCuentasEquipos = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoCuentasEquipos") = value - ' End Set - 'End Property - 'Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value - ' End Set - 'End Property - 'Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTTipoCuentasEquiposOpciones = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones") = value - ' End Set - 'End Property ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1) As DataTable Get Dim ObjPS As New ClsProductosServicios @@ -8059,469 +7627,132 @@ Namespace Modelos - Property GlobalDTInvMetodosInventario() As DataTable - Get - GlobalDTInvMetodosInventario = DirectCast(HttpContext.Current.Application("GlobalDTInvMetodosInventario"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTInvMetodosInventario") = value - End Set - End Property - 'Property GlobalDTAFCaracteristicasOpciones() As DataTable + 'Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable ' Get - ' GlobalDTAFCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones") = value - ' End Set - 'End Property - 'Property GlobalDTAFCaracteristicas() As DataTable - ' Get - ' GlobalDTAFCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicas"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTAFCaracteristicas") = value - ' End Set - 'End Property - 'Property GlobalDTAFCaracteristicasClasificaciones() As DataTable - ' Get - ' GlobalDTAFCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones") = value - ' End Set - 'End Property - 'Property GlobalDTImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As DataTable - ' Get - ' Dim Str As New StringBuilder - ' If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS) - ' If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa) - - ' If CvePS > 0 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - ' GlobalDTImpuestosLocales = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTImpuestosLocales = DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTImpuestosLocales") = value - ' End Set - 'End Property - 'Bancos - Property GlobalDTBancos() As DataTable - Get - GlobalDTBancos = DirectCast(HttpContext.Current.Application("GlobalDTBancos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTBancos") = value - End Set - End Property - - - Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) - 'sino existe, recarga los datos - If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then - Dim ObjBancos As New ClsBancos - If ObjBancos.GetBancosCuentasUsuarios(-1, CveEmpresa) Then - HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados - Else - HttpContext.Current.Application(AppNombre) = Nothing - End If - ObjBancos.Dispose() - End If - - Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa) - If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario) - If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta) - If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo")) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows) - GlobalDTBancosCuentas = Dv.ToTable - Dv.Dispose() - 'GlobalDTBancosCuentas = DirectCast(Application("GlobalDTBancosCuentas"), DataTable) - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - End Set - End Property - - - - Property GlobalDTTipoTransacciones() As DataTable - Get - If UsuarioActual.CveEmpresa = 66 Then - GlobalDTTipoTransacciones = DirectCast(HttpContext.Current.Application("GlobalDTTipoTransacciones"), DataTable).FiltraParametros("Estatus = 1") - Else - GlobalDTTipoTransacciones = DirectCast(HttpContext.Current.Application("GlobalDTTipoTransacciones"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoTransacciones") = value - End Set - End Property - 'Property GlobalDTEstatusIE() As DataTable - ' Get - ' GlobalDTEstatusIE = DirectCast(HttpContext.Current.Application("GlobalDTEstatusIE"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTEstatusIE") = value - ' End Set - 'End Property - 'Property GlobalDTBancosIE() As DataTable - ' Get - ' GlobalDTBancosIE = DirectCast(HttpContext.Current.Application("GlobalDTBancosIE"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTBancosIE") = value - ' End Set - 'End Property - 'Property GlobalDTTipoCuenta() As DataTable - ' Get - ' GlobalDTTipoCuenta = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuenta"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoCuenta") = value - ' End Set - 'End Property - ''Fin Bancos - - ''Fin EstadoCIvil - ''TipoPerioso - 'Property GlobalDTTipoPeriodo() As DataTable - ' Get - ' GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application("GlobalDTTipoPeriodo"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoPeriodo") = value - ' End Set - 'End Property - ''Fin TipoPeriodo - - 'Periodos - 'Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable - ' Get - ' Dim Str As New StringBuilder - ' If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - ' If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo) - ' If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo) - ' If Str.Length > 0 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - ' GlobalDTNominasPeriodos = Dv.ToTable - ' Dv.Dispose() - - ' Else - ' GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable) + ' Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa) + ' 'sino existe, recarga los datos + ' If HttpContext.Current.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 HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados + ' ObjClientes.Dispose() ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTNominasPeriodos") = value - ' End Set - 'End Property - 'Fin Periodos - 'Fin Ruta - 'Cliente - Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa) - 'sino existe, recarga los datos - If HttpContext.Current.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 HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados - ObjClientes.Dispose() - End If - - - If CveEmpresa <> -1 Then - - Dim StrSQL As New StringBuilder - StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCliente = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) - End If - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - 'Dim ObjClientes As New ClsClientes - 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados - 'ObjClientes.Dispose() - End Set - End Property - Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones-{0}", CveEmpresa) - 'sino existe, recarga los datos - If HttpContext.Current.Application(AppNombre) Is Nothing Then - Dim ObjClientes As New ClsClientes - If ObjClientes.GetClienteClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados - ObjClientes.Dispose() - End If - If CveEmpresa <> -1 Then - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClienteClasificaciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) - End If - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - 'Dim ObjClientes As New ClsClientes - 'If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados - 'ObjClientes.Dispose() - End Set - End Property - Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenServicios"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTEstatusOrdenServicios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTEstatusOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenServicios"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstatusOrdenServicios") = value - End Set - End Property - 'Variables para Ventas - Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTVendedores"), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows) - GlobalDTVendedores = Dv.ToTable - Dv.Dispose() - Else - GlobalDTVendedores = DirectCast(HttpContext.Current.Application("GlobalDTVendedores"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTVendedores") = value - End Set - End Property - Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClientesCorporativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClientesCorporativo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClientesCorporativo = DirectCast(HttpContext.Current.Application("GlobalDTClientesCorporativo"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClientesCorporativo") = value - End Set - End Property - Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCompProveedores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTCompProveedores = Dv.ToTable - Dv.Dispose() - Else - GlobalDTCompProveedores = DirectCast(HttpContext.Current.Application("GlobalDTCompProveedores"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTCompProveedores") = value - End Set - End Property - 'EstatusFactura - 'Property GlobalDTCompEstatusFactura() As DataTable - ' Get - ' GlobalDTCompEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTCompEstatusFactura"), DataTable).FiltraParametros("Estatus = 'Activo'") - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTCompEstatusFactura") = value - ' End Set - 'End Property - 'Property GlobalDTContratosSecciones() As DataTable - ' Get - ' GlobalDTContratosSecciones = DirectCast(HttpContext.Current.Application("GlobalDTContratosSecciones"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTContratosSecciones") = value - ' End Set - 'End Property - 'Property GlobalDTContratos() As DataTable - ' Get - ' GlobalDTContratos = DirectCast(HttpContext.Current.Application("GlobalDTContratos"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTContratos") = value - ' End Set - 'End Property - 'Property GlobalDTContratosTipos() As DataTable - ' Get - ' GlobalDTContratosTipos = DirectCast(HttpContext.Current.Application("GlobalDTContratosTipos"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTContratosTipos") = value - ' End Set - 'End Property - 'Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable - ' Get ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTTipoAlmacen = Dv.ToTable + + ' Dim StrSQL As New StringBuilder + ' StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) + ' If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) + + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTCliente = Dv.ToTable ' Dv.Dispose() + ' Else - ' GlobalDTTipoAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable) + ' GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) ' End If - ' End Get ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTipoAlmacen") = value + ' Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa) + ' HttpContext.Current.Application(AppNombre) = value + ' 'Dim ObjClientes As New ClsClientes + ' 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados + ' 'ObjClientes.Dispose() ' End Set 'End Property - 'Property GlobalDTInvConceptos() As DataTable - ' Get - - ' Return DirectCast(HttpContext.Current.Application("GlobalDTInvConceptos"), DataTable) - - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTInvConceptos") = value - ' End Set - 'End Property - 'Property GlobalDTSeccionAlmacen(CveEmpresa As Integer) As DataTable + 'Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable ' Get + ' Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones-{0}", CveEmpresa) + ' 'sino existe, recarga los datos + ' If HttpContext.Current.Application(AppNombre) Is Nothing Then + ' Dim ObjClientes As New ClsClientes + ' If ObjClientes.GetClienteClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados + ' ObjClientes.Dispose() + ' End If ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTSeccionAlmacen = Dv.ToTable + + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTClienteClasificaciones = Dv.ToTable ' Dv.Dispose() ' Else - ' GlobalDTSeccionAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable) + ' GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones-{0}", CveEmpresa) + ' HttpContext.Current.Application(AppNombre) = value + ' 'Dim ObjClientes As New ClsClientes + ' 'If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados + ' 'ObjClientes.Dispose() + ' End Set + 'End Property + + 'Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable + ' Get + ' Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) + ' 'sino existe, recarga los datos + ' If HttpContext.Current.Application(AppNombre) Is Nothing Then + ' Dim ObjUsr As New ClsInventarios + ' If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados + ' ObjUsr.Dispose() ' End If + ' Dim Str As New StringBuilder + ' Str.Append("1=1 AND ") + ' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) + ' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) + ' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) + ' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) + + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTAlmacen = Dv.ToTable + ' Dv.Dispose() ' End Get ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value + ' Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) + ' HttpContext.Current.Application(AppNombre) = value ' End Set + ' 'Get + + ' ' Dim Str As New StringBuilder + ' ' Str.Append("1=1 AND ") + ' ' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) + ' ' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) + ' ' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) + ' ' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) + + ' ' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' ' GlobalDTAlmacen = Dv.ToTable + ' ' Dv.Dispose() + + ' 'End Get + ' 'Set(value As DataTable) + ' ' Application("GlobalDTAlmacen") = value + ' 'End Set 'End Property - Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) - 'sino existe, recarga los datos - If HttpContext.Current.Application(AppNombre) Is Nothing Then - Dim ObjUsr As New ClsInventarios - If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados - ObjUsr.Dispose() - End If - - Dim Str As New StringBuilder - Str.Append("1=1 AND ") - If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) - If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) - If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) - If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTAlmacen = Dv.ToTable - Dv.Dispose() - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - End Set - 'Get - - ' Dim Str As New StringBuilder - ' Str.Append("1=1 AND ") - ' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) - ' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) - ' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) - ' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) - - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - ' GlobalDTAlmacen = Dv.ToTable - ' Dv.Dispose() - - 'End Get - 'Set(value As DataTable) - ' Application("GlobalDTAlmacen") = value - 'End Set - End Property - Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa) - 'sino existe, recarga los datos - If HttpContext.Current.Application(AppNombre) Is Nothing Then - Dim ObjUsr As New ClsSisUsuarios - If ObjUsr.GetAlmacen(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados - ObjUsr.Dispose() - End If - Dim Str As New StringBuilder - Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa) - If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTAlmacenUsuarios = Dv.ToTable - Dv.Dispose() - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - End Set - End Property - 'Property GlobalDTNom_Periodos() As DataTable + 'Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable ' Get - ' GlobalDTNom_Periodos = DirectCast(HttpContext.Current.Application("GlobalDTNom_Periodos"), DataTable) + ' Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa) + ' 'sino existe, recarga los datos + ' If HttpContext.Current.Application(AppNombre) Is Nothing Then + ' Dim ObjUsr As New ClsSisUsuarios + ' If ObjUsr.GetAlmacen(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados + ' ObjUsr.Dispose() + ' End If + ' Dim Str As New StringBuilder + ' Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa) + ' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) + + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTAlmacenUsuarios = Dv.ToTable + ' Dv.Dispose() ' End Get ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTNom_Periodos") = value - ' End Set - 'End Property - 'Property GlobalDTVtaFormaPago() As DataTable - ' Get - ' GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTVtaFormaPago") = value - ' End Set - 'End Property - 'Property GlobalDTVtaMetodoPago() As DataTable - ' Get - ' GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value - ' End Set - 'End Property - 'Property GlobalDTVtaTiposRelacion() As DataTable - ' Get - ' GlobalDTVtaTiposRelacion = DirectCast(HttpContext.Current.Application("GlobalDTVtaTiposRelacion"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTVtaTiposRelacion") = value - ' End Set - 'End Property - 'Property GlobalDTTiposDocumentos() As DataTable - ' Get - ' GlobalDTTiposDocumentos = DirectCast(HttpContext.Current.Application("GlobalDTTiposDocumentos"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTTiposDocumentos") = value + ' Dim AppNombre As String = String.Format("GlobalDTAlmacenUsuarios-{0}", CveEmpresa) + ' HttpContext.Current.Application(AppNombre) = value ' End Set 'End Property + Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As ClsPaginas.MTipoCambioFluctuacion Get @@ -8597,30 +7828,6 @@ Namespace Modelos End Set End Property - Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") - 'sino existe, recarga los datos - If HttpContext.Current.Application(AppNombre) Is Nothing Then - Using ObjContabilidad As New ClsContabilidad - If ObjContabilidad.GetConta_ConceptosContables() Then HttpContext.Current.Application(AppNombre) = ObjContabilidad.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing - End Using - - End If - If CveConceptoContable <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) - GlobalDTContaConceptosContables = Dv.ToTable - Dv.Dispose() - Else - GlobalDTContaConceptosContables = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) - End If - - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") - HttpContext.Current.Application(AppNombre) = value - End Set - End Property #End Region diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index d9fa69a59..590b27b3c 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -1650,7 +1650,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState If DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTProyectos"), DataTable).Rows.Count = 0) Then Dim P As New ClsProyectos - If P.GetProyectos Then + If P.GetProyectos(-1) Then HttpContext.Current.Application("GlobalDTProyectos") = P.DtResultados End If P.Dispose() diff --git a/CRM/RepAgendasBitacoras.aspx.cs b/CRM/RepAgendasBitacoras.aspx.cs index 3a460798c..8f2242b97 100644 --- a/CRM/RepAgendasBitacoras.aspx.cs +++ b/CRM/RepAgendasBitacoras.aspx.cs @@ -103,6 +103,6 @@ public partial class CRM_AgendasBitacoras : ClsPaginas protected void LnkExcel_Click(object sender, EventArgs e) { - GVDatos.ExportToExcelx("RepAgendaBiracora.xls"); + GVDatos.ExportToExcelX("RepAgendaBiracora"); } } \ No newline at end of file diff --git a/Compras/EvaluacionProveedor.aspx.vb b/Compras/EvaluacionProveedor.aspx.vb index 460ed861b..517bedcec 100644 --- a/Compras/EvaluacionProveedor.aspx.vb +++ b/Compras/EvaluacionProveedor.aspx.vb @@ -118,7 +118,7 @@ Partial Class Compras_EvaluacionProveedor TxtSerieFolio.Text = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString() End If End If - If ObjCompras.GetCompraDetalle(CveCompra) Then + If ObjCompras.GetCompraDetalle(CveCompra, UsuarioActual.CveEmpresa) Then Dim StrPS As New StringBuilder() For Each Row As DataRow In ObjCompras.DtResultados.Rows If ObjCompras.DtResultados.Rows.Count > 1 Then diff --git a/Contabilidad/PopUpAuxiliar.aspx.vb b/Contabilidad/PopUpAuxiliar.aspx.vb index 111ae7686..21da35698 100644 --- a/Contabilidad/PopUpAuxiliar.aspx.vb +++ b/Contabilidad/PopUpAuxiliar.aspx.vb @@ -225,13 +225,21 @@ Partial Class PopUpAuxiliar e.Row.FCLinkButton("LnkDesAplicar").CommandName = "DesAplicarCompra" e.Row.FCLinkButton("imgD").Visible = False If e.Row.DBCampo("CveConceptoContable").Contiene("272") Then - e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompra"), e.Row.DBCampo("CveCompraAmortizacion")) + e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}|{3}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompra"), e.Row.DBCampo("CveCompraAmortizacion"), e.Row.DBCampo("CveIE")) Else - e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompraAmortizacion"), e.Row.DBCampo("CveCompra")) + e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}|{3}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompraAmortizacion"), e.Row.DBCampo("CveCompra"), e.Row.DBCampo("CveIE")) End If - End If - If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then + ElseIf e.Row.DBCampo("CveConceptoContable").Contiene("21") Then 'desaplicar anticipo de compra + + e.Row.FCLinkButton("LnkDesAplicar").Visible = True + e.Row.FCLinkButton("LnkDesAplicar").CommandName = "DesAplicarAnticipoCompra" + e.Row.FCLinkButton("imgD").Visible = False + e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompra"), e.Row.DBCampo("CveIE")) + + End If + + If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DBCampo("CveReferencia").ToEntero}" 'If e.Row.DBCampo("CveReferencia").ToEntero > 0 Then ' e.Row.Cells(10).Text = "" @@ -519,6 +527,40 @@ Partial Class PopUpAuxiliar End If + If e.CommandName = "DesAplicarAnticipoCompra" Then + + Dim CvePrePoliza, CveCompra, CveIE As Integer + Dim TieneError = False + + Dim St As String() = e.CommandArgument.ToString.Split("|"c) + If St.Length > 0 Then + CvePrePoliza = St(0).ToEntero + CveCompra = St(1).ToEntero + CveIE = St(2).ToEntero + End If + + If CvePrePoliza > 0 Then + Dim Conta As New ClsContabilidad() + Conta.IniciaTransacSQL() + + If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + TieneError = True + End If + + If Not TieneError AndAlso Not Conta.DesAplicarPago(CvePrePoliza, 21, CveCompra, CveIE) Then + TieneError = True + End If + + If Not TieneError Then + Conta.Commit() + Alert("Pago Desaplicado.", TipoMensaje.ToastInformacion) + Else + Conta.RollBack() + Alert("Pago no fue desaplicado.", TipoMensaje.ToastError) + End If + End If + + End If End Sub End Class diff --git a/CxC/GestionCobranza.aspx.vb b/CxC/GestionCobranza.aspx.vb index 183098cf2..836c147bf 100644 --- a/CxC/GestionCobranza.aspx.vb +++ b/CxC/GestionCobranza.aspx.vb @@ -57,11 +57,11 @@ Partial Class Ventas_GestionCobranza DdlResponsableCobranza.DataBind() DdlResponsableCobranza.Items.Insert(0, New ListItem("Todos", "-1")) - DdlCobranzaEstatus.DataSource = GlobalDTCobranzaEstatus(UsuarioActual.CveEmpresa) + DdlCobranzaEstatus.DataSource = GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) DdlCobranzaEstatus.DataBind() DdlCobranzaEstatus.Items.Insert(0, New ListItem("Todos", "-1")) - DdlCobranzaEstatusEdit.DataSource = GlobalDTCobranzaEstatus(UsuarioActual.CveEmpresa) + DdlCobranzaEstatusEdit.DataSource = GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) DdlCobranzaEstatusEdit.DataBind() If ObjVentas.GetCobranzaTurnoEstatus(-1, UsuarioActual.CveEmpresa) Then diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx index e66c3446e..8b9913fba 100644 --- a/CxC/RepCxC.aspx +++ b/CxC/RepCxC.aspx @@ -365,7 +365,7 @@
Contrato:
-
+
diff --git a/CxC/RepCxC.aspx.vb b/CxC/RepCxC.aspx.vb index f6030f5be..02e642962 100644 --- a/CxC/RepCxC.aspx.vb +++ b/CxC/RepCxC.aspx.vb @@ -4,7 +4,8 @@ Option Strict On Imports System.Data Imports System.IO Imports Extensiones -Imports Microsoft.Reporting.WebForms +Imports Microsoft.Reporting.WebForms + Partial Class RepCxC Inherits ClsPaginas @@ -152,7 +153,7 @@ Partial Class RepCxC txtCorteA.Text = $"31/12/{Now.Year}" 'Carga Cobranza Estatus - DdlCobranzaEstatus.DataSource = GlobalDTCobranzaEstatus(UsuarioActual.CveEmpresa) + DdlCobranzaEstatus.DataSource = GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) DdlCobranzaEstatus.DataBind() DdlCobranzaEstatus.Items.Insert(0, New ListItem("Todos", "-1")) @@ -181,9 +182,9 @@ Partial Class RepCxC Private Sub CargaContratos() Dim ObjContratos As New ClsContratos If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente:=-1) Then - DdlContrato.DataSource = ObjContratos.DtResultados - End If - + DdlContrato.DataSource = ObjContratos.DtResultados + End If + divContrato.Visible = True ObjContratos.Dispose() DdlContrato.DataBind() diff --git a/CxC/RepCxCDetalle.aspx b/CxC/RepCxCDetalle.aspx index e13c957ac..694f59a17 100644 --- a/CxC/RepCxCDetalle.aspx +++ b/CxC/RepCxCDetalle.aspx @@ -348,7 +348,7 @@
Contrato:
-
+
diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index ee74096fa..4edcd7ef5 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -280,7 +280,7 @@ Partial Class RepCxCDetalle DdlTipoDocto.Items.Add(New ListItem("Ing X Comp", "IxC")) 'Carga Cobranza Estatus - DdlCobranzaEstatusFiltro.DataSource = GlobalDTCobranzaEstatus(UsuarioActual.CveEmpresa) + DdlCobranzaEstatusFiltro.DataSource = GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) DdlCobranzaEstatusFiltro.DataBind() DdlCobranzaEstatusFiltro.Items.Insert(0, New ListItem("Todos", "-1")) @@ -439,7 +439,7 @@ Partial Class RepCxCDetalle If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente:=-1) Then DdlContrato.DataSource = ObjContratos.DtResultados End If - + divContrato.Visible = True ObjContratos.Dispose() DdlContrato.DataBind() @@ -1062,7 +1062,7 @@ Partial Class RepCxCDetalle DdlUsuarioCobranza.DataBind() DdlUsuarioCobranza.Items.Insert(0, New ListItem("Sin Cobrador", "-1")) - DdlCobranzaEstatus.DataSource = GlobalDTCobranzaEstatus(UsuarioActual.CveEmpresa) + DdlCobranzaEstatus.DataSource = GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) DdlCobranzaEstatus.DataBind() DdlCobranzaEstatus.Items.Insert(0, New ListItem("Sin Estatus", "-1")) diff --git a/CxC/RepCxCPeriodo.aspx.cs b/CxC/RepCxCPeriodo.aspx.cs index ab35f80f1..83ab94427 100644 --- a/CxC/RepCxCPeriodo.aspx.cs +++ b/CxC/RepCxCPeriodo.aspx.cs @@ -81,7 +81,7 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas txtCorteA.Text = $"31/12/{DateTime.Now.Year}"; //Carga Cobranza Estatus - DdlCobranzaEstatus.DataSource = get_GlobalDTCobranzaEstatus(UsuarioActual.CveEmpresa); + DdlCobranzaEstatus.DataSource = get_GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa); DdlCobranzaEstatus.DataBind(); DdlCobranzaEstatus.Items.Insert(0, new ListItem("Todos", "-1")); diff --git a/GPS/RepParadas.aspx.cs b/GPS/RepParadas.aspx.cs index 1be65fd4a..c378183ef 100644 --- a/GPS/RepParadas.aspx.cs +++ b/GPS/RepParadas.aspx.cs @@ -197,6 +197,6 @@ public partial class GPS_RepParardas : ClsPaginas { //var table = new System.Web.UI.HtmlControls.HtmlTable(); // table.InnerHtml = DivIndicadores.InnerHtml; - GvDatos.ExportToExcelx("ReporteRutas"); + GvDatos.ExportToExcel("ReporteRutas"); } } \ No newline at end of file diff --git a/Global.asax b/Global.asax index 7c4e7e04d..4590b7858 100644 --- a/Global.asax +++ b/Global.asax @@ -193,27 +193,27 @@ 'B A N C O S - GuardaLogAsax(String.Format("Globalasax 12:{0}", DateTime.Now)) - Using ObjBancos As New ClsBancos - 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing - 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing - If ObjBancos.GetBancos_TiposTransaccion(-1) Then Application("GlobalDTTipoTransacciones") = ObjBancos.DtResultados Else Application("GlobalDTTipoTransacciones") = Nothing - If ObjBancos.GetBancos_EstatusIE() Then Application("GlobalDTBancosEstatusIE") = ObjBancos.DtResultados Else Application("GlobalDTBancosEstatusIE") = Nothing - If ObjBancos.GetBancos() Then Application("GlobalDTBancos") = ObjBancos.DtResultados Else Application("GlobalDTBancos") = Nothing - If ObjBancos.GetBancos_TiposCuenta() Then Application("GlobalDTTipoCuenta") = ObjBancos.DtResultados Else Application("GlobalDTTipoCuenta") = Nothing - End Using + 'GuardaLogAsax(String.Format("Globalasax 12:{0}", DateTime.Now)) + 'Using ObjBancos As New ClsBancos + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing + 'If ObjBancos.GetBancos_TiposTransaccion(-1) Then Application("GlobalDTTipoTransacciones") = ObjBancos.DtResultados Else Application("GlobalDTTipoTransacciones") = Nothing + 'If ObjBancos.GetBancos_EstatusIE() Then Application("GlobalDTBancosEstatusIE") = ObjBancos.DtResultados Else Application("GlobalDTBancosEstatusIE") = Nothing + 'If ObjBancos.GetBancos() Then Application("GlobalDTBancos") = ObjBancos.DtResultados Else Application("GlobalDTBancos") = Nothing + 'If ObjBancos.GetBancos_TiposCuenta() Then Application("GlobalDTTipoCuenta") = ObjBancos.DtResultados Else Application("GlobalDTTipoCuenta") = Nothing + 'End Using - GuardaLogAsax(String.Format("Globalasax 13:{0}", DateTime.Now)) + 'GuardaLogAsax(String.Format("Globalasax 13:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'I N V E N T A R I O S - Using Objinventarios As New ClsInventarios - 'If Objinventarios.GetAlmacenes(-1, -1, -1, -1) Then Application("GlobalDTAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTAlmacen") = Nothing - If Objinventarios.GetSeccionesAlmacenes(-1, -1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing - If Objinventarios.GetTiposAlmacenes Then Application("GlobalDTTipoAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTTipoAlmacen") = Nothing - If Objinventarios.GetConceptos Then Application("GlobalDTInvConceptos") = Objinventarios.DtResultados Else Application("GlobalDTInvConceptos") = Nothing - End Using + 'Using Objinventarios As New ClsInventarios + 'If Objinventarios.GetAlmacenes(-1, -1, -1, -1) Then Application("GlobalDTAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTAlmacen") = Nothing + 'If Objinventarios.GetSeccionesAlmacenes(-1, -1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing + 'If Objinventarios.GetTiposAlmacenes Then Application("GlobalDTTipoAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTTipoAlmacen") = Nothing + 'If Objinventarios.GetConceptos Then Application("GlobalDTInvConceptos") = Objinventarios.DtResultados Else Application("GlobalDTInvConceptos") = Nothing + 'End Using GuardaLogAsax(String.Format("Globalasax 14:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -262,18 +262,16 @@ 'If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing 'If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing End Using -#End If - GuardaLogAsax(String.Format("Globalasax 16:{0}", DateTime.Now)) + 'GuardaLogAsax(String.Format("Globalasax 16:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'E V E N T O S - Using ObjEventos As New ClsOIEventos - If ObjEventos.GetEstatusEventos(-1) Then Application("GlobalDTOIEstatusEventos") = ObjEventos.DtResultados Else Application("GlobalDTOIEstatusEventos") = Nothing - If ObjEventos.GetRevisionesEventos(-1) Then Application("GlobalDTOIRevision") = ObjEventos.DtResultados Else Application("GlobalDTOIRevision") = Nothing - If ObjEventos.GetAgendaTipo() Then Application("GlobalDTOIAgendaTipo") = ObjEventos.DtResultados Else Application("GlobalDTOIAgendaTipo") = Nothing - If ObjEventos.GetEventoTarea(-1, -1) Then Application("GlobalDTOIEventoTarea") = ObjEventos.DtResultados Else Application("GlobalDTOIEventoTarea") = Nothing - End Using - + 'Using ObjEventos As New ClsOIEventos + 'If ObjEventos.GetEstatusEventos(-1) Then Application("GlobalDTOIEstatusEventos") = ObjEventos.DtResultados Else Application("GlobalDTOIEstatusEventos") = Nothing + 'If ObjEventos.GetRevisionesEventos(-1) Then Application("GlobalDTOIRevision") = ObjEventos.DtResultados Else Application("GlobalDTOIRevision") = Nothing + 'If ObjEventos.GetAgendaTipo() Then Application("GlobalDTOIAgendaTipo") = ObjEventos.DtResultados Else Application("GlobalDTOIAgendaTipo") = Nothing + 'If ObjEventos.GetEventoTarea(-1, -1) Then Application("GlobalDTOIEventoTarea") = ObjEventos.DtResultados Else Application("GlobalDTOIEventoTarea") = Nothing + 'End Using GuardaLogAsax(String.Format("Globalasax 17:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'V E N T A S @@ -289,11 +287,7 @@ If ObjVentas.GetCobranzaEstatus(-1, -1) Then Application("GlobalDTVtaCobranzaEstatus") = ObjVentas.DtResultados Else Application("GlobalDTVtaCobranzaEstatus") = Nothing End Using - GuardaLogAsax(String.Format("Globalasax 18:{0}", DateTime.Now)) - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - - GuardaLogAsax(String.Format("Globalasax 19:{0}", DateTime.Now)) - + 'GuardaLogAsax(String.Format("Globalasax 19:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ''MF @@ -304,7 +298,7 @@ 'ObjMF.Dispose() - +#End If '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C L A S I F I C A C I O N E S @@ -365,10 +359,10 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'M E T O D O S - D E - P A G O - Using ObjMetodoPago As New ClsMetodosPagos() - If ObjMetodoPago.GetMetodosPago() Then Application("GlobalDTMetodosPago") = ObjMetodoPago.DtResultados Else Application("GlobalDTMetodosPago") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 21:{0}", DateTime.Now)) + 'Using ObjMetodoPago As New ClsMetodosPagos() + ' If ObjMetodoPago.GetMetodosPago() Then Application("GlobalDTMetodosPago") = ObjMetodoPago.DtResultados Else Application("GlobalDTMetodosPago") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 21:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -379,34 +373,34 @@ ' If ObjMonedas.GetMonedasAlias() Then Application("GlobalDTMonedasAlias") = ObjMonedas.DtResultados Else Application("GlobalDTMonedasAlias") = Nothing 'End Using - GuardaLogAsax(String.Format("Globalasax 22:{0}", DateTime.Now)) + 'GuardaLogAsax(String.Format("Globalasax 22:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'L E Y E N D A S - F I S C A L E S - Using ObjLeyendasFiscales As New ClsLeyendasFiscales() - If ObjLeyendasFiscales.GetLeyendasFiscales() Then Application("GlobalDTLeyendasFiscales") = ObjLeyendasFiscales.DtResultados Else Application("GlobalDTLeyendasFiscales") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 23:{0}", DateTime.Now)) + 'Using ObjLeyendasFiscales As New ClsLeyendasFiscales() + ' If ObjLeyendasFiscales.GetLeyendasFiscales() Then Application("GlobalDTLeyendasFiscales") = ObjLeyendasFiscales.DtResultados Else Application("GlobalDTLeyendasFiscales") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 23:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'F A C T U R A S - Using ObjEstatusFactura As New ClsEstatusFactura() - If ObjEstatusFactura.GetEstatusFactura() Then Application("GlobalDTEstatusFactura") = ObjEstatusFactura.DtResultados Else Application("GlobalDTEstatusFactura") = Nothing + 'Using ObjEstatusFactura As New ClsEstatusFactura() + ' If ObjEstatusFactura.GetEstatusFactura() Then Application("GlobalDTEstatusFactura") = ObjEstatusFactura.DtResultados Else Application("GlobalDTEstatusFactura") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 24:{0}", DateTime.Now)) + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 24:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'P R O Y E C T O S - Using ObjProyectos As New ClsProyectos - If ObjProyectos.GetProyectos Then Application("GlobalDTProyectos") = ObjProyectos.DtResultados Else Application("GlobalDTProyectos") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 25:{0}", DateTime.Now)) + 'Using ObjProyectos As New ClsProyectos + ' If ObjProyectos.GetProyectos Then Application("GlobalDTProyectos") = ObjProyectos.DtResultados Else Application("GlobalDTProyectos") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 25:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'S U B P R O Y E C T O S diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index d9299387d..835bd7d29 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -1506,26 +1506,14 @@ Partial Class Inicio Private Sub IniializaDdlsOpcionesAgenda() 'CLIENTES - If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then - DdlClientesWS.setEsWebService(True) - Else - DdlClientesWS.setEsWebService(False) - CargaClientes() - End If + DdlClientesWS.setEsWebService(True) 'PROVEEDORES - If (UsuarioActual.Empresa.Funcionalidad(105) = "1") Then - DdlProveedor.setEsWebService(True) - DdlProveedor.Attributes.Add("data-metodo", "getproveedores") - DdlProveedor.SelectedText = "Todos" - DdlProveedor.SelectedValue = "-1" - Else - DdlProveedor.setEsWebService(False) - DdlProveedor.ddl.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedor.ddl.DataBind() - DdlProveedor.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - End If + DdlProveedor.setEsWebService(True) + DdlProveedor.Attributes.Add("data-metodo", "getproveedores") + DdlProveedor.SelectedText = "Todos" + DdlProveedor.SelectedValue = "-1" DdlProveedor.ddl.AutoPostBack = False DdlClientesWS.ddl.AutoPostBack = False @@ -1579,8 +1567,6 @@ Partial Class Inicio Private Sub CargaClientes() If Not UsuarioActual.Empresa.Funcionalidad(105) = "1" Then DdlClientesWS.ddl.Items.Clear() - DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) - DdlClientesWS.DataBind() DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) End If End Sub diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 20274a117..e13af0eeb 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -1069,7 +1069,7 @@ Partial Class Inventarios_RecepcionAlmacen DtRecepcion = ObjInventario.DtResultados.Copy() 'VERIFICA LOS QUE TENGAN LAS CLASIFICACION DE USADOS - If ObjCompras.GetCompraDetalle(pCveCompra) Then + If ObjCompras.GetCompraDetalle(pCveCompra, UsuarioActual.CveEmpresa) Then If ObjCompras.DtResultados.COUNT("Cantidad", "CveClasificacion=20519") > 0 Then SumarImporteUsados = True ValidarRecepcionUsados = True @@ -3186,13 +3186,11 @@ Partial Class Inventarios_RecepcionAlmacen Dim DtComprasDetalle As DataTable = Nothing Dim DtTamanios As DataTable = Nothing - If ObjCompras.GetCompraDetalle(CveCompraSurtir) Then + If ObjCompras.GetCompraDetalle(CveCompraSurtir, UsuarioActual.CveEmpresa) Then DtComprasDetalle = ObjCompras.DtResultados.Copy() End If - If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then - DtTamanios = ObjAcum.DtResultados.Copy() - End If + DtTamanios = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa) For Each GvRow As GridViewRow In GvInv.Rows If GvRow.RowType = DataControlRowType.DataRow Then diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs index ea868bc5d..e09084b6d 100644 --- a/OI/TareaDetalle.aspx.cs +++ b/OI/TareaDetalle.aspx.cs @@ -253,7 +253,7 @@ public partial class OI_TareaDetalle : ClsPaginas private void CargaEstatus() { - DdlEventoEstatus.DataSource = GlobalDTOIEstatusEventos;//get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlEventoEstatus.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); DDlEstatus.DataSource = DdlEventoEstatus.DataSource; DdlEventoEstatus.DataBind(); DDlEstatus.DataBind(); diff --git a/RMA/Garantias.aspx.vb b/RMA/Garantias.aspx.vb index 178f130fa..33ed5008a 100644 --- a/RMA/Garantias.aspx.vb +++ b/RMA/Garantias.aspx.vb @@ -62,7 +62,7 @@ Partial Class Ventas_Garantias Private Sub CargaCompra() Dim objCompras As New ClsCompras - If objCompras.GetCompraDetalle(DdlFolios.SelectedValue.ToEntero) Then + If objCompras.GetCompraDetalle(DdlFolios.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then ViewState("DTCompras") = objCompras.DtResultados GvPS.Visible = True BtnSolicitar.Visible = True diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index a5cd054d6..a554bcc80 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -364,13 +364,14 @@ Partial Class Sistemas_CatSesiones Private Sub CargaProyectos() 'Carga Proyectos - Dim ObjProyectos As New ClsProyectos - If ObjProyectos.GetProyectos Then - Application("GlobalDTProyectos") = ObjProyectos.DtResultados - Else - Application("GlobalDTProyectos") = Nothing - End If - ObjProyectos.Dispose() + 'Dim ObjProyectos As New ClsProyectos + 'If ObjProyectos.GetProyectos(UsuarioActual.CveEmpresa) Then + ' Application("GlobalDTProyectos") = ObjProyectos.DtResultados + 'Else + ' Application("GlobalDTProyectos") = Nothing + 'End If + 'ObjProyectos.Dispose() + GlobalDTProyectos(UsuarioActual.CveEmpresa) = Nothing 'Fin Carga Proyectos End Sub diff --git a/UserControl/TareaNueva.ascx.cs b/UserControl/TareaNueva.ascx.cs index 1ce591d19..b71d5a575 100644 --- a/UserControl/TareaNueva.ascx.cs +++ b/UserControl/TareaNueva.ascx.cs @@ -34,24 +34,7 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl { dt = (System.Data.DataTable)Application["GlobalDTUsuarios"]; } return dt; } - //public DataTable GlobalDTOIRevision - protected System.Data.DataTable get_GlobalDTOIRevision(int CveEmpresa = -1) - { - System.Data.DataTable dt = null; - System.Text.StringBuilder Str = new System.Text.StringBuilder(); - - if (CveEmpresa != -1) - { - string StrSQL = string.Format("CveEmpresa = {0}", CveEmpresa); - System.Data.DataView Dv = new System.Data.DataView((System.Data.DataTable)Application["GlobalDTOIRevision"], StrSQL, "", System.Data.DataViewRowState.CurrentRows); - dt = Dv.ToTable(); - Dv.Dispose(); - } - else { dt = (System.Data.DataTable)Application["GlobalDTOIRevision"]; } - - return dt; - } - + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -80,7 +63,7 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl DdlPara.DataSource = GVUsuarios_TareaNueva.DataSource; DdlPara.DataBind(); - DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataSource = ClsPaginas.get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); DdlTema.DataBind(); DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); GVUsuarios_TareaNueva.DataBind(); @@ -296,7 +279,7 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl private void CargaTemas() { - DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataSource = ClsPaginas.get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); DdlTema.DataBind(); DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 5a0c04c99..d078f30e8 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -296,7 +296,7 @@ Partial Class Ventas_ClientesAbonar RVTxtFechaDocumento.MaximumValue = Now.ToString("dd/MM/yyyy") - If UsuarioActual.CveEmpresa.Contiene(13, 83) Then + If UsuarioActual.CveEmpresa.Contiene(13, 83, 158) Then LnkAccionesModalSeleccionLayout.Visible = True End If @@ -864,15 +864,12 @@ Partial Class Ventas_ClientesAbonar 'inserto los movimientos de la conta para abonar al saldo If CvePrePoliza > 0 Then - Dim PorcentajePago As Decimal = 100 Dim CvePlantillaPoliza As Integer = 11 Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" Dim idCuentaContabilizacion As Long = 1 Dim CveCuentaContabilizacion As Long = 1 Dim dtConceptos As DataTable = Nothing - Dim tipoCambioVenta As Decimal Dim tipoCambioPago As Decimal - Dim tipoCambioVentaValuacion As Decimal = 1 Dim TipoCambioGeneral As Decimal = 1 Dim CveSubProyectoContabilizar As Integer = -1 Dim CveSubProyectoMaximo As Integer = -1 @@ -886,6 +883,7 @@ Partial Class Ventas_ClientesAbonar Dim ImportePrestamo As Decimal = 0 Dim TCPrestamo As Decimal = 0 + If TxtPrestamoImporte.Text.ToDecimal <> 0 Then 'amortización del préstamo ImportePrestamo = TxtPrestamoImporte.Text.ToDecimal Dim tCveProv As Integer = DtPrestamos.FiltroPrimeroValor("CveProveedor", "CveIE=" & DdlPrestamo.SelectedValue) @@ -912,14 +910,14 @@ Partial Class Ventas_ClientesAbonar End If End If - If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then - tipoCambioPago = If(TxtTCDolares.Visible, TxtTCDolares.Text.ToDecimal, TxtTCDolaresDolares.Text.ToDecimal) - Dim ImporteIntereses As Decimal = (TxtPrestamoIntereses.Text.ToDecimal * tipoCambioPago).RoundSQL - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteIntereses, ImporteIntereses, 51, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=11881, TipoCambio:=tipoCambioPago, CveClasificacion:=21927) Then - MsgError = "No se pudo insertar la póliza" - End If - End If + End If + If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then + tipoCambioPago = If(TxtTCDolares.Visible, TxtTCDolares.Text.ToDecimal, TxtTCDolaresDolares.Text.ToDecimal) + Dim ImporteIntereses As Decimal = (TxtPrestamoIntereses.Text.ToDecimal * tipoCambioPago).RoundSQL + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteIntereses, ImporteIntereses, 51, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=11881, TipoCambio:=tipoCambioPago, CveClasificacion:=21927) Then + MsgError = "No se pudo insertar la póliza" + End If End If 'inserto las ventas que voy a pagar @@ -977,26 +975,6 @@ Partial Class Ventas_ClientesAbonar If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal - If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos - tipoCambioPago = 1 - tipoCambioVenta = 1 - PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal - ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos - tipoCambioPago = TxtTC.Text.ToDecimal - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - tipoCambioVentaValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES - tipoCambioPago = If(CveMonedaFiltro = -1, TxtTCDolares.Text.ToDecimal, TxtTCDolaresDolares.Text.ToDecimal) - tipoCambioVenta = gvr.DataKey("TipoCambio").ToDecimal - tipoCambioVentaValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal - ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - tipoCambioPago = TxtTCDolares.Text.ToDecimal - tipoCambioVenta = 1 - PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal - End If - If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then EsAnticipoEspecial = True Pago.AplicaTraslado = False @@ -1109,7 +1087,7 @@ Partial Class Ventas_ClientesAbonar End If 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo FluctuacionAnticipo = ((TCP - tipoCambioPago) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) End If If MsgError = "" AndAlso gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero > 0 Then @@ -1130,12 +1108,13 @@ Partial Class Ventas_ClientesAbonar End If 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo FluctuacionAnticipo += ((TCP - tipoCambioPago) * gvr.FCTextBox("TxtAmort2").Text.ToDecimal).RoundSQL - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) End If If ImportePrestamo <> 0 Then If TCPrestamo > 0 Then FluctuacionAnticipo += ((TCPrestamo - tipoCambioPago) * ImportePrestamo).RoundSQL + ImportePrestamo = 0 End If End If Pago.ImporteFluctuacionAdicional = FluctuacionAnticipo @@ -1216,8 +1195,6 @@ Partial Class Ventas_ClientesAbonar End If - - End If If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then @@ -1386,13 +1363,12 @@ Partial Class Ventas_ClientesAbonar StrMsg.AppendFormat("Nota de crédito generada correctamente.

Folio: {1}
", RespuestaNotaCredito.Respuesta.CveVenta, RespuestaNotaCredito.Respuesta.SerieFolio) End If Next - Alert($"{StrMsg.ToString}

{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx""")) Else If ObjConta IsNot Nothing Then ObjConta.RollBack() ObjIE.RollBack() - ' Alert(MsgError, TipoMensaje.MsgAdvertencia) + Alert(MsgError, TipoMensaje.MsgAdvertencia) End If ObjIE.Dispose() @@ -1409,7 +1385,7 @@ Partial Class Ventas_ClientesAbonar End Sub - Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal, CveVenta As Integer, ReferenciaVenta As String, ReferenciaPago As String) As String + Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, CveVenta As Integer, ReferenciaVenta As String, ReferenciaPago As String) As String Dim MsgError As String = "" If CveMonedaPago = 2 Then @@ -2756,7 +2732,10 @@ Partial Class Ventas_ClientesAbonar End Sub Protected Sub ChkLiquidacion_CheckedChanged(sender As Object, e As EventArgs) + ActivaDesactivaLiquidacion() + End Sub + Private Sub ActivaDesactivaLiquidacion() If ChkLiquidacion.Checked Then TimTiempo.Enabled = True 'para que no me saque @@ -2811,7 +2790,6 @@ Partial Class Ventas_ClientesAbonar End If UPVentas.Update() - End Sub #End Region @@ -2833,31 +2811,36 @@ Partial Class Ventas_ClientesAbonar Dim CountRegistros As Integer = 0 Dim TotalSeleccion As Decimal = 0D - Dim SBNoEncotradosEnLista As New StringBuilder - Dim SBPagoMAyorASaldo As New StringBuilder + Dim SBNoEncontradosEnLista As New StringBuilder + Dim SBPagoMayorASaldo As New StringBuilder If TxtModalLayoutExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtModalLayoutExcel.getfiles().Archivos(0) Dim Directorio As String = Server.MapPath("~") & file.path Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") - Dim DT As New DataTable + Dim DTExcel As New DataTable Dim ErrorArchivo = False Dim ErrorExcel = False - DT = ReadExcelFile(Directorio + file.filename, True) + DTExcel = ReadExcelFile(Directorio + file.filename, True) - If Not DT.Columns(0).ColumnName.ToUpper = "FOLIO" Then + If Not DTExcel.Columns(0).ColumnName.ToUpper = "FOLIO" Then Alert("El nombre de la primera columna debe ser 'Folio'. Favor de corregirlo", TipoMensaje.MsgAdvertencia) Exit Sub End If - If Not DT.Columns(1).ColumnName.ToUpper = "IMPORTE PAGO" Then - Alert("El nombre de la segunda columna debe ser 'Importe Pago'.Favor de corregirlo." & DT.Columns(1).ColumnName, TipoMensaje.MsgAdvertencia) + If Not DTExcel.Columns(1).ColumnName.ToUpper = "IMPORTE PAGO" Then + Alert("El nombre de la segunda columna debe ser 'Importe Pago'.Favor de corregirlo." & DTExcel.Columns(1).ColumnName, TipoMensaje.MsgAdvertencia) Exit Sub End If - For Each Drow As DataRow In DT.Rows + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + ChkLiquidacion.Checked = True + ActivaDesactivaLiquidacion() + End If + + For Each Drow As DataRow In DTExcel.Rows Dim SerieFolioBusqueda As String = Drow("Folio").ToString.Trim.ToUpper Dim ImportePago As Decimal = Drow("Importe Pago").ToString.ToDecimal.RoundSQL(2) @@ -2878,7 +2861,7 @@ Partial Class Ventas_ClientesAbonar If Diferencia < 0 Then If Math.Abs(Diferencia) > 0.01 Then - SBPagoMAyorASaldo.AppendLine($"Factura: {SerieFolioBusqueda} Importe de pago {ImportePago.ToString("###,###,###.00")} es mayor al saldo {SaldoGV.ToString("###,###,###.00")}
") + SBPagoMayorASaldo.AppendLine($"Factura: {SerieFolioBusqueda} Importe de pago {ImportePago.ToString("###,###,###.00")} es mayor al saldo {SaldoGV.ToString("###,###,###.00")}
") ProcesoOK = False Exit For Else @@ -2889,6 +2872,26 @@ Partial Class Ventas_ClientesAbonar GvRow.FCCheckBox("Chk").Checked = True GvRow.FCTextBox("TxtAbonar").Text = ImportePago.ToString("###,###,###.00") + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + + GvRow.FCDropDownList("DdlTG").SelectedTextExist(Drow("Tipo").ToString) + GvRow.FCTextBox("TxtLiqCol1").Text = Drow("Comisión").ToString + GvRow.FCTextBox("TxtLiqCol2").Text = Drow("Gastos").ToString + GvRow.FCTextBox("TxtLiqCol3").Text = Drow("Inspeccion").ToString + GvRow.FCTextBox("TxtLiqCol4").Text = Drow("Seguro").ToString + GvRow.FCTextBox("TxtLiqCol5").Text = Drow("AduanaMex").ToString + GvRow.FCTextBox("TxtLiqCol6").Text = Drow("Diversos").ToString + GvRow.FCTextBox("TxtLiqCol7").Text = Drow("AduanaUSA").ToString + GvRow.FCTextBox("TxtLiqCol8").Text = Drow("MaterialEmpaque").ToString + GvRow.FCTextBox("TxtLiqCol9").Text = Drow("Semilla").ToString + + GvRow.FCDropDownList("DdlAnti").SelectedTextLikeIfExist(Drow("FolioAnticipo1").ToString) + GvRow.FCTextBox("TxtAmort").Text = Drow("ImporteAnticipo1").ToString + GvRow.FCDropDownList("DdlAnti2").SelectedTextLikeIfExist(Drow("FolioAnticipo2").ToString) + GvRow.FCTextBox("TxtAmort2").Text = Drow("ImporteAnticipo2").ToString + + End If + TotalSeleccion = TotalSeleccion + ImportePago CountRegistros = CountRegistros + 1 @@ -2897,7 +2900,7 @@ Partial Class Ventas_ClientesAbonar Next If Not SerieFolioEncontrado Then - SBNoEncotradosEnLista.AppendLine($"{SerieFolioBusqueda}
") + SBNoEncontradosEnLista.AppendLine($"{SerieFolioBusqueda}
") End If End If Next @@ -2908,7 +2911,7 @@ Partial Class Ventas_ClientesAbonar If ProcesoOK Then - Alert($"Facturas seleccionadas: {CountRegistros}
{SBNoEncotradosEnLista.ToString}") + Alert($"Facturas seleccionadas: {CountRegistros}
{SBNoEncontradosEnLista.ToString}") RegistraScript("$('#ModalSeleccionLayout').modal('hide');") TxtImporte.Text = TotalSeleccion.ToString("###,###,###.00") @@ -2925,13 +2928,26 @@ Partial Class Ventas_ClientesAbonar End Sub + Public Sub SelectedTextLikeIfExist(ByRef Rbl As RadioButtonList, Value As String) + Try + For Each item As ListItem In Rbl.Items + If item.Value.Contains(Value) Then + item.Selected = True + End If + Next + Catch ex As Exception + End Try + End Sub Protected Sub LnkDescargaFormato_Click(sender As Object, e As EventArgs) Dim Directorio As String = "" - Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\LayoutSeleccion.xlsx" + Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\LayoutPagoCliente.xlsx" + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\LayoutPagoClienteLiquidacion.xlsx" + End If If Not (Directorio = "") Then diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 95cffc511..41e4fcd44 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -360,12 +360,10 @@ Partial Class ProductosyServicios CargaCombosSeccionAlmacen() - If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then 'emisión 4.0 - DivObjetoImpuesto.Visible = True - DdlObjetoImpuesto.DataSource = GlobalDTSATObjetosImpuestos - DdlObjetoImpuesto.DataBind() - DdlObjetoImpuesto.SelectedValue = "2" 'se sugiere este valor, que sería el más utilizado - End If + DivObjetoImpuesto.Visible = True + DdlObjetoImpuesto.DataSource = GlobalDTSATObjetosImpuestos + DdlObjetoImpuesto.DataBind() + DdlObjetoImpuesto.SelectedValue = "2" 'se sugiere este valor, que sería el más utilizado CreaDtSeccionAlmacen()