Se adapta toda la aplicación para separar la información por años

git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES/tags/1.5.1@10 9a1d36f3-7752-2d40-8ccb-50eb49674c68
This commit is contained in:
roberto 2009-03-05 18:34:34 +00:00
parent ff561ae7ed
commit 8cd836fe1e
127 changed files with 3472 additions and 1651 deletions

Binary file not shown.

Binary file not shown.

View File

@ -168,8 +168,8 @@ Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath] [HistoryLists\hlSearchPath]
Count=16 Count=16
Item0=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Intervalos;..\Modulos\Documentos asociados;..\Modulos\Contactos\Cliente;..\Modulos\Contactos\Reglas;..\Modulos\Presupuestos\Cliente;..\Modulos\Presupuestos\Reglas;..\Modulos\Albaranes de cliente\Cliente;..\Modulos\Albaranes de cliente\Reglas;..\Modulos\Facturas de cliente\Cliente;..\Modulos\Facturas de cliente\Reglas;..\Modulos\Pedidos a proveedor\Cliente;..\Modulos\Pedidos a proveedor\Reglas;..\Modulos\Facturas de proveedor\Cliente;..\Modulos\Facturas de proveedor\Reglas;..\Modulos\Montajes\Reglas;..\Modulos\Montajes\Cliente;..\Modulos\Articulos\Cliente;..\Modulos\Articulos\Reglas;..\Modulos\Almacenes\Reglas;..\Modulos\Almacenes\Cliente;..\Modulos\Pagos\Reglas;..\Modulos\Pagos\Cliente;..\Modulos\Cuentas\Reglas;..\Modulos\Cuentas\Cliente;..\Modulos\Asientos\Reglas;..\Modulos\Asientos\Cliente;..\Modulos\Calendarios\Cliente;..\Modulos\Calendarios\Reglas Item0=..\Modulos\Presupuestos\Reglas;..\Modulos\Contactos\Reglas;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Albaranes de cliente\Reglas
Item1=..\Modulos\Presupuestos\Reglas;..\Modulos\Contactos\Reglas;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Albaranes de cliente\Reglas Item1=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Intervalos;..\Modulos\Documentos asociados;..\Modulos\Contactos\Cliente;..\Modulos\Contactos\Reglas;..\Modulos\Presupuestos\Cliente;..\Modulos\Presupuestos\Reglas;..\Modulos\Albaranes de cliente\Cliente;..\Modulos\Albaranes de cliente\Reglas;..\Modulos\Facturas de cliente\Cliente;..\Modulos\Facturas de cliente\Reglas;..\Modulos\Pedidos a proveedor\Cliente;..\Modulos\Pedidos a proveedor\Reglas;..\Modulos\Facturas de proveedor\Cliente;..\Modulos\Facturas de proveedor\Reglas;..\Modulos\Montajes\Reglas;..\Modulos\Montajes\Cliente;..\Modulos\Articulos\Cliente;..\Modulos\Articulos\Reglas;..\Modulos\Almacenes\Reglas;..\Modulos\Almacenes\Cliente;..\Modulos\Pagos\Reglas;..\Modulos\Pagos\Cliente;..\Modulos\Cuentas\Reglas;..\Modulos\Cuentas\Cliente;..\Modulos\Asientos\Reglas;..\Modulos\Asientos\Cliente;..\Modulos\Calendarios\Cliente;..\Modulos\Calendarios\Reglas
Item2=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente;..\..\Cuentas\Cliente Item2=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente;..\..\Cuentas\Cliente
Item3=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente Item3=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente
Item4=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente Item4=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente
@ -189,8 +189,8 @@ Count=1
Item0=.\ Item0=.\
[HistoryLists\hlOutputDirectorry] [HistoryLists\hlOutputDirectorry]
Count=2 Count=2
Item0=..\Output\Cliente Item0=..\Output\Servidor
Item1=..\Output\Servidor Item1=..\Output\Cliente
[HistoryLists\hlBPLOutput] [HistoryLists\hlBPLOutput]
Count=3 Count=3
Item0=..\..\..\Output\Cliente Item0=..\..\..\Output\Cliente
@ -199,320 +199,3 @@ Item2=..\..\Output\Cliente
[HistoryLists\hlDCPOutput] [HistoryLists\hlDCPOutput]
Count=1 Count=1
Item0=.\ Item0=.\
[Exception Log]
EurekaLog Version=519
Activate=1
Activate Handle=1
Save Log File=1
Foreground Tab=0
Freeze Activate=0
Freeze Timeout=0
Freeze Message=The application seems to be frozen.
SMTP From=eurekalog@email.com
SMTP Host=
SMTP Port=25
SMTP UserID=
SMTP Password=
Append to Log=0
Show TerminateBtn=1
TerminateBtn Operation=1
Errors Number=32
Errors Terminate=3
Email Address=
Email Object=
Email Send Options=0
Output Path=
Encrypt Password=
AutoCloseDialogSecs=0
WebSendMode=0
SupportULR=
HTMLLayout Count=15
HTMLLine0="%3Chtml%3E"
HTMLLine1=" %3Chead%3E"
HTMLLine2=" %3C/head%3E"
HTMLLine3=" %3Cbody TopMargin=10 LeftMargin=10%3E"
HTMLLine4=" %3Ctable width="100%%" border="0"%3E"
HTMLLine5=" %3Ctr%3E"
HTMLLine6=" %3Ctd nowrap%3E"
HTMLLine7=" %3Cfont face="Lucida Console, Courier" size="2"%3E"
HTMLLine8=" %3C%%HTML_TAG%%%3E"
HTMLLine9=" %3C/font%3E"
HTMLLine10=" %3C/td%3E"
HTMLLine11=" %3C/tr%3E"
HTMLLine12=" %3C/table%3E"
HTMLLine13=" %3C/body%3E"
HTMLLine14="%3C/html%3E"
AutoCrashOperation=1
AutoCrashNumber=10
AutoCrashMinutes=1
WebURL=
WebUserID=
WebPassword=
WebPort=0
AttachedFiles=
Count=0
EMail Message Line Count=0
loNoDuplicateErrors=0
loAppendReproduceText=0
loDeleteLogAtVersionChange=0
loAddComputerNameInLogFileName=0
loSaveModulesSection=1
loSaveCPUSection=1
soAppStartDate=1
soAppName=1
soAppVersionNumber=1
soAppParameters=1
soAppCompilationDate=1
soExcDate=1
soExcAddress=1
soExcModule=1
soExcType=1
soExcMessage=1
soActCtlsFormClass=1
soActCtlsFormText=1
soActCtlsControlClass=1
soActCtlsControlText=1
soCmpName=1
soCmpUser=1
soCmpTotalMemory=1
soCmpFreeMemory=1
soCmpTotalDisk=1
soCmpFreeDisk=1
soCmpSysUpTime=1
soCmpProcessor=1
soCmpDisplayMode=1
soOSType=1
soOSBuildN=1
soOSUpdate=1
soOSLanguage=1
soNetIP=1
soNetSubmask=1
soNetGateway=1
soNetDNS1=1
soNetDNS2=1
soNetDHCP=1
sndShowSendDialog=1
sndShowSuccessFailureMsg=0
sndSendEntireLog=0
sndSendXMLLogCopy=0
sndSendScreenshot=0
sndUseOnlyActiveWindow=0
sndSendLastHTMLPage=1
sndSendInSeparatedThread=0
sndAddDateInFileName=0
sndCompressAllFiles=0
edoShowExceptionDialog=1
edoSendEmailChecked=1
edoAttachScreenshotChecked=1
edoShowCopyToClipOption=1
edoShowDetailsButton=1
edoShowInDetailedMode=0
edoShowInTopMostMode=0
edoUseEurekaLogLookAndFeel=1
csoShowDLLs=1
csoShowBPLs=1
csoShowBorlandThreads=1
csoShowWindowsThreads=1
csoShowProcedureOffset=0
boActivateCrashDetection=0
boPauseBorlandThreads=0
boDoNotPauseMainThread=0
boPauseWindowsThreads=0
boUseMainModuleOptions=1
boCopyLogInCaseOfError=1
boSaveCompressedCopyInCaseOfError=0
Count mtInformationMsgCaption=1
mtInformationMsgCaption0="Information."
Count mtQuestionMsgCaption=1
mtQuestionMsgCaption0="Question."
Count mtDialog_Caption=1
mtDialog_Caption0="Error."
Count mtDialog_ErrorMsgCaption=2
mtDialog_ErrorMsgCaption0="An error has occurred during program execution."
mtDialog_ErrorMsgCaption1="Please read the following information for further details."
Count mtDialog_GeneralCaption=1
mtDialog_GeneralCaption0="General"
Count mtDialog_GeneralHeader=1
mtDialog_GeneralHeader0="General Information"
Count mtDialog_CallStackCaption=1
mtDialog_CallStackCaption0="Call Stack"
Count mtDialog_CallStackHeader=1
mtDialog_CallStackHeader0="Call Stack Information"
Count mtDialog_ModulesCaption=1
mtDialog_ModulesCaption0="Modules"
Count mtDialog_ModulesHeader=1
mtDialog_ModulesHeader0="Modules Information"
Count mtDialog_CPUCaption=1
mtDialog_CPUCaption0="CPU"
Count mtDialog_CPUHeader=1
mtDialog_CPUHeader0="CPU Information"
Count mtDialog_CustomDataCaption=1
mtDialog_CustomDataCaption0="Other"
Count mtDialog_CustomDataHeader=1
mtDialog_CustomDataHeader0="Other Information"
Count mtDialog_OKButtonCaption=1
mtDialog_OKButtonCaption0="%26OK"
Count mtDialog_TerminateButtonCaption=1
mtDialog_TerminateButtonCaption0="%26Terminate"
Count mtDialog_RestartButtonCaption=1
mtDialog_RestartButtonCaption0="%26Restart"
Count mtDialog_DetailsButtonCaption=1
mtDialog_DetailsButtonCaption0="%26Details"
Count mtDialog_SendMessage=1
mtDialog_SendMessage0="%26Send this error via Internet"
Count mtDialog_ScreenshotMessage=1
mtDialog_ScreenshotMessage0="%26Attach a Screenshot image"
Count mtDialog_CopyMessage=1
mtDialog_CopyMessage0="%26Copy to Clipboard"
Count mtDialog_SupportMessage=1
mtDialog_SupportMessage0="Go to the Support Page"
Count mtLog_AppHeader=1
mtLog_AppHeader0="Application"
Count mtLog_AppStartDate=1
mtLog_AppStartDate0="Start Date"
Count mtLog_AppName=1
mtLog_AppName0="Name/Description"
Count mtLog_AppVersionNumber=1
mtLog_AppVersionNumber0="Version Number"
Count mtLog_AppParameters=1
mtLog_AppParameters0="Parameters"
Count mtLog_AppCompilationDate=1
mtLog_AppCompilationDate0="Compilation Date"
Count mtLog_ExcHeader=1
mtLog_ExcHeader0="Exception"
Count mtLog_ExcDate=1
mtLog_ExcDate0="Date"
Count mtLog_ExcAddress=1
mtLog_ExcAddress0="Address"
Count mtLog_ExcModule=1
mtLog_ExcModule0="Module"
Count mtLog_ExcType=1
mtLog_ExcType0="Type"
Count mtLog_ExcMessage=1
mtLog_ExcMessage0="Message"
Count mtLog_ActCtrlsHeader=1
mtLog_ActCtrlsHeader0="Active Controls"
Count mtLog_ActCtrlsFormClass=1
mtLog_ActCtrlsFormClass0="Form Class"
Count mtLog_ActCtrlsFormText=1
mtLog_ActCtrlsFormText0="Form Text"
Count mtLog_ActCtrlsControlClass=1
mtLog_ActCtrlsControlClass0="Control Class"
Count mtLog_ActCtrlsControlText=1
mtLog_ActCtrlsControlText0="Control Text"
Count mtLog_CmpHeader=1
mtLog_CmpHeader0="Computer"
Count mtLog_CmpName=1
mtLog_CmpName0="Name"
Count mtLog_CmpUser=1
mtLog_CmpUser0="User"
Count mtLog_CmpTotalMemory=1
mtLog_CmpTotalMemory0="Total Memory"
Count mtLog_CmpFreeMemory=1
mtLog_CmpFreeMemory0="Free Memory"
Count mtLog_CmpTotalDisk=1
mtLog_CmpTotalDisk0="Total Disk"
Count mtLog_CmpFreeDisk=1
mtLog_CmpFreeDisk0="Free Disk"
Count mtLog_CmpSystemUpTime=1
mtLog_CmpSystemUpTime0="System Up Time"
Count mtLog_CmpProcessor=1
mtLog_CmpProcessor0="Processor"
Count mtLog_CmpDisplayMode=1
mtLog_CmpDisplayMode0="Display Mode"
Count mtLog_OSHeader=1
mtLog_OSHeader0="Operating System"
Count mtLog_OSType=1
mtLog_OSType0="Type"
Count mtLog_OSBuildN=1
mtLog_OSBuildN0="Build #"
Count mtLog_OSUpdate=1
mtLog_OSUpdate0="Update"
Count mtLog_OSLanguage=1
mtLog_OSLanguage0="Language"
Count mtLog_NetHeader=1
mtLog_NetHeader0="Network"
Count mtLog_NetIP=1
mtLog_NetIP0="IP Address"
Count mtLog_NetSubmask=1
mtLog_NetSubmask0="Submask"
Count mtLog_NetGateway=1
mtLog_NetGateway0="Gateway"
Count mtLog_NetDNS1=1
mtLog_NetDNS10="DNS 1"
Count mtLog_NetDNS2=1
mtLog_NetDNS20="DNS 2"
Count mtLog_NetDHCP=1
mtLog_NetDHCP0="DHCP"
Count mtLog_CustInfoHeader=1
mtLog_CustInfoHeader0="Custom Information"
Count mtCallStack_Address=1
mtCallStack_Address0="Address"
Count mtCallStack_Name=1
mtCallStack_Name0="Module"
Count mtCallStack_Unit=1
mtCallStack_Unit0="Unit"
Count mtCallStack_Class=1
mtCallStack_Class0="Class"
Count mtCallStack_Procedure=1
mtCallStack_Procedure0="Procedure/Method"
Count mtCallStack_Line=1
mtCallStack_Line0="Line"
Count mtCallStack_MainThread=1
mtCallStack_MainThread0="Main"
Count mtCallStack_ExceptionThread=1
mtCallStack_ExceptionThread0="Exception Thread"
Count mtCallStack_RunningThread=1
mtCallStack_RunningThread0="Running Thread"
Count mtCallStack_CallingThread=1
mtCallStack_CallingThread0="Calling Thread"
Count mtCallStack_ThreadID=1
mtCallStack_ThreadID0="ID"
Count mtCallStack_ThreadPriority=1
mtCallStack_ThreadPriority0="Priority"
Count mtCallStack_ThreadClass=1
mtCallStack_ThreadClass0="Class"
Count mtSendDialog_Caption=1
mtSendDialog_Caption0="Send."
Count mtSendDialog_Message=1
mtSendDialog_Message0="Message"
Count mtSendDialog_Resolving=1
mtSendDialog_Resolving0="Resolving DNS..."
Count mtSendDialog_Connecting=1
mtSendDialog_Connecting0="Connecting with server..."
Count mtSendDialog_Connected=1
mtSendDialog_Connected0="Connected with server."
Count mtSendDialog_Sending=1
mtSendDialog_Sending0="Sending message..."
Count mtReproduceDialog_Caption=1
mtReproduceDialog_Caption0="Request"
Count mtReproduceDialog_Request=1
mtReproduceDialog_Request0="Please describe the steps to reproduce the error:"
Count mtReproduceDialog_OKButtonCaption=1
mtReproduceDialog_OKButtonCaption0="%26OK"
Count mtModules_Handle=1
mtModules_Handle0="Handle"
Count mtModules_Name=1
mtModules_Name0="Name"
Count mtModules_Description=1
mtModules_Description0="Description"
Count mtModules_Version=1
mtModules_Version0="Version"
Count mtModules_Size=1
mtModules_Size0="Size"
Count mtModules_LastModified=1
mtModules_LastModified0="Modified"
Count mtModules_Path=1
mtModules_Path0="Path"
Count mtCPU_Registers=1
mtCPU_Registers0="Registers"
Count mtCPU_Stack=1
mtCPU_Stack0="Stack"
Count mtCPU_MemoryDump=1
mtCPU_MemoryDump0="Memory Dump"
Count mtSend_SuccessMsg=1
mtSend_SuccessMsg0="The message was sent successfully."
Count mtSend_FailureMsg=1
mtSend_FailureMsg0="Sorry, sending the message didn't work."

View File

@ -2,7 +2,7 @@ object dmBase: TdmBase
OldCreateOrder = True OldCreateOrder = True
OnCreate = DAClientDataModuleCreate OnCreate = DAClientDataModuleCreate
Left = 616 Left = 616
Top = 230 Top = 176
Height = 368 Height = 368
Width = 494 Width = 494
object SmallImages: TPngImageList object SmallImages: TPngImageList

View File

@ -1,6 +1,6 @@
object fEditorBase: TfEditorBase object fEditorBase: TfEditorBase
Left = 482 Left = 482
Top = 318 Top = 242
Width = 670 Width = 670
Height = 512 Height = 512
Caption = 'EditorBase' Caption = 'EditorBase'

View File

@ -57,24 +57,31 @@ begin
inherited; inherited;
if Assigned(dsDataTable.DataTable) then if Assigned(dsDataTable.DataTable) then
begin begin
if (dsDataTable.DataTable.IsEmpty) or (not ModifiedQuery) then if (not ModifiedQuery) then
Exit; // No continuar con el refresco Exit; // No continuar con el refresco
ABookmark := dsDataTable.DataTable.GetBookMark;
// dsDataTable.DataTable.DisableControls; <- No descomentar
ACursor := Screen.Cursor; ACursor := Screen.Cursor;
Screen.Cursor := crHourGlass; Screen.Cursor := crHourGlass;
try try
dsDataTable.DataTable.Refresh; if dsDataTable.DataTable.IsEmpty then
begin
if dsDataTable.DataTable.Dataset.BookmarkValid(ABookmark) then dsDataTable.DataTable.Refresh;
dsDataTable.DataTable.GotoBookmark(ABookmark); end
else
begin
ABookmark := dsDataTable.DataTable.GetBookMark;
// dsDataTable.DataTable.DisableControls; <- No descomentar
dsDataTable.DataTable.Refresh;
if dsDataTable.DataTable.Dataset.BookmarkValid(ABookmark) then
dsDataTable.DataTable.GotoBookmark(ABookmark);
dsDataTable.DataTable.FreeBookmark(ABookmark);
// dsDataTable.DataTable.EnableControls; <- No descomentar
end;
finally finally
dsDataTable.DataTable.FreeBookmark(ABookmark);
// dsDataTable.DataTable.EnableControls; <- No descomentar
Screen.Cursor := ACursor; Screen.Cursor := ACursor;
end; end;
end; end;
end; end;

View File

@ -1,19 +1,20 @@
inherited fEditorGrid: TfEditorGrid inherited fEditorGrid: TfEditorGrid
Left = 208 Left = 747
Top = 182 Top = 158
Width = 893 Width = 714
Height = 485 Height = 485
Caption = 'fEditorGrid' Caption = 'fEditorGrid'
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
inherited JvNavPanelHeader: TJvNavPanelHeader inherited JvNavPanelHeader: TJvNavPanelHeader
Width = 885 Width = 706
inherited Image1: TImage inherited Image1: TImage
Left = 858 Left = 679
end end
end end
inherited TBXDock: TTBXDock inherited TBXDock: TTBXDock
Width = 885 Width = 706
Height = 75
inherited tbxMain: TTBXToolbar inherited tbxMain: TTBXToolbar
DefaultDock = TBXDock DefaultDock = TBXDock
inherited TBXItem29: TTBXItem inherited TBXItem29: TTBXItem
@ -52,21 +53,27 @@ inherited fEditorGrid: TfEditorGrid
end end
end end
object tbxFiltro: TTBXToolbar object tbxFiltro: TTBXToolbar
Left = 465 Left = 0
Top = 23 Top = 49
Align = alRight Align = alRight
CloseButton = False
DefaultDock = TBXDock DefaultDock = TBXDock
DockMode = dmCannotFloatOrChangeDocks DockMode = dmCannotFloatOrChangeDocks
DockPos = 392 DockPos = -12
DockRow = 1 DockRow = 2
DragHandleStyle = dhNone
Images = SmallImages Images = SmallImages
ParentShowHint = False ParentShowHint = False
Resizable = False
ShowHint = True ShowHint = True
ShrinkMode = tbsmNone
TabOrder = 2 TabOrder = 2
object lblAno: TTBXLabelItem
Caption = 'A'#241'o:'
Visible = False
end
object cbxListaAnos: TTBXComboBoxItem
Visible = False
end
object sepAno: TTBXSeparatorItem
Visible = False
end
object TBXLabelItem1: TTBXLabelItem object TBXLabelItem1: TTBXLabelItem
Caption = 'Filtrar:' Caption = 'Filtrar:'
end end
@ -91,7 +98,7 @@ inherited fEditorGrid: TfEditorGrid
end end
inherited StatusBar: TStatusBar inherited StatusBar: TStatusBar
Top = 432 Top = 432
Width = 885 Width = 706
end end
inherited EditorActionList: TActionList inherited EditorActionList: TActionList
Left = 72 Left = 72
@ -652,6 +659,8 @@ inherited fEditorGrid: TfEditorGrid
Name = 'PngImage21' Name = 'PngImage21'
Background = clWindow Background = clWindow
end> end>
Left = 323
Top = 120
Bitmap = {} Bitmap = {}
end end
inherited LargeImages: TPngImageList inherited LargeImages: TPngImageList
@ -1422,6 +1431,8 @@ inherited fEditorGrid: TfEditorGrid
Name = 'PngImage20' Name = 'PngImage20'
Background = clWindow Background = clWindow
end> end>
Left = 443
Top = 128
Bitmap = {} Bitmap = {}
end end
inherited JvFormStorage: TJvFormStorage inherited JvFormStorage: TJvFormStorage

View File

