git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES2/trunk@6 40301925-124e-1c4e-b97d-170ad7a8785b
95 lines
2.0 KiB
ObjectPascal
95 lines
2.0 KiB
ObjectPascal
unit uBizAsientos;
|
|
|
|
interface
|
|
|
|
uses
|
|
uDAInterfaces, uDADataTable, schContabilidadClient_Intf, uBizApuntes;
|
|
|
|
const
|
|
BIZ_CLIENT_Asiento = 'Client.Asiento';
|
|
|
|
type
|
|
IBizAsiento = interface(IAsientos)
|
|
['{F79E3238-1E0D-4FB6-9AF7-E5703619B067}']
|
|
|
|
function GetApuntes: IBizApunte;
|
|
procedure SetApuntes(Value: IBizApunte);
|
|
property Apuntes: IBizApunte read GetApuntes write SetApuntes;
|
|
|
|
function EsNuevo : Boolean;
|
|
end;
|
|
|
|
TBizAsiento = class(TAsientosDataTableRules, IBizAsiento)
|
|
protected
|
|
FApuntes : IBizApunte;
|
|
FApuntesLink : TDADataSource;
|
|
function GetApuntes: IBizApunte;
|
|
procedure SetApuntes(Value: IBizApunte);
|
|
procedure OnNewRecord(Sender: TDADataTable); override;
|
|
|
|
public
|
|
property Apuntes: IBizApunte read GetApuntes write SetApuntes;
|
|
procedure IniciarValoresAsientoNueva;
|
|
function EsNuevo : Boolean;
|
|
|
|
constructor Create(aDataTable: TDADataTable); override;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{ TBizAsiento }
|
|
|
|
uses
|
|
SysUtils, uDataTableUtils, uFactuGES_App;
|
|
|
|
constructor TBizAsiento.Create(aDataTable: TDADataTable);
|
|
begin
|
|
inherited;
|
|
FApuntes := Nil;
|
|
FApuntesLink := TDADataSource.Create(NIL);
|
|
FApuntesLink.DataTable := aDataTable;
|
|
end;
|
|
|
|
destructor TBizAsiento.Destroy;
|
|
begin
|
|
FApuntes := NIL;
|
|
FApuntesLink.Free;
|
|
inherited;
|
|
end;
|
|
|
|
function TBizAsiento.EsNuevo: Boolean;
|
|
begin
|
|
Result := (ID < 0);
|
|
end;
|
|
|
|
function TBizAsiento.GetApuntes: IBizApunte;
|
|
begin
|
|
Result := FApuntes;
|
|
end;
|
|
|
|
procedure TBizAsiento.IniciarValoresAsientoNueva;
|
|
begin
|
|
FECHA_ASIENTO := Date;
|
|
end;
|
|
|
|
procedure TBizAsiento.OnNewRecord(Sender: TDADataTable);
|
|
begin
|
|
inherited;
|
|
IniciarValoresAsientoNueva;
|
|
end;
|
|
|
|
procedure TBizAsiento.SetApuntes(Value: IBizApunte);
|
|
begin
|
|
FApuntes := Value;
|
|
EnlazarMaestroDetalle(FApuntesLink, FApuntes);
|
|
end;
|
|
|
|
initialization
|
|
RegisterDataTableRules(BIZ_CLIENT_Asiento, TBizAsiento);
|
|
|
|
finalization
|
|
|
|
end.
|
|
|