FactuGES2/Source/Modulos/Contabilidad/Views/uViewCajasBancos.pas
roberto d6e8d1a440 Generacion automatica de subcuenta para el pago de recibos y remesas de cliente, falta repaso de facturas de cliente.
Tambien se ha incluido la directiva de compilacion para el modulo de contabilidad

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@164 f4e31baf-9722-1c47-927c-6f952f962d4b
2008-02-29 18:10:08 +00:00

121 lines
3.1 KiB
ObjectPascal

unit uViewCajasBancos;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewBase, ExtCtrls, StdCtrls, DB, uDADataTable, cxGraphics,
dxLayoutControl, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit,
cxControls, cxCheckBox;
type
IViewCajasBancos = interface(IViewBase)
['{5266EE90-D715-462A-9720-FF0D4078A496}']
end;
TfrViewCajasBancos = class(TfrViewBase, IViewCajasBancos)
cbCajasBancos: TcxComboBox;
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
dxLayoutControl1Item1: TdxLayoutItem;
dxLayoutControl1Item2: TdxLayoutItem;
eContabilizar: TcxCheckBox;
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure cbCajaBancoPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
procedure eContabilizarPropertiesEditValueChanged(Sender: TObject);
private
FIdSubCuenta : Integer;
FListaCajasBancos : TStringList;
function getIDCajaBanco: Integer;
public
property IdSubCuenta: Integer read getIDCajaBanco;
procedure ElegirCajaBanco(const AIdSubCuenta : Integer);
end;
implementation
{$R *.dfm}
{$INCLUDE ..\..\..\FactuGES.inc}
uses
uFactuGES_App, uSubCuentasController;
procedure TfrViewCajasBancos.cbCajaBancoPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
begin
inherited;
FIdSubCuenta := StrToInt(FListaCajasBancos.Values[DisplayValue]);
end;
procedure TfrViewCajasBancos.CustomViewCreate(Sender: TObject);
var
i : integer;
begin
inherited;
with TSubCuentasController.create do
begin
FListaCajasBancos := DarListaCajasBancos;
with cbCajasBancos.Properties.Items do
begin
BeginUpdate;
try
Clear;
for i := 0 to FListaCajasBancos.Count - 1 do
Add(FListaCajasBancos.Names[i]);
finally
EndUpdate;
end;
end;
Free;
end;
{$IFDEF CONTABILIDAD}
eContabilizar.Checked := false;
{$ELSE}
eContabilizar.Checked := true;
{$ENDIF}
end;
procedure TfrViewCajasBancos.CustomViewDestroy(Sender: TObject);
begin
inherited;
FreeAndNIL(FListaCajasBancos);
end;
procedure TfrViewCajasBancos.eContabilizarPropertiesEditValueChanged(Sender: TObject);
begin
inherited;
if not eContabilizar.Checked then
begin
cbCajasBancos.ItemIndex := 0;
cbCajasBancos.Enabled := True;
end
else
begin
cbCajasBancos.ItemIndex := -1;
cbCajasBancos.Enabled := False;
end;
end;
procedure TfrViewCajasBancos.ElegirCajaBanco(const AIdSubCuenta: Integer);
var
i : integer;
begin
for i := 0 to FListaCajasBancos.Count-1 do
begin
if FListaCajasBancos.ValueFromIndex[i] = IntToStr(AIdSubCuenta) then
begin
cbCajasBancos.Text := FListaCajasBancos.Names[i];
Break;
end;
end;
end;
function TfrViewCajasBancos.getIDCajaBanco: Integer;
begin
Result := FIdSubCuenta;
end;
end.