unit uPluginAlbaranesProveedor;

interface

uses
  uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList,
  ImgList, Controls, PngImageList;

type
  IMCAlbaranesProveedor = interface(IInterface)
  ['{69EA97C0-7AEE-4D5A-80C8-402DDB3CE59E}']
  end;

  TPluginAlbaranesProveedor = class(TModuleController, IMCAlbaranesProveedor)
    actAlbaranesProveedor: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Compras1: TMenuItem;
    AlbaranesdeProveedor1: TMenuItem;
    actDevolucionesProveedor: TAction;
    rdenesdedevolucin1: TMenuItem;
    procedure actAlbaranesProveedorExecute(Sender: TObject);
    procedure actDevolucionesProveedorExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uAlbaranesProveedorController, uBizAlbaranesProveedor, uAlbaranesProveedorViewRegister;

function GetModule : TModuleController;
begin
  Result := TPluginAlbaranesProveedor.Create(NIL);
end;

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginAlbaranesProveedor.actAlbaranesProveedorExecute(Sender: TObject);
var
  AAlbaranesProveedorController : IAlbaranesProveedorController;
  AAlbaranesProveedor : IBizAlbaranProveedor;

begin
  AAlbaranesProveedorController := TAlbaranesProveedorController.Create;
  AAlbaranesProveedor := (AAlbaranesProveedorController.BuscarAlbaranesNormales as IBizAlbaranProveedor);
  AAlbaranesProveedorController.VerTodosAlbaranes(AAlbaranesProveedor);
end;

procedure TPluginAlbaranesProveedor.actDevolucionesProveedorExecute(Sender: TObject);
var
  AAlbaranesProveedorController : IAlbaranesProveedorController;
  AAlbaranesProveedor : IBizAlbaranProveedor;

begin
  AAlbaranesProveedorController := TAlbaranesProveedorController.Create;
  AAlbaranesProveedor := (AAlbaranesProveedorController.BuscarAlbaranesDevolucion as IBizAlbaranProveedor);
  AAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbaranesProveedor);
end;

constructor TPluginAlbaranesProveedor.Create(AOwner: TComponent);
begin
  inherited;
  uAlbaranesProveedorViewRegister.RegisterViews;
end;

destructor TPluginAlbaranesProveedor.Destroy;
begin
  uAlbaranesProveedorViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginAlbaranesProveedor);

finalization
  UnRegisterModuleClass(TPluginAlbaranesProveedor);

end.
