Tarea #293 Tarea #366 git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@988 0c75b7a4-871f-7646-8a2f-f78d34cc349f
93 lines
2.3 KiB
ObjectPascal
93 lines
2.3 KiB
ObjectPascal
unit uEditorVariarPrecios;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
|
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorVariarPrecios,
|
|
cxGraphics, DB, uDAInterfaces, uDADataTable, cxDBEdit, uEmpresasController,
|
|
cxSpinEdit, cxRadioGroup, ActnList;
|
|
|
|
type
|
|
TfEditorVariarPrecios = class(TfEditorBasico, IEditorVariarPrecios)
|
|
Label1: TLabel;
|
|
bAceptar: TButton;
|
|
bCancelar: TButton;
|
|
Panel1: TPanel;
|
|
sDescuento: TcxSpinEdit;
|
|
Label3: TLabel;
|
|
rdDescuento: TcxRadioButton;
|
|
rdAumento: TcxRadioButton;
|
|
sAumento: TcxSpinEdit;
|
|
Label2: TLabel;
|
|
ActionListContenido: TActionList;
|
|
actDescuento: TAction;
|
|
actAumento: TAction;
|
|
procedure actDescuentoExecute(Sender: TObject);
|
|
procedure actAumentoExecute(Sender: TObject);
|
|
|
|
private
|
|
FPorcentaje: Variant;
|
|
function GetPorcentaje: Variant;
|
|
procedure SetPorcentaje(const Value: Variant);
|
|
function GetTipoOperacion: Integer;
|
|
|
|
public
|
|
property TipoOperacion: Integer Read GetTipoOperacion;
|
|
property Porcentaje: Variant Read GetPorcentaje write SetPorcentaje;
|
|
end;
|
|
|
|
implementation
|
|
{$R *.dfm}
|
|
|
|
uses uFactuGES_App;
|
|
|
|
procedure TfEditorVariarPrecios.actAumentoExecute(Sender: TObject);
|
|
begin
|
|
if rdAumento.Checked then
|
|
begin
|
|
sDescuento.Clear;
|
|
sDescuento.Enabled := False;
|
|
sAumento.Enabled := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfEditorVariarPrecios.actDescuentoExecute(Sender: TObject);
|
|
begin
|
|
if rdDescuento.Checked then
|
|
begin
|
|
sAumento.Clear;
|
|
sAumento.Enabled := False;
|
|
sDescuento.Enabled := True;
|
|
end;
|
|
end;
|
|
|
|
function TfEditorVariarPrecios.GetPorcentaje: Variant;
|
|
begin
|
|
if rdDescuento.Checked then
|
|
Result := sDescuento.EditValue
|
|
else
|
|
Result := sAumento.EditValue
|
|
end;
|
|
|
|
function TfEditorVariarPrecios.GetTipoOperacion: Integer;
|
|
begin
|
|
if rdDescuento.Checked then
|
|
Result := -1
|
|
else if rdAumento.Checked then
|
|
Result := 1
|
|
else
|
|
Result := 0;
|
|
end;
|
|
|
|
procedure TfEditorVariarPrecios.SetPorcentaje(const Value: Variant);
|
|
begin
|
|
if rdDescuento.Checked then
|
|
sDescuento.EditValue := Value
|
|
else
|
|
sAumento.EditValue := Value;
|
|
end;
|
|
|
|
end.
|