From 9ba0a9bbf4fb24deb985801c6fda039ee4c60aa8 Mon Sep 17 00:00:00 2001 From: roberto Date: Thu, 17 Dec 2009 15:19:47 +0000 Subject: [PATCH] Se cambia para que multiempresa sea una variable de compilacion git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@493 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/ApplicationBase/uFactuGES_App.pas | 5 +++++ Source/Cliente/uNavPaneController.pas | 16 ++++++++++++---- Source/Cliente/uPantallaPrincipal.pas | 8 ++++++++ Source/FactuGES.inc | 1 + 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Source/ApplicationBase/uFactuGES_App.pas b/Source/ApplicationBase/uFactuGES_App.pas index 34ab67ba..2a155d3c 100644 --- a/Source/ApplicationBase/uFactuGES_App.pas +++ b/Source/ApplicationBase/uFactuGES_App.pas @@ -188,6 +188,7 @@ var AppFactuGES : IAppFactuGES; implementation +{$INCLUDE ..\FactuGES.inc} uses Windows, Dialogs, JSDialog, JSDialogs, uDialogUtils, cxControls, uUsuariosViewRegister, uDMBase, @@ -520,9 +521,13 @@ begin end; AEmpresas.DataTable.First; + {$IFDEF MULTIEMPRESA} if JsDialog.Execute <> IDCANCEL then if JsDialog.CustomButtonResult > 0 then CambiarEmpresa(JsDialog.CustomButtonResult); + {$ELSE} + CambiarEmpresa(AEmpresas.ID); + {$ENDIF} finally FreeAndNIL(JsDialog); diff --git a/Source/Cliente/uNavPaneController.pas b/Source/Cliente/uNavPaneController.pas index 8ca080b7..0db4937d 100644 --- a/Source/Cliente/uNavPaneController.pas +++ b/Source/Cliente/uNavPaneController.pas @@ -42,6 +42,7 @@ var NavPaneController : TNavPaneController; implementation +{$INCLUDE ..\FactuGES.inc} uses Dialogs, uModuleController, uAcercaDe, uNavPaneUtils, @@ -112,6 +113,7 @@ var begin AListaSecciones := TStringList.Create; AListaSecciones.Duplicates := dupIgnore; + AEmpresasCount := 0; try // Guardar la lista de secciones (Ventas, Compras, etc...) @@ -128,10 +130,14 @@ begin AEmpresas := AppFactuGES.EmpresasController.BuscarTodos; try AEmpresas.DataTable.Active := True; + + {$IFDEF MULTIEMPRESA} while not AEmpresas.DataTable.EOF do begin - ASeccionPadre := NIL; - AIndex := -1; + {$ENDIF} + +// ASeccionPadre := NIL; +// AIndex := -1; // Buscar la página si existe AIndex := EncontrarPagina(FNavigationPane, AEmpresas.NOMBRE); @@ -166,15 +172,17 @@ begin ASeccion.Height := ASeccion.Height + ADivisor.Height; end; + {$IFDEF MULTIEMPRESA} AEmpresas.DataTable.Next; end; + {$ENDIF} + AEmpresas.DataTable.Active := False; finally AEmpresas := NIL; end; finally - AListaSecciones.Free; - AListaSecciones := NIL; + FreeAndNIL(AListaSecciones); end; end; diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas index e89cd3cc..dad84375 100644 --- a/Source/Cliente/uPantallaPrincipal.pas +++ b/Source/Cliente/uPantallaPrincipal.pas @@ -150,6 +150,7 @@ var fPantallaPrincipal: TfPantallaPrincipal; implementation +{$INCLUDE ..\FactuGES.inc} uses uSplash, uAcercaDe, UxTheme, Themes, uMenuUtils, uBizEmpresas, @@ -501,6 +502,13 @@ end; constructor TfPantallaPrincipal.Create(AOwner: TComponent); begin inherited; + + {$IFDEF MULTIEMPRESA} + // + {$ELSE} + Listadeempresas1_OLD.Destroy; + {$ENDIF} + FContenido := NIL; with AppFactuGES.ModuleManager do diff --git a/Source/FactuGES.inc b/Source/FactuGES.inc index 6b29364c..72603a0d 100644 --- a/Source/FactuGES.inc +++ b/Source/FactuGES.inc @@ -1,3 +1,4 @@ +{$DEFINE MULTIEMPRESA} {DEFINE ALMACEN} {DEFINE PEDIDOSPROVEEDOR} {$DEFINE CONTABILIDAD} \ No newline at end of file