unit uPluginControllerRecepciones;

interface

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

type
  IMCRecepciones = interface(IInterface)
  ['{3BA48DD2-A9D3-4168-9507-84065E8F839B}']
  end;

  TModuleRecepciones = class(TModuleController, IMCRecepciones)
    menu: TMenuItem;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    actRecepcion: TAction;
    Controldeventasenproceso1: TMenuItem;
    actRecepcionAlbaranes: TAction;
    Controldealbaranes1: TMenuItem;
    procedure actRecepcionExecute(Sender: TObject);
    procedure actRecepcionAlbaranesExecute(Sender: TObject);
  public
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, uGUIBase, SysUtils, uDataModuleRecepciones,
  uEditorListaRecepciones, uEditorListaRecepcionesAlbaran;

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

exports
  GetModule name GET_MODULE_FUNC;

{
******************************* TModuleContactos *******************************
}

procedure TModuleRecepciones.actRecepcionExecute(Sender: TObject);
var
  aControl: IBizRecepciones;
  aObj: IEditorListaRecepciones;
begin
  aControl := dmRecepciones.GetItems(tirPendiente);
  aObj := TfEditorListaRecepciones.Create(Application);
  try
    with aObj do
    begin
      Items := aControl;
      ShowEmbedded;
    end;
  finally
    aControl := NIL;
    aObj := NIL;
  end;
end;

procedure TModuleRecepciones.actRecepcionAlbaranesExecute(Sender: TObject);
var
  aControl: IBizRecepcionesAlbaran;
  aObj: IEditorListaRecepcionesAlbaran;
begin
  aControl := dmRecepciones.GetItemsAlbaran(tiraPendiente);
  aObj := TfEditorListaRecepcionesAlbaran.Create(Application);
  try
    with aObj do
    begin
      Items := aControl;
      ShowEmbedded;
    end;
  finally
    aControl := NIL;
    aObj := NIL;
  end;
end;

initialization
  RegisterModuleClass(TModuleRecepciones);

finalization
  UnRegisterModuleClass(TModuleRecepciones);

end.