@ -41,6 +41,9 @@ type
TBXItem35: TTBXItem; TBXItem35: TTBXItem;
actFiltrar: TAction; actFiltrar: TAction;
TBXItem37: TTBXItem; TBXItem37: TTBXItem;
lblAno: TTBXLabelItem;
cbxListaAnos: TTBXComboBoxItem;
sepAno: TTBXSeparatorItem;
procedure tbxEditFiltroChange(Sender: TObject; const Text: String); procedure tbxEditFiltroChange(Sender: TObject; const Text: String);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure actPrevisualizarExecute(Sender: TObject); procedure actPrevisualizarExecute(Sender: TObject);
@ -58,15 +61,27 @@ type
procedure actFiltrarExecute(Sender: TObject); procedure actFiltrarExecute(Sender: TObject);
procedure actFiltrarUpdate(Sender: TObject); procedure actFiltrarUpdate(Sender: TObject);
private private
FListaAnos: TStringList;
FViewGrid : IViewGrid; FViewGrid : IViewGrid;
FWhereDataTable: WideString;
function GetListaAnos: TStringList;
procedure SetListaAnos(const Value: TStringList);
function GetWhereDataTable: String;
procedure SetWhereDataTable(const Value: String);
protected protected
procedure SetViewGrid(const Value : IViewGrid); virtual; procedure SetViewGrid(const Value : IViewGrid); virtual;
function GetViewGrid: IViewGrid; function GetViewGrid: IViewGrid;
public public
property ListaAnos: TStringList read GetListaAnos write SetListaAnos;
property WhereDataTable: String read GetWhereDataTable write SetWhereDataTable;
property ViewGrid: IViewGrid read GetViewGrid write SetViewGrid; property ViewGrid: IViewGrid read GetViewGrid write SetViewGrid;
constructor Create(AOwner : TComponent); override; constructor Create(AOwner : TComponent); override;
destructor Destroy; override; destructor Destroy; override;
end; end;
implementation implementation
@ -81,7 +96,11 @@ uses
} }
destructor TfEditorGrid.Destroy; destructor TfEditorGrid.Destroy;
begin begin
FWhereDataTable := '';
FViewGrid := NIL; FViewGrid := NIL;
if Assigned(FListaAnos) then
FlistaAnos.Free;
inherited; inherited;
end; end;
@ -109,6 +128,8 @@ end;
procedure TfEditorGrid.FormShow(Sender: TObject); procedure TfEditorGrid.FormShow(Sender: TObject);
begin begin
inherited; inherited;
cbxListaAnos.ItemIndex := 0; //OJO EL ORDEN PORQUE EL ShowEmbedded hace el open de la tabla
if Assigned(ViewGrid) then if Assigned(ViewGrid) then
ViewGrid.ShowEmbedded(Self); ViewGrid.ShowEmbedded(Self);
end; end;
@ -239,6 +260,57 @@ begin
(Sender as TAction).Checked := ViewGrid.EstanFiltrosVisible (Sender as TAction).Checked := ViewGrid.EstanFiltrosVisible
end; end;
function TfEditorGrid.GetListaAnos: TStringList;
begin
Result := FListaAnos;
end;
function TfEditorGrid.GetWhereDataTable: String;
begin
Result := FWhereDataTable;
end;
procedure TfEditorGrid.SetListaAnos(const Value: TStringList);
var
i: Integer;
AStringAnterior: String;
begin
AStringAnterior := '';
if Assigned(FListaAnos) then
begin
AStringAnterior := FListaAnos.ValueFromIndex[cbxListaAnos.ItemIndex];
FListaAnos.Free;
end;
//Se asigna el nuevo TStringList
FListaAnos := Value;
if Assigned(FListaAnos) then
begin
cbxListaAnos.Strings.BeginUpdate;
cbxListaAnos.Strings.Clear;
for i := 0 to FListaAnos.Count - 1 do
cbxListaAnos.Strings.Append(FListaAnos.Names[i]);
//Se posiciona en el elemento que habia anteriormente
if Length(AStringAnterior) > 0 then
begin
if FListaAnos.IndexOfName(AStringAnterior) <> -1 then
cbxListaAnos.ItemIndex := FListaAnos.IndexOfName(AStringAnterior)
else
cbxListaAnos.ItemIndex := 0;
end;
cbxListaAnos.Strings.EndUpdate;
end;
end;
procedure TfEditorGrid.SetWhereDataTable(const Value: String);
begin
FWhereDataTable := Value;
end;
initialization initialization
RegisterClass(TfEditorGrid); RegisterClass(TfEditorGrid);

View File

@ -1,5 +1,5 @@
inherited frViewBarraSeleccion: TfrViewBarraSeleccion inherited frViewBarraSeleccion: TfrViewBarraSeleccion
Width = 439 Width = 443
Height = 19 Height = 19
Align = alBottom Align = alBottom
AutoScroll = False AutoScroll = False
@ -7,14 +7,14 @@ inherited frViewBarraSeleccion: TfrViewBarraSeleccion
object pnlSeleccion: TPanel object pnlSeleccion: TPanel
Left = 0 Left = 0
Top = -18 Top = -18
Width = 439 Width = 443
Height = 37 Height = 37
Align = alBottom Align = alBottom
BevelOuter = bvNone BevelOuter = bvNone
ParentBackground = True ParentBackground = True
TabOrder = 0 TabOrder = 0
DesignSize = ( DesignSize = (
439 443
37) 37)
object bSeleccionar: TButton object bSeleccionar: TButton
Left = 264 Left = 264

Binary file not shown.

View File

@ -11,10 +11,10 @@ BRCC = $(ROOT)\bin\brcc32.exe $**
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
PROJECTS = DataAbstract_D7.bpl BaseD7.bpl Usuarios.bpl Configuracion.bpl \ PROJECTS = DataAbstract_D7.bpl BaseD7.bpl Usuarios.bpl Configuracion.bpl \
Contactos.bpl Intervalos.bpl DocumentosAsociados.bpl Cuentas.bpl Almacenes.bpl \ Contactos.bpl Intervalos.bpl DocumentosAsociados.bpl Cuentas.bpl Almacenes.bpl \
Presupuestos_Intf.bpl Montajes_Intf.bpl Presupuestos.bpl AlbaranesCliente.bpl \ Presupuestos_Intf.bpl Montajes_Intf.bpl Presupuestos.bpl Asientos.bpl Pagos.bpl \
PedidosProveedor.bpl PedidosMontaje.bpl Articulos.bpl ArticulosMontaje.bpl \ AlbaranesCliente.bpl PedidosProveedor.bpl PedidosMontaje.bpl Articulos.bpl \
Montajes_Impl.bpl FacturasCliente.bpl FacturasProveedor.bpl Asientos.bpl \ ArticulosMontaje.bpl Montajes_Impl.bpl FacturasCliente.bpl \
Pagos.bpl Calendarios.bpl FactuGES.exe FactuGES_Server.exe FacturasProveedor.bpl Calendarios.bpl FactuGES.exe FactuGES_Server.exe
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
default: $(PROJECTS) default: $(PROJECTS)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -683,4 +683,113 @@ object dmAlbaranesCliente: TdmAlbaranesCliente
Left = 48 Left = 48
Top = 152 Top = 152
end end
object tbl_ListaAnosAlbaranes: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosAlbaranes'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosAlbaranes'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosAlbaranes'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = dmBase.DABINAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosAlbaranes'
IndexDefs = <>
Left = 184
Top = 200
end
object ds_ListaAnosAlbaranes: TDADataSource
DataTable = tbl_ListaAnosAlbaranes
Left = 184
Top = 152
end
end end

View File

@ -17,6 +17,8 @@ type
ds_DetallesAlbaranCliente: TDADataSource; ds_DetallesAlbaranCliente: TDADataSource;
DADesigntimeCall1: TDADesigntimeCall; DADesigntimeCall1: TDADesigntimeCall;
RORemoteService2: TRORemoteService; RORemoteService2: TRORemoteService;
tbl_ListaAnosAlbaranes: TDACDSDataTable;
ds_ListaAnosAlbaranes: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
private private
{ Private declarations } { Private declarations }
@ -31,6 +33,9 @@ type
function PuedoEliminarAlbaran (CodigoAlbaran : Integer) : Boolean; function PuedoEliminarAlbaran (CodigoAlbaran : Integer) : Boolean;
function GetItemsSeleccionados(ASource : IBizAlbaranesCliente): IBizAlbaranesCliente; function GetItemsSeleccionados(ASource : IBizAlbaranesCliente): IBizAlbaranesCliente;
procedure CambiarSituacion(AAlbaran: IBizAlbaranesCliente); procedure CambiarSituacion(AAlbaran: IBizAlbaranesCliente);
function DarListaAnosAlbaranes: TStringList;
procedure FiltrarAno(AAlbaranes: IBizAlbaranesCliente; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -41,7 +46,7 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Forms, Controls, uDataTableUtils, uBizContacto, uDataModulePagos, Forms, Controls, cxControls, uDataTableUtils, uBizContacto, uDataModulePagos,
uDataModuleContactos, uDataModuleBase, schAlbaranesClienteClient_Intf, uDataModuleContactos, uDataModuleBase, schAlbaranesClienteClient_Intf,
uEditorPreview, uROTypes, uDBSelectionList, uDAInterfaces; uEditorPreview, uROTypes, uDBSelectionList, uDAInterfaces;
@ -246,6 +251,55 @@ begin
end; end;
end; end;
function TdmAlbaranesCliente.DarListaAnosAlbaranes: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosAlbaranes do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
procedure TdmAlbaranesCliente.FiltrarAno(AAlbaranes: IBizAlbaranesCliente; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
AAlbaranes.DataTable.Where.Clear;
AAlbaranes.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los presupuestos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with AAlbaranes.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_AlbaranClienteFECHAALBARAN, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_AlbaranClienteFECHAALBARAN, cLessOrEqual, FechaFin);
end;
end;
end;
initialization initialization
dmAlbaranesCliente := TdmAlbaranesCliente.Create(nil); dmAlbaranesCliente := TdmAlbaranesCliente.Create(nil);

View File

@ -48,7 +48,15 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente
end end
end end
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 505 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
end end
end end
inherited StatusBar: TStatusBar inherited StatusBar: TStatusBar

View File

@ -34,14 +34,19 @@ type
procedure frViewBarraSeleccionactCancelarExecute(Sender: TObject); procedure frViewBarraSeleccionactCancelarExecute(Sender: TObject);
procedure actPagarExecute(Sender: TObject); procedure actPagarExecute(Sender: TObject);
procedure edtFechaFiltro1PropertiesEditValueChanged(Sender: TObject); procedure edtFechaFiltro1PropertiesEditValueChanged(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
procedure FormShow(Sender: TObject);
private private
FAlbaranesCliente: IBizAlbaranesCliente; FAlbaranesCliente: IBizAlbaranesCliente;
protected protected
function GetAlbaranesCliente: IBizAlbaranesCliente; function GetAlbaranesCliente: IBizAlbaranesCliente;
procedure SetAlbaranesCliente(const Value: IBizAlbaranesCliente); procedure SetAlbaranesCliente(const Value: IBizAlbaranesCliente);
procedure SetViewGrid(const Value: IViewGrid); override; procedure SetViewGrid(const Value: IViewGrid); override;
function GetSelectionBarVisible: Boolean; function GetSelectionBarVisible: Boolean;
procedure SetSelectionBarVisible(const Value: Boolean); procedure SetSelectionBarVisible(const Value: Boolean);
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -130,13 +135,20 @@ begin
Result := FAlbaranesCliente; Result := FAlbaranesCliente;
end; end;
procedure TfEditorAlbaranesCliente.SetAlbaranesCliente(const Value: procedure TfEditorAlbaranesCliente.SetAlbaranesCliente(const Value: IBizAlbaranesCliente);
IBizAlbaranesCliente);
begin begin
FAlbaranesCliente := Value; FAlbaranesCliente := Value;
dsDataTable.DataTable := FAlbaranesCliente.DataTable;
if Assigned(ViewGrid) then if Assigned(FAlbaranesCliente) then
(ViewGrid as IViewAlbaranesCliente).AlbaranesCliente := AlbaranesCliente; begin
//Se guarda el where de la sentencia origen, por si el editor tiene filtros que
//afecten a este where y en un futuro se desea volver al where origen (filtro de año))
WhereDataTable := FAlbaranesCliente.DataTable.Where.Clause;
dsDataTable.DataTable := FAlbaranesCliente.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewAlbaranesCliente).AlbaranesCliente := AlbaranesCliente;
end;
end; end;
procedure TfEditorAlbaranesCliente.SetViewGrid(const Value: IViewGrid); procedure TfEditorAlbaranesCliente.SetViewGrid(const Value: IViewGrid);
@ -201,6 +213,21 @@ begin
} }
end; end;
procedure TfEditorAlbaranesCliente.FormShow(Sender: TObject);
begin
ListaAnos := dmAlbaranesCliente.DarListaAnosAlbaranes;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
end;
procedure TfEditorAlbaranesCliente.OnListaAnosChange(Sender: TObject; const Text: string);
begin
dmAlbaranesCliente.FiltrarAno(AlbaranesCliente, WhereDataTable, Text);
if AlbaranesCliente.DataTable.Active then
actRefrescar.Execute;
end;
initialization initialization
RegisterEditor(IBizAlbaranesCliente, ShowEditorAlbaranesCliente, etItems); RegisterEditor(IBizAlbaranesCliente, ShowEditorAlbaranesCliente, etItems);
RegisterEditor(IBizAlbaranesCliente, ShowSelectEditorAlbaranesCliente, etSelectItems); RegisterEditor(IBizAlbaranesCliente, ShowSelectEditorAlbaranesCliente, etSelectItems);

View File

