AbetoDesign_FactuGES2/Source/Modulos/Recibos de cliente/Plugin/uPluginRecibosCliente.pas

83 lines
2.2 KiB
ObjectPascal
Raw Normal View History

unit uPluginRecibosCliente;
interface
uses
uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList,
ImgList, Controls, PngImageList;
type
IMCRecibosCliente = interface(IInterface)
['{9078C6E6-6733-4CD8-BCBF-DEC48A322CF7}']
end;
TPluginRecibosCliente = class(TModuleController, IMCRecibosCliente)
actRecibosCliente: TAction;
ExtraImages: TPngImageList;
LargeImages: TPngImageList;
MainMenu: TMainMenu;
ModuleActionList: TActionList;
SmallImages: TPngImageList;
Compras1: TMenuItem;
RecibosdeCliente1: TMenuItem;
procedure actRecibosClienteExecute(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{$R *.dfm}
uses
Forms, Dialogs, SysUtils, uFactuGES_App,
uRecibosClienteController, uBizRecibosCliente, uRecibosClienteViewRegister;
function GetModule : TModuleController;
begin
Result := TPluginRecibosCliente.Create(NIL);
end;
exports
GetModule name GET_MODULE_FUNC;
procedure TPluginRecibosCliente.actRecibosClienteExecute(Sender: TObject);
var
ARecibosClienteController : IRecibosClienteController;
ARecibosCliente : IBizRecibosCliente;
begin
ARecibosClienteController := TRecibosClienteController.Create;
ARecibosCliente := (ARecibosClienteController.BuscarTodos as IBizRecibosCliente);
ARecibosClienteController.VerTodos(ARecibosCliente);
end;
constructor TPluginRecibosCliente.Create(AOwner: TComponent);
begin
inherited;
uRecibosClienteViewRegister.RegisterViews;
//Los usuarios SOLO PRESUPUESTOS ver<65>n solo clientes y presupuestos de la empresa asignada o todas
if ((AppFactuGES.UsuarioActivo.ID_PERFIL >= CTE_PERFIL_PRESUPUESTOS_INI)
and (AppFactuGES.UsuarioActivo.ID_PERFIL <= CTE_PERFIL_PRESUPUESTOS_FIN)) then
begin
actRecibosCliente.Enabled := False;
actRecibosCliente.Visible := False;
end;
end;
destructor TPluginRecibosCliente.Destroy;
begin
uRecibosClienteViewRegister.UnregisterViews;
inherited;
end;
initialization
RegisterModuleClass(TPluginRecibosCliente);
finalization
UnRegisterModuleClass(TPluginRecibosCliente);
end.