unit uDialogOpcionesImpresionFacturasCliente;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uDialogBase, ActnList, StdCtrls, ExtCtrls, cxRadioGroup;

type
  TfDialogOpcionesImpresionFacturasCliente = class(TfDialogBase)
    cbOriginal: TCheckBox;
    cbCopia: TCheckBox;
    cbContabilidad: TCheckBox;
    procedure actAceptarExecute(Sender: TObject);
    procedure actCancelarExecute(Sender: TObject);
    procedure actAceptarUpdate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  function ElegirOpcionesImpresionFacturaCliente(var AOriginal, ACopia, AContabilidad : Integer): Boolean;

implementation

{$R *.dfm}

function ElegirOpcionesImpresionFacturaCliente(var AOriginal, ACopia, AContabilidad : Integer): Boolean;
var
  AEditor : TfDialogOpcionesImpresionFacturasCliente;
begin
  AEditor := TfDialogOpcionesImpresionFacturasCliente.Create(NIL);
  try
    Result := (AEditor.ShowModal = mrOk);
    if Result then
    begin
      if True then
      begin
        if AEditor.cbOriginal.Checked then
           AOriginal := 1;

        if AEditor.cbCopia.Checked then
           ACopia := 1;

        if AEditor.cbContabilidad.Checked then
           AContabilidad := 1;
      end;
    end;
  finally
    AEditor.Release;
  end;
end;

procedure TfDialogOpcionesImpresionFacturasCliente.actAceptarExecute(Sender: TObject);
begin
  inherited;
  ModalResult := mrOk
end;

procedure TfDialogOpcionesImpresionFacturasCliente.actAceptarUpdate(
  Sender: TObject);
begin
  inherited;
  (Sender as TAction).Enabled := cbOriginal.Checked or cbCopia.Checked or cbContabilidad.Checked;
end;

procedure TfDialogOpcionesImpresionFacturasCliente.actCancelarExecute(Sender: TObject);
begin
  inherited;
  ModalResult := mrCancel;
end;

end.
