Poder filtrar información de los grid por años
git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@309 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
parent
96c436f1d9
commit
c83756255b
Binary file not shown.
@ -17,7 +17,12 @@ DECLARE EXTERNAL FUNCTION MOD
|
||||
RETURNS DOUBLE PRECISION BY VALUE
|
||||
ENTRY_POINT 'IB_UDF_mod' MODULE_NAME 'ib_udf';
|
||||
|
||||
|
||||
DECLARE EXTERNAL FUNCTION SUBSTR
|
||||
CSTRING(254),
|
||||
SMALLINT,
|
||||
SMALLINT
|
||||
RETURNS CSTRING(254) FREE_IT
|
||||
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
@ -214,9 +214,9 @@
|
||||
<Excluded_Packages Name="C:\Documents and Settings\David\Mis documentos\Borland Studio Projects\Bpl\dxGDIPlusD10.bpl">ExpressGDI+ Library by Developer Express Inc.</Excluded_Packages>
|
||||
</Excluded_Packages>
|
||||
</Delphi.Personality>
|
||||
<!-- EurekaLog First Line
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=519
|
||||
EurekaLog Version=6014
|
||||
Activate=1
|
||||
Activate Handle=1
|
||||
Save Log File=1
|
||||
@ -530,5 +530,190 @@ Count mtSend_SuccessMsg=1
|
||||
mtSend_SuccessMsg0="The message was sent successfully."
|
||||
Count mtSend_FailureMsg=1
|
||||
mtSend_FailureMsg0="Sorry, sending the message didn't work."
|
||||
ProxyURL=
|
||||
ProxyUser=
|
||||
ProxyPassword=
|
||||
ProxyPort=8080
|
||||
TrakerUser=
|
||||
TrakerPassword=
|
||||
TrakerAssignTo=
|
||||
TrakerProject=
|
||||
TrakerCategory=
|
||||
TrakerTrialID=
|
||||
ZipPassword=
|
||||
PreBuildEvent=
|
||||
PostSuccessfulBuildEvent=
|
||||
PostFailureBuildEvent=
|
||||
ExceptionDialogType=2
|
||||
loSaveModulesAndProcessesSections=1
|
||||
loSaveAssemblerAndCPUSections=1
|
||||
soAppUpTime=1
|
||||
soExcModuleName=1
|
||||
soExcModuleVersion=1
|
||||
soExcID=1
|
||||
soExcCount=1
|
||||
soExcStatus=1
|
||||
soExcNote=1
|
||||
soUserID=1
|
||||
soUserName=1
|
||||
soUserEmail=1
|
||||
soUserPrivileges=1
|
||||
soUserCompany=1
|
||||
soCmpDisplayDPI=1
|
||||
soCmpVideoCard=1
|
||||
soCmpPrinter=1
|
||||
soOSCharset=1
|
||||
soCustomData=1
|
||||
sndAddComputerNameInFileName=0
|
||||
edoSendErrorReportChecked=1
|
||||
edoShowSendErrorReportOption=1
|
||||
edoShowAttachScreenshotOption=1
|
||||
edoShowCustomButton=0
|
||||
csoDoNotStoreProcNames=0
|
||||
boHandleSafeCallExceptions=1
|
||||
boCallRTLExceptionEvent=0
|
||||
boCatchHandledExceptions=0
|
||||
loCatchLeaks=0
|
||||
loGroupsSonLeaks=1
|
||||
loHideBorlandLeaks=1
|
||||
loFreeAllLeaks=1
|
||||
loCatchLeaksExceptions=1
|
||||
cfoReduceFileSize=1
|
||||
cfoCheckFileCorruption=0
|
||||
Count mtErrorMsgCaption=1
|
||||
mtErrorMsgCaption0="Error."
|
||||
Count mtDialog_ProcessesCaption=1
|
||||
mtDialog_ProcessesCaption0="Processes"
|
||||
Count mtDialog_ProcessesHeader=1
|
||||
mtDialog_ProcessesHeader0="Processes Information"
|
||||
Count mtDialog_AsmCaption=1
|
||||
mtDialog_AsmCaption0="Assembler"
|
||||
Count mtDialog_AsmHeader=1
|
||||
mtDialog_AsmHeader0="Assembler Information"
|
||||
Count mtDialog_CustomButtonCaption=1
|
||||
mtDialog_CustomButtonCaption0="%26Help"
|
||||
Count mtMSDialog_ErrorMsgCaption=1
|
||||
mtMSDialog_ErrorMsgCaption0="The application has encountered a problem. We are sorry for the inconvenience."
|
||||
Count mtMSDialog_RestartCaption=1
|
||||
mtMSDialog_RestartCaption0="Restart application."
|
||||
Count mtMSDialog_TerminateCaption=1
|
||||
mtMSDialog_TerminateCaption0="Terminate application."
|
||||
Count mtMSDialog_PleaseCaption=1
|
||||
mtMSDialog_PleaseCaption0="Please tell us about this problem."
|
||||
Count mtMSDialog_DescriptionCaption=1
|
||||
mtMSDialog_DescriptionCaption0="We have created an error report that you can send to us. We will treat this report as confidential and anonymous."
|
||||
Count mtMSDialog_SeeDetailsCaption=1
|
||||
mtMSDialog_SeeDetailsCaption0="To see what data the error report contains,"
|
||||
Count mtMSDialog_SeeClickCaption=1
|
||||
mtMSDialog_SeeClickCaption0="click here."
|
||||
Count mtMSDialog_HowToReproduceCaption=1
|
||||
mtMSDialog_HowToReproduceCaption0="What were you doing when the problem happened (optional)?"
|
||||
Count mtMSDialog_EmailCaption=1
|
||||
mtMSDialog_EmailCaption0="Email address (optional):"
|
||||
Count mtMSDialog_SendButtonCaption=1
|
||||
mtMSDialog_SendButtonCaption0="%26Send Error Report"
|
||||
Count mtMSDialog_NoSendButtonCaption=1
|
||||
mtMSDialog_NoSendButtonCaption0="%26Don't Send"
|
||||
Count mtLog_AppUpTime=1
|
||||
mtLog_AppUpTime0="Up Time"
|
||||
Count mtLog_ExcModuleName=1
|
||||
mtLog_ExcModuleName0="Module Name"
|
||||
Count mtLog_ExcModuleVersion=1
|
||||
mtLog_ExcModuleVersion0="Module Version"
|
||||
Count mtLog_ExcID=1
|
||||
mtLog_ExcID0="ID"
|
||||
Count mtLog_ExcCount=1
|
||||
mtLog_ExcCount0="Count"
|
||||
Count mtLog_ExcStatus=1
|
||||
mtLog_ExcStatus0="Status"
|
||||
Count mtLog_ExcNote=1
|
||||
mtLog_ExcNote0="Note"
|
||||
Count mtLog_UserHeader=1
|
||||
mtLog_UserHeader0="User"
|
||||
Count mtLog_UserID=1
|
||||
mtLog_UserID0="ID"
|
||||
Count mtLog_UserName=1
|
||||
mtLog_UserName0="Name"
|
||||
Count mtLog_UserEmail=1
|
||||
mtLog_UserEmail0="Email"
|
||||
Count mtLog_UserCompany=1
|
||||
mtLog_UserCompany0="Company"
|
||||
Count mtLog_UserPrivileges=1
|
||||
mtLog_UserPrivileges0="Privileges"
|
||||
Count mtLog_CmpDisplayDPI=1
|
||||
mtLog_CmpDisplayDPI0="Display DPI"
|
||||
Count mtLog_CmpVideoCard=1
|
||||
mtLog_CmpVideoCard0="Video Card"
|
||||
Count mtLog_CmpPrinter=1
|
||||
mtLog_CmpPrinter0="Printer"
|
||||
Count mtLog_OSCharset=1
|
||||
mtLog_OSCharset0="Charset"
|
||||
Count mtCallStack_LeakCaption=1
|
||||
mtCallStack_LeakCaption0="Memory Leak"
|
||||
Count mtCallStack_LeakData=1
|
||||
mtCallStack_LeakData0="Data"
|
||||
Count mtCallStack_LeakType=1
|
||||
mtCallStack_LeakType0="Type"
|
||||
Count mtCallStack_LeakSize=1
|
||||
mtCallStack_LeakSize0="Total size"
|
||||
Count mtCallStack_LeakCount=1
|
||||
mtCallStack_LeakCount0="Count"
|
||||
Count mtSendDialog_Login=1
|
||||
mtSendDialog_Login0="Login..."
|
||||
Count mtSendDialog_Sent=1
|
||||
mtSendDialog_Sent0="Message sent."
|
||||
Count mtSendDialog_SelectProject=1
|
||||
mtSendDialog_SelectProject0="Select project..."
|
||||
Count mtSendDialog_Searching=1
|
||||
mtSendDialog_Searching0="Searching..."
|
||||
Count mtSendDialog_Modifying=1
|
||||
mtSendDialog_Modifying0="Modifying..."
|
||||
Count mtSendDialog_Disconnecting=1
|
||||
mtSendDialog_Disconnecting0="Disconnecting..."
|
||||
Count mtSendDialog_Disconnected=1
|
||||
mtSendDialog_Disconnected0="Disconnected."
|
||||
Count mtProcesses_ID=1
|
||||
mtProcesses_ID0="ID"
|
||||
Count mtProcesses_Name=1
|
||||
mtProcesses_Name0="Name"
|
||||
Count mtProcesses_Description=1
|
||||
mtProcesses_Description0="Description"
|
||||
Count mtProcesses_Version=1
|
||||
mtProcesses_Version0="Version"
|
||||
Count mtProcesses_Memory=1
|
||||
mtProcesses_Memory0="Memory"
|
||||
Count mtProcesses_Priority=1
|
||||
mtProcesses_Priority0="Priority"
|
||||
Count mtProcesses_Threads=1
|
||||
mtProcesses_Threads0="Threads"
|
||||
Count mtProcesses_Path=1
|
||||
mtProcesses_Path0="Path"
|
||||
Count mtSend_BugClosedMsg=2
|
||||
mtSend_BugClosedMsg0="These BUG is just closed."
|
||||
mtSend_BugClosedMsg1="Contact the program support to obtain an update."
|
||||
Count mtSend_UnknownErrorMsg=1
|
||||
mtSend_UnknownErrorMsg0="Unknown error."
|
||||
Count mtSend_InvalidLoginMsg=1
|
||||
mtSend_InvalidLoginMsg0="Invalid login request."
|
||||
Count mtSend_InvalidSearchMsg=1
|
||||
mtSend_InvalidSearchMsg0="Invalid search request."
|
||||
Count mtSend_InvalidSelectionMsg=1
|
||||
mtSend_InvalidSelectionMsg0="Invalid selection request."
|
||||
Count mtSend_InvalidInsertMsg=1
|
||||
mtSend_InvalidInsertMsg0="Invalid insert request."
|
||||
Count mtSend_InvalidModifyMsg=1
|
||||
mtSend_InvalidModifyMsg0="Invalid modify request."
|
||||
Count mtFileCrackedMsg=2
|
||||
mtFileCrackedMsg0="This file is cracked."
|
||||
mtFileCrackedMsg1="The application will be closed."
|
||||
Count mtException_LeakMultiFree=1
|
||||
mtException_LeakMultiFree0="Multi Free memory leak."
|
||||
Count mtException_LeakMemoryOverrun=1
|
||||
mtException_LeakMemoryOverrun0="Memory Overrun leak."
|
||||
Count mtException_AntiFreeze=1
|
||||
mtException_AntiFreeze0="The application seems to be frozen."
|
||||
Count mtInvalidEmailMsg=1
|
||||
mtInvalidEmailMsg0="Invalid email."
|
||||
TextsCollection=English
|
||||
EurekaLog Last Line -->
|
||||
</BorlandProject>
|
||||
|
||||
@ -181,9 +181,9 @@
|
||||
<Excluded_Packages Name="c:\archivos de programa\borland\delphi10\Bin\dcltee100.bpl">TeeChart Components</Excluded_Packages>
|
||||
</Excluded_Packages>
|
||||
</Delphi.Personality>
|
||||
<!-- EurekaLog First Line
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=519
|
||||
EurekaLog Version=6014
|
||||
Activate=1
|
||||
Activate Handle=1
|
||||
Save Log File=1
|
||||
|
||||
@ -85,6 +85,16 @@ inherited fEditorGridBase: TfEditorGridBase
|
||||
ShowHint = True
|
||||
ShrinkMode = tbsmNone
|
||||
TabOrder = 0
|
||||
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
|
||||
Caption = 'Filtrar:'
|
||||
end
|
||||
|
||||
@ -57,6 +57,9 @@ type
|
||||
actFiltrar: TAction;
|
||||
TBXItem37: TTBXItem;
|
||||
TBXTMain2: TTBXToolbar;
|
||||
lblAno: TTBXLabelItem;
|
||||
cbxListaAnos: TTBXComboBoxItem;
|
||||
sepAno: TTBXSeparatorItem;
|
||||
procedure tbxEditFiltroChange(Sender: TObject; const Text: String);
|
||||
procedure FormShow(Sender: TObject); override;
|
||||
procedure actQuitarFiltroExecute(Sender: TObject);
|
||||
@ -70,9 +73,15 @@ type
|
||||
procedure actFiltrarUpdate(Sender: TObject);
|
||||
procedure CustomEditorDestroy(Sender: TObject);
|
||||
protected
|
||||
FListaAnos: TStringList;
|
||||
FViewGrid : IViewGridBase;
|
||||
FWhereDataTable: WideString;
|
||||
function GetListaAnos: TStringList;
|
||||
procedure SetListaAnos(const Value: TStringList);
|
||||
procedure SetViewGrid(const Value : IViewGridBase); virtual;
|
||||
function GetViewGrid: IViewGridBase;
|
||||
function GetWhereDataTable: String;
|
||||
procedure SetWhereDataTable(const Value: String);
|
||||
procedure SetMultiSelect (AValue : Boolean);
|
||||
function GetMultiSelect : Boolean;
|
||||
|
||||
@ -81,7 +90,9 @@ type
|
||||
procedure ImprimirInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
public
|
||||
property ListaAnos: TStringList read GetListaAnos write SetListaAnos;
|
||||
property ViewGrid: IViewGridBase read GetViewGrid write SetViewGrid;
|
||||
property WhereDataTable: String read GetWhereDataTable write SetWhereDataTable;
|
||||
property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect;
|
||||
|
||||
constructor Create(AOwner : TComponent); override;
|
||||
@ -101,9 +112,17 @@ uses
|
||||
destructor TfEditorGridBase.Destroy;
|
||||
begin
|
||||
FViewGrid := NIL;
|
||||
FWhereDataTable := '';
|
||||
if Assigned(FListaAnos) then
|
||||
FlistaAnos.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TfEditorGridBase.GetListaAnos: TStringList;
|
||||
begin
|
||||
Result := FListaAnos;
|
||||
end;
|
||||
|
||||
function TfEditorGridBase.GetMultiSelect: Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
@ -116,12 +135,53 @@ begin
|
||||
Result := FViewGrid;
|
||||
end;
|
||||
|
||||
function TfEditorGridBase.GetWhereDataTable: String;
|
||||
begin
|
||||
Result := FWhereDataTable;
|
||||
end;
|
||||
|
||||
procedure TfEditorGridBase.ImprimirInterno;
|
||||
begin
|
||||
inherited;
|
||||
ViewGrid.Print;
|
||||
end;
|
||||
|
||||
procedure TfEditorGridBase.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 TfEditorGridBase.SetMultiSelect(AValue: Boolean);
|
||||
begin
|
||||
if Assigned(ViewGrid) then
|
||||
@ -138,6 +198,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorGridBase.SetWhereDataTable(const Value: String);
|
||||
begin
|
||||
FWhereDataTable := Value;
|
||||
end;
|
||||
|
||||
procedure TfEditorGridBase.tbxEditFiltroChange(Sender: TObject; const Text: String);
|
||||
begin
|
||||
if Assigned(ViewGrid) then
|
||||
@ -158,6 +223,8 @@ begin
|
||||
ViewGrid.RestoreFromIniFile;
|
||||
ViewGrid.ShowEmbedded(Self);
|
||||
end;
|
||||
|
||||
cbxListaAnos.ItemIndex := 0;
|
||||
end;
|
||||
|
||||
procedure TfEditorGridBase.actEliminarUpdate(Sender: TObject);
|
||||
@ -247,6 +314,7 @@ constructor TfEditorGridBase.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
actModificar.ShortCut := ShortCut(VK_RETURN, []);
|
||||
FWhereDataTable := '';
|
||||
end;
|
||||
|
||||
procedure TfEditorGridBase.CustomEditorDestroy(Sender: TObject);
|
||||
|
||||
@ -4,7 +4,7 @@ interface
|
||||
|
||||
|
||||
uses
|
||||
SysUtils, uDADataTable, uEditorDBItem,
|
||||
Classes, SysUtils, uDADataTable, uEditorDBItem,
|
||||
uControllerBase, uIDataModuleAlbaranesCliente, uClientesController,
|
||||
uDetallesAlbaranClienteController, uBizAlbaranesCliente, uBizDireccionesContacto,
|
||||
uViewGridBase;
|
||||
@ -72,6 +72,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosAlbaranes: TStringList;
|
||||
procedure FiltrarAno(AAlbaran: IBizAlbaranCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TAlbaranesClienteController = class(TObservador, IAlbaranesClienteController)
|
||||
@ -158,6 +161,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosAlbaranes: TStringList;
|
||||
procedure FiltrarAno(AAlbaran: IBizAlbaranCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -166,7 +172,7 @@ uses
|
||||
uROTypes, Controls, cxControls, DB, uEditorRegistryUtils, uEditorPreview, DateUtils,
|
||||
uIEditorAlbaranesCliente, uIEditorAlbaranesDevCliente, uIEditorAlbaranDevCliente,
|
||||
uDataModuleAlbaranesCliente, Variants, uBizDetallesAlbaranCliente,
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios, Classes,
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios,
|
||||
schAlbaranesClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorAlbaranCliente,
|
||||
uIEditorElegirAlbaranesCliente, uIEditorDireccionEntregaAlbaranCliente,
|
||||
schContactosClient_Intf, uAlbaranesClienteReportController, uControllerDetallesBase,
|
||||
@ -399,6 +405,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteController.DarListaAnosAlbaranes: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesClienteController.DescartarCambios(AAlbaran: IBizAlbaranCliente);
|
||||
begin
|
||||
if not Assigned(AAlbaran) then
|
||||
@ -990,6 +1001,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesClienteController.FiltrarAno(AAlbaran: IBizAlbaranCliente; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
AAlbaran.DataTable.Where.Clear;
|
||||
AAlbaran.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with AAlbaran.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_AlbaranesClienteFECHA_ALBARAN, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_AlbaranesClienteFECHA_ALBARAN, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesClienteController.FiltrarEmpresa(
|
||||
AAlbaran: IBizAlbaranCliente);
|
||||
begin
|
||||
|
||||
@ -1097,4 +1097,113 @@ object DataModuleAlbaranesCliente: TDataModuleAlbaranesCliente
|
||||
Left = 392
|
||||
Top = 80
|
||||
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 = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosAlbaranes'
|
||||
IndexDefs = <>
|
||||
Left = 256
|
||||
Top = 288
|
||||
end
|
||||
object ds_ListaAnosAlbaranes: TDADataSource
|
||||
DataTable = tbl_ListaAnosAlbaranes
|
||||
Left = 256
|
||||
Top = 232
|
||||
end
|
||||
end
|
||||
|
||||
@ -22,6 +22,8 @@ type
|
||||
ds_AlbaranesCliente: TDADataSource;
|
||||
tbl_AlbaranesCliente_Detalles: TDACDSDataTable;
|
||||
ds_AlbaranesCliente_Detalles: TDADataSource;
|
||||
tbl_ListaAnosAlbaranes: TDACDSDataTable;
|
||||
ds_ListaAnosAlbaranes: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
|
||||
private
|
||||
@ -41,6 +43,8 @@ type
|
||||
function GetReport(const AID: String; const ConObservacionesIncidencias: Boolean = False; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetEtiquetas(const AID: Integer; withRefCliente: Boolean): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -131,6 +135,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleAlbaranesCliente.GetAnosItems: 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;
|
||||
|
||||
function TDataModuleAlbaranesCliente.GetEtiquetas(const AID: Integer; withRefCliente: Boolean): Binary;
|
||||
begin
|
||||
Result := (RORemoteService as IsrvAlbaranesCliente).GenerateEtiquetas(AID, withRefCliente)
|
||||
|
||||
@ -3,11 +3,12 @@ unit uIDataModuleAlbaranesCliente;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizAlbaranesCliente;
|
||||
Classes, uBizAlbaranesCliente;
|
||||
|
||||
type
|
||||
IDataModuleAlbaranesCliente = interface
|
||||
['{81932348-9595-45AC-AFC9-5A8983B4A3A8}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizAlbaranCliente;
|
||||
function GetItem(const ID : Integer) : IBizAlbaranCliente;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,19 +9,27 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferencia = '{6E198309-9D28-4477-9CA0-EB9D2D66816E}';
|
||||
RID_AlbaranesCliente = '{427DEED0-B45E-416C-9691-878364B1D157}';
|
||||
RID_AlbaranesCliente_Detalles = '{F872903B-5A03-4005-9BC7-BF23C732C514}';
|
||||
RID_AlbaranesCliente_Detalles_Refresh = '{34528702-5411-427E-A31E-AD548FE013DB}';
|
||||
RID_AlbaranesCliente_Refresh = '{75C41D7C-87F3-4135-94D8-64EB689EEED2}';
|
||||
RID_ListaAnosAlbaranes = '{A07DBFAC-A835-4C6F-8EDD-63D516CE7018}';
|
||||
RID_DarReferencia = '{7548CCD3-BA67-4F25-99B8-0DF8C7922DC8}';
|
||||
RID_AlbaranesCliente = '{2803D94C-6CA5-473B-B00C-6B1E4DD62039}';
|
||||
RID_AlbaranesCliente_Detalles = '{186AC7FF-AABB-4207-8532-39F70C7F0994}';
|
||||
RID_AlbaranesCliente_Detalles_Refresh = '{40C5D633-0EC0-4EEB-9062-B5E23735AA49}';
|
||||
RID_AlbaranesCliente_Refresh = '{2F10C424-28DF-4E96-A146-D3C8AFC874B0}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosAlbaranes = 'ListaAnosAlbaranes';
|
||||
nme_DarReferencia = 'DarReferencia';
|
||||
nme_AlbaranesCliente = 'AlbaranesCliente';
|
||||
nme_AlbaranesCliente_Detalles = 'AlbaranesCliente_Detalles';
|
||||
nme_AlbaranesCliente_Detalles_Refresh = 'AlbaranesCliente_Detalles_Refresh';
|
||||
nme_AlbaranesCliente_Refresh = 'AlbaranesCliente_Refresh';
|
||||
|
||||
{ ListaAnosAlbaranes fields }
|
||||
fld_ListaAnosAlbaranesANO = 'ANO';
|
||||
|
||||
{ ListaAnosAlbaranes field indexes }
|
||||
idx_ListaAnosAlbaranesANO = 0;
|
||||
|
||||
{ DarReferencia fields }
|
||||
fld_DarReferenciaVALOR = 'VALOR';
|
||||
|
||||
@ -295,9 +303,38 @@ const
|
||||
idx_AlbaranesCliente_RefreshNUM_CORREOS = 46;
|
||||
|
||||
type
|
||||
{ IListaAnosAlbaranes }
|
||||
IListaAnosAlbaranes = interface(IDAStronglyTypedDataTable)
|
||||
['{4256FFC5-19D0-4268-BECE-63386E811952}']
|
||||
{ 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;
|
||||
|
||||
{ IDarReferencia }
|
||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{161D1427-0B1E-4930-99D1-32771941E834}']
|
||||
['{55C372FF-BF39-4F24-8C0F-3F8652C093C9}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -326,7 +363,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente }
|
||||
IAlbaranesCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{D1B387DE-6B5E-4E62-9D66-DCAE4650B924}']
|
||||
['{30E4105E-F304-4684-9F36-0F085B95E8F6}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -637,7 +674,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente_Detalles }
|
||||
IAlbaranesCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{B24E4037-B5C6-4614-A46B-883647A0DE56}']
|
||||
['{5CAD693C-E2DB-4355-8310-B8EBA15EDB4F}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -750,7 +787,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente_Detalles_Refresh }
|
||||
IAlbaranesCliente_Detalles_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{EDB2FD19-DB40-48A9-927F-438CF7EAEA89}']
|
||||
['{3B82C2B6-F19A-453E-8524-EA8E3565867B}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -863,7 +900,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente_Refresh }
|
||||
IAlbaranesCliente_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{F4C1C165-FC99-4013-8201-13BC3A53C5B3}']
|
||||
['{04558C4E-FE43-44B4-9439-774781EB864B}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -1170,6 +1207,28 @@ implementation
|
||||
|
||||
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;
|
||||
|
||||
|
||||
{ TDarReferenciaDataTableRules }
|
||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -2495,6 +2554,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosAlbaranes, TListaAnosAlbaranesDataTableRules);
|
||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_AlbaranesCliente, TAlbaranesClienteDataTableRules);
|
||||
RegisterDataTableRules(RID_AlbaranesCliente_Detalles, TAlbaranesCliente_DetallesDataTableRules);
|
||||
|
||||
@ -9,16 +9,46 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferenciaDelta = '{F5B4C4C3-C729-4547-87F6-03DBAC94A16C}';
|
||||
RID_AlbaranesClienteDelta = '{6BB65B45-5F5A-4D5B-81BE-A0E323B271D3}';
|
||||
RID_AlbaranesCliente_DetallesDelta = '{983E8353-C226-4781-BFC0-41B9FD033718}';
|
||||
RID_AlbaranesCliente_Detalles_RefreshDelta = '{9AB519AF-EFCD-467E-A3C2-13A7ACF9BA27}';
|
||||
RID_AlbaranesCliente_RefreshDelta = '{2AC22218-4783-4C52-8DD3-7F7DAD417657}';
|
||||
RID_ListaAnosAlbaranesDelta = '{90F084BA-9BC4-4890-8E73-EE502ED7EC0F}';
|
||||
RID_DarReferenciaDelta = '{5C4E2CEA-88DD-4AC6-AAC2-6293B3382633}';
|
||||
RID_AlbaranesClienteDelta = '{98711469-A105-4C12-A90C-952772B92D20}';
|
||||
RID_AlbaranesCliente_DetallesDelta = '{A0FDE976-C61E-4FCE-8507-54924F485E4F}';
|
||||
RID_AlbaranesCliente_Detalles_RefreshDelta = '{48C36801-6C3D-4815-B443-DDDC4BCD25DF}';
|
||||
RID_AlbaranesCliente_RefreshDelta = '{4153EB2E-48B9-4133-8427-285B91FA9723}';
|
||||
|
||||
type
|
||||
{ IListaAnosAlbaranesDelta }
|
||||
IListaAnosAlbaranesDelta = interface(IListaAnosAlbaranes)
|
||||
['{90F084BA-9BC4-4890-8E73-EE502ED7EC0F}']
|
||||
{ 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;
|
||||
|
||||
{ IDarReferenciaDelta }
|
||||
IDarReferenciaDelta = interface(IDarReferencia)
|
||||
['{F5B4C4C3-C729-4547-87F6-03DBAC94A16C}']
|
||||
['{5C4E2CEA-88DD-4AC6-AAC2-6293B3382633}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -47,7 +77,7 @@ type
|
||||
|
||||
{ IAlbaranesClienteDelta }
|
||||
IAlbaranesClienteDelta = interface(IAlbaranesCliente)
|
||||
['{6BB65B45-5F5A-4D5B-81BE-A0E323B271D3}']
|
||||
['{98711469-A105-4C12-A90C-952772B92D20}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -405,7 +435,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente_DetallesDelta }
|
||||
IAlbaranesCliente_DetallesDelta = interface(IAlbaranesCliente_Detalles)
|
||||
['{983E8353-C226-4781-BFC0-41B9FD033718}']
|
||||
['{A0FDE976-C61E-4FCE-8507-54924F485E4F}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_ALBARANValue : Integer;
|
||||
@ -532,7 +562,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente_Detalles_RefreshDelta }
|
||||
IAlbaranesCliente_Detalles_RefreshDelta = interface(IAlbaranesCliente_Detalles_Refresh)
|
||||
['{9AB519AF-EFCD-467E-A3C2-13A7ACF9BA27}']
|
||||
['{48C36801-6C3D-4815-B443-DDDC4BCD25DF}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_ALBARANValue : Integer;
|
||||
@ -659,7 +689,7 @@ type
|
||||
|
||||
{ IAlbaranesCliente_RefreshDelta }
|
||||
IAlbaranesCliente_RefreshDelta = interface(IAlbaranesCliente_Refresh)
|
||||
['{2AC22218-4783-4C52-8DD3-7F7DAD417657}']
|
||||
['{4153EB2E-48B9-4133-8427-285B91FA9723}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -1013,6 +1043,33 @@ implementation
|
||||
uses
|
||||
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;
|
||||
|
||||
|
||||
{ TDarReferenciaBusinessProcessorRules }
|
||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2972,6 +3029,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosAlbaranesDelta, TListaAnosAlbaranesBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_AlbaranesClienteDelta, TAlbaranesClienteBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_AlbaranesCliente_DetallesDelta, TAlbaranesCliente_DetallesBusinessProcessorRules);
|
||||
|
||||
@ -15,6 +15,35 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente
|
||||
ConnectionManager = dmServer.ConnectionManager
|
||||
DataDictionary = DADataDictionary
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_ALBARAN, 1,4)) as ' +
|
||||
'ANO'#10'from albaranes_cliente'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select d' +
|
||||
'istinct '#39'Todos'#39' as ANO'#10'from empresas'
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -133,12 +133,26 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 855
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
Visible = True
|
||||
ExplicitWidth = 514
|
||||
ExplicitLeft = 435
|
||||
ExplicitWidth = 420
|
||||
object TBXItem42: TTBXItem
|
||||
Action = actEnviar
|
||||
DisplayMode = nbdmImageAndText
|
||||
|
||||
@ -55,6 +55,7 @@ type
|
||||
procedure actGenerarOrdenExecute(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
protected
|
||||
FAlbaranes: IBizAlbaranCliente;
|
||||
@ -72,6 +73,7 @@ type
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
//Si queremos crear otra vista para el editor heredado solo tendriamos que
|
||||
//sobreescribir este método
|
||||
@ -383,6 +385,8 @@ end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES QUE EL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -485,6 +489,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(Albaranes, WhereDataTable, Text);
|
||||
if Albaranes.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -542,17 +553,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosAlbaranes;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.SetController(const Value: IAlbaranesClienteController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosAlbaranes;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.SetAlbaranes(const Value: IBizAlbaranCliente);
|
||||
begin
|
||||
FAlbaranes := Value;
|
||||
dsDataTable.DataTable := FAlbaranes.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewAlbaranesCliente).Albaranes := Albaranes;
|
||||
|
||||
if Assigned(FAlbaranes) then
|
||||
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 := FAlbaranes.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FAlbaranes.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewAlbaranesCliente).Albaranes := Albaranes;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -4,7 +4,7 @@ interface
|
||||
|
||||
|
||||
uses
|
||||
SysUtils, uDADataTable, uEditorDBItem,
|
||||
Classes, SysUtils, uDADataTable, uEditorDBItem,
|
||||
uControllerBase, uIDataModuleAlbaranesProveedor, uProveedoresController,
|
||||
uDetallesAlbaranProveedorController, uBizAlbaranesProveedor,
|
||||
uBizDireccionesContacto, uBizInventario, uViewGridBase;
|
||||
@ -64,6 +64,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosAlbaranes: TStringList;
|
||||
procedure FiltrarAno(AAlbaran: IBizAlbaranProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TAlbaranesProveedorController = class(TObservador, IAlbaranesProveedorController)
|
||||
@ -89,7 +92,7 @@ type
|
||||
procedure FiltrarEmpresa(AAlbaran: IBizAlbaranProveedor);
|
||||
function _Vacio : IBizAlbaranProveedor;
|
||||
function ValidarAlbaran(AAlbaran: IBizAlbaranProveedor): Boolean;
|
||||
procedure _AnadirMarcaEnvioCorreo(AAlbaran: IBizAlbaranProveedor);
|
||||
procedure _AnadirMarcaEnvioCorreo(AAlbaran: IBizAlbaranProveedor);
|
||||
|
||||
public
|
||||
property ProveedorController: IProveedoresController read GetProveedorController write SetProveedorController;
|
||||
@ -117,7 +120,7 @@ type
|
||||
procedure VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor);
|
||||
procedure VerDireccionEntrega(AAlbaran : IBizAlbaranProveedor);
|
||||
function Duplicar(AAlbaran: IBizAlbaranProveedor): IBizAlbaranProveedor;
|
||||
function GenerarOrdenDev(AAlbaran: IBizAlbaranProveedor): IBizAlbaranProveedor;
|
||||
function GenerarOrdenDev(AAlbaran: IBizAlbaranProveedor): IBizAlbaranProveedor;
|
||||
procedure CopiarDireccionEnvio (const ADireccionEnvio: IBizDireccionesContacto;
|
||||
AAlbaran: IBizAlbaranProveedor);
|
||||
|
||||
@ -140,6 +143,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosAlbaranes: TStringList;
|
||||
procedure FiltrarAno(AAlbaran: IBizAlbaranProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -152,7 +158,7 @@ uses
|
||||
uIEditorElegirAlbaranesProveedor, uIEditorDireccionEntregaAlbaranProveedor,
|
||||
schContactosClient_Intf, Forms, schPedidosProveedorClient_Intf,
|
||||
uBizPedidosProveedor, uPedidosProveedorController, schInventarioClient_Intf,
|
||||
uArticulosController, uBizArticulos, uControllerDetallesBase, Classes,
|
||||
uArticulosController, uBizArticulos, uControllerDetallesBase,
|
||||
schArticulosClient_Intf, uControllerDetallesArticulos, Variants, uDialogUtils,
|
||||
uIEditorAlbaranDevProveedor, uAlbaranesProveedorReportController, uDataModuleRegistroCorreos,
|
||||
uIDialogListaAlbaranesProvEnvioEMail, uSistemaFunc, uStringsUtils, uDialogElegirEMail, uEMailUtils;
|
||||
@ -527,6 +533,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TAlbaranesProveedorController.DarListaAnosAlbaranes: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesProveedorController.DescartarCambios(AAlbaran: IBizAlbaranProveedor);
|
||||
begin
|
||||
if not Assigned(AAlbaran) then
|
||||
@ -1078,6 +1089,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesProveedorController.FiltrarAno(AAlbaran: IBizAlbaranProveedor; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
AAlbaran.DataTable.Where.Clear;
|
||||
AAlbaran.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with AAlbaran.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_AlbaranesProveedorFECHA_ALBARAN, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_AlbaranesProveedorFECHA_ALBARAN, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesProveedorController.FiltrarEmpresa(
|
||||
AAlbaran: IBizAlbaranProveedor);
|
||||
begin
|
||||
|
||||
@ -1020,4 +1020,113 @@ object DataModuleAlbaranesProveedor: TDataModuleAlbaranesProveedor
|
||||
Left = 408
|
||||
Top = 72
|
||||
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 = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosAlbaranes'
|
||||
IndexDefs = <>
|
||||
Left = 264
|
||||
Top = 280
|
||||
end
|
||||
object ds_ListaAnosAlbaranes: TDADataSource
|
||||
DataTable = tbl_ListaAnosAlbaranes
|
||||
Left = 264
|
||||
Top = 224
|
||||
end
|
||||
end
|
||||
|
||||
@ -21,6 +21,8 @@ type
|
||||
ds_AlbaranesProveedor: TDADataSource;
|
||||
tbl_AlbaranesProveedor_Detalles: TDACDSDataTable;
|
||||
ds_AlbaranesProveedor_Detalles: TDADataSource;
|
||||
tbl_ListaAnosAlbaranes: TDACDSDataTable;
|
||||
ds_ListaAnosAlbaranes: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
|
||||
private
|
||||
@ -39,6 +41,8 @@ type
|
||||
// Report
|
||||
function GetReport(const AID: String): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -129,6 +133,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleAlbaranesProveedor.GetAnosItems: 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;
|
||||
|
||||
function TDataModuleAlbaranesProveedor.GetItem(const ID: Integer): IBizAlbaranProveedor;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -3,11 +3,12 @@ unit uIDataModuleAlbaranesProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizAlbaranesProveedor;
|
||||
Classes, uBizAlbaranesProveedor;
|
||||
|
||||
type
|
||||
IDataModuleAlbaranesProveedor = interface
|
||||
['{2BAD8B3B-B57D-475C-B528-F82B320B2332}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizAlbaranProveedor;
|
||||
function GetItem(const ID : Integer) : IBizAlbaranProveedor;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,19 +9,27 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferencia = '{DA095C7E-E4E8-4CD8-8528-CDFABA7AC4D6}';
|
||||
RID_AlbaranesProveedor = '{9DEFDF85-B205-4A82-BA07-0635FCF732F3}';
|
||||
RID_AlbaranesProveedor_Detalles = '{FBDF4F91-4049-467A-8A23-0B34C49219CF}';
|
||||
RID_AlbaranesProveedor_Detalles_Refresh = '{6E08DC28-910D-48BB-84F7-BB4B5C843BEC}';
|
||||
RID_AlbaranesProveedor_Refresh = '{9B6AAB0A-F47E-4F80-A860-CF79F10150D9}';
|
||||
RID_ListaAnosAlbaranes = '{EE6F2F2C-59BC-4A82-B178-DDF4B5B69A3B}';
|
||||
RID_DarReferencia = '{21DE2CF6-8692-4441-ABB7-CF287400758B}';
|
||||
RID_AlbaranesProveedor = '{1B88CDE3-408C-45A3-B107-D0710ECCB27A}';
|
||||
RID_AlbaranesProveedor_Detalles = '{F763B958-71F8-47CB-9679-92266890CEC6}';
|
||||
RID_AlbaranesProveedor_Detalles_Refresh = '{4FFEBC17-83DE-48C5-A30C-12D90245BEE1}';
|
||||
RID_AlbaranesProveedor_Refresh = '{71A438CD-A51E-40B1-8AF6-447EF6EE35C2}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosAlbaranes = 'ListaAnosAlbaranes';
|
||||
nme_DarReferencia = 'DarReferencia';
|
||||
nme_AlbaranesProveedor = 'AlbaranesProveedor';
|
||||
nme_AlbaranesProveedor_Detalles = 'AlbaranesProveedor_Detalles';
|
||||
nme_AlbaranesProveedor_Detalles_Refresh = 'AlbaranesProveedor_Detalles_Refresh';
|
||||
nme_AlbaranesProveedor_Refresh = 'AlbaranesProveedor_Refresh';
|
||||
|
||||
{ ListaAnosAlbaranes fields }
|
||||
fld_ListaAnosAlbaranesANO = 'ANO';
|
||||
|
||||
{ ListaAnosAlbaranes field indexes }
|
||||
idx_ListaAnosAlbaranesANO = 0;
|
||||
|
||||
{ DarReferencia fields }
|
||||
fld_DarReferenciaVALOR = 'VALOR';
|
||||
|
||||
@ -273,9 +281,38 @@ const
|
||||
idx_AlbaranesProveedor_RefreshNUM_CORREOS = 41;
|
||||
|
||||
type
|
||||
{ IListaAnosAlbaranes }
|
||||
IListaAnosAlbaranes = interface(IDAStronglyTypedDataTable)
|
||||
['{43CA430C-125E-48EB-A695-17952EF4F5E4}']
|
||||
{ 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;
|
||||
|
||||
{ IDarReferencia }
|
||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{5CD5F727-9809-49B0-8443-CD13342FA522}']
|
||||
['{29352567-15EE-447C-A805-9FD838BF2E02}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -304,7 +341,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor }
|
||||
IAlbaranesProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{737FDD88-7B6C-43ED-A2DD-B0EB6D98C824}']
|
||||
['{C1FFE5AC-6527-4F94-8550-6B1DF2F389EA}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -579,7 +616,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor_Detalles }
|
||||
IAlbaranesProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{22AD4182-E814-436B-A816-84190412CE2F}']
|
||||
['{55C5E54E-7364-4A06-AA23-A6F98E41B72E}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -692,7 +729,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor_Detalles_Refresh }
|
||||
IAlbaranesProveedor_Detalles_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{008B27AC-5E14-43A8-9619-872B8AF42821}']
|
||||
['{718E5287-E155-487D-BFA2-31450B9EE8D0}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -805,7 +842,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor_Refresh }
|
||||
IAlbaranesProveedor_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{0767EBD5-75B6-462C-B2D7-42FBAC01680B}']
|
||||
['{BED01443-54F6-4998-9BEF-647345BF7472}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -1082,6 +1119,28 @@ implementation
|
||||
|
||||
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;
|
||||
|
||||
|
||||
{ TDarReferenciaDataTableRules }
|
||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -2297,6 +2356,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosAlbaranes, TListaAnosAlbaranesDataTableRules);
|
||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_AlbaranesProveedor, TAlbaranesProveedorDataTableRules);
|
||||
RegisterDataTableRules(RID_AlbaranesProveedor_Detalles, TAlbaranesProveedor_DetallesDataTableRules);
|
||||
|
||||
@ -9,16 +9,46 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferenciaDelta = '{072ED31D-044E-4E64-9C2F-3A60BADA6E2B}';
|
||||
RID_AlbaranesProveedorDelta = '{CE83BD2D-ADEA-4A6F-9939-F42C34875F8C}';
|
||||
RID_AlbaranesProveedor_DetallesDelta = '{9B5D0070-C7CB-4B34-B97A-8C92AF15B871}';
|
||||
RID_AlbaranesProveedor_Detalles_RefreshDelta = '{1C39A006-A42E-4F9A-B39B-6DCBA89A8E98}';
|
||||
RID_AlbaranesProveedor_RefreshDelta = '{7C2640AE-B65F-4215-A655-9C1A4950D037}';
|
||||
RID_ListaAnosAlbaranesDelta = '{50AFF5A5-FA78-49E8-A9B5-619AB87C6965}';
|
||||
RID_DarReferenciaDelta = '{5BAE3A56-16AA-4BF1-883D-F7C3BD61177D}';
|
||||
RID_AlbaranesProveedorDelta = '{12351137-EB50-45F3-BC78-6553ED19A50D}';
|
||||
RID_AlbaranesProveedor_DetallesDelta = '{FA3E4A53-4AEF-40BF-9044-7661D2F3FC0D}';
|
||||
RID_AlbaranesProveedor_Detalles_RefreshDelta = '{5831679B-4C77-4189-A6B4-767A14A0EB27}';
|
||||
RID_AlbaranesProveedor_RefreshDelta = '{8D93E3B8-0E2D-41C2-BD26-DA07D07D790E}';
|
||||
|
||||
type
|
||||
{ IListaAnosAlbaranesDelta }
|
||||
IListaAnosAlbaranesDelta = interface(IListaAnosAlbaranes)
|
||||
['{50AFF5A5-FA78-49E8-A9B5-619AB87C6965}']
|
||||
{ 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;
|
||||
|
||||
{ IDarReferenciaDelta }
|
||||
IDarReferenciaDelta = interface(IDarReferencia)
|
||||
['{072ED31D-044E-4E64-9C2F-3A60BADA6E2B}']
|
||||
['{5BAE3A56-16AA-4BF1-883D-F7C3BD61177D}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -47,7 +77,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedorDelta }
|
||||
IAlbaranesProveedorDelta = interface(IAlbaranesProveedor)
|
||||
['{CE83BD2D-ADEA-4A6F-9939-F42C34875F8C}']
|
||||
['{12351137-EB50-45F3-BC78-6553ED19A50D}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -363,7 +393,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor_DetallesDelta }
|
||||
IAlbaranesProveedor_DetallesDelta = interface(IAlbaranesProveedor_Detalles)
|
||||
['{9B5D0070-C7CB-4B34-B97A-8C92AF15B871}']
|
||||
['{FA3E4A53-4AEF-40BF-9044-7661D2F3FC0D}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_ALBARANValue : Integer;
|
||||
@ -490,7 +520,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor_Detalles_RefreshDelta }
|
||||
IAlbaranesProveedor_Detalles_RefreshDelta = interface(IAlbaranesProveedor_Detalles_Refresh)
|
||||
['{1C39A006-A42E-4F9A-B39B-6DCBA89A8E98}']
|
||||
['{5831679B-4C77-4189-A6B4-767A14A0EB27}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_ALBARANValue : Integer;
|
||||
@ -617,7 +647,7 @@ type
|
||||
|
||||
{ IAlbaranesProveedor_RefreshDelta }
|
||||
IAlbaranesProveedor_RefreshDelta = interface(IAlbaranesProveedor_Refresh)
|
||||
['{7C2640AE-B65F-4215-A655-9C1A4950D037}']
|
||||
['{8D93E3B8-0E2D-41C2-BD26-DA07D07D790E}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -936,6 +966,33 @@ implementation
|
||||
uses
|
||||
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;
|
||||
|
||||
|
||||
{ TDarReferenciaBusinessProcessorRules }
|
||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2730,6 +2787,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosAlbaranesDelta, TListaAnosAlbaranesBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_AlbaranesProveedorDelta, TAlbaranesProveedorBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_AlbaranesProveedor_DetallesDelta, TAlbaranesProveedor_DetallesBusinessProcessorRules);
|
||||
|
||||
@ -15,6 +15,35 @@ object srvAlbaranesProveedor: TsrvAlbaranesProveedor
|
||||
ConnectionManager = dmServer.ConnectionManager
|
||||
DataDictionary = DADataDictionary
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_ALBARAN, 1,4)) as ' +
|
||||
'ANO'#10'from albaranes_proveedor'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select' +
|
||||
' distinct '#39'Todos'#39' as ANO'#10'from empresas'
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -2,7 +2,6 @@ inherited fEditorAlbaranesProveedor: TfEditorAlbaranesProveedor
|
||||
Caption = 'Lista de albaranes de proveedor'
|
||||
ClientWidth = 606
|
||||
ExplicitWidth = 614
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
@ -130,12 +129,26 @@ inherited fEditorAlbaranesProveedor: TfEditorAlbaranesProveedor
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 606
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
Visible = True
|
||||
ExplicitWidth = 239
|
||||
ExplicitLeft = 435
|
||||
ExplicitWidth = 171
|
||||
object TBXItem38: TTBXItem
|
||||
Action = actGenerarOrden
|
||||
DisplayMode = nbdmImageAndText
|
||||
|
||||
@ -33,6 +33,7 @@ type
|
||||
procedure actGenerarOrdenExecute(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
protected
|
||||
FAlbaranes: IBizAlbaranProveedor;
|
||||
@ -50,6 +51,7 @@ type
|
||||
procedure DuplicarInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
//Si queremos crear otra vista para el editor heredado solo tendriamos que
|
||||
//sobreescribir este metodo
|
||||
@ -220,6 +222,8 @@ end;
|
||||
|
||||
procedure TfEditorAlbaranesProveedor.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES QUE EL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -315,6 +319,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesProveedor.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(Albaranes, WhereDataTable, Text);
|
||||
if Albaranes.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesProveedor.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -368,17 +379,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesProveedor.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosAlbaranes;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesProveedor.SetController(const Value: IAlbaranesProveedorController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosAlbaranes;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesProveedor.SetAlbaranes(const Value: IBizAlbaranProveedor);
|
||||
begin
|
||||
FAlbaranes := Value;
|
||||
dsDataTable.DataTable := FAlbaranes.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewAlbaranesProveedor).Albaranes := Albaranes;
|
||||
|
||||
if Assigned(FAlbaranes) then
|
||||
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 := FAlbaranes.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FAlbaranes.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewAlbaranesProveedor).Albaranes := Albaranes;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -174,7 +174,7 @@
|
||||
</Delphi.Personality>
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=519
|
||||
EurekaLog Version=6014
|
||||
Activate=0
|
||||
Activate Handle=1
|
||||
Save Log File=1
|
||||
@ -488,5 +488,190 @@ Count mtSend_SuccessMsg=1
|
||||
mtSend_SuccessMsg0="The message was sent successfully."
|
||||
Count mtSend_FailureMsg=1
|
||||
mtSend_FailureMsg0="Sorry, sending the message didn't work."
|
||||
ProxyURL=
|
||||
ProxyUser=
|
||||
ProxyPassword=
|
||||
ProxyPort=8080
|
||||
TrakerUser=
|
||||
TrakerPassword=
|
||||
TrakerAssignTo=
|
||||
TrakerProject=
|
||||
TrakerCategory=
|
||||
TrakerTrialID=
|
||||
ZipPassword=
|
||||
PreBuildEvent=
|
||||
PostSuccessfulBuildEvent=
|
||||
PostFailureBuildEvent=
|
||||
ExceptionDialogType=2
|
||||
loSaveModulesAndProcessesSections=1
|
||||
loSaveAssemblerAndCPUSections=1
|
||||
soAppUpTime=1
|
||||
soExcModuleName=1
|
||||
soExcModuleVersion=1
|
||||
soExcID=1
|
||||
soExcCount=1
|
||||
soExcStatus=1
|
||||
soExcNote=1
|
||||
soUserID=1
|
||||
soUserName=1
|
||||
soUserEmail=1
|
||||
soUserPrivileges=1
|
||||
soUserCompany=1
|
||||
soCmpDisplayDPI=1
|
||||
soCmpVideoCard=1
|
||||
soCmpPrinter=1
|
||||
soOSCharset=1
|
||||
soCustomData=1
|
||||
sndAddComputerNameInFileName=0
|
||||
edoSendErrorReportChecked=1
|
||||
edoShowSendErrorReportOption=1
|
||||
edoShowAttachScreenshotOption=1
|
||||
edoShowCustomButton=0
|
||||
csoDoNotStoreProcNames=0
|
||||
boHandleSafeCallExceptions=1
|
||||
boCallRTLExceptionEvent=0
|
||||
boCatchHandledExceptions=0
|
||||
loCatchLeaks=0
|
||||
loGroupsSonLeaks=1
|
||||
loHideBorlandLeaks=1
|
||||
loFreeAllLeaks=1
|
||||
loCatchLeaksExceptions=1
|
||||
cfoReduceFileSize=1
|
||||
cfoCheckFileCorruption=0
|
||||
Count mtErrorMsgCaption=1
|
||||
mtErrorMsgCaption0="Error."
|
||||
Count mtDialog_ProcessesCaption=1
|
||||
mtDialog_ProcessesCaption0="Processes"
|
||||
Count mtDialog_ProcessesHeader=1
|
||||
mtDialog_ProcessesHeader0="Processes Information"
|
||||
Count mtDialog_AsmCaption=1
|
||||
mtDialog_AsmCaption0="Assembler"
|
||||
Count mtDialog_AsmHeader=1
|
||||
mtDialog_AsmHeader0="Assembler Information"
|
||||
Count mtDialog_CustomButtonCaption=1
|
||||
mtDialog_CustomButtonCaption0="%26Help"
|
||||
Count mtMSDialog_ErrorMsgCaption=1
|
||||
mtMSDialog_ErrorMsgCaption0="The application has encountered a problem. We are sorry for the inconvenience."
|
||||
Count mtMSDialog_RestartCaption=1
|
||||
mtMSDialog_RestartCaption0="Restart application."
|
||||
Count mtMSDialog_TerminateCaption=1
|
||||
mtMSDialog_TerminateCaption0="Terminate application."
|
||||
Count mtMSDialog_PleaseCaption=1
|
||||
mtMSDialog_PleaseCaption0="Please tell us about this problem."
|
||||
Count mtMSDialog_DescriptionCaption=1
|
||||
mtMSDialog_DescriptionCaption0="We have created an error report that you can send to us. We will treat this report as confidential and anonymous."
|
||||
Count mtMSDialog_SeeDetailsCaption=1
|
||||
mtMSDialog_SeeDetailsCaption0="To see what data the error report contains,"
|
||||
Count mtMSDialog_SeeClickCaption=1
|
||||
mtMSDialog_SeeClickCaption0="click here."
|
||||
Count mtMSDialog_HowToReproduceCaption=1
|
||||
mtMSDialog_HowToReproduceCaption0="What were you doing when the problem happened (optional)?"
|
||||
Count mtMSDialog_EmailCaption=1
|
||||
mtMSDialog_EmailCaption0="Email address (optional):"
|
||||
Count mtMSDialog_SendButtonCaption=1
|
||||
mtMSDialog_SendButtonCaption0="%26Send Error Report"
|
||||
Count mtMSDialog_NoSendButtonCaption=1
|
||||
mtMSDialog_NoSendButtonCaption0="%26Don't Send"
|
||||
Count mtLog_AppUpTime=1
|
||||
mtLog_AppUpTime0="Up Time"
|
||||
Count mtLog_ExcModuleName=1
|
||||
mtLog_ExcModuleName0="Module Name"
|
||||
Count mtLog_ExcModuleVersion=1
|
||||
mtLog_ExcModuleVersion0="Module Version"
|
||||
Count mtLog_ExcID=1
|
||||
mtLog_ExcID0="ID"
|
||||
Count mtLog_ExcCount=1
|
||||
mtLog_ExcCount0="Count"
|
||||
Count mtLog_ExcStatus=1
|
||||
mtLog_ExcStatus0="Status"
|
||||
Count mtLog_ExcNote=1
|
||||
mtLog_ExcNote0="Note"
|
||||
Count mtLog_UserHeader=1
|
||||
mtLog_UserHeader0="User"
|
||||
Count mtLog_UserID=1
|
||||
mtLog_UserID0="ID"
|
||||
Count mtLog_UserName=1
|
||||
mtLog_UserName0="Name"
|
||||
Count mtLog_UserEmail=1
|
||||
mtLog_UserEmail0="Email"
|
||||
Count mtLog_UserCompany=1
|
||||
mtLog_UserCompany0="Company"
|
||||
Count mtLog_UserPrivileges=1
|
||||
mtLog_UserPrivileges0="Privileges"
|
||||
Count mtLog_CmpDisplayDPI=1
|
||||
mtLog_CmpDisplayDPI0="Display DPI"
|
||||
Count mtLog_CmpVideoCard=1
|
||||
mtLog_CmpVideoCard0="Video Card"
|
||||
Count mtLog_CmpPrinter=1
|
||||
mtLog_CmpPrinter0="Printer"
|
||||
Count mtLog_OSCharset=1
|
||||
mtLog_OSCharset0="Charset"
|
||||
Count mtCallStack_LeakCaption=1
|
||||
mtCallStack_LeakCaption0="Memory Leak"
|
||||
Count mtCallStack_LeakData=1
|
||||
mtCallStack_LeakData0="Data"
|
||||
Count mtCallStack_LeakType=1
|
||||
mtCallStack_LeakType0="Type"
|
||||
Count mtCallStack_LeakSize=1
|
||||
mtCallStack_LeakSize0="Total size"
|
||||
Count mtCallStack_LeakCount=1
|
||||
mtCallStack_LeakCount0="Count"
|
||||
Count mtSendDialog_Login=1
|
||||
mtSendDialog_Login0="Login..."
|
||||
Count mtSendDialog_Sent=1
|
||||
mtSendDialog_Sent0="Message sent."
|
||||
Count mtSendDialog_SelectProject=1
|
||||
mtSendDialog_SelectProject0="Select project..."
|
||||
Count mtSendDialog_Searching=1
|
||||
mtSendDialog_Searching0="Searching..."
|
||||
Count mtSendDialog_Modifying=1
|
||||
mtSendDialog_Modifying0="Modifying..."
|
||||
Count mtSendDialog_Disconnecting=1
|
||||
mtSendDialog_Disconnecting0="Disconnecting..."
|
||||
Count mtSendDialog_Disconnected=1
|
||||
mtSendDialog_Disconnected0="Disconnected."
|
||||
Count mtProcesses_ID=1
|
||||
mtProcesses_ID0="ID"
|
||||
Count mtProcesses_Name=1
|
||||
mtProcesses_Name0="Name"
|
||||
Count mtProcesses_Description=1
|
||||
mtProcesses_Description0="Description"
|
||||
Count mtProcesses_Version=1
|
||||
mtProcesses_Version0="Version"
|
||||
Count mtProcesses_Memory=1
|
||||
mtProcesses_Memory0="Memory"
|
||||
Count mtProcesses_Priority=1
|
||||
mtProcesses_Priority0="Priority"
|
||||
Count mtProcesses_Threads=1
|
||||
mtProcesses_Threads0="Threads"
|
||||
Count mtProcesses_Path=1
|
||||
mtProcesses_Path0="Path"
|
||||
Count mtSend_BugClosedMsg=2
|
||||
mtSend_BugClosedMsg0="These BUG is just closed."
|
||||
mtSend_BugClosedMsg1="Contact the program support to obtain an update."
|
||||
Count mtSend_UnknownErrorMsg=1
|
||||
mtSend_UnknownErrorMsg0="Unknown error."
|
||||
Count mtSend_InvalidLoginMsg=1
|
||||
mtSend_InvalidLoginMsg0="Invalid login request."
|
||||
Count mtSend_InvalidSearchMsg=1
|
||||
mtSend_InvalidSearchMsg0="Invalid search request."
|
||||
Count mtSend_InvalidSelectionMsg=1
|
||||
mtSend_InvalidSelectionMsg0="Invalid selection request."
|
||||
Count mtSend_InvalidInsertMsg=1
|
||||
mtSend_InvalidInsertMsg0="Invalid insert request."
|
||||
Count mtSend_InvalidModifyMsg=1
|
||||
mtSend_InvalidModifyMsg0="Invalid modify request."
|
||||
Count mtFileCrackedMsg=2
|
||||
mtFileCrackedMsg0="This file is cracked."
|
||||
mtFileCrackedMsg1="The application will be closed."
|
||||
Count mtException_LeakMultiFree=1
|
||||
mtException_LeakMultiFree0="Multi Free memory leak."
|
||||
Count mtException_LeakMemoryOverrun=1
|
||||
mtException_LeakMemoryOverrun0="Memory Overrun leak."
|
||||
Count mtException_AntiFreeze=1
|
||||
mtException_AntiFreeze0="The application seems to be frozen."
|
||||
Count mtInvalidEmailMsg=1
|
||||
mtInvalidEmailMsg0="Invalid email."
|
||||
TextsCollection=English
|
||||
EurekaLog Last Line -->
|
||||
</BorlandProject>
|
||||
|
||||
@ -55,6 +55,9 @@ type
|
||||
|
||||
function ElegirFacturas(AFacturas : IBizFacturaCliente; AMensaje: String; AMultiSelect: Boolean): IBizFacturaCliente;
|
||||
function ExtraerSeleccionados(ARecibosCliente: IBizFacturaCliente; const ViewGrid: IViewGridBase = Nil) : IBizFacturaCliente;
|
||||
|
||||
function DarListaAnosFacturas: TStringList;
|
||||
procedure FiltrarAno(AFactura: IBizFacturaCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TFacturasClienteController = class(TObservador, IFacturasClienteController)
|
||||
@ -123,6 +126,9 @@ type
|
||||
|
||||
function ElegirFacturas(AFacturas : IBizFacturaCliente; AMensaje: String; AMultiSelect: Boolean): IBizFacturaCliente;
|
||||
function ExtraerSeleccionados(AFacturasCliente: IBizFacturaCliente; Const ViewGrid: IViewGridBase = Nil) : IBizFacturaCliente;
|
||||
|
||||
function DarListaAnosFacturas: TStringList;
|
||||
procedure FiltrarAno(AFactura: IBizFacturaCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -549,6 +555,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TFacturasClienteController.DarListaAnosFacturas: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TFacturasClienteController.DescartarCambios(AFactura: IBizFacturaCliente);
|
||||
begin
|
||||
if not Assigned(AFactura) then
|
||||
@ -1028,6 +1039,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFacturasClienteController.FiltrarAno(AFactura: IBizFacturaCliente; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
AFactura.DataTable.Where.Clear;
|
||||
AFactura.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with AFactura.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_FacturasClienteFECHA_FACTURA, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_FacturasClienteFECHA_FACTURA, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFacturasClienteController.FiltrarEmpresa(AFactura: IBizFacturaCliente);
|
||||
begin
|
||||
if AFactura.DataTable.Active then
|
||||
|
||||
@ -919,4 +919,113 @@ object DataModuleFacturasCliente: TDataModuleFacturasCliente
|
||||
Left = 48
|
||||
Top = 324
|
||||
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 = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosFacturas'
|
||||
IndexDefs = <>
|
||||
Left = 208
|
||||
Top = 232
|
||||
end
|
||||
object ds_ListaAnosFacturas: TDADataSource
|
||||
DataTable = tbl_ListaAnosFacturas
|
||||
Left = 208
|
||||
Top = 176
|
||||
end
|
||||
end
|
||||
|
||||
@ -22,11 +22,14 @@ type
|
||||
LoginRemoteService: TRORemoteService;
|
||||
ROWinInetHTTPChannel1: TROWinInetHTTPChannel;
|
||||
ROBinMessage1: TROBinMessage;
|
||||
tbl_ListaAnosFacturas: TDACDSDataTable;
|
||||
ds_ListaAnosFacturas: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
private
|
||||
function _CloneDataTable (const ADataTable : TDACDSDataTable): TDACDSDataTable; overload;
|
||||
function _GetDetalles : IBizDetallesFacturaCliente;
|
||||
public
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems : IBizFacturaCliente;
|
||||
function GetItem(const ID : Integer) : IBizFacturaCliente;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
@ -130,6 +133,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleFacturasCliente.GetAnosItems: 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;
|
||||
|
||||
function TDataModuleFacturasCliente.GetItem(const ID: Integer): IBizFacturaCliente;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
</PersonalityInfo>
|
||||
<Default.Personality>
|
||||
|
||||
|
||||
|
||||
<Projects>
|
||||
<Projects Name="Base.bpl">..\..\Base\Base.bdsproj</Projects>
|
||||
<Projects Name="ControllerBase.bpl">..\..\Base\ControllerBase\ControllerBase.bdsproj</Projects>
|
||||
@ -33,7 +35,14 @@
|
||||
<Projects Name="FacturasProveedor_view.bpl">..\Facturas de proveedor\Views\FacturasProveedor_view.bdsproj</Projects>
|
||||
<Projects Name="PedidosCliente_view.bpl">..\Pedidos de cliente\Views\PedidosCliente_view.bdsproj</Projects>
|
||||
<Projects Name="PedidosCliente_controller.bpl">..\Pedidos de cliente\Controller\PedidosCliente_controller.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl Articulos_view.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl AlbCli_FacCli_relation.bpl FacturasCliente_view.bpl FactuGES.exe FactuGES_Server.exe AlbaranesCliente_controller.bpl FacturasProveedor_view.bpl PedidosCliente_view.bpl PedidosCliente_controller.bpl</Projects>
|
||||
<Projects Name="AlbaranesCliente_view.bpl">..\Albaranes de cliente\Views\AlbaranesCliente_view.bdsproj</Projects>
|
||||
<Projects Name="AlbaranesProveedor_view.bpl">..\Albaranes de proveedor\Views\AlbaranesProveedor_view.bdsproj</Projects>
|
||||
<Projects Name="PedidosProveedor_view.bpl">..\Pedidos a proveedor\Views\PedidosProveedor_view.bdsproj</Projects>
|
||||
<Projects Name="RecibosCliente_view.bpl">..\Recibos de cliente\Views\RecibosCliente_view.bdsproj</Projects>
|
||||
<Projects Name="RecibosProveedor_view.bpl">..\Recibos de proveedor\Views\RecibosProveedor_view.bdsproj</Projects>
|
||||
<Projects Name="RemesasCliente_view.bpl">..\Remesas de cliente\Views\RemesasCliente_view.bdsproj</Projects>
|
||||
<Projects Name="RemesasProveedor_view.bpl">..\Remesas de proveedor\Views\RemesasProveedor_view.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl Articulos_view.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl AlbCli_FacCli_relation.bpl FacturasCliente_view.bpl FactuGES.exe FactuGES_Server.exe AlbaranesCliente_controller.bpl FacturasProveedor_view.bpl PedidosCliente_view.bpl PedidosCliente_controller.bpl AlbaranesCliente_view.bpl AlbaranesProveedor_view.bpl PedidosProveedor_view.bpl RecibosCliente_view.bpl RecibosProveedor_view.bpl RemesasCliente_view.bpl RemesasProveedor_view.bpl</Projects>
|
||||
</Projects>
|
||||
<Dependencies/>
|
||||
</Default.Personality>
|
||||
|
||||
@ -9,6 +9,7 @@ uses
|
||||
type
|
||||
IDataModuleFacturasCliente = interface
|
||||
['{B0BDC388-E831-4946-B736-E817E3EA4B7C}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizFacturaCliente;
|
||||
function GetItem(const ID : Integer) : IBizFacturaCliente;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,14 +9,16 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferencia = '{F07C0630-2482-4183-B171-5F9A8689D08B}';
|
||||
RID_FacturasCliente = '{6DFFB254-B69F-4A64-A33F-92E0568329FD}';
|
||||
RID_FacturasCliente_Detalles = '{9EB4A221-1FE5-4D7F-8A74-0331667B2F11}';
|
||||
RID_FacturasCliente_Detalles_Refresh = '{28FE35F0-46C2-493C-B30C-DFBE5B2DB181}';
|
||||
RID_FacturasCliente_Refresh = '{B30DD588-2914-4443-BBD5-50D4F138F95F}';
|
||||
RID_DarReferencia = '{A621C326-E4EC-467B-ADBC-3405D36E60EE}';
|
||||
RID_ListaAnosFacturas = '{4BE1F671-5EAA-439D-AFB9-0AD7989ADF34}';
|
||||
RID_FacturasCliente = '{428E1B81-D8A3-4C5E-B021-5E4BF418E6B7}';
|
||||
RID_FacturasCliente_Detalles = '{8FB6D423-E42F-4A10-8C35-736C711FFA32}';
|
||||
RID_FacturasCliente_Detalles_Refresh = '{3618523F-C786-4185-A189-80867AA103C0}';
|
||||
RID_FacturasCliente_Refresh = '{3DCA7D8A-2508-4E3A-BE11-B6E06C9EA8B6}';
|
||||
|
||||
{ Data table names }
|
||||
nme_DarReferencia = 'DarReferencia';
|
||||
nme_ListaAnosFacturas = 'ListaAnosFacturas';
|
||||
nme_FacturasCliente = 'FacturasCliente';
|
||||
nme_FacturasCliente_Detalles = 'FacturasCliente_Detalles';
|
||||
nme_FacturasCliente_Detalles_Refresh = 'FacturasCliente_Detalles_Refresh';
|
||||
@ -28,6 +30,12 @@ const
|
||||
{ DarReferencia field indexes }
|
||||
idx_DarReferenciaVALOR = 0;
|
||||
|
||||
{ ListaAnosFacturas fields }
|
||||
fld_ListaAnosFacturasANO = 'ANO';
|
||||
|
||||
{ ListaAnosFacturas field indexes }
|
||||
idx_ListaAnosFacturasANO = 0;
|
||||
|
||||
{ FacturasCliente fields }
|
||||
fld_FacturasClienteID = 'ID';
|
||||
fld_FacturasClienteID_EMPRESA = 'ID_EMPRESA';
|
||||
@ -247,7 +255,7 @@ const
|
||||
type
|
||||
{ IDarReferencia }
|
||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{9DABABE4-9529-4D46-8390-02D72879F053}']
|
||||
['{DC6A031B-D148-478D-9BCA-101202CCC948}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -274,9 +282,38 @@ type
|
||||
|
||||
end;
|
||||
|
||||
{ IListaAnosFacturas }
|
||||
IListaAnosFacturas = interface(IDAStronglyTypedDataTable)
|
||||
['{FF89EDF2-3698-477F-B6DE-83A3FE03F68E}']
|
||||
{ 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;
|
||||
|
||||
{ IFacturasCliente }
|
||||
IFacturasCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{A4A64CE1-E0C3-42E1-9FE3-3CCFC56E8149}']
|
||||
['{AACD7C2D-E96C-430C-A07F-12AF77A42630}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -515,7 +552,7 @@ type
|
||||
|
||||
{ IFacturasCliente_Detalles }
|
||||
IFacturasCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{48DB542A-94AF-49A6-9B13-E3FB282FAB21}']
|
||||
['{B6A306E7-6C2F-46BC-A313-C6F68ED5C577}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -622,7 +659,7 @@ type
|
||||
|
||||
{ IFacturasCliente_Detalles_Refresh }
|
||||
IFacturasCliente_Detalles_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{1ED3E85F-9BE1-4DBC-A810-895CB87EFF7B}']
|
||||
['{6C0D8072-B0E3-4774-A560-8336A4DFBF60}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -729,7 +766,7 @@ type
|
||||
|
||||
{ IFacturasCliente_Refresh }
|
||||
IFacturasCliente_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{4774EBB6-EE6F-4091-982C-0BE9F6733DF7}']
|
||||
['{C8BA494B-931B-4C73-8E06-1F3846B17070}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -992,6 +1029,28 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
{ TFacturasClienteDataTableRules }
|
||||
constructor TFacturasClienteDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -2044,6 +2103,7 @@ end;
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_ListaAnosFacturas, TListaAnosFacturasDataTableRules);
|
||||
RegisterDataTableRules(RID_FacturasCliente, TFacturasClienteDataTableRules);
|
||||
RegisterDataTableRules(RID_FacturasCliente_Detalles, TFacturasCliente_DetallesDataTableRules);
|
||||
RegisterDataTableRules(RID_FacturasCliente_Detalles_Refresh, TFacturasCliente_Detalles_RefreshDataTableRules);
|
||||
|
||||
@ -9,16 +9,17 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferenciaDelta = '{A361CA72-14B0-4A2F-8D48-594E3B6757B5}';
|
||||
RID_FacturasClienteDelta = '{9D0AFD95-68E6-4552-A9E1-0BD9CDCF5EF5}';
|
||||
RID_FacturasCliente_DetallesDelta = '{B9A181BB-83C6-4C37-8D94-8870ECFA5672}';
|
||||
RID_FacturasCliente_Detalles_RefreshDelta = '{D18A6A64-A4BC-49E2-9F4C-7EB197491CAF}';
|
||||
RID_FacturasCliente_RefreshDelta = '{1929E045-A3F6-43D9-ACCD-B31FA5847473}';
|
||||
RID_DarReferenciaDelta = '{DCB4C31D-2825-4AED-A0D5-085D371E73FF}';
|
||||
RID_ListaAnosFacturasDelta = '{BE0BAF1D-C955-44C4-872C-6DD555772691}';
|
||||
RID_FacturasClienteDelta = '{91BB9203-1A6A-4FC1-AD02-41A181969867}';
|
||||
RID_FacturasCliente_DetallesDelta = '{7DCB2097-1E44-42CC-BA9E-9CF8645A18E3}';
|
||||
RID_FacturasCliente_Detalles_RefreshDelta = '{4C1BB5AD-9C14-47AC-8CB9-B298E9CBC9E4}';
|
||||
RID_FacturasCliente_RefreshDelta = '{94A51D8A-EC34-4716-8531-4CC62F89C1CD}';
|
||||
|
||||
type
|
||||
{ IDarReferenciaDelta }
|
||||
IDarReferenciaDelta = interface(IDarReferencia)
|
||||
['{A361CA72-14B0-4A2F-8D48-594E3B6757B5}']
|
||||
['{DCB4C31D-2825-4AED-A0D5-085D371E73FF}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -45,9 +46,38 @@ type
|
||||
|
||||
end;
|
||||
|
||||
{ IListaAnosFacturasDelta }
|
||||
IListaAnosFacturasDelta = interface(IListaAnosFacturas)
|
||||
['{BE0BAF1D-C955-44C4-872C-6DD555772691}']
|
||||
{ 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;
|
||||
|
||||
{ IFacturasClienteDelta }
|
||||
IFacturasClienteDelta = interface(IFacturasCliente)
|
||||
['{9D0AFD95-68E6-4552-A9E1-0BD9CDCF5EF5}']
|
||||
['{91BB9203-1A6A-4FC1-AD02-41A181969867}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -321,7 +351,7 @@ type
|
||||
|
||||
{ IFacturasCliente_DetallesDelta }
|
||||
IFacturasCliente_DetallesDelta = interface(IFacturasCliente_Detalles)
|
||||
['{B9A181BB-83C6-4C37-8D94-8870ECFA5672}']
|
||||
['{7DCB2097-1E44-42CC-BA9E-9CF8645A18E3}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_FACTURAValue : Integer;
|
||||
@ -441,7 +471,7 @@ type
|
||||
|
||||
{ IFacturasCliente_Detalles_RefreshDelta }
|
||||
IFacturasCliente_Detalles_RefreshDelta = interface(IFacturasCliente_Detalles_Refresh)
|
||||
['{D18A6A64-A4BC-49E2-9F4C-7EB197491CAF}']
|
||||
['{4C1BB5AD-9C14-47AC-8CB9-B298E9CBC9E4}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_FACTURAValue : Integer;
|
||||
@ -561,7 +591,7 @@ type
|
||||
|
||||
{ IFacturasCliente_RefreshDelta }
|
||||
IFacturasCliente_RefreshDelta = interface(IFacturasCliente_Refresh)
|
||||
['{1929E045-A3F6-43D9-ACCD-B31FA5847473}']
|
||||
['{94A51D8A-EC34-4716-8531-4CC62F89C1CD}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -865,6 +895,33 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
{ TFacturasClienteBusinessProcessorRules }
|
||||
constructor TFacturasClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2419,6 +2476,7 @@ end;
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosFacturasDelta, TListaAnosFacturasBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_FacturasClienteDelta, TFacturasClienteBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_FacturasCliente_DetallesDelta, TFacturasCliente_DetallesBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_FacturasCliente_Detalles_RefreshDelta, TFacturasCliente_Detalles_RefreshBusinessProcessorRules);
|
||||
|
||||
@ -63,6 +63,39 @@ object srvFacturasCliente: TsrvFacturasCliente
|
||||
BusinessRulesClient.ScriptLanguage = rslPascalScript
|
||||
BusinessRulesServer.ScriptLanguage = rslPascalScript
|
||||
end
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_FACTURA, 1,4)) as ' +
|
||||
'ANO'#10'from facturas_cliente'#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
|
||||
Params = <>
|
||||
Statements = <
|
||||
|
||||
@ -172,9 +172,9 @@
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
</Delphi.Personality>
|
||||
<!-- EurekaLog First Line
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=519
|
||||
EurekaLog Version=6014
|
||||
Activate=1
|
||||
Activate Handle=1
|
||||
Save Log File=1
|
||||
@ -488,5 +488,190 @@ Count mtSend_SuccessMsg=1
|
||||
mtSend_SuccessMsg0="The message was sent successfully."
|
||||
Count mtSend_FailureMsg=1
|
||||
mtSend_FailureMsg0="Sorry, sending the message didn't work."
|
||||
ProxyURL=
|
||||
ProxyUser=
|
||||
ProxyPassword=
|
||||
ProxyPort=8080
|
||||
TrakerUser=
|
||||
TrakerPassword=
|
||||
TrakerAssignTo=
|
||||
TrakerProject=
|
||||
TrakerCategory=
|
||||
TrakerTrialID=
|
||||
ZipPassword=
|
||||
PreBuildEvent=
|
||||
PostSuccessfulBuildEvent=
|
||||
PostFailureBuildEvent=
|
||||
ExceptionDialogType=2
|
||||
loSaveModulesAndProcessesSections=1
|
||||
loSaveAssemblerAndCPUSections=1
|
||||
soAppUpTime=1
|
||||
soExcModuleName=1
|
||||
soExcModuleVersion=1
|
||||
soExcID=1
|
||||
soExcCount=1
|
||||
soExcStatus=1
|
||||
soExcNote=1
|
||||
soUserID=1
|
||||
soUserName=1
|
||||
soUserEmail=1
|
||||
soUserPrivileges=1
|
||||
soUserCompany=1
|
||||
soCmpDisplayDPI=1
|
||||
soCmpVideoCard=1
|
||||
soCmpPrinter=1
|
||||
soOSCharset=1
|
||||
soCustomData=1
|
||||
sndAddComputerNameInFileName=0
|
||||
edoSendErrorReportChecked=1
|
||||
edoShowSendErrorReportOption=1
|
||||
edoShowAttachScreenshotOption=1
|
||||
edoShowCustomButton=0
|
||||
csoDoNotStoreProcNames=0
|
||||
boHandleSafeCallExceptions=1
|
||||
boCallRTLExceptionEvent=0
|
||||
boCatchHandledExceptions=0
|
||||
loCatchLeaks=0
|
||||
loGroupsSonLeaks=1
|
||||
loHideBorlandLeaks=1
|
||||
loFreeAllLeaks=1
|
||||
loCatchLeaksExceptions=1
|
||||
cfoReduceFileSize=1
|
||||
cfoCheckFileCorruption=0
|
||||
Count mtErrorMsgCaption=1
|
||||
mtErrorMsgCaption0="Error."
|
||||
Count mtDialog_ProcessesCaption=1
|
||||
mtDialog_ProcessesCaption0="Processes"
|
||||
Count mtDialog_ProcessesHeader=1
|
||||
mtDialog_ProcessesHeader0="Processes Information"
|
||||
Count mtDialog_AsmCaption=1
|
||||
mtDialog_AsmCaption0="Assembler"
|
||||
Count mtDialog_AsmHeader=1
|
||||
mtDialog_AsmHeader0="Assembler Information"
|
||||
Count mtDialog_CustomButtonCaption=1
|
||||
mtDialog_CustomButtonCaption0="%26Help"
|
||||
Count mtMSDialog_ErrorMsgCaption=1
|
||||
mtMSDialog_ErrorMsgCaption0="The application has encountered a problem. We are sorry for the inconvenience."
|
||||
Count mtMSDialog_RestartCaption=1
|
||||
mtMSDialog_RestartCaption0="Restart application."
|
||||
Count mtMSDialog_TerminateCaption=1
|
||||
mtMSDialog_TerminateCaption0="Terminate application."
|
||||
Count mtMSDialog_PleaseCaption=1
|
||||
mtMSDialog_PleaseCaption0="Please tell us about this problem."
|
||||
Count mtMSDialog_DescriptionCaption=1
|
||||
mtMSDialog_DescriptionCaption0="We have created an error report that you can send to us. We will treat this report as confidential and anonymous."
|
||||
Count mtMSDialog_SeeDetailsCaption=1
|
||||
mtMSDialog_SeeDetailsCaption0="To see what data the error report contains,"
|
||||
Count mtMSDialog_SeeClickCaption=1
|
||||
mtMSDialog_SeeClickCaption0="click here."
|
||||
Count mtMSDialog_HowToReproduceCaption=1
|
||||
mtMSDialog_HowToReproduceCaption0="What were you doing when the problem happened (optional)?"
|
||||
Count mtMSDialog_EmailCaption=1
|
||||
mtMSDialog_EmailCaption0="Email address (optional):"
|
||||
Count mtMSDialog_SendButtonCaption=1
|
||||
mtMSDialog_SendButtonCaption0="%26Send Error Report"
|
||||
Count mtMSDialog_NoSendButtonCaption=1
|
||||
mtMSDialog_NoSendButtonCaption0="%26Don't Send"
|
||||
Count mtLog_AppUpTime=1
|
||||
mtLog_AppUpTime0="Up Time"
|
||||
Count mtLog_ExcModuleName=1
|
||||
mtLog_ExcModuleName0="Module Name"
|
||||
Count mtLog_ExcModuleVersion=1
|
||||
mtLog_ExcModuleVersion0="Module Version"
|
||||
Count mtLog_ExcID=1
|
||||
mtLog_ExcID0="ID"
|
||||
Count mtLog_ExcCount=1
|
||||
mtLog_ExcCount0="Count"
|
||||
Count mtLog_ExcStatus=1
|
||||
mtLog_ExcStatus0="Status"
|
||||
Count mtLog_ExcNote=1
|
||||
mtLog_ExcNote0="Note"
|
||||
Count mtLog_UserHeader=1
|
||||
mtLog_UserHeader0="User"
|
||||
Count mtLog_UserID=1
|
||||
mtLog_UserID0="ID"
|
||||
Count mtLog_UserName=1
|
||||
mtLog_UserName0="Name"
|
||||
Count mtLog_UserEmail=1
|
||||
mtLog_UserEmail0="Email"
|
||||
Count mtLog_UserCompany=1
|
||||
mtLog_UserCompany0="Company"
|
||||
Count mtLog_UserPrivileges=1
|
||||
mtLog_UserPrivileges0="Privileges"
|
||||
Count mtLog_CmpDisplayDPI=1
|
||||
mtLog_CmpDisplayDPI0="Display DPI"
|
||||
Count mtLog_CmpVideoCard=1
|
||||
mtLog_CmpVideoCard0="Video Card"
|
||||
Count mtLog_CmpPrinter=1
|
||||
mtLog_CmpPrinter0="Printer"
|
||||
Count mtLog_OSCharset=1
|
||||
mtLog_OSCharset0="Charset"
|
||||
Count mtCallStack_LeakCaption=1
|
||||
mtCallStack_LeakCaption0="Memory Leak"
|
||||
Count mtCallStack_LeakData=1
|
||||
mtCallStack_LeakData0="Data"
|
||||
Count mtCallStack_LeakType=1
|
||||
mtCallStack_LeakType0="Type"
|
||||
Count mtCallStack_LeakSize=1
|
||||
mtCallStack_LeakSize0="Total size"
|
||||
Count mtCallStack_LeakCount=1
|
||||
mtCallStack_LeakCount0="Count"
|
||||
Count mtSendDialog_Login=1
|
||||
mtSendDialog_Login0="Login..."
|
||||
Count mtSendDialog_Sent=1
|
||||
mtSendDialog_Sent0="Message sent."
|
||||
Count mtSendDialog_SelectProject=1
|
||||
mtSendDialog_SelectProject0="Select project..."
|
||||
Count mtSendDialog_Searching=1
|
||||
mtSendDialog_Searching0="Searching..."
|
||||
Count mtSendDialog_Modifying=1
|
||||
mtSendDialog_Modifying0="Modifying..."
|
||||
Count mtSendDialog_Disconnecting=1
|
||||
mtSendDialog_Disconnecting0="Disconnecting..."
|
||||
Count mtSendDialog_Disconnected=1
|
||||
mtSendDialog_Disconnected0="Disconnected."
|
||||
Count mtProcesses_ID=1
|
||||
mtProcesses_ID0="ID"
|
||||
Count mtProcesses_Name=1
|
||||
mtProcesses_Name0="Name"
|
||||
Count mtProcesses_Description=1
|
||||
mtProcesses_Description0="Description"
|
||||
Count mtProcesses_Version=1
|
||||
mtProcesses_Version0="Version"
|
||||
Count mtProcesses_Memory=1
|
||||
mtProcesses_Memory0="Memory"
|
||||
Count mtProcesses_Priority=1
|
||||
mtProcesses_Priority0="Priority"
|
||||
Count mtProcesses_Threads=1
|
||||
mtProcesses_Threads0="Threads"
|
||||
Count mtProcesses_Path=1
|
||||
mtProcesses_Path0="Path"
|
||||
Count mtSend_BugClosedMsg=2
|
||||
mtSend_BugClosedMsg0="These BUG is just closed."
|
||||
mtSend_BugClosedMsg1="Contact the program support to obtain an update."
|
||||
Count mtSend_UnknownErrorMsg=1
|
||||
mtSend_UnknownErrorMsg0="Unknown error."
|
||||
Count mtSend_InvalidLoginMsg=1
|
||||
mtSend_InvalidLoginMsg0="Invalid login request."
|
||||
Count mtSend_InvalidSearchMsg=1
|
||||
mtSend_InvalidSearchMsg0="Invalid search request."
|
||||
Count mtSend_InvalidSelectionMsg=1
|
||||
mtSend_InvalidSelectionMsg0="Invalid selection request."
|
||||
Count mtSend_InvalidInsertMsg=1
|
||||
mtSend_InvalidInsertMsg0="Invalid insert request."
|
||||
Count mtSend_InvalidModifyMsg=1
|
||||
mtSend_InvalidModifyMsg0="Invalid modify request."
|
||||
Count mtFileCrackedMsg=2
|
||||
mtFileCrackedMsg0="This file is cracked."
|
||||
mtFileCrackedMsg1="The application will be closed."
|
||||
Count mtException_LeakMultiFree=1
|
||||
mtException_LeakMultiFree0="Multi Free memory leak."
|
||||
Count mtException_LeakMemoryOverrun=1
|
||||
mtException_LeakMemoryOverrun0="Memory Overrun leak."
|
||||
Count mtException_AntiFreeze=1
|
||||
mtException_AntiFreeze0="The application seems to be frozen."
|
||||
Count mtInvalidEmailMsg=1
|
||||
mtInvalidEmailMsg0="Invalid email."
|
||||
TextsCollection=English
|
||||
EurekaLog Last Line -->
|
||||
</BorlandProject>
|
||||
|
||||
@ -60,6 +60,18 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 640
|
||||
object TBXSubmenuItem3: TTBXSubmenuItem [4]
|
||||
@ -69,6 +81,10 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
ExplicitLeft = 435
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
Top = 556
|
||||
|
||||
@ -41,13 +41,14 @@ type
|
||||
procedure actNuevoAbonoExecute(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
private
|
||||
FFacturas: IBizFacturaCliente;
|
||||
FController : IFacturasClienteController;
|
||||
|
||||
protected
|
||||
function GetFacturas: IBizFacturaCliente;
|
||||
procedure SetFacturas(const Value: IBizFacturaCliente);
|
||||
|
||||
function GetController : IFacturasClienteController; virtual;
|
||||
procedure SetController (const Value : IFacturasClienteController); virtual;
|
||||
procedure NuevoInterno; override;
|
||||
@ -56,10 +57,12 @@ type
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
public
|
||||
procedure PonerTitulos(const ATitulo: string = ''); override;
|
||||
property Facturas: IBizFacturaCliente read GetFacturas write SetFacturas;
|
||||
property Controller : IFacturasClienteController read GetController write SetController;
|
||||
procedure PonerTitulos(const ATitulo: string = ''); override;
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
@ -155,6 +158,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasCliente.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(Facturas, WhereDataTable, Text);
|
||||
if Facturas.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
constructor TfEditorFacturasCliente.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
@ -237,6 +247,8 @@ end;
|
||||
|
||||
procedure TfEditorFacturasCliente.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange;
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -401,17 +413,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasCliente.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosFacturas;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasCliente.SetController(const Value: IFacturasClienteController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosFacturas;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasCliente.SetFacturas(const Value: IBizFacturaCliente);
|
||||
begin
|
||||
FFacturas := Value;
|
||||
dsDataTable.DataTable := FFacturas.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewFacturasCliente).Facturas := Facturas;
|
||||
|
||||
if Assigned(FFacturas) then
|
||||
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 := FFacturas.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FFacturas.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewFacturasCliente).Facturas := Facturas;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -54,6 +54,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosFacturas: TStringList;
|
||||
procedure FiltrarAno(AFactura: IBizFacturaProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TFacturasProveedorController = class(TObservador, IFacturasProveedorController)
|
||||
@ -123,6 +126,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosFacturas: TStringList;
|
||||
procedure FiltrarAno(AFactura: IBizFacturaProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -554,6 +560,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TFacturasProveedorController.DarListaAnosFacturas: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorController.DescartarCambios(AFactura: IBizFacturaProveedor);
|
||||
begin
|
||||
if not Assigned(AFactura) then
|
||||
@ -1029,6 +1040,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorController.FiltrarAno(AFactura: IBizFacturaProveedor; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
AFactura.DataTable.Where.Clear;
|
||||
AFactura.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with AFactura.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_FacturasProveedorFECHA_FACTURA, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_FacturasProveedorFECHA_FACTURA, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorController.FiltrarEmpresa(AFactura: IBizFacturaProveedor);
|
||||
begin
|
||||
if AFactura.DataTable.Active then
|
||||
|
||||
@ -901,4 +901,113 @@ object DataModuleFacturasProveedor: TDataModuleFacturasProveedor
|
||||
Left = 400
|
||||
Top = 104
|
||||
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 = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosFacturas'
|
||||
IndexDefs = <>
|
||||
Left = 320
|
||||
Top = 272
|
||||
end
|
||||
object ds_ListaAnosFacturas: TDADataSource
|
||||
DataTable = tbl_ListaAnosFacturas
|
||||
Left = 320
|
||||
Top = 216
|
||||
end
|
||||
end
|
||||
|
||||
@ -22,6 +22,8 @@ type
|
||||
ds_FacturasProveedor: TDADataSource;
|
||||
tbl_FacturasProveedor_Detalles: TDACDSDataTable;
|
||||
ds_FacturasProveedor_Detalles: TDADataSource;
|
||||
tbl_ListaAnosFacturas: TDACDSDataTable;
|
||||
ds_ListaAnosFacturas: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
private
|
||||
function _CloneDataTable (const ADataTable : TDACDSDataTable): TDACDSDataTable; overload;
|
||||
@ -36,6 +38,7 @@ type
|
||||
function GetReport(const AFacturaID: String): Binary;
|
||||
function GetRptPDFFacturas(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -121,6 +124,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleFacturasProveedor.GetAnosItems: 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;
|
||||
|
||||
function TDataModuleFacturasProveedor.GetItem(const ID: Integer): IBizFacturaProveedor;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -9,6 +9,7 @@ uses
|
||||
type
|
||||
IDataModuleFacturasProveedor = interface
|
||||
['{FD0F5B2F-5556-4031-86F0-EFF96805FD66}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizFacturaProveedor;
|
||||
function GetItem(const ID : Integer) : IBizFacturaProveedor;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,19 +9,27 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_darReferencia = '{3702A8D4-542B-4B43-9C44-D838C5B94D06}';
|
||||
RID_FacturasProveedor = '{DF304139-ED00-47CD-82B3-2FB5BC641650}';
|
||||
RID_FacturasProveedor_Detalles = '{74A5AB9E-6DA2-4517-B5BB-20F9FF441D4A}';
|
||||
RID_FacturasProveedor_Detalles_Refresh = '{8C687B77-B589-4613-9908-935FB59DA5FB}';
|
||||
RID_FacturasProveedor_Refresh = '{81F6B50C-EF92-49C7-8207-D3BD0156CCAE}';
|
||||
RID_ListaAnosFacturas = '{70EAC624-449A-4C2D-A171-02AFF36ABAD3}';
|
||||
RID_darReferencia = '{0274F164-968D-45A1-85A1-759FEDE0316D}';
|
||||
RID_FacturasProveedor = '{A120C0B7-5F66-4256-8D73-08D1720667DF}';
|
||||
RID_FacturasProveedor_Detalles = '{4DA06E3C-AE72-4BCF-A4BE-52778C461BCE}';
|
||||
RID_FacturasProveedor_Detalles_Refresh = '{A446C1C0-E31A-4D15-BB72-825834D5A48C}';
|
||||
RID_FacturasProveedor_Refresh = '{1EC31E89-5AEF-4057-BFCB-4719F6F17A56}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosFacturas = 'ListaAnosFacturas';
|
||||
nme_darReferencia = 'darReferencia';
|
||||
nme_FacturasProveedor = 'FacturasProveedor';
|
||||
nme_FacturasProveedor_Detalles = 'FacturasProveedor_Detalles';
|
||||
nme_FacturasProveedor_Detalles_Refresh = 'FacturasProveedor_Detalles_Refresh';
|
||||
nme_FacturasProveedor_Refresh = 'FacturasProveedor_Refresh';
|
||||
|
||||
{ ListaAnosFacturas fields }
|
||||
fld_ListaAnosFacturasANO = 'ANO';
|
||||
|
||||
{ ListaAnosFacturas field indexes }
|
||||
idx_ListaAnosFacturasANO = 0;
|
||||
|
||||
{ darReferencia fields }
|
||||
fld_darReferenciaVALOR = 'VALOR';
|
||||
|
||||
@ -237,9 +245,38 @@ const
|
||||
idx_FacturasProveedor_RefreshFECHA_VENCIMIENTO = 33;
|
||||
|
||||
type
|
||||
{ IListaAnosFacturas }
|
||||
IListaAnosFacturas = interface(IDAStronglyTypedDataTable)
|
||||
['{8C8C7921-105D-4816-B414-3A838B66BDED}']
|
||||
{ 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;
|
||||
|
||||
{ IdarReferencia }
|
||||
IdarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{83152272-9537-4CC0-B2B9-52D3DCB94CC1}']
|
||||
['{F4DA60C5-AA5C-4C19-A6F1-AC34598B7253}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -268,7 +305,7 @@ type
|
||||
|
||||
{ IFacturasProveedor }
|
||||
IFacturasProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{1D0E8202-D645-489F-9E75-F8C3E625DA5D}']
|
||||
['{27F3C7CA-62C3-4BA7-9174-40ECDD054CE1}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -495,7 +532,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_Detalles }
|
||||
IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{E79A8CFF-C4FB-4165-BD40-1A655B5560FC}']
|
||||
['{04247BEA-5459-456E-8FED-8AA310EC3032}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -602,7 +639,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_Detalles_Refresh }
|
||||
IFacturasProveedor_Detalles_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{7AF91EA7-7E55-42D9-99DF-E0D1BBDA4678}']
|
||||
['{284DC1B7-E465-4F55-B460-883905501260}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -709,7 +746,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_Refresh }
|
||||
IFacturasProveedor_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{49436B87-CB54-4066-BCFF-BDDE2410A264}']
|
||||
['{6C448004-0E85-4BC6-9086-99379FF83405}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -938,6 +975,28 @@ implementation
|
||||
|
||||
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;
|
||||
|
||||
|
||||
{ TdarReferenciaDataTableRules }
|
||||
constructor TdarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -1971,6 +2030,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosFacturas, TListaAnosFacturasDataTableRules);
|
||||
RegisterDataTableRules(RID_darReferencia, TdarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_FacturasProveedor, TFacturasProveedorDataTableRules);
|
||||
RegisterDataTableRules(RID_FacturasProveedor_Detalles, TFacturasProveedor_DetallesDataTableRules);
|
||||
|
||||
@ -9,16 +9,46 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_darReferenciaDelta = '{0E73F199-FA0A-4189-9760-9CE6C99E7EB3}';
|
||||
RID_FacturasProveedorDelta = '{4F3FA98F-4BC6-416A-8B47-C9E2B0B2FAA7}';
|
||||
RID_FacturasProveedor_DetallesDelta = '{946B1AE8-1695-4BB3-8A7A-9827305E2ACE}';
|
||||
RID_FacturasProveedor_Detalles_RefreshDelta = '{D52663D1-8475-4406-90D4-19CD1638018B}';
|
||||
RID_FacturasProveedor_RefreshDelta = '{37B84B46-1766-4FBF-89EF-D435761DD571}';
|
||||
RID_ListaAnosFacturasDelta = '{DAA042A6-D72B-4F6C-B3C1-3E1D4418A214}';
|
||||
RID_darReferenciaDelta = '{122C0944-862E-48BC-9974-D9EF9C6EB3CC}';
|
||||
RID_FacturasProveedorDelta = '{7A5E7012-A904-480D-B951-B387CF375EB8}';
|
||||
RID_FacturasProveedor_DetallesDelta = '{A862E9E7-CDCC-4455-A054-F1209C9404C0}';
|
||||
RID_FacturasProveedor_Detalles_RefreshDelta = '{2A5AD3A0-DD3C-468E-8A3E-C4DBDB5408CB}';
|
||||
RID_FacturasProveedor_RefreshDelta = '{BFF6F42D-413B-449C-8469-4DB070D778B9}';
|
||||
|
||||
type
|
||||
{ IListaAnosFacturasDelta }
|
||||
IListaAnosFacturasDelta = interface(IListaAnosFacturas)
|
||||
['{DAA042A6-D72B-4F6C-B3C1-3E1D4418A214}']
|
||||
{ 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;
|
||||
|
||||
{ IdarReferenciaDelta }
|
||||
IdarReferenciaDelta = interface(IdarReferencia)
|
||||
['{0E73F199-FA0A-4189-9760-9CE6C99E7EB3}']
|
||||
['{122C0944-862E-48BC-9974-D9EF9C6EB3CC}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -47,7 +77,7 @@ type
|
||||
|
||||
{ IFacturasProveedorDelta }
|
||||
IFacturasProveedorDelta = interface(IFacturasProveedor)
|
||||
['{4F3FA98F-4BC6-416A-8B47-C9E2B0B2FAA7}']
|
||||
['{7A5E7012-A904-480D-B951-B387CF375EB8}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -307,7 +337,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_DetallesDelta }
|
||||
IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles)
|
||||
['{946B1AE8-1695-4BB3-8A7A-9827305E2ACE}']
|
||||
['{A862E9E7-CDCC-4455-A054-F1209C9404C0}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_FACTURAValue : Integer;
|
||||
@ -427,7 +457,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_Detalles_RefreshDelta }
|
||||
IFacturasProveedor_Detalles_RefreshDelta = interface(IFacturasProveedor_Detalles_Refresh)
|
||||
['{D52663D1-8475-4406-90D4-19CD1638018B}']
|
||||
['{2A5AD3A0-DD3C-468E-8A3E-C4DBDB5408CB}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_FACTURAValue : Integer;
|
||||
@ -547,7 +577,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_RefreshDelta }
|
||||
IFacturasProveedor_RefreshDelta = interface(IFacturasProveedor_Refresh)
|
||||
['{37B84B46-1766-4FBF-89EF-D435761DD571}']
|
||||
['{BFF6F42D-413B-449C-8469-4DB070D778B9}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -810,6 +840,33 @@ implementation
|
||||
uses
|
||||
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;
|
||||
|
||||
|
||||
{ TdarReferenciaBusinessProcessorRules }
|
||||
constructor TdarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2330,6 +2387,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosFacturasDelta, TListaAnosFacturasBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_darReferenciaDelta, TdarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_FacturasProveedorDelta, TFacturasProveedorBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_FacturasProveedor_DetallesDelta, TFacturasProveedor_DetallesBusinessProcessorRules);
|
||||
|
||||
@ -16,6 +16,35 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
||||
DataDictionary = DataDictionary
|
||||
Diagrams = Diagrams
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_FACTURA, 1,4)) as ' +
|
||||
'ANO'#10'from facturas_proveedor'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select ' +
|
||||
'distinct '#39'Todos'#39' as ANO'#10'from empresas'
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -61,9 +61,26 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
DockPos = -6
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 640
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
ExplicitLeft = 435
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
Top = 647
|
||||
|
||||
@ -39,21 +39,27 @@ type
|
||||
procedure actNuevoAbonoExecute(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
private
|
||||
FFacturas: IBizFacturaProveedor;
|
||||
FController : IFacturasProveedorController;
|
||||
|
||||
protected
|
||||
function GetFacturas: IBizFacturaProveedor;
|
||||
procedure SetFacturas(const Value: IBizFacturaProveedor);
|
||||
|
||||
function GetController : IFacturasProveedorController; virtual;
|
||||
procedure SetController (const Value : IFacturasProveedorController); virtual;
|
||||
|
||||
procedure NuevoInterno; override;
|
||||
procedure EliminarInterno; override;
|
||||
procedure ModificarInterno; override;
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
public
|
||||
procedure PonerTitulos(const ATitulo: string = ''); override;
|
||||
property Facturas: IBizFacturaProveedor read GetFacturas write SetFacturas;
|
||||
@ -241,6 +247,8 @@ end;
|
||||
|
||||
procedure TfEditorFacturasProveedor.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -355,6 +363,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasProveedor.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(Facturas, WhereDataTable, Text);
|
||||
if Facturas.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasProveedor.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -404,17 +419,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasProveedor.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosFacturas;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasProveedor.SetController(const Value: IFacturasProveedorController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosFacturas;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturasProveedor.SetFacturas(const Value: IBizFacturaProveedor);
|
||||
begin
|
||||
FFacturas := Value;
|
||||
dsDataTable.DataTable := FFacturas.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewFacturasProveedor).Facturas := Facturas;
|
||||
|
||||
if Assigned(FFacturas) then
|
||||
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 := FFacturas.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FFacturas.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewFacturasProveedor).Facturas := Facturas;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -4,7 +4,7 @@ interface
|
||||
|
||||
|
||||
uses
|
||||
SysUtils, uDADataTable, uEditorDBItem,
|
||||
Classes, SysUtils, uDADataTable, uEditorDBItem,
|
||||
uControllerBase, uIDataModulePedidosProveedor, uProveedoresController,
|
||||
uDetallesPedidoProveedorController, uBizPedidosProveedor, uViewGridBase;
|
||||
|
||||
@ -56,6 +56,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosPedidos: TStringList;
|
||||
procedure FiltrarAno(APedido: IBizPedidoProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TPedidosProveedorController = class(TObservador, IPedidosProveedorController)
|
||||
@ -129,6 +132,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosPedidos: TStringList;
|
||||
procedure FiltrarAno(APedido: IBizPedidoProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -139,7 +145,7 @@ uses
|
||||
uBizDetallesPedidoProveedor, uBizContactos, uDataTableUtils, uDataModuleUsuarios,
|
||||
schPedidosProveedorClient_Intf, uDAInterfaces, uPedidosProveedorReportController,
|
||||
uDateUtils, uIEditorPedidoProveedor, uIEditorElegirPedidosProveedor,
|
||||
Dialogs, uIEditorDireccionEntregaPedidoProveedor, Classes,
|
||||
Dialogs, uIEditorDireccionEntregaPedidoProveedor,
|
||||
uIEditorSituacionPedidoProveedor, Variants, uDataModuleRegistroCorreos,
|
||||
uIDialogListaPedidosProvEnvioEMail, uSistemaFunc, uStringsUtils, uDialogElegirEMail, Forms, uEMailUtils;
|
||||
|
||||
@ -222,6 +228,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TPedidosProveedorController.DarListaAnosPedidos: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TPedidosProveedorController.DescartarCambios(APedido: IBizPedidoProveedor);
|
||||
begin
|
||||
if not Assigned(APedido) then
|
||||
@ -814,6 +825,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosProveedorController.FiltrarAno(APedido: IBizPedidoProveedor; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
APedido.DataTable.Where.Clear;
|
||||
APedido.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with APedido.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_PedidosProveedorFECHA_PEDIDO, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_PedidosProveedorFECHA_PEDIDO, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosProveedorController.FiltrarEmpresa(
|
||||
APedido: IBizPedidoProveedor);
|
||||
begin
|
||||
|
||||
@ -1102,4 +1102,113 @@ object DataModulePedidosProveedor: TDataModulePedidosProveedor
|
||||
Left = 312
|
||||
Top = 200
|
||||
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 = 152
|
||||
Top = 216
|
||||
end
|
||||
object ds_ListaAnosPedidos: TDADataSource
|
||||
DataTable = tbl_ListaAnosPedidos
|
||||
Left = 152
|
||||
Top = 168
|
||||
end
|
||||
end
|
||||
|
||||
@ -26,6 +26,8 @@ type
|
||||
LoginRemoteService: TRORemoteService;
|
||||
tbl_PedidosProveedor_Articulos_Pendientes: TDACDSDataTable;
|
||||
ds_PedidosProveedor_Articulos_Pendientes: TDADataSource;
|
||||
tbl_ListaAnosPedidos: TDACDSDataTable;
|
||||
ds_ListaAnosPedidos: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
|
||||
private
|
||||
@ -46,6 +48,8 @@ type
|
||||
// Report
|
||||
function GetReport(const AID: String): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -137,6 +141,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModulePedidosProveedor.GetAnosItems: 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;
|
||||
|
||||
function TDataModulePedidosProveedor.GetArticulosPendientes(const IDPedido: Integer): IBizDetallesPedidoProveedorPend;
|
||||
var
|
||||
AArticulos : TDACDSDataTable;
|
||||
|
||||
@ -3,11 +3,12 @@ unit uIDataModulePedidosProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizPedidosProveedor, uBizDetallesPedidoProveedor;
|
||||
Classes, uBizPedidosProveedor, uBizDetallesPedidoProveedor;
|
||||
|
||||
type
|
||||
IDataModulePedidosProveedor = interface
|
||||
['{280AA760-26CC-4962-AB08-6C473199DF86}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizPedidoProveedor;
|
||||
function GetItem(const ID : Integer) : IBizPedidoProveedor;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,14 +9,16 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferencia = '{569D9087-BBEE-4EC6-9A84-936628C183A9}';
|
||||
RID_PedidosProveedor = '{92B50C29-DC14-4FD5-A1C1-B6B4DCD3EEBD}';
|
||||
RID_PedidosProveedor_Detalles = '{B6ECB5AB-5B23-468C-9F17-B8826F1F7D3A}';
|
||||
RID_PedidosProveedor_Detalles_Refresh = '{36A9B592-23EC-4FE7-BB3A-81B2BCF9928C}';
|
||||
RID_PedidosProveedor_Refresh = '{39391BDC-E558-43CE-A6AF-5D3A22627534}';
|
||||
RID_PedidosProveedor_Articulos_Pendientes = '{AA412BC5-2D68-45DC-AC60-97540E357854}';
|
||||
RID_ListaAnosPedidos = '{290AFB7D-0056-420C-945C-021352CC3963}';
|
||||
RID_DarReferencia = '{554DA6CD-358E-4506-BB1C-856F2F70CC2F}';
|
||||
RID_PedidosProveedor = '{89837A68-B255-4A32-9192-C1970E124121}';
|
||||
RID_PedidosProveedor_Detalles = '{66A8F285-16A6-4A12-ACE2-D931DDC1DCFB}';
|
||||
RID_PedidosProveedor_Detalles_Refresh = '{9AAF8998-076D-4D08-A0B9-7F73281C1748}';
|
||||
RID_PedidosProveedor_Refresh = '{5930F96F-FADD-49D0-9FB7-B72B3E99FAAE}';
|
||||
RID_PedidosProveedor_Articulos_Pendientes = '{77D750C6-07EA-41E5-86EB-1D6394278CA6}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosPedidos = 'ListaAnosPedidos';
|
||||
nme_DarReferencia = 'DarReferencia';
|
||||
nme_PedidosProveedor = 'PedidosProveedor';
|
||||
nme_PedidosProveedor_Detalles = 'PedidosProveedor_Detalles';
|
||||
@ -24,6 +26,12 @@ const
|
||||
nme_PedidosProveedor_Refresh = 'PedidosProveedor_Refresh';
|
||||
nme_PedidosProveedor_Articulos_Pendientes = 'PedidosProveedor_Articulos_Pendientes';
|
||||
|
||||
{ ListaAnosPedidos fields }
|
||||
fld_ListaAnosPedidosANO = 'ANO';
|
||||
|
||||
{ ListaAnosPedidos field indexes }
|
||||
idx_ListaAnosPedidosANO = 0;
|
||||
|
||||
{ DarReferencia fields }
|
||||
fld_DarReferenciaVALOR = 'VALOR';
|
||||
|
||||
@ -267,9 +275,38 @@ const
|
||||
idx_PedidosProveedor_Articulos_PendientesREFERENCIA_PROVEEDOR = 5;
|
||||
|
||||
type
|
||||
{ IListaAnosPedidos }
|
||||
IListaAnosPedidos = interface(IDAStronglyTypedDataTable)
|
||||
['{F4595921-1C65-49CA-8758-0AA47C2F500B}']
|
||||
{ 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;
|
||||
|
||||
{ IDarReferencia }
|
||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{64D07D1A-5773-40AD-A317-0371C1E4D403}']
|
||||
['{BD142307-84CF-49B4-8C99-CA7611194394}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -298,7 +335,7 @@ type
|
||||
|
||||
{ IPedidosProveedor }
|
||||
IPedidosProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{DB7BC08B-43B9-486E-AB73-628B2C885199}']
|
||||
['{B972EDC1-558B-4001-8066-E3A5FBE288B3}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -543,7 +580,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_Detalles }
|
||||
IPedidosProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{E9EF64AB-0C7A-4F49-8856-34144A2E42AC}']
|
||||
['{4DBD5169-6684-4F63-A58A-6715FB2EC4F6}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -650,7 +687,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_Detalles_Refresh }
|
||||
IPedidosProveedor_Detalles_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{B1FF840E-8E77-4AD8-B8A8-4E749525408D}']
|
||||
['{A8412934-58C7-446E-91F7-7F0F8FC8003D}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -757,7 +794,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_Refresh }
|
||||
IPedidosProveedor_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{4D420826-77D4-4AA6-A215-8E176224B9B2}']
|
||||
['{1BBADE38-A5FC-4F34-988C-5AFB6BA4DDE1}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -1002,7 +1039,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_Articulos_Pendientes }
|
||||
IPedidosProveedor_Articulos_Pendientes = interface(IDAStronglyTypedDataTable)
|
||||
['{1DF9A26D-11AD-4D01-9C56-88D2D9839665}']
|
||||
['{F3FE7A3C-4442-4871-B639-EA9CD5C91DCB}']
|
||||
{ Property getters and setters }
|
||||
function GetID_PEDIDOValue: Integer;
|
||||
procedure SetID_PEDIDOValue(const aValue: Integer);
|
||||
@ -1063,6 +1100,28 @@ implementation
|
||||
|
||||
uses Variants;
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
{ TDarReferenciaDataTableRules }
|
||||
constructor TDarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -2230,6 +2289,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosPedidos, TListaAnosPedidosDataTableRules);
|
||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_PedidosProveedor, TPedidosProveedorDataTableRules);
|
||||
RegisterDataTableRules(RID_PedidosProveedor_Detalles, TPedidosProveedor_DetallesDataTableRules);
|
||||
|
||||
@ -9,17 +9,47 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_DarReferenciaDelta = '{B28F26DA-2A46-4DAA-A0D5-1DDBCA844BED}';
|
||||
RID_PedidosProveedorDelta = '{7E20BCA7-2527-4CB5-B584-2D2341893091}';
|
||||
RID_PedidosProveedor_DetallesDelta = '{8C0FC64F-23A1-4A84-9026-FDAA9F3AA72D}';
|
||||
RID_PedidosProveedor_Detalles_RefreshDelta = '{801C5F9B-3CD7-4AFC-B4AD-F8F194EF8B1F}';
|
||||
RID_PedidosProveedor_RefreshDelta = '{1B4B8841-EF46-426A-BED9-0C6175972907}';
|
||||
RID_PedidosProveedor_Articulos_PendientesDelta = '{DA326CEB-0C27-4873-BA40-1A58EC0FF8F8}';
|
||||
RID_ListaAnosPedidosDelta = '{B82AE96C-74FC-4147-AA8C-BB2935F7190F}';
|
||||
RID_DarReferenciaDelta = '{9FD6B0FB-52EB-42CB-821C-1844BFF2165A}';
|
||||
RID_PedidosProveedorDelta = '{958AB2DC-FEE5-4840-9CE2-6DA8CCF1B940}';
|
||||
RID_PedidosProveedor_DetallesDelta = '{FD11BE1D-B1BC-4F0A-82D9-1FDF68A45811}';
|
||||
RID_PedidosProveedor_Detalles_RefreshDelta = '{2826119A-BB2A-4993-B9D2-ECEAA9B69EF9}';
|
||||
RID_PedidosProveedor_RefreshDelta = '{2EE41CA1-25EE-47C7-AAF1-926A3CE0A94A}';
|
||||
RID_PedidosProveedor_Articulos_PendientesDelta = '{0D0784C9-B751-4869-BE03-EA0DA4DC09BA}';
|
||||
|
||||
type
|
||||
{ IListaAnosPedidosDelta }
|
||||
IListaAnosPedidosDelta = interface(IListaAnosPedidos)
|
||||
['{B82AE96C-74FC-4147-AA8C-BB2935F7190F}']
|
||||
{ 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;
|
||||
|
||||
{ IDarReferenciaDelta }
|
||||
IDarReferenciaDelta = interface(IDarReferencia)
|
||||
['{B28F26DA-2A46-4DAA-A0D5-1DDBCA844BED}']
|
||||
['{9FD6B0FB-52EB-42CB-821C-1844BFF2165A}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -48,7 +78,7 @@ type
|
||||
|
||||
{ IPedidosProveedorDelta }
|
||||
IPedidosProveedorDelta = interface(IPedidosProveedor)
|
||||
['{7E20BCA7-2527-4CB5-B584-2D2341893091}']
|
||||
['{958AB2DC-FEE5-4840-9CE2-6DA8CCF1B940}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -329,7 +359,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_DetallesDelta }
|
||||
IPedidosProveedor_DetallesDelta = interface(IPedidosProveedor_Detalles)
|
||||
['{8C0FC64F-23A1-4A84-9026-FDAA9F3AA72D}']
|
||||
['{FD11BE1D-B1BC-4F0A-82D9-1FDF68A45811}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_PEDIDOValue : Integer;
|
||||
@ -449,7 +479,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_Detalles_RefreshDelta }
|
||||
IPedidosProveedor_Detalles_RefreshDelta = interface(IPedidosProveedor_Detalles_Refresh)
|
||||
['{801C5F9B-3CD7-4AFC-B4AD-F8F194EF8B1F}']
|
||||
['{2826119A-BB2A-4993-B9D2-ECEAA9B69EF9}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_PEDIDOValue : Integer;
|
||||
@ -569,7 +599,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_RefreshDelta }
|
||||
IPedidosProveedor_RefreshDelta = interface(IPedidosProveedor_Refresh)
|
||||
['{1B4B8841-EF46-426A-BED9-0C6175972907}']
|
||||
['{2EE41CA1-25EE-47C7-AAF1-926A3CE0A94A}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -850,7 +880,7 @@ type
|
||||
|
||||
{ IPedidosProveedor_Articulos_PendientesDelta }
|
||||
IPedidosProveedor_Articulos_PendientesDelta = interface(IPedidosProveedor_Articulos_Pendientes)
|
||||
['{DA326CEB-0C27-4873-BA40-1A58EC0FF8F8}']
|
||||
['{0D0784C9-B751-4869-BE03-EA0DA4DC09BA}']
|
||||
{ Property getters and setters }
|
||||
function GetOldID_PEDIDOValue : Integer;
|
||||
function GetOldREFERENCIAValue : String;
|
||||
@ -917,6 +947,33 @@ implementation
|
||||
uses
|
||||
Variants, uROBinaryHelpers;
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
{ TDarReferenciaBusinessProcessorRules }
|
||||
constructor TDarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2633,6 +2690,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosPedidosDelta, TListaAnosPedidosBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_PedidosProveedorDelta, TPedidosProveedorBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_PedidosProveedor_DetallesDelta, TPedidosProveedor_DetallesBusinessProcessorRules);
|
||||
|
||||
@ -15,6 +15,35 @@ object srvPedidosProveedor: TsrvPedidosProveedor
|
||||
ConnectionManager = dmServer.ConnectionManager
|
||||
DataDictionary = DADataDictionary
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_PEDIDO, 1,4)) as A' +
|
||||
'NO'#10'from pedidos_proveedor'#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 = <>
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -49,11 +49,25 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 700
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
Visible = True
|
||||
ExplicitLeft = 435
|
||||
ExplicitWidth = 119
|
||||
object TBXItem39: TTBXItem
|
||||
Action = actRecibirPedido
|
||||
|
||||
@ -34,6 +34,7 @@ type
|
||||
procedure actEliminarUpdate(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
protected
|
||||
FPedidos: IBizPedidoProveedor;
|
||||
@ -44,12 +45,15 @@ type
|
||||
|
||||
function GetController : IPedidosProveedorController; virtual;
|
||||
procedure SetController (const Value : IPedidosProveedorController); virtual;
|
||||
|
||||
procedure NuevoInterno; override;
|
||||
procedure ModificarInterno; override;
|
||||
procedure EliminarInterno; override;
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
public
|
||||
procedure PonerTitulos(const ATitulo: string = ''); override;
|
||||
|
||||
@ -212,6 +216,8 @@ end;
|
||||
|
||||
procedure TfEditorPedidosProveedor.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -307,6 +313,13 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosProveedor.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(Pedidos, WhereDataTable, Text);
|
||||
if Pedidos.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosProveedor.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -356,17 +369,38 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosProveedor.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosPedidos;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosProveedor.SetController(const Value: IPedidosProveedorController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosPedidos;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosProveedor.SetPedidos(const Value: IBizPedidoProveedor);
|
||||
begin
|
||||
FPedidos := Value;
|
||||
dsDataTable.DataTable := FPedidos.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewPedidosProveedor).Pedidos := Pedidos;
|
||||
|
||||
|
||||
if Assigned(FPedidos) then
|
||||
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 := FPedidos.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FPedidos.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewPedidosProveedor).Pedidos := Pedidos;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -4,7 +4,7 @@ interface
|
||||
|
||||
|
||||
uses
|
||||
SysUtils, uDADataTable, uEditorDBItem,
|
||||
Classes, SysUtils, uDADataTable, uEditorDBItem,
|
||||
uControllerBase, uIDataModulePedidosCliente, uClientesController,
|
||||
uDetallesPedidoClienteController, uBizPedidosCliente, uBizDireccionesContacto,
|
||||
uBizDetallesPedidoCliente, uViewGridBase;
|
||||
@ -60,6 +60,9 @@ type
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function ArticulosPendientes(const ID : Integer): IBizPedidoClienteArticulosPend;
|
||||
|
||||
function DarListaAnosPedidos: TStringList;
|
||||
procedure FiltrarAno(APedido: IBizPedidoCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TPedidosClienteController = class(TObservador, IPedidosClienteController)
|
||||
@ -133,6 +136,9 @@ type
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function ArticulosPendientes(const ID : Integer): IBizPedidoClienteArticulosPend;
|
||||
|
||||
function DarListaAnosPedidos: TStringList;
|
||||
procedure FiltrarAno(APedido: IBizPedidoCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -140,7 +146,7 @@ implementation
|
||||
uses
|
||||
uROTypes, Controls, cxControls, DB, uEditorRegistryUtils, uEditorPreview, DateUtils,
|
||||
uIEditorPedidosCliente, uDataModulePedidosCliente, Variants,
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios, Classes,
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios,
|
||||
schPedidosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorPedidoCliente,
|
||||
uIEditorElegirPedidosCliente, uIEditorDireccionEntregaPedidoCliente,
|
||||
schContactosClient_Intf, uPedidosClienteReportController, uDataModuleRegistroCorreos,
|
||||
@ -284,6 +290,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.DarListaAnosPedidos: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TPedidosClienteController.DescartarCambios(APedido: IBizPedidoCliente);
|
||||
begin
|
||||
if not Assigned(APedido) then
|
||||
@ -797,6 +808,32 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosClienteController.FiltrarAno(APedido: IBizPedidoCliente; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
APedido.DataTable.Where.Clear;
|
||||
APedido.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las pedidos actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with APedido.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_PedidosClienteFECHA_PEDIDO, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_PedidosClienteFECHA_PEDIDO, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TPedidosClienteController.FiltrarEmpresa(
|
||||
APedido: IBizPedidoCliente);
|
||||
begin
|
||||
|
||||
@ -1220,4 +1220,113 @@ object DataModulePedidosCliente: TDataModulePedidosCliente
|
||||
Left = 440
|
||||
Top = 256
|
||||
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 = 520
|
||||
Top = 112
|
||||
end
|
||||
object ds_ListaAnosPedidos: TDADataSource
|
||||
DataTable = tbl_ListaAnosPedidos
|
||||
Left = 520
|
||||
Top = 48
|
||||
end
|
||||
end
|
||||
|
||||
@ -27,6 +27,8 @@ type
|
||||
ds_PedidoCliente_Articulos_Pendientes: TDADataSource;
|
||||
tbl_PedidoCliente_ArticulosPendientesPedirAProv: TDACDSDataTable;
|
||||
ds_PedidoCliente_ArticulosPendientesPedirAProv: TDADataSource;
|
||||
tbl_ListaAnosPedidos: TDACDSDataTable;
|
||||
ds_ListaAnosPedidos: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
|
||||
private
|
||||
@ -47,6 +49,8 @@ type
|
||||
// Report
|
||||
function GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -137,6 +141,30 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModulePedidosCliente.GetAnosItems: 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;
|
||||
|
||||
function TDataModulePedidosCliente.GetArticulosPendientes(
|
||||
const IDPedido: Integer): IBizPedidoClienteArticulosPend;
|
||||
var
|
||||
|
||||
@ -3,11 +3,12 @@ unit uIDataModulePedidosCliente;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizPedidosCliente, uBizDetallesPedidoCliente;
|
||||
Classes, uBizPedidosCliente, uBizDetallesPedidoCliente;
|
||||
|
||||
type
|
||||
IDataModulePedidosCliente = interface
|
||||
['{F0DDD126-9E62-4FEC-A849-FDCA75718F5B}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizPedidoCliente;
|
||||
function GetItem(const ID : Integer) : IBizPedidoCliente;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,15 +9,17 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_PedidoCliente_ArticulosPendientesPedirAProv = '{4866506D-B7AD-48C1-AA0E-7F3259ADC372}';
|
||||
RID_DarReferencia = '{8014D812-7F3F-4918-90BF-807C1840C700}';
|
||||
RID_PedidosCliente = '{282EAEF6-17F1-485F-80D9-ED71D2C0B016}';
|
||||
RID_PedidosCliente_Detalles = '{09D5B882-A47C-42D1-B80D-8DFF76F70F10}';
|
||||
RID_PedidosCliente_Refresh = '{028AFA09-EB59-40AC-8EAF-C6320FD9105A}';
|
||||
RID_PedidosCliente_Detalles_Refresh = '{DE07DB2B-7CB4-48F9-8ADC-177DFF9166F8}';
|
||||
RID_PedidoCliente_Articulos_Pendientes = '{BA23D65A-A8BE-4EDB-878B-534180C048E5}';
|
||||
RID_ListaAnosPedidos = '{A8BF7EC3-3A8B-4ADC-BDB7-A733020AC74D}';
|
||||
RID_PedidoCliente_ArticulosPendientesPedirAProv = '{AA12C258-2C76-4668-B1AD-E2546DD86BBC}';
|
||||
RID_DarReferencia = '{E3D18DE1-33E2-4605-B4C6-9965ECC16B40}';
|
||||
RID_PedidosCliente = '{1CF72627-1238-4A61-9E2E-DC0F059E11CE}';
|
||||
RID_PedidosCliente_Detalles = '{920BEDAF-84DA-46E6-B11D-6C89F144ADFB}';
|
||||
RID_PedidosCliente_Refresh = '{0B02AE04-8937-4159-B241-D05CB9E0B0B2}';
|
||||
RID_PedidosCliente_Detalles_Refresh = '{F6C41177-85FD-473C-81BF-94C18C9CCD4C}';
|
||||
RID_PedidoCliente_Articulos_Pendientes = '{6B013D42-70AA-4DA8-ADD6-E466F9CABDA6}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosPedidos = 'ListaAnosPedidos';
|
||||
nme_PedidoCliente_ArticulosPendientesPedirAProv = 'PedidoCliente_ArticulosPendientesPedirAProv';
|
||||
nme_DarReferencia = 'DarReferencia';
|
||||
nme_PedidosCliente = 'PedidosCliente';
|
||||
@ -26,6 +28,12 @@ const
|
||||
nme_PedidosCliente_Detalles_Refresh = 'PedidosCliente_Detalles_Refresh';
|
||||
nme_PedidoCliente_Articulos_Pendientes = 'PedidoCliente_Articulos_Pendientes';
|
||||
|
||||
{ ListaAnosPedidos fields }
|
||||
fld_ListaAnosPedidosANO = 'ANO';
|
||||
|
||||
{ ListaAnosPedidos field indexes }
|
||||
idx_ListaAnosPedidosANO = 0;
|
||||
|
||||
{ PedidoCliente_ArticulosPendientesPedirAProv fields }
|
||||
fld_PedidoCliente_ArticulosPendientesPedirAProvID_PEDIDO = 'ID_PEDIDO';
|
||||
fld_PedidoCliente_ArticulosPendientesPedirAProvID_ARTICULO = 'ID_ARTICULO';
|
||||
@ -265,9 +273,38 @@ const
|
||||
idx_PedidoCliente_Articulos_PendientesCANTIDAD_PENDIENTE = 3;
|
||||
|
||||
type
|
||||
{ IListaAnosPedidos }
|
||||
IListaAnosPedidos = interface(IDAStronglyTypedDataTable)
|
||||
['{B7C11B2A-6E4A-4350-916F-433C5A608472}']
|
||||
{ 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;
|
||||
|
||||
{ IPedidoCliente_ArticulosPendientesPedirAProv }
|
||||
IPedidoCliente_ArticulosPendientesPedirAProv = interface(IDAStronglyTypedDataTable)
|
||||
['{3C606C79-CCB1-4981-A4A1-50814B9C6AB1}']
|
||||
['{7BE36BBA-03FB-4429-B62E-96095DFA3279}']
|
||||
{ Property getters and setters }
|
||||
function GetID_PEDIDOValue: Integer;
|
||||
procedure SetID_PEDIDOValue(const aValue: Integer);
|
||||
@ -326,7 +363,7 @@ type
|
||||
|
||||
{ IDarReferencia }
|
||||
IDarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{2CA2F013-394E-443E-AD5A-C8C3FD287B5C}']
|
||||
['{DA2DF3D7-A974-4014-81AA-86FC6A6CF896}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -355,7 +392,7 @@ type
|
||||
|
||||
{ IPedidosCliente }
|
||||
IPedidosCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{ECE661D7-1653-475F-8A03-A88242EA7F98}']
|
||||
['{8B94E384-CF25-4B29-8717-E22CCF6FEC19}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -576,7 +613,7 @@ type
|
||||
|
||||
{ IPedidosCliente_Detalles }
|
||||
IPedidosCliente_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{DC02EC1B-51E9-40CC-A3F1-B4D1D75448E0}']
|
||||
['{3E9F8DFC-08A1-4FE6-B3E0-A8D35B4713F8}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -683,7 +720,7 @@ type
|
||||
|
||||
{ IPedidosCliente_Refresh }
|
||||
IPedidosCliente_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{D2BB5DB6-04DF-497A-BA7C-36324598582A}']
|
||||
['{DA0A11AA-8112-4F55-9C26-FCE234AB2667}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -904,7 +941,7 @@ type
|
||||
|
||||
{ IPedidosCliente_Detalles_Refresh }
|
||||
IPedidosCliente_Detalles_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{CEA381F6-75A1-48AD-9A9D-BDFF73BA4C76}']
|
||||
['{3EE0B65C-375E-4C0E-903D-69798136D6A7}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -1011,7 +1048,7 @@ type
|
||||
|
||||
{ IPedidoCliente_Articulos_Pendientes }
|
||||
IPedidoCliente_Articulos_Pendientes = interface(IDAStronglyTypedDataTable)
|
||||
['{584AEFF3-D810-4B52-A619-38006EB43574}']
|
||||
['{5FCCA01A-C6BB-42BE-BD6F-25FD004B4D8A}']
|
||||
{ Property getters and setters }
|
||||
function GetID_ARTICULOValue: Integer;
|
||||
procedure SetID_ARTICULOValue(const aValue: Integer);
|
||||
@ -1060,6 +1097,28 @@ implementation
|
||||
|
||||
uses Variants;
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
{ TPedidoCliente_ArticulosPendientesPedirAProvDataTableRules }
|
||||
constructor TPedidoCliente_ArticulosPendientesPedirAProvDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -2199,6 +2258,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosPedidos, TListaAnosPedidosDataTableRules);
|
||||
RegisterDataTableRules(RID_PedidoCliente_ArticulosPendientesPedirAProv, TPedidoCliente_ArticulosPendientesPedirAProvDataTableRules);
|
||||
RegisterDataTableRules(RID_DarReferencia, TDarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_PedidosCliente, TPedidosClienteDataTableRules);
|
||||
|
||||
@ -9,18 +9,48 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_PedidoCliente_ArticulosPendientesPedirAProvDelta = '{9DF33AF3-48FE-41B5-887B-98F4D7DFC83A}';
|
||||
RID_DarReferenciaDelta = '{BBA79BFA-59B0-4129-82AB-0D3BD9C217F2}';
|
||||
RID_PedidosClienteDelta = '{ECFDA30A-0379-4A81-ADF5-8668C838FA92}';
|
||||
RID_PedidosCliente_DetallesDelta = '{6293C9B7-58C6-4082-9BB3-C22E56A1E4F8}';
|
||||
RID_PedidosCliente_RefreshDelta = '{6B062172-1FB8-4C75-8D2D-7F749CA52D3F}';
|
||||
RID_PedidosCliente_Detalles_RefreshDelta = '{9B82DF9B-6228-4B13-ACB5-B18EB4559B30}';
|
||||
RID_PedidoCliente_Articulos_PendientesDelta = '{58C4E6B6-FDC3-4283-8FA6-7D23B0A1C2CF}';
|
||||
RID_ListaAnosPedidosDelta = '{72B93EDB-61B4-4067-9C49-839CF8C12F0D}';
|
||||
RID_PedidoCliente_ArticulosPendientesPedirAProvDelta = '{71CD0BAA-A9CA-4590-B190-F2827A7F9586}';
|
||||
RID_DarReferenciaDelta = '{3C370241-8868-4857-BB76-F0D014CBFFEF}';
|
||||
RID_PedidosClienteDelta = '{D8A3D195-E200-43EF-B7DD-D0E6C06B2D93}';
|
||||
RID_PedidosCliente_DetallesDelta = '{12D37153-BEC6-45CF-BB9B-381CC1C4AC1B}';
|
||||
RID_PedidosCliente_RefreshDelta = '{EBF93E3E-EC20-4B5B-BA36-F10AFD7C5FA3}';
|
||||
RID_PedidosCliente_Detalles_RefreshDelta = '{6EC1CD96-189D-4F49-A529-AAC0513C4EF4}';
|
||||
RID_PedidoCliente_Articulos_PendientesDelta = '{087CF6A1-BD59-41DA-8636-85D3390A7A8C}';
|
||||
|
||||
type
|
||||
{ IListaAnosPedidosDelta }
|
||||
IListaAnosPedidosDelta = interface(IListaAnosPedidos)
|
||||
['{72B93EDB-61B4-4067-9C49-839CF8C12F0D}']
|
||||
{ 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;
|
||||
|
||||
{ IPedidoCliente_ArticulosPendientesPedirAProvDelta }
|
||||
IPedidoCliente_ArticulosPendientesPedirAProvDelta = interface(IPedidoCliente_ArticulosPendientesPedirAProv)
|
||||
['{9DF33AF3-48FE-41B5-887B-98F4D7DFC83A}']
|
||||
['{71CD0BAA-A9CA-4590-B190-F2827A7F9586}']
|
||||
{ Property getters and setters }
|
||||
function GetOldID_PEDIDOValue : Integer;
|
||||
function GetOldID_ARTICULOValue : Integer;
|
||||
@ -84,7 +114,7 @@ type
|
||||
|
||||
{ IDarReferenciaDelta }
|
||||
IDarReferenciaDelta = interface(IDarReferencia)
|
||||
['{BBA79BFA-59B0-4129-82AB-0D3BD9C217F2}']
|
||||
['{3C370241-8868-4857-BB76-F0D014CBFFEF}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -113,7 +143,7 @@ type
|
||||
|
||||
{ IPedidosClienteDelta }
|
||||
IPedidosClienteDelta = interface(IPedidosCliente)
|
||||
['{ECFDA30A-0379-4A81-ADF5-8668C838FA92}']
|
||||
['{D8A3D195-E200-43EF-B7DD-D0E6C06B2D93}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -366,7 +396,7 @@ type
|
||||
|
||||
{ IPedidosCliente_DetallesDelta }
|
||||
IPedidosCliente_DetallesDelta = interface(IPedidosCliente_Detalles)
|
||||
['{6293C9B7-58C6-4082-9BB3-C22E56A1E4F8}']
|
||||
['{12D37153-BEC6-45CF-BB9B-381CC1C4AC1B}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_PEDIDOValue : Integer;
|
||||
@ -486,7 +516,7 @@ type
|
||||
|
||||
{ IPedidosCliente_RefreshDelta }
|
||||
IPedidosCliente_RefreshDelta = interface(IPedidosCliente_Refresh)
|
||||
['{6B062172-1FB8-4C75-8D2D-7F749CA52D3F}']
|
||||
['{EBF93E3E-EC20-4B5B-BA36-F10AFD7C5FA3}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -739,7 +769,7 @@ type
|
||||
|
||||
{ IPedidosCliente_Detalles_RefreshDelta }
|
||||
IPedidosCliente_Detalles_RefreshDelta = interface(IPedidosCliente_Detalles_Refresh)
|
||||
['{9B82DF9B-6228-4B13-ACB5-B18EB4559B30}']
|
||||
['{6EC1CD96-189D-4F49-A529-AAC0513C4EF4}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_PEDIDOValue : Integer;
|
||||
@ -859,7 +889,7 @@ type
|
||||
|
||||
{ IPedidoCliente_Articulos_PendientesDelta }
|
||||
IPedidoCliente_Articulos_PendientesDelta = interface(IPedidoCliente_Articulos_Pendientes)
|
||||
['{58C4E6B6-FDC3-4283-8FA6-7D23B0A1C2CF}']
|
||||
['{087CF6A1-BD59-41DA-8636-85D3390A7A8C}']
|
||||
{ Property getters and setters }
|
||||
function GetOldID_ARTICULOValue : Integer;
|
||||
function GetOldCANTIDAD_PEDValue : Integer;
|
||||
@ -912,6 +942,33 @@ implementation
|
||||
uses
|
||||
Variants, uROBinaryHelpers;
|
||||
|
||||
{ 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;
|
||||
|
||||
|
||||
{ TPedidoCliente_ArticulosPendientesPedirAProvBusinessProcessorRules }
|
||||
constructor TPedidoCliente_ArticulosPendientesPedirAProvBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2580,6 +2637,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosPedidosDelta, TListaAnosPedidosBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_PedidoCliente_ArticulosPendientesPedirAProvDelta, TPedidoCliente_ArticulosPendientesPedirAProvBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_DarReferenciaDelta, TDarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_PedidosClienteDelta, TPedidosClienteBusinessProcessorRules);
|
||||
|
||||
@ -15,6 +15,35 @@ object srvPedidosCliente: TsrvPedidosCliente
|
||||
ConnectionManager = dmServer.ConnectionManager
|
||||
DataDictionary = DADataDictionary
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_PEDIDO, 1,4)) as A' +
|
||||
'NO'#10'from pedidos_cliente'#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 = <>
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -129,6 +129,18 @@ inherited fEditorPedidosCliente: TfEditorPedidosCliente
|
||||
Action = actEnviarEmail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 674
|
||||
object TBXSubmenuItem2: TTBXSubmenuItem [4]
|
||||
@ -144,7 +156,9 @@ inherited fEditorPedidosCliente: TfEditorPedidosCliente
|
||||
end
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
Visible = True
|
||||
ExplicitLeft = 435
|
||||
ExplicitWidth = 91
|
||||
object TBXItem40: TTBXItem
|
||||
Action = actGenerar
|
||||
|
||||
@ -43,6 +43,7 @@ type
|
||||
procedure actGenerarUpdate(Sender: TObject);
|
||||
procedure actEnviarEmailExecute(Sender: TObject);
|
||||
procedure actEnviarEmailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
protected
|
||||
FPedidos: IBizPedidoCliente;
|
||||
@ -60,6 +61,7 @@ type
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
//Si queremos crear otra vista para el editor heredado solo tendriamos que
|
||||
//sobreescribir este metodo
|
||||
@ -281,6 +283,8 @@ end;
|
||||
|
||||
procedure TfEditorPedidosCliente.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES QUE EL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -358,6 +362,13 @@ begin
|
||||
FController.Ver(Pedidos);
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(Pedidos, WhereDataTable, Text);
|
||||
if Pedidos.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -407,17 +418,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de los pedidos
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosPedidos;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.SetController(const Value: IPedidosClienteController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosPedidos;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.SetPedidos(const Value: IBizPedidoCliente);
|
||||
begin
|
||||
FPedidos := Value;
|
||||
dsDataTable.DataTable := FPedidos.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewPedidosCliente).Pedidos := Pedidos;
|
||||
|
||||
if Assigned(FPedidos) then
|
||||
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 := FPedidos.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FPedidos.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewPedidosCliente).Pedidos := Pedidos;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -83,6 +83,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosRecibos: TStringList;
|
||||
procedure FiltrarAno(ARecibo: IBizRecibosCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TRecibosClienteController = class(TObservador, IRecibosClienteController)
|
||||
@ -152,6 +155,9 @@ type
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function DarListaAnosRecibos: TStringList;
|
||||
procedure FiltrarAno(ARecibo: IBizRecibosCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -444,6 +450,11 @@ begin
|
||||
Result := Buscar(ID_NULO);
|
||||
end;
|
||||
|
||||
function TRecibosClienteController.DarListaAnosRecibos: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
function TRecibosClienteController.DarNuevaReferencia(ID_FACTURA: Integer; REFERENCIA: String): String;
|
||||
var
|
||||
ARecibosCliente: IBizRecibosCliente;
|
||||
@ -591,6 +602,7 @@ begin
|
||||
if Assigned(AEditor) then
|
||||
with AEditor do
|
||||
begin
|
||||
Controller := Self; //OJO ORDEN MUY IMPORTANTE
|
||||
RecibosCliente := ARecibosCliente;
|
||||
MultiSelect := True;
|
||||
ShowEmbedded;
|
||||
@ -980,6 +992,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRecibosClienteController.FiltrarAno(ARecibo: IBizRecibosCliente; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
ARecibo.DataTable.Where.Clear;
|
||||
ARecibo.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with ARecibo.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RecibosClienteFECHA_EMISION, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RecibosClienteFECHA_EMISION, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRecibosClienteController.Preview(ARecibosCliente: IBizRecibosCliente; AllItems: Boolean = false);
|
||||
var
|
||||
AReportController : IRecibosClienteReportController;
|
||||
|
||||
@ -67,6 +67,8 @@ object DataModuleRecibosCliente: TDataModuleRecibosCliente
|
||||
ProbeFrequency = 60000
|
||||
UserAgent = 'RemObjects SDK'
|
||||
TargetURL = 'http://localhost:8099/bin'
|
||||
Login.Username = '1'
|
||||
Login.Password = 'Luis'
|
||||
Left = 48
|
||||
Top = 272
|
||||
end
|
||||
@ -1133,4 +1135,113 @@ object DataModuleRecibosCliente: TDataModuleRecibosCliente
|
||||
Left = 328
|
||||
Top = 248
|
||||
end
|
||||
object tbl_ListaAnosRecibos: 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 = 'ListaAnosRecibos'
|
||||
end>
|
||||
DataRequestCall.MethodName = 'GetDatasetDataEx'
|
||||
DataRequestCall.Params = <
|
||||
item
|
||||
Name = 'Result'
|
||||
ParamType = fResult
|
||||
DataType = rtBinary
|
||||
end
|
||||
item
|
||||
Name = 'DatasetName'
|
||||
ParamType = fIn
|
||||
DataType = rtString
|
||||
Value = 'ListaAnosRecibos'
|
||||
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 = 'ListaAnosRecibos'
|
||||
end>
|
||||
ReadOnly = False
|
||||
RemoteService = RORemoteService
|
||||
Adapter = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosRecibos'
|
||||
IndexDefs = <>
|
||||
Left = 160
|
||||
Top = 168
|
||||
end
|
||||
object ds_ListaAnosRecibos: TDADataSource
|
||||
DataTable = tbl_ListaAnosRecibos
|
||||
Left = 160
|
||||
Top = 112
|
||||
end
|
||||
end
|
||||
|
||||
@ -48,6 +48,8 @@ type
|
||||
ds_PagosCliente: TDADataSource;
|
||||
tbl_RecibosCompensadosCli: TDACDSDataTable;
|
||||
ds_RecibosCompensadosCli: TDADataSource;
|
||||
tbl_ListaAnosRecibos: TDACDSDataTable;
|
||||
ds_ListaAnosRecibos: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
protected
|
||||
function DarNombreGenerador(DataSetName: String): String; virtual;
|
||||
@ -61,6 +63,8 @@ type
|
||||
function NewItem : IBizRecibosCliente;
|
||||
function GetReport(const ID: String): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -190,6 +194,30 @@ begin
|
||||
Result := GetItem(ID_NULO)
|
||||
end;
|
||||
|
||||
function TDataModuleRecibosCliente.GetAnosItems: TStringList;
|
||||
var
|
||||
AListaAnos: TStringList;
|
||||
begin
|
||||
AListaAnos := TStringList.Create;
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
with tbl_ListaAnosRecibos 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;
|
||||
|
||||
function TDataModuleRecibosCliente.GetItem(const ID: Integer): IBizRecibosCliente;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -26,11 +26,12 @@ unit uIDataModuleRecibosCliente;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizRecibosCliente;
|
||||
Classes, uBizRecibosCliente;
|
||||
|
||||
type
|
||||
IDataModuleRecibosCliente = interface
|
||||
['{F4F02C9E-E861-4938-8A2D-FE971A41EE92}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizRecibosCliente;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
function GetItem(const ID : Integer) : IBizRecibosCliente;
|
||||
|
||||
@ -9,17 +9,25 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_RecibosCliente = '{3A31A595-D48C-4913-88A1-753A1DBBA5C4}';
|
||||
RID_RecibosCliente_Refresh = '{F9FF0068-D1C5-43A2-BEDE-19310B8CEB7D}';
|
||||
RID_PagosCliente = '{36B21D04-17C3-45EB-BBC9-F864DAEE8BEE}';
|
||||
RID_RecibosCompensadosCli = '{0768E6E5-C46A-44B5-9FE5-CCE0089141BF}';
|
||||
RID_ListaAnosRecibos = '{F2409BB9-C9B3-44EA-9642-D2B782E76EC4}';
|
||||
RID_RecibosCliente = '{B3602898-1B21-4F62-ADCF-FBC749E176FC}';
|
||||
RID_RecibosCliente_Refresh = '{BD5B5013-8C5F-4117-81E7-1109FF474874}';
|
||||
RID_PagosCliente = '{47521D6F-8CA8-4F32-8300-B17922C1EBF3}';
|
||||
RID_RecibosCompensadosCli = '{BA08F41B-F985-45EE-BFE3-07999C72FA54}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosRecibos = 'ListaAnosRecibos';
|
||||
nme_RecibosCliente = 'RecibosCliente';
|
||||
nme_RecibosCliente_Refresh = 'RecibosCliente_Refresh';
|
||||
nme_PagosCliente = 'PagosCliente';
|
||||
nme_RecibosCompensadosCli = 'RecibosCompensadosCli';
|
||||
|
||||
{ ListaAnosRecibos fields }
|
||||
fld_ListaAnosRecibosANO = 'ANO';
|
||||
|
||||
{ ListaAnosRecibos field indexes }
|
||||
idx_ListaAnosRecibosANO = 0;
|
||||
|
||||
{ RecibosCliente fields }
|
||||
fld_RecibosClienteID = 'ID';
|
||||
fld_RecibosClienteID_RECIBO_COMPENSADO = 'ID_RECIBO_COMPENSADO';
|
||||
@ -217,9 +225,38 @@ const
|
||||
idx_RecibosCompensadosCliID_EMPRESA = 15;
|
||||
|
||||
type
|
||||
{ IListaAnosRecibos }
|
||||
IListaAnosRecibos = interface(IDAStronglyTypedDataTable)
|
||||
['{89DE9459-2A91-4F1A-B39F-F1D9016A2D2A}']
|
||||
{ Property getters and setters }
|
||||
function GetANOValue: String;
|
||||
procedure SetANOValue(const aValue: String);
|
||||
|
||||
|
||||
{ Properties }
|
||||
property ANO: String read GetANOValue write SetANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRecibosDataTableRules }
|
||||
TListaAnosRecibosDataTableRules = class(TDADataTableRules, IListaAnosRecibos)
|
||||
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;
|
||||
|
||||
{ IRecibosCliente }
|
||||
IRecibosCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{071E91B1-00CA-4F7E-AEDD-ACF4B65D0B94}']
|
||||
['{D261ED1D-212D-47BA-A684-790B6F3C301B}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -428,7 +465,7 @@ type
|
||||
|
||||
{ IRecibosCliente_Refresh }
|
||||
IRecibosCliente_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{9CBDE222-CACC-4694-BEB7-73E4EA38087C}']
|
||||
['{2A3C390B-23ED-44EC-82E5-49490E998071}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -637,7 +674,7 @@ type
|
||||
|
||||
{ IPagosCliente }
|
||||
IPagosCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{9038B034-EDDD-4CE6-A24E-D9F12F7CF8E3}']
|
||||
['{49C05D5F-2FAA-4BE7-8806-CDEEEBD1BB79}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -732,7 +769,7 @@ type
|
||||
|
||||
{ IRecibosCompensadosCli }
|
||||
IRecibosCompensadosCli = interface(IDAStronglyTypedDataTable)
|
||||
['{38498E3F-092B-4877-A3E9-EEB66C7B6806}']
|
||||
['{57951F5C-8B70-478A-8C4B-FB93AD63B4D5}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -853,6 +890,28 @@ implementation
|
||||
|
||||
uses Variants;
|
||||
|
||||
{ TListaAnosRecibosDataTableRules }
|
||||
constructor TListaAnosRecibosDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRecibosDataTableRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRecibosDataTableRules.GetANOValue: String;
|
||||
begin
|
||||
result := DataTable.Fields[idx_ListaAnosRecibosANO].AsString;
|
||||
end;
|
||||
|
||||
procedure TListaAnosRecibosDataTableRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
DataTable.Fields[idx_ListaAnosRecibosANO].AsString := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TRecibosClienteDataTableRules }
|
||||
constructor TRecibosClienteDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -1802,6 +1861,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosRecibos, TListaAnosRecibosDataTableRules);
|
||||
RegisterDataTableRules(RID_RecibosCliente, TRecibosClienteDataTableRules);
|
||||
RegisterDataTableRules(RID_RecibosCliente_Refresh, TRecibosCliente_RefreshDataTableRules);
|
||||
RegisterDataTableRules(RID_PagosCliente, TPagosClienteDataTableRules);
|
||||
|
||||
@ -9,15 +9,45 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_RecibosClienteDelta = '{AA27035C-016E-417B-827B-D8851447786A}';
|
||||
RID_RecibosCliente_RefreshDelta = '{25876270-8B70-4853-9E59-581AC90FFE3C}';
|
||||
RID_PagosClienteDelta = '{9FB42929-5B3B-45A1-9DB1-E7004D6BCFA4}';
|
||||
RID_RecibosCompensadosCliDelta = '{33B534EA-40C6-4D0D-B7B3-496DF8B28FB3}';
|
||||
RID_ListaAnosRecibosDelta = '{AFB3F9CF-8D5C-40FD-AC65-7B9BBD04E7D8}';
|
||||
RID_RecibosClienteDelta = '{9E317E04-A207-4CD5-87CB-323881FF3991}';
|
||||
RID_RecibosCliente_RefreshDelta = '{07DDE83E-B15B-4B40-86AE-40A0E920D8D6}';
|
||||
RID_PagosClienteDelta = '{1DDDA700-4544-40C4-9763-D46B3F058E28}';
|
||||
RID_RecibosCompensadosCliDelta = '{692B5FAD-7002-4B0C-A0C5-5FC22CC3A75C}';
|
||||
|
||||
type
|
||||
{ IListaAnosRecibosDelta }
|
||||
IListaAnosRecibosDelta = interface(IListaAnosRecibos)
|
||||
['{AFB3F9CF-8D5C-40FD-AC65-7B9BBD04E7D8}']
|
||||
{ Property getters and setters }
|
||||
function GetOldANOValue : String;
|
||||
|
||||
{ Properties }
|
||||
property OldANO : String read GetOldANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRecibosBusinessProcessorRules }
|
||||
TListaAnosRecibosBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosRecibos, IListaAnosRecibosDelta)
|
||||
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;
|
||||
|
||||
{ IRecibosClienteDelta }
|
||||
IRecibosClienteDelta = interface(IRecibosCliente)
|
||||
['{AA27035C-016E-417B-827B-D8851447786A}']
|
||||
['{9E317E04-A207-4CD5-87CB-323881FF3991}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||
@ -256,7 +286,7 @@ type
|
||||
|
||||
{ IRecibosCliente_RefreshDelta }
|
||||
IRecibosCliente_RefreshDelta = interface(IRecibosCliente_Refresh)
|
||||
['{25876270-8B70-4853-9E59-581AC90FFE3C}']
|
||||
['{07DDE83E-B15B-4B40-86AE-40A0E920D8D6}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||
@ -495,7 +525,7 @@ type
|
||||
|
||||
{ IPagosClienteDelta }
|
||||
IPagosClienteDelta = interface(IPagosCliente)
|
||||
['{9FB42929-5B3B-45A1-9DB1-E7004D6BCFA4}']
|
||||
['{1DDDA700-4544-40C4-9763-D46B3F058E28}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBOValue : Integer;
|
||||
@ -601,7 +631,7 @@ type
|
||||
|
||||
{ IRecibosCompensadosCliDelta }
|
||||
IRecibosCompensadosCliDelta = interface(IRecibosCompensadosCli)
|
||||
['{33B534EA-40C6-4D0D-B7B3-496DF8B28FB3}']
|
||||
['{692B5FAD-7002-4B0C-A0C5-5FC22CC3A75C}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||
@ -738,6 +768,33 @@ implementation
|
||||
uses
|
||||
Variants, uROBinaryHelpers;
|
||||
|
||||
{ TListaAnosRecibosBusinessProcessorRules }
|
||||
constructor TListaAnosRecibosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRecibosBusinessProcessorRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRecibosBusinessProcessorRules.GetANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRecibosANO];
|
||||
end;
|
||||
|
||||
function TListaAnosRecibosBusinessProcessorRules.GetOldANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosRecibosANO];
|
||||
end;
|
||||
|
||||
procedure TListaAnosRecibosBusinessProcessorRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRecibosANO] := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TRecibosClienteBusinessProcessorRules }
|
||||
constructor TRecibosClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2137,6 +2194,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosRecibosDelta, TListaAnosRecibosBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RecibosClienteDelta, TRecibosClienteBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RecibosCliente_RefreshDelta, TRecibosCliente_RefreshBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_PagosClienteDelta, TPagosClienteBusinessProcessorRules);
|
||||
|
||||
@ -15,6 +15,35 @@ object srvRecibosCliente: TsrvRecibosCliente
|
||||
ConnectionManager = dmServer.ConnectionManager
|
||||
DataDictionary = DADataDictionary
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_EMISION, 1,4)) as ' +
|
||||
'ANO'#10'from recibos_cliente'#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 = <>
|
||||
end>
|
||||
Name = 'ListaAnosRecibos'
|
||||
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
|
||||
Params = <>
|
||||
Statements = <
|
||||
|
||||
@ -46,9 +46,25 @@ inherited fEditorRecibosCliente: TfEditorRecibosCliente
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 645
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
ExplicitLeft = 435
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
Top = 542
|
||||
|
||||
@ -49,12 +49,16 @@ type
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
private
|
||||
FRecibosCliente: IBizRecibosCliente;
|
||||
FController : IRecibosClienteController;
|
||||
|
||||
protected
|
||||
function GetRecibosCliente: IBizRecibosCliente;
|
||||
procedure SetRecibosCliente(const Value: IBizRecibosCliente);
|
||||
|
||||
function GetController : IRecibosClienteController;
|
||||
procedure SetController (const Value : IRecibosClienteController);
|
||||
|
||||
@ -64,6 +68,8 @@ type
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
public
|
||||
procedure PonerTitulos(const ATitulo: string = ''); override;
|
||||
property RecibosCliente: IBizRecibosCliente read GetRecibosCliente write SetRecibosCliente;
|
||||
@ -144,6 +150,8 @@ end;
|
||||
|
||||
procedure TfEditorRecibosCliente.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES QUE EL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -221,6 +229,13 @@ begin
|
||||
//No se pueden añadir recibos nuevos
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosCliente.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(RecibosCliente, WhereDataTable, Text);
|
||||
if RecibosCliente.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosCliente.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -270,17 +285,38 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosCliente.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRecibos;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosCliente.SetController(const Value: IRecibosClienteController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRecibos;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosCliente.SetRecibosCliente(const Value: IBizRecibosCliente);
|
||||
begin
|
||||
FRecibosCliente := Value;
|
||||
dsDataTable.DataTable := FRecibosCliente.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRecibosCliente).Recibos := FRecibosCliente;
|
||||
|
||||
|
||||
if Assigned(FRecibosCliente) then
|
||||
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 := FRecibosCliente.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FRecibosCliente.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRecibosCliente).Recibos := FRecibosCliente;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -71,6 +71,9 @@ type
|
||||
|
||||
procedure Preview(ARecibosProveedor : IBizRecibosProveedor);
|
||||
procedure Print(ARecibosProveedor : IBizRecibosProveedor);
|
||||
|
||||
function DarListaAnosRecibos: TStringList;
|
||||
procedure FiltrarAno(AREcibo: IBizRecibosProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TRecibosProveedorController = class(TObservador, IRecibosProveedorController)
|
||||
@ -132,6 +135,9 @@ type
|
||||
|
||||
procedure Preview(ARecibosProveedor : IBizRecibosProveedor);
|
||||
procedure Print(ARecibosProveedor : IBizRecibosProveedor);
|
||||
|
||||
function DarListaAnosRecibos: TStringList;
|
||||
procedure FiltrarAno(AREcibo: IBizRecibosProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -377,6 +383,11 @@ begin
|
||||
Result := Buscar(ID_NULO);
|
||||
end;
|
||||
|
||||
function TRecibosProveedorController.DarListaAnosRecibos: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
function TRecibosProveedorController.DarNuevaReferencia(ID_FACTURA: Integer; REFERENCIA: String): String;
|
||||
var
|
||||
ARecibosProveedor: IBizRecibosProveedor;
|
||||
@ -522,7 +533,10 @@ begin
|
||||
try
|
||||
CreateEditor('EditorRecibosProveedor', IEditorRecibosProveedor, AEditor);
|
||||
with AEditor do
|
||||
begin
|
||||
Controller := Self; //OJO ORDEN MUY IMPORTANTE
|
||||
RecibosProveedor := ARecibosProveedor;
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
@ -773,6 +787,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRecibosProveedorController.FiltrarAno(AREcibo: IBizRecibosProveedor; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
ARecibo.DataTable.Where.Clear;
|
||||
ARecibo.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las facturas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with ARecibo.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RecibosProveedorFECHA_EMISION, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RecibosProveedorFECHA_EMISION, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRecibosProveedorController.Preview(ARecibosProveedor: IBizRecibosProveedor);
|
||||
var
|
||||
AReportController : IRecibosProveedorReportController;
|
||||
|
||||
@ -66,7 +66,7 @@ object DataModuleRecibosProveedor: TDataModuleRecibosProveedor
|
||||
ProbeServers = False
|
||||
ProbeFrequency = 60000
|
||||
UserAgent = 'RemObjects SDK'
|
||||
TargetURL = 'http://localhost:8090/bin'
|
||||
TargetURL = 'http://localhost:8099/bin'
|
||||
Left = 48
|
||||
Top = 272
|
||||
end
|
||||
@ -1130,4 +1130,113 @@ object DataModuleRecibosProveedor: TDataModuleRecibosProveedor
|
||||
Left = 320
|
||||
Top = 256
|
||||
end
|
||||
object tbl_ListaAnosRecibos: 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 = 'ListaAnosRecibos'
|
||||
end>
|
||||
DataRequestCall.MethodName = 'GetDatasetDataEx'
|
||||
DataRequestCall.Params = <
|
||||
item
|
||||
Name = 'Result'
|
||||
ParamType = fResult
|
||||
DataType = rtBinary
|
||||
end
|
||||
item
|
||||
Name = 'DatasetName'
|
||||
ParamType = fIn
|
||||
DataType = rtString
|
||||
Value = 'ListaAnosRecibos'
|
||||
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 = 'ListaAnosRecibos'
|
||||
end>
|
||||
ReadOnly = False
|
||||
RemoteService = RORemoteService
|
||||
Adapter = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosRecibos'
|
||||
IndexDefs = <>
|
||||
Left = 168
|
||||
Top = 304
|
||||
end
|
||||
object ds_ListaAnosRecibos: TDADataSource
|
||||
DataTable = tbl_ListaAnosRecibos
|
||||
Left = 168
|
||||
Top = 248
|
||||
end
|
||||
end
|
||||
|
||||
@ -48,6 +48,8 @@ type
|
||||
ds_RecibosProveedor: TDADataSource;
|
||||
tbl_RecibosCompensadosProv: TDACDSDataTable;
|
||||
ds_RecibosCompensadosProv: TDADataSource;
|
||||
tbl_ListaAnosRecibos: TDACDSDataTable;
|
||||
ds_ListaAnosRecibos: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
protected
|
||||
function DarNombreGenerador(DataSetName: String): String; virtual;
|
||||
@ -61,6 +63,7 @@ type
|
||||
function NewItem : IBizRecibosProveedor;
|
||||
function GetReport(const ID: Integer): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -177,6 +180,30 @@ begin
|
||||
Result := GetItem(ID_NULO)
|
||||
end;
|
||||
|
||||
function TDataModuleRecibosProveedor.GetAnosItems: TStringList;
|
||||
var
|
||||
AListaAnos: TStringList;
|
||||
begin
|
||||
AListaAnos := TStringList.Create;
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
with tbl_ListaAnosRecibos 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;
|
||||
|
||||
function TDataModuleRecibosProveedor.GetItem(const ID: Integer): IBizRecibosProveedor;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -26,11 +26,12 @@ unit uIDataModuleRecibosProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizRecibosProveedor;
|
||||
Classes, uBizRecibosProveedor;
|
||||
|
||||
type
|
||||
IDataModuleRecibosProveedor = interface
|
||||
['{0EEAF672-1509-4695-90B0-0D6EBB81B6C5}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizRecibosProveedor;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
function GetItem(const ID : Integer) : IBizRecibosProveedor;
|
||||
|
||||
@ -9,17 +9,25 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_RecibosCompensadosProv = '{63570371-F94E-4DAD-A5D6-3615FADEBAD4}';
|
||||
RID_RecibosProveedor = '{01D52742-DC1E-482F-A9A8-772A8B7FD75D}';
|
||||
RID_RecibosProveedor_Refresh = '{5F724DAB-29AB-4E61-BDC2-C3F476CF30F0}';
|
||||
RID_PagosProveedor = '{6B536629-405F-46A8-9008-9871D317EE04}';
|
||||
RID_ListaAnosRecibos = '{FABFE323-72E1-4714-A4EB-63025727A2F3}';
|
||||
RID_RecibosCompensadosProv = '{2F2458FB-EB0A-4CDF-8289-C46BA178D6DA}';
|
||||
RID_RecibosProveedor = '{5A5DD4C8-CE95-4428-A09D-BE403CEEBB40}';
|
||||
RID_RecibosProveedor_Refresh = '{67465BB0-C8AB-4135-A7D8-2884BC3D40DA}';
|
||||
RID_PagosProveedor = '{BB4589D4-EF3B-4D95-8CDC-41DE2E8E856C}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosRecibos = 'ListaAnosRecibos';
|
||||
nme_RecibosCompensadosProv = 'RecibosCompensadosProv';
|
||||
nme_RecibosProveedor = 'RecibosProveedor';
|
||||
nme_RecibosProveedor_Refresh = 'RecibosProveedor_Refresh';
|
||||
nme_PagosProveedor = 'PagosProveedor';
|
||||
|
||||
{ ListaAnosRecibos fields }
|
||||
fld_ListaAnosRecibosANO = 'ANO';
|
||||
|
||||
{ ListaAnosRecibos field indexes }
|
||||
idx_ListaAnosRecibosANO = 0;
|
||||
|
||||
{ RecibosCompensadosProv fields }
|
||||
fld_RecibosCompensadosProvID = 'ID';
|
||||
fld_RecibosCompensadosProvID_RECIBO_COMPENSADO = 'ID_RECIBO_COMPENSADO';
|
||||
@ -217,9 +225,38 @@ const
|
||||
idx_PagosProveedorUSUARIO = 11;
|
||||
|
||||
type
|
||||
{ IListaAnosRecibos }
|
||||
IListaAnosRecibos = interface(IDAStronglyTypedDataTable)
|
||||
['{99555B42-5EAF-4BB2-BB1A-B2DD1BAA22EA}']
|
||||
{ Property getters and setters }
|
||||
function GetANOValue: String;
|
||||
procedure SetANOValue(const aValue: String);
|
||||
|
||||
|
||||
{ Properties }
|
||||
property ANO: String read GetANOValue write SetANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRecibosDataTableRules }
|
||||
TListaAnosRecibosDataTableRules = class(TDADataTableRules, IListaAnosRecibos)
|
||||
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;
|
||||
|
||||
{ IRecibosCompensadosProv }
|
||||
IRecibosCompensadosProv = interface(IDAStronglyTypedDataTable)
|
||||
['{A73311E9-6383-4A33-B880-1E50E74E7119}']
|
||||
['{B307BEAA-EBF5-4F4B-814D-BDB02BB63336}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -338,7 +375,7 @@ type
|
||||
|
||||
{ IRecibosProveedor }
|
||||
IRecibosProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{BBBE2FC9-D743-448A-A741-C9C1919A0618}']
|
||||
['{38664EF9-172A-4E7C-9195-5D3B63279533}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -547,7 +584,7 @@ type
|
||||
|
||||
{ IRecibosProveedor_Refresh }
|
||||
IRecibosProveedor_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{B98899CB-80FA-49C3-A650-463AEA8A49A6}']
|
||||
['{40DA5BFF-5A7E-468A-87E2-239FFF4AC7CF}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -756,7 +793,7 @@ type
|
||||
|
||||
{ IPagosProveedor }
|
||||
IPagosProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{81F0AAB6-D43A-4832-9A2F-D4F8C013F6FA}']
|
||||
['{381D94DF-9A80-48EE-9404-910096E811A9}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -853,6 +890,28 @@ implementation
|
||||
|
||||
uses Variants;
|
||||
|
||||
{ TListaAnosRecibosDataTableRules }
|
||||
constructor TListaAnosRecibosDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRecibosDataTableRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRecibosDataTableRules.GetANOValue: String;
|
||||
begin
|
||||
result := DataTable.Fields[idx_ListaAnosRecibosANO].AsString;
|
||||
end;
|
||||
|
||||
procedure TListaAnosRecibosDataTableRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
DataTable.Fields[idx_ListaAnosRecibosANO].AsString := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TRecibosCompensadosProvDataTableRules }
|
||||
constructor TRecibosCompensadosProvDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -1802,6 +1861,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosRecibos, TListaAnosRecibosDataTableRules);
|
||||
RegisterDataTableRules(RID_RecibosCompensadosProv, TRecibosCompensadosProvDataTableRules);
|
||||
RegisterDataTableRules(RID_RecibosProveedor, TRecibosProveedorDataTableRules);
|
||||
RegisterDataTableRules(RID_RecibosProveedor_Refresh, TRecibosProveedor_RefreshDataTableRules);
|
||||
|
||||
@ -9,15 +9,45 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_RecibosCompensadosProvDelta = '{BA2DCF11-7070-4929-857C-AB7731AF7924}';
|
||||
RID_RecibosProveedorDelta = '{4C7167E6-9FB3-46CC-9733-EDC6BB1778BA}';
|
||||
RID_RecibosProveedor_RefreshDelta = '{3C6253BF-134D-4B04-97C7-A02E2933935D}';
|
||||
RID_PagosProveedorDelta = '{1BDCAA45-F48F-47E8-947D-8D70E87FF7A3}';
|
||||
RID_ListaAnosRecibosDelta = '{BFF440E9-12BC-425B-8040-CBECEF5190CB}';
|
||||
RID_RecibosCompensadosProvDelta = '{016D5CE9-683B-4A12-8274-656BD000E183}';
|
||||
RID_RecibosProveedorDelta = '{FE478D0D-F8F0-4399-B6EC-12BED231E97D}';
|
||||
RID_RecibosProveedor_RefreshDelta = '{3B183AEE-00B6-4C9F-8D57-B9BA4A7939B2}';
|
||||
RID_PagosProveedorDelta = '{773645D4-A67B-4355-BD24-3AF6431F4FD9}';
|
||||
|
||||
type
|
||||
{ IListaAnosRecibosDelta }
|
||||
IListaAnosRecibosDelta = interface(IListaAnosRecibos)
|
||||
['{BFF440E9-12BC-425B-8040-CBECEF5190CB}']
|
||||
{ Property getters and setters }
|
||||
function GetOldANOValue : String;
|
||||
|
||||
{ Properties }
|
||||
property OldANO : String read GetOldANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRecibosBusinessProcessorRules }
|
||||
TListaAnosRecibosBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosRecibos, IListaAnosRecibosDelta)
|
||||
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;
|
||||
|
||||
{ IRecibosCompensadosProvDelta }
|
||||
IRecibosCompensadosProvDelta = interface(IRecibosCompensadosProv)
|
||||
['{BA2DCF11-7070-4929-857C-AB7731AF7924}']
|
||||
['{016D5CE9-683B-4A12-8274-656BD000E183}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||
@ -151,7 +181,7 @@ type
|
||||
|
||||
{ IRecibosProveedorDelta }
|
||||
IRecibosProveedorDelta = interface(IRecibosProveedor)
|
||||
['{4C7167E6-9FB3-46CC-9733-EDC6BB1778BA}']
|
||||
['{FE478D0D-F8F0-4399-B6EC-12BED231E97D}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||
@ -390,7 +420,7 @@ type
|
||||
|
||||
{ IRecibosProveedor_RefreshDelta }
|
||||
IRecibosProveedor_RefreshDelta = interface(IRecibosProveedor_Refresh)
|
||||
['{3C6253BF-134D-4B04-97C7-A02E2933935D}']
|
||||
['{3B183AEE-00B6-4C9F-8D57-B9BA4A7939B2}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBO_COMPENSADOValue : Integer;
|
||||
@ -629,7 +659,7 @@ type
|
||||
|
||||
{ IPagosProveedorDelta }
|
||||
IPagosProveedorDelta = interface(IPagosProveedor)
|
||||
['{1BDCAA45-F48F-47E8-947D-8D70E87FF7A3}']
|
||||
['{773645D4-A67B-4355-BD24-3AF6431F4FD9}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_RECIBOValue : Integer;
|
||||
@ -738,6 +768,33 @@ implementation
|
||||
uses
|
||||
Variants, uROBinaryHelpers;
|
||||
|
||||
{ TListaAnosRecibosBusinessProcessorRules }
|
||||
constructor TListaAnosRecibosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRecibosBusinessProcessorRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRecibosBusinessProcessorRules.GetANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRecibosANO];
|
||||
end;
|
||||
|
||||
function TListaAnosRecibosBusinessProcessorRules.GetOldANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosRecibosANO];
|
||||
end;
|
||||
|
||||
procedure TListaAnosRecibosBusinessProcessorRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRecibosANO] := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TRecibosCompensadosProvBusinessProcessorRules }
|
||||
constructor TRecibosCompensadosProvBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -2137,6 +2194,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosRecibosDelta, TListaAnosRecibosBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RecibosCompensadosProvDelta, TRecibosCompensadosProvBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RecibosProveedorDelta, TRecibosProveedorBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RecibosProveedor_RefreshDelta, TRecibosProveedor_RefreshBusinessProcessorRules);
|
||||
|
||||
@ -8,9 +8,7 @@
|
||||
<Option Name="GUID">{31F77077-B4B9-443C-9AA9-F13B4EB640B4}</Option>
|
||||
</Option>
|
||||
</PersonalityInfo>
|
||||
<Default.Personality>
|
||||
|
||||
<Projects>
|
||||
<Default.Personality> <Projects>
|
||||
<Projects Name="Base.bpl">..\..\Base\Base.bdsproj</Projects>
|
||||
<Projects Name="ControllerBase.bpl">..\..\Base\ControllerBase\ControllerBase.bdsproj</Projects>
|
||||
<Projects Name="GUIBase.bpl">..\..\Base\GUIBase\GUIBase.bdsproj</Projects>
|
||||
@ -29,7 +27,8 @@
|
||||
<Projects Name="RecibosProveedor_plugin.bpl">Plugin\RecibosProveedor_plugin.bdsproj</Projects>
|
||||
<Projects Name="FactuGES.exe">..\..\Cliente\FactuGES.bdsproj</Projects>
|
||||
<Projects Name="FactuGES_Server.exe">..\..\Servidor\FactuGES_Server.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_view.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl RecibosProveedor_model.bpl RecibosProveedor_data.bpl RecibosProveedor_controller.bpl RecibosProveedor_view.bpl RecibosProveedor_plugin.bpl FactuGES.exe FactuGES_Server.exe</Projects>
|
||||
<Projects Name="FacturasCliente_view.bpl">..\Facturas de cliente\Views\FacturasCliente_view.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_view.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl RecibosProveedor_model.bpl RecibosProveedor_data.bpl RecibosProveedor_controller.bpl RecibosProveedor_view.bpl RecibosProveedor_plugin.bpl FactuGES.exe FactuGES_Server.exe FacturasCliente_view.bpl</Projects>
|
||||
</Projects>
|
||||
<Dependencies/>
|
||||
</Default.Personality>
|
||||
|
||||
@ -15,6 +15,35 @@ object srvRecibosProveedor: TsrvRecibosProveedor
|
||||
ConnectionManager = dmServer.ConnectionManager
|
||||
DataDictionary = DADataDictionary
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_EMISION, 1,4)) as ' +
|
||||
'ANO'#10'from recibos_proveedor'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select d' +
|
||||
'istinct '#39'Todos'#39' as ANO'#10'from empresas'
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
Name = 'ListaAnosRecibos'
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -2,7 +2,6 @@ inherited fEditorRecibosProveedor: TfEditorRecibosProveedor
|
||||
Caption = 'Lista de recibos de proveedor'
|
||||
ClientHeight = 664
|
||||
ClientWidth = 638
|
||||
ExplicitTop = -173
|
||||
ExplicitWidth = 646
|
||||
ExplicitHeight = 691
|
||||
PixelsPerInch = 96
|
||||
@ -44,9 +43,25 @@ inherited fEditorRecibosProveedor: TfEditorRecibosProveedor
|
||||
inherited tbxMain: TTBXToolbar
|
||||
ExplicitWidth = 276
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 435
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 638
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 435
|
||||
ExplicitLeft = 435
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
Top = 645
|
||||
|
||||
@ -33,9 +33,9 @@ uses
|
||||
TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls,
|
||||
JvNavigationPane, uViewGrid, pngimage, JvComponentBase,
|
||||
JvExComCtrls, JvStatusBar, uViewBase, uViewBarraSeleccion, uViewGridBase,
|
||||
uEditorGridBase, uCustomView,
|
||||
|
||||
uBizRecibosProveedor, uIEditorRecibosProveedor, uRecibosProveedorController,
|
||||
uEditorGridBase, uCustomView,
|
||||
|
||||
uBizRecibosProveedor, uIEditorRecibosProveedor, uRecibosProveedorController,
|
||||
uViewRecibosProveedor;
|
||||
|
||||
type
|
||||
@ -43,12 +43,16 @@ type
|
||||
TfEditorRecibosProveedor = class(TfEditorGridBase, IEditorRecibosProveedor)
|
||||
frViewRecibosProveedor1: TfrViewRecibosProveedor;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
private
|
||||
FRecibosProveedor: IBizRecibosProveedor;
|
||||
FController : IRecibosProveedorController;
|
||||
|
||||
protected
|
||||
function GetRecibosProveedor: IBizRecibosProveedor;
|
||||
procedure SetRecibosProveedor(const Value: IBizRecibosProveedor);
|
||||
|
||||
function GetController : IRecibosProveedorController;
|
||||
procedure SetController (const Value : IRecibosProveedorController);
|
||||
|
||||
@ -58,6 +62,8 @@ type
|
||||
procedure DuplicarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
public
|
||||
procedure PonerTitulos(const ATitulo: string = ''); override;
|
||||
property RecibosProveedor: IBizRecibosProveedor read GetRecibosProveedor write SetRecibosProveedor;
|
||||
@ -105,6 +111,8 @@ end;
|
||||
|
||||
procedure TfEditorRecibosProveedor.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -145,6 +153,13 @@ begin
|
||||
//No se pueden añadir recibos nuevos
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosProveedor.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(RecibosProveedor, WhereDataTable, Text);
|
||||
if RecibosProveedor.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosProveedor.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -158,17 +173,37 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosProveedor.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de los recibos
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRecibos;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosProveedor.SetController(const Value: IRecibosProveedorController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRecibos;
|
||||
end;
|
||||
|
||||
procedure TfEditorRecibosProveedor.SetRecibosProveedor(const Value: IBizRecibosProveedor);
|
||||
begin
|
||||
FRecibosProveedor := Value;
|
||||
dsDataTable.DataTable := FRecibosProveedor.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRecibosProveedor).Recibos := FRecibosProveedor;
|
||||
|
||||
if Assigned(FRecibosProveedor) then
|
||||
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 := FRecibosProveedor.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FRecibosProveedor.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRecibosProveedor).Recibos := FRecibosProveedor;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -35,6 +35,9 @@ type
|
||||
|
||||
procedure RecuperarRecibos(ARemesaCliente: IBizRemesaCliente);
|
||||
function ExtraerSeleccionados(ARemesasCliente: IBizRemesaCliente; Const ViewGrid: IViewGridBase = Nil) : IBizRemesaCliente;
|
||||
|
||||
function DarListaAnosRemesas: TStringList;
|
||||
procedure FiltrarAno(ARemesa: IBizRemesaCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TRemesasClienteController = class(TObservador, IRemesasClienteController)
|
||||
@ -81,6 +84,9 @@ type
|
||||
function ExtraerSeleccionados(ARemesasCliente: IBizRemesaCliente; Const ViewGrid: IViewGridBase = Nil) : IBizRemesaCliente; virtual;
|
||||
function ElegirRecibosCliente(ARemesaCliente : IBizRemesaCliente): Boolean;
|
||||
procedure EliminarReciboCliente(ARemesaCliente : IBizRemesaCliente);
|
||||
|
||||
function DarListaAnosRemesas: TStringList;
|
||||
procedure FiltrarAno(ARemesa: IBizRemesaCliente; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -162,6 +168,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TRemesasClienteController.DarListaAnosRemesas: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TRemesasClienteController.DescartarCambios(ARemesaCliente: IBizRemesaCliente);
|
||||
begin
|
||||
if not Assigned(ARemesaCliente) then
|
||||
@ -467,6 +478,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRemesasClienteController.FiltrarAno(ARemesa: IBizRemesaCliente; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
ARemesa.DataTable.Where.Clear;
|
||||
ARemesa.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las remesas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with ARemesa.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RemesasClienteFECHA_REMESA, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RemesasClienteFECHA_REMESA, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRemesasClienteController.FiltrarEmpresa(ARemesaCliente: IBizRemesaCliente);
|
||||
begin
|
||||
if ARemesaCliente.DataTable.Active then
|
||||
|
||||
@ -423,4 +423,113 @@ object DataModuleRemesasCliente: TDataModuleRemesasCliente
|
||||
Left = 288
|
||||
Top = 88
|
||||
end
|
||||
object tbl_ListaAnosRemesas: 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 = 'ListaAnosRemesas'
|
||||
end>
|
||||
DataRequestCall.MethodName = 'GetDatasetDataEx'
|
||||
DataRequestCall.Params = <
|
||||
item
|
||||
Name = 'Result'
|
||||
ParamType = fResult
|
||||
DataType = rtBinary
|
||||
end
|
||||
item
|
||||
Name = 'DatasetName'
|
||||
ParamType = fIn
|
||||
DataType = rtString
|
||||
Value = 'ListaAnosRemesas'
|
||||
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 = 'ListaAnosRemesas'
|
||||
end>
|
||||
ReadOnly = False
|
||||
RemoteService = RORemoteService
|
||||
Adapter = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosRemesas'
|
||||
IndexDefs = <>
|
||||
Left = 176
|
||||
Top = 160
|
||||
end
|
||||
object ds_ListaAnosRemesas: TDADataSource
|
||||
DataTable = tbl_ListaAnosRemesas
|
||||
Left = 176
|
||||
Top = 88
|
||||
end
|
||||
end
|
||||
|
||||
@ -19,6 +19,8 @@ type
|
||||
ROBinMessage1: TROBinMessage;
|
||||
tbl_RemesasCliente: TDACDSDataTable;
|
||||
ds_RemesasCliente: TDADataSource;
|
||||
tbl_ListaAnosRemesas: TDACDSDataTable;
|
||||
ds_ListaAnosRemesas: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
|
||||
protected
|
||||
@ -33,6 +35,8 @@ type
|
||||
|
||||
// Report
|
||||
function GetReport(const ID: String): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -91,6 +95,30 @@ begin
|
||||
CloneDataTable(ADataTable, Result);
|
||||
end;
|
||||
|
||||
function TDataModuleRemesasCliente.GetAnosItems: TStringList;
|
||||
var
|
||||
AListaAnos: TStringList;
|
||||
begin
|
||||
AListaAnos := TStringList.Create;
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
with tbl_ListaAnosRemesas 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;
|
||||
|
||||
function TDataModuleRemesasCliente.GetItem(const ID: Integer): IBizRemesaCliente;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -3,11 +3,12 @@ unit uIDataModuleRemesasCliente;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizRemesasCliente;
|
||||
Classes, uBizRemesasCliente;
|
||||
|
||||
type
|
||||
IDataModuleRemesasCliente = interface
|
||||
['{9047C468-78DE-404E-9047-1125B382FE3B}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizRemesaCliente;
|
||||
function GetItem(const ID : Integer) : IBizRemesaCliente;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,15 +9,23 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_darReferencia = '{B51817C3-0E66-46C0-9913-CD22E47DEDCF}';
|
||||
RID_RemesasCliente = '{C58CD9F2-60DE-4E16-9EC6-0792C6FA4739}';
|
||||
RID_RemesasCliente_Refresh = '{565D1E0B-F210-4FBE-A49D-31D731D3D946}';
|
||||
RID_ListaAnosRemesas = '{C821D04E-EFDE-42BF-8F2B-99FD4FAF9547}';
|
||||
RID_darReferencia = '{B15925D1-0E5F-437A-BB81-1A66E3503BDE}';
|
||||
RID_RemesasCliente = '{10177270-8028-4076-A370-23B61F8AFA94}';
|
||||
RID_RemesasCliente_Refresh = '{7DB2286C-C11F-44F1-B2B2-CF55A0B760FF}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosRemesas = 'ListaAnosRemesas';
|
||||
nme_darReferencia = 'darReferencia';
|
||||
nme_RemesasCliente = 'RemesasCliente';
|
||||
nme_RemesasCliente_Refresh = 'RemesasCliente_Refresh';
|
||||
|
||||
{ ListaAnosRemesas fields }
|
||||
fld_ListaAnosRemesasANO = 'ANO';
|
||||
|
||||
{ ListaAnosRemesas field indexes }
|
||||
idx_ListaAnosRemesasANO = 0;
|
||||
|
||||
{ darReferencia fields }
|
||||
fld_darReferenciaVALOR = 'VALOR';
|
||||
|
||||
@ -109,9 +117,38 @@ const
|
||||
idx_RemesasCliente_RefreshSUFIJO_N58 = 18;
|
||||
|
||||
type
|
||||
{ IListaAnosRemesas }
|
||||
IListaAnosRemesas = interface(IDAStronglyTypedDataTable)
|
||||
['{87635282-9C38-46C3-94AF-677D38E12D01}']
|
||||
{ Property getters and setters }
|
||||
function GetANOValue: String;
|
||||
procedure SetANOValue(const aValue: String);
|
||||
|
||||
|
||||
{ Properties }
|
||||
property ANO: String read GetANOValue write SetANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRemesasDataTableRules }
|
||||
TListaAnosRemesasDataTableRules = class(TDADataTableRules, IListaAnosRemesas)
|
||||
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;
|
||||
|
||||
{ IdarReferencia }
|
||||
IdarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{63DE6705-0083-4EB0-A969-D0A7EA49C2D3}']
|
||||
['{68E16B74-99A8-473F-81FC-9D35481D444A}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -140,7 +177,7 @@ type
|
||||
|
||||
{ IRemesasCliente }
|
||||
IRemesasCliente = interface(IDAStronglyTypedDataTable)
|
||||
['{8069DEA4-13BC-4DDC-8280-C385C6FEA141}']
|
||||
['{5B2D5FF2-7A89-433D-96F6-196E16620625}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -277,7 +314,7 @@ type
|
||||
|
||||
{ IRemesasCliente_Refresh }
|
||||
IRemesasCliente_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{70773417-03B3-44E1-BE83-EC8D300A2E34}']
|
||||
['{96877B1C-EA17-46B5-A8A4-51BEF5B2D4E4}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -416,6 +453,28 @@ implementation
|
||||
|
||||
uses Variants;
|
||||
|
||||
{ TListaAnosRemesasDataTableRules }
|
||||
constructor TListaAnosRemesasDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRemesasDataTableRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRemesasDataTableRules.GetANOValue: String;
|
||||
begin
|
||||
result := DataTable.Fields[idx_ListaAnosRemesasANO].AsString;
|
||||
end;
|
||||
|
||||
procedure TListaAnosRemesasDataTableRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
DataTable.Fields[idx_ListaAnosRemesasANO].AsString := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TdarReferenciaDataTableRules }
|
||||
constructor TdarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -843,6 +902,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosRemesas, TListaAnosRemesasDataTableRules);
|
||||
RegisterDataTableRules(RID_darReferencia, TdarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_RemesasCliente, TRemesasClienteDataTableRules);
|
||||
RegisterDataTableRules(RID_RemesasCliente_Refresh, TRemesasCliente_RefreshDataTableRules);
|
||||
|
||||
@ -9,14 +9,44 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_darReferenciaDelta = '{A22BAD63-61D2-4A59-B8D5-75E81DA5DC76}';
|
||||
RID_RemesasClienteDelta = '{9092926B-D466-4D6C-A6BF-5446307DF549}';
|
||||
RID_RemesasCliente_RefreshDelta = '{BA819617-6407-45A8-A07F-3EBEE792DED6}';
|
||||
RID_ListaAnosRemesasDelta = '{27FFB589-C200-4B87-9E63-02E33044F952}';
|
||||
RID_darReferenciaDelta = '{B841812F-0D02-4C8E-931B-A31251CBB6E0}';
|
||||
RID_RemesasClienteDelta = '{2081F08D-A611-495B-9003-96A9CF4CA182}';
|
||||
RID_RemesasCliente_RefreshDelta = '{A171C918-A8E4-43F4-9D3E-36EF727AACB6}';
|
||||
|
||||
type
|
||||
{ IListaAnosRemesasDelta }
|
||||
IListaAnosRemesasDelta = interface(IListaAnosRemesas)
|
||||
['{27FFB589-C200-4B87-9E63-02E33044F952}']
|
||||
{ Property getters and setters }
|
||||
function GetOldANOValue : String;
|
||||
|
||||
{ Properties }
|
||||
property OldANO : String read GetOldANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRemesasBusinessProcessorRules }
|
||||
TListaAnosRemesasBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosRemesas, IListaAnosRemesasDelta)
|
||||
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;
|
||||
|
||||
{ IdarReferenciaDelta }
|
||||
IdarReferenciaDelta = interface(IdarReferencia)
|
||||
['{A22BAD63-61D2-4A59-B8D5-75E81DA5DC76}']
|
||||
['{B841812F-0D02-4C8E-931B-A31251CBB6E0}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -45,7 +75,7 @@ type
|
||||
|
||||
{ IRemesasClienteDelta }
|
||||
IRemesasClienteDelta = interface(IRemesasCliente)
|
||||
['{9092926B-D466-4D6C-A6BF-5446307DF549}']
|
||||
['{2081F08D-A611-495B-9003-96A9CF4CA182}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -200,7 +230,7 @@ type
|
||||
|
||||
{ IRemesasCliente_RefreshDelta }
|
||||
IRemesasCliente_RefreshDelta = interface(IRemesasCliente_Refresh)
|
||||
['{BA819617-6407-45A8-A07F-3EBEE792DED6}']
|
||||
['{A171C918-A8E4-43F4-9D3E-36EF727AACB6}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -358,6 +388,33 @@ implementation
|
||||
uses
|
||||
Variants, uROBinaryHelpers;
|
||||
|
||||
{ TListaAnosRemesasBusinessProcessorRules }
|
||||
constructor TListaAnosRemesasBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRemesasBusinessProcessorRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRemesasBusinessProcessorRules.GetANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRemesasANO];
|
||||
end;
|
||||
|
||||
function TListaAnosRemesasBusinessProcessorRules.GetOldANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosRemesasANO];
|
||||
end;
|
||||
|
||||
procedure TListaAnosRemesasBusinessProcessorRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRemesasANO] := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TdarReferenciaBusinessProcessorRules }
|
||||
constructor TdarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -980,6 +1037,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosRemesasDelta, TListaAnosRemesasBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_darReferenciaDelta, TdarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RemesasClienteDelta, TRemesasClienteBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RemesasCliente_RefreshDelta, TRemesasCliente_RefreshBusinessProcessorRules);
|
||||
|
||||
@ -190,6 +190,35 @@ object srvRemesasCliente: TsrvRemesasCliente
|
||||
DataDictionary = DataDictionary
|
||||
Diagrams = Diagrams
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_REMESA, 1,4)) as A' +
|
||||
'NO'#10'from remesas_cliente'#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 = <>
|
||||
end>
|
||||
Name = 'ListaAnosRemesas'
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -50,7 +50,16 @@ inherited fEditorRemesasCliente: TfEditorRemesasCliente
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 269
|
||||
ExplicitWidth = 363
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
inherited tbxEditFiltro: TTBXEditItem
|
||||
EditOptions = [tboUseEditWhenVertical]
|
||||
end
|
||||
@ -68,9 +77,9 @@ inherited fEditorRemesasCliente: TfEditorRemesasCliente
|
||||
end
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 269
|
||||
Left = 363
|
||||
DockPos = 267
|
||||
ExplicitLeft = 269
|
||||
ExplicitLeft = 363
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
|
||||
@ -28,12 +28,15 @@ type
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure actVolcarDiscoExecute(Sender: TObject);
|
||||
procedure actVolcarDiscoUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
private
|
||||
FRemesasCliente: IBizRemesaCliente;
|
||||
FController : IRemesasClienteController;
|
||||
protected
|
||||
function GetRemesasCliente: IBizRemesaCliente;
|
||||
procedure SetRemesasCliente(const Value: IBizRemesaCliente);
|
||||
|
||||
function GetController : IRemesasClienteController; virtual;
|
||||
procedure SetController (const Value : IRemesasClienteController); virtual;
|
||||
|
||||
@ -42,7 +45,7 @@ type
|
||||
procedure ModificarInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
//Si queremos crear otra vista para el editor heredado solo tendriamos que
|
||||
//sobreescribir este metodo
|
||||
@ -72,6 +75,8 @@ uses
|
||||
}
|
||||
procedure TfEditorRemesasCliente.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -149,6 +154,13 @@ begin
|
||||
FController.Ver(RemesasCliente);
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasCliente.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(RemesasCliente, WhereDataTable, Text);
|
||||
if RemesasCliente.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasCliente.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -198,17 +210,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasCliente.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las facturas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRemesas;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasCliente.SetRemesasCliente(const Value: IBizRemesaCliente);
|
||||
begin
|
||||
FRemesasCliente := Value;
|
||||
dsDataTable.DataTable := FRemesasCliente.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRemesasCliente).RemesasCliente := RemesasCliente;
|
||||
|
||||
if Assigned(FRemesasCliente) then
|
||||
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 := FRemesasCliente.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FRemesasCliente.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRemesasCliente).RemesasCliente := RemesasCliente;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasCliente.SetController(const Value: IRemesasClienteController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRemesas;
|
||||
end;
|
||||
|
||||
destructor TfEditorRemesasCliente.Destroy;
|
||||
|
||||
@ -35,6 +35,9 @@ type
|
||||
|
||||
procedure RecuperarRecibos(ARemesaProveedor: IBizRemesaProveedor);
|
||||
function ExtraerSeleccionados(ARemesasProveedor: IBizRemesaProveedor; Const ViewGrid: IViewGridBase = Nil) : IBizRemesaProveedor;
|
||||
|
||||
function DarListaAnosRemesas: TStringList;
|
||||
procedure FiltrarAno(ARemesa: IBizRemesaProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
TRemesasProveedorController = class(TObservador, IRemesasProveedorController)
|
||||
@ -81,6 +84,9 @@ type
|
||||
function ExtraerSeleccionados(ARemesasProveedor: IBizRemesaProveedor; Const ViewGrid: IViewGridBase = Nil) : IBizRemesaProveedor; virtual;
|
||||
function ElegirRecibosProveedor(ARemesaProveedor : IBizRemesaProveedor): Boolean;
|
||||
procedure EliminarReciboProveedor(ARemesaProveedor : IBizRemesaProveedor);
|
||||
|
||||
function DarListaAnosRemesas: TStringList;
|
||||
procedure FiltrarAno(ARemesa: IBizRemesaProveedor; AWhereDataTable: String; const Ano: String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -162,6 +168,11 @@ begin
|
||||
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
|
||||
end;
|
||||
|
||||
function TRemesasProveedorController.DarListaAnosRemesas: TStringList;
|
||||
begin
|
||||
Result := FDataModule.GetAnosItems;
|
||||
end;
|
||||
|
||||
procedure TRemesasProveedorController.DescartarCambios(ARemesaProveedor: IBizRemesaProveedor);
|
||||
begin
|
||||
if not Assigned(ARemesaProveedor) then
|
||||
@ -467,6 +478,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRemesasProveedorController.FiltrarAno(ARemesa: IBizRemesaProveedor; AWhereDataTable: String; const Ano: String);
|
||||
var
|
||||
FechaIni: String;
|
||||
FechaFin: String;
|
||||
|
||||
begin
|
||||
ARemesa.DataTable.Where.Clear;
|
||||
ARemesa.DataTable.Where.AddText(AWhereDataTable);
|
||||
|
||||
if (Ano <> 'Todos') then
|
||||
begin
|
||||
// Filtrar las remesas actuales por empresa
|
||||
FechaIni := '01.01.' + Ano;
|
||||
FechaFin := '31.12.' + Ano;
|
||||
with ARemesa.DataTable.Where do
|
||||
begin
|
||||
if NotEmpty then
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RemesasProveedorFECHA_REMESA, cMajorOrEqual, FechaIni);
|
||||
AddOperator(opAND);
|
||||
AddCondition(fld_RemesasProveedorFECHA_REMESA, cLessOrEqual, FechaFin);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRemesasProveedorController.FiltrarEmpresa(ARemesaProveedor: IBizRemesaProveedor);
|
||||
begin
|
||||
if ARemesaProveedor.DataTable.Active then
|
||||
|
||||
@ -421,4 +421,113 @@ object DataModuleRemesasProveedor: TDataModuleRemesasProveedor
|
||||
Left = 272
|
||||
Top = 96
|
||||
end
|
||||
object tbl_ListaAnosRemesas: 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 = 'ListaAnosRemesas'
|
||||
end>
|
||||
DataRequestCall.MethodName = 'GetDatasetDataEx'
|
||||
DataRequestCall.Params = <
|
||||
item
|
||||
Name = 'Result'
|
||||
ParamType = fResult
|
||||
DataType = rtBinary
|
||||
end
|
||||
item
|
||||
Name = 'DatasetName'
|
||||
ParamType = fIn
|
||||
DataType = rtString
|
||||
Value = 'ListaAnosRemesas'
|
||||
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 = 'ListaAnosRemesas'
|
||||
end>
|
||||
ReadOnly = False
|
||||
RemoteService = RORemoteService
|
||||
Adapter = DABinAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'ListaAnosRemesas'
|
||||
IndexDefs = <>
|
||||
Left = 152
|
||||
Top = 160
|
||||
end
|
||||
object ds_ListaAnosRemesas: TDADataSource
|
||||
DataTable = tbl_ListaAnosRemesas
|
||||
Left = 152
|
||||
Top = 96
|
||||
end
|
||||
end
|
||||
|
||||
@ -19,6 +19,8 @@ type
|
||||
ROBinMessage1: TROBinMessage;
|
||||
tbl_RemesasProveedor: TDACDSDataTable;
|
||||
ds_RemesasProveedor: TDADataSource;
|
||||
tbl_ListaAnosRemesas: TDACDSDataTable;
|
||||
ds_ListaAnosRemesas: TDADataSource;
|
||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||
|
||||
protected
|
||||
@ -33,6 +35,8 @@ type
|
||||
|
||||
// Report
|
||||
function GetReport(const ID: String): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -91,6 +95,30 @@ begin
|
||||
CloneDataTable(ADataTable, Result);
|
||||
end;
|
||||
|
||||
function TDataModuleRemesasProveedor.GetAnosItems: TStringList;
|
||||
var
|
||||
AListaAnos: TStringList;
|
||||
begin
|
||||
AListaAnos := TStringList.Create;
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
with tbl_ListaAnosRemesas 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;
|
||||
|
||||
function TDataModuleRemesasProveedor.GetItem(const ID: Integer): IBizRemesaProveedor;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
|
||||
@ -3,11 +3,12 @@ unit uIDataModuleRemesasProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizRemesasProveedor;
|
||||
Classes, uBizRemesasProveedor;
|
||||
|
||||
type
|
||||
IDataModuleRemesasProveedor = interface
|
||||
['{6073E44A-0B61-4D26-BCDE-33150D88C91B}']
|
||||
function GetAnosItems : TStringList;
|
||||
function GetItems: IBizRemesaProveedor;
|
||||
function GetItem(const ID : Integer) : IBizRemesaProveedor;
|
||||
function GetNextID(const DataSetName : String) : Integer;
|
||||
|
||||
@ -9,15 +9,23 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_darReferencia = '{C46DD694-0C93-4DC1-806C-761CB55A3E78}';
|
||||
RID_RemesasProveedor = '{D4F4C043-452C-4C78-AC2A-2BFED8440BB3}';
|
||||
RID_RemesasProveedor_Refresh = '{423CFB65-3863-4ADA-B9B3-318A7C13A13D}';
|
||||
RID_ListaAnosRemesas = '{25DE85B4-DA4E-4DA7-ACC0-960EC1B035C5}';
|
||||
RID_darReferencia = '{5181C1C2-7262-4AE3-8F53-785C9B2333EE}';
|
||||
RID_RemesasProveedor = '{45E53708-C9B3-493F-A7E5-07E44D1E3B40}';
|
||||
RID_RemesasProveedor_Refresh = '{CD0FFFE0-5E3E-437B-83A9-D5AFAEB972DE}';
|
||||
|
||||
{ Data table names }
|
||||
nme_ListaAnosRemesas = 'ListaAnosRemesas';
|
||||
nme_darReferencia = 'darReferencia';
|
||||
nme_RemesasProveedor = 'RemesasProveedor';
|
||||
nme_RemesasProveedor_Refresh = 'RemesasProveedor_Refresh';
|
||||
|
||||
{ ListaAnosRemesas fields }
|
||||
fld_ListaAnosRemesasANO = 'ANO';
|
||||
|
||||
{ ListaAnosRemesas field indexes }
|
||||
idx_ListaAnosRemesasANO = 0;
|
||||
|
||||
{ darReferencia fields }
|
||||
fld_darReferenciaVALOR = 'VALOR';
|
||||
|
||||
@ -109,9 +117,38 @@ const
|
||||
idx_RemesasProveedor_RefreshSUFIJO_N58 = 18;
|
||||
|
||||
type
|
||||
{ IListaAnosRemesas }
|
||||
IListaAnosRemesas = interface(IDAStronglyTypedDataTable)
|
||||
['{C6918980-686B-43C9-ADD9-24F2869D2548}']
|
||||
{ Property getters and setters }
|
||||
function GetANOValue: String;
|
||||
procedure SetANOValue(const aValue: String);
|
||||
|
||||
|
||||
{ Properties }
|
||||
property ANO: String read GetANOValue write SetANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRemesasDataTableRules }
|
||||
TListaAnosRemesasDataTableRules = class(TDADataTableRules, IListaAnosRemesas)
|
||||
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;
|
||||
|
||||
{ IdarReferencia }
|
||||
IdarReferencia = interface(IDAStronglyTypedDataTable)
|
||||
['{BCC59268-E9D7-4AFD-8FED-205F17C495DC}']
|
||||
['{58F7E4B9-122E-4B0E-A8FC-2250E8DFE0F3}']
|
||||
{ Property getters and setters }
|
||||
function GetVALORValue: String;
|
||||
procedure SetVALORValue(const aValue: String);
|
||||
@ -140,7 +177,7 @@ type
|
||||
|
||||
{ IRemesasProveedor }
|
||||
IRemesasProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{1EC2C43E-91B7-4DB1-B5B8-DA5D4F579C1E}']
|
||||
['{12BC2EC9-3D9C-40C6-A8C6-81808D261864}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -277,7 +314,7 @@ type
|
||||
|
||||
{ IRemesasProveedor_Refresh }
|
||||
IRemesasProveedor_Refresh = interface(IDAStronglyTypedDataTable)
|
||||
['{2A8FF214-38C0-48F1-B20F-952E755DDCF9}']
|
||||
['{43F4455C-1139-452D-8D91-7B9011C927E1}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -416,6 +453,28 @@ implementation
|
||||
|
||||
uses Variants;
|
||||
|
||||
{ TListaAnosRemesasDataTableRules }
|
||||
constructor TListaAnosRemesasDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRemesasDataTableRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRemesasDataTableRules.GetANOValue: String;
|
||||
begin
|
||||
result := DataTable.Fields[idx_ListaAnosRemesasANO].AsString;
|
||||
end;
|
||||
|
||||
procedure TListaAnosRemesasDataTableRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
DataTable.Fields[idx_ListaAnosRemesasANO].AsString := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TdarReferenciaDataTableRules }
|
||||
constructor TdarReferenciaDataTableRules.Create(aDataTable: TDADataTable);
|
||||
begin
|
||||
@ -843,6 +902,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterDataTableRules(RID_ListaAnosRemesas, TListaAnosRemesasDataTableRules);
|
||||
RegisterDataTableRules(RID_darReferencia, TdarReferenciaDataTableRules);
|
||||
RegisterDataTableRules(RID_RemesasProveedor, TRemesasProveedorDataTableRules);
|
||||
RegisterDataTableRules(RID_RemesasProveedor_Refresh, TRemesasProveedor_RefreshDataTableRules);
|
||||
|
||||
@ -9,14 +9,44 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_darReferenciaDelta = '{144B45A9-6550-4495-B484-6F00D72EE60B}';
|
||||
RID_RemesasProveedorDelta = '{0847F13C-BE25-4D9C-900C-846F8E6879E1}';
|
||||
RID_RemesasProveedor_RefreshDelta = '{37A3A546-CFF5-4D40-A35B-5E2544E59472}';
|
||||
RID_ListaAnosRemesasDelta = '{332B5E0D-C5DD-41C5-A1FD-CD4D650B98C3}';
|
||||
RID_darReferenciaDelta = '{13C48250-38D1-4E4D-B718-17A1F1067E24}';
|
||||
RID_RemesasProveedorDelta = '{04481F3E-D933-4486-A71F-E0CDEADFB4B1}';
|
||||
RID_RemesasProveedor_RefreshDelta = '{BC664756-CB71-4EE1-8F61-56371F5B8D7F}';
|
||||
|
||||
type
|
||||
{ IListaAnosRemesasDelta }
|
||||
IListaAnosRemesasDelta = interface(IListaAnosRemesas)
|
||||
['{332B5E0D-C5DD-41C5-A1FD-CD4D650B98C3}']
|
||||
{ Property getters and setters }
|
||||
function GetOldANOValue : String;
|
||||
|
||||
{ Properties }
|
||||
property OldANO : String read GetOldANOValue;
|
||||
end;
|
||||
|
||||
{ TListaAnosRemesasBusinessProcessorRules }
|
||||
TListaAnosRemesasBusinessProcessorRules = class(TDABusinessProcessorRules, IListaAnosRemesas, IListaAnosRemesasDelta)
|
||||
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;
|
||||
|
||||
{ IdarReferenciaDelta }
|
||||
IdarReferenciaDelta = interface(IdarReferencia)
|
||||
['{144B45A9-6550-4495-B484-6F00D72EE60B}']
|
||||
['{13C48250-38D1-4E4D-B718-17A1F1067E24}']
|
||||
{ Property getters and setters }
|
||||
function GetOldVALORValue : String;
|
||||
|
||||
@ -45,7 +75,7 @@ type
|
||||
|
||||
{ IRemesasProveedorDelta }
|
||||
IRemesasProveedorDelta = interface(IRemesasProveedor)
|
||||
['{0847F13C-BE25-4D9C-900C-846F8E6879E1}']
|
||||
['{04481F3E-D933-4486-A71F-E0CDEADFB4B1}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -200,7 +230,7 @@ type
|
||||
|
||||
{ IRemesasProveedor_RefreshDelta }
|
||||
IRemesasProveedor_RefreshDelta = interface(IRemesasProveedor_Refresh)
|
||||
['{37A3A546-CFF5-4D40-A35B-5E2544E59472}']
|
||||
['{BC664756-CB71-4EE1-8F61-56371F5B8D7F}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -358,6 +388,33 @@ implementation
|
||||
uses
|
||||
Variants, uROBinaryHelpers;
|
||||
|
||||
{ TListaAnosRemesasBusinessProcessorRules }
|
||||
constructor TListaAnosRemesasBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
destructor TListaAnosRemesasBusinessProcessorRules.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListaAnosRemesasBusinessProcessorRules.GetANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRemesasANO];
|
||||
end;
|
||||
|
||||
function TListaAnosRemesasBusinessProcessorRules.GetOldANOValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_ListaAnosRemesasANO];
|
||||
end;
|
||||
|
||||
procedure TListaAnosRemesasBusinessProcessorRules.SetANOValue(const aValue: String);
|
||||
begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_ListaAnosRemesasANO] := aValue;
|
||||
end;
|
||||
|
||||
|
||||
{ TdarReferenciaBusinessProcessorRules }
|
||||
constructor TdarReferenciaBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
begin
|
||||
@ -980,6 +1037,7 @@ end;
|
||||
|
||||
|
||||
initialization
|
||||
RegisterBusinessProcessorRules(RID_ListaAnosRemesasDelta, TListaAnosRemesasBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_darReferenciaDelta, TdarReferenciaBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RemesasProveedorDelta, TRemesasProveedorBusinessProcessorRules);
|
||||
RegisterBusinessProcessorRules(RID_RemesasProveedor_RefreshDelta, TRemesasProveedor_RefreshBusinessProcessorRules);
|
||||
|
||||
@ -190,6 +190,35 @@ object srvRemesasProveedor: TsrvRemesasProveedor
|
||||
DataDictionary = DataDictionary
|
||||
Diagrams = Diagrams
|
||||
Datasets = <
|
||||
item
|
||||
Params = <>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
SQL =
|
||||
'select ANO from'#10'(select distinct(substr(FECHA_REMESA, 1,4)) as A' +
|
||||
'NO'#10'from remesas_proveedor'#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 = <>
|
||||
end>
|
||||
Name = 'ListaAnosRemesas'
|
||||
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
|
||||
Params = <
|
||||
item
|
||||
|
||||
@ -4,7 +4,6 @@ inherited fEditorRemesasProveedor: TfEditorRemesasProveedor
|
||||
Caption = 'Lista de remesas de pago'
|
||||
ClientWidth = 820
|
||||
ExplicitWidth = 828
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
@ -49,7 +48,16 @@ inherited fEditorRemesasProveedor: TfEditorRemesasProveedor
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
ExplicitWidth = 269
|
||||
ExplicitWidth = 363
|
||||
inherited lblAno: TTBXLabelItem
|
||||
Visible = True
|
||||
end
|
||||
inherited cbxListaAnos: TTBXComboBoxItem
|
||||
Visible = True
|
||||
end
|
||||
inherited sepAno: TTBXSeparatorItem
|
||||
Visible = True
|
||||
end
|
||||
inherited tbxEditFiltro: TTBXEditItem
|
||||
EditOptions = [tboUseEditWhenVertical]
|
||||
end
|
||||
@ -67,8 +75,8 @@ inherited fEditorRemesasProveedor: TfEditorRemesasProveedor
|
||||
end
|
||||
end
|
||||
inherited TBXTMain2: TTBXToolbar
|
||||
Left = 334
|
||||
ExplicitLeft = 334
|
||||
Left = 363
|
||||
ExplicitLeft = 363
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
|
||||
@ -28,12 +28,16 @@ type
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure actVolcarDiscoExecute(Sender: TObject);
|
||||
procedure actVolcarDiscoUpdate(Sender: TObject);
|
||||
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
|
||||
private
|
||||
FRemesasProveedor: IBizRemesaProveedor;
|
||||
FController : IRemesasProveedorController;
|
||||
|
||||
protected
|
||||
function GetRemesasProveedor: IBizRemesaProveedor;
|
||||
procedure SetRemesasProveedor(const Value: IBizRemesaProveedor);
|
||||
|
||||
function GetController : IRemesasProveedorController; virtual;
|
||||
procedure SetController (const Value : IRemesasProveedorController); virtual;
|
||||
|
||||
@ -42,7 +46,7 @@ type
|
||||
procedure ModificarInterno; override;
|
||||
procedure PrevisualizarInterno; override;
|
||||
procedure ImprimirInterno; override;
|
||||
|
||||
procedure RefrescarInterno; override;
|
||||
|
||||
//Si queremos crear otra vista para el editor heredado solo tendriamos que
|
||||
//sobreescribir este metodo
|
||||
@ -72,6 +76,8 @@ uses
|
||||
}
|
||||
procedure TfEditorRemesasProveedor.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
|
||||
|
||||
inherited;
|
||||
|
||||
if not Assigned(ViewGrid) then
|
||||
@ -149,6 +155,13 @@ begin
|
||||
FController.Ver(RemesasProveedor);
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasProveedor.OnListaAnosChange(Sender: TObject; const Text: string);
|
||||
begin
|
||||
Controller.FiltrarAno(RemesasProveedor, WhereDataTable, Text);
|
||||
if RemesasProveedor.DataTable.Active then
|
||||
RefrescarInterno;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasProveedor.PonerTitulos(const ATitulo: string);
|
||||
var
|
||||
FTitulo : String;
|
||||
@ -198,17 +211,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasProveedor.RefrescarInterno;
|
||||
begin
|
||||
//Volvemos a cargar los años de las remesas
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRemesas;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasProveedor.SetRemesasProveedor(const Value: IBizRemesaProveedor);
|
||||
begin
|
||||
FRemesasProveedor := Value;
|
||||
dsDataTable.DataTable := FRemesasProveedor.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRemesasProveedor).RemesasProveedor := RemesasProveedor;
|
||||
|
||||
if Assigned(FRemesasProveedor) then
|
||||
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 := FRemesasProveedor.DataTable.Where.Clause;
|
||||
|
||||
dsDataTable.DataTable := FRemesasProveedor.DataTable;
|
||||
if Assigned(ViewGrid) then
|
||||
(ViewGrid as IViewRemesasProveedor).RemesasProveedor := RemesasProveedor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorRemesasProveedor.SetController(const Value: IRemesasProveedorController);
|
||||
begin
|
||||
FController := Value;
|
||||
|
||||
if Assigned(FController) then
|
||||
ListaAnos := FController.DarListaAnosRemesas;
|
||||
end;
|
||||
|
||||
destructor TfEditorRemesasProveedor.Destroy;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user