@ -9,16 +9,18 @@ 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_DarReferenciaAlbaran = '{35F98298-F696-46BE-9D56-50D87C52A2C1}'; RID_ListaAnosAlbaranes = '{633AA7F3-9231-41FD-9AFA-20F135BF0015}';
RID_AlbaranCliente = '{14578616-F521-4BA3-A7E9-BB99BA3FA09C}'; RID_DarReferenciaAlbaran = '{2A1DC102-86E4-4ED4-99B3-63A0A8ADF44E}';
RID_AlbaranDePresupuesto = '{116AED58-1A39-4230-8961-B965FB7B0697}'; RID_AlbaranCliente = '{D7B2EDBF-3686-4A8C-910A-B4CFBE86FA03}';
RID_DetallesAlbaranCliente = '{9C31D267-5CA0-4776-9B6A-32E4633153D9}'; RID_AlbaranDePresupuesto = '{30A07021-CB00-471E-933D-C775663D9916}';
RID_AlbaranCliente_RefreshDataset = '{22F08733-B02A-4130-84ED-B1E32F9F18DF}'; RID_DetallesAlbaranCliente = '{7462D89E-A291-4EEB-86A1-466E9CA91AB2}';
RID_InformeCabeceraAlbaranPago = '{D018D751-1373-4A7C-9E2F-BFD097EC6967}'; RID_AlbaranCliente_RefreshDataset = '{937F0EE6-A236-4A40-AC09-EA6C414C708C}';
RID_InformeDetallesAlbaranPago = '{61D6092F-B71A-40E6-9601-980B85F71C86}'; RID_InformeCabeceraAlbaranPago = '{56F3725F-E457-4DC3-AE69-F6B955C4D525}';
RID_DarSumaImportes = '{6AD3F242-7984-41B6-8F0F-CEAEF113373A}'; RID_InformeDetallesAlbaranPago = '{1023528D-E1A8-4850-9C26-F0AE36E755D0}';
RID_DarSumaImportes = '{0183F8AD-2381-4ED5-931F-546D5C269857}';
{ Data table names } { Data table names }
nme_ListaAnosAlbaranes = 'ListaAnosAlbaranes';
nme_DarReferenciaAlbaran = 'DarReferenciaAlbaran'; nme_DarReferenciaAlbaran = 'DarReferenciaAlbaran';
nme_AlbaranCliente = 'AlbaranCliente'; nme_AlbaranCliente = 'AlbaranCliente';
nme_AlbaranDePresupuesto = 'AlbaranDePresupuesto'; nme_AlbaranDePresupuesto = 'AlbaranDePresupuesto';
@ -28,6 +30,12 @@ const
nme_InformeDetallesAlbaranPago = 'InformeDetallesAlbaranPago'; nme_InformeDetallesAlbaranPago = 'InformeDetallesAlbaranPago';
nme_DarSumaImportes = 'DarSumaImportes'; nme_DarSumaImportes = 'DarSumaImportes';
{ ListaAnosAlbaranes fields }
fld_ListaAnosAlbaranesANO = 'ANO';
{ ListaAnosAlbaranes field indexes }
idx_ListaAnosAlbaranesANO = 0;
{ DarReferenciaAlbaran fields } { DarReferenciaAlbaran fields }
fld_DarReferenciaAlbaranREFERENCIA = 'REFERENCIA'; fld_DarReferenciaAlbaranREFERENCIA = 'REFERENCIA';
@ -211,9 +219,38 @@ const
idx_DarSumaImportesIMPORTETOTAL = 2; idx_DarSumaImportesIMPORTETOTAL = 2;
type type
{ IListaAnosAlbaranes }
IListaAnosAlbaranes = interface(IDAStronglyTypedDataTable)
['{D7D4C0A5-1F72-468B-A5FB-C81C33C826F2}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosAlbaranesDataTableRules }
TListaAnosAlbaranesDataTableRules = class(TDADataTableRules, IListaAnosAlbaranes)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IDarReferenciaAlbaran } { IDarReferenciaAlbaran }
IDarReferenciaAlbaran = interface(IDAStronglyTypedDataTable) IDarReferenciaAlbaran = interface(IDAStronglyTypedDataTable)
['{C6FEC801-58D9-4332-B152-41E118F9B63A}'] ['{631B04FF-3196-4DB1-8266-43D0CCA14B6C}']
{ Property getters and setters } { Property getters and setters }
function GetREFERENCIAValue: String; function GetREFERENCIAValue: String;
procedure SetREFERENCIAValue(const aValue: String); procedure SetREFERENCIAValue(const aValue: String);
@ -242,7 +279,7 @@ type
{ IAlbaranCliente } { IAlbaranCliente }
IAlbaranCliente = interface(IDAStronglyTypedDataTable) IAlbaranCliente = interface(IDAStronglyTypedDataTable)
['{642833FA-4649-486C-89C8-B9728500F01D}'] ['{2E3EA9B3-B1D2-432C-A31E-4BBDDD644872}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -385,7 +422,7 @@ type
{ IAlbaranDePresupuesto } { IAlbaranDePresupuesto }
IAlbaranDePresupuesto = interface(IDAStronglyTypedDataTable) IAlbaranDePresupuesto = interface(IDAStronglyTypedDataTable)
['{78FBFEFF-5738-4B40-819A-3F70EED86124}'] ['{8CD58BB1-A4D0-4DF4-8E30-969F1BACC961}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOValue: Integer; function GetCODIGOValue: Integer;
procedure SetCODIGOValue(const aValue: Integer); procedure SetCODIGOValue(const aValue: Integer);
@ -414,7 +451,7 @@ type
{ IDetallesAlbaranCliente } { IDetallesAlbaranCliente }
IDetallesAlbaranCliente = interface(IDAStronglyTypedDataTable) IDetallesAlbaranCliente = interface(IDAStronglyTypedDataTable)
['{D9E720C6-134F-4020-975B-7EF111D57933}'] ['{675AE33F-D64C-47AD-A206-64BFAA11FCD7}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOALBARANValue: Integer; function GetCODIGOALBARANValue: Integer;
procedure SetCODIGOALBARANValue(const aValue: Integer); procedure SetCODIGOALBARANValue(const aValue: Integer);
@ -503,7 +540,7 @@ type
{ IAlbaranCliente_RefreshDataset } { IAlbaranCliente_RefreshDataset }
IAlbaranCliente_RefreshDataset = interface(IDAStronglyTypedDataTable) IAlbaranCliente_RefreshDataset = interface(IDAStronglyTypedDataTable)
['{3832562D-0F4D-4243-A963-3B59CB9D2B05}'] ['{37351A63-CE65-4762-B897-5DE5998CAB64}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOValue: Integer; function GetCODIGOValue: Integer;
procedure SetCODIGOValue(const aValue: Integer); procedure SetCODIGOValue(const aValue: Integer);
@ -550,7 +587,7 @@ type
{ IInformeCabeceraAlbaranPago } { IInformeCabeceraAlbaranPago }
IInformeCabeceraAlbaranPago = interface(IDAStronglyTypedDataTable) IInformeCabeceraAlbaranPago = interface(IDAStronglyTypedDataTable)
['{7CEBCE95-FD7B-46D1-844E-70F47FC60D0E}'] ['{173C44D2-12F3-4383-86A6-29107BF40AF6}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -735,7 +772,7 @@ type
{ IInformeDetallesAlbaranPago } { IInformeDetallesAlbaranPago }
IInformeDetallesAlbaranPago = interface(IDAStronglyTypedDataTable) IInformeDetallesAlbaranPago = interface(IDAStronglyTypedDataTable)
['{2C1837CB-F884-46C6-BD8E-59A6AD8670A8}'] ['{92CC3EF0-B88D-4396-8134-AD775CD2E583}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOALBARANValue: Integer; function GetCODIGOALBARANValue: Integer;
procedure SetCODIGOALBARANValue(const aValue: Integer); procedure SetCODIGOALBARANValue(const aValue: Integer);
@ -809,7 +846,7 @@ type
} }
{ IDarSumaImportes } { IDarSumaImportes }
IDarSumaImportes = interface(IDAStronglyTypedDataTable) IDarSumaImportes = interface(IDAStronglyTypedDataTable)
['{C49AE35E-D0D0-4D17-80C9-9E996E212A8D}'] ['{0A03D6E5-29C3-4B3C-8004-8D48A433FB36}']
{ Property getters and setters } { Property getters and setters }
function GetBASEIMPONIBLEValue: Float; function GetBASEIMPONIBLEValue: Float;
procedure SetBASEIMPONIBLEValue(const aValue: Float); procedure SetBASEIMPONIBLEValue(const aValue: Float);
@ -852,6 +889,28 @@ implementation
uses Variants; uses Variants;
{ TListaAnosAlbaranesDataTableRules }
constructor TListaAnosAlbaranesDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosAlbaranesDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosAlbaranesDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosAlbaranesANO].AsString;
end;
procedure TListaAnosAlbaranesDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosAlbaranesANO].AsString := aValue;
end;
{ TDarReferenciaAlbaranDataTableRules } { TDarReferenciaAlbaranDataTableRules }
constructor TDarReferenciaAlbaranDataTableRules.Create(aDataTable: TDADataTable); constructor TDarReferenciaAlbaranDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -1703,6 +1762,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_ListaAnosAlbaranes, TListaAnosAlbaranesDataTableRules);
RegisterDataTableRules(RID_DarReferenciaAlbaran, TDarReferenciaAlbaranDataTableRules); RegisterDataTableRules(RID_DarReferenciaAlbaran, TDarReferenciaAlbaranDataTableRules);
RegisterDataTableRules(RID_AlbaranCliente, TAlbaranClienteDataTableRules); RegisterDataTableRules(RID_AlbaranCliente, TAlbaranClienteDataTableRules);
RegisterDataTableRules(RID_AlbaranDePresupuesto, TAlbaranDePresupuestoDataTableRules); RegisterDataTableRules(RID_AlbaranDePresupuesto, TAlbaranDePresupuestoDataTableRules);

View File

@ -9,19 +9,49 @@ 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_DarReferenciaAlbaranDelta = '{D9EAC03F-B4A2-41B9-A2B2-7CF11F780D28}'; RID_ListaAnosAlbaranesDelta = '{5C2DB703-C887-4F77-A9DC-11DA0CF6FE4E}';
RID_AlbaranClienteDelta = '{8E3B55C2-3828-41E4-8AEA-F0D487EDD873}'; RID_DarReferenciaAlbaranDelta = '{D832A4B5-6FDD-49E0-AE5F-306375C415AD}';
RID_AlbaranDePresupuestoDelta = '{1D24D93A-7A20-4DC4-ACE3-F9E644618634}'; RID_AlbaranClienteDelta = '{5DFFE549-E998-435B-BB5C-F859B970C506}';
RID_DetallesAlbaranClienteDelta = '{91443B47-343B-46EC-85F0-19C431B1F56B}'; RID_AlbaranDePresupuestoDelta = '{B5AB03E8-D48D-4BA2-A1E9-9CD0D0907C62}';
RID_AlbaranCliente_RefreshDatasetDelta = '{7857A2CE-B06F-491A-BB36-844139B9125E}'; RID_DetallesAlbaranClienteDelta = '{1502B47E-54CF-4FCD-8CC2-48C36D9EF53A}';
RID_InformeCabeceraAlbaranPagoDelta = '{B87026ED-31B8-4320-8908-DE7DED600AC9}'; RID_AlbaranCliente_RefreshDatasetDelta = '{5E7557E0-2251-46D8-83CF-818EC119C817}';
RID_InformeDetallesAlbaranPagoDelta = '{0698DC8F-4317-451B-8770-F18535997036}'; RID_InformeCabeceraAlbaranPagoDelta = '{51A960DD-CBCF-4151-9471-61453103C2EF}';
RID_DarSumaImportesDelta = '{DFDB0CB4-85D3-449B-B350-EC3758E21B72}'; RID_InformeDetallesAlbaranPagoDelta = '{FA30D0F8-1FFC-4FAD-8C8B-CA8553D877EA}';
RID_DarSumaImportesDelta = '{50AE6D16-89E0-4C6A-9A75-62FE055859AF}';
type type
{ IListaAnosAlbaranesDelta }
IListaAnosAlbaranesDelta = interface(IListaAnosAlbaranes)
['{5C2DB703-C887-4F77-A9DC-11DA0CF6FE4E}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosAlbaranesBusinessProcessorRules }
TListaAnosAlbaranesBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosAlbaranes, IListaAnosAlbaranesDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IDarReferenciaAlbaranDelta } { IDarReferenciaAlbaranDelta }
IDarReferenciaAlbaranDelta = interface(IDarReferenciaAlbaran) IDarReferenciaAlbaranDelta = interface(IDarReferenciaAlbaran)
['{D9EAC03F-B4A2-41B9-A2B2-7CF11F780D28}'] ['{D832A4B5-6FDD-49E0-AE5F-306375C415AD}']
{ Property getters and setters } { Property getters and setters }
function GetOldREFERENCIAValue : String; function GetOldREFERENCIAValue : String;
@ -50,7 +80,7 @@ type
{ IAlbaranClienteDelta } { IAlbaranClienteDelta }
IAlbaranClienteDelta = interface(IAlbaranCliente) IAlbaranClienteDelta = interface(IAlbaranCliente)
['{8E3B55C2-3828-41E4-8AEA-F0D487EDD873}'] ['{5DFFE549-E998-435B-BB5C-F859B970C506}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -212,7 +242,7 @@ type
{ IAlbaranDePresupuestoDelta } { IAlbaranDePresupuestoDelta }
IAlbaranDePresupuestoDelta = interface(IAlbaranDePresupuesto) IAlbaranDePresupuestoDelta = interface(IAlbaranDePresupuesto)
['{1D24D93A-7A20-4DC4-ACE3-F9E644618634}'] ['{B5AB03E8-D48D-4BA2-A1E9-9CD0D0907C62}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -241,7 +271,7 @@ type
{ IDetallesAlbaranClienteDelta } { IDetallesAlbaranClienteDelta }
IDetallesAlbaranClienteDelta = interface(IDetallesAlbaranCliente) IDetallesAlbaranClienteDelta = interface(IDetallesAlbaranCliente)
['{91443B47-343B-46EC-85F0-19C431B1F56B}'] ['{1502B47E-54CF-4FCD-8CC2-48C36D9EF53A}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOALBARANValue : Integer; function GetOldCODIGOALBARANValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -340,7 +370,7 @@ type
{ IAlbaranCliente_RefreshDatasetDelta } { IAlbaranCliente_RefreshDatasetDelta }
IAlbaranCliente_RefreshDatasetDelta = interface(IAlbaranCliente_RefreshDataset) IAlbaranCliente_RefreshDatasetDelta = interface(IAlbaranCliente_RefreshDataset)
['{7857A2CE-B06F-491A-BB36-844139B9125E}'] ['{5E7557E0-2251-46D8-83CF-818EC119C817}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
function GetOldNOMBREValue : String; function GetOldNOMBREValue : String;
@ -390,7 +420,7 @@ type
{ IInformeCabeceraAlbaranPagoDelta } { IInformeCabeceraAlbaranPagoDelta }
IInformeCabeceraAlbaranPagoDelta = interface(IInformeCabeceraAlbaranPago) IInformeCabeceraAlbaranPagoDelta = interface(IInformeCabeceraAlbaranPago)
['{B87026ED-31B8-4320-8908-DE7DED600AC9}'] ['{51A960DD-CBCF-4151-9471-61453103C2EF}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -601,7 +631,7 @@ type
{ IInformeDetallesAlbaranPagoDelta } { IInformeDetallesAlbaranPagoDelta }
IInformeDetallesAlbaranPagoDelta = interface(IInformeDetallesAlbaranPago) IInformeDetallesAlbaranPagoDelta = interface(IInformeDetallesAlbaranPago)
['{0698DC8F-4317-451B-8770-F18535997036}'] ['{FA30D0F8-1FFC-4FAD-8C8B-CA8553D877EA}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOALBARANValue : Integer; function GetOldCODIGOALBARANValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -679,7 +709,7 @@ type
{ IDarSumaImportesDelta } { IDarSumaImportesDelta }
IDarSumaImportesDelta = interface(IDarSumaImportes) IDarSumaImportesDelta = interface(IDarSumaImportes)
['{DFDB0CB4-85D3-449B-B350-EC3758E21B72}'] ['{50AE6D16-89E0-4C6A-9A75-62FE055859AF}']
{ Property getters and setters } { Property getters and setters }
function GetOldBASEIMPONIBLEValue : Float; function GetOldBASEIMPONIBLEValue : Float;
function GetOldIMPORTEIVAValue : Float; function GetOldIMPORTEIVAValue : Float;
@ -725,6 +755,33 @@ implementation
uses uses
Variants, uROBinaryHelpers; Variants, uROBinaryHelpers;
{ TListaAnosAlbaranesBusinessProcessorRules }
constructor TListaAnosAlbaranesBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosAlbaranesBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosAlbaranesBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosAlbaranesANO];
end;
function TListaAnosAlbaranesBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosAlbaranesANO];
end;
procedure TListaAnosAlbaranesBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosAlbaranesANO] := aValue;
end;
{ TDarReferenciaAlbaranBusinessProcessorRules } { TDarReferenciaAlbaranBusinessProcessorRules }
constructor TDarReferenciaAlbaranBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TDarReferenciaAlbaranBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -1955,6 +2012,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_ListaAnosAlbaranesDelta, TListaAnosAlbaranesBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_DarReferenciaAlbaranDelta, TDarReferenciaAlbaranBusinessProcessorRules); RegisterBusinessProcessorRules(RID_DarReferenciaAlbaranDelta, TDarReferenciaAlbaranBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_AlbaranClienteDelta, TAlbaranClienteBusinessProcessorRules); RegisterBusinessProcessorRules(RID_AlbaranClienteDelta, TAlbaranClienteBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_AlbaranDePresupuestoDelta, TAlbaranDePresupuestoBusinessProcessorRules); RegisterBusinessProcessorRules(RID_AlbaranDePresupuestoDelta, TAlbaranDePresupuestoBusinessProcessorRules);

View File

@ -7,7 +7,7 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente
ServiceSchema = schAlbaranesCliente ServiceSchema = schAlbaranesCliente
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 413 Left = 413
Top = 252 Top = 220
Height = 463 Height = 463
Width = 347 Width = 347
object schAlbaranesCliente: TDASchema object schAlbaranesCliente: TDASchema
@ -15,6 +15,39 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente
DataDictionary = dmServer.DataDictionary DataDictionary = dmServer.DataDictionary
Diagrams = dmServer.DADiagrams Diagrams = dmServer.DADiagrams
Datasets = < Datasets = <
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAALBARAN, 1,4)) as A' +
'NO'#10'from albaranpago'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select distinct' +
' '#39'Todos'#39' as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosAlbaranes'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = <> Params = <>
Statements = < Statements = <

View File

@ -29,8 +29,8 @@ type
tbl_AlbaranPago: TDACDSDataTable; tbl_AlbaranPago: TDACDSDataTable;
tbl_DetallesAlbaranPago: TDACDSDataTable; tbl_DetallesAlbaranPago: TDACDSDataTable;
DABINAdapter: TDABINAdapter; DABINAdapter: TDABINAdapter;
schAlbaranesCliente: TDASchema;
frxReport1: TfrxReport; frxReport1: TfrxReport;
schAlbaranesCliente: TDASchema;
private private
protected protected
function GetNextAutoinc: Integer; function GetNextAutoinc: Integer;

View File

@ -7,7 +7,7 @@ object srvAlmacenes: TsrvAlmacenes
ServiceSchema = schAlmacenes ServiceSchema = schAlmacenes
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 200 Left = 200
Top = 200 Top = 175
Height = 300 Height = 300
Width = 300 Width = 300
object schAlmacenes: TDASchema object schAlmacenes: TDASchema

View File

@ -142,12 +142,12 @@ Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath] [HistoryLists\hlSearchPath]
Count=16 Count=16
Item0=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente;..\..\Cuentas\Cliente Item0=..\Modulos\Presupuestos\Reglas;..\Modulos\Contactos\Reglas;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Albaranes de cliente\Reglas
Item1=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente Item1=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Intervalos;..\Modulos\Documentos asociados;..\Modulos\Contactos\Cliente;..\Modulos\Contactos\Reglas;..\Modulos\Presupuestos\Cliente;..\Modulos\Presupuestos\Reglas;..\Modulos\Albaranes de cliente\Cliente;..\Modulos\Albaranes de cliente\Reglas;..\Modulos\Facturas de cliente\Cliente;..\Modulos\Facturas de cliente\Reglas;..\Modulos\Pedidos a proveedor\Cliente;..\Modulos\Pedidos a proveedor\Reglas;..\Modulos\Facturas de proveedor\Cliente;..\Modulos\Facturas de proveedor\Reglas;..\Modulos\Montajes\Reglas;..\Modulos\Montajes\Cliente;..\Modulos\Articulos\Cliente;..\Modulos\Articulos\Reglas;..\Modulos\Almacenes\Reglas;..\Modulos\Almacenes\Cliente;..\Modulos\Pagos\Reglas;..\Modulos\Pagos\Cliente;..\Modulos\Cuentas\Reglas;..\Modulos\Cuentas\Cliente;..\Modulos\Asientos\Reglas;..\Modulos\Asientos\Cliente;..\Modulos\Calendarios\Cliente;..\Modulos\Calendarios\Reglas
Item2=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente Item2=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente;..\..\Cuentas\Cliente
Item3=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente Item3=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente;..\..\Asientos\Cliente
Item4=..\Modulos\Presupuestos\Reglas;..\Modulos\Contactos\Reglas;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Albaranes de cliente\Reglas Item4=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente;..\..\Intervalos\Cliente
Item5=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\Base;..\Configuracion;..\Usuarios;..\Modulos\Intervalos;..\Modulos\Documentos asociados;..\Modulos\Contactos\Cliente;..\Modulos\Contactos\Reglas;..\Modulos\Presupuestos\Cliente;..\Modulos\Presupuestos\Reglas;..\Modulos\Albaranes de cliente\Cliente;..\Modulos\Albaranes de cliente\Reglas;..\Modulos\Facturas de cliente\Cliente;..\Modulos\Facturas de cliente\Reglas;..\Modulos\Pedidos a proveedor\Cliente;..\Modulos\Pedidos a proveedor\Reglas;..\Modulos\Facturas de proveedor\Cliente;..\Modulos\Facturas de proveedor\Reglas;..\Modulos\Montajes\Reglas;..\Modulos\Montajes\Cliente;..\Modulos\Articulos\Cliente;..\Modulos\Articulos\Reglas;..\Modulos\Almacenes\Reglas;..\Modulos\Almacenes\Cliente;..\Modulos\Pagos\Reglas;..\Modulos\Pagos\Cliente;..\Modulos\Cuentas\Reglas;..\Modulos\Cuentas\Cliente;..\Modulos\Asientos\Reglas;..\Modulos\Asientos\Cliente;..\Modulos\Calendarios\Cliente;..\Modulos\Calendarios\Reglas Item5=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\Presupuestos\Cliente;..\..\..\Usuarios;..\..\Albaranes de cliente\Cliente;..\..\Documentos asociados;..\..\Pagos\Cliente
Item6=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\..\Usuarios;..\..\Montajes\Cliente;..\..\Documentos asociados;..\..\Contactos\Cliente;..\..\Almacenes\Cliente Item6=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\..\Usuarios;..\..\Montajes\Cliente;..\..\Documentos asociados;..\..\Contactos\Cliente;..\..\Almacenes\Cliente
Item7=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\..\Usuarios;..\..\Documentos asociados Item7=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\Contactos\Cliente;..\..\..\Usuarios;..\..\Documentos asociados
Item8=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\..\Usuarios;..\..\Montajes\Cliente;..\..\Documentos asociados;..\..\Contactos\Cliente Item8=$(DELPHI)\Lib\Debug;D:\PROYEC~1\COMPON~1\jcl\lib\D7\debug;..\..\..\Base;..\..\..\Servidor;..\..\..\Usuarios;..\..\Montajes\Cliente;..\..\Documentos asociados;..\..\Contactos\Cliente

View File

@ -11,7 +11,7 @@ object dmArticulos: TdmArticulos
DataType = rtString DataType = rtString
end> end>
Left = 328 Left = 328
Top = 337 Top = 294
Height = 197 Height = 197
Width = 369 Width = 369
object RORemoteService: TRORemoteService object RORemoteService: TRORemoteService

View File

