2007-11-28 17:40:31 +00:00
|
|
|
|
unit uEditorFechaPago;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
2007-12-26 19:59:52 +00:00
|
|
|
|
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago,
|
|
|
|
|
|
cxCheckBox, uSubCuentasController, Buttons, cxDBEdit;
|
2007-11-28 17:40:31 +00:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago)
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
eFechaPago: TcxDateEdit;
|
|
|
|
|
|
bAceptar: TButton;
|
|
|
|
|
|
bCancelar: TButton;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
Panel1: TPanel;
|
2007-12-26 19:59:52 +00:00
|
|
|
|
eContabilizar: TcxCheckBox;
|
|
|
|
|
|
eRefSubCuenta: TcxTextEdit;
|
|
|
|
|
|
eSubCuenta: TcxTextEdit;
|
|
|
|
|
|
BitBtn3: TBitBtn;
|
|
|
|
|
|
eIDSubcuenta: TcxTextEdit;
|
2007-11-28 17:40:31 +00:00
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
2007-12-26 19:59:52 +00:00
|
|
|
|
procedure eContabilizarPropertiesChange(Sender: TObject);
|
|
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
procedure BitBtn3Click(Sender: TObject);
|
|
|
|
|
|
procedure eIDSubcuentaPropertiesChange(Sender: TObject);
|
|
|
|
|
|
procedure bAceptarClick(Sender: TObject);
|
2007-11-28 17:40:31 +00:00
|
|
|
|
private
|
2007-12-26 19:59:52 +00:00
|
|
|
|
FController : ISubcuentasController;
|
|
|
|
|
|
FIdSubCuenta : Integer;
|
|
|
|
|
|
FIgnorarContabilidad : Integer;
|
2007-11-28 17:40:31 +00:00
|
|
|
|
FFechaPago : TDateTime;
|
|
|
|
|
|
function GetFechaPago: TDateTime;
|
|
|
|
|
|
procedure SetFechaPago(const Value: TDateTime);
|
2007-12-26 19:59:52 +00:00
|
|
|
|
function GetIgnorarContabilidad: Integer;
|
|
|
|
|
|
procedure SetIgnorarContabilidad(const Value: Integer);
|
|
|
|
|
|
function GetIdSubCuenta: Integer;
|
|
|
|
|
|
procedure SetIdSubCuenta(const Value: Integer);
|
|
|
|
|
|
|
2007-11-28 17:40:31 +00:00
|
|
|
|
public
|
|
|
|
|
|
property FechaPago: TDateTime Read GetFechaPago write SetFechaPago;
|
2007-12-26 19:59:52 +00:00
|
|
|
|
property IgnorarContabilidad: Integer Read GetIgnorarContabilidad write SetIgnorarContabilidad;
|
|
|
|
|
|
property IdSubCuenta: Integer Read GetIdSubCuenta write SetIdSubCuenta;
|
|
|
|
|
|
constructor Create(AOwner: TComponent); override;
|
2007-11-28 17:40:31 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
fEditorFechaPago: TfEditorFechaPago;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
2007-12-26 19:59:52 +00:00
|
|
|
|
uses uBizSubCuentas;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorFechaPago.bAceptarClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if (not eContabilizar.Checked)
|
|
|
|
|
|
and (eIdSubcuenta.Text = '') then
|
|
|
|
|
|
raise Exception.Create ('Es necesario que elija la SubCuenta donde se realizar<61> el pago');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorFechaPago.BitBtn3Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
ASubCuenta: IBizSubcuenta;
|
|
|
|
|
|
begin
|
|
|
|
|
|
ASubCuenta := FController.ElegirSubCuenta(FController.BuscarTodos,'sssss', False);
|
|
|
|
|
|
eIDSubcuenta.Text := IntToStr(ASubcuenta.ID);
|
|
|
|
|
|
eRefSubCuenta.Text := ASubcuenta.REF_SUBCUENTA;
|
|
|
|
|
|
eSubCuenta.Text := ASubcuenta.DESCRIPCION;
|
|
|
|
|
|
ASubCuenta := Nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
constructor TfEditorFechaPago.Create(AOwner: TComponent);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
FController := TSubcuentasController.Create;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorFechaPago.eContabilizarPropertiesChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FIgnorarContabilidad := eContabilizar.EditValue;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-11-28 17:40:31 +00:00
|
|
|
|
procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FechaPago := eFechaPago.Date;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-12-26 19:59:52 +00:00
|
|
|
|
procedure TfEditorFechaPago.eIDSubcuentaPropertiesChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not VarIsNull(eIDSubCuenta.EditValue) then
|
|
|
|
|
|
FIDSubCuenta := eIDSubCuenta.EditValue;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2008-01-03 18:55:33 +00:00
|
|
|
|
procedure TfEditorFechaPago.FormClose(Sender: TObject; var Action: TCloseAction);
|
2007-12-26 19:59:52 +00:00
|
|
|
|
begin
|
|
|
|
|
|
FController := Nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-11-28 17:40:31 +00:00
|
|
|
|
procedure TfEditorFechaPago.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
2007-12-26 19:59:52 +00:00
|
|
|
|
if (length(eFechaPago.Text) = 0) then
|
|
|
|
|
|
eFechaPago.Date := Date;
|
|
|
|
|
|
// FController.
|
2007-11-28 17:40:31 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorFechaPago.GetFechaPago: TDateTime;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := FFechaPago;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-12-26 19:59:52 +00:00
|
|
|
|
function TfEditorFechaPago.GetIdSubCuenta: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := eIDSubCuenta.EditValue; //FIdSubCuenta;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorFechaPago.GetIgnorarContabilidad: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := FIgnorarContabilidad;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2007-11-28 17:40:31 +00:00
|
|
|
|
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FFechaPago := Value;
|
2007-12-26 19:59:52 +00:00
|
|
|
|
eFechaPago.EditValue := FFechaPago;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorFechaPago.SetIdSubCuenta(const Value: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FIdSubCuenta := Value;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorFechaPago.SetIgnorarContabilidad(const Value: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FIgnorarContabilidad := Value;
|
|
|
|
|
|
eContabilizar.EditValue := FIgnorarContabilidad;
|
2007-11-28 17:40:31 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|