git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@70 93f398dd-4eb6-7a46-baf6-13f46f578da2
107 lines
2.8 KiB
ObjectPascal
107 lines
2.8 KiB
ObjectPascal
unit uBizRemesasCliente;
|
|
|
|
interface
|
|
|
|
uses
|
|
uDAInterfaces, uDADataTable, schRemesasClienteClient_Intf, uDBSelectionListUtils,
|
|
uBizRecibosCliente;
|
|
|
|
const
|
|
BIZ_CLIENT_REMESACLIENTE = 'Client.RemesaCliente';
|
|
CTE_TIPO_REMESA = 'REMESA';
|
|
CTE_TIPO_TALON = 'TALON';
|
|
CTE_TIPO_EFECTIVO = 'EFECTIVO';
|
|
CTE_TIPO_TRANSFERENCIA = 'TRANSFERENCIA';
|
|
|
|
type
|
|
IBizRemesaCliente = interface(IRemesasCliente)
|
|
['{62E5474B-627F-41B8-A5FD-5E553DFF3C50}']
|
|
function GetRecibos: IBizRecibosCliente;
|
|
procedure SetRecibos(const Value: IBizRecibosCliente);
|
|
property Recibos: IBizRecibosCliente read GetRecibos write SetRecibos;
|
|
function EsNuevo : Boolean;
|
|
end;
|
|
|
|
TBizRemesaCliente = class(TRemesasClienteDataTableRules, IBizRemesaCliente, ISeleccionable)
|
|
protected
|
|
FRecibos: IBizRecibosCliente;
|
|
FSeleccionableInterface : ISeleccionable;
|
|
|
|
function GetRecibos: IBizRecibosCliente;
|
|
procedure SetRecibos(const Value: IBizRecibosCliente);
|
|
procedure OnNewRecord(Sender: TDADataTable); override;
|
|
public
|
|
property SeleccionableInterface : ISeleccionable read FSeleccionableInterface
|
|
write FSeleccionableInterface implements ISeleccionable;
|
|
property Recibos: IBizRecibosCliente read GetRecibos write SetRecibos;
|
|
|
|
procedure IniciarValoresRemesaClienteNuevo; virtual;
|
|
function EsNuevo : Boolean;
|
|
constructor Create(aDataTable: TDADataTable); override;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
uDataTableUtils, uDataModuleUsuarios, SysUtils, uROClasses, Classes,
|
|
uFactuGES_App, dialogs;
|
|
|
|
{ TBizRemesaCliente }
|
|
|
|
constructor TBizRemesaCliente.Create(aDataTable: TDADataTable);
|
|
begin
|
|
inherited;
|
|
FRecibos := Nil;
|
|
FSeleccionableInterface := TSeleccionable.Create(aDataTable);
|
|
end;
|
|
|
|
destructor TBizRemesaCliente.Destroy;
|
|
begin
|
|
FRecibos := Nil;
|
|
FSeleccionableInterface := NIL;
|
|
inherited;
|
|
end;
|
|
|
|
function TBizRemesaCliente.EsNuevo: Boolean;
|
|
begin
|
|
Result := (ID < 0);
|
|
end;
|
|
|
|
function TBizRemesaCliente.GetRecibos: IBizRecibosCliente;
|
|
begin
|
|
Result := FRecibos;
|
|
end;
|
|
|
|
procedure TBizRemesaCliente.IniciarValoresRemesaClienteNuevo;
|
|
begin
|
|
ID_EMPRESA := AppFactuGES.EmpresaActiva.ID;
|
|
FECHA_REMESA := Date;
|
|
USUARIO := AppFactuGES.UsuarioActivo.UserName;
|
|
TIPO := CTE_TIPO_REMESA;
|
|
end;
|
|
|
|
procedure TBizRemesaCliente.OnNewRecord(Sender: TDADataTable);
|
|
begin
|
|
inherited;
|
|
IniciarValoresRemesaClienteNuevo;
|
|
end;
|
|
|
|
procedure TBizRemesaCliente.SetRecibos(const Value: IBizRecibosCliente);
|
|
begin
|
|
FRecibos := Value;
|
|
if Assigned(FRecibos) then
|
|
begin
|
|
if not FRecibos.DataTable.Active then
|
|
FRecibos.DataTable.Active := True;
|
|
end;
|
|
end;
|
|
|
|
initialization
|
|
RegisterDataTableRules(BIZ_CLIENT_RemesaCliente, TBizRemesaCliente);
|
|
|
|
finalization
|
|
|
|
end.
|
|
|