c
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@807 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
dfe63e8f2e
commit
51a087ba8f
@ -42,6 +42,7 @@ type
|
||||
function GetAppSplashForm : IAppSplashForm;
|
||||
procedure SetAppSplashForm (AAppSplashForm : IAppSplashForm);
|
||||
|
||||
procedure SeleccionarEmpresa;
|
||||
procedure CambiarEmpresa(const AIDEmpresa : Integer);
|
||||
|
||||
procedure ShowSplashForm;
|
||||
@ -118,6 +119,7 @@ type
|
||||
procedure Run;
|
||||
procedure Terminate;
|
||||
|
||||
procedure SeleccionarEmpresa;
|
||||
procedure CambiarEmpresa(const AIDEmpresa : Integer);
|
||||
|
||||
function GetModule(AModuleName: String): TModuleController;
|
||||
@ -145,7 +147,7 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
Dialogs, uDialogUtils, cxControls, uUsuariosViewRegister,
|
||||
Windows, Dialogs, JSDialog, JSDialogs, uDialogUtils, cxControls, uUsuariosViewRegister,
|
||||
uEmpresasViewRegister, uAppInfoUtils, uDMBase;
|
||||
|
||||
procedure TAppFactuGES.CambiarEmpresa(const AIDEmpresa: Integer);
|
||||
@ -340,6 +342,49 @@ begin
|
||||
FDoMainFormEvent := AMainFormEvent;
|
||||
end;
|
||||
|
||||
procedure TAppFactuGES.SeleccionarEmpresa;
|
||||
var
|
||||
JsDialog: TJSDialog;
|
||||
AEmpresas: IBizEmpresa;
|
||||
AEmpresasController: IEmpresasController;
|
||||
begin
|
||||
JsDialog := TJSDialog.Create(nil);
|
||||
try
|
||||
JsDialog.Content.Add('Selección de empresa');
|
||||
JsDialog.Instruction.Text := 'Elija la empresa con la que desea trabajar.';
|
||||
JsDialog.DialogOptions := [doCommandLinks, doModal];
|
||||
JsDialog.ButtonBar.Buttons := [cbOk];
|
||||
JsDialog.Width := 600;
|
||||
|
||||
|
||||
//Añadimos las diferentes empresas que existan
|
||||
AEmpresasController := TEmpresasController.Create;
|
||||
AEmpresas := AEmpresasController.BuscarTodos;
|
||||
AEmpresas.DataTable.Active := True;
|
||||
|
||||
AEmpresas.Datatable.First;
|
||||
while not AEmpresas.Datatable.eof do
|
||||
begin
|
||||
with JsDialog.CustomButtons.Add do
|
||||
begin
|
||||
Caption := AEmpresas.NIF_CIF + ' - ' + AEmpresas.NOMBRE;
|
||||
Value := AEmpresas.ID;
|
||||
end;
|
||||
AEmpresas.DataTable.Next;
|
||||
end;
|
||||
AEmpresas.DataTable.First;
|
||||
|
||||
if JsDialog.Execute <> IDCANCEL then
|
||||
if JsDialog.CustomButtonResult > 0 then
|
||||
CambiarEmpresa(JsDialog.CustomButtonResult);
|
||||
|
||||
finally
|
||||
FreeAndNIL(JsDialog);
|
||||
AEmpresasController:= NIL;
|
||||
AEmpresas := NIL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAppFactuGES.SetAppSplashForm(AAppSplashForm: IAppSplashForm);
|
||||
begin
|
||||
FAppSplashForm := AAppSplashForm;
|
||||
|
||||
@ -300,7 +300,6 @@ object fPantallaPrincipal: TfPantallaPrincipal
|
||||
object actMenuEmpresa: TAction
|
||||
Category = 'Menus'
|
||||
Caption = 'Empresa'
|
||||
OnUpdate = actMenuComprasUpdate
|
||||
end
|
||||
object actMenuInformes: TAction
|
||||
Category = 'Menus'
|
||||
@ -593,8 +592,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
|
||||
Tag = 1000
|
||||
Caption = 'Empresa'
|
||||
object Listadeempresas1_OLD: TMenuItem
|
||||
Caption = 'Lista de empresas'
|
||||
Visible = False
|
||||
Caption = 'Selecci'#243'n de empresas'
|
||||
OnClick = Listadeempresas1_OLDClick
|
||||
end
|
||||
object N1_OLD: TMenuItem
|
||||
Tag = 100
|
||||
@ -656,7 +655,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
|
||||
end
|
||||
object Informes1: TMenuItem
|
||||
Tag = 6000
|
||||
Caption = 'Informes'
|
||||
Action = actMenuInformes
|
||||
end
|
||||
end
|
||||
object JvXPMenuItemPainter1: TJvXPMenuItemPainter
|
||||
|
||||
@ -116,6 +116,7 @@ type
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure actMenuInformesExecute(Sender: TObject);
|
||||
procedure Listadeempresas1_OLDClick(Sender: TObject);
|
||||
private
|
||||
FContenido : TCustomEditor;
|
||||
procedure ShowEmbedded(AEditor : ICustomEditor);
|
||||
@ -128,7 +129,7 @@ type
|
||||
//procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
|
||||
protected
|
||||
function GetWorkPanel : TWinControl;
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
public
|
||||
function IsShortcut(var Message: TWMKey): Boolean; override;
|
||||
procedure OnWorkPanelChanged(AEditor : ICustomEditor);
|
||||
@ -192,7 +193,10 @@ begin
|
||||
WindowState := wsMaximized;
|
||||
ClientWidth := Screen.Width;
|
||||
ClientHeight := Screen.Height;
|
||||
Refresh;
|
||||
Refresh;
|
||||
|
||||
//Sacamos la lista de empresas para que el usuario elija con la que va a trabajar
|
||||
AppFactuGES.SeleccionarEmpresa;
|
||||
end;
|
||||
|
||||
procedure TfPantallaPrincipal.RefrescarUI;
|
||||
@ -307,7 +311,8 @@ end;
|
||||
|
||||
procedure TfPantallaPrincipal.Informacindeempresa1Click(Sender: TObject);
|
||||
begin
|
||||
AppFactuGES.EmpresasController.Ver(AppFactuGES.EmpresaActiva);
|
||||
if Assigned(AppFactuGES.EmpresaActiva) then
|
||||
AppFactuGES.EmpresasController.Ver(AppFactuGES.EmpresaActiva);
|
||||
end;
|
||||
|
||||
procedure TfPantallaPrincipal.InicializarUI;
|
||||
@ -583,6 +588,11 @@ begin
|
||||
RefrescarUI;
|
||||
end;
|
||||
|
||||
procedure TfPantallaPrincipal.Listadeempresas1_OLDClick(Sender: TObject);
|
||||
begin
|
||||
AppFactuGES.SeleccionarEmpresa;
|
||||
end;
|
||||
|
||||
procedure TfPantallaPrincipal.actConexionExecute(Sender: TObject);
|
||||
begin
|
||||
dmConexion.ConfigurarConexion;
|
||||
|
||||
@ -233,6 +233,7 @@ object PluginContactos: TPluginContactos
|
||||
Caption = 'Empleados'
|
||||
ImageIndex = 2
|
||||
OnExecute = actEmpleadosExecute
|
||||
OnUpdate = actEmpleadosUpdate
|
||||
end
|
||||
object actGruposCliente: TAction
|
||||
Caption = 'Grupos de cliente'
|
||||
|
||||
@ -39,11 +39,12 @@ type
|
||||
procedure actGruposClienteExecute(Sender: TObject);
|
||||
procedure actGruposProveedorExecute(Sender: TObject);
|
||||
procedure actGruposEmpleadoExecute(Sender: TObject);
|
||||
procedure actEmpleadosUpdate(Sender: TObject);
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
@ -53,7 +54,7 @@ uses
|
||||
uClientesController, uProveedoresController, uEmpleadosController,
|
||||
uGruposClienteController, uBizGruposCliente, uGruposProveedorController,
|
||||
uBizGruposProveedor, uGruposEmpleadoController, uBizGruposEmpleado,
|
||||
uContactosViewRegister, uBizContactos;
|
||||
uContactosViewRegister, uBizContactos, uFactuGES_App;
|
||||
|
||||
function GetModule : TModuleController;
|
||||
begin
|
||||
@ -131,6 +132,11 @@ begin
|
||||
AEmpleadosController.VerTodos(AEmpleados);
|
||||
end;
|
||||
|
||||
procedure TPluginContactos.actEmpleadosUpdate(Sender: TObject);
|
||||
begin
|
||||
(Sender as TAction).Enabled := Assigned(AppFactuGES.EmpresaActiva);
|
||||
end;
|
||||
|
||||
constructor TPluginContactos.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
@ -22,7 +22,7 @@ inherited frViewProveedorDatosComerciales: TfrViewProveedorDatosComerciales
|
||||
Height = 39
|
||||
Caption =
|
||||
'Puede indicar el d'#237'a del mes en el cual el proveedor realiza los' +
|
||||
' pagos.'
|
||||
' cobros.'
|
||||
Transparent = True
|
||||
WordWrap = True
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user