@ -100,8 +100,7 @@ begin
begin begin
Clear; Clear;
OpenBraket; OpenBraket;
AddText('MONTAJES.SITUACION not in (''' + SITUACION_PENDIENTEPAGO + ''', ''' + SITUACION_PAGADO + ''')', False); AddText('(MONTAJES.SITUACION is null) OR (MONTAJES.SITUACION not in (''' + SITUACION_PENDIENTEPAGO + ''', ''' + SITUACION_PAGADO + '''))', False);
// AddText('MONTAJES.FECHAFIN is null', False);
CloseBraket; CloseBraket;
end; end;

View File

@ -1,6 +1,6 @@
inherited fEditorArticulosAlmacen: TfEditorArticulosAlmacen inherited fEditorArticulosAlmacen: TfEditorArticulosAlmacen
Left = 162 Left = 162
Top = 243 Top = 212
Caption = 'Inventario de art'#237'culos en almacenes' Caption = 'Inventario de art'#237'culos en almacenes'
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13

View File

@ -7,8 +7,8 @@ object ModuleArticulos: TModuleArticulos
LargeImages = LargeImages LargeImages = LargeImages
Author = 'Rodax Software' Author = 'Rodax Software'
Version = '1.0.0' Version = '1.0.0'
Left = 691 Left = 690
Top = 507 Top = 441
Height = 252 Height = 252
Width = 401 Width = 401
object LargeImages: TPngImageList object LargeImages: TPngImageList

View File

@ -6,7 +6,7 @@ object srvArticulos: TsrvArticulos
ServiceSchema = schArticulos ServiceSchema = schArticulos
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 449 Left = 449
Top = 259 Top = 197
Height = 300 Height = 300
Width = 300 Width = 300
object schArticulos: TDASchema object schArticulos: TDASchema

View File

@ -7,7 +7,7 @@ object srvAsientos: TsrvAsientos
ServiceSchema = schAsientos ServiceSchema = schAsientos
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 512 Left = 512
Top = 168 Top = 147
Height = 300 Height = 300
Width = 300 Width = 300
object schAsientos: TDASchema object schAsientos: TDASchema

View File

@ -7,7 +7,7 @@ object srvCitas: TsrvCitas
ServiceSchema = schCitas ServiceSchema = schCitas
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 502 Left = 502
Top = 206 Top = 180
Height = 184 Height = 184
Width = 245 Width = 245
object schCitas: TDASchema object schCitas: TDASchema

View File

@ -9,7 +9,7 @@ object srvContactos: TsrvContactos
ServiceSchema = schContactos ServiceSchema = schContactos
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 617 Left = 617
Top = 313 Top = 273
Height = 354 Height = 354
Width = 450 Width = 450
object schContactos: TDASchema object schContactos: TDASchema
@ -501,7 +501,7 @@ object srvContactos: TsrvContactos
Top = 16 Top = 16
end end
object frxReport1: TfrxReport object frxReport1: TfrxReport
Version = '3.15' Version = '3.23.7'
DotMatrixReport = False DotMatrixReport = False
EngineOptions.DoublePass = True EngineOptions.DoublePass = True
IniFile = '\Software\Fast Reports' IniFile = '\Software\Fast Reports'
@ -545,7 +545,7 @@ object srvContactos: TsrvContactos
Height = 18.897650000000000000 Height = 18.897650000000000000
DataSet = frxDBDataset1 DataSet = frxDBDataset1
DataSetName = 'frxDBDataset1' DataSetName = 'frxDBDataset1'
Memo.Strings = ( Memo.UTF8 = (
'[frxDBDataset1."nombre"]') '[frxDBDataset1."nombre"]')
end end
end end

Binary file not shown.

View File

@ -7,7 +7,7 @@ object srvCuentas: TsrvCuentas
ServiceSchema = schCuentas ServiceSchema = schCuentas
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 555 Left = 555
Top = 179 Top = 156
Height = 300 Height = 300
Width = 300 Width = 300
object schCuentas: TDASchema object schCuentas: TDASchema

View File

@ -680,4 +680,113 @@ object dmFacturasCliente: TdmFacturasCliente
Left = 48 Left = 48
Top = 152 Top = 152
end end
object tbl_ListaAnosFacturas: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosFacturas'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosFacturas'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosFacturas'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = dmBase.DABINAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosFacturas'
IndexDefs = <>
Left = 168
Top = 216
end
object ds_ListaAnosFacturas: TDADataSource
DataTable = tbl_ListaAnosFacturas
Left = 168
Top = 160
end
end end

View File

@ -21,6 +21,8 @@ type
ds_DetallesFacturasCliente: TDADataSource; ds_DetallesFacturasCliente: TDADataSource;
DADesigntimeCall1: TDADesigntimeCall; DADesigntimeCall1: TDADesigntimeCall;
RORemoteService2: TRORemoteService; RORemoteService2: TRORemoteService;
tbl_ListaAnosFacturas: TDACDSDataTable;
ds_ListaAnosFacturas: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
private private
{ Private declarations } { Private declarations }
@ -32,7 +34,10 @@ type
procedure Preview(Const Codigo: Integer); procedure Preview(Const Codigo: Integer);
function DarNuevaReferencia : String; function DarNuevaReferencia : String;
function PuedoEliminarFactura (CodigoFactura : Integer) : Boolean; function PuedoEliminarFactura (CodigoFactura : Integer) : Boolean;
procedure Refrescar(lReport: TfrxReport; Const Codigo: Integer; const TamLetra: Integer); procedure Refrescar(lReport: TfrxReport; Const Codigo: Integer; const TamLetra: Integer);
function DarListaAnosFacturas: TStringList;
procedure FiltrarAno(AFacturas: IBizFacturasCliente; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -43,8 +48,8 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Forms, Controls, uDataTableUtils, uBizContacto, Forms, Controls, cxControls, uDataTableUtils, uBizContacto,
uDataModuleContactos, uDataModuleBase, uDataModuleContactos, uDataModuleBase, uDAInterfaces,
FactuGES_Intf, uEditorPreviewFacturaCliente, uEditorPreview, FactuGES_Intf, uEditorPreviewFacturaCliente, uEditorPreview,
uROTypes, schFacturasClienteClient_Intf; uROTypes, schFacturasClienteClient_Intf;
@ -194,6 +199,55 @@ begin
lReport.ShowPreparedReport; lReport.ShowPreparedReport;
end; end;
function TdmFacturasCliente.DarListaAnosFacturas: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosFacturas do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
procedure TdmFacturasCliente.FiltrarAno(AFacturas: IBizFacturasCliente; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
AFacturas.DataTable.Where.Clear;
AFacturas.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los presupuestos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with AFacturas.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_FacturasClienteFECHAFACTURA, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_FacturasClienteFECHAFACTURA, cLessOrEqual, FechaFin);
end;
end;
end;
initialization initialization
dmFacturasCliente := TdmFacturasCliente.Create(nil); dmFacturasCliente := TdmFacturasCliente.Create(nil);

View File

@ -42,7 +42,15 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
end end
end end
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 395 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
end end
end end
inherited StatusBar: TStatusBar inherited StatusBar: TStatusBar

View File

@ -26,12 +26,17 @@ type
procedure actEliminarExecute(Sender: TObject); procedure actEliminarExecute(Sender: TObject);
procedure actModificarExecute(Sender: TObject); procedure actModificarExecute(Sender: TObject);
procedure actNuevoExecute(Sender: TObject); procedure actNuevoExecute(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
procedure FormShow(Sender: TObject);
private private
FFacturasCliente: IBizFacturasCliente; FFacturasCliente: IBizFacturasCliente;
protected protected
function GetFacturasCliente: IBizFacturasCliente; function GetFacturasCliente: IBizFacturasCliente;
procedure SetFacturasCliente(const Value: IBizFacturasCliente); procedure SetFacturasCliente(const Value: IBizFacturasCliente);
procedure SetViewGrid(const Value: IViewGrid); override; procedure SetViewGrid(const Value: IViewGrid); override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -122,13 +127,20 @@ begin
Result := FFacturasCliente; Result := FFacturasCliente;
end; end;
procedure TfEditorFacturasCliente.SetFacturasCliente(const Value: procedure TfEditorFacturasCliente.SetFacturasCliente(const Value: IBizFacturasCliente);
IBizFacturasCliente);
begin begin
FFacturasCliente := Value; FFacturasCliente := Value;
dsDataTable.DataTable := FFacturasCliente.DataTable;
if Assigned(ViewGrid) then if Assigned(FFacturasCliente) then
(ViewGrid as IViewFacturasCliente).FacturasCliente := FacturasCliente; begin
//Se guarda el where de la sentencia origen, por si el editor tiene filtros que
//afecten a este where y en un futuro se desea volver al where origen (filtro de año))
WhereDataTable := FFacturasCliente.DataTable.Where.Clause;
dsDataTable.DataTable := FFacturasCliente.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewFacturasCliente).FacturasCliente := FacturasCliente;
end;
end; end;
procedure TfEditorFacturasCliente.SetViewGrid(const Value: IViewGrid); procedure TfEditorFacturasCliente.SetViewGrid(const Value: IViewGrid);
@ -138,6 +150,21 @@ begin
(ViewGrid as IViewFacturasCliente).FacturasCliente := FFacturasCliente; (ViewGrid as IViewFacturasCliente).FacturasCliente := FFacturasCliente;
end; end;
procedure TfEditorFacturasCliente.FormShow(Sender: TObject);
begin
ListaAnos := dmFacturasCliente.DarListaAnosFacturas;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
end;
procedure TfEditorFacturasCliente.OnListaAnosChange(Sender: TObject; const Text: string);
begin
dmFacturasCliente.FiltrarAno(FacturasCliente, WhereDataTable, Text);
if FacturasCliente.DataTable.Active then
actRefrescar.Execute;
end;
initialization initialization
RegisterEditor(IBizFacturasCliente, ShowEditorFacturasCliente, etItems); RegisterEditor(IBizFacturasCliente, ShowEditorFacturasCliente, etItems);
RegisterEditor(IBizFacturasCliente, ShowSelectEditorFacturasCliente, etSelectItems); RegisterEditor(IBizFacturasCliente, ShowSelectEditorFacturasCliente, etSelectItems);

View File

@ -9,19 +9,27 @@ 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_DarReferenciaFactura = '{0A0311FE-E619-4E86-8FB5-DF8D223B48EA}'; RID_ListaAnosFacturas = '{42919587-DDC2-4D2F-8B79-4C034016B877}';
RID_FacturasCliente = '{896C2481-665F-4006-88F1-3C08F7AE938C}'; RID_DarReferenciaFactura = '{75D2C86E-2226-4165-AE57-6FBB114F6C38}';
RID_DetallesFacturasCliente = '{A966AEEF-FB48-42DA-A290-C9AD58B38E48}'; RID_FacturasCliente = '{46F2D1A1-F069-49C3-8FD7-F73A82EA4B30}';
RID_InformeCabeceraFacturaCliente = '{6652332A-E17A-44E7-9833-7CD70E9458C1}'; RID_DetallesFacturasCliente = '{BB44EE25-910C-4356-B962-792C1239F806}';
RID_InformeDetallesFacturaCliente = '{D240F619-DD60-4E7F-AB3F-E2B401E3236D}'; RID_InformeCabeceraFacturaCliente = '{865C733F-2C85-46C9-A40C-8A022512FC4E}';
RID_InformeDetallesFacturaCliente = '{E219BB9F-D3FD-438D-A03B-0E466305B8A9}';
{ Data table names } { Data table names }
nme_ListaAnosFacturas = 'ListaAnosFacturas';
nme_DarReferenciaFactura = 'DarReferenciaFactura'; nme_DarReferenciaFactura = 'DarReferenciaFactura';
nme_FacturasCliente = 'FacturasCliente'; nme_FacturasCliente = 'FacturasCliente';
nme_DetallesFacturasCliente = 'DetallesFacturasCliente'; nme_DetallesFacturasCliente = 'DetallesFacturasCliente';
nme_InformeCabeceraFacturaCliente = 'InformeCabeceraFacturaCliente'; nme_InformeCabeceraFacturaCliente = 'InformeCabeceraFacturaCliente';
nme_InformeDetallesFacturaCliente = 'InformeDetallesFacturaCliente'; nme_InformeDetallesFacturaCliente = 'InformeDetallesFacturaCliente';
{ ListaAnosFacturas fields }
fld_ListaAnosFacturasANO = 'ANO';
{ ListaAnosFacturas field indexes }
idx_ListaAnosFacturasANO = 0;
{ DarReferenciaFactura fields } { DarReferenciaFactura fields }
fld_DarReferenciaFacturaREFERENCIA = 'REFERENCIA'; fld_DarReferenciaFacturaREFERENCIA = 'REFERENCIA';
@ -165,9 +173,38 @@ const
idx_InformeDetallesFacturaClientePOSICION = 7; idx_InformeDetallesFacturaClientePOSICION = 7;
type type
{ IListaAnosFacturas }
IListaAnosFacturas = interface(IDAStronglyTypedDataTable)
['{728E1D30-3B2E-44F0-86B2-D18BDDE2C92C}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosFacturasDataTableRules }
TListaAnosFacturasDataTableRules = class(TDADataTableRules, IListaAnosFacturas)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IDarReferenciaFactura } { IDarReferenciaFactura }
IDarReferenciaFactura = interface(IDAStronglyTypedDataTable) IDarReferenciaFactura = interface(IDAStronglyTypedDataTable)
['{3780860F-0689-4DB4-87ED-879E5E0974B9}'] ['{E947ABD4-4AD9-41C2-9351-96CBCDFFF938}']
{ Property getters and setters } { Property getters and setters }
function GetREFERENCIAValue: String; function GetREFERENCIAValue: String;
procedure SetREFERENCIAValue(const aValue: String); procedure SetREFERENCIAValue(const aValue: String);
@ -196,7 +233,7 @@ type
{ IFacturasCliente } { IFacturasCliente }
IFacturasCliente = interface(IDAStronglyTypedDataTable) IFacturasCliente = interface(IDAStronglyTypedDataTable)
['{9AB55416-5EBD-4913-9D16-DFB75478A091}'] ['{1D8ABDA0-4A60-4470-9880-627ED9D48B67}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -351,7 +388,7 @@ type
{ IDetallesFacturasCliente } { IDetallesFacturasCliente }
IDetallesFacturasCliente = interface(IDAStronglyTypedDataTable) IDetallesFacturasCliente = interface(IDAStronglyTypedDataTable)
['{BF49E552-D331-4DD7-A1E9-6C246BE51E99}'] ['{5D2C18DA-1596-42C5-B509-360BFB347BDD}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOFACTURAValue: Integer; function GetCODIGOFACTURAValue: Integer;
procedure SetCODIGOFACTURAValue(const aValue: Integer); procedure SetCODIGOFACTURAValue(const aValue: Integer);
@ -428,7 +465,7 @@ type
{ IInformeCabeceraFacturaCliente } { IInformeCabeceraFacturaCliente }
IInformeCabeceraFacturaCliente = interface(IDAStronglyTypedDataTable) IInformeCabeceraFacturaCliente = interface(IDAStronglyTypedDataTable)
['{3C1DD3E9-BFEC-479A-91BE-9703C511AA3B}'] ['{64DCF384-1920-4E15-9B5A-BD3B2673C3C4}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -577,7 +614,7 @@ type
{ IInformeDetallesFacturaCliente } { IInformeDetallesFacturaCliente }
IInformeDetallesFacturaCliente = interface(IDAStronglyTypedDataTable) IInformeDetallesFacturaCliente = interface(IDAStronglyTypedDataTable)
['{8A9BE448-C659-4CA5-8C7C-B916FBF7E9C1}'] ['{398C14EC-410D-4756-B0B6-97EF74DA85D2}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOFACTURAValue: Integer; function GetCODIGOFACTURAValue: Integer;
procedure SetCODIGOFACTURAValue(const aValue: Integer); procedure SetCODIGOFACTURAValue(const aValue: Integer);
@ -650,6 +687,28 @@ implementation
uses Variants; uses Variants;
{ TListaAnosFacturasDataTableRules }
constructor TListaAnosFacturasDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosFacturasDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosFacturasDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosFacturasANO].AsString;
end;
procedure TListaAnosFacturasDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosFacturasANO].AsString := aValue;
end;
{ TDarReferenciaFacturaDataTableRules } { TDarReferenciaFacturaDataTableRules }
constructor TDarReferenciaFacturaDataTableRules.Create(aDataTable: TDADataTable); constructor TDarReferenciaFacturaDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -1325,6 +1384,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_ListaAnosFacturas, TListaAnosFacturasDataTableRules);
RegisterDataTableRules(RID_DarReferenciaFactura, TDarReferenciaFacturaDataTableRules); RegisterDataTableRules(RID_DarReferenciaFactura, TDarReferenciaFacturaDataTableRules);
RegisterDataTableRules(RID_FacturasCliente, TFacturasClienteDataTableRules); RegisterDataTableRules(RID_FacturasCliente, TFacturasClienteDataTableRules);
RegisterDataTableRules(RID_DetallesFacturasCliente, TDetallesFacturasClienteDataTableRules); RegisterDataTableRules(RID_DetallesFacturasCliente, TDetallesFacturasClienteDataTableRules);

View File

@ -9,16 +9,46 @@ 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_DarReferenciaFacturaDelta = '{F2A5D10C-55BF-43D0-BEE6-3712ED9D6EF7}'; RID_ListaAnosFacturasDelta = '{4A3D7BF0-E719-4050-B586-158542987232}';
RID_FacturasClienteDelta = '{E5E319FF-A856-43F4-A936-9BEA61505D26}'; RID_DarReferenciaFacturaDelta = '{83C26CE1-CD1F-49D4-9120-6EDE7CEEA2EA}';
RID_DetallesFacturasClienteDelta = '{7BDC4CEC-780B-4254-8D31-10F7DBDC2641}'; RID_FacturasClienteDelta = '{68C74297-5D44-444B-8771-A8E6D3D3271B}';
RID_InformeCabeceraFacturaClienteDelta = '{4EB09950-01DA-4E9E-A3A2-DECCB3A7812F}'; RID_DetallesFacturasClienteDelta = '{BD1FD6EF-39D5-452F-9839-1629116AF11F}';
RID_InformeDetallesFacturaClienteDelta = '{6666A20D-5DCA-4D7C-9AAE-46BE7FEF57F6}'; RID_InformeCabeceraFacturaClienteDelta = '{790B67BB-36BD-484E-8E99-288CC4E12849}';
RID_InformeDetallesFacturaClienteDelta = '{0EC5EBAE-B438-4B46-AC9F-C126476C5876}';
type type
{ IListaAnosFacturasDelta }
IListaAnosFacturasDelta = interface(IListaAnosFacturas)
['{4A3D7BF0-E719-4050-B586-158542987232}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosFacturasBusinessProcessorRules }
TListaAnosFacturasBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosFacturas, IListaAnosFacturasDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IDarReferenciaFacturaDelta } { IDarReferenciaFacturaDelta }
IDarReferenciaFacturaDelta = interface(IDarReferenciaFactura) IDarReferenciaFacturaDelta = interface(IDarReferenciaFactura)
['{F2A5D10C-55BF-43D0-BEE6-3712ED9D6EF7}'] ['{83C26CE1-CD1F-49D4-9120-6EDE7CEEA2EA}']
{ Property getters and setters } { Property getters and setters }
function GetOldREFERENCIAValue : String; function GetOldREFERENCIAValue : String;
@ -47,7 +77,7 @@ type
{ IFacturasClienteDelta } { IFacturasClienteDelta }
IFacturasClienteDelta = interface(IFacturasCliente) IFacturasClienteDelta = interface(IFacturasCliente)
['{E5E319FF-A856-43F4-A936-9BEA61505D26}'] ['{68C74297-5D44-444B-8771-A8E6D3D3271B}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -223,7 +253,7 @@ type
{ IDetallesFacturasClienteDelta } { IDetallesFacturasClienteDelta }
IDetallesFacturasClienteDelta = interface(IDetallesFacturasCliente) IDetallesFacturasClienteDelta = interface(IDetallesFacturasCliente)
['{7BDC4CEC-780B-4254-8D31-10F7DBDC2641}'] ['{BD1FD6EF-39D5-452F-9839-1629116AF11F}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOFACTURAValue : Integer; function GetOldCODIGOFACTURAValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -308,7 +338,7 @@ type
{ IInformeCabeceraFacturaClienteDelta } { IInformeCabeceraFacturaClienteDelta }
IInformeCabeceraFacturaClienteDelta = interface(IInformeCabeceraFacturaCliente) IInformeCabeceraFacturaClienteDelta = interface(IInformeCabeceraFacturaCliente)
['{4EB09950-01DA-4E9E-A3A2-DECCB3A7812F}'] ['{790B67BB-36BD-484E-8E99-288CC4E12849}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -477,7 +507,7 @@ type
{ IInformeDetallesFacturaClienteDelta } { IInformeDetallesFacturaClienteDelta }
IInformeDetallesFacturaClienteDelta = interface(IInformeDetallesFacturaCliente) IInformeDetallesFacturaClienteDelta = interface(IInformeDetallesFacturaCliente)
['{6666A20D-5DCA-4D7C-9AAE-46BE7FEF57F6}'] ['{0EC5EBAE-B438-4B46-AC9F-C126476C5876}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOFACTURAValue : Integer; function GetOldCODIGOFACTURAValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -558,6 +588,33 @@ implementation
uses uses
Variants, uROBinaryHelpers; Variants, uROBinaryHelpers;
{ TListaAnosFacturasBusinessProcessorRules }
constructor TListaAnosFacturasBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosFacturasBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosFacturasBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosFacturasANO];
end;
function TListaAnosFacturasBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosFacturasANO];
end;
procedure TListaAnosFacturasBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosFacturasANO] := aValue;
end;
{ TDarReferenciaFacturaBusinessProcessorRules } { TDarReferenciaFacturaBusinessProcessorRules }
constructor TDarReferenciaFacturaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TDarReferenciaFacturaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -1542,6 +1599,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_ListaAnosFacturasDelta, TListaAnosFacturasBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_DarReferenciaFacturaDelta, TDarReferenciaFacturaBusinessProcessorRules); RegisterBusinessProcessorRules(RID_DarReferenciaFacturaDelta, TDarReferenciaFacturaBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_FacturasClienteDelta, TFacturasClienteBusinessProcessorRules); RegisterBusinessProcessorRules(RID_FacturasClienteDelta, TFacturasClienteBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_DetallesFacturasClienteDelta, TDetallesFacturasClienteBusinessProcessorRules); RegisterBusinessProcessorRules(RID_DetallesFacturasClienteDelta, TDetallesFacturasClienteBusinessProcessorRules);

View File

@ -6,8 +6,8 @@ object srvFacturasCliente: TsrvFacturasCliente
ConnectionName = 'IBX' ConnectionName = 'IBX'
ServiceSchema = schFacturasCliente ServiceSchema = schFacturasCliente
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 711 Left = 710
Top = 310 Top = 270
Height = 490 Height = 490
Width = 347 Width = 347
object schFacturasCliente: TDASchema object schFacturasCliente: TDASchema
@ -15,6 +15,39 @@ object srvFacturasCliente: TsrvFacturasCliente
DataDictionary = dmServer.DataDictionary DataDictionary = dmServer.DataDictionary
Diagrams = dmServer.DADiagrams Diagrams = dmServer.DADiagrams
Datasets = < Datasets = <
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAfactura, 1,4)) as A' +
'NO'#10'from facturascliente'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select dist' +
'inct '#39'Todos'#39' as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosFacturas'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = <> Params = <>
Statements = < Statements = <

View File

@ -38,8 +38,8 @@ type
frxDotMatrixExport1: TfrxDotMatrixExport; frxDotMatrixExport1: TfrxDotMatrixExport;
frxDialogControls1: TfrxDialogControls; frxDialogControls1: TfrxDialogControls;
DABINAdapter: TDABINAdapter; DABINAdapter: TDABINAdapter;
schFacturasCliente: TDASchema;
frxReport1: TfrxReport; frxReport1: TfrxReport;
schFacturasCliente: TDASchema;
private private
protected protected
{ IsrvFacturasCliente methods } { IsrvFacturasCliente methods }

View File

@ -448,4 +448,113 @@ object dmFacturasProveedor: TdmFacturasProveedor
Left = 48 Left = 48
Top = 88 Top = 88
end end
object tbl_ListaAnosFacturas: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosFacturas'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosFacturas'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosFacturas'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = dmBase.DABINAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosFacturas'
IndexDefs = <>
Left = 152
Top = 144
end
object ds_ListaAnosFacturas: TDADataSource
DataTable = tbl_ListaAnosFacturas
Left = 152
Top = 96
end
end end

View File

@ -14,6 +14,8 @@ type
tbl_FacturasProveedor: TDACDSDataTable; tbl_FacturasProveedor: TDACDSDataTable;
ds_FacturasProveedor: TDADataSource; ds_FacturasProveedor: TDADataSource;
DADesigntimeCall1: TDADesigntimeCall; DADesigntimeCall1: TDADesigntimeCall;
tbl_ListaAnosFacturas: TDACDSDataTable;
ds_ListaAnosFacturas: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
private private
{ Private declarations } { Private declarations }
@ -22,6 +24,9 @@ type
function GetItem: IBizFacturasProveedor; function GetItem: IBizFacturasProveedor;
function GetItems: IBizFacturasProveedor; function GetItems: IBizFacturasProveedor;
function PuedoEliminarFactura (CodigoFactura : Integer) : Boolean; function PuedoEliminarFactura (CodigoFactura : Integer) : Boolean;
function DarListaAnosFacturas: TStringList;
procedure FiltrarAno(AFacturas: IBizFacturasProveedor; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -32,8 +37,8 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Forms, Controls, uDataTableUtils, uBizContacto, Forms, Controls, cxControls, uDataTableUtils, uBizContacto,
uDataModuleContactos, uDataModuleBase, uDataModuleContactos, uDataModuleBase, uDAInterfaces,
FactuGES_Intf, uEditorPreview, uROTypes, schFacturasProveedorClient_Intf; FactuGES_Intf, uEditorPreview, uROTypes, schFacturasProveedorClient_Intf;
{ TDAClientDataModule1 } { TDAClientDataModule1 }
@ -121,6 +126,55 @@ begin
Result := (RORemoteService as IsrvFacturasProveedor).PuedoEliminarFactura(CodigoFactura); Result := (RORemoteService as IsrvFacturasProveedor).PuedoEliminarFactura(CodigoFactura);
end; end;
function TdmFacturasProveedor.DarListaAnosFacturas: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosFacturas do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
procedure TdmFacturasProveedor.FiltrarAno(AFacturas: IBizFacturasProveedor; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
AFacturas.DataTable.Where.Clear;
AFacturas.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los presupuestos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with AFacturas.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_FacturasProveedorFECHAFACTURA, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_FacturasProveedorFECHAFACTURA, cLessOrEqual, FechaFin);
end;
end;
end;
initialization initialization
dmFacturasProveedor := TdmFacturasProveedor.Create(nil); dmFacturasProveedor := TdmFacturasProveedor.Create(nil);

View File

@ -36,7 +36,15 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
end end
end end
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 411 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
end end
end end
inherited EditorActionList: TActionList inherited EditorActionList: TActionList

View File

@ -24,6 +24,9 @@ type
procedure actEliminarExecute(Sender: TObject); procedure actEliminarExecute(Sender: TObject);
procedure actModificarExecute(Sender: TObject); procedure actModificarExecute(Sender: TObject);
procedure actNuevoExecute(Sender: TObject); procedure actNuevoExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
private private
FFacturasProveedor: IBizFacturasProveedor; FFacturasProveedor: IBizFacturasProveedor;
protected protected
@ -137,6 +140,21 @@ begin
(ViewGrid as IViewFacturasProveedor).FacturasProveedor := FFacturasProveedor; (ViewGrid as IViewFacturasProveedor).FacturasProveedor := FFacturasProveedor;
end; end;
procedure TfEditorFacturasProveedor.FormShow(Sender: TObject);
begin
ListaAnos := dmFacturasProveedor.DarListaAnosFacturas;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
end;
procedure TfEditorFacturasProveedor.OnListaAnosChange(Sender: TObject; const Text: string);
begin
dmFacturasProveedor.FiltrarAno(FacturasProveedor, WhereDataTable, Text);
if FacturasProveedor.DataTable.Active then
actRefrescar.Execute;
end;
initialization initialization
RegisterEditor(IBizFacturasProveedor, ShowEditorFacturasProveedor, etItems); RegisterEditor(IBizFacturasProveedor, ShowEditorFacturasProveedor, etItems);
RegisterEditor(IBizFacturasProveedor, ShowSelectEditorFacturasProveedor, etSelectItems); RegisterEditor(IBizFacturasProveedor, ShowSelectEditorFacturasProveedor, etSelectItems);

View File

@ -9,11 +9,19 @@ 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_FacturasProveedor = '{3F8DC163-805B-44BC-9D8A-90A0A6527F1B}'; RID_ListaAnosFacturas = '{A357058B-4217-48F4-A5D2-9C243409ABAE}';
RID_FacturasProveedor = '{DF327921-CD7F-42FB-A1F9-0F1642C8826E}';
{ Data table names } { Data table names }
nme_ListaAnosFacturas = 'ListaAnosFacturas';
nme_FacturasProveedor = 'FacturasProveedor'; nme_FacturasProveedor = 'FacturasProveedor';
{ ListaAnosFacturas fields }
fld_ListaAnosFacturasANO = 'ANO';
{ ListaAnosFacturas field indexes }
idx_ListaAnosFacturasANO = 0;
{ FacturasProveedor fields } { FacturasProveedor fields }
fld_FacturasProveedorCODIGOEMPRESA = 'CODIGOEMPRESA'; fld_FacturasProveedorCODIGOEMPRESA = 'CODIGOEMPRESA';
fld_FacturasProveedorCODIGO = 'CODIGO'; fld_FacturasProveedorCODIGO = 'CODIGO';
@ -63,9 +71,38 @@ const
idx_FacturasProveedorPOBLACION = 21; idx_FacturasProveedorPOBLACION = 21;
type type
{ IListaAnosFacturas }
IListaAnosFacturas = interface(IDAStronglyTypedDataTable)
['{BB47DCBF-79F2-4F47-B2FB-78344C6265D9}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosFacturasDataTableRules }
TListaAnosFacturasDataTableRules = class(TDADataTableRules, IListaAnosFacturas)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IFacturasProveedor } { IFacturasProveedor }
IFacturasProveedor = interface(IDAStronglyTypedDataTable) IFacturasProveedor = interface(IDAStronglyTypedDataTable)
['{B8F57619-27F5-4D11-A277-5F3873F0A4E8}'] ['{03DE23C9-A1E1-41CB-B3AB-4E923905D12C}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -222,6 +259,28 @@ implementation
uses Variants; uses Variants;
{ TListaAnosFacturasDataTableRules }
constructor TListaAnosFacturasDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosFacturasDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosFacturasDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosFacturasANO].AsString;
end;
procedure TListaAnosFacturasDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosFacturasANO].AsString := aValue;
end;
{ TFacturasProveedorDataTableRules } { TFacturasProveedorDataTableRules }
constructor TFacturasProveedorDataTableRules.Create(aDataTable: TDADataTable); constructor TFacturasProveedorDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -457,6 +516,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_ListaAnosFacturas, TListaAnosFacturasDataTableRules);
RegisterDataTableRules(RID_FacturasProveedor, TFacturasProveedorDataTableRules); RegisterDataTableRules(RID_FacturasProveedor, TFacturasProveedorDataTableRules);
end. end.

View File

@ -9,12 +9,42 @@ 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_FacturasProveedorDelta = '{F350F1F7-81A3-49B7-BD15-015F6A05A808}'; RID_ListaAnosFacturasDelta = '{8208DBF7-1A9B-4F24-B4E8-18CF5DC51A1E}';
RID_FacturasProveedorDelta = '{48F74298-152B-4B34-88EB-AF07A72D390A}';
type type
{ IListaAnosFacturasDelta }
IListaAnosFacturasDelta = interface(IListaAnosFacturas)
['{8208DBF7-1A9B-4F24-B4E8-18CF5DC51A1E}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosFacturasBusinessProcessorRules }
TListaAnosFacturasBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosFacturas, IListaAnosFacturasDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IFacturasProveedorDelta } { IFacturasProveedorDelta }
IFacturasProveedorDelta = interface(IFacturasProveedor) IFacturasProveedorDelta = interface(IFacturasProveedor)
['{F350F1F7-81A3-49B7-BD15-015F6A05A808}'] ['{48F74298-152B-4B34-88EB-AF07A72D390A}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -193,6 +223,33 @@ implementation
uses uses
Variants, uROBinaryHelpers; Variants, uROBinaryHelpers;
{ TListaAnosFacturasBusinessProcessorRules }
constructor TListaAnosFacturasBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosFacturasBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosFacturasBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosFacturasANO];
end;
function TListaAnosFacturasBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosFacturasANO];
end;
procedure TListaAnosFacturasBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosFacturasANO] := aValue;
end;
{ TFacturasProveedorBusinessProcessorRules } { TFacturasProveedorBusinessProcessorRules }
constructor TFacturasProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TFacturasProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -540,6 +597,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_ListaAnosFacturasDelta, TListaAnosFacturasBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_FacturasProveedorDelta, TFacturasProveedorBusinessProcessorRules); RegisterBusinessProcessorRules(RID_FacturasProveedorDelta, TFacturasProveedorBusinessProcessorRules);
end. end.

View File

@ -7,7 +7,7 @@ object srvFacturasProveedor: TsrvFacturasProveedor
ServiceSchema = schFacturasProveedor ServiceSchema = schFacturasProveedor
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 477 Left = 477
Top = 382 Top = 333
Height = 392 Height = 392
Width = 369 Width = 369
object schFacturasProveedor: TDASchema object schFacturasProveedor: TDASchema
@ -15,6 +15,39 @@ object srvFacturasProveedor: TsrvFacturasProveedor
DataDictionary = dmServer.DataDictionary DataDictionary = dmServer.DataDictionary
Diagrams = dmServer.DADiagrams Diagrams = dmServer.DADiagrams
Datasets = < Datasets = <
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAFACTURA, 1,4)) as A' +
'NO'#10'from facturasproveedor'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select di' +
'stinct '#39'Todos'#39' as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosFacturas'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = <> Params = <>
Statements = < Statements = <

View File

@ -20,8 +20,8 @@ uses
type type
{ TsrvFacturasProveedor } { TsrvFacturasProveedor }
TsrvFacturasProveedor = class(TDARemoteService, IsrvFacturasProveedor) TsrvFacturasProveedor = class(TDARemoteService, IsrvFacturasProveedor)
schFacturasProveedor: TDASchema;
DABINAdapter: TDABINAdapter; DABINAdapter: TDABINAdapter;
schFacturasProveedor: TDASchema;
private private
protected protected
{ IsrvFacturasProveedor methods } { IsrvFacturasProveedor methods }

View File

@ -7,7 +7,7 @@ object srvIntervalos: TsrvIntervalos
ServiceSchema = schIntervalos ServiceSchema = schIntervalos
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 444 Left = 444
Top = 205 Top = 179
Height = 300 Height = 300
Width = 300 Width = 300
object schIntervalos: TDASchema object schIntervalos: TDASchema

View File

@ -13,7 +13,7 @@ object dmMontajes: TdmMontajes
Left = 564 Left = 564
Top = 347 Top = 347
Height = 335 Height = 335
Width = 343 Width = 536
object RORemoteService: TRORemoteService object RORemoteService: TRORemoteService
ServiceName = 'srvMontajes' ServiceName = 'srvMontajes'
Message = dmBase.ROMessage Message = dmBase.ROMessage
@ -616,4 +616,113 @@ object dmMontajes: TdmMontajes
Left = 240 Left = 240
Top = 200 Top = 200
end end
object tbl_ListaAnosMontajes: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosMontajes'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosMontajes'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosMontajes'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = DABINAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosMontajes'
IndexDefs = <>
Left = 344
Top = 88
end
object ds_ListaAnosMontajes: TDADataSource
DataTable = tbl_ListaAnosMontajes
Left = 344
Top = 24
end
end end

View File

@ -18,6 +18,8 @@ type
ds_FichaBeneficios: TDADataSource; ds_FichaBeneficios: TDADataSource;
tbl_FichaBeneficios_Aux: TDACDSDataTable; tbl_FichaBeneficios_Aux: TDACDSDataTable;
ds_FichaBeneficios_Aux: TDADataSource; ds_FichaBeneficios_Aux: TDADataSource;
tbl_ListaAnosMontajes: TDACDSDataTable;
ds_ListaAnosMontajes: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
public public
function GetItems: IBizMontaje; overload; function GetItems: IBizMontaje; overload;
@ -34,7 +36,10 @@ type
function darFichaBeneficiosAux: IFichaBeneficios_Aux; function darFichaBeneficiosAux: IFichaBeneficios_Aux;
procedure NuevoMontaje(AMontaje: IBizMontaje; APresupuesto: IBizPresupuestos); procedure NuevoMontaje(AMontaje: IBizMontaje; APresupuesto: IBizPresupuestos);
function CambiarSituacion(CodigoPresupuesto: Integer; Situacion: TEnumSituacion): String; function CambiarSituacion(CodigoPresupuesto: Integer; Situacion: TEnumSituacion): String;
function DarNuevaReferencia (TipoMontaje : String) : String; function DarNuevaReferencia (TipoMontaje : String) : String;
function DarListaAnosMontajes: TStringList;
procedure FiltrarAno(AMontajes: IBizMontaje; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -45,7 +50,7 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Controls, Forms, uDAInterfaces, DataAbstract_Intf, FactuGES_Intf, Controls, cxControls, Forms, uDAInterfaces, DataAbstract_Intf, FactuGES_Intf,
uDataTableUtils, uROTypes, uEditorPreview, uDataTableUtils, uROTypes, uEditorPreview,
Dialogs, uDataModuleBase, uDBSelectionList, Dialogs, uDataModuleBase, uDBSelectionList,
uDataModuleContactos, uDataModulePresupuestos; uDataModuleContactos, uDataModulePresupuestos;
@ -364,6 +369,55 @@ begin
Result := (RORemoteService as IsrvMontajes).DarNuevaReferencia(TipoMontaje); Result := (RORemoteService as IsrvMontajes).DarNuevaReferencia(TipoMontaje);
end; end;
function TdmMontajes.DarListaAnosMontajes: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosMontajes do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
procedure TdmMontajes.FiltrarAno(AMontajes: IBizMontaje; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
AMontajes.DataTable.Where.Clear;
AMontajes.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los presupuestos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with AMontajes.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_MontajesFECHAINICIO, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_MontajesFECHAINICIO, cLessOrEqual, FechaFin);
end;
end;
end;
initialization initialization
dmMontajes := TdmMontajes.Create(nil); dmMontajes := TdmMontajes.Create(nil);

View File

@ -41,7 +41,15 @@ inherited fEditorMontajes: TfEditorMontajes
inherited TBXDock: TTBXDock inherited TBXDock: TTBXDock
Width = 742 Width = 742
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 411 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
inherited tbxEditFiltro: TTBXEditItem inherited tbxEditFiltro: TTBXEditItem
EditOptions = [tboUseEditWhenVertical] EditOptions = [tboUseEditWhenVertical]
end end

View File

@ -32,14 +32,18 @@ type
procedure actModificarExecute(Sender: TObject); procedure actModificarExecute(Sender: TObject);
procedure actEliminarExecute(Sender: TObject); procedure actEliminarExecute(Sender: TObject);
procedure frViewBarraSeleccionactSeleccionarExecute(Sender: TObject); procedure frViewBarraSeleccionactSeleccionarExecute(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
private private
FMontajes: IBizMontaje; FMontajes: IBizMontaje;
protected protected
function GetMontajes: IBizMontaje; virtual; function GetMontajes: IBizMontaje; virtual;
procedure SetMontajes(const Value: IBizMontaje); virtual; procedure SetMontajes(const Value: IBizMontaje); virtual;
procedure SetViewGrid(const Value: IViewGrid); override; procedure SetViewGrid(const Value: IViewGrid); override;
function GetSelectionBarVisible: Boolean; virtual; function GetSelectionBarVisible: Boolean; virtual;
procedure SetSelectionBarVisible(const Value: Boolean); virtual; procedure SetSelectionBarVisible(const Value: Boolean); virtual;
public public
property SelectionBarVisible : Boolean read GetSelectionBarVisible write property SelectionBarVisible : Boolean read GetSelectionBarVisible write
SetSelectionBarVisible; SetSelectionBarVisible;
@ -90,6 +94,9 @@ end;
} }
procedure TfEditorMontajes.FormShow(Sender: TObject); procedure TfEditorMontajes.FormShow(Sender: TObject);
begin begin
ListaAnos := dmMontajes.DarListaAnosMontajes;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited; inherited;
if not Assigned(ViewGrid) then if not Assigned(ViewGrid) then
@ -191,6 +198,13 @@ begin
end; end;
end; end;
procedure TfEditorMontajes.OnListaAnosChange(Sender: TObject; const Text: string);
begin
dmMontajes.FiltrarAno(Montajes, WhereDataTable, Text);
if Montajes.DataTable.Active then
actRefrescar.Execute;
end;
initialization initialization
RegisterEditor(IBizMontaje, ShowEditorMontajes, etItems); RegisterEditor(IBizMontaje, ShowEditorMontajes, etItems);
RegisterEditor(IBizMontaje, ShowSelectEditorMontajes, etSelectItems); RegisterEditor(IBizMontaje, ShowSelectEditorMontajes, etSelectItems);

View File

@ -9,15 +9,17 @@ 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_darNuevaReferencia = '{6547ACA4-805B-4EE7-9499-2D0196BEFC6F}'; RID_ListaAnosMontajes = '{8A77AA23-1850-4C51-9890-61883469A21D}';
RID_InformeCabeceraFicha = '{F09A7509-40A9-480E-8E43-F05EF537125E}'; RID_darNuevaReferencia = '{98BF35DF-261B-4AF5-B3EC-024D293CB3BF}';
RID_Montajes = '{C70762DB-3285-4C26-888D-63B20160927C}'; RID_InformeCabeceraFicha = '{9FCA86CA-5B72-45D8-8B2E-623344608585}';
RID_Refresh_Montajes = '{40108B41-7E49-4883-9528-3FBD57B56703}'; RID_Montajes = '{EA56C374-7E7B-4FC5-8C42-1D65BA1BD7EF}';
RID_FichaBeneficios = '{573182C2-5168-428D-99A9-5BFBA9E74705}'; RID_Refresh_Montajes = '{A948AC0C-F4EF-465D-B2DD-FA4301D3B029}';
RID_InformeDetallesFicha = '{BA1E0ABA-559C-4A1A-B028-32382BB3111A}'; RID_FichaBeneficios = '{8572BE0C-91B5-4D2C-B729-BB13BAEBC13D}';
RID_FichaBeneficios_Aux = '{706C0AC4-9532-4640-AAF4-BFA1DCD52D26}'; RID_InformeDetallesFicha = '{D3E3E171-62A4-465E-A954-3EDF6EB38F6F}';
RID_FichaBeneficios_Aux = '{5D3EC453-7D49-4AB0-98C0-7F0807279919}';
{ Data table names } { Data table names }
nme_ListaAnosMontajes = 'ListaAnosMontajes';
nme_darNuevaReferencia = 'darNuevaReferencia'; nme_darNuevaReferencia = 'darNuevaReferencia';
nme_InformeCabeceraFicha = 'InformeCabeceraFicha'; nme_InformeCabeceraFicha = 'InformeCabeceraFicha';
nme_Montajes = 'Montajes'; nme_Montajes = 'Montajes';
@ -26,6 +28,12 @@ const
nme_InformeDetallesFicha = 'InformeDetallesFicha'; nme_InformeDetallesFicha = 'InformeDetallesFicha';
nme_FichaBeneficios_Aux = 'FichaBeneficios_Aux'; nme_FichaBeneficios_Aux = 'FichaBeneficios_Aux';
{ ListaAnosMontajes fields }
fld_ListaAnosMontajesANO = 'ANO';
{ ListaAnosMontajes field indexes }
idx_ListaAnosMontajesANO = 0;
{ darNuevaReferencia fields } { darNuevaReferencia fields }
fld_darNuevaReferenciaREFERENCIA = 'REFERENCIA'; fld_darNuevaReferenciaREFERENCIA = 'REFERENCIA';
@ -167,9 +175,38 @@ const
idx_FichaBeneficios_AuxDESCRIPCION = 1; idx_FichaBeneficios_AuxDESCRIPCION = 1;
type type
{ IListaAnosMontajes }
IListaAnosMontajes = interface(IDAStronglyTypedDataTable)
['{6FCA63AA-AE36-4EF9-BFCB-91693E467AE1}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosMontajesDataTableRules }
TListaAnosMontajesDataTableRules = class(TDADataTableRules, IListaAnosMontajes)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IdarNuevaReferencia } { IdarNuevaReferencia }
IdarNuevaReferencia = interface(IDAStronglyTypedDataTable) IdarNuevaReferencia = interface(IDAStronglyTypedDataTable)
['{1D96C64B-6FB2-4AAF-8444-A92600498486}'] ['{A6774E16-4A24-4A3D-A8D6-93ADD76C90AF}']
{ Property getters and setters } { Property getters and setters }
function GetREFERENCIAValue: String; function GetREFERENCIAValue: String;
procedure SetREFERENCIAValue(const aValue: String); procedure SetREFERENCIAValue(const aValue: String);
@ -198,7 +235,7 @@ type
{ IInformeCabeceraFicha } { IInformeCabeceraFicha }
IInformeCabeceraFicha = interface(IDAStronglyTypedDataTable) IInformeCabeceraFicha = interface(IDAStronglyTypedDataTable)
['{72D2A87F-6179-41A5-84D9-22060DEE9727}'] ['{232A3364-2478-4717-BD42-3DBAE60B11CC}']
{ Property getters and setters } { Property getters and setters }
function GetREFERENCIAValue: String; function GetREFERENCIAValue: String;
procedure SetREFERENCIAValue(const aValue: String); procedure SetREFERENCIAValue(const aValue: String);
@ -311,7 +348,7 @@ type
{ IMontajes } { IMontajes }
IMontajes = interface(IDAStronglyTypedDataTable) IMontajes = interface(IDAStronglyTypedDataTable)
['{ECCCC9FA-E3EF-4F98-9B46-795A66D964DB}'] ['{E50B9717-4671-4DC6-896B-F2C3EC14C399}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -412,7 +449,7 @@ type
{ IRefresh_Montajes } { IRefresh_Montajes }
IRefresh_Montajes = interface(IDAStronglyTypedDataTable) IRefresh_Montajes = interface(IDAStronglyTypedDataTable)
['{FAB2B839-6970-4AB2-A8BC-088A8B74FDCC}'] ['{B31A8001-6DF2-4389-9347-423642175B74}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -513,7 +550,7 @@ type
{ IFichaBeneficios } { IFichaBeneficios }
IFichaBeneficios = interface(IDAStronglyTypedDataTable) IFichaBeneficios = interface(IDAStronglyTypedDataTable)
['{7C92B973-791A-477D-8DE0-BF61AF95236A}'] ['{CBD6AD21-2417-45BD-B514-D9D3ACA64E4F}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOMONTAJEValue: Integer; function GetCODIGOMONTAJEValue: Integer;
procedure SetCODIGOMONTAJEValue(const aValue: Integer); procedure SetCODIGOMONTAJEValue(const aValue: Integer);
@ -578,7 +615,7 @@ type
{ IInformeDetallesFicha } { IInformeDetallesFicha }
IInformeDetallesFicha = interface(IDAStronglyTypedDataTable) IInformeDetallesFicha = interface(IDAStronglyTypedDataTable)
['{16284B23-DBDE-405F-9307-CAFDDB913576}'] ['{CDD0B24E-43DC-4BE9-9451-49126D130C35}']
{ Property getters and setters } { Property getters and setters }
function GetDESCRIPCIONValue: String; function GetDESCRIPCIONValue: String;
procedure SetDESCRIPCIONValue(const aValue: String); procedure SetDESCRIPCIONValue(const aValue: String);
@ -631,7 +668,7 @@ type
{ IFichaBeneficios_Aux } { IFichaBeneficios_Aux }
IFichaBeneficios_Aux = interface(IDAStronglyTypedDataTable) IFichaBeneficios_Aux = interface(IDAStronglyTypedDataTable)
['{C14BE74A-4651-4387-A6E3-048197F0CAC9}'] ['{AE5C37AD-B172-4181-8726-C94153D32E9B}']
{ Property getters and setters } { Property getters and setters }
function GetNUMCONCEPTOValue: Integer; function GetNUMCONCEPTOValue: Integer;
procedure SetNUMCONCEPTOValue(const aValue: Integer); procedure SetNUMCONCEPTOValue(const aValue: Integer);
@ -668,6 +705,28 @@ implementation
uses Variants; uses Variants;
{ TListaAnosMontajesDataTableRules }
constructor TListaAnosMontajesDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosMontajesDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosMontajesDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosMontajesANO].AsString;
end;
procedure TListaAnosMontajesDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosMontajesANO].AsString := aValue;
end;
{ TdarNuevaReferenciaDataTableRules } { TdarNuevaReferenciaDataTableRules }
constructor TdarNuevaReferenciaDataTableRules.Create(aDataTable: TDADataTable); constructor TdarNuevaReferenciaDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -1316,6 +1375,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_ListaAnosMontajes, TListaAnosMontajesDataTableRules);
RegisterDataTableRules(RID_darNuevaReferencia, TdarNuevaReferenciaDataTableRules); RegisterDataTableRules(RID_darNuevaReferencia, TdarNuevaReferenciaDataTableRules);
RegisterDataTableRules(RID_InformeCabeceraFicha, TInformeCabeceraFichaDataTableRules); RegisterDataTableRules(RID_InformeCabeceraFicha, TInformeCabeceraFichaDataTableRules);
RegisterDataTableRules(RID_Montajes, TMontajesDataTableRules); RegisterDataTableRules(RID_Montajes, TMontajesDataTableRules);

View File

@ -9,18 +9,48 @@ 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_darNuevaReferenciaDelta = '{5C9B1530-2031-47B8-A401-B55FE08E3EB7}'; RID_ListaAnosMontajesDelta = '{A1079675-6804-43A1-8113-4C69034E612B}';
RID_InformeCabeceraFichaDelta = '{F5A62AC1-DF4E-4510-942E-3595C5BC5137}'; RID_darNuevaReferenciaDelta = '{B926E1E9-D5FE-4AD9-81B6-6DB568BAF1AC}';
RID_MontajesDelta = '{939D89F0-AEBE-4E5F-9F1C-05829C1C9AD4}'; RID_InformeCabeceraFichaDelta = '{295D1406-43D2-4AB6-90C5-3C77F026EEF1}';
RID_Refresh_MontajesDelta = '{A7E3BF24-EC68-403B-9732-11DA2807356E}'; RID_MontajesDelta = '{2E686B2F-A149-44D8-B8A0-978EF00888B3}';
RID_FichaBeneficiosDelta = '{E6D1DA2C-DE89-4F62-B1C1-8DE78BBF1F76}'; RID_Refresh_MontajesDelta = '{A0465C98-DB95-4236-B3CE-5D2580AED7A0}';
RID_InformeDetallesFichaDelta = '{FAC578F4-482B-4E46-8C07-D7C521604FCA}'; RID_FichaBeneficiosDelta = '{E75F17B7-C959-49D7-84B3-55AA239759FC}';
RID_FichaBeneficios_AuxDelta = '{3E015966-D349-4153-B8F8-4F083CD724F5}'; RID_InformeDetallesFichaDelta = '{E97CAB1B-CCB0-4710-95F3-9AD8D1C9305F}';
RID_FichaBeneficios_AuxDelta = '{BB83B8A0-16FB-43C4-8776-0A2DDCE8A85B}';
type type
{ IListaAnosMontajesDelta }
IListaAnosMontajesDelta = interface(IListaAnosMontajes)
['{A1079675-6804-43A1-8113-4C69034E612B}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosMontajesBusinessProcessorRules }
TListaAnosMontajesBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosMontajes, IListaAnosMontajesDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IdarNuevaReferenciaDelta } { IdarNuevaReferenciaDelta }
IdarNuevaReferenciaDelta = interface(IdarNuevaReferencia) IdarNuevaReferenciaDelta = interface(IdarNuevaReferencia)
['{5C9B1530-2031-47B8-A401-B55FE08E3EB7}'] ['{B926E1E9-D5FE-4AD9-81B6-6DB568BAF1AC}']
{ Property getters and setters } { Property getters and setters }
function GetOldREFERENCIAValue : String; function GetOldREFERENCIAValue : String;
@ -49,7 +79,7 @@ type
{ IInformeCabeceraFichaDelta } { IInformeCabeceraFichaDelta }
IInformeCabeceraFichaDelta = interface(IInformeCabeceraFicha) IInformeCabeceraFichaDelta = interface(IInformeCabeceraFicha)
['{F5A62AC1-DF4E-4510-942E-3595C5BC5137}'] ['{295D1406-43D2-4AB6-90C5-3C77F026EEF1}']
{ Property getters and setters } { Property getters and setters }
function GetOldREFERENCIAValue : String; function GetOldREFERENCIAValue : String;
function GetOldFECHAINICIOValue : DateTime; function GetOldFECHAINICIOValue : DateTime;
@ -176,7 +206,7 @@ type
{ IMontajesDelta } { IMontajesDelta }
IMontajesDelta = interface(IMontajes) IMontajesDelta = interface(IMontajes)
['{939D89F0-AEBE-4E5F-9F1C-05829C1C9AD4}'] ['{2E686B2F-A149-44D8-B8A0-978EF00888B3}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -289,7 +319,7 @@ type
{ IRefresh_MontajesDelta } { IRefresh_MontajesDelta }
IRefresh_MontajesDelta = interface(IRefresh_Montajes) IRefresh_MontajesDelta = interface(IRefresh_Montajes)
['{A7E3BF24-EC68-403B-9732-11DA2807356E}'] ['{A0465C98-DB95-4236-B3CE-5D2580AED7A0}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -402,7 +432,7 @@ type
{ IFichaBeneficiosDelta } { IFichaBeneficiosDelta }
IFichaBeneficiosDelta = interface(IFichaBeneficios) IFichaBeneficiosDelta = interface(IFichaBeneficios)
['{E6D1DA2C-DE89-4F62-B1C1-8DE78BBF1F76}'] ['{E75F17B7-C959-49D7-84B3-55AA239759FC}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOMONTAJEValue : Integer; function GetOldCODIGOMONTAJEValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -473,7 +503,7 @@ type
{ IInformeDetallesFichaDelta } { IInformeDetallesFichaDelta }
IInformeDetallesFichaDelta = interface(IInformeDetallesFicha) IInformeDetallesFichaDelta = interface(IInformeDetallesFicha)
['{FAC578F4-482B-4E46-8C07-D7C521604FCA}'] ['{E97CAB1B-CCB0-4710-95F3-9AD8D1C9305F}']
{ Property getters and setters } { Property getters and setters }
function GetOldDESCRIPCIONValue : String; function GetOldDESCRIPCIONValue : String;
function GetOldMODELOValue : String; function GetOldMODELOValue : String;
@ -530,7 +560,7 @@ type
{ IFichaBeneficios_AuxDelta } { IFichaBeneficios_AuxDelta }
IFichaBeneficios_AuxDelta = interface(IFichaBeneficios_Aux) IFichaBeneficios_AuxDelta = interface(IFichaBeneficios_Aux)
['{3E015966-D349-4153-B8F8-4F083CD724F5}'] ['{BB83B8A0-16FB-43C4-8776-0A2DDCE8A85B}']
{ Property getters and setters } { Property getters and setters }
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
function GetOldDESCRIPCIONValue : String; function GetOldDESCRIPCIONValue : String;
@ -569,6 +599,33 @@ implementation
uses uses
Variants, uROBinaryHelpers; Variants, uROBinaryHelpers;
{ TListaAnosMontajesBusinessProcessorRules }
constructor TListaAnosMontajesBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosMontajesBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosMontajesBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosMontajesANO];
end;
function TListaAnosMontajesBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosMontajesANO];
end;
procedure TListaAnosMontajesBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosMontajesANO] := aValue;
end;
{ TdarNuevaReferenciaBusinessProcessorRules } { TdarNuevaReferenciaBusinessProcessorRules }
constructor TdarNuevaReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TdarNuevaReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -1500,6 +1557,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_ListaAnosMontajesDelta, TListaAnosMontajesBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_darNuevaReferenciaDelta, TdarNuevaReferenciaBusinessProcessorRules); RegisterBusinessProcessorRules(RID_darNuevaReferenciaDelta, TdarNuevaReferenciaBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_InformeCabeceraFichaDelta, TInformeCabeceraFichaBusinessProcessorRules); RegisterBusinessProcessorRules(RID_InformeCabeceraFichaDelta, TInformeCabeceraFichaBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_MontajesDelta, TMontajesBusinessProcessorRules); RegisterBusinessProcessorRules(RID_MontajesDelta, TMontajesBusinessProcessorRules);

View File

@ -5,8 +5,8 @@ object srvMontajes: TsrvMontajes
ConnectionName = 'IBX' ConnectionName = 'IBX'
ServiceSchema = schMontajes ServiceSchema = schMontajes
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 648 Left = 647
Top = 207 Top = 181
Height = 356 Height = 356
Width = 300 Width = 300
object bpMontajes: TDABusinessProcessor object bpMontajes: TDABusinessProcessor
@ -26,6 +26,39 @@ object srvMontajes: TsrvMontajes
DataDictionary = dmServer.DataDictionary DataDictionary = dmServer.DataDictionary
Diagrams = dmServer.DADiagrams Diagrams = dmServer.DADiagrams
Datasets = < Datasets = <
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAINICIO, 1,4)) as AN' +
'O'#10'from montajes'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select distinct '#39'To' +
'dos'#39' as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosMontajes'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = < Params = <
item item

Binary file not shown.

View File

@ -305,4 +305,113 @@ object dmPagos: TdmPagos
Left = 232 Left = 232
Top = 24 Top = 24
end end
object tbl_ListaAnosPagos: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPagos'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPagos'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPagos'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = DABINAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosPagos'
IndexDefs = <>
Left = 128
Top = 120
end
object ds_ListaAnosPagos: TDADataSource
DataTable = tbl_ListaAnosPagos
Left = 128
Top = 64
end
end end

View File

@ -14,6 +14,8 @@ type
RORemoteService: TRORemoteService; RORemoteService: TRORemoteService;
tbl_Pagos: TDACDSDataTable; tbl_Pagos: TDACDSDataTable;
ds_Pagos: TDADataSource; ds_Pagos: TDADataSource;
tbl_ListaAnosPagos: TDACDSDataTable;
ds_ListaAnosPagos: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
private private
function GetPagos(CodigoCategoria : Integer): IBizPagos; function GetPagos(CodigoCategoria : Integer): IBizPagos;
@ -31,6 +33,9 @@ type
function PuedoEliminarAlmacen(Codigo : Integer) : Boolean; function PuedoEliminarAlmacen(Codigo : Integer) : Boolean;
function AnadirPagoCliente(Cliente: IBizCliente; CodigoPresupuesto: Integer; function AnadirPagoCliente(Cliente: IBizCliente; CodigoPresupuesto: Integer;
Descripcion: Variant; Importe: Currency; var FechaPago: TDateTime): Boolean; Descripcion: Variant; Importe: Currency; var FechaPago: TDateTime): Boolean;
function DarListaAnosPagos: TStringList;
procedure FiltrarAno(APagos: IBizPagos; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -41,7 +46,7 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Controls, Forms, uDAInterfaces, DataAbstract_Intf, FactuGES_Intf, Controls, cxControls, Forms, uDAInterfaces, DataAbstract_Intf, FactuGES_Intf,
uDataTableUtils, uROTypes, uEditorPreview, Dialogs, uDataModuleBase, uDataTableUtils, uROTypes, uEditorPreview, Dialogs, uDataModuleBase,
schPagosClient_Intf, uDataModuleMontajes, uBizMontajes; schPagosClient_Intf, uDataModuleMontajes, uBizMontajes;
@ -82,6 +87,55 @@ begin
RORemoteService.Message := dmBase.Message; RORemoteService.Message := dmBase.Message;
end; end;
function TdmPagos.DarListaAnosPagos: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosPagos do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
procedure TdmPagos.FiltrarAno(APagos: IBizPagos; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
APagos.DataTable.Where.Clear;
APagos.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los presupuestos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with APagos.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_PagosFECHAPAGO, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_PagosFECHAPAGO, cLessOrEqual, FechaFin);
end;
end;
end;
function TdmPagos.GetItems: IBizPagos; function TdmPagos.GetItems: IBizPagos;
var var
dtPagos: TDACDSDataTable; dtPagos: TDACDSDataTable;

View File

@ -9,7 +9,15 @@ inherited fEditorPagos: TfEditorPagos
end end
inherited TBXDock: TTBXDock inherited TBXDock: TTBXDock
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 411 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
inherited tbxEditFiltro: TTBXEditItem inherited tbxEditFiltro: TTBXEditItem
EditOptions = [tboUseEditWhenVertical] EditOptions = [tboUseEditWhenVertical]
end end

View File

@ -21,15 +21,19 @@ type
end; end;
TfEditorPagos = class(TfEditorGrid, IEditorPagos) TfEditorPagos = class(TfEditorGrid, IEditorPagos)
procedure FormShow(Sender: TObject);
procedure actNuevoExecute(Sender: TObject); procedure actNuevoExecute(Sender: TObject);
procedure actModificarExecute(Sender: TObject); procedure actModificarExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
private private
FPagos: IBizPagos; FPagos: IBizPagos;
protected protected
function GetPagos: IBizPagos; virtual; function GetPagos: IBizPagos; virtual;
procedure SetPagos(const Value: IBizPagos); virtual; procedure SetPagos(const Value: IBizPagos); virtual;
procedure SetViewGrid(const Value: IViewGrid); override; procedure SetViewGrid(const Value: IViewGrid); override;
public public
property Pagos: IBizPagos read GetPagos write SetPagos; property Pagos: IBizPagos read GetPagos write SetPagos;
destructor Destroy; override; destructor Destroy; override;
@ -50,6 +54,9 @@ uses
} }
procedure TfEditorPagos.FormShow(Sender: TObject); procedure TfEditorPagos.FormShow(Sender: TObject);
begin begin
ListaAnos := dmPagos.DarListaAnosPagos;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited; inherited;
if not Assigned(ViewGrid) then if not Assigned(ViewGrid) then
@ -58,7 +65,7 @@ begin
if not Assigned(Pagos) then if not Assigned(Pagos) then
raise Exception.Create('No hay ningún Pago asignado'); raise Exception.Create('No hay ningún Pago asignado');
Pagos.DataTable.Active := True; // Pagos.DataTable.Active := True;
end; end;
function TfEditorPagos.GetPagos: IBizPagos; function TfEditorPagos.GetPagos: IBizPagos;
@ -69,9 +76,17 @@ end;
procedure TfEditorPagos.SetPagos(const Value: IBizPagos); procedure TfEditorPagos.SetPagos(const Value: IBizPagos);
begin begin
FPagos := Value; FPagos := Value;
dsDataTable.DataTable := FPagos.DataTable;
if Assigned(ViewGrid) then if Assigned(FPagos) then
(ViewGrid as IViewPagos).Pagos := Pagos; begin
//Se guarda el where de la sentencia origen, por si el editor tiene filtros que
//afecten a este where y en un futuro se desea volver al where origen (filtro de año))
WhereDataTable := FPagos.DataTable.Where.Clause;
dsDataTable.DataTable := FPagos.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewPagos).Pagos := Pagos;
end;
end; end;
procedure TfEditorPagos.actNuevoExecute(Sender: TObject); procedure TfEditorPagos.actNuevoExecute(Sender: TObject);
@ -104,5 +119,12 @@ begin
inherited; inherited;
end; end;
procedure TfEditorPagos.OnListaAnosChange(Sender: TObject; const Text: string);
begin
dmPagos.FiltrarAno(Pagos, WhereDataTable, Text);
if Pagos.DataTable.Active then
actRefrescar.Execute;
end;
end. end.

View File

@ -9,12 +9,14 @@ 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_InformeCabeceraPago = '{15DB645D-82F8-47D2-B265-F96587E77C7B}'; RID_InformeCabeceraPago = '{B59F93CF-6EAF-4991-B028-BB0CCE36364E}';
RID_Pagos = '{B164F992-38BF-4CC5-89D1-01472F107C3E}'; RID_ListaAnosPagos = '{850055F7-8D08-4539-AB66-5DA63D40E26A}';
RID_Refresh_Pagos = '{CBBD3913-987D-4199-9F0D-F76BB9557BA3}'; RID_Pagos = '{29B2AF5B-087B-4E74-83F7-8D96ECEC370C}';
RID_Refresh_Pagos = '{7E9A215E-D8F2-452C-83EB-36815D1F2E30}';
{ Data table names } { Data table names }
nme_InformeCabeceraPago = 'InformeCabeceraPago'; nme_InformeCabeceraPago = 'InformeCabeceraPago';
nme_ListaAnosPagos = 'ListaAnosPagos';
nme_Pagos = 'Pagos'; nme_Pagos = 'Pagos';
nme_Refresh_Pagos = 'Refresh_Pagos'; nme_Refresh_Pagos = 'Refresh_Pagos';
@ -50,6 +52,12 @@ const
idx_InformeCabeceraPagoPOBLACION = 12; idx_InformeCabeceraPagoPOBLACION = 12;
idx_InformeCabeceraPagoPROVINCIA = 13; idx_InformeCabeceraPagoPROVINCIA = 13;
{ ListaAnosPagos fields }
fld_ListaAnosPagosANO = 'ANO';
{ ListaAnosPagos field indexes }
idx_ListaAnosPagosANO = 0;
{ Pagos fields } { Pagos fields }
fld_PagosCODIGOEMPRESA = 'CODIGOEMPRESA'; fld_PagosCODIGOEMPRESA = 'CODIGOEMPRESA';
fld_PagosCODIGO = 'CODIGO'; fld_PagosCODIGO = 'CODIGO';
@ -117,7 +125,7 @@ const
type type
{ IInformeCabeceraPago } { IInformeCabeceraPago }
IInformeCabeceraPago = interface(IDAStronglyTypedDataTable) IInformeCabeceraPago = interface(IDAStronglyTypedDataTable)
['{D34C282C-0A16-4856-93A2-761BCC9E74B6}'] ['{148B6411-0D8B-49BB-BB6D-B7EC3E511B59}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -222,9 +230,38 @@ type
end; end;
{ IListaAnosPagos }
IListaAnosPagos = interface(IDAStronglyTypedDataTable)
['{1FB6B43B-966A-47CA-BACF-1BC4BBF28F54}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosPagosDataTableRules }
TListaAnosPagosDataTableRules = class(TDADataTableRules, IListaAnosPagos)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IPagos } { IPagos }
IPagos = interface(IDAStronglyTypedDataTable) IPagos = interface(IDAStronglyTypedDataTable)
['{0B093D73-8029-4287-A384-410C43F01D94}'] ['{26CF2773-53D4-4547-A06B-7E5C1A131C5A}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -331,7 +368,7 @@ type
{ IRefresh_Pagos } { IRefresh_Pagos }
IRefresh_Pagos = interface(IDAStronglyTypedDataTable) IRefresh_Pagos = interface(IDAStronglyTypedDataTable)
['{62CDC2A7-3320-400F-817E-059D1FCB917E}'] ['{D6BB1255-4087-475E-AC3E-54FD4FA60158}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -592,6 +629,28 @@ begin
end; end;
{ TListaAnosPagosDataTableRules }
constructor TListaAnosPagosDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosPagosDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosPagosDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosPagosANO].AsString;
end;
procedure TListaAnosPagosDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosPagosANO].AsString := aValue;
end;
{ TPagosDataTableRules } { TPagosDataTableRules }
constructor TPagosDataTableRules.Create(aDataTable: TDADataTable); constructor TPagosDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -900,6 +959,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_InformeCabeceraPago, TInformeCabeceraPagoDataTableRules); RegisterDataTableRules(RID_InformeCabeceraPago, TInformeCabeceraPagoDataTableRules);
RegisterDataTableRules(RID_ListaAnosPagos, TListaAnosPagosDataTableRules);
RegisterDataTableRules(RID_Pagos, TPagosDataTableRules); RegisterDataTableRules(RID_Pagos, TPagosDataTableRules);
RegisterDataTableRules(RID_Refresh_Pagos, TRefresh_PagosDataTableRules); RegisterDataTableRules(RID_Refresh_Pagos, TRefresh_PagosDataTableRules);

View File

@ -9,14 +9,15 @@ 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_InformeCabeceraPagoDelta = '{435D82E6-79DC-40E5-8832-EA15AE38CFB2}'; RID_InformeCabeceraPagoDelta = '{FC7F498A-8050-4BDE-A554-9C74657C161A}';
RID_PagosDelta = '{C8AD6796-7481-4F57-AF85-C283AAF1DF27}'; RID_ListaAnosPagosDelta = '{FB96D6D8-C3F2-4F99-B469-E697516F65C6}';
RID_Refresh_PagosDelta = '{3A452B1A-45BD-4837-8F96-86D8F5B8F80E}'; RID_PagosDelta = '{4F690594-2042-436F-B8F7-EA4D4E766C33}';
RID_Refresh_PagosDelta = '{BBAE7331-5759-4693-A233-6EBD8A2B340E}';
type type
{ IInformeCabeceraPagoDelta } { IInformeCabeceraPagoDelta }
IInformeCabeceraPagoDelta = interface(IInformeCabeceraPago) IInformeCabeceraPagoDelta = interface(IInformeCabeceraPago)
['{435D82E6-79DC-40E5-8832-EA15AE38CFB2}'] ['{FC7F498A-8050-4BDE-A554-9C74657C161A}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -134,9 +135,38 @@ type
end; end;
{ IListaAnosPagosDelta }
IListaAnosPagosDelta = interface(IListaAnosPagos)
['{FB96D6D8-C3F2-4F99-B469-E697516F65C6}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosPagosBusinessProcessorRules }
TListaAnosPagosBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosPagos, IListaAnosPagosDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IPagosDelta } { IPagosDelta }
IPagosDelta = interface(IPagos) IPagosDelta = interface(IPagos)
['{C8AD6796-7481-4F57-AF85-C283AAF1DF27}'] ['{4F690594-2042-436F-B8F7-EA4D4E766C33}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -256,7 +286,7 @@ type
{ IRefresh_PagosDelta } { IRefresh_PagosDelta }
IRefresh_PagosDelta = interface(IRefresh_Pagos) IRefresh_PagosDelta = interface(IRefresh_Pagos)
['{3A452B1A-45BD-4837-8F96-86D8F5B8F80E}'] ['{BBAE7331-5759-4693-A233-6EBD8A2B340E}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -601,6 +631,33 @@ begin
end; end;
{ TListaAnosPagosBusinessProcessorRules }
constructor TListaAnosPagosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosPagosBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosPagosBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosPagosANO];
end;
function TListaAnosPagosBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosPagosANO];
end;
procedure TListaAnosPagosBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosPagosANO] := aValue;
end;
{ TPagosBusinessProcessorRules } { TPagosBusinessProcessorRules }
constructor TPagosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TPagosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -1051,6 +1108,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_InformeCabeceraPagoDelta, TInformeCabeceraPagoBusinessProcessorRules); RegisterBusinessProcessorRules(RID_InformeCabeceraPagoDelta, TInformeCabeceraPagoBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_ListaAnosPagosDelta, TListaAnosPagosBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_PagosDelta, TPagosBusinessProcessorRules); RegisterBusinessProcessorRules(RID_PagosDelta, TPagosBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_Refresh_PagosDelta, TRefresh_PagosBusinessProcessorRules); RegisterBusinessProcessorRules(RID_Refresh_PagosDelta, TRefresh_PagosBusinessProcessorRules);

View File

@ -7,7 +7,7 @@ object srvPagos: TsrvPagos
ServiceSchema = schPagos ServiceSchema = schPagos
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 345 Left = 345
Top = 452 Top = 394
Height = 300 Height = 300
Width = 300 Width = 300
object schPagos: TDASchema object schPagos: TDASchema
@ -259,6 +259,39 @@ object srvPagos: TsrvPagos
BusinessRulesClient.ScriptLanguage = rslPascalScript BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript BusinessRulesServer.ScriptLanguage = rslPascalScript
end end
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAPago, 1,4)) as ANO'#10 +
'from pagos'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select distinct '#39'Todos'#39' ' +
'as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosPagos'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = <> Params = <>
Statements = < Statements = <
@ -931,7 +964,7 @@ object srvPagos: TsrvPagos
Top = 16 Top = 16
end end
object frxReport1: TfrxReport object frxReport1: TfrxReport
Version = '3.15' Version = '3.23.7'
DotMatrixReport = False DotMatrixReport = False
EngineOptions.DoublePass = True EngineOptions.DoublePass = True
IniFile = '\Software\Fast Reports' IniFile = '\Software\Fast Reports'

View File

@ -26,8 +26,8 @@ type
tbl_Pagos: TDACDSDataTable; tbl_Pagos: TDACDSDataTable;
DADataCabecera: TDADataSource; DADataCabecera: TDADataSource;
frxReport1: TfrxReport; frxReport1: TfrxReport;
schPagos: TDASchema;
DABINAdapter: TDABINAdapter; DABINAdapter: TDABINAdapter;
schPagos: TDASchema;
private private
protected protected
function GetNextAutoinc: Integer; function GetNextAutoinc: Integer;

View File

@ -611,4 +611,113 @@ object dmPedidos: TdmPedidos
Left = 288 Left = 288
Top = 24 Top = 24
end end
object tbl_ListaAnosPedidos: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPedidos'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPedidos'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPedidos'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = DABinAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosPedidos'
IndexDefs = <>
Left = 56
Top = 184
end
object ds_ListaAnosPedidos: TDADataSource
DataTable = tbl_ListaAnosPedidos
Left = 48
Top = 136
end
end end

View File

@ -16,6 +16,8 @@ type
ds_DetallesPedidosProveedor: TDADataSource; ds_DetallesPedidosProveedor: TDADataSource;
tbl_PedidosProveedor: TDACDSDataTable; tbl_PedidosProveedor: TDACDSDataTable;
ds_PedidosProveedor: TDADataSource; ds_PedidosProveedor: TDADataSource;
tbl_ListaAnosPedidos: TDACDSDataTable;
ds_ListaAnosPedidos: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
{ private { private
procedure Fax (AFile : String);} procedure Fax (AFile : String);}
@ -28,7 +30,10 @@ type
function GetItemsPendientesRecepcion: IBizPedidosProveedor; function GetItemsPendientesRecepcion: IBizPedidosProveedor;
function GetItem(Codigo : Integer): IBizPedidosProveedor; function GetItem(Codigo : Integer): IBizPedidosProveedor;
function DarNuevaReferencia : String; function DarNuevaReferencia : String;
function PuedoEliminarPedido(Codigo : Integer) : Boolean; function PuedoEliminarPedido(Codigo : Integer) : Boolean;
function DarListaAnosPedidos: TStringList;
procedure FiltrarAno(APedidos: IBizPedidosProveedor; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -39,7 +44,7 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Forms, Controls, uDataTableUtils, uBizContacto, FactuGES_Intf, Forms, Controls, cxControls, uDataTableUtils, uBizContacto, FactuGES_Intf,
uDataModuleContactos, uDataModuleBase, schPedidosProveedorClient_Intf, uDataModuleContactos, uDataModuleBase, schPedidosProveedorClient_Intf,
uDAInterfaces, uEditorPreview, Dialogs; uDAInterfaces, uEditorPreview, Dialogs;
@ -199,6 +204,55 @@ begin
end; end;
end;} end;}
function TdmPedidos.DarListaAnosPedidos: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosPedidos do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
procedure TdmPedidos.FiltrarAno(APedidos: IBizPedidosProveedor; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
APedidos.DataTable.Where.Clear;
APedidos.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los pedidos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with APedidos.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_PedidosProveedorFECHAPEDIDO, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_PedidosProveedorFECHAPEDIDO, cLessOrEqual, FechaFin);
end;
end;
end;
initialization initialization
dmPedidos := TdmPedidos.Create(nil); dmPedidos := TdmPedidos.Create(nil);

View File

@ -35,13 +35,21 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor
end end
inherited TBXDock: TTBXDock inherited TBXDock: TTBXDock
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 482 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
end end
end end
inline frViewBarraSeleccion: TfrViewBarraSeleccion [3] inline frViewBarraSeleccion: TfrViewBarraSeleccion [3]
Left = 0 Left = 0
Top = 395 Top = 395
Width = 707 Width = 706
Height = 37 Height = 37
Align = alBottom Align = alBottom
AutoScroll = False AutoScroll = False
@ -56,7 +64,7 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor
ReadOnly = False ReadOnly = False
inherited pnlSeleccion: TPanel inherited pnlSeleccion: TPanel
Top = 0 Top = 0
Width = 707 Width = 706
inherited bSeleccionar: TButton inherited bSeleccionar: TButton
Left = 550 Left = 550
end end

View File

@ -29,21 +29,24 @@ type
procedure frViewBarraSeleccionactSeleccionarExecute(Sender: TObject); procedure frViewBarraSeleccionactSeleccionarExecute(Sender: TObject);
procedure frViewBarraSeleccionbCancelarClick(Sender: TObject); procedure frViewBarraSeleccionbCancelarClick(Sender: TObject);
procedure actDuplicarExecute(Sender: TObject); procedure actDuplicarExecute(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
procedure FormShow(Sender: TObject);
private private
FPedidosProveedor: IBizPedidosProveedor; FPedidosProveedor: IBizPedidosProveedor;
protected protected
function GetPedidosProveedor: IBizPedidosProveedor; function GetPedidosProveedor: IBizPedidosProveedor;
function GetSelectionBarVisible: Boolean; function GetSelectionBarVisible: Boolean;
procedure SetPedidosProveedor(const Value: IBizPedidosProveedor); procedure SetPedidosProveedor(const Value: IBizPedidosProveedor);
procedure SetSelectionBarVisible(const Value: Boolean); procedure SetSelectionBarVisible(const Value: Boolean);
procedure SetViewGrid(const Value: IViewGrid); override; procedure SetViewGrid(const Value: IViewGrid); override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
property PedidosProveedor: IBizPedidosProveedor read GetPedidosProveedor write property PedidosProveedor: IBizPedidosProveedor read GetPedidosProveedor write SetPedidosProveedor;
SetPedidosProveedor; property SelectionBarVisible: Boolean read GetSelectionBarVisible write SetSelectionBarVisible;
property SelectionBarVisible: Boolean read GetSelectionBarVisible write
SetSelectionBarVisible;
end; end;
var var
@ -184,6 +187,22 @@ begin
// ViewGrid.GotoFirst; // ViewGrid.GotoFirst;
end; end;
procedure TfEditorPedidosProveedor.OnListaAnosChange(Sender: TObject;
const Text: string);
begin
dmPedidos.FiltrarAno(PedidosProveedor, WhereDataTable, Text);
if PedidosProveedor.DataTable.Active then
actRefrescar.Execute;
end;
procedure TfEditorPedidosProveedor.FormShow(Sender: TObject);
begin
ListaAnos := dmPedidos.DarListaAnosPedidos;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
end;
initialization initialization
RegisterEditor(IBizPedidosProveedor, ShowEditorPedidosProveedor, etItems); RegisterEditor(IBizPedidosProveedor, ShowEditorPedidosProveedor, etItems);
RegisterEditor(IBizPedidosProveedor, ShowSelectEditorPedidosProveedor, etSelectItems); RegisterEditor(IBizPedidosProveedor, ShowSelectEditorPedidosProveedor, etSelectItems);

View File

@ -9,16 +9,18 @@ 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_darReferenciaPedido = '{505FD1BA-CDDC-4703-8DD7-3D2BDD241D2E}'; RID_darReferenciaPedido = '{3B002028-795E-4D3E-AFC5-A1D21AC442E3}';
RID_DetallesPedidosProveedor = '{FBD0F0E0-3295-4D79-863F-FC778E6787E2}'; RID_DetallesPedidosProveedor = '{3052F8C1-9E64-4C97-AC67-3CBDCD3B7E2E}';
RID_PedidosProveedor = '{45DBB351-50FF-4444-A2BA-305E6D011C02}'; RID_ListaAnosPedidos = '{954E9284-FE16-4847-8094-359A86E7F733}';
RID_Refresh_PedidosProveedor = '{139C4281-92C5-4431-B4BB-E51B6D4CBC8A}'; RID_PedidosProveedor = '{40ACE341-D7B5-4619-9D19-D3A0BEAD3A3E}';
RID_InformeCabeceraPedido = '{4D5A204C-EE0C-4C02-B954-C305CE082250}'; RID_Refresh_PedidosProveedor = '{808987D2-D222-43AB-B8B5-4180683C7955}';
RID_InformeDetallesPedido = '{5EB109BB-A440-4768-A612-6A04E27E451D}'; RID_InformeCabeceraPedido = '{2C8C37B1-EE18-4CA7-8078-D8BA9B4355C6}';
RID_InformeDetallesPedido = '{3C6B060F-68EB-4A3C-8DC4-5EF3C99BFD5B}';
{ Data table names } { Data table names }
nme_darReferenciaPedido = 'darReferenciaPedido'; nme_darReferenciaPedido = 'darReferenciaPedido';
nme_DetallesPedidosProveedor = 'DetallesPedidosProveedor'; nme_DetallesPedidosProveedor = 'DetallesPedidosProveedor';
nme_ListaAnosPedidos = 'ListaAnosPedidos';
nme_PedidosProveedor = 'PedidosProveedor'; nme_PedidosProveedor = 'PedidosProveedor';
nme_Refresh_PedidosProveedor = 'Refresh_PedidosProveedor'; nme_Refresh_PedidosProveedor = 'Refresh_PedidosProveedor';
nme_InformeCabeceraPedido = 'InformeCabeceraPedido'; nme_InformeCabeceraPedido = 'InformeCabeceraPedido';
@ -48,6 +50,12 @@ const
idx_DetallesPedidosProveedorPOSICION = 6; idx_DetallesPedidosProveedorPOSICION = 6;
idx_DetallesPedidosProveedorTIPO = 7; idx_DetallesPedidosProveedorTIPO = 7;
{ ListaAnosPedidos fields }
fld_ListaAnosPedidosANO = 'ANO';
{ ListaAnosPedidos field indexes }
idx_ListaAnosPedidosANO = 0;
{ PedidosProveedor fields } { PedidosProveedor fields }
fld_PedidosProveedorCODIGOEMPRESA = 'CODIGOEMPRESA'; fld_PedidosProveedorCODIGOEMPRESA = 'CODIGOEMPRESA';
fld_PedidosProveedorCODIGO = 'CODIGO'; fld_PedidosProveedorCODIGO = 'CODIGO';
@ -199,7 +207,7 @@ const
type type
{ IdarReferenciaPedido } { IdarReferenciaPedido }
IdarReferenciaPedido = interface(IDAStronglyTypedDataTable) IdarReferenciaPedido = interface(IDAStronglyTypedDataTable)
['{0F22273C-9C50-4C0B-A525-91B8A4A2B810}'] ['{18C748BC-1317-4E78-B489-08E7B08EE6DC}']
{ Property getters and setters } { Property getters and setters }
@ -222,7 +230,7 @@ type
{ IDetallesPedidosProveedor } { IDetallesPedidosProveedor }
IDetallesPedidosProveedor = interface(IDAStronglyTypedDataTable) IDetallesPedidosProveedor = interface(IDAStronglyTypedDataTable)
['{85D589DA-23C9-4E5C-A8D5-E9C5FE0C299C}'] ['{7F82D076-A16A-4224-8E51-C0B633DE871A}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOPEDIDOValue: Integer; function GetCODIGOPEDIDOValue: Integer;
procedure SetCODIGOPEDIDOValue(const aValue: Integer); procedure SetCODIGOPEDIDOValue(const aValue: Integer);
@ -291,9 +299,38 @@ type
end; end;
{ IListaAnosPedidos }
IListaAnosPedidos = interface(IDAStronglyTypedDataTable)
['{F60E3C70-E432-46AC-A1A9-179DED53654C}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosPedidosDataTableRules }
TListaAnosPedidosDataTableRules = class(TDADataTableRules, IListaAnosPedidos)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IPedidosProveedor } { IPedidosProveedor }
IPedidosProveedor = interface(IDAStronglyTypedDataTable) IPedidosProveedor = interface(IDAStronglyTypedDataTable)
['{A3234350-6EC1-44E2-914A-4F402CAD1C21}'] ['{F3788442-CDBC-42DC-A0E7-9694796FC10B}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -442,7 +479,7 @@ type
{ IRefresh_PedidosProveedor } { IRefresh_PedidosProveedor }
IRefresh_PedidosProveedor = interface(IDAStronglyTypedDataTable) IRefresh_PedidosProveedor = interface(IDAStronglyTypedDataTable)
['{6F81940D-E091-4CCF-87B5-3D18484BF359}'] ['{BDBAF845-6E60-4488-9165-A5D2BDB6355D}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -591,7 +628,7 @@ type
{ IInformeCabeceraPedido } { IInformeCabeceraPedido }
IInformeCabeceraPedido = interface(IDAStronglyTypedDataTable) IInformeCabeceraPedido = interface(IDAStronglyTypedDataTable)
['{D3E6B5DA-06AA-442B-89E8-53CF2ACC19ED}'] ['{6F1EB595-8513-4BCA-BC28-6D939D39E2A2}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -710,7 +747,7 @@ type
{ IInformeDetallesPedido } { IInformeDetallesPedido }
IInformeDetallesPedido = interface(IDAStronglyTypedDataTable) IInformeDetallesPedido = interface(IDAStronglyTypedDataTable)
['{7800BEA2-1E81-406B-9107-3E56B0A796B6}'] ['{4461E273-1874-4E87-84F3-C8A69C2F5F81}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOPEDIDOValue: Integer; function GetCODIGOPEDIDOValue: Integer;
procedure SetCODIGOPEDIDOValue(const aValue: Integer); procedure SetCODIGOPEDIDOValue(const aValue: Integer);
@ -887,6 +924,28 @@ begin
end; end;
{ TListaAnosPedidosDataTableRules }
constructor TListaAnosPedidosDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosPedidosDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosPedidosDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosPedidosANO].AsString;
end;
procedure TListaAnosPedidosDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosPedidosANO].AsString := aValue;
end;
{ TPedidosProveedorDataTableRules } { TPedidosProveedorDataTableRules }
constructor TPedidosProveedorDataTableRules.Create(aDataTable: TDADataTable); constructor TPedidosProveedorDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -1606,6 +1665,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_darReferenciaPedido, TdarReferenciaPedidoDataTableRules); RegisterDataTableRules(RID_darReferenciaPedido, TdarReferenciaPedidoDataTableRules);
RegisterDataTableRules(RID_DetallesPedidosProveedor, TDetallesPedidosProveedorDataTableRules); RegisterDataTableRules(RID_DetallesPedidosProveedor, TDetallesPedidosProveedorDataTableRules);
RegisterDataTableRules(RID_ListaAnosPedidos, TListaAnosPedidosDataTableRules);
RegisterDataTableRules(RID_PedidosProveedor, TPedidosProveedorDataTableRules); RegisterDataTableRules(RID_PedidosProveedor, TPedidosProveedorDataTableRules);
RegisterDataTableRules(RID_Refresh_PedidosProveedor, TRefresh_PedidosProveedorDataTableRules); RegisterDataTableRules(RID_Refresh_PedidosProveedor, TRefresh_PedidosProveedorDataTableRules);
RegisterDataTableRules(RID_InformeCabeceraPedido, TInformeCabeceraPedidoDataTableRules); RegisterDataTableRules(RID_InformeCabeceraPedido, TInformeCabeceraPedidoDataTableRules);

View File

@ -9,17 +9,18 @@ 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_darReferenciaPedidoDelta = '{BD698220-2611-41EB-89F0-E844371835DD}'; RID_darReferenciaPedidoDelta = '{6B5B16E9-5B36-4082-A757-7B0429D1B110}';
RID_DetallesPedidosProveedorDelta = '{A69EEC04-2DA2-41D3-90B3-F3DDFDF124AB}'; RID_DetallesPedidosProveedorDelta = '{43C91112-A2EE-4A9E-83B2-BEF9CB6A2DE3}';
RID_PedidosProveedorDelta = '{C14C1230-236A-46C3-91AF-903D77FA30EE}'; RID_ListaAnosPedidosDelta = '{081EB504-A5DD-4B18-B47C-13DBF134B88D}';
RID_Refresh_PedidosProveedorDelta = '{9FC9D322-C920-4E9A-8CEA-23CD43B052ED}'; RID_PedidosProveedorDelta = '{1DDF0247-6AED-4F12-AB3D-187CD8742029}';
RID_InformeCabeceraPedidoDelta = '{FF0381B3-8498-47B0-96EA-FE9723B370A6}'; RID_Refresh_PedidosProveedorDelta = '{1FA69710-D78F-4702-BB9C-FED9D0EF34FF}';
RID_InformeDetallesPedidoDelta = '{011AA7C9-CDEC-493F-BA61-F01B37E0F0C3}'; RID_InformeCabeceraPedidoDelta = '{AAA39823-20B1-40CA-B150-B1DD9366F5F9}';
RID_InformeDetallesPedidoDelta = '{48CFF8AA-9EEB-4068-AB9E-362E5700810A}';
type type
{ IdarReferenciaPedidoDelta } { IdarReferenciaPedidoDelta }
IdarReferenciaPedidoDelta = interface(IdarReferenciaPedido) IdarReferenciaPedidoDelta = interface(IdarReferenciaPedido)
['{BD698220-2611-41EB-89F0-E844371835DD}'] ['{6B5B16E9-5B36-4082-A757-7B0429D1B110}']
{ Property getters and setters } { Property getters and setters }
{ Properties } { Properties }
@ -41,7 +42,7 @@ type
{ IDetallesPedidosProveedorDelta } { IDetallesPedidosProveedorDelta }
IDetallesPedidosProveedorDelta = interface(IDetallesPedidosProveedor) IDetallesPedidosProveedorDelta = interface(IDetallesPedidosProveedor)
['{A69EEC04-2DA2-41D3-90B3-F3DDFDF124AB}'] ['{43C91112-A2EE-4A9E-83B2-BEF9CB6A2DE3}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOPEDIDOValue : Integer; function GetOldCODIGOPEDIDOValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -117,9 +118,38 @@ type
end; end;
{ IListaAnosPedidosDelta }
IListaAnosPedidosDelta = interface(IListaAnosPedidos)
['{081EB504-A5DD-4B18-B47C-13DBF134B88D}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosPedidosBusinessProcessorRules }
TListaAnosPedidosBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosPedidos, IListaAnosPedidosDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IPedidosProveedorDelta } { IPedidosProveedorDelta }
IPedidosProveedorDelta = interface(IPedidosProveedor) IPedidosProveedorDelta = interface(IPedidosProveedor)
['{C14C1230-236A-46C3-91AF-903D77FA30EE}'] ['{1DDF0247-6AED-4F12-AB3D-187CD8742029}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -288,7 +318,7 @@ type
{ IRefresh_PedidosProveedorDelta } { IRefresh_PedidosProveedorDelta }
IRefresh_PedidosProveedorDelta = interface(IRefresh_PedidosProveedor) IRefresh_PedidosProveedorDelta = interface(IRefresh_PedidosProveedor)
['{9FC9D322-C920-4E9A-8CEA-23CD43B052ED}'] ['{1FA69710-D78F-4702-BB9C-FED9D0EF34FF}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -457,7 +487,7 @@ type
{ IInformeCabeceraPedidoDelta } { IInformeCabeceraPedidoDelta }
IInformeCabeceraPedidoDelta = interface(IInformeCabeceraPedido) IInformeCabeceraPedidoDelta = interface(IInformeCabeceraPedido)
['{FF0381B3-8498-47B0-96EA-FE9723B370A6}'] ['{AAA39823-20B1-40CA-B150-B1DD9366F5F9}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -591,7 +621,7 @@ type
{ IInformeDetallesPedidoDelta } { IInformeDetallesPedidoDelta }
IInformeDetallesPedidoDelta = interface(IInformeDetallesPedido) IInformeDetallesPedidoDelta = interface(IInformeDetallesPedido)
['{011AA7C9-CDEC-493F-BA61-F01B37E0F0C3}'] ['{48CFF8AA-9EEB-4068-AB9E-362E5700810A}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOPEDIDOValue : Integer; function GetOldCODIGOPEDIDOValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -816,6 +846,33 @@ begin
end; end;
{ TListaAnosPedidosBusinessProcessorRules }
constructor TListaAnosPedidosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosPedidosBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosPedidosBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosPedidosANO];
end;
function TListaAnosPedidosBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosPedidosANO];
end;
procedure TListaAnosPedidosBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosPedidosANO] := aValue;
end;
{ TPedidosProveedorBusinessProcessorRules } { TPedidosProveedorBusinessProcessorRules }
constructor TPedidosProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TPedidosProveedorBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -1873,6 +1930,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_darReferenciaPedidoDelta, TdarReferenciaPedidoBusinessProcessorRules); RegisterBusinessProcessorRules(RID_darReferenciaPedidoDelta, TdarReferenciaPedidoBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_DetallesPedidosProveedorDelta, TDetallesPedidosProveedorBusinessProcessorRules); RegisterBusinessProcessorRules(RID_DetallesPedidosProveedorDelta, TDetallesPedidosProveedorBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_ListaAnosPedidosDelta, TListaAnosPedidosBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_PedidosProveedorDelta, TPedidosProveedorBusinessProcessorRules); RegisterBusinessProcessorRules(RID_PedidosProveedorDelta, TPedidosProveedorBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_Refresh_PedidosProveedorDelta, TRefresh_PedidosProveedorBusinessProcessorRules); RegisterBusinessProcessorRules(RID_Refresh_PedidosProveedorDelta, TRefresh_PedidosProveedorBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_InformeCabeceraPedidoDelta, TInformeCabeceraPedidoBusinessProcessorRules); RegisterBusinessProcessorRules(RID_InformeCabeceraPedidoDelta, TInformeCabeceraPedidoBusinessProcessorRules);

View File

@ -7,7 +7,7 @@ object srvPedidosProveedor: TsrvPedidosProveedor
ServiceSchema = schPedidosProveedor ServiceSchema = schPedidosProveedor
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 445 Left = 445
Top = 306 Top = 267
Height = 459 Height = 459
Width = 300 Width = 300
object schPedidosProveedor: TDASchema object schPedidosProveedor: TDASchema
@ -169,6 +169,39 @@ object srvPedidosProveedor: TsrvPedidosProveedor
BusinessRulesClient.ScriptLanguage = rslPascalScript BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript BusinessRulesServer.ScriptLanguage = rslPascalScript
end end
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAPEDIDO, 1,4)) as AN' +
'O'#10'from pedidos'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select distinct '#39'Tod' +
'os'#39' as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosPedidos'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = <> Params = <>
Statements = < Statements = <

View File

@ -34,9 +34,9 @@ type
IBDataSet2: TIBDataSet; IBDataSet2: TIBDataSet;
DataSource1: TDataSource; DataSource1: TDataSource;
DataSource2: TDataSource; DataSource2: TDataSource;
schPedidosProveedor: TDASchema;
DABINAdapter: TDABINAdapter; DABINAdapter: TDABINAdapter;
frxReport1: TfrxReport; frxReport1: TfrxReport;
schPedidosProveedor: TDASchema;
private private
protected protected
function GetNextAutoinc: Integer; function GetNextAutoinc: Integer;

View File

@ -702,4 +702,113 @@ object dmPresupuestos: TdmPresupuestos
Left = 296 Left = 296
Top = 40 Top = 40
end end
object tbl_ListaAnosPresupuestos: TDACDSDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
Params = <>
MasterMappingMode = mmDataRequest
StreamingOptions = [soDisableEventsWhileStreaming]
SchemaCall.MethodName = 'GetDatasetSchema'
SchemaCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'aDatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPresupuestos'
end>
DataRequestCall.MethodName = 'GetDatasetDataEx'
DataRequestCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'DatasetName'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPresupuestos'
end
item
Name = 'Params'
ParamType = fIn
DataType = rtUserDefined
UserClassName = 'TDADatasetParamArray'
end
item
Name = 'UserFilter'
ParamType = fIn
DataType = rtString
Value = ''
end
item
Name = 'IncludeSchema'
ParamType = fIn
DataType = rtBoolean
Value = False
end
item
Name = 'MaxRecords'
ParamType = fIn
DataType = rtInteger
Value = -1
end>
DataUpdateCall.MethodName = 'UpdateData'
DataUpdateCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtBinary
end
item
Name = 'Delta'
ParamType = fIn
DataType = rtBinary
end>
ScriptCall.MethodName = 'GetDatasetScripts'
ScriptCall.Params = <
item
Name = 'Result'
ParamType = fResult
DataType = rtString
Value = ''
end
item
Name = 'DatasetNames'
ParamType = fIn
DataType = rtString
Value = 'ListaAnosPresupuestos'
end>
ReadOnly = False
RemoteService = RORemoteService
Adapter = DABinAdapter
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'ListaAnosPresupuestos'
IndexDefs = <>
Left = 72
Top = 192
end
object ds_ListaAnosPresupuestos: TDADataSource
DataTable = tbl_ListaAnosPresupuestos
Left = 72
Top = 136
end
end end

View File

@ -53,6 +53,8 @@ type
ds_DetallesPresupuestos: TDADataSource; ds_DetallesPresupuestos: TDADataSource;
tbl_Presupuestos: TDACDSDataTable; tbl_Presupuestos: TDACDSDataTable;
ds_Presupuestos: TDADataSource; ds_Presupuestos: TDADataSource;
tbl_ListaAnosPresupuestos: TDACDSDataTable;
ds_ListaAnosPresupuestos: TDADataSource;
procedure DAClientDataModuleCreate(Sender: TObject); procedure DAClientDataModuleCreate(Sender: TObject);
public public
function PuedoEliminarPresupuesto (CodigoPresupuesto : Integer) : Boolean; function PuedoEliminarPresupuesto (CodigoPresupuesto : Integer) : Boolean;
@ -67,6 +69,9 @@ type
procedure Refrescar(lReport: TfrxReport; Const Codigo: Integer; const TamLetra: Integer); procedure Refrescar(lReport: TfrxReport; Const Codigo: Integer; const TamLetra: Integer);
procedure Print(Const Codigo: Integer); procedure Print(Const Codigo: Integer);
function GetItemsSeleccionados(ASource : IBizPresupuestos): IBizPresupuestos; function GetItemsSeleccionados(ASource : IBizPresupuestos): IBizPresupuestos;
function DarListaAnosPresupuestos: TStringList;
procedure FiltrarAno(APresupuestos: IBizPresupuestos; AWhereDataTable: String; const Ano: String);
end; end;
var var
@ -77,7 +82,7 @@ implementation
{$R *.DFM} {$R *.DFM}
uses uses
Forms, Controls, uDataTableUtils, uBizContacto, Dialogs, Variants, Forms, Controls, cxControls, uDataTableUtils, uBizContacto, Dialogs, Variants,
uDataModuleContactos, uDataModuleBase, schPresupuestosClient_Intf, uDataModuleContactos, uDataModuleBase, schPresupuestosClient_Intf,
uDAInterfaces, uEditorPreview, uEditorPreviewPresupuesto, uROTypes, uDAInterfaces, uEditorPreview, uEditorPreviewPresupuesto, uROTypes,
uDBSelectionList; uDBSelectionList;
@ -320,6 +325,55 @@ begin
lReport.ShowPreparedReport; lReport.ShowPreparedReport;
end; end;
procedure TdmPresupuestos.FiltrarAno(APresupuestos: IBizPresupuestos; AWhereDataTable: String; const Ano: String);
var
FechaIni: String;
FechaFin: String;
begin
APresupuestos.DataTable.Where.Clear;
APresupuestos.DataTable.Where.AddText(AWhereDataTable);
if (Ano <> 'Todos') then
begin
// Filtrar los presupuestos actuales por años
FechaIni := '01.01.' + Ano;
FechaFin := '31.12.' + Ano;
with APresupuestos.DataTable.Where do
begin
if NotEmpty then
AddOperator(opAND);
AddCondition(fld_PresupuestosFECHAPRESUPUESTO, cMajorOrEqual, FechaIni);
AddOperator(opAND);
AddCondition(fld_PresupuestosFECHAPRESUPUESTO, cLessOrEqual, FechaFin);
end;
end;
end;
function TdmPresupuestos.DarListaAnosPresupuestos: TStringList;
var
AListaAnos: TStringList;
begin
AListaAnos := TStringList.Create;
ShowHourglassCursor;
try
with tbl_ListaAnosPresupuestos do
begin
Open;
First;
while not eof do
begin
AListaAnos.Add(Format('%s=%s', [Fields[0].AsString, Fields[0].AsString]));
Next;
end;
Close;
end;
Result := AListaAnos;
finally
HideHourglassCursor;
end;
end;
initialization initialization
dmPresupuestos := TdmPresupuestos.Create(nil); dmPresupuestos := TdmPresupuestos.Create(nil);

View File

@ -1,6 +1,6 @@
inherited fEditorPresupuestos: TfEditorPresupuestos inherited fEditorPresupuestos: TfEditorPresupuestos
Left = 221 Left = 221
Top = 235 Top = 205
Width = 781 Width = 781
Caption = 'Lista de presupuestos' Caption = 'Lista de presupuestos'
PixelsPerInch = 96 PixelsPerInch = 96
@ -41,7 +41,15 @@ inherited fEditorPresupuestos: TfEditorPresupuestos
end end
end end
inherited tbxFiltro: TTBXToolbar inherited tbxFiltro: TTBXToolbar
Left = 471 inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
end end
end end
inherited StatusBar: TStatusBar inherited StatusBar: TStatusBar

View File

@ -20,7 +20,7 @@ type
property Presupuestos: IBizPresupuestos read GetPresupuestos write property Presupuestos: IBizPresupuestos read GetPresupuestos write
SetPresupuestos; SetPresupuestos;
end; end;
TfEditorPresupuestos = class(TfEditorGrid, IEditorPresupuestos) TfEditorPresupuestos = class(TfEditorGrid, IEditorPresupuestos)
frViewBarraSeleccion: TfrViewBarraSeleccion; frViewBarraSeleccion: TfrViewBarraSeleccion;
actAceptado: TAction; actAceptado: TAction;
@ -42,8 +42,12 @@ type
procedure actAceptadoExecute(Sender: TObject); procedure actAceptadoExecute(Sender: TObject);
procedure actRechazadoExecute(Sender: TObject); procedure actRechazadoExecute(Sender: TObject);
procedure actPendienteExecute(Sender: TObject); procedure actPendienteExecute(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
procedure FormShow(Sender: TObject);
private private
FPresupuestos: IBizPresupuestos; FPresupuestos: IBizPresupuestos;
protected protected
function GetPresupuestos: IBizPresupuestos; function GetPresupuestos: IBizPresupuestos;
function GetSelectionBarVisible: Boolean; function GetSelectionBarVisible: Boolean;
@ -171,9 +175,17 @@ end;
procedure TfEditorPresupuestos.SetPresupuestos(const Value: IBizPresupuestos); procedure TfEditorPresupuestos.SetPresupuestos(const Value: IBizPresupuestos);
begin begin
FPresupuestos := Value; FPresupuestos := Value;
dsDataTable.DataTable := FPresupuestos.DataTable;
if Assigned(ViewGrid) then if Assigned(FPresupuestos) then
(ViewGrid as IViewPresupuestos).Presupuestos := Presupuestos; begin
//Se guarda el where de la sentencia origen, por si el editor tiene filtros que
//afecten a este where y en un futuro se desea volver al where origen (filtro de año))
WhereDataTable := FPresupuestos.DataTable.Where.Clause;
dsDataTable.DataTable := FPresupuestos.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewPresupuestos).Presupuestos := Presupuestos;
end;
end; end;
procedure TfEditorPresupuestos.SetSelectionBarVisible(const Value: Boolean); procedure TfEditorPresupuestos.SetSelectionBarVisible(const Value: Boolean);
@ -249,6 +261,21 @@ begin
end; end;
end; end;
procedure TfEditorPresupuestos.OnListaAnosChange(Sender: TObject; const Text: string);
begin
dmPresupuestos.FiltrarAno(Presupuestos, WhereDataTable, Text);
if Presupuestos.DataTable.Active then
actRefrescar.Execute;
end;
procedure TfEditorPresupuestos.FormShow(Sender: TObject);
begin
ListaAnos := dmPresupuestos.DarListaAnosPresupuestos;
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
end;
initialization initialization
RegisterEditor(IBizPresupuestos, ShowEditorPresupuestos, etItems); RegisterEditor(IBizPresupuestos, ShowEditorPresupuestos, etItems);
RegisterEditor(IBizPresupuestos, ShowSelectEditorPresupuestos, etSelectItems); RegisterEditor(IBizPresupuestos, ShowSelectEditorPresupuestos, etSelectItems);

View File

@ -9,19 +9,27 @@ 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_DetallesPresupuestos = '{A6A79145-2CF4-404F-AF3C-216C6C1C6220}'; RID_ListaAnosPresupuestos = '{95031149-82C7-4C73-BC10-9B1285B42FD8}';
RID_Presupuestos = '{5B155DB3-9C72-4E74-AF1E-2F5F54B8C085}'; RID_DetallesPresupuestos = '{4155E7A3-B36F-440C-9232-FCDA6E0E57D3}';
RID_Presupuestos_RefreshDataset = '{A4DBCB7A-51D7-4CC6-AE4C-4F3E92E621C3}'; RID_Presupuestos = '{3C692B06-401D-4BB5-9E59-1029ECE88CCA}';
RID_InformeCabeceraPresupuesto = '{264277A9-3681-40C0-90A1-E3164B449B02}'; RID_Presupuestos_RefreshDataset = '{4DDAA5E9-1786-49E9-82E4-92A8E5A30D2E}';
RID_InformeDetallesPresupuesto = '{31CD6A31-A8D3-4D6E-9AA5-FD7D0B85DDBA}'; RID_InformeCabeceraPresupuesto = '{3826E313-F328-47E3-AFF6-4C02E162BD3C}';
RID_InformeDetallesPresupuesto = '{363E9ABE-D657-4094-A45A-1F44E3CC35DE}';
{ Data table names } { Data table names }
nme_ListaAnosPresupuestos = 'ListaAnosPresupuestos';
nme_DetallesPresupuestos = 'DetallesPresupuestos'; nme_DetallesPresupuestos = 'DetallesPresupuestos';
nme_Presupuestos = 'Presupuestos'; nme_Presupuestos = 'Presupuestos';
nme_Presupuestos_RefreshDataset = 'Presupuestos_RefreshDataset'; nme_Presupuestos_RefreshDataset = 'Presupuestos_RefreshDataset';
nme_InformeCabeceraPresupuesto = 'InformeCabeceraPresupuesto'; nme_InformeCabeceraPresupuesto = 'InformeCabeceraPresupuesto';
nme_InformeDetallesPresupuesto = 'InformeDetallesPresupuesto'; nme_InformeDetallesPresupuesto = 'InformeDetallesPresupuesto';
{ ListaAnosPresupuestos fields }
fld_ListaAnosPresupuestosANO = 'ANO';
{ ListaAnosPresupuestos field indexes }
idx_ListaAnosPresupuestosANO = 0;
{ DetallesPresupuestos fields } { DetallesPresupuestos fields }
fld_DetallesPresupuestosCODIGOPRESUPUESTO = 'CODIGOPRESUPUESTO'; fld_DetallesPresupuestosCODIGOPRESUPUESTO = 'CODIGOPRESUPUESTO';
fld_DetallesPresupuestosNUMCONCEPTO = 'NUMCONCEPTO'; fld_DetallesPresupuestosNUMCONCEPTO = 'NUMCONCEPTO';
@ -203,9 +211,38 @@ const
idx_InformeDetallesPresupuestoPOSICION = 7; idx_InformeDetallesPresupuestoPOSICION = 7;
type type
{ IListaAnosPresupuestos }
IListaAnosPresupuestos = interface(IDAStronglyTypedDataTable)
['{6D5B13E0-C373-43E8-B599-1AD86BD6ABF2}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
end;
{ TListaAnosPresupuestosDataTableRules }
TListaAnosPresupuestosDataTableRules = class(TDADataTableRules, IListaAnosPresupuestos)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO: String read GetANOValue write SetANOValue;
public
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
{ IDetallesPresupuestos } { IDetallesPresupuestos }
IDetallesPresupuestos = interface(IDAStronglyTypedDataTable) IDetallesPresupuestos = interface(IDAStronglyTypedDataTable)
['{44CD0F43-9391-4901-9C68-B711CBCB7FDC}'] ['{18414808-5E3F-4017-8DCF-885665361C3C}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOPRESUPUESTOValue: Integer; function GetCODIGOPRESUPUESTOValue: Integer;
procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer); procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer);
@ -294,7 +331,7 @@ type
{ IPresupuestos } { IPresupuestos }
IPresupuestos = interface(IDAStronglyTypedDataTable) IPresupuestos = interface(IDAStronglyTypedDataTable)
['{27C72B9E-C122-4FA0-A412-B2681821A051}'] ['{3B57E67A-BCF1-4A9C-8DE3-680F3FC7E851}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -461,7 +498,7 @@ type
{ IPresupuestos_RefreshDataset } { IPresupuestos_RefreshDataset }
IPresupuestos_RefreshDataset = interface(IDAStronglyTypedDataTable) IPresupuestos_RefreshDataset = interface(IDAStronglyTypedDataTable)
['{36CACFE6-C6B9-497D-A821-2ABF5E3298F0}'] ['{5097F042-BB92-4714-98E3-38D672728B8B}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOValue: Integer; function GetCODIGOValue: Integer;
procedure SetCODIGOValue(const aValue: Integer); procedure SetCODIGOValue(const aValue: Integer);
@ -514,7 +551,7 @@ type
{ IInformeCabeceraPresupuesto } { IInformeCabeceraPresupuesto }
IInformeCabeceraPresupuesto = interface(IDAStronglyTypedDataTable) IInformeCabeceraPresupuesto = interface(IDAStronglyTypedDataTable)
['{B0CC1F1A-3AC1-4696-A03F-15F309307109}'] ['{68F7F7E4-616C-464B-A795-E4ACAFC2D708}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOEMPRESAValue: Integer; function GetCODIGOEMPRESAValue: Integer;
procedure SetCODIGOEMPRESAValue(const aValue: Integer); procedure SetCODIGOEMPRESAValue(const aValue: Integer);
@ -729,7 +766,7 @@ type
{ IInformeDetallesPresupuesto } { IInformeDetallesPresupuesto }
IInformeDetallesPresupuesto = interface(IDAStronglyTypedDataTable) IInformeDetallesPresupuesto = interface(IDAStronglyTypedDataTable)
['{331BAA43-0C6C-45D7-A7C2-098D7686A53F}'] ['{25CACDCE-E4DB-42FC-B0B8-78493C06240D}']
{ Property getters and setters } { Property getters and setters }
function GetCODIGOPRESUPUESTOValue: Integer; function GetCODIGOPRESUPUESTOValue: Integer;
procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer); procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer);
@ -802,6 +839,28 @@ implementation
uses Variants; uses Variants;
{ TListaAnosPresupuestosDataTableRules }
constructor TListaAnosPresupuestosDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TListaAnosPresupuestosDataTableRules.Destroy;
begin
inherited;
end;
function TListaAnosPresupuestosDataTableRules.GetANOValue: String;
begin
result := DataTable.Fields[idx_ListaAnosPresupuestosANO].AsString;
end;
procedure TListaAnosPresupuestosDataTableRules.SetANOValue(const aValue: String);
begin
DataTable.Fields[idx_ListaAnosPresupuestosANO].AsString := aValue;
end;
{ TDetallesPresupuestosDataTableRules } { TDetallesPresupuestosDataTableRules }
constructor TDetallesPresupuestosDataTableRules.Create(aDataTable: TDADataTable); constructor TDetallesPresupuestosDataTableRules.Create(aDataTable: TDADataTable);
begin begin
@ -1669,6 +1728,7 @@ end;
initialization initialization
RegisterDataTableRules(RID_ListaAnosPresupuestos, TListaAnosPresupuestosDataTableRules);
RegisterDataTableRules(RID_DetallesPresupuestos, TDetallesPresupuestosDataTableRules); RegisterDataTableRules(RID_DetallesPresupuestos, TDetallesPresupuestosDataTableRules);
RegisterDataTableRules(RID_Presupuestos, TPresupuestosDataTableRules); RegisterDataTableRules(RID_Presupuestos, TPresupuestosDataTableRules);
RegisterDataTableRules(RID_Presupuestos_RefreshDataset, TPresupuestos_RefreshDatasetDataTableRules); RegisterDataTableRules(RID_Presupuestos_RefreshDataset, TPresupuestos_RefreshDatasetDataTableRules);

View File

@ -9,16 +9,46 @@ 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_DetallesPresupuestosDelta = '{27189DEC-DB55-4CFF-90D4-3CCC8C3789B7}'; RID_ListaAnosPresupuestosDelta = '{CBA70605-3C3B-48A1-A28C-B1E97902006E}';
RID_PresupuestosDelta = '{AD80280F-15D4-422B-9E7C-B413BD6D9270}'; RID_DetallesPresupuestosDelta = '{A06F07C8-8609-4E0C-A202-CDFD98C02B75}';
RID_Presupuestos_RefreshDatasetDelta = '{F4E70462-4089-44C8-AFAA-B6FDEFE43DB9}'; RID_PresupuestosDelta = '{475CF11F-7C34-4390-B427-291574D72D01}';
RID_InformeCabeceraPresupuestoDelta = '{41A03000-031E-4727-B794-E79D553EC52B}'; RID_Presupuestos_RefreshDatasetDelta = '{7B057008-D651-4A1C-B4B7-08C7C4A566F9}';
RID_InformeDetallesPresupuestoDelta = '{741759BF-9981-4B00-A217-C5C769B36552}'; RID_InformeCabeceraPresupuestoDelta = '{749B0EED-D424-4553-BE62-F24B9EE4B0DE}';
RID_InformeDetallesPresupuestoDelta = '{322F58BC-E445-4DF9-9BFB-86086B38356B}';
type type
{ IListaAnosPresupuestosDelta }
IListaAnosPresupuestosDelta = interface(IListaAnosPresupuestos)
['{CBA70605-3C3B-48A1-A28C-B1E97902006E}']
{ Property getters and setters }
function GetOldANOValue : String;
{ Properties }
property OldANO : String read GetOldANOValue;
end;
{ TListaAnosPresupuestosBusinessProcessorRules }
TListaAnosPresupuestosBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosPresupuestos, IListaAnosPresupuestosDelta)
private
protected
{ Property getters and setters }
function GetANOValue: String; virtual;
function GetOldANOValue: String; virtual;
procedure SetANOValue(const aValue: String); virtual;
{ Properties }
property ANO : String read GetANOValue write SetANOValue;
property OldANO : String read GetOldANOValue;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
destructor Destroy; override;
end;
{ IDetallesPresupuestosDelta } { IDetallesPresupuestosDelta }
IDetallesPresupuestosDelta = interface(IDetallesPresupuestos) IDetallesPresupuestosDelta = interface(IDetallesPresupuestos)
['{27189DEC-DB55-4CFF-90D4-3CCC8C3789B7}'] ['{A06F07C8-8609-4E0C-A202-CDFD98C02B75}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOPRESUPUESTOValue : Integer; function GetOldCODIGOPRESUPUESTOValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -117,7 +147,7 @@ type
{ IPresupuestosDelta } { IPresupuestosDelta }
IPresupuestosDelta = interface(IPresupuestos) IPresupuestosDelta = interface(IPresupuestos)
['{AD80280F-15D4-422B-9E7C-B413BD6D9270}'] ['{475CF11F-7C34-4390-B427-291574D72D01}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -307,7 +337,7 @@ type
{ IPresupuestos_RefreshDatasetDelta } { IPresupuestos_RefreshDatasetDelta }
IPresupuestos_RefreshDatasetDelta = interface(IPresupuestos_RefreshDataset) IPresupuestos_RefreshDatasetDelta = interface(IPresupuestos_RefreshDataset)
['{F4E70462-4089-44C8-AFAA-B6FDEFE43DB9}'] ['{7B057008-D651-4A1C-B4B7-08C7C4A566F9}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
function GetOldNOMBREValue : String; function GetOldNOMBREValue : String;
@ -364,7 +394,7 @@ type
{ IInformeCabeceraPresupuestoDelta } { IInformeCabeceraPresupuestoDelta }
IInformeCabeceraPresupuestoDelta = interface(IInformeCabeceraPresupuesto) IInformeCabeceraPresupuestoDelta = interface(IInformeCabeceraPresupuesto)
['{41A03000-031E-4727-B794-E79D553EC52B}'] ['{749B0EED-D424-4553-BE62-F24B9EE4B0DE}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOEMPRESAValue : Integer;
function GetOldCODIGOValue : Integer; function GetOldCODIGOValue : Integer;
@ -610,7 +640,7 @@ type
{ IInformeDetallesPresupuestoDelta } { IInformeDetallesPresupuestoDelta }
IInformeDetallesPresupuestoDelta = interface(IInformeDetallesPresupuesto) IInformeDetallesPresupuestoDelta = interface(IInformeDetallesPresupuesto)
['{741759BF-9981-4B00-A217-C5C769B36552}'] ['{322F58BC-E445-4DF9-9BFB-86086B38356B}']
{ Property getters and setters } { Property getters and setters }
function GetOldCODIGOPRESUPUESTOValue : Integer; function GetOldCODIGOPRESUPUESTOValue : Integer;
function GetOldNUMCONCEPTOValue : Integer; function GetOldNUMCONCEPTOValue : Integer;
@ -691,6 +721,33 @@ implementation
uses uses
Variants, uROBinaryHelpers; Variants, uROBinaryHelpers;
{ TListaAnosPresupuestosBusinessProcessorRules }
constructor TListaAnosPresupuestosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
inherited;
end;
destructor TListaAnosPresupuestosBusinessProcessorRules.Destroy;
begin
inherited;
end;
function TListaAnosPresupuestosBusinessProcessorRules.GetANOValue: String;
begin
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosPresupuestosANO];
end;
function TListaAnosPresupuestosBusinessProcessorRules.GetOldANOValue: String;
begin
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosPresupuestosANO];
end;
procedure TListaAnosPresupuestosBusinessProcessorRules.SetANOValue(const aValue: String);
begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosPresupuestosANO] := aValue;
end;
{ TDetallesPresupuestosBusinessProcessorRules } { TDetallesPresupuestosBusinessProcessorRules }
constructor TDetallesPresupuestosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); constructor TDetallesPresupuestosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin begin
@ -1964,6 +2021,7 @@ end;
initialization initialization
RegisterBusinessProcessorRules(RID_ListaAnosPresupuestosDelta, TListaAnosPresupuestosBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_DetallesPresupuestosDelta, TDetallesPresupuestosBusinessProcessorRules); RegisterBusinessProcessorRules(RID_DetallesPresupuestosDelta, TDetallesPresupuestosBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_PresupuestosDelta, TPresupuestosBusinessProcessorRules); RegisterBusinessProcessorRules(RID_PresupuestosDelta, TPresupuestosBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_Presupuestos_RefreshDatasetDelta, TPresupuestos_RefreshDatasetBusinessProcessorRules); RegisterBusinessProcessorRules(RID_Presupuestos_RefreshDatasetDelta, TPresupuestos_RefreshDatasetBusinessProcessorRules);

View File

@ -6,8 +6,8 @@ object srvPresupuestos: TsrvPresupuestos
ConnectionName = 'IBX' ConnectionName = 'IBX'
ServiceSchema = schPresupuestos ServiceSchema = schPresupuestos
ServiceAdapter = DABINAdapter ServiceAdapter = DABINAdapter
Left = 729 Left = 728
Top = 363 Top = 316
Height = 359 Height = 359
Width = 328 Width = 328
object schPresupuestos: TDASchema object schPresupuestos: TDASchema
@ -15,6 +15,39 @@ object srvPresupuestos: TsrvPresupuestos
DataDictionary = dmServer.DataDictionary DataDictionary = dmServer.DataDictionary
Diagrams = dmServer.DADiagrams Diagrams = dmServer.DADiagrams
Datasets = < Datasets = <
item
Params = <>
Statements = <
item
Connection = 'IBX'
SQL =
'select ANO from'#10'(select distinct(substr(FECHAPRESUPUESTO, 1,4)) ' +
'as ANO'#10'from presupuestos'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select dis' +
'tinct '#39'Todos'#39' as ANO'#10'from empresas'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ANO'
TableField = 'ANO'
end>
end>
Name = 'ListaAnosPresupuestos'
Fields = <
item
Name = 'ANO'
DataType = datString
Size = 254
BlobType = dabtUnknown
DisplayWidth = 0
Alignment = taLeftJustify
InPrimaryKey = False
Calculated = False
Lookup = False
LookupCache = False
end>
BusinessRulesClient.ScriptLanguage = rslPascalScript
BusinessRulesServer.ScriptLanguage = rslPascalScript
end
item item
Params = < Params = <
item item

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More