From 8f1f3f84d4acf655def329036b1b843ddaa84dc3 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 15 Sep 2020 09:55:52 -0700 Subject: [PATCH] -- globaldttipogasto --- App_Code/ClsPaginas.vb | 24 +++- Ashx/SIGWeb.ashx | 2 +- Compras/CatTipoGasto.aspx.cs | 31 +++-- Global.asax | 8 +- Ventas/Clientes.aspx | 235 +++++++++++++++++------------------ Ventas/Clientes.aspx.vb | 23 ++-- 6 files changed, 174 insertions(+), 149 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 35bf0d9b8..0f1360d65 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -192,20 +192,34 @@ Public Class ClsPaginas Application("GlobalDTNomConceptos") = value End Set End Property - Property GlobalDTTiposGastos(CveEmpresa As Integer) As DataTable + Property GlobalDTTiposGastos(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable Get + Dim AppNombre As String = String.Format("GlobalDTTiposGastos-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjCompra As New ClsCompras() + If ObjCompra.GetTipoGasto(-1, -1) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing + ObjCompra.Dispose() + End If + If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTiposGastos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + + Dim StrSQL As New StringBuilder + StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) + If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", Estatus) + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) GlobalDTTiposGastos = Dv.ToTable Dv.Dispose() Else - GlobalDTTiposGastos = DirectCast(Application("GlobalDTTiposGastos"), DataTable) + GlobalDTTiposGastos = DirectCast(Application(AppNombre), DataTable) End If - End Get Set(value As DataTable) - Application("GlobalDTTiposGastos") = value + Dim AppNombre As String = String.Format("GlobalDTTiposGastos-{0}", CveEmpresa) + Application(AppNombre) = value End Set + End Property Property GlobalDTMFActividad(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveActividad As Integer = -1) As DataTable Get diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index e53a90a5f..af213df24 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -620,7 +620,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'verifica existencias - If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152) Then + If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153) Then UsaGlobal = False Dim objInv As New ClsInventarios diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs index 4ffb4c9b7..9f5ac4687 100644 --- a/Compras/CatTipoGasto.aspx.cs +++ b/Compras/CatTipoGasto.aspx.cs @@ -33,7 +33,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas private void CargaDatos() { ClsCompras ObjCompras = new ClsCompras(); - if (ObjCompras.GetTipoGasto(-1,UsuarioActual.CveEmpresa)) + if (ObjCompras.GetTipoGasto(-1, UsuarioActual.CveEmpresa)) { GvDatos.DataSource = ObjCompras.DtResultados; GvDatos.DataBind(); @@ -41,6 +41,17 @@ public partial class Compras_CatTipoGasto : ClsPaginas ObjCompras.Dispose(); } + private void RecargarGlobal() + { + set_GlobalDTTiposGastos(UsuarioActual.CveEmpresa, -1, null); + //ClsCompras ObjCompras = new ClsCompras(); + //if (ObjCompras.GetTipoGasto(-1, -1)) + //{ + // set_GlobalDTTiposGastos(UsuarioActual.CveEmpresa, ObjCompras.DtResultados); + //} + //ObjCompras.Dispose(); + } + protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e) { BtnAgregarTipoGasto.Text = "Agregar"; @@ -74,6 +85,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas Alert("Se eliminó el Tipo de Gasto correctamente"); } ObjCompras.Dispose(); + RecargarGlobal(); } protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e) @@ -81,23 +93,22 @@ public partial class Compras_CatTipoGasto : ClsPaginas ClsCompras ObjCompras = new ClsCompras(); if (BtnAgregarTipoGasto.Text == "Agregar") { - if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa)) + if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text, ChkEstatus.Checked, DateTime.Now.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { - CargaDatos(); - UpDatos.Update(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); Alert("Se agregó el Tipo de Gasto correctamente"); } - }else + } + else { - if (ObjCompras.UpdateTipoGasto(CveTipoGasto,TxtTipoGasto.Text,ChkEstatus.Checked,-1,-1)) + if (ObjCompras.UpdateTipoGasto(CveTipoGasto, TxtTipoGasto.Text, ChkEstatus.Checked, -1, -1)) { - CargaDatos(); - UpDatos.Update(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); Alert("Se actualizó el Tipo de Gasto correctamente"); } } ObjCompras.Dispose(); + CargaDatos(); + RecargarGlobal(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); } } \ No newline at end of file diff --git a/Global.asax b/Global.asax index 86b5d58d8..857349e12 100644 --- a/Global.asax +++ b/Global.asax @@ -138,10 +138,10 @@ GuardaLogAsax(String.Format("Globalasax 7:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C A R G A - T I P O G A S T O S - Using ObjCompra As New ClsCompras() - If ObjCompra.GetTipoGasto(-1, -1) Then Application("GlobalDTTiposGastos") = ObjCompra.DtResultados Else Application("GlobalDTTiposGastos") = Nothing - End Using + ''C A R G A - T I P O G A S T O S + 'Using ObjCompra As New ClsCompras() + ' If ObjCompra.GetTipoGasto(-1, -1) Then Application("GlobalDTTiposGastos") = ObjCompra.DtResultados Else Application("GlobalDTTiposGastos") = Nothing + 'End Using GuardaLogAsax(String.Format("Globalasax 8:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 428706e48..b9895d553 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -1007,129 +1007,10 @@
-
- -
- - - - - -
-
- -
- -
- - - - - -
-
- - -
- -
- - - - - -
-
- - - -
- -
- - - - - -
-
- - -
- -
- - - - - -
-
- - -
- -
- - - - - -
-
- - - - -
- -
- - - - - -
-
-
- -
- - - - - -
-
-
- -
- - - - - -
-
-
-
- -
-
-
- - Cuentas y conceptos -
-
-
-
-
-
-
-
- +
+ - + @@ -1137,9 +1018,119 @@ + +
+
+
+ +
+ + + + + +
+
+ +
+ +
+ + + + + +
+
+ + +
+ +
+ + + + + +
+
+ + + +
+ +
+ + + + + +
+
+ + +
+ +
+ + + + + +
+
+ + +
+ +
+ + + + + +
+
+ + + + +
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+ +
+ + + + + +
+
+
+
+ diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 59800645b..0aecf49c4 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -791,7 +791,7 @@ Partial Class Clientes If Request("ATI") IsNot Nothing AndAlso IsNumeric(Request("ATI")) Then Tab.ActiveTabIndex = Request("ATI").ToEntero End If - CargaCuentasyConceptos() + 'CargaCuentasyConceptos() Else 'Configuración de Modalidad Insert @@ -1079,13 +1079,13 @@ Partial Class Clientes DdlMonedaExtranjeraAnticipos.Attributes.Add("onclick", "CargaCuentas(9);") End Sub - Private Sub CargaCuentasyConceptos() + Private Sub CargaCuentasConceptos() Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentasyConceptos(CveCliente) Then - GvCuentasContable.DataSource = ObjConta.DtResultados + If ObjConta.GetCuentasConceptos(6, UsuarioActual.CveEmpresa, CveCliente:=CveCliente) Then + GvCta.DataSource = ObjConta.DtResultados End If ObjConta.Dispose() - GvCuentasContable.DataBind() + GvCta.DataBind() UpCuentaConceptos.Update() End Sub Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click @@ -1681,8 +1681,17 @@ Partial Class Clientes End If CargaEventoBitacora() - - 'Ocultamos la mayoria de informacion si es no-frecuente + If UsuarioActual.Empresa.Funcionalidad(300) = "1" Then + CargaCuentasConceptos() + divCuentas.Visible = True + divCuentasContp.Visible = False + Else + divCuentas.Visible = False + divCuentasContp.Visible = True + End If + + + 'Ocultamos la mayoria de informacion si es no-frecuente If ObjClientes.TipoCliente = 2 Then TabFiscalContable.Visible = False TabCxC.Visible = False