unit schAsientosServer_Intf; interface uses Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, schAsientosClient_Intf; const { Delta rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } RID_darPenultimoCierreDelta = '{D3C1CAE3-F142-4BFA-B8D4-B1F32E9DEB2E}'; RID_AsientosDelta = '{0D27F555-A7BA-4304-B9C3-F7F79F39934E}'; RID_darSumaAcumuladaDelta = '{80563683-11A2-4648-845B-90F578B8B434}'; type { IdarPenultimoCierreDelta } IdarPenultimoCierreDelta = interface(IdarPenultimoCierre) ['{D3C1CAE3-F142-4BFA-B8D4-B1F32E9DEB2E}'] { Property getters and setters } function GetOldCODIGOValue : Integer; function GetOldFECHAASIENTOValue : DateTime; function GetOldDESCRIPCIONValue : String; { Properties } property OldCODIGO : Integer read GetOldCODIGOValue; property OldFECHAASIENTO : DateTime read GetOldFECHAASIENTOValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; end; { TdarPenultimoCierreBusinessProcessorRules } TdarPenultimoCierreBusinessProcessorRules = class(TDABusinessProcessorRules, IdarPenultimoCierre, IdarPenultimoCierreDelta) private protected { Property getters and setters } function GetCODIGOValue: Integer; virtual; function GetOldCODIGOValue: Integer; virtual; procedure SetCODIGOValue(const aValue: Integer); virtual; function GetFECHAASIENTOValue: DateTime; virtual; function GetOldFECHAASIENTOValue: DateTime; virtual; procedure SetFECHAASIENTOValue(const aValue: DateTime); virtual; function GetDESCRIPCIONValue: String; virtual; function GetOldDESCRIPCIONValue: String; virtual; procedure SetDESCRIPCIONValue(const aValue: String); virtual; { Properties } property CODIGO : Integer read GetCODIGOValue write SetCODIGOValue; property OldCODIGO : Integer read GetOldCODIGOValue; property FECHAASIENTO : DateTime read GetFECHAASIENTOValue write SetFECHAASIENTOValue; property OldFECHAASIENTO : DateTime read GetOldFECHAASIENTOValue; property DESCRIPCION : String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; { IAsientosDelta } IAsientosDelta = interface(IAsientos) ['{0D27F555-A7BA-4304-B9C3-F7F79F39934E}'] { Property getters and setters } function GetOldCODIGOValue : Integer; function GetOldCODIGOCUENTAValue : Integer; function GetOldTIPOASIENTOValue : String; function GetOldPUNTEADOValue : Integer; function GetOldFECHAALTAValue : DateTime; function GetOldUSUARIOValue : String; function GetOldFECHAASIENTOValue : DateTime; function GetOldFORMAPAGOValue : IROStrings; function GetOldDESCRIPCIONValue : String; function GetOldCODIGOPAGOValue : Integer; function GetOldIMPORTEValue : Currency; function GetOldIMPORTEANTValue : Currency; function GetOldIMPORTEPOSValue : Currency; { Properties } property OldCODIGO : Integer read GetOldCODIGOValue; property OldCODIGOCUENTA : Integer read GetOldCODIGOCUENTAValue; property OldTIPOASIENTO : String read GetOldTIPOASIENTOValue; property OldPUNTEADO : Integer read GetOldPUNTEADOValue; property OldFECHAALTA : DateTime read GetOldFECHAALTAValue; property OldUSUARIO : String read GetOldUSUARIOValue; property OldFECHAASIENTO : DateTime read GetOldFECHAASIENTOValue; property OldFORMAPAGO : IROStrings read GetOldFORMAPAGOValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; property OldCODIGOPAGO : Integer read GetOldCODIGOPAGOValue; property OldIMPORTE : Currency read GetOldIMPORTEValue; property OldIMPORTEANT : Currency read GetOldIMPORTEANTValue; property OldIMPORTEPOS : Currency read GetOldIMPORTEPOSValue; end; { TAsientosBusinessProcessorRules } TAsientosBusinessProcessorRules = class(TDABusinessProcessorRules, IAsientos, IAsientosDelta) private protected { Property getters and setters } function GetCODIGOValue: Integer; virtual; function GetOldCODIGOValue: Integer; virtual; procedure SetCODIGOValue(const aValue: Integer); virtual; function GetCODIGOCUENTAValue: Integer; virtual; function GetOldCODIGOCUENTAValue: Integer; virtual; procedure SetCODIGOCUENTAValue(const aValue: Integer); virtual; function GetTIPOASIENTOValue: String; virtual; function GetOldTIPOASIENTOValue: String; virtual; procedure SetTIPOASIENTOValue(const aValue: String); virtual; function GetPUNTEADOValue: Integer; virtual; function GetOldPUNTEADOValue: Integer; virtual; procedure SetPUNTEADOValue(const aValue: Integer); virtual; function GetFECHAALTAValue: DateTime; virtual; function GetOldFECHAALTAValue: DateTime; virtual; procedure SetFECHAALTAValue(const aValue: DateTime); virtual; function GetUSUARIOValue: String; virtual; function GetOldUSUARIOValue: String; virtual; procedure SetUSUARIOValue(const aValue: String); virtual; function GetFECHAASIENTOValue: DateTime; virtual; function GetOldFECHAASIENTOValue: DateTime; virtual; procedure SetFECHAASIENTOValue(const aValue: DateTime); virtual; function GetFORMAPAGOValue: IROStrings; virtual; function GetOldFORMAPAGOValue: IROStrings; virtual; procedure SetFORMAPAGOValue(const aValue: IROStrings); virtual; function GetDESCRIPCIONValue: String; virtual; function GetOldDESCRIPCIONValue: String; virtual; procedure SetDESCRIPCIONValue(const aValue: String); virtual; function GetCODIGOPAGOValue: Integer; virtual; function GetOldCODIGOPAGOValue: Integer; virtual; procedure SetCODIGOPAGOValue(const aValue: Integer); virtual; function GetIMPORTEValue: Currency; virtual; function GetOldIMPORTEValue: Currency; virtual; procedure SetIMPORTEValue(const aValue: Currency); virtual; function GetIMPORTEANTValue: Currency; virtual; function GetOldIMPORTEANTValue: Currency; virtual; procedure SetIMPORTEANTValue(const aValue: Currency); virtual; function GetIMPORTEPOSValue: Currency; virtual; function GetOldIMPORTEPOSValue: Currency; virtual; procedure SetIMPORTEPOSValue(const aValue: Currency); virtual; { Properties } property CODIGO : Integer read GetCODIGOValue write SetCODIGOValue; property OldCODIGO : Integer read GetOldCODIGOValue; property CODIGOCUENTA : Integer read GetCODIGOCUENTAValue write SetCODIGOCUENTAValue; property OldCODIGOCUENTA : Integer read GetOldCODIGOCUENTAValue; property TIPOASIENTO : String read GetTIPOASIENTOValue write SetTIPOASIENTOValue; property OldTIPOASIENTO : String read GetOldTIPOASIENTOValue; property PUNTEADO : Integer read GetPUNTEADOValue write SetPUNTEADOValue; property OldPUNTEADO : Integer read GetOldPUNTEADOValue; property FECHAALTA : DateTime read GetFECHAALTAValue write SetFECHAALTAValue; property OldFECHAALTA : DateTime read GetOldFECHAALTAValue; property USUARIO : String read GetUSUARIOValue write SetUSUARIOValue; property OldUSUARIO : String read GetOldUSUARIOValue; property FECHAASIENTO : DateTime read GetFECHAASIENTOValue write SetFECHAASIENTOValue; property OldFECHAASIENTO : DateTime read GetOldFECHAASIENTOValue; property FORMAPAGO : IROStrings read GetFORMAPAGOValue write SetFORMAPAGOValue; property OldFORMAPAGO : IROStrings read GetOldFORMAPAGOValue; property DESCRIPCION : String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; property CODIGOPAGO : Integer read GetCODIGOPAGOValue write SetCODIGOPAGOValue; property OldCODIGOPAGO : Integer read GetOldCODIGOPAGOValue; property IMPORTE : Currency read GetIMPORTEValue write SetIMPORTEValue; property OldIMPORTE : Currency read GetOldIMPORTEValue; property IMPORTEANT : Currency read GetIMPORTEANTValue write SetIMPORTEANTValue; property OldIMPORTEANT : Currency read GetOldIMPORTEANTValue; property IMPORTEPOS : Currency read GetIMPORTEPOSValue write SetIMPORTEPOSValue; property OldIMPORTEPOS : Currency read GetOldIMPORTEPOSValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; { IdarSumaAcumuladaDelta } IdarSumaAcumuladaDelta = interface(IdarSumaAcumulada) ['{80563683-11A2-4648-845B-90F578B8B434}'] { Property getters and setters } function GetOldSUMAValue : Float; { Properties } property OldSUMA : Float read GetOldSUMAValue; end; { TdarSumaAcumuladaBusinessProcessorRules } TdarSumaAcumuladaBusinessProcessorRules = class(TDABusinessProcessorRules, IdarSumaAcumulada, IdarSumaAcumuladaDelta) private protected { Property getters and setters } function GetSUMAValue: Float; virtual; function GetOldSUMAValue: Float; virtual; procedure SetSUMAValue(const aValue: Float); virtual; { Properties } property SUMA : Float read GetSUMAValue write SetSUMAValue; property OldSUMA : Float read GetOldSUMAValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; implementation uses Variants, uROBinaryHelpers; { TdarPenultimoCierreBusinessProcessorRules } constructor TdarPenultimoCierreBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TdarPenultimoCierreBusinessProcessorRules.Destroy; begin inherited; end; function TdarPenultimoCierreBusinessProcessorRules.GetCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_darPenultimoCierreCODIGO]; end; function TdarPenultimoCierreBusinessProcessorRules.GetOldCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_darPenultimoCierreCODIGO]; end; procedure TdarPenultimoCierreBusinessProcessorRules.SetCODIGOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_darPenultimoCierreCODIGO] := aValue; end; function TdarPenultimoCierreBusinessProcessorRules.GetFECHAASIENTOValue: DateTime; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_darPenultimoCierreFECHAASIENTO]; end; function TdarPenultimoCierreBusinessProcessorRules.GetOldFECHAASIENTOValue: DateTime; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_darPenultimoCierreFECHAASIENTO]; end; procedure TdarPenultimoCierreBusinessProcessorRules.SetFECHAASIENTOValue(const aValue: DateTime); begin BusinessProcessor.CurrentChange.NewValueByName[fld_darPenultimoCierreFECHAASIENTO] := aValue; end; function TdarPenultimoCierreBusinessProcessorRules.GetDESCRIPCIONValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_darPenultimoCierreDESCRIPCION]; end; function TdarPenultimoCierreBusinessProcessorRules.GetOldDESCRIPCIONValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_darPenultimoCierreDESCRIPCION]; end; procedure TdarPenultimoCierreBusinessProcessorRules.SetDESCRIPCIONValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_darPenultimoCierreDESCRIPCION] := aValue; end; { TAsientosBusinessProcessorRules } constructor TAsientosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TAsientosBusinessProcessorRules.Destroy; begin inherited; end; function TAsientosBusinessProcessorRules.GetCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosCODIGO]; end; function TAsientosBusinessProcessorRules.GetOldCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosCODIGO]; end; procedure TAsientosBusinessProcessorRules.SetCODIGOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosCODIGO] := aValue; end; function TAsientosBusinessProcessorRules.GetCODIGOCUENTAValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosCODIGOCUENTA]; end; function TAsientosBusinessProcessorRules.GetOldCODIGOCUENTAValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosCODIGOCUENTA]; end; procedure TAsientosBusinessProcessorRules.SetCODIGOCUENTAValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosCODIGOCUENTA] := aValue; end; function TAsientosBusinessProcessorRules.GetTIPOASIENTOValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosTIPOASIENTO]; end; function TAsientosBusinessProcessorRules.GetOldTIPOASIENTOValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosTIPOASIENTO]; end; procedure TAsientosBusinessProcessorRules.SetTIPOASIENTOValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosTIPOASIENTO] := aValue; end; function TAsientosBusinessProcessorRules.GetPUNTEADOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosPUNTEADO]; end; function TAsientosBusinessProcessorRules.GetOldPUNTEADOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosPUNTEADO]; end; procedure TAsientosBusinessProcessorRules.SetPUNTEADOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosPUNTEADO] := aValue; end; function TAsientosBusinessProcessorRules.GetFECHAALTAValue: DateTime; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosFECHAALTA]; end; function TAsientosBusinessProcessorRules.GetOldFECHAALTAValue: DateTime; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosFECHAALTA]; end; procedure TAsientosBusinessProcessorRules.SetFECHAALTAValue(const aValue: DateTime); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosFECHAALTA] := aValue; end; function TAsientosBusinessProcessorRules.GetUSUARIOValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosUSUARIO]; end; function TAsientosBusinessProcessorRules.GetOldUSUARIOValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosUSUARIO]; end; procedure TAsientosBusinessProcessorRules.SetUSUARIOValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosUSUARIO] := aValue; end; function TAsientosBusinessProcessorRules.GetFECHAASIENTOValue: DateTime; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosFECHAASIENTO]; end; function TAsientosBusinessProcessorRules.GetOldFECHAASIENTOValue: DateTime; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosFECHAASIENTO]; end; procedure TAsientosBusinessProcessorRules.SetFECHAASIENTOValue(const aValue: DateTime); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosFECHAASIENTO] := aValue; end; function TAsientosBusinessProcessorRules.GetFORMAPAGOValue: IROStrings; begin result := NewROStrings(); result.Text := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosFORMAPAGO]; end; function TAsientosBusinessProcessorRules.GetOldFORMAPAGOValue: IROStrings; begin result := NewROStrings(); result.Text := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosFORMAPAGO]; end; procedure TAsientosBusinessProcessorRules.SetFORMAPAGOValue(const aValue: IROStrings); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosFORMAPAGO] := aValue.Text; end; function TAsientosBusinessProcessorRules.GetDESCRIPCIONValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosDESCRIPCION]; end; function TAsientosBusinessProcessorRules.GetOldDESCRIPCIONValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosDESCRIPCION]; end; procedure TAsientosBusinessProcessorRules.SetDESCRIPCIONValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosDESCRIPCION] := aValue; end; function TAsientosBusinessProcessorRules.GetCODIGOPAGOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosCODIGOPAGO]; end; function TAsientosBusinessProcessorRules.GetOldCODIGOPAGOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosCODIGOPAGO]; end; procedure TAsientosBusinessProcessorRules.SetCODIGOPAGOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosCODIGOPAGO] := aValue; end; function TAsientosBusinessProcessorRules.GetIMPORTEValue: Currency; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosIMPORTE]; end; function TAsientosBusinessProcessorRules.GetOldIMPORTEValue: Currency; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosIMPORTE]; end; procedure TAsientosBusinessProcessorRules.SetIMPORTEValue(const aValue: Currency); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosIMPORTE] := aValue; end; function TAsientosBusinessProcessorRules.GetIMPORTEANTValue: Currency; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosIMPORTEANT]; end; function TAsientosBusinessProcessorRules.GetOldIMPORTEANTValue: Currency; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosIMPORTEANT]; end; procedure TAsientosBusinessProcessorRules.SetIMPORTEANTValue(const aValue: Currency); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosIMPORTEANT] := aValue; end; function TAsientosBusinessProcessorRules.GetIMPORTEPOSValue: Currency; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosIMPORTEPOS]; end; function TAsientosBusinessProcessorRules.GetOldIMPORTEPOSValue: Currency; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_AsientosIMPORTEPOS]; end; procedure TAsientosBusinessProcessorRules.SetIMPORTEPOSValue(const aValue: Currency); begin BusinessProcessor.CurrentChange.NewValueByName[fld_AsientosIMPORTEPOS] := aValue; end; { TdarSumaAcumuladaBusinessProcessorRules } constructor TdarSumaAcumuladaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TdarSumaAcumuladaBusinessProcessorRules.Destroy; begin inherited; end; function TdarSumaAcumuladaBusinessProcessorRules.GetSUMAValue: Float; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_darSumaAcumuladaSUMA]; end; function TdarSumaAcumuladaBusinessProcessorRules.GetOldSUMAValue: Float; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_darSumaAcumuladaSUMA]; end; procedure TdarSumaAcumuladaBusinessProcessorRules.SetSUMAValue(const aValue: Float); begin BusinessProcessor.CurrentChange.NewValueByName[fld_darSumaAcumuladaSUMA] := aValue; end; initialization RegisterBusinessProcessorRules(RID_darPenultimoCierreDelta, TdarPenultimoCierreBusinessProcessorRules); RegisterBusinessProcessorRules(RID_AsientosDelta, TAsientosBusinessProcessorRules); RegisterBusinessProcessorRules(RID_darSumaAcumuladaDelta, TdarSumaAcumuladaBusinessProcessorRules); end.