- Usar el nuevo servicio de gestión de referencias en los módulos de la aplicación
- En la BD, añadir clave primario ID y generador para la table REFERENCIAS git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@69 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
08891f5662
commit
9a8b866380
2623
Build/Build.fbp5
2623
Build/Build.fbp5
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -9,21 +9,13 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferencia = '{A693E269-BAF7-46A1-84E5-DBC746856BE3}';
|
RID_AlbaranesCliente = '{075163FA-70D9-40DC-999D-5CAB8882B53C}';
|
||||||
RID_AlbaranesCliente = '{1D19F302-9D09-4E86-9602-98B88C9FF5E7}';
|
RID_AlbaranesCliente_Detalles = '{40889198-AE9A-45C6-A6DE-31DE39AF5323}';
|
||||||
RID_AlbaranesCliente_Detalles = '{DFBF54C4-E8F9-47BA-9920-89709FB21148}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_DarReferencia = 'DarReferencia';
|
|
||||||
nme_AlbaranesCliente = 'AlbaranesCliente';
|
nme_AlbaranesCliente = 'AlbaranesCliente';
|
||||||
nme_AlbaranesCliente_Detalles = 'AlbaranesCliente_Detalles';
|
nme_AlbaranesCliente_Detalles = 'AlbaranesCliente_Detalles';
|
||||||
|
|
||||||
{ DarReferencia fields }
|
|
||||||
fld_DarReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ DarReferencia field indexes }
|
|
||||||
idx_DarReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ AlbaranesCliente fields }
|
{ AlbaranesCliente fields }
|
||||||
fld_AlbaranesClienteID = 'ID';
|
fld_AlbaranesClienteID = 'ID';
|
||||||
fld_AlbaranesClienteID_EMPRESA = 'ID_EMPRESA';
|
fld_AlbaranesClienteID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -139,44 +131,9 @@ const
|
|||||||
idx_AlbaranesCliente_DetallesREFERENCIA_PROVEEDOR = 13;
|
idx_AlbaranesCliente_DetallesREFERENCIA_PROVEEDOR = 13;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferencia }
|
|
||||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{15B4231D-DD94-42A2-9AC2-4C32AFB4B267}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
TDarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IDarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IAlbaranesCliente }
|
{ IAlbaranesCliente }
|
||||||
IAlbaranesCliente = interface(IDAStronglyTypedDataTable)
|
IAlbaranesCliente = interface(IDAStronglyTypedDataTable)
|
||||||
['{26F46D95-DBBE-40FD-BB99-EEC4B6EE75CD}']
|
['{9E47C30E-71A9-4677-978C-7E91AF2A9ABE}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -667,7 +624,7 @@ type
|
|||||||
|
|
||||||
{ IAlbaranesCliente_Detalles }
|
{ IAlbaranesCliente_Detalles }
|
||||||
IAlbaranesCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
IAlbaranesCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||||
['{C442C7DF-32BE-4A00-8446-3DA2F08508AC}']
|
['{75F4E552-56D6-47A3-9D76-77310590BF15}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -860,39 +817,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TAlbaranesClienteDataTableRules }
|
{ TAlbaranesClienteDataTableRules }
|
||||||
constructor TAlbaranesClienteDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TAlbaranesClienteDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
var
|
var
|
||||||
@ -2043,7 +1967,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_AlbaranesCliente, TAlbaranesClienteDataTableRules);
|
RegisterDataTableRules(RID_AlbaranesCliente, TAlbaranesClienteDataTableRules);
|
||||||
RegisterDataTableRules(RID_AlbaranesCliente_Detalles, TAlbaranesCliente_DetallesDataTableRules);
|
RegisterDataTableRules(RID_AlbaranesCliente_Detalles, TAlbaranesCliente_DetallesDataTableRules);
|
||||||
|
|
||||||
|
|||||||
@ -9,48 +9,13 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferenciaDelta = '{95530CA0-F6C5-439B-ACE3-8DD1B50D65AC}';
|
RID_AlbaranesClienteDelta = '{9D0691A8-4F4E-4F30-84A1-BCBA842729F3}';
|
||||||
RID_AlbaranesClienteDelta = '{9E1A105B-7BE6-4100-BED9-9EB5E4517371}';
|
RID_AlbaranesCliente_DetallesDelta = '{424240C2-D81F-4084-B7A9-510E394C566F}';
|
||||||
RID_AlbaranesCliente_DetallesDelta = '{4FD893A0-294F-4ACF-8656-9DC37A524688}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferenciaDelta }
|
|
||||||
IDarReferenciaDelta = interface(IDarReferencia)
|
|
||||||
['{95530CA0-F6C5-439B-ACE3-8DD1B50D65AC}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
TDarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IDarReferencia, IDarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IAlbaranesClienteDelta }
|
{ IAlbaranesClienteDelta }
|
||||||
IAlbaranesClienteDelta = interface(IAlbaranesCliente)
|
IAlbaranesClienteDelta = interface(IAlbaranesCliente)
|
||||||
['{9E1A105B-7BE6-4100-BED9-9EB5E4517371}']
|
['{9D0691A8-4F4E-4F30-84A1-BCBA842729F3}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -542,7 +507,7 @@ type
|
|||||||
|
|
||||||
{ IAlbaranesCliente_DetallesDelta }
|
{ IAlbaranesCliente_DetallesDelta }
|
||||||
IAlbaranesCliente_DetallesDelta = interface(IAlbaranesCliente_Detalles)
|
IAlbaranesCliente_DetallesDelta = interface(IAlbaranesCliente_Detalles)
|
||||||
['{4FD893A0-294F-4ACF-8656-9DC37A524688}']
|
['{424240C2-D81F-4084-B7A9-510E394C566F}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_ALBARANValue : Integer;
|
function GetOldID_ALBARANValue : Integer;
|
||||||
@ -735,49 +700,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TAlbaranesClienteBusinessProcessorRules }
|
{ TAlbaranesClienteBusinessProcessorRules }
|
||||||
constructor TAlbaranesClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TAlbaranesClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
var
|
var
|
||||||
@ -2460,7 +2382,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_AlbaranesClienteDelta, TAlbaranesClienteBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_AlbaranesClienteDelta, TAlbaranesClienteBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_AlbaranesCliente_DetallesDelta, TAlbaranesCliente_DetallesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_AlbaranesCliente_DetallesDelta, TAlbaranesCliente_DetallesBusinessProcessorRules);
|
||||||
|
|
||||||
|
|||||||
@ -8,73 +8,107 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_ALBARAN_CLIENTE = 'Server.AlbaranCliente';
|
BIZ_SERVER_ALBARAN_CLIENTE = 'Server.AlbaranCliente';
|
||||||
REF_ALBARANES_CLIENTE = 'REF_ALBARANES_CLIENTE';
|
|
||||||
REF_ALBARANES_DEV_CLIENTE = 'REF_ALBARANES_DEV_CLIENTE';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizAlbaranClienteServer = class(TAlbaranesClienteBusinessProcessorRules)
|
TBizAlbaranClienteServer = class(TAlbaranesClienteBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schAlbaranesClienteClient_Intf;
|
schAlbaranesClienteClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_ALBARANES_CLIENTE = 'REF_ALBARANES_CLIENTE';
|
||||||
|
REF_ALBARANES_DEV_CLIENTE = 'REF_ALBARANES_DEV_CLIENTE';
|
||||||
|
|
||||||
{ TBizAlbaranClienteServer }
|
{ TBizAlbaranClienteServer }
|
||||||
|
|
||||||
procedure TBizAlbaranClienteServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
procedure TBizAlbaranClienteServer.AfterProcessChange(
|
||||||
var
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
ASchema : TDASchema;
|
var CanRemoveFromDelta: Boolean);
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
CodigoReferencia: String;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TBizAlbaranClienteServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_AlbaranesClienteREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_AlbaranesClienteREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_AlbaranesClienteID_EMPRESA];
|
|
||||||
if (Sender.CurrentChange.NewValueByName[fld_AlbaranesClienteIMPORTE_TOTAL] < 0) then
|
|
||||||
CodigoReferencia := REF_ALBARANES_DEV_CLIENTE
|
|
||||||
else
|
|
||||||
CodigoReferencia := REF_ALBARANES_CLIENTE;
|
|
||||||
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [CodigoReferencia, Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + CodigoReferencia + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName(fld_DarReferenciaVALOR).AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [CodigoReferencia, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TBizAlbaranClienteServer.DarReferencia: String;
|
||||||
|
var
|
||||||
|
ACodigoReferencia : String;
|
||||||
|
begin
|
||||||
|
if (IMPORTE_TOTAL < 0) then
|
||||||
|
ACodigoReferencia := REF_ALBARANES_DEV_CLIENTE
|
||||||
|
else
|
||||||
|
ACodigoReferencia := REF_ALBARANES_CLIENTE;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TBizAlbaranClienteServer.IncrementarReferencia: Boolean;
|
||||||
|
var
|
||||||
|
ACodigoReferencia : String;
|
||||||
|
begin
|
||||||
|
if (IMPORTE_TOTAL < 0) then
|
||||||
|
ACodigoReferencia := REF_ALBARANES_DEV_CLIENTE
|
||||||
|
else
|
||||||
|
ACodigoReferencia := REF_ALBARANES_CLIENTE;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(ACodigoReferencia,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_ALBARAN_CLIENTE, TBizAlbaranClienteServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_ALBARAN_CLIENTE, TBizAlbaranClienteServer);
|
||||||
|
|
||||||
|
|||||||
@ -14,40 +14,6 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente
|
|||||||
ConnectionManager = dmServer.ConnectionManager
|
ConnectionManager = dmServer.ConnectionManager
|
||||||
DataDictionary = DADataDictionary
|
DataDictionary = DADataDictionary
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT'#10' VALOR'#10'FROM'#10' REFERENCIAS'#10'WHERE'#10' CODIGO = :COD' +
|
|
||||||
'IGO'#10'AND ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'DarReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -591,32 +557,6 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -30,7 +30,6 @@ type
|
|||||||
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
||||||
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset; const IncludeSchema: Boolean; const MaxRecords: Integer);
|
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset; const IncludeSchema: Boolean; const MaxRecords: Integer);
|
||||||
procedure DARemoteServiceCreate(Sender: TObject);
|
procedure DARemoteServiceCreate(Sender: TObject);
|
||||||
private
|
|
||||||
protected
|
protected
|
||||||
{ IsrvAlbaranesCliente methods }
|
{ IsrvAlbaranesCliente methods }
|
||||||
function GenerateReport(const ID: String): Binary;
|
function GenerateReport(const ID: String): Binary;
|
||||||
@ -46,6 +45,12 @@ uses
|
|||||||
// uRptAlbaranesCliente_Server,
|
// uRptAlbaranesCliente_Server,
|
||||||
uBizAlbaranClienteServer;
|
uBizAlbaranClienteServer;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_ALBARANES_CLIENTE = 'REF_ALBARANES_CLIENTE';
|
||||||
|
REF_ALBARANES_DEV_CLIENTE = 'REF_ALBARANES_DEV_CLIENTE';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure Create_srvAlbaranesCliente(out anInstance : IUnknown);
|
procedure Create_srvAlbaranesCliente(out anInstance : IUnknown);
|
||||||
begin
|
begin
|
||||||
anInstance := TsrvAlbaranesCliente.Create(NIL);
|
anInstance := TsrvAlbaranesCliente.Create(NIL);
|
||||||
|
|||||||
@ -9,21 +9,13 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferencia = '{E264DAAA-A65A-4F97-8399-054CD6715754}';
|
RID_AlbaranesProveedor = '{5D89B51C-1BBF-4965-9ACB-E1001B5BB710}';
|
||||||
RID_AlbaranesProveedor = '{8070DE55-5BC2-4DCA-B26F-B6E77353CD13}';
|
RID_AlbaranesProveedor_Detalles = '{F59ECE23-B806-40E7-B93E-B6544F6AF9EF}';
|
||||||
RID_AlbaranesProveedor_Detalles = '{B5916447-B176-439A-8E99-A6CDA1527B86}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_DarReferencia = 'DarReferencia';
|
|
||||||
nme_AlbaranesProveedor = 'AlbaranesProveedor';
|
nme_AlbaranesProveedor = 'AlbaranesProveedor';
|
||||||
nme_AlbaranesProveedor_Detalles = 'AlbaranesProveedor_Detalles';
|
nme_AlbaranesProveedor_Detalles = 'AlbaranesProveedor_Detalles';
|
||||||
|
|
||||||
{ DarReferencia fields }
|
|
||||||
fld_DarReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ DarReferencia field indexes }
|
|
||||||
idx_DarReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ AlbaranesProveedor fields }
|
{ AlbaranesProveedor fields }
|
||||||
fld_AlbaranesProveedorID = 'ID';
|
fld_AlbaranesProveedorID = 'ID';
|
||||||
fld_AlbaranesProveedorID_EMPRESA = 'ID_EMPRESA';
|
fld_AlbaranesProveedorID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -133,44 +125,9 @@ const
|
|||||||
idx_AlbaranesProveedor_DetallesREFERENCIA_PROVEEDOR = 13;
|
idx_AlbaranesProveedor_DetallesREFERENCIA_PROVEEDOR = 13;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferencia }
|
|
||||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{87BCEB3E-3FAF-44FF-A992-70B549FF79CE}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
TDarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IDarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IAlbaranesProveedor }
|
{ IAlbaranesProveedor }
|
||||||
IAlbaranesProveedor = interface(IDAStronglyTypedDataTable)
|
IAlbaranesProveedor = interface(IDAStronglyTypedDataTable)
|
||||||
['{91E3DC89-DDB4-4727-88A3-1931B49B7F08}']
|
['{3AAA0A9E-4414-45B7-B5CB-A7A2B174ABD0}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -625,7 +582,7 @@ type
|
|||||||
|
|
||||||
{ IAlbaranesProveedor_Detalles }
|
{ IAlbaranesProveedor_Detalles }
|
||||||
IAlbaranesProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
IAlbaranesProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||||
['{A644C742-27E7-449C-9A6B-ED24143E13CD}']
|
['{7D0DD573-4F12-44EB-9355-C334C92E18C0}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -818,39 +775,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TAlbaranesProveedorDataTableRules }
|
{ TAlbaranesProveedorDataTableRules }
|
||||||
constructor TAlbaranesProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TAlbaranesProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
var
|
var
|
||||||
@ -1938,7 +1862,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_AlbaranesProveedor, TAlbaranesProveedorDataTableRules);
|
RegisterDataTableRules(RID_AlbaranesProveedor, TAlbaranesProveedorDataTableRules);
|
||||||
RegisterDataTableRules(RID_AlbaranesProveedor_Detalles, TAlbaranesProveedor_DetallesDataTableRules);
|
RegisterDataTableRules(RID_AlbaranesProveedor_Detalles, TAlbaranesProveedor_DetallesDataTableRules);
|
||||||
|
|
||||||
|
|||||||
@ -9,48 +9,13 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferenciaDelta = '{AD9EC61F-92A8-4757-A729-430A9C0F1014}';
|
RID_AlbaranesProveedorDelta = '{54AAD20A-09DB-4C98-B452-D36229C7A4F3}';
|
||||||
RID_AlbaranesProveedorDelta = '{6120285E-A519-4B85-96C3-9568FD81A17F}';
|
RID_AlbaranesProveedor_DetallesDelta = '{903174F0-DB0A-491D-9C1E-222E145262F6}';
|
||||||
RID_AlbaranesProveedor_DetallesDelta = '{CEDDEB44-9AE4-468F-A241-3235B7D100D6}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferenciaDelta }
|
|
||||||
IDarReferenciaDelta = interface(IDarReferencia)
|
|
||||||
['{AD9EC61F-92A8-4757-A729-430A9C0F1014}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
TDarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IDarReferencia, IDarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IAlbaranesProveedorDelta }
|
{ IAlbaranesProveedorDelta }
|
||||||
IAlbaranesProveedorDelta = interface(IAlbaranesProveedor)
|
IAlbaranesProveedorDelta = interface(IAlbaranesProveedor)
|
||||||
['{6120285E-A519-4B85-96C3-9568FD81A17F}']
|
['{54AAD20A-09DB-4C98-B452-D36229C7A4F3}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -506,7 +471,7 @@ type
|
|||||||
|
|
||||||
{ IAlbaranesProveedor_DetallesDelta }
|
{ IAlbaranesProveedor_DetallesDelta }
|
||||||
IAlbaranesProveedor_DetallesDelta = interface(IAlbaranesProveedor_Detalles)
|
IAlbaranesProveedor_DetallesDelta = interface(IAlbaranesProveedor_Detalles)
|
||||||
['{CEDDEB44-9AE4-468F-A241-3235B7D100D6}']
|
['{903174F0-DB0A-491D-9C1E-222E145262F6}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_ALBARANValue : Integer;
|
function GetOldID_ALBARANValue : Integer;
|
||||||
@ -699,49 +664,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TAlbaranesProveedorBusinessProcessorRules }
|
{ TAlbaranesProveedorBusinessProcessorRules }
|
||||||
constructor TAlbaranesProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TAlbaranesProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
var
|
var
|
||||||
@ -2331,7 +2253,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_AlbaranesProveedorDelta, TAlbaranesProveedorBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_AlbaranesProveedorDelta, TAlbaranesProveedorBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_AlbaranesProveedor_DetallesDelta, TAlbaranesProveedor_DetallesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_AlbaranesProveedor_DetallesDelta, TAlbaranesProveedor_DetallesBusinessProcessorRules);
|
||||||
|
|
||||||
|
|||||||
@ -8,74 +8,106 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_ALBARAN_PROVEEDOR = 'Server.AlbaranProveedor';
|
BIZ_SERVER_ALBARAN_PROVEEDOR = 'Server.AlbaranProveedor';
|
||||||
REF_ALBARANES_PROVEEDOR = 'REF_ALBARANES_PROVEEDOR';
|
|
||||||
REF_ALBARANES_DEV_PROVEEDOR = 'REF_ALBARANES_DEV_PROVEEDOR';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizAlbaranProveedorServer = class(TFacturasClienteBusinessProcessorRules)
|
TBizAlbaranProveedorServer = class(TFacturasClienteBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor;
|
||||||
|
const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor;
|
||||||
|
aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Dialogs, SysUtils, Variants, uDataModuleServer, uDAClasses, DARemoteService_Impl,
|
Dialogs, SysUtils, Variants, uDataModuleServer, uDAClasses,
|
||||||
schAlbaranesProveedorClient_Intf, uBusinessUtils, uReferenciasUtils, uROClasses;
|
schAlbaranesProveedorClient_Intf, uBusinessUtils, uReferenciasUtils, uROClasses,
|
||||||
|
srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_ALBARANES_PROVEEDOR = 'REF_ALBARANES_PROVEEDOR';
|
||||||
|
REF_ALBARANES_DEV_PROVEEDOR = 'REF_ALBARANES_DEV_PROVEEDOR';
|
||||||
|
|
||||||
{ TBizFacturasClienteServer }
|
{ TBizFacturasClienteServer }
|
||||||
|
|
||||||
procedure TBizAlbaranProveedorServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
procedure TBizAlbaranProveedorServer.AfterProcessChange(
|
||||||
var
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
ASchema : TDASchema;
|
var CanRemoveFromDelta: Boolean);
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
CodigoReferencia: String;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizAlbaranProveedorServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
begin
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_AlbaranesProveedorREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_AlbaranesProveedorREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_AlbaranesProveedorID_EMPRESA];
|
|
||||||
if Sender.CurrentChange.NewValueByName[fld_AlbaranesProveedorIMPORTE_TOTAL] < 0 then
|
|
||||||
CodigoReferencia := REF_ALBARANES_DEV_PROVEEDOR
|
|
||||||
else
|
|
||||||
CodigoReferencia := REF_ALBARANES_PROVEEDOR;
|
|
||||||
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [CodigoReferencia, Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + CodigoReferencia + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName(fld_DarReferenciaVALOR).AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [CodigoReferencia, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBizAlbaranProveedorServer.DarReferencia: String;
|
||||||
|
var
|
||||||
|
ACodigoReferencia : String;
|
||||||
|
begin
|
||||||
|
if (IMPORTE_TOTAL < 0) then
|
||||||
|
ACodigoReferencia := REF_ALBARANES_DEV_PROVEEDOR
|
||||||
|
else
|
||||||
|
ACodigoReferencia := REF_ALBARANES_PROVEEDOR;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBizAlbaranProveedorServer.IncrementarReferencia: Boolean;
|
||||||
|
var
|
||||||
|
ACodigoReferencia : String;
|
||||||
|
begin
|
||||||
|
if (IMPORTE_TOTAL < 0) then
|
||||||
|
ACodigoReferencia := REF_ALBARANES_DEV_PROVEEDOR
|
||||||
|
else
|
||||||
|
ACodigoReferencia := REF_ALBARANES_PROVEEDOR;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(ACodigoReferencia,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_ALBARAN_PROVEEDOR, TBizAlbaranProveedorServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_ALBARAN_PROVEEDOR, TBizAlbaranProveedorServer);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
@ -14,40 +14,6 @@ object srvAlbaranesProveedor: TsrvAlbaranesProveedor
|
|||||||
ConnectionManager = dmServer.ConnectionManager
|
ConnectionManager = dmServer.ConnectionManager
|
||||||
DataDictionary = DADataDictionary
|
DataDictionary = DADataDictionary
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT'#10' VALOR'#10'FROM'#10' REFERENCIAS'#10'WHERE'#10' CODIGO = :COD' +
|
|
||||||
'IGO'#10'AND ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'DarReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -565,32 +531,6 @@ object srvAlbaranesProveedor: TsrvAlbaranesProveedor
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -3,27 +3,19 @@ unit schFacturasClienteClient_Intf;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, DB, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf;
|
Classes, DB, schBase_Intf, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf;
|
||||||
|
|
||||||
const
|
const
|
||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferencia = '{BFD0BE4F-A013-4368-AAB1-D78832815453}';
|
RID_FacturasCliente = '{F2391B37-1CFC-4278-9886-10B58EB16F64}';
|
||||||
RID_FacturasCliente = '{F251FC90-F8DB-4542-BB27-1D9D1C38B5C2}';
|
RID_FacturasCliente_Detalles = '{85136507-38CB-4985-B1C4-DFBDB0D69903}';
|
||||||
RID_FacturasCliente_Detalles = '{21F1B1B1-A23D-4DE8-A7A9-91B042AA33C4}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_DarReferencia = 'DarReferencia';
|
|
||||||
nme_FacturasCliente = 'FacturasCliente';
|
nme_FacturasCliente = 'FacturasCliente';
|
||||||
nme_FacturasCliente_Detalles = 'FacturasCliente_Detalles';
|
nme_FacturasCliente_Detalles = 'FacturasCliente_Detalles';
|
||||||
|
|
||||||
{ DarReferencia fields }
|
|
||||||
fld_DarReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ DarReferencia field indexes }
|
|
||||||
idx_DarReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ FacturasCliente fields }
|
{ FacturasCliente fields }
|
||||||
fld_FacturasClienteID = 'ID';
|
fld_FacturasClienteID = 'ID';
|
||||||
fld_FacturasClienteID_EMPRESA = 'ID_EMPRESA';
|
fld_FacturasClienteID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -129,44 +121,9 @@ const
|
|||||||
idx_FacturasCliente_DetallesREFERENCIA_PROVEEDOR = 13;
|
idx_FacturasCliente_DetallesREFERENCIA_PROVEEDOR = 13;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferencia }
|
|
||||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{2F985A85-CE21-459E-9476-83CB04A2F9AC}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
TDarReferenciaDataTableRules = class(TDADataTableRules, IDarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IFacturasCliente }
|
{ IFacturasCliente }
|
||||||
IFacturasCliente = interface(IDAStronglyTypedDataTable)
|
IFacturasCliente = interface(IDAStronglyTypedDataTable)
|
||||||
['{153F474D-B1D3-4EC7-A4AE-B83884F61A16}']
|
['{EE310893-B940-40AD-B0F3-7BBF9128C629}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -377,7 +334,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFacturasClienteDataTableRules }
|
{ TFacturasClienteDataTableRules }
|
||||||
TFacturasClienteDataTableRules = class(TDADataTableRules, IFacturasCliente)
|
TFacturasClienteDataTableRules = class(TIntfObjectDADataTableRules, IFacturasCliente)
|
||||||
private
|
private
|
||||||
f_OBSERVACIONES: IROStrings;
|
f_OBSERVACIONES: IROStrings;
|
||||||
procedure OBSERVACIONES_OnChange(Sender: TObject);
|
procedure OBSERVACIONES_OnChange(Sender: TObject);
|
||||||
@ -597,7 +554,7 @@ type
|
|||||||
|
|
||||||
{ IFacturasCliente_Detalles }
|
{ IFacturasCliente_Detalles }
|
||||||
IFacturasCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
IFacturasCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||||
['{CC81CA29-10BA-4644-B6C0-86EB1BB27BBD}']
|
['{69194180-6BEA-41D0-8DD9-21E562F1B351}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -689,7 +646,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFacturasCliente_DetallesDataTableRules }
|
{ TFacturasCliente_DetallesDataTableRules }
|
||||||
TFacturasCliente_DetallesDataTableRules = class(TDADataTableRules, IFacturasCliente_Detalles)
|
TFacturasCliente_DetallesDataTableRules = class(TIntfObjectDADataTableRules, IFacturasCliente_Detalles)
|
||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
@ -790,39 +747,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TFacturasClienteDataTableRules }
|
{ TFacturasClienteDataTableRules }
|
||||||
constructor TFacturasClienteDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TFacturasClienteDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
var
|
var
|
||||||
@ -1863,7 +1787,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_FacturasCliente, TFacturasClienteDataTableRules);
|
RegisterDataTableRules(RID_FacturasCliente, TFacturasClienteDataTableRules);
|
||||||
RegisterDataTableRules(RID_FacturasCliente_Detalles, TFacturasCliente_DetallesDataTableRules);
|
RegisterDataTableRules(RID_FacturasCliente_Detalles, TFacturasCliente_DetallesDataTableRules);
|
||||||
|
|
||||||
|
|||||||
@ -9,48 +9,13 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferenciaDelta = '{96BD45A4-7433-4AE5-B411-7B16AB88936D}';
|
RID_FacturasClienteDelta = '{156A6AD0-D912-4FCF-AC71-2BB455BBC0AB}';
|
||||||
RID_FacturasClienteDelta = '{4EBF93DA-5847-45E1-960B-069B5239374F}';
|
RID_FacturasCliente_DetallesDelta = '{F4802AAF-93A6-40A6-8DC8-8BF1B5E4B06A}';
|
||||||
RID_FacturasCliente_DetallesDelta = '{1CB4A035-683D-412C-A365-6CF3A4E86ACD}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferenciaDelta }
|
|
||||||
IDarReferenciaDelta = interface(IDarReferencia)
|
|
||||||
['{96BD45A4-7433-4AE5-B411-7B16AB88936D}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
TDarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IDarReferencia, IDarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IFacturasClienteDelta }
|
{ IFacturasClienteDelta }
|
||||||
IFacturasClienteDelta = interface(IFacturasCliente)
|
IFacturasClienteDelta = interface(IFacturasCliente)
|
||||||
['{4EBF93DA-5847-45E1-960B-069B5239374F}']
|
['{156A6AD0-D912-4FCF-AC71-2BB455BBC0AB}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -481,7 +446,7 @@ type
|
|||||||
|
|
||||||
{ IFacturasCliente_DetallesDelta }
|
{ IFacturasCliente_DetallesDelta }
|
||||||
IFacturasCliente_DetallesDelta = interface(IFacturasCliente_Detalles)
|
IFacturasCliente_DetallesDelta = interface(IFacturasCliente_Detalles)
|
||||||
['{1CB4A035-683D-412C-A365-6CF3A4E86ACD}']
|
['{F4802AAF-93A6-40A6-8DC8-8BF1B5E4B06A}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_FACTURAValue : Integer;
|
function GetOldID_FACTURAValue : Integer;
|
||||||
@ -674,49 +639,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TFacturasClienteBusinessProcessorRules }
|
{ TFacturasClienteBusinessProcessorRules }
|
||||||
constructor TFacturasClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TFacturasClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
var
|
var
|
||||||
@ -2238,7 +2160,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_FacturasClienteDelta, TFacturasClienteBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_FacturasClienteDelta, TFacturasClienteBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_FacturasCliente_DetallesDelta, TFacturasCliente_DetallesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_FacturasCliente_DetallesDelta, TFacturasCliente_DetallesBusinessProcessorRules);
|
||||||
|
|
||||||
|
|||||||
@ -8,13 +8,13 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_FACTURAS_CLIENTE = 'Server.FacturasCliente';
|
BIZ_SERVER_FACTURAS_CLIENTE = 'Server.FacturasCliente';
|
||||||
REF_FACTURAS_CLIENTE = 'REF_FACTURAS_CLIENTE';
|
|
||||||
REF_ABONOS_CLIENTE = 'REF_ABONOS_CLIENTE';
|
|
||||||
CTE_TIPO_ABONO = 'A';
|
|
||||||
CTE_TIPO_FACTURA = 'F';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizFacturasClienteServer = class(TFacturasClienteBusinessProcessorRules)
|
TBizFacturasClienteServer = class(TFacturasClienteBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure Insert_Asiento_Factura(aChange: TDADeltaChange); virtual;
|
procedure Insert_Asiento_Factura(aChange: TDADeltaChange); virtual;
|
||||||
procedure Update_Asiento_Factura(aChange: TDADeltaChange); virtual;
|
procedure Update_Asiento_Factura(aChange: TDADeltaChange); virtual;
|
||||||
@ -28,7 +28,13 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schFacturasClienteClient_Intf;
|
schFacturasClienteClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_FACTURAS_CLIENTE = 'REF_FACTURAS_CLIENTE';
|
||||||
|
REF_ABONOS_CLIENTE = 'REF_ABONOS_CLIENTE';
|
||||||
|
CTE_TIPO_ABONO = 'A';
|
||||||
|
CTE_TIPO_FACTURA = 'F';
|
||||||
|
|
||||||
{ TBizFacturasClienteServer }
|
{ TBizFacturasClienteServer }
|
||||||
|
|
||||||
@ -51,59 +57,31 @@ begin
|
|||||||
// mantengan por si alguna tabla detalle lo necesita
|
// mantengan por si alguna tabla detalle lo necesita
|
||||||
// (por ejemplo, DireccionesContacto)
|
// (por ejemplo, DireccionesContacto)
|
||||||
CanRemoveFromDelta := False;
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
// Actualizamos el contador de referencias.
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBizFacturasClienteServer.BeforeProcessDelta(
|
procedure TBizFacturasClienteServer.BeforeProcessDelta(
|
||||||
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
var
|
|
||||||
ASchema : TDASchema;
|
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
Tipo : Variant;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
|
|
||||||
ASchema := BusinessProcessor.Schema;
|
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
|
||||||
|
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_FacturasClienteREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_FacturasClienteREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
try
|
FReferenciaAutomatica := True;
|
||||||
//Siempre va a estar rellena
|
REFERENCIA := DarReferencia;
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_FacturasClienteID_EMPRESA];
|
|
||||||
Tipo := Sender.CurrentChange.NewValueByName[fld_FacturasClienteTIPO];
|
|
||||||
|
|
||||||
if Tipo = CTE_TIPO_FACTURA then
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_FACTURAS_CLIENTE, Empresa])
|
|
||||||
else
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_ABONOS_CLIENTE, Empresa]);
|
|
||||||
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + REF_FACTURAS_CLIENTE + ' / ' + REF_ABONOS_CLIENTE + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName('VALOR').AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
if Tipo = CTE_TIPO_FACTURA then
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [REF_FACTURAS_CLIENTE, DarReferenciaSiguiente(REFERENCIA), Empresa])
|
|
||||||
else
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [REF_ABONOS_CLIENTE, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -130,6 +108,41 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBizFacturasClienteServer.DarReferencia: String;
|
||||||
|
var
|
||||||
|
ATipo : String;
|
||||||
|
begin
|
||||||
|
if TIPO = CTE_TIPO_FACTURA then
|
||||||
|
ATipo := REF_FACTURAS_CLIENTE
|
||||||
|
else
|
||||||
|
ATipo := REF_ABONOS_CLIENTE;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(ATipo, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBizFacturasClienteServer.IncrementarReferencia: Boolean;
|
||||||
|
var
|
||||||
|
ATipo : String;
|
||||||
|
begin
|
||||||
|
if TIPO = CTE_TIPO_FACTURA then
|
||||||
|
ATipo := REF_FACTURAS_CLIENTE
|
||||||
|
else
|
||||||
|
ATipo := REF_ABONOS_CLIENTE;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(ATipo,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TBizFacturasClienteServer.Insert_Asiento_Factura(aChange: TDADeltaChange);
|
procedure TBizFacturasClienteServer.Insert_Asiento_Factura(aChange: TDADeltaChange);
|
||||||
var
|
var
|
||||||
ASchema : TDASchema;
|
ASchema : TDASchema;
|
||||||
|
|||||||
@ -15,42 +15,6 @@ object srvFacturasCliente: TsrvFacturasCliente
|
|||||||
DataDictionary = DataDictionary
|
DataDictionary = DataDictionary
|
||||||
Diagrams = Diagrams
|
Diagrams = Diagrams
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
DataType = datString
|
|
||||||
Size = 50
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT VALOR'#10'FROM REFERENCIAS'#10'WHERE CODIGO = :CODIGO'#10'AND ID_EMPR' +
|
|
||||||
'ESA = :EMPRESA'
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'DarReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -579,31 +543,6 @@ object srvFacturasCliente: TsrvFacturasCliente
|
|||||||
end>
|
end>
|
||||||
Name = 'Insert_AsientoFactura'
|
Name = 'Insert_AsientoFactura'
|
||||||
end
|
end
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -9,21 +9,13 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferencia = '{5C2671F2-30A9-40DF-85EB-DAC3E5798C81}';
|
RID_FacturasProveedor = '{136699FF-423F-4F03-8EF2-2177BB023D1D}';
|
||||||
RID_FacturasProveedor = '{EB88CFA6-A4F3-44A5-99AC-CEEF636BBC0F}';
|
RID_FacturasProveedor_Detalles = '{DEFE9C53-4E75-4151-97EB-0B915C6D0FA3}';
|
||||||
RID_FacturasProveedor_Detalles = '{794BFE28-FCFA-451E-809D-4B3204729DB8}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_DarReferencia = 'DarReferencia';
|
|
||||||
nme_FacturasProveedor = 'FacturasProveedor';
|
nme_FacturasProveedor = 'FacturasProveedor';
|
||||||
nme_FacturasProveedor_Detalles = 'FacturasProveedor_Detalles';
|
nme_FacturasProveedor_Detalles = 'FacturasProveedor_Detalles';
|
||||||
|
|
||||||
{ DarReferencia fields }
|
|
||||||
fld_DarReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ DarReferencia field indexes }
|
|
||||||
idx_DarReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ FacturasProveedor fields }
|
{ FacturasProveedor fields }
|
||||||
fld_FacturasProveedorID = 'ID';
|
fld_FacturasProveedorID = 'ID';
|
||||||
fld_FacturasProveedorID_EMPRESA = 'ID_EMPRESA';
|
fld_FacturasProveedorID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -123,44 +115,9 @@ const
|
|||||||
idx_FacturasProveedor_DetallesREFERENCIA_PROVEEDOR = 13;
|
idx_FacturasProveedor_DetallesREFERENCIA_PROVEEDOR = 13;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferencia }
|
|
||||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{2CD8615C-AC9E-463D-A28B-9DF7EA71C261}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
TDarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IDarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IFacturasProveedor }
|
{ IFacturasProveedor }
|
||||||
IFacturasProveedor = interface(IDAStronglyTypedDataTable)
|
IFacturasProveedor = interface(IDAStronglyTypedDataTable)
|
||||||
['{19ADA8D8-BA53-426F-9AFA-700B29166843}']
|
['{C77E17AB-983D-4BA0-9307-753EEACE24CA}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -555,7 +512,7 @@ type
|
|||||||
|
|
||||||
{ IFacturasProveedor_Detalles }
|
{ IFacturasProveedor_Detalles }
|
||||||
IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||||
['{8C420A12-5489-4872-A3A6-9DE83225D778}']
|
['{A0C91003-B79C-400B-815C-9CC93FBAB289}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -748,39 +705,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TFacturasProveedorDataTableRules }
|
{ TFacturasProveedorDataTableRules }
|
||||||
constructor TFacturasProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TFacturasProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
var
|
var
|
||||||
@ -1758,7 +1682,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_FacturasProveedor, TFacturasProveedorDataTableRules);
|
RegisterDataTableRules(RID_FacturasProveedor, TFacturasProveedorDataTableRules);
|
||||||
RegisterDataTableRules(RID_FacturasProveedor_Detalles, TFacturasProveedor_DetallesDataTableRules);
|
RegisterDataTableRules(RID_FacturasProveedor_Detalles, TFacturasProveedor_DetallesDataTableRules);
|
||||||
|
|
||||||
|
|||||||
@ -9,48 +9,13 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferenciaDelta = '{29799EE8-6169-4A26-9C4C-02C33D658D97}';
|
RID_FacturasProveedorDelta = '{49DEF80E-CE30-451C-9F9F-ACC792AF58B2}';
|
||||||
RID_FacturasProveedorDelta = '{90E2FE05-93D9-4478-B54E-73618BD635BF}';
|
RID_FacturasProveedor_DetallesDelta = '{2373FE62-65FF-43FC-86C0-82138300CDA1}';
|
||||||
RID_FacturasProveedor_DetallesDelta = '{9215693E-0AA6-46A8-AD7B-3EAE75F51EFE}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferenciaDelta }
|
|
||||||
IDarReferenciaDelta = interface(IDarReferencia)
|
|
||||||
['{29799EE8-6169-4A26-9C4C-02C33D658D97}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
TDarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IDarReferencia, IDarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IFacturasProveedorDelta }
|
{ IFacturasProveedorDelta }
|
||||||
IFacturasProveedorDelta = interface(IFacturasProveedor)
|
IFacturasProveedorDelta = interface(IFacturasProveedor)
|
||||||
['{90E2FE05-93D9-4478-B54E-73618BD635BF}']
|
['{49DEF80E-CE30-451C-9F9F-ACC792AF58B2}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -445,7 +410,7 @@ type
|
|||||||
|
|
||||||
{ IFacturasProveedor_DetallesDelta }
|
{ IFacturasProveedor_DetallesDelta }
|
||||||
IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles)
|
IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles)
|
||||||
['{9215693E-0AA6-46A8-AD7B-3EAE75F51EFE}']
|
['{2373FE62-65FF-43FC-86C0-82138300CDA1}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_FACTURAValue : Integer;
|
function GetOldID_FACTURAValue : Integer;
|
||||||
@ -638,49 +603,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TFacturasProveedorBusinessProcessorRules }
|
{ TFacturasProveedorBusinessProcessorRules }
|
||||||
constructor TFacturasProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TFacturasProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
var
|
var
|
||||||
@ -2109,7 +2031,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_FacturasProveedorDelta, TFacturasProveedorBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_FacturasProveedorDelta, TFacturasProveedorBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_FacturasProveedor_DetallesDelta, TFacturasProveedor_DetallesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_FacturasProveedor_DetallesDelta, TFacturasProveedor_DetallesBusinessProcessorRules);
|
||||||
|
|
||||||
|
|||||||
@ -8,80 +8,105 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_FACTURAS_PROVEEDOR = 'Server.FacturasProveedor';
|
BIZ_SERVER_FACTURAS_PROVEEDOR = 'Server.FacturasProveedor';
|
||||||
REF_FACTURAS_PROVEEDOR = 'REF_FACTURAS_PROVEEDOR';
|
|
||||||
REF_ABONOS_PROVEEDOR = 'REF_ABONOS_PROVEEDOR';
|
|
||||||
CTE_TIPO_ABONO = 'A';
|
|
||||||
CTE_TIPO_FACTURA = 'F';
|
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizFacturasProveedorServer = class(TFacturasProveedorBusinessProcessorRules)
|
TBizFacturasProveedorServer = class(TFacturasProveedorBusinessProcessorRules)
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor;
|
||||||
|
const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor;
|
||||||
|
aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schFacturasProveedorClient_Intf;
|
schFacturasProveedorClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_FACTURAS_PROVEEDOR = 'REF_FACTURAS_PROVEEDOR';
|
||||||
|
REF_ABONOS_PROVEEDOR = 'REF_ABONOS_PROVEEDOR';
|
||||||
|
CTE_TIPO_ABONO = 'A';
|
||||||
|
CTE_TIPO_FACTURA = 'F';
|
||||||
|
|
||||||
{ TBizFacturasProveedorServer }
|
{ TBizFacturasProveedorServer }
|
||||||
|
|
||||||
procedure TBizFacturasProveedorServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
procedure TBizFacturasProveedorServer.AfterProcessChange(
|
||||||
var
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
ASchema : TDASchema;
|
var CanRemoveFromDelta: Boolean);
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
Tipo : Variant;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizFacturasProveedorServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
begin
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_FacturasProveedorREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_FacturasProveedorREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_FacturasProveedorID_EMPRESA];
|
|
||||||
Tipo := Sender.CurrentChange.NewValueByName[fld_FacturasProveedorTIPO];
|
|
||||||
|
|
||||||
if Tipo = CTE_TIPO_FACTURA then
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_FACTURAS_PROVEEDOR, Empresa])
|
|
||||||
else
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_ABONOS_PROVEEDOR, Empresa]);
|
|
||||||
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + REF_FACTURAS_PROVEEDOR + ' / ' + REF_ABONOS_PROVEEDOR + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName('VALOR').AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
if Tipo = CTE_TIPO_FACTURA then
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [REF_FACTURAS_PROVEEDOR, DarReferenciaSiguiente(REFERENCIA), Empresa])
|
|
||||||
else
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [REF_ABONOS_PROVEEDOR, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBizFacturasProveedorServer.DarReferencia: String;
|
||||||
|
var
|
||||||
|
ATipo : String;
|
||||||
|
begin
|
||||||
|
if TIPO = CTE_TIPO_FACTURA then
|
||||||
|
ATipo := REF_FACTURAS_PROVEEDOR
|
||||||
|
else
|
||||||
|
ATipo := REF_ABONOS_PROVEEDOR;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(ATipo, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBizFacturasProveedorServer.IncrementarReferencia: Boolean;
|
||||||
|
var
|
||||||
|
ATipo : String;
|
||||||
|
begin
|
||||||
|
if TIPO = CTE_TIPO_FACTURA then
|
||||||
|
ATipo := REF_FACTURAS_PROVEEDOR
|
||||||
|
else
|
||||||
|
ATipo := REF_ABONOS_PROVEEDOR;
|
||||||
|
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(ATipo,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_FACTURAS_PROVEEDOR, TBizFacturasProveedorServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_FACTURAS_PROVEEDOR, TBizFacturasProveedorServer);
|
||||||
|
|
||||||
|
|||||||
@ -15,42 +15,6 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
|||||||
DataDictionary = DataDictionary
|
DataDictionary = DataDictionary
|
||||||
Diagrams = Diagrams
|
Diagrams = Diagrams
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
DataType = datString
|
|
||||||
Size = 50
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT VALOR'#10'FROM REFERENCIAS'#10'WHERE CODIGO = :CODIGO'#10'AND ID_EMPR' +
|
|
||||||
'ESA = :EMPRESA'
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'DarReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -519,31 +483,6 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -9,23 +9,15 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferencia = '{CA7994DB-6CC3-4494-8CDA-4D8411DB5D2D}';
|
RID_PedidosProveedor = '{74E7C143-965A-4B32-80F9-D2C42B5B1287}';
|
||||||
RID_PedidosProveedor = '{684C5776-911B-490A-9C71-D4EDCCAD631E}';
|
RID_PedidosProveedor_Detalles = '{F254F368-78C1-4219-B5A5-3716C3A52772}';
|
||||||
RID_PedidosProveedor_Detalles = '{FCF3DE95-4073-4679-92C0-87B7E7C46108}';
|
RID_PedidosProveedor_Articulos_Pendientes = '{5AE8E5D9-5CC5-48B5-986F-F8C8A20284A8}';
|
||||||
RID_PedidosProveedor_Articulos_Pendientes = '{EA978B2E-441A-49F8-AF4D-76517D74CF10}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_DarReferencia = 'DarReferencia';
|
|
||||||
nme_PedidosProveedor = 'PedidosProveedor';
|
nme_PedidosProveedor = 'PedidosProveedor';
|
||||||
nme_PedidosProveedor_Detalles = 'PedidosProveedor_Detalles';
|
nme_PedidosProveedor_Detalles = 'PedidosProveedor_Detalles';
|
||||||
nme_PedidosProveedor_Articulos_Pendientes = 'PedidosProveedor_Articulos_Pendientes';
|
nme_PedidosProveedor_Articulos_Pendientes = 'PedidosProveedor_Articulos_Pendientes';
|
||||||
|
|
||||||
{ DarReferencia fields }
|
|
||||||
fld_DarReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ DarReferencia field indexes }
|
|
||||||
idx_DarReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ PedidosProveedor fields }
|
{ PedidosProveedor fields }
|
||||||
fld_PedidosProveedorID = 'ID';
|
fld_PedidosProveedorID = 'ID';
|
||||||
fld_PedidosProveedorID_EMPRESA = 'ID_EMPRESA';
|
fld_PedidosProveedorID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -149,44 +141,9 @@ const
|
|||||||
idx_PedidosProveedor_Articulos_PendientesREFERENCIA_PROVEEDOR = 5;
|
idx_PedidosProveedor_Articulos_PendientesREFERENCIA_PROVEEDOR = 5;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferencia }
|
|
||||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{04456888-5D38-48BB-8CED-95617D1F2BB9}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
TDarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IDarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IPedidosProveedor }
|
{ IPedidosProveedor }
|
||||||
IPedidosProveedor = interface(IDAStronglyTypedDataTable)
|
IPedidosProveedor = interface(IDAStronglyTypedDataTable)
|
||||||
['{4E3D9B42-CF76-460B-8136-2D0C2B3417D4}']
|
['{659AE890-EF50-4D5D-A340-A46C0FE2C5E3}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -629,7 +586,7 @@ type
|
|||||||
|
|
||||||
{ IPedidosProveedor_Detalles }
|
{ IPedidosProveedor_Detalles }
|
||||||
IPedidosProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
IPedidosProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||||
['{127BE3FD-DEF4-4C58-ABC5-5A54DCE0608D}']
|
['{858490D5-7CC4-4293-A34B-B2843B15A102}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -820,7 +777,7 @@ type
|
|||||||
|
|
||||||
{ IPedidosProveedor_Articulos_Pendientes }
|
{ IPedidosProveedor_Articulos_Pendientes }
|
||||||
IPedidosProveedor_Articulos_Pendientes = interface(IDAStronglyTypedDataTable)
|
IPedidosProveedor_Articulos_Pendientes = interface(IDAStronglyTypedDataTable)
|
||||||
['{34BDDF31-970F-4F58-923B-1C0E66F27A5F}']
|
['{7D012016-CF55-4F5A-9726-B19B2CF79733}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetID_PEDIDOValue: Integer;
|
function GetID_PEDIDOValue: Integer;
|
||||||
procedure SetID_PEDIDOValue(const aValue: Integer);
|
procedure SetID_PEDIDOValue(const aValue: Integer);
|
||||||
@ -917,39 +874,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TPedidosProveedorDataTableRules }
|
{ TPedidosProveedorDataTableRules }
|
||||||
constructor TPedidosProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TPedidosProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
var
|
var
|
||||||
@ -2154,7 +2078,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_PedidosProveedor, TPedidosProveedorDataTableRules);
|
RegisterDataTableRules(RID_PedidosProveedor, TPedidosProveedorDataTableRules);
|
||||||
RegisterDataTableRules(RID_PedidosProveedor_Detalles, TPedidosProveedor_DetallesDataTableRules);
|
RegisterDataTableRules(RID_PedidosProveedor_Detalles, TPedidosProveedor_DetallesDataTableRules);
|
||||||
RegisterDataTableRules(RID_PedidosProveedor_Articulos_Pendientes, TPedidosProveedor_Articulos_PendientesDataTableRules);
|
RegisterDataTableRules(RID_PedidosProveedor_Articulos_Pendientes, TPedidosProveedor_Articulos_PendientesDataTableRules);
|
||||||
|
|||||||
@ -9,49 +9,14 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferenciaDelta = '{A1F1C534-FD91-42C1-856B-0CAE9DE48B68}';
|
RID_PedidosProveedorDelta = '{1F3B2168-C09F-472F-8722-9DA783EF59A9}';
|
||||||
RID_PedidosProveedorDelta = '{349D50BE-57FD-468A-8751-0374A571AAA4}';
|
RID_PedidosProveedor_DetallesDelta = '{7716AB41-604A-4367-904A-82479CDE2DA1}';
|
||||||
RID_PedidosProveedor_DetallesDelta = '{E924668B-8D1B-44C3-9DA2-D033F8C44E06}';
|
RID_PedidosProveedor_Articulos_PendientesDelta = '{8E47806D-955F-4154-97C8-B4543A8837D7}';
|
||||||
RID_PedidosProveedor_Articulos_PendientesDelta = '{0B859C3A-9F82-4451-A206-24CEF18A61E9}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferenciaDelta }
|
|
||||||
IDarReferenciaDelta = interface(IDarReferencia)
|
|
||||||
['{A1F1C534-FD91-42C1-856B-0CAE9DE48B68}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
TDarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IDarReferencia, IDarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IPedidosProveedorDelta }
|
{ IPedidosProveedorDelta }
|
||||||
IPedidosProveedorDelta = interface(IPedidosProveedor)
|
IPedidosProveedorDelta = interface(IPedidosProveedor)
|
||||||
['{349D50BE-57FD-468A-8751-0374A571AAA4}']
|
['{1F3B2168-C09F-472F-8722-9DA783EF59A9}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -495,7 +460,7 @@ type
|
|||||||
|
|
||||||
{ IPedidosProveedor_DetallesDelta }
|
{ IPedidosProveedor_DetallesDelta }
|
||||||
IPedidosProveedor_DetallesDelta = interface(IPedidosProveedor_Detalles)
|
IPedidosProveedor_DetallesDelta = interface(IPedidosProveedor_Detalles)
|
||||||
['{E924668B-8D1B-44C3-9DA2-D033F8C44E06}']
|
['{7716AB41-604A-4367-904A-82479CDE2DA1}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_PEDIDOValue : Integer;
|
function GetOldID_PEDIDOValue : Integer;
|
||||||
@ -685,7 +650,7 @@ type
|
|||||||
|
|
||||||
{ IPedidosProveedor_Articulos_PendientesDelta }
|
{ IPedidosProveedor_Articulos_PendientesDelta }
|
||||||
IPedidosProveedor_Articulos_PendientesDelta = interface(IPedidosProveedor_Articulos_Pendientes)
|
IPedidosProveedor_Articulos_PendientesDelta = interface(IPedidosProveedor_Articulos_Pendientes)
|
||||||
['{0B859C3A-9F82-4451-A206-24CEF18A61E9}']
|
['{8E47806D-955F-4154-97C8-B4543A8837D7}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldID_PEDIDOValue : Integer;
|
function GetOldID_PEDIDOValue : Integer;
|
||||||
function GetOldREFERENCIAValue : String;
|
function GetOldREFERENCIAValue : String;
|
||||||
@ -782,49 +747,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TPedidosProveedorBusinessProcessorRules }
|
{ TPedidosProveedorBusinessProcessorRules }
|
||||||
constructor TPedidosProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TPedidosProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
var
|
var
|
||||||
@ -2581,7 +2503,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_PedidosProveedorDelta, TPedidosProveedorBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_PedidosProveedorDelta, TPedidosProveedorBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_PedidosProveedor_DetallesDelta, TPedidosProveedor_DetallesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_PedidosProveedor_DetallesDelta, TPedidosProveedor_DetallesBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_PedidosProveedor_Articulos_PendientesDelta, TPedidosProveedor_Articulos_PendientesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_PedidosProveedor_Articulos_PendientesDelta, TPedidosProveedor_Articulos_PendientesBusinessProcessorRules);
|
||||||
|
|||||||
@ -8,68 +8,91 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_PEDIDOS_PROVEEDOR = 'Server.PedidosProveedor';
|
BIZ_SERVER_PEDIDOS_PROVEEDOR = 'Server.PedidosProveedor';
|
||||||
REF_PEDIDOS_PROVEEDOR = 'REF_PEDIDOS_PROVEEDOR';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizPedidosProveedorServer = class(TPedidosProveedorBusinessProcessorRules)
|
TBizPedidosProveedorServer = class(TPedidosProveedorBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor;
|
||||||
|
const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor;
|
||||||
|
aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schPedidosProveedorClient_Intf;
|
schPedidosProveedorClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_PEDIDOS_PROVEEDOR = 'REF_PEDIDOS_PROVEEDOR';
|
||||||
|
|
||||||
{ TBizPedidosProveedorServer }
|
{ TBizPedidosProveedorServer }
|
||||||
|
|
||||||
procedure TBizPedidosProveedorServer.BeforeProcessDelta(
|
procedure TBizPedidosProveedorServer.AfterProcessChange(
|
||||||
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
var
|
var CanRemoveFromDelta: Boolean);
|
||||||
ASchema : TDASchema;
|
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizPedidosProveedorServer.BeforeProcessDelta(
|
||||||
|
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
begin
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_PedidosProveedorREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_PedidosProveedorREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_PedidosProveedorID_EMPRESA];
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_PEDIDOS_PROVEEDOR, Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + REF_PEDIDOS_PROVEEDOR + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName(fld_DarReferenciaVALOR).AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [REF_PEDIDOS_PROVEEDOR, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBizPedidosProveedorServer.DarReferencia: String;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(REF_PEDIDOS_PROVEEDOR, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBizPedidosProveedorServer.IncrementarReferencia: Boolean;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(REF_PEDIDOS_PROVEEDOR,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_PEDIDOS_PROVEEDOR, TBizPedidosProveedorServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_PEDIDOS_PROVEEDOR, TBizPedidosProveedorServer);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
@ -14,40 +14,6 @@ object srvPedidosProveedor: TsrvPedidosProveedor
|
|||||||
ConnectionManager = dmServer.ConnectionManager
|
ConnectionManager = dmServer.ConnectionManager
|
||||||
DataDictionary = DADataDictionary
|
DataDictionary = DADataDictionary
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT'#10' VALOR'#10'FROM'#10' REFERENCIAS'#10'WHERE'#10' CODIGO = :COD' +
|
|
||||||
'IGO'#10'AND ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'DarReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -619,32 +585,6 @@ object srvPedidosProveedor: TsrvPedidosProveedor
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -9,21 +9,13 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferencia = '{6594B31A-A292-486E-A784-AF4659E1A953}';
|
RID_PresupuestosCliente = '{E1C79C14-6D88-4DE2-8C1C-9027B44498C9}';
|
||||||
RID_PresupuestosCliente = '{13857C95-50E8-4EF5-8544-ABFCE393A83E}';
|
RID_PresupuestosCliente_Detalles = '{198216A6-7817-4E5D-B053-94EF41471C94}';
|
||||||
RID_PresupuestosCliente_Detalles = '{FE4E1E48-710A-404F-B2DD-4547549B420D}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_DarReferencia = 'DarReferencia';
|
|
||||||
nme_PresupuestosCliente = 'PresupuestosCliente';
|
nme_PresupuestosCliente = 'PresupuestosCliente';
|
||||||
nme_PresupuestosCliente_Detalles = 'PresupuestosCliente_Detalles';
|
nme_PresupuestosCliente_Detalles = 'PresupuestosCliente_Detalles';
|
||||||
|
|
||||||
{ DarReferencia fields }
|
|
||||||
fld_DarReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ DarReferencia field indexes }
|
|
||||||
idx_DarReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ PresupuestosCliente fields }
|
{ PresupuestosCliente fields }
|
||||||
fld_PresupuestosClienteID = 'ID';
|
fld_PresupuestosClienteID = 'ID';
|
||||||
fld_PresupuestosClienteID_EMPRESA = 'ID_EMPRESA';
|
fld_PresupuestosClienteID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -117,44 +109,9 @@ const
|
|||||||
idx_PresupuestosCliente_DetallesREFERENCIA_PROVEEDOR = 13;
|
idx_PresupuestosCliente_DetallesREFERENCIA_PROVEEDOR = 13;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferencia }
|
|
||||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{D7753D57-71A2-4C4D-A580-8D58520FCFD3}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
TDarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IDarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IPresupuestosCliente }
|
{ IPresupuestosCliente }
|
||||||
IPresupuestosCliente = interface(IDAStronglyTypedDataTable)
|
IPresupuestosCliente = interface(IDAStronglyTypedDataTable)
|
||||||
['{4FCC9A5F-7A94-4A3A-940A-4CA0D4176EDB}']
|
['{6413A346-D037-4FA8-B7B4-CBD611916F97}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -513,7 +470,7 @@ type
|
|||||||
|
|
||||||
{ IPresupuestosCliente_Detalles }
|
{ IPresupuestosCliente_Detalles }
|
||||||
IPresupuestosCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
IPresupuestosCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||||
['{5B7F200F-3962-455D-98BB-A24DE98BD18B}']
|
['{862A13D0-9B6A-44BE-BE39-0779D381B015}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -706,39 +663,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TDarReferenciaDataTableRules }
|
|
||||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_DarReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_DarReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TPresupuestosClienteDataTableRules }
|
{ TPresupuestosClienteDataTableRules }
|
||||||
constructor TPresupuestosClienteDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TPresupuestosClienteDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
var
|
var
|
||||||
@ -1668,7 +1592,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_PresupuestosCliente, TPresupuestosClienteDataTableRules);
|
RegisterDataTableRules(RID_PresupuestosCliente, TPresupuestosClienteDataTableRules);
|
||||||
RegisterDataTableRules(RID_PresupuestosCliente_Detalles, TPresupuestosCliente_DetallesDataTableRules);
|
RegisterDataTableRules(RID_PresupuestosCliente_Detalles, TPresupuestosCliente_DetallesDataTableRules);
|
||||||
|
|
||||||
|
|||||||
@ -9,48 +9,13 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_DarReferenciaDelta = '{0B34135E-0FB6-4CBA-AF23-A26B88542C10}';
|
RID_PresupuestosClienteDelta = '{D14C4979-8012-4543-A051-FA40304370C4}';
|
||||||
RID_PresupuestosClienteDelta = '{847B43BF-5186-406F-92E6-2135D35EF01F}';
|
RID_PresupuestosCliente_DetallesDelta = '{D3649E01-484C-44F1-8B19-9592C984B428}';
|
||||||
RID_PresupuestosCliente_DetallesDelta = '{1DA22D38-0DB5-450C-AF43-3F7F4D2EA56E}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IDarReferenciaDelta }
|
|
||||||
IDarReferenciaDelta = interface(IDarReferencia)
|
|
||||||
['{0B34135E-0FB6-4CBA-AF23-A26B88542C10}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
TDarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IDarReferencia, IDarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IPresupuestosClienteDelta }
|
{ IPresupuestosClienteDelta }
|
||||||
IPresupuestosClienteDelta = interface(IPresupuestosCliente)
|
IPresupuestosClienteDelta = interface(IPresupuestosCliente)
|
||||||
['{847B43BF-5186-406F-92E6-2135D35EF01F}']
|
['{D14C4979-8012-4543-A051-FA40304370C4}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -412,7 +377,7 @@ type
|
|||||||
|
|
||||||
{ IPresupuestosCliente_DetallesDelta }
|
{ IPresupuestosCliente_DetallesDelta }
|
||||||
IPresupuestosCliente_DetallesDelta = interface(IPresupuestosCliente_Detalles)
|
IPresupuestosCliente_DetallesDelta = interface(IPresupuestosCliente_Detalles)
|
||||||
['{1DA22D38-0DB5-450C-AF43-3F7F4D2EA56E}']
|
['{D3649E01-484C-44F1-8B19-9592C984B428}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_PRESUPUESTOValue : Integer;
|
function GetOldID_PRESUPUESTOValue : Integer;
|
||||||
@ -605,49 +570,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TDarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TDarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_DarReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_DarReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TPresupuestosClienteBusinessProcessorRules }
|
{ TPresupuestosClienteBusinessProcessorRules }
|
||||||
constructor TPresupuestosClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TPresupuestosClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
var
|
var
|
||||||
@ -2001,7 +1923,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_PresupuestosClienteDelta, TPresupuestosClienteBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_PresupuestosClienteDelta, TPresupuestosClienteBusinessProcessorRules);
|
||||||
RegisterBusinessProcessorRules(RID_PresupuestosCliente_DetallesDelta, TPresupuestosCliente_DetallesBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_PresupuestosCliente_DetallesDelta, TPresupuestosCliente_DetallesBusinessProcessorRules);
|
||||||
|
|
||||||
|
|||||||
@ -8,69 +8,95 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_PRESUPUESTOS_CLIENTE = 'Server.PresupuestosCliente';
|
BIZ_SERVER_PRESUPUESTOS_CLIENTE = 'Server.PresupuestosCliente';
|
||||||
REF_PRESUPUESTOS_CLIENTE = 'REF_PRESUPUESTOS_CLIENTE';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizPresupuestosClienteServer = class(TPresupuestosClienteBusinessProcessorRules)
|
TBizPresupuestosClienteServer = class(TPresupuestosClienteBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor;
|
||||||
|
const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor;
|
||||||
|
aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schPresupuestosClienteClient_Intf;
|
schPresupuestosClienteClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_PRESUPUESTOS_CLIENTE = 'REF_PRESUPUESTOS_CLIENTE';
|
||||||
|
|
||||||
{ TBizPresupuestosClienteServer }
|
{ TBizPresupuestosClienteServer }
|
||||||
|
|
||||||
procedure TBizPresupuestosClienteServer.BeforeProcessDelta(
|
procedure TBizPresupuestosClienteServer.AfterProcessChange(
|
||||||
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
var
|
var CanRemoveFromDelta: Boolean);
|
||||||
ASchema : TDASchema;
|
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizPresupuestosClienteServer.BeforeProcessDelta(
|
||||||
|
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_PresupuestosClienteREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_PresupuestosClienteREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_PresupuestosClienteID_EMPRESA];
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_PRESUPUESTOS_CLIENTE, Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + REF_PRESUPUESTOS_CLIENTE + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName(fld_DarReferenciaVALOR).AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'EMPRESA'], [REF_PRESUPUESTOS_CLIENTE, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TBizPresupuestosClienteServer.DarReferencia: String;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(REF_PRESUPUESTOS_CLIENTE, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TBizPresupuestosClienteServer.IncrementarReferencia: Boolean;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(REF_PRESUPUESTOS_CLIENTE,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_PRESUPUESTOS_CLIENTE, TBizPresupuestosClienteServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_PRESUPUESTOS_CLIENTE, TBizPresupuestosClienteServer);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
@ -13,43 +13,6 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
|
|||||||
ConnectionManager = dmServer.ConnectionManager
|
ConnectionManager = dmServer.ConnectionManager
|
||||||
DataDictionary = DADataDictionary
|
DataDictionary = DADataDictionary
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
ConnectionType = 'Interbase'
|
|
||||||
Default = True
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
Name = 'IBX'
|
|
||||||
SQL =
|
|
||||||
'SELECT VALOR'#10'FROM REFERENCIAS'#10'WHERE CODIGO = :CODIGO'#10'AND ID_EMPR' +
|
|
||||||
'ESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'DarReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -487,34 +450,6 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
ConnectionType = 'Interbase'
|
|
||||||
Default = True
|
|
||||||
Name = 'IBX'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -11,6 +11,14 @@ type
|
|||||||
function GetFechaPago: TDateTime;
|
function GetFechaPago: TDateTime;
|
||||||
procedure SetFechaPago(const Value: TDateTime);
|
procedure SetFechaPago(const Value: TDateTime);
|
||||||
property FechaPago: TDateTime Read GetFechaPago write SetFechaPago;
|
property FechaPago: TDateTime Read GetFechaPago write SetFechaPago;
|
||||||
|
|
||||||
|
function GetIgnorarContabilidad: Integer;
|
||||||
|
procedure SetIgnorarContabilidad(const Value: Integer);
|
||||||
|
property IgnorarContabilidad: Integer Read GetIgnorarContabilidad write SetIgnorarContabilidad;
|
||||||
|
|
||||||
|
function GetIdSubCuenta: Integer;
|
||||||
|
procedure SetIdSubCuenta(const Value: Integer);
|
||||||
|
property IdSubCuenta: Integer Read GetIdSubCuenta write SetIdSubCuenta;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|||||||
@ -32,8 +32,8 @@ uses
|
|||||||
type
|
type
|
||||||
IPagosClienteController = interface(ISujeto)
|
IPagosClienteController = interface(ISujeto)
|
||||||
['{1864471E-74FA-4E96-BA8D-21357DA38B0F}']
|
['{1864471E-74FA-4E96-BA8D-21357DA38B0F}']
|
||||||
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''): Boolean;
|
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0): Boolean;
|
||||||
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String);
|
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String; Const IgnorarContabilidad: Integer);
|
||||||
function Eliminar(APagoCliente : IBizPagosCliente): Boolean;
|
function Eliminar(APagoCliente : IBizPagosCliente): Boolean;
|
||||||
function EliminarTodo(APagossCliente : IBizPagosCliente): Boolean;
|
function EliminarTodo(APagossCliente : IBizPagosCliente): Boolean;
|
||||||
end;
|
end;
|
||||||
@ -47,8 +47,8 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''): Boolean;
|
function Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0): Boolean;
|
||||||
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String);
|
procedure Modificar(APagosCliente: IBizPagosCliente; Const Fecha: String; Const IgnorarContabilidad: Integer);
|
||||||
function Eliminar(APagoCliente : IBizPagosCliente): Boolean;
|
function Eliminar(APagoCliente : IBizPagosCliente): Boolean;
|
||||||
function EliminarTodo(APagosCliente : IBizPagosCliente): Boolean;
|
function EliminarTodo(APagosCliente : IBizPagosCliente): Boolean;
|
||||||
end;
|
end;
|
||||||
@ -63,7 +63,7 @@ uses
|
|||||||
|
|
||||||
{ TPagosClienteController }
|
{ TPagosClienteController }
|
||||||
|
|
||||||
function TPagosClienteController.Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''): Boolean;
|
function TPagosClienteController.Anadir(APagosCliente: IBizPagosCliente; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0): Boolean;
|
||||||
{ Si el pago introducido es un pago y no una devolución devolvemos true en caso de ser
|
{ Si el pago introducido es un pago y no una devolución devolvemos true en caso de ser
|
||||||
una devolución devolvemos false}
|
una devolución devolvemos false}
|
||||||
begin
|
begin
|
||||||
@ -79,7 +79,10 @@ begin
|
|||||||
else
|
else
|
||||||
APagosCliente.TIPO := CTE_DEVOLUCION;
|
APagosCliente.TIPO := CTE_DEVOLUCION;
|
||||||
|
|
||||||
Result := (APagosCliente.TIPO = CTE_PAGO);
|
APagosCliente.IGNORAR_CONTABILIDAD := IgnorarContabilidad;
|
||||||
|
APagosCliente.CUENTA := IntToStr(IdSubCuenta);
|
||||||
|
|
||||||
|
Result := (APagosCliente.TIPO = CTE_PAGO);
|
||||||
APagosCliente.Post;
|
APagosCliente.Post;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -136,10 +139,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPagosClienteController.Modificar(APagosCliente: IBizPagosCliente; const Fecha: String);
|
procedure TPagosClienteController.Modificar(APagosCliente: IBizPagosCliente; const Fecha: String; Const IgnorarContabilidad: Integer);
|
||||||
begin
|
begin
|
||||||
APagosCliente.DataTable.Edit;
|
APagosCliente.DataTable.Edit;
|
||||||
APagosCliente.FECHA_PAGO := StrToDate(Fecha);
|
APagosCliente.FECHA_PAGO := StrToDate(Fecha);
|
||||||
|
APagosCliente.IGNORAR_CONTABILIDAD := IgnorarContabilidad;
|
||||||
APagosCliente.DataTable.Post;
|
APagosCliente.DataTable.Post;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -161,6 +161,8 @@ end;
|
|||||||
function TRecibosClienteController.AnadirPago(ARecibosCliente: IBizRecibosCliente; FechaPago: String =''): Boolean;
|
function TRecibosClienteController.AnadirPago(ARecibosCliente: IBizRecibosCliente; FechaPago: String =''): Boolean;
|
||||||
var
|
var
|
||||||
AEditor : IEditorFechaPago;
|
AEditor : IEditorFechaPago;
|
||||||
|
AIgnorarContabilidad : Integer;
|
||||||
|
ASubCuenta: Integer;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
@ -174,7 +176,11 @@ begin
|
|||||||
if Assigned(AEditor) then
|
if Assigned(AEditor) then
|
||||||
try
|
try
|
||||||
if (AEditor.ShowModal = mrOk) then
|
if (AEditor.ShowModal = mrOk) then
|
||||||
|
begin
|
||||||
FechaPago := DateToStr(AEditor.FechaPago);
|
FechaPago := DateToStr(AEditor.FechaPago);
|
||||||
|
AIgnorarContabilidad := AEditor.IgnorarContabilidad;
|
||||||
|
ASubCuenta := AEditor.IdSubcuenta;
|
||||||
|
end;
|
||||||
AEditor.Release;
|
AEditor.Release;
|
||||||
finally
|
finally
|
||||||
AEditor := NIL;
|
AEditor := NIL;
|
||||||
@ -198,7 +204,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
//Finalmente añadimos el pago (cobro o devolucion)
|
//Finalmente añadimos el pago (cobro o devolucion)
|
||||||
if PagosController.Anadir(ARecibosCliente.Pagos, FechaPago) then
|
if PagosController.Anadir(ARecibosCliente.Pagos, FechaPago, AIgnorarContabilidad, ASubCuenta) then
|
||||||
begin
|
begin
|
||||||
ARecibosCliente.Edit;
|
ARecibosCliente.Edit;
|
||||||
ARecibosCliente.SITUACION := CTE_COBRADO;
|
ARecibosCliente.SITUACION := CTE_COBRADO;
|
||||||
@ -753,21 +759,26 @@ procedure TRecibosClienteController.ModificarPago(ARecibosCliente: IBizRecibosCl
|
|||||||
var
|
var
|
||||||
AEditor : IEditorFechaPago;
|
AEditor : IEditorFechaPago;
|
||||||
FechaPago: String;
|
FechaPago: String;
|
||||||
|
IgnorarContabilidad: Integer;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
//Pedimos la fecha del pago
|
//Pedimos la fecha del pago
|
||||||
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
|
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
|
||||||
if Assigned(AEditor) then
|
if Assigned(AEditor) then
|
||||||
FechaPago:= '';
|
AEditor.FechaPago := ARecibosCliente.Pagos.FECHA_PAGO;
|
||||||
|
AEditor.IgnorarContabilidad := ARecibosCliente.Pagos.IGNORAR_CONTABILIDAD;
|
||||||
if (AEditor.ShowModal = mrOk) then
|
if (AEditor.ShowModal = mrOk) then
|
||||||
|
begin
|
||||||
FechaPago := DateToStr(AEditor.FechaPago);
|
FechaPago := DateToStr(AEditor.FechaPago);
|
||||||
|
IgnorarContabilidad := AEditor.IgnorarContabilidad;
|
||||||
|
end;
|
||||||
AEditor.Release;
|
AEditor.Release;
|
||||||
finally
|
finally
|
||||||
AEditor := NIL;
|
AEditor := NIL;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Length(FechaPago) > 0 then
|
if Length(FechaPago) > 0 then
|
||||||
PagosController.Modificar(ARecibosCliente.Pagos, FechaPago);
|
PagosController.Modificar(ARecibosCliente.Pagos, FechaPago, IgnorarContabilidad);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRecibosClienteController.Nuevo: IBizRecibosCliente;
|
function TRecibosClienteController.Nuevo: IBizRecibosCliente;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{f10782d8-a2a3-45bb-9ae0-98f0b23968fc}</ProjectGuid>
|
<ProjectGuid>{f10782d8-a2a3-45bb-9ae0-98f0b23968fc}</ProjectGuid>
|
||||||
<MainSource>RecibosCliente_data.dpk</MainSource>
|
<MainSource>RecibosCliente_data.dpk</MainSource>
|
||||||
@ -48,10 +49,11 @@
|
|||||||
<DelphiCompile Include="RecibosCliente_data.dpk">
|
<DelphiCompile Include="RecibosCliente_data.dpk">
|
||||||
<MainSource>MainSource</MainSource>
|
<MainSource>MainSource</MainSource>
|
||||||
</DelphiCompile>
|
</DelphiCompile>
|
||||||
<DCCReference Include="..\..\Lib\ApplicationBase.dcp" />
|
<DCCReference Include="..\ApplicationBase.dcp" />
|
||||||
<DCCReference Include="..\..\Lib\RecibosCliente_model.dcp" />
|
<DCCReference Include="..\RecibosCliente_model.dcp" />
|
||||||
<DCCReference Include="uDataModuleRecibosCliente.pas">
|
<DCCReference Include="uDataModuleRecibosCliente.pas">
|
||||||
<Form>DataModuleRecibosCliente</Form>
|
<Form>DataModuleRecibosCliente</Form>
|
||||||
|
<DesignClass>TDAClientDataModule</DesignClass>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -107,6 +107,10 @@ inherited DataModuleRecibosCliente: TDataModuleRecibosCliente
|
|||||||
Size = 20
|
Size = 20
|
||||||
DisplayLabel = 'PagosCliente_USUARIO'
|
DisplayLabel = 'PagosCliente_USUARIO'
|
||||||
DictionaryEntry = 'PagosCliente_USUARIO'
|
DictionaryEntry = 'PagosCliente_USUARIO'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'IGNORAR_CONTABILIDAD'
|
||||||
|
DataType = datSmallInt
|
||||||
end>
|
end>
|
||||||
Params = <>
|
Params = <>
|
||||||
MasterMappingMode = mmWhere
|
MasterMappingMode = mmWhere
|
||||||
|
|||||||
@ -9,9 +9,9 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_RecibosCliente = '{5410D8EC-FA59-43E6-96AB-C7C2E1292FBB}';
|
RID_RecibosCliente = '{BD713121-B67A-4555-B1F6-8C79907169A8}';
|
||||||
RID_PagosCliente = '{A9A33A29-1E9F-40C7-9F00-73776CAA6D93}';
|
RID_PagosCliente = '{51327032-C47B-4B5A-A2FB-4FF7FA518830}';
|
||||||
RID_RecibosCompensadosCli = '{55474263-530A-458F-ADE8-497B260FA9A3}';
|
RID_RecibosCompensadosCli = '{942FEF94-88F0-4687-9F8F-420A53607386}';
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_RecibosCliente = 'RecibosCliente';
|
nme_RecibosCliente = 'RecibosCliente';
|
||||||
@ -93,6 +93,7 @@ const
|
|||||||
fld_PagosClienteFECHA_ALTA = 'FECHA_ALTA';
|
fld_PagosClienteFECHA_ALTA = 'FECHA_ALTA';
|
||||||
fld_PagosClienteFECHA_MODIFICACION = 'FECHA_MODIFICACION';
|
fld_PagosClienteFECHA_MODIFICACION = 'FECHA_MODIFICACION';
|
||||||
fld_PagosClienteUSUARIO = 'USUARIO';
|
fld_PagosClienteUSUARIO = 'USUARIO';
|
||||||
|
fld_PagosClienteIGNORAR_CONTABILIDAD = 'IGNORAR_CONTABILIDAD';
|
||||||
|
|
||||||
{ PagosCliente field indexes }
|
{ PagosCliente field indexes }
|
||||||
idx_PagosClienteID = 0;
|
idx_PagosClienteID = 0;
|
||||||
@ -107,6 +108,7 @@ const
|
|||||||
idx_PagosClienteFECHA_ALTA = 9;
|
idx_PagosClienteFECHA_ALTA = 9;
|
||||||
idx_PagosClienteFECHA_MODIFICACION = 10;
|
idx_PagosClienteFECHA_MODIFICACION = 10;
|
||||||
idx_PagosClienteUSUARIO = 11;
|
idx_PagosClienteUSUARIO = 11;
|
||||||
|
idx_PagosClienteIGNORAR_CONTABILIDAD = 12;
|
||||||
|
|
||||||
{ RecibosCompensadosCli fields }
|
{ RecibosCompensadosCli fields }
|
||||||
fld_RecibosCompensadosCliID = 'ID';
|
fld_RecibosCompensadosCliID = 'ID';
|
||||||
@ -173,7 +175,7 @@ const
|
|||||||
type
|
type
|
||||||
{ IRecibosCliente }
|
{ IRecibosCliente }
|
||||||
IRecibosCliente = interface(IDAStronglyTypedDataTable)
|
IRecibosCliente = interface(IDAStronglyTypedDataTable)
|
||||||
['{11D2AB69-38A8-41B8-8139-2C32F3732B9C}']
|
['{13B23B67-01E0-4206-8F77-7C86FAB5765C}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -544,7 +546,7 @@ type
|
|||||||
|
|
||||||
{ IPagosCliente }
|
{ IPagosCliente }
|
||||||
IPagosCliente = interface(IDAStronglyTypedDataTable)
|
IPagosCliente = interface(IDAStronglyTypedDataTable)
|
||||||
['{A77D5C00-617A-4A1C-B34F-B24E6AC72E0D}']
|
['{CACDCDCC-257B-4007-87DE-DDB16A31FA1E}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -594,6 +596,10 @@ type
|
|||||||
procedure SetUSUARIOValue(const aValue: String);
|
procedure SetUSUARIOValue(const aValue: String);
|
||||||
function GetUSUARIOIsNull: Boolean;
|
function GetUSUARIOIsNull: Boolean;
|
||||||
procedure SetUSUARIOIsNull(const aValue: Boolean);
|
procedure SetUSUARIOIsNull(const aValue: Boolean);
|
||||||
|
function GetIGNORAR_CONTABILIDADValue: SmallInt;
|
||||||
|
procedure SetIGNORAR_CONTABILIDADValue(const aValue: SmallInt);
|
||||||
|
function GetIGNORAR_CONTABILIDADIsNull: Boolean;
|
||||||
|
procedure SetIGNORAR_CONTABILIDADIsNull(const aValue: Boolean);
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
{ Properties }
|
||||||
@ -621,6 +627,8 @@ type
|
|||||||
property FECHA_MODIFICACIONIsNull: Boolean read GetFECHA_MODIFICACIONIsNull write SetFECHA_MODIFICACIONIsNull;
|
property FECHA_MODIFICACIONIsNull: Boolean read GetFECHA_MODIFICACIONIsNull write SetFECHA_MODIFICACIONIsNull;
|
||||||
property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue;
|
property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue;
|
||||||
property USUARIOIsNull: Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull;
|
property USUARIOIsNull: Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull;
|
||||||
|
property IGNORAR_CONTABILIDAD: SmallInt read GetIGNORAR_CONTABILIDADValue write SetIGNORAR_CONTABILIDADValue;
|
||||||
|
property IGNORAR_CONTABILIDADIsNull: Boolean read GetIGNORAR_CONTABILIDADIsNull write SetIGNORAR_CONTABILIDADIsNull;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPagosClienteDataTableRules }
|
{ TPagosClienteDataTableRules }
|
||||||
@ -676,6 +684,10 @@ type
|
|||||||
procedure SetUSUARIOValue(const aValue: String); virtual;
|
procedure SetUSUARIOValue(const aValue: String); virtual;
|
||||||
function GetUSUARIOIsNull: Boolean; virtual;
|
function GetUSUARIOIsNull: Boolean; virtual;
|
||||||
procedure SetUSUARIOIsNull(const aValue: Boolean); virtual;
|
procedure SetUSUARIOIsNull(const aValue: Boolean); virtual;
|
||||||
|
function GetIGNORAR_CONTABILIDADValue: SmallInt; virtual;
|
||||||
|
procedure SetIGNORAR_CONTABILIDADValue(const aValue: SmallInt); virtual;
|
||||||
|
function GetIGNORAR_CONTABILIDADIsNull: Boolean; virtual;
|
||||||
|
procedure SetIGNORAR_CONTABILIDADIsNull(const aValue: Boolean); virtual;
|
||||||
|
|
||||||
{ Properties }
|
{ Properties }
|
||||||
property ID: Integer read GetIDValue write SetIDValue;
|
property ID: Integer read GetIDValue write SetIDValue;
|
||||||
@ -702,6 +714,8 @@ type
|
|||||||
property FECHA_MODIFICACIONIsNull: Boolean read GetFECHA_MODIFICACIONIsNull write SetFECHA_MODIFICACIONIsNull;
|
property FECHA_MODIFICACIONIsNull: Boolean read GetFECHA_MODIFICACIONIsNull write SetFECHA_MODIFICACIONIsNull;
|
||||||
property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue;
|
property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue;
|
||||||
property USUARIOIsNull: Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull;
|
property USUARIOIsNull: Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull;
|
||||||
|
property IGNORAR_CONTABILIDAD: SmallInt read GetIGNORAR_CONTABILIDADValue write SetIGNORAR_CONTABILIDADValue;
|
||||||
|
property IGNORAR_CONTABILIDADIsNull: Boolean read GetIGNORAR_CONTABILIDADIsNull write SetIGNORAR_CONTABILIDADIsNull;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
constructor Create(aDataTable: TDADataTable); override;
|
||||||
@ -711,7 +725,7 @@ type
|
|||||||
|
|
||||||
{ IRecibosCompensadosCli }
|
{ IRecibosCompensadosCli }
|
||||||
IRecibosCompensadosCli = interface(IDAStronglyTypedDataTable)
|
IRecibosCompensadosCli = interface(IDAStronglyTypedDataTable)
|
||||||
['{3E3D9FC0-4E90-4A4D-AE58-8B53087B5A5F}']
|
['{318980D4-1AED-437D-A1BB-40D176B7F41A}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -1968,6 +1982,27 @@ begin
|
|||||||
DataTable.Fields[idx_PagosClienteUSUARIO].AsVariant := Null;
|
DataTable.Fields[idx_PagosClienteUSUARIO].AsVariant := Null;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPagosClienteDataTableRules.GetIGNORAR_CONTABILIDADValue: SmallInt;
|
||||||
|
begin
|
||||||
|
result := DataTable.Fields[idx_PagosClienteIGNORAR_CONTABILIDAD].AsSmallInt;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPagosClienteDataTableRules.SetIGNORAR_CONTABILIDADValue(const aValue: SmallInt);
|
||||||
|
begin
|
||||||
|
DataTable.Fields[idx_PagosClienteIGNORAR_CONTABILIDAD].AsSmallInt := aValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TPagosClienteDataTableRules.GetIGNORAR_CONTABILIDADIsNull: boolean;
|
||||||
|
begin
|
||||||
|
result := DataTable.Fields[idx_PagosClienteIGNORAR_CONTABILIDAD].IsNull;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPagosClienteDataTableRules.SetIGNORAR_CONTABILIDADIsNull(const aValue: Boolean);
|
||||||
|
begin
|
||||||
|
if aValue then
|
||||||
|
DataTable.Fields[idx_PagosClienteIGNORAR_CONTABILIDAD].AsVariant := Null;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TRecibosCompensadosCliDataTableRules }
|
{ TRecibosCompensadosCliDataTableRules }
|
||||||
constructor TRecibosCompensadosCliDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TRecibosCompensadosCliDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
|
|||||||
@ -9,14 +9,14 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_RecibosClienteDelta = '{E1FDCE22-19B3-498A-BEBA-6CFB34FC22C2}';
|
RID_RecibosClienteDelta = '{0886304E-ADCF-4985-93CD-63C479B0592E}';
|
||||||
RID_PagosClienteDelta = '{B09875FA-0962-46A9-9A3A-40F618B4230D}';
|
RID_PagosClienteDelta = '{D5A42190-E981-46DA-BADE-32C8DD8A03B3}';
|
||||||
RID_RecibosCompensadosCliDelta = '{43471651-957E-47B2-B810-E0227C1BB163}';
|
RID_RecibosCompensadosCliDelta = '{46B04689-C995-45CE-B3CA-C602E1142822}';
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IRecibosClienteDelta }
|
{ IRecibosClienteDelta }
|
||||||
IRecibosClienteDelta = interface(IRecibosCliente)
|
IRecibosClienteDelta = interface(IRecibosCliente)
|
||||||
['{E1FDCE22-19B3-498A-BEBA-6CFB34FC22C2}']
|
['{0886304E-ADCF-4985-93CD-63C479B0592E}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||||
@ -386,7 +386,7 @@ type
|
|||||||
|
|
||||||
{ IPagosClienteDelta }
|
{ IPagosClienteDelta }
|
||||||
IPagosClienteDelta = interface(IPagosCliente)
|
IPagosClienteDelta = interface(IPagosCliente)
|
||||||
['{B09875FA-0962-46A9-9A3A-40F618B4230D}']
|
['{D5A42190-E981-46DA-BADE-32C8DD8A03B3}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_RECIBOValue : Integer;
|
function GetOldID_RECIBOValue : Integer;
|
||||||
@ -400,6 +400,7 @@ type
|
|||||||
function GetOldFECHA_ALTAValue : DateTime;
|
function GetOldFECHA_ALTAValue : DateTime;
|
||||||
function GetOldFECHA_MODIFICACIONValue : DateTime;
|
function GetOldFECHA_MODIFICACIONValue : DateTime;
|
||||||
function GetOldUSUARIOValue : String;
|
function GetOldUSUARIOValue : String;
|
||||||
|
function GetOldIGNORAR_CONTABILIDADValue : SmallInt;
|
||||||
|
|
||||||
{ Properties }
|
{ Properties }
|
||||||
property OldID : Integer read GetOldIDValue;
|
property OldID : Integer read GetOldIDValue;
|
||||||
@ -414,6 +415,7 @@ type
|
|||||||
property OldFECHA_ALTA : DateTime read GetOldFECHA_ALTAValue;
|
property OldFECHA_ALTA : DateTime read GetOldFECHA_ALTAValue;
|
||||||
property OldFECHA_MODIFICACION : DateTime read GetOldFECHA_MODIFICACIONValue;
|
property OldFECHA_MODIFICACION : DateTime read GetOldFECHA_MODIFICACIONValue;
|
||||||
property OldUSUARIO : String read GetOldUSUARIOValue;
|
property OldUSUARIO : String read GetOldUSUARIOValue;
|
||||||
|
property OldIGNORAR_CONTABILIDAD : SmallInt read GetOldIGNORAR_CONTABILIDADValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPagosClienteBusinessProcessorRules }
|
{ TPagosClienteBusinessProcessorRules }
|
||||||
@ -493,6 +495,12 @@ type
|
|||||||
function GetOldUSUARIOIsNull: Boolean; virtual;
|
function GetOldUSUARIOIsNull: Boolean; virtual;
|
||||||
procedure SetUSUARIOValue(const aValue: String); virtual;
|
procedure SetUSUARIOValue(const aValue: String); virtual;
|
||||||
procedure SetUSUARIOIsNull(const aValue: Boolean); virtual;
|
procedure SetUSUARIOIsNull(const aValue: Boolean); virtual;
|
||||||
|
function GetIGNORAR_CONTABILIDADValue: SmallInt; virtual;
|
||||||
|
function GetIGNORAR_CONTABILIDADIsNull: Boolean; virtual;
|
||||||
|
function GetOldIGNORAR_CONTABILIDADValue: SmallInt; virtual;
|
||||||
|
function GetOldIGNORAR_CONTABILIDADIsNull: Boolean; virtual;
|
||||||
|
procedure SetIGNORAR_CONTABILIDADValue(const aValue: SmallInt); virtual;
|
||||||
|
procedure SetIGNORAR_CONTABILIDADIsNull(const aValue: Boolean); virtual;
|
||||||
|
|
||||||
{ Properties }
|
{ Properties }
|
||||||
property ID : Integer read GetIDValue write SetIDValue;
|
property ID : Integer read GetIDValue write SetIDValue;
|
||||||
@ -543,6 +551,10 @@ type
|
|||||||
property USUARIOIsNull : Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull;
|
property USUARIOIsNull : Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull;
|
||||||
property OldUSUARIO : String read GetOldUSUARIOValue;
|
property OldUSUARIO : String read GetOldUSUARIOValue;
|
||||||
property OldUSUARIOIsNull : Boolean read GetOldUSUARIOIsNull;
|
property OldUSUARIOIsNull : Boolean read GetOldUSUARIOIsNull;
|
||||||
|
property IGNORAR_CONTABILIDAD : SmallInt read GetIGNORAR_CONTABILIDADValue write SetIGNORAR_CONTABILIDADValue;
|
||||||
|
property IGNORAR_CONTABILIDADIsNull : Boolean read GetIGNORAR_CONTABILIDADIsNull write SetIGNORAR_CONTABILIDADIsNull;
|
||||||
|
property OldIGNORAR_CONTABILIDAD : SmallInt read GetOldIGNORAR_CONTABILIDADValue;
|
||||||
|
property OldIGNORAR_CONTABILIDADIsNull : Boolean read GetOldIGNORAR_CONTABILIDADIsNull;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
||||||
@ -552,7 +564,7 @@ type
|
|||||||
|
|
||||||
{ IRecibosCompensadosCliDelta }
|
{ IRecibosCompensadosCliDelta }
|
||||||
IRecibosCompensadosCliDelta = interface(IRecibosCompensadosCli)
|
IRecibosCompensadosCliDelta = interface(IRecibosCompensadosCli)
|
||||||
['{43471651-957E-47B2-B810-E0227C1BB163}']
|
['{46B04689-C995-45CE-B3CA-C602E1142822}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||||
@ -2219,6 +2231,37 @@ begin
|
|||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_PagosClienteUSUARIO] := Null;
|
BusinessProcessor.CurrentChange.NewValueByName[fld_PagosClienteUSUARIO] := Null;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPagosClienteBusinessProcessorRules.GetIGNORAR_CONTABILIDADValue: SmallInt;
|
||||||
|
begin
|
||||||
|
result := BusinessProcessor.CurrentChange.NewValueByName[fld_PagosClienteIGNORAR_CONTABILIDAD];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TPagosClienteBusinessProcessorRules.GetIGNORAR_CONTABILIDADIsNull: Boolean;
|
||||||
|
begin
|
||||||
|
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_PagosClienteIGNORAR_CONTABILIDAD]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TPagosClienteBusinessProcessorRules.GetOldIGNORAR_CONTABILIDADValue: SmallInt;
|
||||||
|
begin
|
||||||
|
result := BusinessProcessor.CurrentChange.OldValueByName[fld_PagosClienteIGNORAR_CONTABILIDAD];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TPagosClienteBusinessProcessorRules.GetOldIGNORAR_CONTABILIDADIsNull: Boolean;
|
||||||
|
begin
|
||||||
|
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_PagosClienteIGNORAR_CONTABILIDAD]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPagosClienteBusinessProcessorRules.SetIGNORAR_CONTABILIDADValue(const aValue: SmallInt);
|
||||||
|
begin
|
||||||
|
BusinessProcessor.CurrentChange.NewValueByName[fld_PagosClienteIGNORAR_CONTABILIDAD] := aValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPagosClienteBusinessProcessorRules.SetIGNORAR_CONTABILIDADIsNull(const aValue: Boolean);
|
||||||
|
begin
|
||||||
|
if aValue then
|
||||||
|
BusinessProcessor.CurrentChange.NewValueByName[fld_PagosClienteIGNORAR_CONTABILIDAD] := Null;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TRecibosCompensadosCliBusinessProcessorRules }
|
{ TRecibosCompensadosCliBusinessProcessorRules }
|
||||||
constructor TRecibosCompensadosCliBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TRecibosCompensadosCliBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
|
|||||||
@ -40,8 +40,11 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TBizPagosCliente = class(TPagosClienteDataTableRules, IBizPagosCliente)
|
TBizPagosCliente = class(TPagosClienteDataTableRules, IBizPagosCliente)
|
||||||
|
private
|
||||||
|
procedure IniciarValoresIBizPagosClienteNuevo;
|
||||||
protected
|
protected
|
||||||
procedure BeforeInsert(Sender: TDADataTable); override;
|
procedure BeforeInsert(Sender: TDADataTable); override;
|
||||||
|
procedure OnNewRecord(Sender: TDADataTable); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -61,6 +64,17 @@ begin
|
|||||||
AMasterTable.Post;
|
AMasterTable.Post;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBizPagosCliente.IniciarValoresIBizPagosClienteNuevo;
|
||||||
|
begin
|
||||||
|
IGNORAR_CONTABILIDAD := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizPagosCliente.OnNewRecord(Sender: TDADataTable);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
IniciarValoresIBizPagosClienteNuevo;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(BIZ_CLIENT_IBIZPAGOSCLIENTE, TBizPagosCliente);
|
RegisterDataTableRules(BIZ_CLIENT_IBIZPAGOSCLIENTE, TBizPagosCliente);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,118 @@
|
|||||||
|
unit uBizPagosClienteServer;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
uDAInterfaces, uDADelta, uDABusinessProcessor,
|
||||||
|
schRecibosClienteServer_Intf;
|
||||||
|
|
||||||
|
const
|
||||||
|
BIZ_SERVER_PAGOS_CLIENTE = 'Server.PagosCliente';
|
||||||
|
|
||||||
|
type
|
||||||
|
TBizPagosClienteServer = class(TPagosClienteBusinessProcessorRules)
|
||||||
|
protected
|
||||||
|
procedure Insert_Asiento_Pago(aChange: TDADeltaChange); virtual;
|
||||||
|
procedure Update_Asiento_Pago(aChange: TDADeltaChange); virtual;
|
||||||
|
procedure Delete_Asiento_Pago(aChange: TDADeltaChange); virtual;
|
||||||
|
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean; var CanRemoveFromDelta: Boolean); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
|
schRecibosClienteClient_Intf;
|
||||||
|
|
||||||
|
{ TBizFacturasClienteServer }
|
||||||
|
|
||||||
|
procedure TBizPagosClienteServer.AfterProcessChange(Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean);
|
||||||
|
begin
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert: begin
|
||||||
|
Insert_Asiento_Pago(aChange);
|
||||||
|
end;
|
||||||
|
ctUpdate: begin
|
||||||
|
Update_Asiento_Pago(aChange);
|
||||||
|
end;
|
||||||
|
ctDelete: begin
|
||||||
|
Delete_Asiento_Pago(aChange);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// No hay que quitar los deltas para que los datos del contacto se
|
||||||
|
// mantengan por si alguna tabla detalle lo necesita
|
||||||
|
// (por ejemplo, DireccionesContacto)
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizPagosClienteServer.Delete_Asiento_Pago(aChange: TDADeltaChange);
|
||||||
|
var
|
||||||
|
ASchema : TDASchema;
|
||||||
|
ACurrentConn : IDAConnection;
|
||||||
|
ACommand : IDASQLCommand;
|
||||||
|
begin
|
||||||
|
ASchema := BusinessProcessor.Schema;
|
||||||
|
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
||||||
|
|
||||||
|
ACommand := ASchema.NewCommand(ACurrentConn, 'Delete_AsientoPago');
|
||||||
|
try
|
||||||
|
with ACommand do
|
||||||
|
begin
|
||||||
|
ParamByName('IdPago').Value := aChange.OldValueByName[fld_PagosClienteID];
|
||||||
|
Execute;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
ACommand := NIL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizPagosClienteServer.Insert_Asiento_Pago(aChange: TDADeltaChange);
|
||||||
|
var
|
||||||
|
ASchema : TDASchema;
|
||||||
|
ACurrentConn : IDAConnection;
|
||||||
|
ACommand : IDASQLCommand;
|
||||||
|
begin
|
||||||
|
ASchema := BusinessProcessor.Schema;
|
||||||
|
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
||||||
|
|
||||||
|
ACommand := ASchema.NewCommand(ACurrentConn, 'Insert_AsientoPago');
|
||||||
|
try
|
||||||
|
with ACommand do
|
||||||
|
begin
|
||||||
|
ParamByName('IdPago').Value := aChange.NewValueByName[fld_PagosClienteID];
|
||||||
|
ParamByName('IdSubCuentaPago').Value := aChange.NewValueByName[fld_PagosClienteCUENTA];
|
||||||
|
Execute;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
ACommand := NIL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizPagosClienteServer.Update_Asiento_Pago(aChange: TDADeltaChange);
|
||||||
|
var
|
||||||
|
ASchema : TDASchema;
|
||||||
|
ACurrentConn : IDAConnection;
|
||||||
|
ACommand : IDASQLCommand;
|
||||||
|
begin
|
||||||
|
ASchema := BusinessProcessor.Schema;
|
||||||
|
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
||||||
|
|
||||||
|
ACommand := ASchema.NewCommand(ACurrentConn, 'Insert_AsientoPago');
|
||||||
|
try
|
||||||
|
with ACommand do
|
||||||
|
begin
|
||||||
|
ParamByName('IdPago').Value := aChange.NewValueByName[fld_PagosClienteID];
|
||||||
|
Execute;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
ACommand := NIL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterBusinessProcessorRules(BIZ_SERVER_PAGOS_CLIENTE, TBizPagosClienteServer);
|
||||||
|
|
||||||
|
end.
|
||||||
@ -9,6 +9,8 @@
|
|||||||
<Projects Include="..\..\Cliente\FactuGES.dproj" />
|
<Projects Include="..\..\Cliente\FactuGES.dproj" />
|
||||||
<Projects Include="..\..\GUIBase\GUIBase.dproj" />
|
<Projects Include="..\..\GUIBase\GUIBase.dproj" />
|
||||||
<Projects Include="..\..\Servidor\FactuGES_Server.dproj" />
|
<Projects Include="..\..\Servidor\FactuGES_Server.dproj" />
|
||||||
|
<Projects Include="..\Contabilidad\Controller\Contabilidad_controller.dproj" />
|
||||||
|
<Projects Include="..\Contactos\Views\Contactos_view.dproj" />
|
||||||
<Projects Include="Controller\RecibosCliente_controller.dproj" />
|
<Projects Include="Controller\RecibosCliente_controller.dproj" />
|
||||||
<Projects Include="Data\RecibosCliente_data.dproj" />
|
<Projects Include="Data\RecibosCliente_data.dproj" />
|
||||||
<Projects Include="Model\RecibosCliente_model.dproj" />
|
<Projects Include="Model\RecibosCliente_model.dproj" />
|
||||||
@ -111,14 +113,32 @@
|
|||||||
<Target Name="FactuGES_Server:Make">
|
<Target Name="FactuGES_Server:Make">
|
||||||
<MSBuild Projects="..\..\Servidor\FactuGES_Server.dproj" Targets="Make" />
|
<MSBuild Projects="..\..\Servidor\FactuGES_Server.dproj" Targets="Make" />
|
||||||
</Target>
|
</Target>
|
||||||
|
<Target Name="Contactos_view">
|
||||||
|
<MSBuild Projects="..\Contactos\Views\Contactos_view.dproj" Targets="" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contactos_view:Clean">
|
||||||
|
<MSBuild Projects="..\Contactos\Views\Contactos_view.dproj" Targets="Clean" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contactos_view:Make">
|
||||||
|
<MSBuild Projects="..\Contactos\Views\Contactos_view.dproj" Targets="Make" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contabilidad_controller">
|
||||||
|
<MSBuild Projects="..\Contabilidad\Controller\Contabilidad_controller.dproj" Targets="" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contabilidad_controller:Clean">
|
||||||
|
<MSBuild Projects="..\Contabilidad\Controller\Contabilidad_controller.dproj" Targets="Clean" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Contabilidad_controller:Make">
|
||||||
|
<MSBuild Projects="..\Contabilidad\Controller\Contabilidad_controller.dproj" Targets="Make" />
|
||||||
|
</Target>
|
||||||
<Target Name="Build">
|
<Target Name="Build">
|
||||||
<CallTarget Targets="Base;GUIBase;ApplicationBase;RecibosCliente_model;RecibosCliente_data;RecibosCliente_controller;RecibosCliente_view;RecibosCliente_plugin;FactuGES;FactuGES_Server" />
|
<CallTarget Targets="Base;GUIBase;ApplicationBase;RecibosCliente_model;RecibosCliente_data;RecibosCliente_controller;RecibosCliente_view;RecibosCliente_plugin;FactuGES;FactuGES_Server;Contactos_view;Contabilidad_controller" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Clean">
|
<Target Name="Clean">
|
||||||
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;RecibosCliente_model:Clean;RecibosCliente_data:Clean;RecibosCliente_controller:Clean;RecibosCliente_view:Clean;RecibosCliente_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean" />
|
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;RecibosCliente_model:Clean;RecibosCliente_data:Clean;RecibosCliente_controller:Clean;RecibosCliente_view:Clean;RecibosCliente_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;Contactos_view:Clean;Contabilidad_controller:Clean" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="Make">
|
<Target Name="Make">
|
||||||
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;RecibosCliente_model:Make;RecibosCliente_data:Make;RecibosCliente_controller:Make;RecibosCliente_view:Make;RecibosCliente_plugin:Make;FactuGES:Make;FactuGES_Server:Make" />
|
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;RecibosCliente_model:Make;RecibosCliente_data:Make;RecibosCliente_controller:Make;RecibosCliente_view:Make;RecibosCliente_plugin:Make;FactuGES:Make;FactuGES_Server:Make;Contactos_view:Make;Contabilidad_controller:Make" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@ -358,6 +358,10 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
item
|
item
|
||||||
DatasetField = 'USUARIO'
|
DatasetField = 'USUARIO'
|
||||||
TableField = 'USUARIO'
|
TableField = 'USUARIO'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
DatasetField = 'IGNORAR_CONTABILIDAD'
|
||||||
|
TableField = 'IGNORAR_CONTABILIDAD'
|
||||||
end>
|
end>
|
||||||
end>
|
end>
|
||||||
Name = 'PagosCliente'
|
Name = 'PagosCliente'
|
||||||
@ -431,6 +435,10 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
DataType = datString
|
DataType = datString
|
||||||
Size = 20
|
Size = 20
|
||||||
DictionaryEntry = 'PagosCliente_USUARIO'
|
DictionaryEntry = 'PagosCliente_USUARIO'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'IGNORAR_CONTABILIDAD'
|
||||||
|
DataType = datSmallInt
|
||||||
end>
|
end>
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
@ -695,6 +703,48 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'IdPago'
|
||||||
|
Value = ''
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL = 'execute procedure proc_delete_asiento_pago :IdPago'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <>
|
||||||
|
end>
|
||||||
|
Name = 'Delete_AsientoPago'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Params = <
|
||||||
|
item
|
||||||
|
Name = 'IdPago'
|
||||||
|
Value = ''
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Name = 'IdSubCuentaPago'
|
||||||
|
Value = ''
|
||||||
|
end>
|
||||||
|
Statements = <
|
||||||
|
item
|
||||||
|
Connection = 'IBX'
|
||||||
|
ConnectionType = 'Interbase'
|
||||||
|
Default = True
|
||||||
|
Name = 'IBX'
|
||||||
|
SQL =
|
||||||
|
'execute procedure proc_new_asiento_pago :IdPago, :IdSubCuentaPag' +
|
||||||
|
'o'#10
|
||||||
|
StatementType = stSQL
|
||||||
|
ColumnMappings = <>
|
||||||
|
end>
|
||||||
|
Name = 'Insert_AsientoPago'
|
||||||
|
end
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
@ -876,68 +926,46 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
DataType = datAutoInc
|
DataType = datAutoInc
|
||||||
GeneratorName = 'GEN_PAGOS_CLIENTE_ID'
|
GeneratorName = 'GEN_PAGOS_CLIENTE_ID'
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'ID_RECIBO'
|
Name = 'ID_RECIBO'
|
||||||
DataType = datInteger
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'TIPO'
|
Name = 'TIPO'
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'FECHA_PAGO'
|
Name = 'FECHA_PAGO'
|
||||||
DataType = datDateTime
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'TITULAR'
|
Name = 'TITULAR'
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'ENTIDAD'
|
Name = 'ENTIDAD'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'SUCURSAL'
|
Name = 'SUCURSAL'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'DC'
|
Name = 'DC'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'CUENTA'
|
Name = 'CUENTA'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'USUARIO'
|
Name = 'USUARIO'
|
||||||
DataType = datString
|
|
||||||
Size = 20
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
end
|
||||||
|
item
|
||||||
|
Name = 'IGNORAR_CONTABILIDAD'
|
||||||
|
Value = ''
|
||||||
end>
|
end>
|
||||||
Statements = <
|
Statements = <
|
||||||
item
|
item
|
||||||
@ -945,9 +973,10 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
TargetTable = 'PAGOS_CLIENTE'
|
TargetTable = 'PAGOS_CLIENTE'
|
||||||
SQL =
|
SQL =
|
||||||
'INSERT'#10' INTO PAGOS_CLIENTE'#10' (ID, ID_RECIBO, TIPO, FECHA_PAGO' +
|
'INSERT'#10' INTO PAGOS_CLIENTE'#10' (ID, ID_RECIBO, TIPO, FECHA_PAGO' +
|
||||||
', TITULAR, ENTIDAD, '#10' SUCURSAL, DC, CUENTA, USUARIO)'#10' VALUE' +
|
', TITULAR, ENTIDAD, '#10' SUCURSAL, DC, CUENTA, USUARIO, IGNORAR' +
|
||||||
'S'#10' (:ID, :ID_RECIBO, :TIPO, :FECHA_PAGO, :TITULAR, :ENTIDAD, ' +
|
'_CONTABILIDAD)'#10' VALUES'#10' (:ID, :ID_RECIBO, :TIPO, :FECHA_PAGO' +
|
||||||
#10' :SUCURSAL, :DC, :CUENTA, :USUARIO)'
|
', :TITULAR, :ENTIDAD, '#10' :SUCURSAL, :DC, :CUENTA, :USUARIO, :' +
|
||||||
|
'IGNORAR_CONTABILIDAD)'#10
|
||||||
StatementType = stSQL
|
StatementType = stSQL
|
||||||
ColumnMappings = <>
|
ColumnMappings = <>
|
||||||
end>
|
end>
|
||||||
@ -975,69 +1004,47 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
Name = 'ID'
|
Name = 'ID'
|
||||||
DataType = datInteger
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'ID_RECIBO'
|
Name = 'ID_RECIBO'
|
||||||
DataType = datInteger
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'TIPO'
|
Name = 'TIPO'
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'FECHA_PAGO'
|
Name = 'FECHA_PAGO'
|
||||||
DataType = datDateTime
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'TITULAR'
|
Name = 'TITULAR'
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'ENTIDAD'
|
Name = 'ENTIDAD'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'SUCURSAL'
|
Name = 'SUCURSAL'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'DC'
|
Name = 'DC'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'CUENTA'
|
Name = 'CUENTA'
|
||||||
DataType = datString
|
|
||||||
Size = 15
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
end
|
||||||
|
item
|
||||||
|
Name = 'IGNORAR_CONTABILIDAD'
|
||||||
|
Value = ''
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'OLD_ID'
|
Name = 'OLD_ID'
|
||||||
DataType = datInteger
|
|
||||||
Value = ''
|
Value = ''
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
end>
|
||||||
Statements = <
|
Statements = <
|
||||||
item
|
item
|
||||||
@ -1047,8 +1054,8 @@ object srvRecibosCliente: TsrvRecibosCliente
|
|||||||
'UPDATE PAGOS_CLIENTE'#10' SET '#10' ID = :ID, '#10' ID_RECIBO = :ID_R' +
|
'UPDATE PAGOS_CLIENTE'#10' SET '#10' ID = :ID, '#10' ID_RECIBO = :ID_R' +
|
||||||
'ECIBO, '#10' TIPO = :TIPO, '#10' FECHA_PAGO = :FECHA_PAGO, '#10' TI' +
|
'ECIBO, '#10' TIPO = :TIPO, '#10' FECHA_PAGO = :FECHA_PAGO, '#10' TI' +
|
||||||
'TULAR = :TITULAR, '#10' ENTIDAD = :ENTIDAD, '#10' SUCURSAL = :SUCU' +
|
'TULAR = :TITULAR, '#10' ENTIDAD = :ENTIDAD, '#10' SUCURSAL = :SUCU' +
|
||||||
'RSAL, '#10' DC = :DC, '#10' CUENTA = :CUENTA'#10' WHERE'#10' (ID = :OL' +
|
'RSAL, '#10' DC = :DC, '#10' CUENTA = :CUENTA,'#10' IGNORAR_CONTABIL' +
|
||||||
'D_ID)'
|
'IDAD = :IGNORAR_CONTABILIDAD'#10' WHERE'#10' (ID = :OLD_ID)'#10
|
||||||
StatementType = stSQL
|
StatementType = stSQL
|
||||||
ColumnMappings = <>
|
ColumnMappings = <>
|
||||||
end>
|
end>
|
||||||
|
|||||||
@ -42,9 +42,9 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Dialogs,
|
Dialogs,
|
||||||
{Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
|
{Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
|
||||||
schRecibosClienteClient_Intf, uRestriccionesUsuarioUtils;
|
schRecibosClienteClient_Intf, uRestriccionesUsuarioUtils, uBizPagosClienteServer;
|
||||||
// uRptRecibosCliente_Server;
|
// uRptRecibosCliente_Server;
|
||||||
//, uBizRecibosClienteServer;
|
|
||||||
|
|
||||||
procedure Create_srvRecibosCliente(out anInstance : IUnknown);
|
procedure Create_srvRecibosCliente(out anInstance : IUnknown);
|
||||||
begin
|
begin
|
||||||
@ -69,6 +69,7 @@ end;
|
|||||||
procedure TsrvRecibosCliente.DARemoteServiceCreate(Sender: TObject);
|
procedure TsrvRecibosCliente.DARemoteServiceCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SessionManager := dmServer.SessionManager;
|
SessionManager := dmServer.SessionManager;
|
||||||
|
bpPagosCliente.BusinessRulesID := BIZ_SERVER_PAGOS_CLIENTE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsrvRecibosCliente.DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
procedure TsrvRecibosCliente.DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
||||||
|
|||||||
@ -3,8 +3,8 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
Top = 0
|
Top = 0
|
||||||
BorderStyle = bsDialog
|
BorderStyle = bsDialog
|
||||||
Caption = 'Fecha del cobro / devoluci'#243'n'
|
Caption = 'Fecha del cobro / devoluci'#243'n'
|
||||||
ClientHeight = 167
|
ClientHeight = 295
|
||||||
ClientWidth = 283
|
ClientWidth = 383
|
||||||
Color = clWindow
|
Color = clWindow
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
@ -13,7 +13,11 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
Font.Style = []
|
Font.Style = []
|
||||||
OldCreateOrder = False
|
OldCreateOrder = False
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
|
OnClose = FormClose
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
|
DesignSize = (
|
||||||
|
383
|
||||||
|
295)
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
@ -26,16 +30,16 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
'la devoluci'#243'n:'
|
'la devoluci'#243'n:'
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
Left = 38
|
Left = 39
|
||||||
Top = 67
|
Top = 67
|
||||||
Width = 33
|
Width = 77
|
||||||
Height = 13
|
Height = 13
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
Caption = 'Fecha:'
|
Caption = 'Fecha del pago:'
|
||||||
FocusControl = eFechaPago
|
FocusControl = eFechaPago
|
||||||
end
|
end
|
||||||
object eFechaPago: TcxDateEdit
|
object eFechaPago: TcxDateEdit
|
||||||
Left = 77
|
Left = 122
|
||||||
Top = 64
|
Top = 64
|
||||||
Properties.OnChange = eFechaPagoPropertiesChange
|
Properties.OnChange = eFechaPagoPropertiesChange
|
||||||
Style.LookAndFeel.Kind = lfStandard
|
Style.LookAndFeel.Kind = lfStandard
|
||||||
@ -51,8 +55,8 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
end
|
end
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 126
|
Top = 254
|
||||||
Width = 283
|
Width = 383
|
||||||
Height = 41
|
Height = 41
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -64,6 +68,7 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
Caption = 'Aceptar'
|
Caption = 'Aceptar'
|
||||||
ModalResult = 1
|
ModalResult = 1
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
|
OnClick = bAceptarClick
|
||||||
end
|
end
|
||||||
object bCancelar: TButton
|
object bCancelar: TButton
|
||||||
Left = 200
|
Left = 200
|
||||||
@ -75,4 +80,81 @@ object fEditorFechaPago: TfEditorFechaPago
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object eContabilizar: TcxCheckBox
|
||||||
|
Left = 38
|
||||||
|
Top = 120
|
||||||
|
Caption = 'Ignorar en contabiliad'
|
||||||
|
Properties.ValueChecked = 1
|
||||||
|
Properties.ValueUnchecked = 0
|
||||||
|
Properties.OnChange = eContabilizarPropertiesChange
|
||||||
|
TabOrder = 2
|
||||||
|
Width = 203
|
||||||
|
end
|
||||||
|
object eRefSubCuenta: TcxTextEdit
|
||||||
|
Left = 39
|
||||||
|
Top = 147
|
||||||
|
Anchors = [akLeft, akTop, akRight]
|
||||||
|
AutoSize = False
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.ValidateOnEnter = True
|
||||||
|
Style.BorderColor = clWindowFrame
|
||||||
|
Style.BorderStyle = ebs3D
|
||||||
|
Style.Color = 14745599
|
||||||
|
Style.HotTrack = False
|
||||||
|
Style.LookAndFeel.NativeStyle = True
|
||||||
|
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||||
|
StyleFocused.LookAndFeel.NativeStyle = True
|
||||||
|
StyleHot.LookAndFeel.NativeStyle = True
|
||||||
|
TabOrder = 3
|
||||||
|
Height = 21
|
||||||
|
Width = 215
|
||||||
|
end
|
||||||
|
object eSubCuenta: TcxTextEdit
|
||||||
|
Left = 38
|
||||||
|
Top = 174
|
||||||
|
Anchors = [akLeft, akTop, akRight]
|
||||||
|
AutoSize = False
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.ValidateOnEnter = True
|
||||||
|
Style.BorderColor = clWindowFrame
|
||||||
|
Style.BorderStyle = ebs3D
|
||||||
|
Style.Color = 14745599
|
||||||
|
Style.HotTrack = False
|
||||||
|
Style.LookAndFeel.NativeStyle = True
|
||||||
|
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||||
|
StyleFocused.LookAndFeel.NativeStyle = True
|
||||||
|
StyleHot.LookAndFeel.NativeStyle = True
|
||||||
|
TabOrder = 4
|
||||||
|
Height = 21
|
||||||
|
Width = 297
|
||||||
|
end
|
||||||
|
object BitBtn3: TBitBtn
|
||||||
|
Left = 260
|
||||||
|
Top = 143
|
||||||
|
Width = 75
|
||||||
|
Height = 25
|
||||||
|
Caption = 'Elegir subcuenta'
|
||||||
|
TabOrder = 5
|
||||||
|
OnClick = BitBtn3Click
|
||||||
|
end
|
||||||
|
object eIDSubcuenta: TcxTextEdit
|
||||||
|
Left = 38
|
||||||
|
Top = 201
|
||||||
|
Anchors = [akLeft, akTop, akRight]
|
||||||
|
AutoSize = False
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.ValidateOnEnter = True
|
||||||
|
Properties.OnChange = eIDSubcuentaPropertiesChange
|
||||||
|
Style.BorderColor = clWindowFrame
|
||||||
|
Style.BorderStyle = ebs3D
|
||||||
|
Style.Color = 14745599
|
||||||
|
Style.HotTrack = False
|
||||||
|
Style.LookAndFeel.NativeStyle = True
|
||||||
|
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||||
|
StyleFocused.LookAndFeel.NativeStyle = True
|
||||||
|
StyleHot.LookAndFeel.NativeStyle = True
|
||||||
|
TabOrder = 6
|
||||||
|
Height = 21
|
||||||
|
Width = 43
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,7 +5,8 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||||
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago;
|
cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago,
|
||||||
|
cxCheckBox, uSubCuentasController, Buttons, cxDBEdit;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago)
|
TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago)
|
||||||
@ -15,14 +16,35 @@ type
|
|||||||
bCancelar: TButton;
|
bCancelar: TButton;
|
||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
|
eContabilizar: TcxCheckBox;
|
||||||
|
eRefSubCuenta: TcxTextEdit;
|
||||||
|
eSubCuenta: TcxTextEdit;
|
||||||
|
BitBtn3: TBitBtn;
|
||||||
|
eIDSubcuenta: TcxTextEdit;
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
procedure eFechaPagoPropertiesChange(Sender: TObject);
|
||||||
|
procedure eContabilizarPropertiesChange(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure BitBtn3Click(Sender: TObject);
|
||||||
|
procedure eIDSubcuentaPropertiesChange(Sender: TObject);
|
||||||
|
procedure bAceptarClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
FController : ISubcuentasController;
|
||||||
|
FIdSubCuenta : Integer;
|
||||||
|
FIgnorarContabilidad : Integer;
|
||||||
FFechaPago : TDateTime;
|
FFechaPago : TDateTime;
|
||||||
function GetFechaPago: TDateTime;
|
function GetFechaPago: TDateTime;
|
||||||
procedure SetFechaPago(const Value: TDateTime);
|
procedure SetFechaPago(const Value: TDateTime);
|
||||||
|
function GetIgnorarContabilidad: Integer;
|
||||||
|
procedure SetIgnorarContabilidad(const Value: Integer);
|
||||||
|
function GetIdSubCuenta: Integer;
|
||||||
|
procedure SetIdSubCuenta(const Value: Integer);
|
||||||
|
|
||||||
public
|
public
|
||||||
property FechaPago: TDateTime Read GetFechaPago write SetFechaPago;
|
property FechaPago: TDateTime Read GetFechaPago write SetFechaPago;
|
||||||
|
property IgnorarContabilidad: Integer Read GetIgnorarContabilidad write SetIgnorarContabilidad;
|
||||||
|
property IdSubCuenta: Integer Read GetIdSubCuenta write SetIdSubCuenta;
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -32,14 +54,59 @@ implementation
|
|||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
|
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á 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;
|
||||||
|
|
||||||
procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject);
|
procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FechaPago := eFechaPago.Date;
|
FechaPago := eFechaPago.Date;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfEditorFechaPago.eIDSubcuentaPropertiesChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not VarIsNull(eIDSubCuenta.EditValue) then
|
||||||
|
FIDSubCuenta := eIDSubCuenta.EditValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfEditorFechaPago.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
FController := Nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfEditorFechaPago.FormShow(Sender: TObject);
|
procedure TfEditorFechaPago.FormShow(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
eFechaPago.Date := Date;
|
if (length(eFechaPago.Text) = 0) then
|
||||||
|
eFechaPago.Date := Date;
|
||||||
|
// FController.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfEditorFechaPago.GetFechaPago: TDateTime;
|
function TfEditorFechaPago.GetFechaPago: TDateTime;
|
||||||
@ -47,9 +114,31 @@ begin
|
|||||||
Result := FFechaPago;
|
Result := FFechaPago;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TfEditorFechaPago.GetIdSubCuenta: Integer;
|
||||||
|
begin
|
||||||
|
Result := eIDSubCuenta.EditValue; //FIdSubCuenta;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfEditorFechaPago.GetIgnorarContabilidad: Integer;
|
||||||
|
begin
|
||||||
|
Result := FIgnorarContabilidad;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime);
|
||||||
begin
|
begin
|
||||||
FFechaPago := Value;
|
FFechaPago := Value;
|
||||||
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -324,8 +324,6 @@ inherited fEditorReciboCliente: TfEditorReciboCliente
|
|||||||
inherited eImporte: TcxDBCurrencyEdit
|
inherited eImporte: TcxDBCurrencyEdit
|
||||||
DataBinding.DataSource = dsDataTable
|
DataBinding.DataSource = dsDataTable
|
||||||
Properties.OnEditValueChanged = frViewReciboCliImportes1eImportePropertiesEditValueChanged
|
Properties.OnEditValueChanged = frViewReciboCliImportes1eImportePropertiesEditValueChanged
|
||||||
ExplicitWidth = 150
|
|
||||||
Width = 150
|
|
||||||
end
|
end
|
||||||
inherited eOtrosGastos: TcxDBCurrencyEdit
|
inherited eOtrosGastos: TcxDBCurrencyEdit
|
||||||
DataBinding.DataSource = dsDataTable
|
DataBinding.DataSource = dsDataTable
|
||||||
|
|||||||
@ -9,19 +9,11 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_darReferencia = '{2A669FBE-2DE4-4257-8CA5-518E3E7FE0A3}';
|
RID_RemesasCliente = '{A346376B-965B-4865-A253-9DDF4D88E9C5}';
|
||||||
RID_RemesasCliente = '{6AD59CC0-CB4B-4B42-87E9-0C30BF117732}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_darReferencia = 'darReferencia';
|
|
||||||
nme_RemesasCliente = 'RemesasCliente';
|
nme_RemesasCliente = 'RemesasCliente';
|
||||||
|
|
||||||
{ darReferencia fields }
|
|
||||||
fld_darReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ darReferencia field indexes }
|
|
||||||
idx_darReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ RemesasCliente fields }
|
{ RemesasCliente fields }
|
||||||
fld_RemesasClienteID = 'ID';
|
fld_RemesasClienteID = 'ID';
|
||||||
fld_RemesasClienteID_EMPRESA = 'ID_EMPRESA';
|
fld_RemesasClienteID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -63,44 +55,9 @@ const
|
|||||||
idx_RemesasClienteIMPORTE_TOTAL = 17;
|
idx_RemesasClienteIMPORTE_TOTAL = 17;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IdarReferencia }
|
|
||||||
IdarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{41ABA49E-1EC4-40B5-8174-E851C8735EF6}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TdarReferenciaDataTableRules }
|
|
||||||
TdarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IdarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IRemesasCliente }
|
{ IRemesasCliente }
|
||||||
IRemesasCliente = interface(IDAStronglyTypedDataTable)
|
IRemesasCliente = interface(IDAStronglyTypedDataTable)
|
||||||
['{2DFC502B-A484-4565-BFCB-F4A172BBF594}']
|
['{FDEB4748-8F61-4BFF-BED3-8A4904D1F593}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -341,39 +298,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TdarReferenciaDataTableRules }
|
|
||||||
constructor TdarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TdarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_darReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_darReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_darReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_darReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TRemesasClienteDataTableRules }
|
{ TRemesasClienteDataTableRules }
|
||||||
constructor TRemesasClienteDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TRemesasClienteDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
begin
|
begin
|
||||||
@ -765,7 +689,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_darReferencia, TdarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_RemesasCliente, TRemesasClienteDataTableRules);
|
RegisterDataTableRules(RID_RemesasCliente, TRemesasClienteDataTableRules);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -9,47 +9,12 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_darReferenciaDelta = '{93BE415A-B388-496F-B435-1AA6D4F3535C}';
|
RID_RemesasClienteDelta = '{F8C1BED7-3DDB-4A8B-9E23-7ACFF1822443}';
|
||||||
RID_RemesasClienteDelta = '{090FFD4E-3541-40D8-9577-9A6BBB35ECEB}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IdarReferenciaDelta }
|
|
||||||
IdarReferenciaDelta = interface(IdarReferencia)
|
|
||||||
['{93BE415A-B388-496F-B435-1AA6D4F3535C}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TdarReferenciaBusinessProcessorRules }
|
|
||||||
TdarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IdarReferencia, IdarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IRemesasClienteDelta }
|
{ IRemesasClienteDelta }
|
||||||
IRemesasClienteDelta = interface(IRemesasCliente)
|
IRemesasClienteDelta = interface(IRemesasCliente)
|
||||||
['{090FFD4E-3541-40D8-9577-9A6BBB35ECEB}']
|
['{F8C1BED7-3DDB-4A8B-9E23-7ACFF1822443}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -290,49 +255,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TdarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TdarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TdarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_darReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_darReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TRemesasClienteBusinessProcessorRules }
|
{ TRemesasClienteBusinessProcessorRules }
|
||||||
constructor TRemesasClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TRemesasClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
begin
|
begin
|
||||||
@ -904,7 +826,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_darReferenciaDelta, TdarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_RemesasClienteDelta, TRemesasClienteBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_RemesasClienteDelta, TRemesasClienteBusinessProcessorRules);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -8,70 +8,91 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_REMESAS_CLIENTE = 'Server.RemesasCliente';
|
BIZ_SERVER_REMESAS_CLIENTE = 'Server.RemesasCliente';
|
||||||
REF_REMESAS_CLIENTE = 'REF_REMESAS_CLIENTE';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizRemesasClienteServer = class(TRemesasClienteBusinessProcessorRules)
|
TBizRemesasClienteServer = class(TRemesasClienteBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor;
|
||||||
|
const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor;
|
||||||
|
aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schRemesasClienteClient_Intf;
|
schRemesasClienteClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_REMESAS_CLIENTE = 'REF_REMESAS_CLIENTE';
|
||||||
|
|
||||||
{ TBizRemesasClienteServer }
|
{ TBizRemesasClienteServer }
|
||||||
|
|
||||||
|
procedure TBizRemesasClienteServer.AfterProcessChange(
|
||||||
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TBizRemesasClienteServer.BeforeProcessDelta(
|
procedure TBizRemesasClienteServer.BeforeProcessDelta(
|
||||||
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
var
|
|
||||||
ASchema : TDASchema;
|
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_RemesasClienteREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_RemesasClienteREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_RemesasClienteID_EMPRESA];
|
|
||||||
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_REMESAS_CLIENTE, Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + REF_REMESAS_CLIENTE + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName('VALOR').AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'ID_EMPRESA'], [REF_Remesas_CLIENTE, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBizRemesasClienteServer.DarReferencia: String;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(REF_REMESAS_CLIENTE, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBizRemesasClienteServer.IncrementarReferencia: Boolean;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(REF_REMESAS_CLIENTE,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_REMESAS_CLIENTE, TBizRemesasClienteServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_REMESAS_CLIENTE, TBizRemesasClienteServer);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
@ -136,42 +136,6 @@ object srvRemesasCliente: TsrvRemesasCliente
|
|||||||
DataDictionary = DataDictionary
|
DataDictionary = DataDictionary
|
||||||
Diagrams = Diagrams
|
Diagrams = Diagrams
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
DataType = datString
|
|
||||||
Size = 50
|
|
||||||
Value = 'REF_REMESAS_CLIENTE'
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = '1'
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT VALOR'#10'FROM REFERENCIAS'#10'WHERE CODIGO = :CODIGO'#10'AND ID_EMPR' +
|
|
||||||
'ESA = :EMPRESA'
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'darReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -363,32 +327,6 @@ object srvRemesasCliente: TsrvRemesasCliente
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -23,9 +23,9 @@ type
|
|||||||
TsrvRemesasCliente = class(TDataAbstractService, IsrvRemesasCliente)
|
TsrvRemesasCliente = class(TDataAbstractService, IsrvRemesasCliente)
|
||||||
Diagrams: TDADiagrams;
|
Diagrams: TDADiagrams;
|
||||||
bpRemesasCliente: TDABusinessProcessor;
|
bpRemesasCliente: TDABusinessProcessor;
|
||||||
|
Bin2DataStreamer: TDABin2DataStreamer;
|
||||||
schRemesasCliente: TDASchema;
|
schRemesasCliente: TDASchema;
|
||||||
DataDictionary: TDADataDictionary;
|
DataDictionary: TDADataDictionary;
|
||||||
Bin2DataStreamer: TDABin2DataStreamer;
|
|
||||||
procedure DARemoteServiceCreate(Sender: TObject);
|
procedure DARemoteServiceCreate(Sender: TObject);
|
||||||
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
||||||
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
||||||
@ -42,7 +42,7 @@ implementation
|
|||||||
uses
|
uses
|
||||||
{Generated:} FactuGES_Invk, uDataModuleServer,
|
{Generated:} FactuGES_Invk, uDataModuleServer,
|
||||||
uDatabaseUtils, schRemesasClienteClient_Intf, uRestriccionesUsuarioUtils,
|
uDatabaseUtils, schRemesasClienteClient_Intf, uRestriccionesUsuarioUtils,
|
||||||
// uBizRemesasClienteServer,
|
uBizRemesasClienteServer,
|
||||||
// uRptRemesasCliente_Server,
|
// uRptRemesasCliente_Server,
|
||||||
Dialogs;
|
Dialogs;
|
||||||
|
|
||||||
@ -57,21 +57,19 @@ procedure TsrvRemesasCliente.DARemoteServiceBeforeGetDatasetData(
|
|||||||
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
||||||
const MaxRecords: Integer);
|
const MaxRecords: Integer);
|
||||||
begin
|
begin
|
||||||
{
|
|
||||||
if DataSet.Name = nme_RemesasCliente then
|
if DataSet.Name = nme_RemesasCliente then
|
||||||
begin
|
begin
|
||||||
{ Aquí se asegura que el usuario sólo accede a los RemesasCliente
|
{ Aquí se asegura que el usuario sólo accede a los RemesasCliente
|
||||||
de las empresas a las que tiene permiso para acceder
|
de las empresas a las que tiene permiso para acceder
|
||||||
filtrando DataSet por ID_EMPRESA. }
|
filtrando DataSet por ID_EMPRESA. }
|
||||||
{ FiltrarAccesoUsuario(Session, Connection, schRemesasCliente, DataSet, fld_RemesasClienteID_EMPRESA);
|
FiltrarAccesoUsuario(Session, Connection, schRemesasCliente, DataSet, fld_RemesasClienteID_EMPRESA);
|
||||||
end;
|
end;
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsrvRemesasCliente.DARemoteServiceCreate(Sender: TObject);
|
procedure TsrvRemesasCliente.DARemoteServiceCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SessionManager := dmServer.SessionManager;
|
SessionManager := dmServer.SessionManager;
|
||||||
// bpRemesasCliente.BusinessRulesID := BIZ_SERVER_REMESAS_CLIENTE;
|
bpRemesasCliente.BusinessRulesID := BIZ_SERVER_REMESAS_CLIENTE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsrvRemesasCliente.DataAbstractServiceBeforeAcquireConnection(
|
procedure TsrvRemesasCliente.DataAbstractServiceBeforeAcquireConnection(
|
||||||
|
|||||||
@ -9,19 +9,11 @@ const
|
|||||||
{ Data table rules ids
|
{ Data table rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_darReferencia = '{60F91383-6F77-4AD3-9E84-B27C782A1482}';
|
RID_RemesasProveedor = '{23D3FD39-C8A1-424C-A738-908158D36ED1}';
|
||||||
RID_RemesasProveedor = '{044A9E1D-90AB-4E1C-BFCB-98772BB603BE}';
|
|
||||||
|
|
||||||
{ Data table names }
|
{ Data table names }
|
||||||
nme_darReferencia = 'darReferencia';
|
|
||||||
nme_RemesasProveedor = 'RemesasProveedor';
|
nme_RemesasProveedor = 'RemesasProveedor';
|
||||||
|
|
||||||
{ darReferencia fields }
|
|
||||||
fld_darReferenciaVALOR = 'VALOR';
|
|
||||||
|
|
||||||
{ darReferencia field indexes }
|
|
||||||
idx_darReferenciaVALOR = 0;
|
|
||||||
|
|
||||||
{ RemesasProveedor fields }
|
{ RemesasProveedor fields }
|
||||||
fld_RemesasProveedorID = 'ID';
|
fld_RemesasProveedorID = 'ID';
|
||||||
fld_RemesasProveedorID_EMPRESA = 'ID_EMPRESA';
|
fld_RemesasProveedorID_EMPRESA = 'ID_EMPRESA';
|
||||||
@ -63,44 +55,9 @@ const
|
|||||||
idx_RemesasProveedorIMPORTE_TOTAL = 17;
|
idx_RemesasProveedorIMPORTE_TOTAL = 17;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IdarReferencia }
|
|
||||||
IdarReferencia = interface(IDAStronglyTypedDataTable)
|
|
||||||
['{3EC7EB36-5C81-4D96-924C-BFBAD8D38041}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String;
|
|
||||||
procedure SetVALORValue(const aValue: String);
|
|
||||||
function GetVALORIsNull: Boolean;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean);
|
|
||||||
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TdarReferenciaDataTableRules }
|
|
||||||
TdarReferenciaDataTableRules = class(TIntfObjectDADataTableRules, IdarReferencia)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR: String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aDataTable: TDADataTable); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IRemesasProveedor }
|
{ IRemesasProveedor }
|
||||||
IRemesasProveedor = interface(IDAStronglyTypedDataTable)
|
IRemesasProveedor = interface(IDAStronglyTypedDataTable)
|
||||||
['{33E0651A-D061-431F-9EAD-9B9B0458B888}']
|
['{7A79CD94-9A3A-4E75-89AD-C1D0A728A7F5}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetIDValue: Integer;
|
function GetIDValue: Integer;
|
||||||
procedure SetIDValue(const aValue: Integer);
|
procedure SetIDValue(const aValue: Integer);
|
||||||
@ -341,39 +298,6 @@ implementation
|
|||||||
|
|
||||||
uses Variants, uROBinaryHelpers;
|
uses Variants, uROBinaryHelpers;
|
||||||
|
|
||||||
{ TdarReferenciaDataTableRules }
|
|
||||||
constructor TdarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TdarReferenciaDataTableRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaDataTableRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_darReferenciaVALOR].AsString;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaDataTableRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
DataTable.Fields[idx_darReferenciaVALOR].AsString := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaDataTableRules.GetVALORIsNull: boolean;
|
|
||||||
begin
|
|
||||||
result := DataTable.Fields[idx_darReferenciaVALOR].IsNull;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaDataTableRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
DataTable.Fields[idx_darReferenciaVALOR].AsVariant := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TRemesasProveedorDataTableRules }
|
{ TRemesasProveedorDataTableRules }
|
||||||
constructor TRemesasProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
constructor TRemesasProveedorDataTableRules.Create(aDataTable: TDADataTable);
|
||||||
begin
|
begin
|
||||||
@ -765,7 +689,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterDataTableRules(RID_darReferencia, TdarReferenciaDataTableRules);
|
|
||||||
RegisterDataTableRules(RID_RemesasProveedor, TRemesasProveedorDataTableRules);
|
RegisterDataTableRules(RID_RemesasProveedor, TRemesasProveedorDataTableRules);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -9,47 +9,12 @@ const
|
|||||||
{ Delta rules ids
|
{ Delta rules ids
|
||||||
Feel free to change them to something more human readable
|
Feel free to change them to something more human readable
|
||||||
but make sure they are unique in the context of your application }
|
but make sure they are unique in the context of your application }
|
||||||
RID_darReferenciaDelta = '{654CD172-ED14-43A0-85CD-7D5714EF6CA6}';
|
RID_RemesasProveedorDelta = '{D08A9960-77D0-4CFF-95F2-209EA3322B70}';
|
||||||
RID_RemesasProveedorDelta = '{66615F2E-3E7A-49C6-AE86-A922790A3D92}';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ IdarReferenciaDelta }
|
|
||||||
IdarReferenciaDelta = interface(IdarReferencia)
|
|
||||||
['{654CD172-ED14-43A0-85CD-7D5714EF6CA6}']
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetOldVALORValue : String;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TdarReferenciaBusinessProcessorRules }
|
|
||||||
TdarReferenciaBusinessProcessorRules = class(TDABusinessProcessorRules, IdarReferencia, IdarReferenciaDelta)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
{ Property getters and setters }
|
|
||||||
function GetVALORValue: String; virtual;
|
|
||||||
function GetVALORIsNull: Boolean; virtual;
|
|
||||||
function GetOldVALORValue: String; virtual;
|
|
||||||
function GetOldVALORIsNull: Boolean; virtual;
|
|
||||||
procedure SetVALORValue(const aValue: String); virtual;
|
|
||||||
procedure SetVALORIsNull(const aValue: Boolean); virtual;
|
|
||||||
|
|
||||||
{ Properties }
|
|
||||||
property VALOR : String read GetVALORValue write SetVALORValue;
|
|
||||||
property VALORIsNull : Boolean read GetVALORIsNull write SetVALORIsNull;
|
|
||||||
property OldVALOR : String read GetOldVALORValue;
|
|
||||||
property OldVALORIsNull : Boolean read GetOldVALORIsNull;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ IRemesasProveedorDelta }
|
{ IRemesasProveedorDelta }
|
||||||
IRemesasProveedorDelta = interface(IRemesasProveedor)
|
IRemesasProveedorDelta = interface(IRemesasProveedor)
|
||||||
['{66615F2E-3E7A-49C6-AE86-A922790A3D92}']
|
['{D08A9960-77D0-4CFF-95F2-209EA3322B70}']
|
||||||
{ Property getters and setters }
|
{ Property getters and setters }
|
||||||
function GetOldIDValue : Integer;
|
function GetOldIDValue : Integer;
|
||||||
function GetOldID_EMPRESAValue : Integer;
|
function GetOldID_EMPRESAValue : Integer;
|
||||||
@ -290,49 +255,6 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Variants, uROBinaryHelpers, uDAInterfaces;
|
Variants, uROBinaryHelpers, uDAInterfaces;
|
||||||
|
|
||||||
{ TdarReferenciaBusinessProcessorRules }
|
|
||||||
constructor TdarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TdarReferenciaBusinessProcessorRules.Destroy;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetOldVALORValue: String;
|
|
||||||
begin
|
|
||||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_darReferenciaVALOR];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TdarReferenciaBusinessProcessorRules.GetOldVALORIsNull: Boolean;
|
|
||||||
begin
|
|
||||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_darReferenciaVALOR]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaBusinessProcessorRules.SetVALORValue(const aValue: String);
|
|
||||||
begin
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR] := aValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TdarReferenciaBusinessProcessorRules.SetVALORIsNull(const aValue: Boolean);
|
|
||||||
begin
|
|
||||||
if aValue then
|
|
||||||
BusinessProcessor.CurrentChange.NewValueByName[fld_darReferenciaVALOR] := Null;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TRemesasProveedorBusinessProcessorRules }
|
{ TRemesasProveedorBusinessProcessorRules }
|
||||||
constructor TRemesasProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
constructor TRemesasProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||||
begin
|
begin
|
||||||
@ -904,7 +826,6 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(RID_darReferenciaDelta, TdarReferenciaBusinessProcessorRules);
|
|
||||||
RegisterBusinessProcessorRules(RID_RemesasProveedorDelta, TRemesasProveedorBusinessProcessorRules);
|
RegisterBusinessProcessorRules(RID_RemesasProveedorDelta, TRemesasProveedorBusinessProcessorRules);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -8,68 +8,90 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
BIZ_SERVER_REMESAS_Proveedor = 'Server.RemesasProveedor';
|
BIZ_SERVER_REMESAS_Proveedor = 'Server.RemesasProveedor';
|
||||||
REF_REMESAS_PROVEEDOR = 'REF_REMESAS_PROVEEDOR';
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TBizRemesasProveedorServer = class(TRemesasProveedorBusinessProcessorRules)
|
TBizRemesasProveedorServer = class(TRemesasProveedorBusinessProcessorRules)
|
||||||
|
private
|
||||||
|
FReferenciaAutomatica : Boolean;
|
||||||
|
function DarReferencia : String;
|
||||||
|
function IncrementarReferencia : Boolean;
|
||||||
protected
|
protected
|
||||||
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override;
|
||||||
|
procedure AfterProcessChange(Sender: TDABusinessProcessor;
|
||||||
|
aChange: TDADeltaChange; Processed: Boolean;
|
||||||
|
var CanRemoveFromDelta: Boolean);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
schRemesasProveedorClient_Intf;
|
schRemesasProveedorClient_Intf, srvReferencias_Impl;
|
||||||
|
|
||||||
|
const
|
||||||
|
REF_REMESAS_PROVEEDOR = 'REF_REMESAS_PROVEEDOR';
|
||||||
|
|
||||||
{ TBizRemesasProveedorServer }
|
{ TBizRemesasProveedorServer }
|
||||||
|
|
||||||
procedure TBizRemesasProveedorServer.BeforeProcessDelta(
|
procedure TBizRemesasProveedorServer.AfterProcessChange(
|
||||||
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
Sender: TDABusinessProcessor; aChange: TDADeltaChange; Processed: Boolean;
|
||||||
var
|
var CanRemoveFromDelta: Boolean);
|
||||||
ASchema : TDASchema;
|
|
||||||
ACurrentConn : IDAConnection;
|
|
||||||
dsData: IDADataset;
|
|
||||||
Empresa : Variant;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
|
{ Por defecto, mantenemos los deltas por si alguna tabla hija los necesita }
|
||||||
|
CanRemoveFromDelta := False;
|
||||||
|
|
||||||
|
case aChange.ChangeType of
|
||||||
|
ctInsert, ctUpdate: begin
|
||||||
|
if FReferenciaAutomatica then
|
||||||
|
begin
|
||||||
|
IncrementarReferencia;
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBizRemesasProveedorServer.BeforeProcessDelta(
|
||||||
|
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
begin
|
||||||
|
FReferenciaAutomatica := False;
|
||||||
|
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si la referencia no ha sido asignada le asignamos una nosotros
|
//Si la referencia no ha sido asignada le asignamos una nosotros
|
||||||
if (VarIsNull(Sender.CurrentChange.NewValueByName[fld_RemesasProveedorREFERENCIA]))
|
if REFERENCIAIsNull or (Length(REFERENCIA) = 0) then
|
||||||
or (VarToStr(Sender.CurrentChange.NewValueByName[fld_RemesasProveedorREFERENCIA]) = '') then
|
|
||||||
begin
|
begin
|
||||||
ASchema := BusinessProcessor.Schema;
|
FReferenciaAutomatica := True;
|
||||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
REFERENCIA := DarReferencia;
|
||||||
|
|
||||||
try
|
|
||||||
//Siempre va a estar rellena
|
|
||||||
Empresa := Sender.CurrentChange.NewValueByName[fld_RemesasProveedorID_EMPRESA];
|
|
||||||
|
|
||||||
dsData := ASchema.NewDataset(ACurrentConn, 'DarReferencia', ['CODIGO', 'EMPRESA'], [REF_REMESAS_PROVEEDOR, Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('No existe la tabla REFERENCIAS');
|
|
||||||
end;
|
|
||||||
|
|
||||||
dsData.Active := True;
|
|
||||||
|
|
||||||
if dsData.IsEmpty then
|
|
||||||
RaiseError('NO HAY REFERENCIA ' + REF_REMESAS_PROVEEDOR + ' DECLARADA EN TABLA REFERENCIAS');
|
|
||||||
|
|
||||||
REFERENCIA := dsData.FieldByName('VALOR').AsString;
|
|
||||||
|
|
||||||
try
|
|
||||||
ASchema.NewCommand(ACurrentConn, 'ModificarReferencia', ['CODIGO', 'VALOR', 'ID_EMPRESA'], [REF_REMESAS_PROVEEDOR, DarReferenciaSiguiente(REFERENCIA), Empresa]);
|
|
||||||
except
|
|
||||||
RaiseError('Error al asignar la nueva ' + REFERENCIA + ' referencia en tabla');
|
|
||||||
end;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TBizRemesasProveedorServer.DarReferencia: String;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := DarNuevaReferencia(REF_REMESAS_PROVEEDOR, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBizRemesasProveedorServer.IncrementarReferencia: Boolean;
|
||||||
|
begin
|
||||||
|
with TsrvReferencias.Create(NIL) do
|
||||||
|
try
|
||||||
|
Result := IncrementarValorReferencia(REF_REMESAS_PROVEEDOR,
|
||||||
|
Self.REFERENCIA, ID_EMPRESA)
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterBusinessProcessorRules(BIZ_SERVER_REMESAS_Proveedor, TBizRemesasProveedorServer);
|
RegisterBusinessProcessorRules(BIZ_SERVER_REMESAS_Proveedor, TBizRemesasProveedorServer);
|
||||||
|
|
||||||
|
|||||||
@ -136,42 +136,6 @@ object srvRemesasProveedor: TsrvRemesasProveedor
|
|||||||
DataDictionary = DataDictionary
|
DataDictionary = DataDictionary
|
||||||
Diagrams = Diagrams
|
Diagrams = Diagrams
|
||||||
Datasets = <
|
Datasets = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
DataType = datString
|
|
||||||
Size = 50
|
|
||||||
Value = 'REF_REMESAS_CLIENTE'
|
|
||||||
ParamType = daptInput
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = '1'
|
|
||||||
ParamType = daptInput
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'SELECT VALOR'#10'FROM REFERENCIAS'#10'WHERE CODIGO = :CODIGO'#10'AND ID_EMPR' +
|
|
||||||
'ESA = :EMPRESA'
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <
|
|
||||||
item
|
|
||||||
DatasetField = 'VALOR'
|
|
||||||
TableField = 'VALOR'
|
|
||||||
end>
|
|
||||||
end>
|
|
||||||
Name = 'darReferencia'
|
|
||||||
Fields = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
DataType = datString
|
|
||||||
Size = 255
|
|
||||||
end>
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <>
|
Params = <>
|
||||||
Statements = <
|
Statements = <
|
||||||
@ -363,32 +327,6 @@ object srvRemesasProveedor: TsrvRemesasProveedor
|
|||||||
JoinDataTables = <>
|
JoinDataTables = <>
|
||||||
UnionDataTables = <>
|
UnionDataTables = <>
|
||||||
Commands = <
|
Commands = <
|
||||||
item
|
|
||||||
Params = <
|
|
||||||
item
|
|
||||||
Name = 'VALOR'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'CODIGO'
|
|
||||||
Value = ''
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Name = 'EMPRESA'
|
|
||||||
Value = ''
|
|
||||||
end>
|
|
||||||
Statements = <
|
|
||||||
item
|
|
||||||
Connection = 'IBX'
|
|
||||||
TargetTable = 'REFERENCIAS'
|
|
||||||
SQL =
|
|
||||||
'UPDATE REFERENCIAS SET'#10' VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
|
|
||||||
'IGO AND'#10' ID_EMPRESA = :EMPRESA'#10
|
|
||||||
StatementType = stSQL
|
|
||||||
ColumnMappings = <>
|
|
||||||
end>
|
|
||||||
Name = 'ModificarReferencia'
|
|
||||||
end
|
|
||||||
item
|
item
|
||||||
Params = <
|
Params = <
|
||||||
item
|
item
|
||||||
|
|||||||
@ -23,9 +23,9 @@ type
|
|||||||
TsrvRemesasProveedor = class(TDataAbstractService, IsrvRemesasProveedor)
|
TsrvRemesasProveedor = class(TDataAbstractService, IsrvRemesasProveedor)
|
||||||
Diagrams: TDADiagrams;
|
Diagrams: TDADiagrams;
|
||||||
bpRemesasProveedor: TDABusinessProcessor;
|
bpRemesasProveedor: TDABusinessProcessor;
|
||||||
|
Bin2DataStreamer: TDABin2DataStreamer;
|
||||||
schRemesasProveedor: TDASchema;
|
schRemesasProveedor: TDASchema;
|
||||||
DataDictionary: TDADataDictionary;
|
DataDictionary: TDADataDictionary;
|
||||||
Bin2DataStreamer: TDABin2DataStreamer;
|
|
||||||
procedure DARemoteServiceCreate(Sender: TObject);
|
procedure DARemoteServiceCreate(Sender: TObject);
|
||||||
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
||||||
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
||||||
@ -34,7 +34,6 @@ type
|
|||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
{ IsrvRemesasProveedor methods }
|
{ IsrvRemesasProveedor methods }
|
||||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
|
||||||
function GenerateReport(const ID: String): Binary;
|
function GenerateReport(const ID: String): Binary;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -44,7 +43,8 @@ implementation
|
|||||||
uses
|
uses
|
||||||
{Generated:} FactuGES_Invk, uDataModuleServer,
|
{Generated:} FactuGES_Invk, uDataModuleServer,
|
||||||
uDatabaseUtils, schRemesasProveedorClient_Intf, uRestriccionesUsuarioUtils,
|
uDatabaseUtils, schRemesasProveedorClient_Intf, uRestriccionesUsuarioUtils,
|
||||||
// uBizRemesasProveedorServer, uRptRemesasProveedor_Server,
|
uBizRemesasProveedorServer,
|
||||||
|
//uRptRemesasProveedor_Server,
|
||||||
Dialogs;
|
Dialogs;
|
||||||
|
|
||||||
procedure Create_srvRemesasProveedor(out anInstance : IUnknown);
|
procedure Create_srvRemesasProveedor(out anInstance : IUnknown);
|
||||||
@ -58,21 +58,19 @@ procedure TsrvRemesasProveedor.DARemoteServiceBeforeGetDatasetData(
|
|||||||
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
||||||
const MaxRecords: Integer);
|
const MaxRecords: Integer);
|
||||||
begin
|
begin
|
||||||
{
|
|
||||||
if DataSet.Name = nme_RemesasProveedor then
|
if DataSet.Name = nme_RemesasProveedor then
|
||||||
begin
|
begin
|
||||||
{ Aquí se asegura que el usuario sólo accede a los RemesasProveedor
|
{ Aquí se asegura que el usuario sólo accede a los RemesasProveedor
|
||||||
de las empresas a las que tiene permiso para acceder
|
de las empresas a las que tiene permiso para acceder
|
||||||
filtrando DataSet por ID_EMPRESA. }
|
filtrando DataSet por ID_EMPRESA. }
|
||||||
{ FiltrarAccesoUsuario(Session, Connection, schRemesasProveedor, DataSet, fld_RemesasProveedorID_EMPRESA);
|
FiltrarAccesoUsuario(Session, Connection, schRemesasProveedor, DataSet, fld_RemesasProveedorID_EMPRESA);
|
||||||
end;
|
end;
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsrvRemesasProveedor.DARemoteServiceCreate(Sender: TObject);
|
procedure TsrvRemesasProveedor.DARemoteServiceCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SessionManager := dmServer.SessionManager;
|
SessionManager := dmServer.SessionManager;
|
||||||
// bpRemesasProveedor.BusinessRulesID := BIZ_SERVER_REMESAS_PROVEEDOR;
|
bpRemesasProveedor.BusinessRulesID := BIZ_SERVER_REMESAS_PROVEEDOR;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsrvRemesasProveedor.DataAbstractServiceBeforeAcquireConnection(
|
procedure TsrvRemesasProveedor.DataAbstractServiceBeforeAcquireConnection(
|
||||||
@ -95,11 +93,6 @@ begin
|
|||||||
}
|
}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TsrvRemesasProveedor.GetNextAutoInc(const GeneratorName: String): Integer;
|
|
||||||
begin
|
|
||||||
Result := uDatabaseUtils.GetNextAutoInc(GeneratorName)
|
|
||||||
end;
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
TROClassFactory.Create('srvRemesasProveedor', Create_srvRemesasProveedor, TsrvRemesasProveedor_Invoker);
|
TROClassFactory.Create('srvRemesasProveedor', Create_srvRemesasProveedor, TsrvRemesasProveedor_Invoker);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -54,36 +54,22 @@ uses
|
|||||||
schFormasPagoClient_Intf in '..\Modulos\Formas de pago\Model\schFormasPagoClient_Intf.pas',
|
schFormasPagoClient_Intf in '..\Modulos\Formas de pago\Model\schFormasPagoClient_Intf.pas',
|
||||||
schFormasPagoServer_Intf in '..\Modulos\Formas de pago\Model\schFormasPagoServer_Intf.pas',
|
schFormasPagoServer_Intf in '..\Modulos\Formas de pago\Model\schFormasPagoServer_Intf.pas',
|
||||||
uRptPresupuestosCliente_Server in '..\Modulos\Presupuestos de cliente\Reports\uRptPresupuestosCliente_Server.pas' {RptPresupuestosCliente},
|
uRptPresupuestosCliente_Server in '..\Modulos\Presupuestos de cliente\Reports\uRptPresupuestosCliente_Server.pas' {RptPresupuestosCliente},
|
||||||
schAlbaranesClienteClient_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteClient_Intf.pas',
|
|
||||||
schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas',
|
|
||||||
srvRecibosProveedor_Impl in '..\Modulos\Recibos de proveedor\Servidor\srvRecibosProveedor_Impl.pas' {srvRecibosProveedor: TDataAbstractService},
|
srvRecibosProveedor_Impl in '..\Modulos\Recibos de proveedor\Servidor\srvRecibosProveedor_Impl.pas' {srvRecibosProveedor: TDataAbstractService},
|
||||||
uBizFacturasClienteServer in '..\Modulos\Facturas de cliente\Model\uBizFacturasClienteServer.pas',
|
uBizFacturasClienteServer in '..\Modulos\Facturas de cliente\Model\uBizFacturasClienteServer.pas',
|
||||||
srvFacturasProveedor_Impl in '..\Modulos\Facturas de proveedor\Servidor\srvFacturasProveedor_Impl.pas' {srvFacturasProveedor: TDataAbstractService},
|
srvFacturasProveedor_Impl in '..\Modulos\Facturas de proveedor\Servidor\srvFacturasProveedor_Impl.pas' {srvFacturasProveedor: TDataAbstractService},
|
||||||
srvAlbaranesProveedor_Impl in '..\Modulos\Albaranes de proveedor\Servidor\srvAlbaranesProveedor_Impl.pas' {srvAlbaranesProveedor: TDataAbstractService},
|
srvAlbaranesProveedor_Impl in '..\Modulos\Albaranes de proveedor\Servidor\srvAlbaranesProveedor_Impl.pas' {srvAlbaranesProveedor: TDataAbstractService},
|
||||||
srvPedidosProveedor_Impl in '..\Modulos\Pedidos a proveedor\Servidor\srvPedidosProveedor_Impl.pas' {srvPedidosProveedor: TDataAbstractService},
|
srvPedidosProveedor_Impl in '..\Modulos\Pedidos a proveedor\Servidor\srvPedidosProveedor_Impl.pas' {srvPedidosProveedor: TDataAbstractService},
|
||||||
uBizPedidosProveedorServer in '..\Modulos\Pedidos a proveedor\Model\uBizPedidosProveedorServer.pas',
|
uBizPedidosProveedorServer in '..\Modulos\Pedidos a proveedor\Model\uBizPedidosProveedorServer.pas',
|
||||||
schPedidosProveedorClient_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas',
|
|
||||||
schPedidosProveedorServer_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas',
|
|
||||||
schAlbaranesProveedorClient_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorClient_Intf.pas',
|
|
||||||
schAlbaranesProveedorServer_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorServer_Intf.pas',
|
|
||||||
uBizAlbaranProveedorServer in '..\Modulos\Albaranes de proveedor\Model\uBizAlbaranProveedorServer.PAS',
|
uBizAlbaranProveedorServer in '..\Modulos\Albaranes de proveedor\Model\uBizAlbaranProveedorServer.PAS',
|
||||||
uBizFacturasProveedorServer in '..\Modulos\Facturas de proveedor\Model\uBizFacturasProveedorServer.pas',
|
uBizFacturasProveedorServer in '..\Modulos\Facturas de proveedor\Model\uBizFacturasProveedorServer.pas',
|
||||||
schAlmacenesClient_Intf in '..\Modulos\Almacenes\Model\schAlmacenesClient_Intf.pas',
|
schAlmacenesClient_Intf in '..\Modulos\Almacenes\Model\schAlmacenesClient_Intf.pas',
|
||||||
schAlmacenesServer_Intf in '..\Modulos\Almacenes\Model\schAlmacenesServer_Intf.pas',
|
schAlmacenesServer_Intf in '..\Modulos\Almacenes\Model\schAlmacenesServer_Intf.pas',
|
||||||
schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas',
|
|
||||||
schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas',
|
|
||||||
schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
|
|
||||||
schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas',
|
|
||||||
schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas',
|
schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas',
|
||||||
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas',
|
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas',
|
||||||
schRecibosProveedorClient_Intf in '..\Modulos\Recibos de proveedor\Model\schRecibosProveedorClient_Intf.pas',
|
schRecibosProveedorClient_Intf in '..\Modulos\Recibos de proveedor\Model\schRecibosProveedorClient_Intf.pas',
|
||||||
schRecibosProveedorServer_Intf in '..\Modulos\Recibos de proveedor\Model\schRecibosProveedorServer_Intf.pas',
|
schRecibosProveedorServer_Intf in '..\Modulos\Recibos de proveedor\Model\schRecibosProveedorServer_Intf.pas',
|
||||||
srvRemesasCliente_Impl in '..\Modulos\Remesas de cliente\Servidor\srvRemesasCliente_Impl.pas' {srvRemesasCliente: TDataAbstractService},
|
srvRemesasCliente_Impl in '..\Modulos\Remesas de cliente\Servidor\srvRemesasCliente_Impl.pas' {srvRemesasCliente: TDataAbstractService},
|
||||||
srvRemesasProveedor_Impl in '..\Modulos\Remesas de proveedor\Servidor\srvRemesasProveedor_Impl.pas' {srvRemesasProveedor: TDataAbstractService},
|
srvRemesasProveedor_Impl in '..\Modulos\Remesas de proveedor\Servidor\srvRemesasProveedor_Impl.pas' {srvRemesasProveedor: TDataAbstractService},
|
||||||
schRemesasProveedorClient_Intf in '..\Modulos\Remesas de proveedor\Model\schRemesasProveedorClient_Intf.pas',
|
|
||||||
schRemesasProveedorServer_Intf in '..\Modulos\Remesas de proveedor\Model\schRemesasProveedorServer_Intf.pas',
|
|
||||||
schRemesasClienteClient_Intf in '..\Modulos\Remesas de cliente\Model\schRemesasClienteClient_Intf.pas',
|
|
||||||
schRemesasClienteServer_Intf in '..\Modulos\Remesas de cliente\Model\schRemesasClienteServer_Intf.pas',
|
|
||||||
srvInventario_Impl in '..\Modulos\Inventario\Servidor\srvInventario_Impl.pas' {srvInventario: TDataAbstractService},
|
srvInventario_Impl in '..\Modulos\Inventario\Servidor\srvInventario_Impl.pas' {srvInventario: TDataAbstractService},
|
||||||
srvHistoricoMovimientos_Impl in '..\Modulos\Historico de movimientos\Servidor\srvHistoricoMovimientos_Impl.pas' {srvHistoricoMovimientos: TDataAbstractService},
|
srvHistoricoMovimientos_Impl in '..\Modulos\Historico de movimientos\Servidor\srvHistoricoMovimientos_Impl.pas' {srvHistoricoMovimientos: TDataAbstractService},
|
||||||
srvReferencias_Impl in 'srvReferencias_Impl.pas' {srvReferencias: TDataAbstractService},
|
srvReferencias_Impl in 'srvReferencias_Impl.pas' {srvReferencias: TDataAbstractService},
|
||||||
@ -96,15 +82,31 @@ uses
|
|||||||
schEjerciciosServer_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosServer_Intf.pas',
|
schEjerciciosServer_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosServer_Intf.pas',
|
||||||
schEjerciciosClient_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosClient_Intf.pas',
|
schEjerciciosClient_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosClient_Intf.pas',
|
||||||
srvContabilidad_Impl in '..\Modulos\Contabilidad\Servidor\srvContabilidad_Impl.pas' {srvContabilidad: TDataAbstractService},
|
srvContabilidad_Impl in '..\Modulos\Contabilidad\Servidor\srvContabilidad_Impl.pas' {srvContabilidad: TDataAbstractService},
|
||||||
schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas',
|
|
||||||
schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas',
|
|
||||||
uBizPagosClienteServer in '..\Modulos\Recibos de cliente\Model\uBizPagosClienteServer.pas',
|
uBizPagosClienteServer in '..\Modulos\Recibos de cliente\Model\uBizPagosClienteServer.pas',
|
||||||
schContabilidadServer_Intf in '..\Modulos\Contabilidad\Model\schContabilidadServer_Intf.pas',
|
schContabilidadServer_Intf in '..\Modulos\Contabilidad\Model\schContabilidadServer_Intf.pas',
|
||||||
schContabilidadClient_Intf in '..\Modulos\Contabilidad\Model\schContabilidadClient_Intf.pas',
|
schContabilidadClient_Intf in '..\Modulos\Contabilidad\Model\schContabilidadClient_Intf.pas',
|
||||||
schRecibosClienteClient_Intf in '..\Modulos\Recibos de cliente\Model\schRecibosClienteClient_Intf.pas',
|
schRecibosClienteClient_Intf in '..\Modulos\Recibos de cliente\Model\schRecibosClienteClient_Intf.pas',
|
||||||
schRecibosClienteServer_Intf in '..\Modulos\Recibos de cliente\Model\schRecibosClienteServer_Intf.pas',
|
schRecibosClienteServer_Intf in '..\Modulos\Recibos de cliente\Model\schRecibosClienteServer_Intf.pas',
|
||||||
schContactosClient_Intf in '..\Modulos\Contactos\Model\schContactosClient_Intf.pas',
|
schContactosClient_Intf in '..\Modulos\Contactos\Model\schContactosClient_Intf.pas',
|
||||||
schContactosServer_Intf in '..\Modulos\Contactos\Model\schContactosServer_Intf.pas';
|
schContactosServer_Intf in '..\Modulos\Contactos\Model\schContactosServer_Intf.pas',
|
||||||
|
schAlbaranesClienteClient_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteClient_Intf.pas',
|
||||||
|
schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas',
|
||||||
|
schAlbaranesProveedorClient_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorClient_Intf.pas',
|
||||||
|
schAlbaranesProveedorServer_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorServer_Intf.pas',
|
||||||
|
schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas',
|
||||||
|
schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas',
|
||||||
|
schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas',
|
||||||
|
schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas',
|
||||||
|
schPedidosProveedorClient_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas',
|
||||||
|
schPedidosProveedorServer_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas',
|
||||||
|
schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
|
||||||
|
schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas',
|
||||||
|
schRemesasClienteClient_Intf in '..\Modulos\Remesas de cliente\Model\schRemesasClienteClient_Intf.pas',
|
||||||
|
schRemesasClienteServer_Intf in '..\Modulos\Remesas de cliente\Model\schRemesasClienteServer_Intf.pas',
|
||||||
|
uBizRemesasClienteServer in '..\Modulos\Remesas de cliente\Model\uBizRemesasClienteServer.pas',
|
||||||
|
uBizRemesasProveedorServer in '..\Modulos\Remesas de proveedor\Model\uBizRemesasProveedorServer.pas',
|
||||||
|
schRemesasProveedorClient_Intf in '..\Modulos\Remesas de proveedor\Model\schRemesasProveedorClient_Intf.pas',
|
||||||
|
schRemesasProveedorServer_Intf in '..\Modulos\Remesas de proveedor\Model\schRemesasProveedorServer_Intf.pas';
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
{$R ..\Servicios\RODLFile.res}
|
{$R ..\Servicios\RODLFile.res}
|
||||||
@ -116,7 +118,6 @@ begin
|
|||||||
|
|
||||||
Application.ShowMainForm := False;
|
Application.ShowMainForm := False;
|
||||||
Application.CreateForm(TfServerForm, fServerForm);
|
Application.CreateForm(TfServerForm, fServerForm);
|
||||||
Application.CreateForm(TdmServer, dmServer);
|
|
||||||
Application.Run;
|
Application.Run;
|
||||||
Application.Terminate;
|
Application.Terminate;
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -29,6 +29,11 @@
|
|||||||
<Borland.ProjectType />
|
<Borland.ProjectType />
|
||||||
<BorlandProject>
|
<BorlandProject>
|
||||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">3.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys><VersionInfoKeys Name="CompileDate">lunes, 19 de noviembre de 2007 18:58</VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
|
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">3.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys><VersionInfoKeys Name="CompileDate">lunes, 19 de noviembre de 2007 18:58</VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Excluded_Packages Name="C:\Archivos de programa\RemObjects Software\Pascal Script\Dcu\D10\PascalScript_RO_D10.bpl">RemObjects Pascal Script - RemObjects SDK 3.0 Integration</Excluded_Packages>
|
<Excluded_Packages Name="C:\Archivos de programa\RemObjects Software\Pascal Script\Dcu\D10\PascalScript_RO_D10.bpl">RemObjects Pascal Script - RemObjects SDK 3.0 Integration</Excluded_Packages>
|
||||||
</Excluded_Packages><Source><Source Name="MainSource">FactuGES_Server.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
</Excluded_Packages><Source><Source Name="MainSource">FactuGES_Server.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
@ -157,12 +162,14 @@
|
|||||||
</DCCReference>
|
</DCCReference>
|
||||||
<DCCReference Include="..\Modulos\Remesas de cliente\Model\schRemesasClienteClient_Intf.pas" />
|
<DCCReference Include="..\Modulos\Remesas de cliente\Model\schRemesasClienteClient_Intf.pas" />
|
||||||
<DCCReference Include="..\Modulos\Remesas de cliente\Model\schRemesasClienteServer_Intf.pas" />
|
<DCCReference Include="..\Modulos\Remesas de cliente\Model\schRemesasClienteServer_Intf.pas" />
|
||||||
|
<DCCReference Include="..\Modulos\Remesas de cliente\Model\uBizRemesasClienteServer.pas" />
|
||||||
<DCCReference Include="..\Modulos\Remesas de cliente\Servidor\srvRemesasCliente_Impl.pas">
|
<DCCReference Include="..\Modulos\Remesas de cliente\Servidor\srvRemesasCliente_Impl.pas">
|
||||||
<Form>srvRemesasCliente</Form>
|
<Form>srvRemesasCliente</Form>
|
||||||
<DesignClass>TDataAbstractService</DesignClass>
|
<DesignClass>TDataAbstractService</DesignClass>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
<DCCReference Include="..\Modulos\Remesas de proveedor\Model\schRemesasProveedorClient_Intf.pas" />
|
<DCCReference Include="..\Modulos\Remesas de proveedor\Model\schRemesasProveedorClient_Intf.pas" />
|
||||||
<DCCReference Include="..\Modulos\Remesas de proveedor\Model\schRemesasProveedorServer_Intf.pas" />
|
<DCCReference Include="..\Modulos\Remesas de proveedor\Model\schRemesasProveedorServer_Intf.pas" />
|
||||||
|
<DCCReference Include="..\Modulos\Remesas de proveedor\Model\uBizRemesasProveedorServer.pas" />
|
||||||
<DCCReference Include="..\Modulos\Remesas de proveedor\Servidor\srvRemesasProveedor_Impl.pas">
|
<DCCReference Include="..\Modulos\Remesas de proveedor\Servidor\srvRemesasProveedor_Impl.pas">
|
||||||
<Form>srvRemesasProveedor</Form>
|
<Form>srvRemesasProveedor</Form>
|
||||||
<DesignClass>TDataAbstractService</DesignClass>
|
<DesignClass>TDataAbstractService</DesignClass>
|
||||||
@ -196,6 +203,10 @@
|
|||||||
<Form>srvLogin</Form>
|
<Form>srvLogin</Form>
|
||||||
<DesignClass>TDARemoteService</DesignClass>
|
<DesignClass>TDARemoteService</DesignClass>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
<DCCReference Include="srvReferencias_Impl.pas">
|
||||||
|
<Form>srvReferencias</Form>
|
||||||
|
<DesignClass>TDataAbstractService</DesignClass>
|
||||||
|
</DCCReference>
|
||||||
<DCCReference Include="uAcercaDe.pas">
|
<DCCReference Include="uAcercaDe.pas">
|
||||||
<Form>fAcercaDe</Form>
|
<Form>fAcercaDe</Form>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
|||||||
@ -14,7 +14,7 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "FileVersion", "1.0.0.0\0"
|
VALUE "FileVersion", "1.0.0.0\0"
|
||||||
VALUE "ProductVersion", "1.0.0.0\0"
|
VALUE "ProductVersion", "1.0.0.0\0"
|
||||||
VALUE "CompileDate", "miércoles, 26 de diciembre de 2007 16:31\0"
|
VALUE "CompileDate", "miércoles, 26 de diciembre de 2007 20:04\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user