diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dcu b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dcu new file mode 100644 index 00000000..66dca687 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dcu differ diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk new file mode 100644 index 00000000..4bcca8e3 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk differ diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj new file mode 100644 index 00000000..531f8b78 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj @@ -0,0 +1,581 @@ + + + + {276cb891-ed7d-4234-bff6-f7ffd1682ac9} + GestorInformes_controller.dpk + Debug + AnyCPU + DCC32 + ..\..\..\..\Output\Debug\Cliente\GestorInformes_controller.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + ..\..\..\..\Output\Debug\Cliente + .\ + .\ + .\ + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\Lib + + + Delphi.Personality + Package + + + False + True + False + + + False + False + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + GestorInformes_controller.dpk + + + + + + + MainSource + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.identcache b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.identcache new file mode 100644 index 00000000..aa5a7f05 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.identcache differ diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.rc b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res new file mode 100644 index 00000000..8b251f31 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res differ diff --git a/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.dcu b/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.dcu new file mode 100644 index 00000000..f93059d1 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.dcu differ diff --git a/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.pas b/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.pas new file mode 100644 index 00000000..2ce7fc8c --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.pas @@ -0,0 +1,26 @@ +unit uIEditorGestorInformesReport; + +interface + +uses + FactuGES_Intf, uEditorPreview; + +type + IEditorGestorInformesReport = interface(IEditorPreview) + ['{22B97B8E-04B8-4439-965B-D4AF8216DCEA}'] + function GetFechaFin: TDateTime; + function GetFechaInicio: TDateTime; + function GetListaIDClientes: TIntegerArray; + function GetDesglosadoCliente: Boolean; + function GetImporteMinimo: Currency; + property FechaInicio: TDateTime read GetFechaInicio; + property FechaFin: TDateTime read GetFechaFin; + property ListaIDClientes: TIntegerArray read GetListaIDClientes; + property DesglosadoCliente: Boolean read GetDesglosadoCliente; + property ImporteMinimo: Currency read getImporteMinimo; + end; + + +implementation + +end. diff --git a/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.pas.bak b/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.pas.bak new file mode 100644 index 00000000..97fe3df0 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/View/uIEditorGestorInformesReport.pas.bak @@ -0,0 +1,16 @@ +unit uIEditorFacturasClientePreview; + +interface + +uses + uEditorPreview, uBizFacturasCliente, uFacturasClienteReportController; + +type + IEditorFacturasClientePreview = interface(IEditorPreview) + ['{0B893ED1-261A-4358-814E-18D7FD768E14}'] + end; + + +implementation + +end. diff --git a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.dcu b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.dcu new file mode 100644 index 00000000..967e0efe Binary files /dev/null and b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.dcu differ diff --git a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas new file mode 100644 index 00000000..7aed2fd8 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas @@ -0,0 +1,426 @@ +unit uGestorInformesController; + +interface + + +uses + Classes, SysUtils, uDADataTable, uControllerBase, uIDataModuleGestorInformes; + +type + IGestorInformesController = interface(IControllerBase) + ['{5A556B66-AF8F-46F7-B12E-B8336CE07F6D}'] + function GetDataModule: IDataModuleGestorInformes; + property DataModule: IDataModuleGestorInformes read GetDataModule; +// procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false); +// procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false); + procedure GetInformeIVAClientes; + end; + + TGestorInformesController = class(TControllerBase, IGestorInformesController) + private + FDataModule : IDataModuleGestorInformes; + + function CreateEditor(const AName : String; const IID: TGUID; out Intf): Boolean; + function GetDataModule: IDataModuleGestorInformes; + +// procedure FiltrarEmpresa(AFactura: IBizFacturaCliente); + + public + constructor Create; override; + destructor Destroy; override; +{ + function Buscar(const ID: Integer): IBizFacturaCliente; + function BuscarTodos: IBizFacturaCliente; + function BuscarTodasPendientesComision(IdAgente: Integer; IdComision: Integer; IdFacturasAsociadas: String): IBizFacturaCliente; + procedure Ver(AFactura : IBizFacturaCliente); + procedure VerTodos(AFacturas: IBizFacturaCliente); + + procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false); + procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false); +} + property DataModule: IDataModuleGestorInformes read GetDataModule; + procedure GetInformeIVAClientes; + + + end; + +implementation + +uses + Windows, Controls, cxControls, DB, uEditorRegistryUtils, uFactuGES_App, + uDAInterfaces, uDataTableUtils, uDateUtils, uNumUtils, + uROTypes, DateUtils, Forms, uIntegerListUtils, uDataModuleGestorInformes, + uSistemaFunc, uDialogElegirEMail, uEMailUtils, Dialogs, uIEditorGestorInformesReport; + + +{procedure CopiarArticulosPedido(AOrigen: IBizDetallesPedidoCliente; + ADestino : IBizDetallesFacturaCliente); +var + i : integer; + ADetallesController : IDetallesFacturaClienteController; +begin + if not Assigned(AOrigen) then + raise Exception.Create ('Origen no asignado (CopiarArticulosPedido)'); + + if not Assigned(ADestino) then + raise Exception.Create ('Destino no asignado (CopiarArticulosPedido)'); + + if not AOrigen.DataTable.Active then + AOrigen.DataTable.Active := True; + + if not ADestino.DataTable.Active then + ADestino.DataTable.Active := True; + + ADetallesController := TDetallesFacturaClienteController.Create; + try + //OJO IMPORTANTE + //Siempre que vayamos a trabajar con los detalles debemos hacer un beginupdate de los mismos y un endupdate para + //obligarle siempre a recalcular los detalles una sola vez + ADetallesController.BeginUpdate(ADestino); + + AOrigen.DataTable.First; + for i := 0 to AOrigen.DataTable.RecordCount - 1 do + begin + ADetallesController.Add(ADestino, TIPO_DETALLE_CONCEPTO); + ADestino.Edit; + ADestino.REFERENCIA := AOrigen.REFERENCIA; + if AOrigen.ID_ARTICULO > 0 then + ADestino.ID_ARTICULO := AOrigen.ID_ARTICULO; + ADestino.CONCEPTO := AOrigen.CONCEPTO; + ADestino.CANTIDAD := AOrigen.CANTIDAD; + ADestino.IMPORTE_UNIDAD := AOrigen.IMPORTE_UNIDAD; + ADestino.IMPORTE_TOTAL := AOrigen.IMPORTE_TOTAL; + ADestino.DESCUENTO := AOrigen.DESCUENTO; + ADestino.IMPORTE_PORTE := AOrigen.IMPORTE_PORTE; + ADestino.VISIBLE := AOrigen.VISIBLE; + ADestino.REFERENCIA_PROVEEDOR := AOrigen.REFERENCIA_PROVEEDOR; + ADestino.Post; + AOrigen.Next; + end; + finally + ADetallesController.EndUpdate(ADestino); + ADetallesController := NIL; + end; +end;} + + + +{ TGestorInformesController } + + +{ +function TGestorInformesController.Buscar(const ID: Integer): IBizFacturaCliente; +begin +// Result := (FDataModule as IDataModuleFacturasCliente).GetItem(ID); +// FiltrarEmpresa(Result); +end; + +function TGestorInformesController.BuscarTodasPendientesComision(IdAgente:Integer; IdComision: Integer; IdFacturasAsociadas: String): IBizFacturaCliente; +var + Condicion: TDAWhereExpression; +begin +{ ShowHourglassCursor; + try + Result := BuscarTodos; + with Result.DataTable.DynamicWhere do + begin + //Todas las facturas de un agente determinado + Condicion := NewBinaryExpression(NewField('', fld_FacturasClienteID_AGENTE), NewConstant(IdAgente, datInteger), dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + + with Result.DataTable.DynamicWhere do + begin + //Todas aquellas que no esten asociadas a ninguna comisión o asociadas a la comisión, + //pero no asociadas en el editor de la comision, esto es porque se puede agregar y quitar + //facturas y todos los cambios estan el cache y por lo tanto al pedir las facturas a seleccionar + //debemos tener en cuenta dichso cambios en cache + Condicion := NewBinaryExpression(NewField('', fld_FacturasClienteID_COMISION_LIQUIDADA), NewNull(), dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + +{REPASARRRRRRR + //Quitamos aquellas que ya están asociadas + if length(IdFacturasAsociadas) > 0 then + with Result.DataTable.DynamicWhere do + begin + Condicion := NewBinaryExpression(NewField('', fld_FacturasClienteID), ' not in (' + IdFacturasAsociadas + ')');, dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + + with Result.DataTable.Where do + begin + + CLOSEBraket; + AddOperator(opOR); + + OpenBraket; + //En caso de ser facturas ya asociadas lo limitamos a la comision actual + //ya que no debemos poder elegir facturas asociadas a otras comisiones + OpenBraket; + AddText(fld_FacturasClienteID_COMISION_LIQUIDADA + ' = ' + IntToStr(IdComision)); + CloseBraket; + //En el caso de que halla facturas asociadas + if length(IdFacturasAsociadas) > 0 then + begin + AddOperator(opAND); + OpenBraket; + AddText(fld_FacturasClienteID + ' not in (' + IdFacturasAsociadas + ')'); + CloseBraket; + end; + CloseBraket; + + CloseBraket; + end; + + finally + HideHourglassCursor; + end; +end; + +function TGestorInformesController.BuscarTodos: IBizFacturaCliente; +begin +// Result := FDataModule.GetItems; + // FiltrarEmpresa(Result); +end; +} + +constructor TGestorInformesController.Create; +begin + inherited; + FDataModule := TDataModuleGestorInformes.Create(Nil); +end; + + +function TGestorInformesController.CreateEditor(const AName: String; + const IID: TGUID; out Intf): Boolean; +begin + Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf); +end; + +destructor TGestorInformesController.Destroy; +begin + FDataModule := Nil; + inherited; +end; + +function TGestorInformesController.GetDataModule: IDataModuleGestorInformes; +begin + Result := FDataModule; +end; + +procedure TGestorInformesController.GetInformeIVAClientes; +var + AStream: Binary; + AEditor : IEditorGestorInformesReport; +begin + AEditor := NIL; + ShowHourglassCursor; + try + try + CreateEditor('EditorGestorInformesReport', IEditorGestorInformesReport, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + AEditor.Controller := Self; + AStream := FDataModule.GetInformeIVAClientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); + LoadFromStream(AStream); + Preview; + Release; + end; + finally + FreeAndNil(AStream); + AEditor := Nil; + end; + finally + HideHourglassCursor; + end; +end; + +{ +procedure TGestorInformesController.Ver(AFactura: IBizFacturaCliente); +var + AEditor : IEditorFacturaCliente; +begin + AEditor := NIL; +{ ShowHourglassCursor; + try + RecuperarCliente(AFactura); + CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor); + + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; //OJO ORDEN MUY IMPORTANTE + Factura := AFactura; + + //MODO CONSULTAR + if not EsModificable(AFactura) then + begin + SetDataTableReadOnly(AFactura.DataTable, True); + ReadOnly := True; + end; + + ShowModal; + + //MODO CONSULTAR (Se deja la tabla como estaba) + if ReadOnly then + SetDataTableReadOnly(AFactura.DataTable, False); + + Release; + end; + finally + AEditor := NIL; + HideHourglassCursor; + end; +end; + +procedure TGestorInformesController.VerTodos(AFacturas: IBizFacturaCliente); +var + AEditor : IEditorFacturasCliente; +begin + AEditor := NIL; +{ + ShowHourglassCursor; + try + CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; //OJO ORDEN MUY IMPORTANTE + Facturas := AFacturas; + MultiSelect := True; + ShowEmbedded; + end; + finally + AEditor := Nil; + HideHourglassCursor; + end; +end; + + +procedure TGestorInformesController.FiltrarEmpresa(AFactura: IBizFacturaCliente); +var + Condicion: TDAWhereExpression; +begin +{ if AFactura.DataTable.Active then + AFactura.DataTable.Active := False; + + // Filtrar las facturas actuales por empresa + with AFactura.DataTable.DynamicWhere do + begin + // (ID_EMPRESA >= ID) + Condicion := NewBinaryExpression(NewField('', fld_FacturasClienteID_EMPRESA), NewConstant(AppFactuGES.EmpresaActiva.ID, datInteger), dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; +end; + +procedure TGestorInformesController.SetClienteController(const Value: IClientesController); +begin + FClienteController := Value; +end; + +procedure TGestorInformesController.SetDetallesController(const Value: IDetallesFacturaClienteController); +begin + FDetallesController := Value; +end; +} +{ +procedure TGestorInformesController.informe; +begin + + FDataModule.getInforme; +//showmessage('alla voy') +end; + +{ +procedure TGestorInformesController.Preview(AFactura: IBizFacturaCliente; AllItems: Boolean = false); +var +// AReportController : IFacturasClienteReportController; + ID_Facturas: TIntegerList; + +begin +{ + AReportController := TFacturasClienteReportController.Create; + ID_Facturas := TIntegerList.Create; + + try + //Si deseamos previsualizar todos los items del objeto albaran + if AllItems then + begin + with AFactura.DataTable do + begin + First; + while not EOF do + begin + ID_Facturas.Add(AFactura.ID); + Next; + end; + end; + end + //Solo previsualizamos el item seleccionado + else + ID_Facturas.Add(AFactura.ID); + + AReportController.Preview(ID_Facturas); + + finally + AReportController := NIL; + FreeANDNIL(ID_Facturas); + end; +end; + +procedure TGestorInformesController.Print(AFactura: IBizFacturaCliente; AllItems: Boolean = false); +var +// AReportController : IFacturasClienteReportController; + ID_Facturas: TIntegerList; + +begin +{ + AReportController := TFacturasClienteReportController.Create; + ID_Facturas := TIntegerList.Create; + + try + //Si deseamos previsualizar todos los items del objeto albaran + if AllItems then + begin + with AFactura.DataTable do + begin + First; + while not EOF do + begin + ID_Facturas.Add(AFactura.ID); + Next; + end; + end; + end + //Solo previsualizamos el item seleccionado + else + ID_Facturas.Add(AFactura.ID); + + AReportController.Print(ID_Facturas); + + finally + AReportController := NIL; + FreeANDNIL(ID_Facturas); + end; +end; +} + +end. diff --git a/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.dpk b/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.dpk new file mode 100644 index 00000000..a82664e5 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.dpk differ diff --git a/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.dproj b/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.dproj new file mode 100644 index 00000000..ab24152d --- /dev/null +++ b/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.dproj @@ -0,0 +1,79 @@ + + + {45f3d725-bfc7-4084-afb2-6032ebaddc4a} + FacturasCliente_data.dpk + Debug + AnyCPU + DCC32 + C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\FacturasCliente_data.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + False + False + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + FacturasCliente_data.dpk + + + + + + + MainSource + + + +
DataModuleFacturasCliente
+ TDAClientDataModule +
+
+ +
\ No newline at end of file diff --git a/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.res b/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.res new file mode 100644 index 00000000..4f907139 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/FacturasCliente_data.res differ diff --git a/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dcu b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dcu new file mode 100644 index 00000000..337e86d1 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dcu differ diff --git a/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dpk b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dpk new file mode 100644 index 00000000..08999db0 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dpk differ diff --git a/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dproj b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dproj new file mode 100644 index 00000000..8b09b5fc --- /dev/null +++ b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.dproj @@ -0,0 +1,579 @@ + + + + {45f3d725-bfc7-4084-afb2-6032ebaddc4a} + GestorInformes_data.dpk + Debug + AnyCPU + DCC32 + ..\..\..\..\Output\Debug\Cliente\GestorInformes_data.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + .\ + .\ + .\ + ..\..\..\..\Output\Debug\Cliente + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\Lib + + + Delphi.Personality + Package + + + False + True + False + + + False + False + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + GestorInformes_data.dpk + + + + + + + MainSource + + + + + + + + + + + + + + + + + + diff --git a/Source/Modulos/Gestor de informes/Data/GestorInformes_data.identcache b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.identcache new file mode 100644 index 00000000..b39bb677 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.identcache differ diff --git a/Source/Modulos/Gestor de informes/Data/GestorInformes_data.rc b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestor de informes/Data/GestorInformes_data.res b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.res new file mode 100644 index 00000000..8b251f31 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/GestorInformes_data.res differ diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dcu b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dcu new file mode 100644 index 00000000..dfb0be7a Binary files /dev/null and b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dcu differ diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm new file mode 100644 index 00000000..03b96bdd --- /dev/null +++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm @@ -0,0 +1,63 @@ +inherited DataModuleGestorInformes: TDataModuleGestorInformes + OnCreate = DAClientDataModuleCreate + Height = 207 + Width = 518 + object RORemoteService: TRORemoteService + Message = dmConexion.ROMessage + Channel = dmConexion.ROChannel + ServiceName = 'srvGestorInformes' + Left = 40 + Top = 16 + end + object rda_GestorInformes: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RORemoteService + GetDataCall.RemoteService = RORemoteService + UpdateDataCall.RemoteService = RORemoteService + GetScriptsCall.RemoteService = RORemoteService + RemoteService = RORemoteService + DataStreamer = Bin2DataStreamer + Left = 43 + Top = 135 + end + object Bin2DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 72 + end + object tbl_DirectoryData: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'FileName' + DataType = datString + Size = 200 + DisplayWidth = 50 + InPrimaryKey = True + end + item + Name = 'FileSize' + DataType = datInteger + end> + Params = < + item + Name = 'Directory' + DataType = datString + Size = 200 + Value = '' + ParamType = daptInput + end> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rda_GestorInformes + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'DirectoryData' + IndexDefs = <> + Left = 184 + Top = 40 + end + object ds_DirectoryData: TDADataSource + DataSet = tbl_DirectoryData.Dataset + DataTable = tbl_DirectoryData + Left = 184 + Top = 104 + end +end diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas new file mode 100644 index 00000000..6e4914ce --- /dev/null +++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas @@ -0,0 +1,89 @@ +unit uDataModuleGestorInformes; + +interface + +uses + SysUtils, Classes, DB, uDADataTable, uDABINAdapter, + uDAScriptingProvider, uDACDSDataTable, uROWinInetHttpChannel, uROTypes, + uRORemoteService, uROClient, uROBinMessage, + + uIDataModuleGestorInformes, uDADesigntimeCall, uDataModuleBase, + uDAInterfaces, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer, + uDARemoteDataAdapter, uIntegerListUtils, FactuGES_Intf; + +type + TDataModuleGestorInformes = class(TDataModuleBase, IDataModuleGestorInformes) + RORemoteService: TRORemoteService; + rda_GestorInformes: TDARemoteDataAdapter; + Bin2DataStreamer: TDABin2DataStreamer; + tbl_DirectoryData: TDAMemDataTable; + ds_DirectoryData: TDADataSource; + procedure DAClientDataModuleCreate(Sender: TObject); + public +// function GetItems : IBizFacturaCliente; + + // Report + function GetInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + procedure getInforme; + end; + +implementation + +{$R *.DFM} + +uses + uDataModuleConexion, uDataTableUtils, cxControls, + Dialogs; + +{ TdmPresupuestos } + +procedure TDataModuleGestorInformes.DAClientDataModuleCreate(Sender: TObject); +begin + RORemoteService.Channel := dmConexion.Channel; + RORemoteService.Message := dmConexion.Message; +end; + +function TDataModuleGestorInformes.GetInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; +begin + try + Result := (RORemoteService as IsrvGestorInformes).GetInformeIVAClientes(IdEmpresa, FechaInicio, FechaFin, ListaIdClientes, Desglosado, ImporteMinimo); + finally + end; +end; + +procedure TDataModuleGestorInformes.getInforme; +begin + tbl_DirectoryData.close; + tbl_DirectoryData.ParamByName('Directory').AsString := 'ddddd'; + tbl_DirectoryData.Open; + showmessage(tbl_DirectoryData.FieldByName('filename').asstring) +end; +{ +function TDataModuleGestorInformes.GetItems: IBizFacturaCliente; +var + AFactura : TDAMemDataTable; +begin + ShowHourglassCursor; + try + + AFactura := CloneDataTable(tbl_FacturasCliente); + + // EL CAMPO REFERENCIA TIENE QUE SER AUTOREFRESH!!!!! + AFactura.FieldByName(fld_FacturasClienteREFERENCIA).ServerAutoRefresh := TRUE; + + AFactura.BusinessRulesID := BIZ_CLIENT_FACTURA_CLIENTE; + + with TBizFacturaCliente(AFactura.BusinessEventsObj) do + begin + Detalles := _GetDetalles; + end; + + Result := (AFactura as IBizFacturaCliente); + + finally + HideHourglassCursor; + end; +end; +} + +end. diff --git a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.dcu b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.dcu new file mode 100644 index 00000000..1fafac7e Binary files /dev/null and b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.dcu differ diff --git a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas new file mode 100644 index 00000000..6dc3e39a --- /dev/null +++ b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas @@ -0,0 +1,18 @@ +unit uIDataModuleGestorInformes; + +interface + +uses + uROTypes, FactuGES_Intf; + +type + IDataModuleGestorInformes = interface + ['{65FB8E9E-5218-43DC-80AD-BDB4383B7064}'] +// function GetItems: IBizFacturaCliente; + procedure getInforme; + function GetInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: TDateTime; const FechaFin: TDateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + end; + +implementation + +end. diff --git a/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dcu b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dcu new file mode 100644 index 00000000..9732855e Binary files /dev/null and b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dcu differ diff --git a/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dpk b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dpk new file mode 100644 index 00000000..713babe5 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dpk differ diff --git a/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dproj b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dproj new file mode 100644 index 00000000..910ea061 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.dproj @@ -0,0 +1,568 @@ + + + + {e8b638a4-6653-49db-9d4d-557579466934} + GestorInformes_model.dpk + Debug + AnyCPU + DCC32 + ..\..\..\..\Output\Debug\Cliente\GestorInformes_model.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + ..\..\..\..\Output\Debug\Cliente + .\ + .\ + .\ + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\Lib + + + Delphi.Personality + Package + + + False + True + False + + + False + False + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 3082 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + GestorInformes_model.dpk + + + + + + + MainSource + + + + + + + diff --git a/Source/Modulos/Gestor de informes/Model/GestorInformes_model.identcache b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.identcache new file mode 100644 index 00000000..5243afc8 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.identcache differ diff --git a/Source/Modulos/Gestor de informes/Model/GestorInformes_model.rc b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestor de informes/Model/GestorInformes_model.res b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.res new file mode 100644 index 00000000..8b251f31 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Model/GestorInformes_model.res differ diff --git a/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dcu b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dcu new file mode 100644 index 00000000..a51f3bbf Binary files /dev/null and b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dcu differ diff --git a/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dpk b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dpk new file mode 100644 index 00000000..8c7f40c0 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dpk differ diff --git a/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dproj b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dproj new file mode 100644 index 00000000..ea542685 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.dproj @@ -0,0 +1,536 @@ + + + + {ba7a4052-3c4c-401c-bae5-3701abd24fc1} + GestorInformes_plugin.dpk + Debug + AnyCPU + DCC32 + ..\..\..\..\Output\Debug\Cliente\GestorInformes_plugin.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + .\ + .\ + .\ + ..\..\..\..\Output\Debug\Cliente + ..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + + + Delphi.Personality + Package + +FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0GestorInformes_plugin.dpk + + + + + MainSource + + + + + + + + + + + + + + + diff --git a/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.identcache b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.identcache new file mode 100644 index 00000000..dc321ee3 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.identcache differ diff --git a/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.rc b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.res b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.res new file mode 100644 index 00000000..8b251f31 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Plugin/GestorInformes_plugin.res differ diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dcu b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dcu new file mode 100644 index 00000000..66063fa0 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dcu differ diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm new file mode 100644 index 00000000..04489040 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm @@ -0,0 +1,114 @@ +object PluginGestorInformes: TPluginGestorInformes + OldCreateOrder = True + Description = 'Informes' + ModuleMenu = MainMenu + ModuleName = 'Gestor de informes' + SmallImages = SmallImages + LargeImages = LargeImages + Author = 'Rodax Software' + Version = '1.0.0' + Height = 252 + Width = 401 + object LargeImages: TPngImageList + Height = 24 + Width = 24 + PngImages = < + item + PngImage.Data = { + 89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D + F80000000970485973000017120000171201679FD252000001BE4944415478DA + 63FCFFFF3F032D0123B2054BB79CA49A6DD13EE68C582D004A906CD8DFBFFF80 + F83F980601EBC07C86733BA6E1B6C0B6683F8A0187FB1C711A8EAC765BB315C3 + C275FB19E62DDD84DF02525CEE507A9081455D89E1C08C1D0CEF0FC6312CD978 + 90B005D87C802E06027B3BEC189C2B0E311CD97F0BCC7FB32F8661F996C394F9 + E0FF3F605803F11FA0EB41EC3FFFFE41E3E01F98BD7ADB51D27D400C00F9E2F1 + 8E70860DBB4E106701CCDBA480075B431936EF3D459C05F8520E3600D2B3A850 + 8F61EB81D3C45B802BA86096C3E4616AE7E7EB32EC387486763E989DA3CDB0E7 + E839DAF96046A626C3FE131768E783A969EA0C874E5FC26F4184A729387792E3 + 838929AA0CC7CE5EC16F41A89B09387792E3839E042586D317AFE3B720C8D988 + C1ADFA08591674C62A309CBB7213BF057E8E060C5EB5C7F01A06B27CC1913F70 + 7E820D0BD882B62839868BD76FE3B7C0DB4E0F5EAEC0CA1850D9032BF393275F + C1881F18BF394296E1CACD3BF82DF0B0D6C16938884E9B760D6BF0116D818BA5 + 164EC3411667CDB88133E888B2C0DE541D6CD8BFBF88621966E1BFFFFFB1061F + 322068818D912AB844A404E0B5A077CA428A0C8701980500619929EF09CFCE42 + 0000000049454E44AE426082} + Name = 'PngImage0' + Background = clWindow + end> + Left = 232 + Top = 16 + Bitmap = {} + end + object ModuleActionList: TActionList + Images = LargeImages + Left = 40 + Top = 72 + end + object MainMenu: TMainMenu + Images = LargeImages + Left = 40 + Top = 16 + end + object SmallImages: TPngImageList + PngImages = < + item + PngImage.Data = { + 89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF + 610000000970485973000017120000171201679FD252000001684944415478DA + 63FCFFFF3FC394C53BFE33900172623D1819610600394469FAF3F71FC3EF3F7F + 19ACFDF319CEED98866A806DD17E14C587FB1CC134B2F8AE761B86B9ABF632CC + 5BBA09D3007CE0D7EFBF609B4178C98683D80D40770136B0AED69461E59623B8 + 0D80391B04FE01E5FEFCF907B7D9B7FE04C3AA4A6386B53B8EE13700E692BD9D + 760CCEE587E03607359F66585A6AC0B069CF49FC06A0DB0CC2207E58FB598685 + 85BA0CDB0E9CC16DC0C15E0706FBE203605B37375A809D0D02209BA3BB2F30CC + C9D566D87DE41C6E0340CE46B7F9E7AF3F6076D2C42B0C53D2D4180E9FBE8C69 + 4046941B8363E94194105F5E6EC810D9791ECC9E99A5C9903EED3A437F920AC3 + 89F357310D480E7386DB08A2435ACF302C2ED687B8049A067266DD62E88A5364 + 387BF906A60171410E280107B3191DB446C9315CBA7E1BD380283F3B147F23DB + FC1BC9E07FFFFE335CB97907D380502F6B86D5DB8E129D13310C0009900A4006 + 00004B6D80F047EC10D30000000049454E44AE426082} + Name = 'PngImage0' + Background = clWindow + end> + PngOptions = [pngBlendOnDisabled, pngGrayscaleOnDisabled] + Left = 308 + Top = 16 + Bitmap = {} + end + object ExtraImages: TPngImageList + Height = 28 + Width = 28 + PngImages = < + item + PngImage.Data = { + 89504E470D0A1A0A0000000D494844520000001C0000001C0806000000720DDF + 940000000970485973000017120000171201679FD252000002834944415478DA + BDD6ED4F52511800F087ECDFA8B5D6CB2A8550FC525862BC28B56966F9B2D658 + 5B7373D69ABDACF5A12FADD6875EB6968DD922299C1481888680C0E555485494 + 20B2FADCFAD6565FE53EDD7B0B86099C6BD7F970D9E53CDC7B7EE73907388810 + 11363344C5A023F0916BB0B9FC73559B7970C7DFD7DCFBDC8150B5A5AA24705A + 23159505C7A90CB62A0EFCF7E869A62F9A46C8E568C8D134C8DB2EC382EB6979 + D0EE4F635B5335340C506B3A0B3F549485FEBDDE7DF730182C7E308C38F881EB + 0D1654CBF680FFD70A04F42EF819D181D14691C131DF073C79ACA66C85A5F2C1 + 078D70F44A0022D4E742EE47E81C98EC413268F3A6B05D29E65D19BB4EB91C72 + E7E2B56373E6C93019B47A97F0945252B212BEC156FADDDB031667940738CD80 + AA3F60F114AD37BE79BAC1EA9A21836F3D8BD8A13EC881953E959582BD77F4BA + 14ECD3713268712791F9A20A064D572530E19B25836FDC0B7846535B002BAD65 + 7E40C5D7E4EF310E88C14925C8E06BD73C7636D709AEF0F9A56AF084E7798053 + 0CD8221C1CEADF0FBE68920C9AA7E6B0AB4526784AF57DFB808A2D92C1516702 + BBB5F5822B1CECDD0BA1D9140FF05D023BB532EEA74A08F8F8C26E88CEA5C9E0 + C8E47B660DEB41712D28684A1F9DDF05F164861FD8A1AE03E58DB0A00AEFEB76 + 4262294B064D13716C57D582E666541078EFEC0E486696C9E02B470C5B9BA470 + FC568C57E7ECA086232B85B64EBE9503EFF46C8754F60B3FF044A3A4F49643AF + FEFBD03B985DB3CEF9F6EDAE6D905EFE4A065F8ECFA0F6888488B103EAD37F2A + 39EDEB028DF62836378889187BBE38547EFBE20D0E8F4550231713B172B9E2E0 + 05BEB0855175A886DBCB362288A0C11AC227CFCC1B82E5A322B819F11BFB7D9A + E74CD9D0710000000049454E44AE426082} + Name = 'PngImage0' + Background = clWindow + end> + Left = 232 + Top = 80 + Bitmap = {} + end +end diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas new file mode 100644 index 00000000..4c76f8f5 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas @@ -0,0 +1,59 @@ +unit uPluginGestorInformes; + +interface + +uses + uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList, + ImgList, Controls, PngImageList; + +type + IMCGestorInformes = interface(IInterface) + ['{D44E1560-BF8F-4DA2-BF64-E0A44C08AC01}'] + end; + + TPluginGestorInformes = class(TModuleController, IMCGestorInformes) + ExtraImages: TPngImageList; + LargeImages: TPngImageList; + MainMenu: TMainMenu; + ModuleActionList: TActionList; + SmallImages: TPngImageList; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + +implementation + +{$R *.dfm} + +uses + Forms, Dialogs, SysUtils, + uGestorInformesController, uGestorInformesViewRegister; + +function GetModule : TModuleController; +begin + Result := TPluginGestorInformes.Create(NIL); +end; + +exports + GetModule name GET_MODULE_FUNC; + +constructor TPluginGestorInformes.Create(AOwner: TComponent); +begin + inherited; + uGestorInformesViewRegister.RegisterViews; +end; + +destructor TPluginGestorInformes.Destroy; +begin + uGestorInformesViewRegister.UnregisterViews; + inherited; +end; + +initialization + RegisterModuleClass(TPluginGestorInformes); + +finalization + UnRegisterModuleClass(TPluginGestorInformes); + +end. diff --git a/Source/Modulos/Gestor de informes/Servidor/NewService_Impl.dfm b/Source/Modulos/Gestor de informes/Servidor/NewService_Impl.dfm new file mode 100644 index 00000000..76f3ebcb --- /dev/null +++ b/Source/Modulos/Gestor de informes/Servidor/NewService_Impl.dfm @@ -0,0 +1,107 @@ +object NewService: TNewService + OldCreateOrder = True + SessionManager = dmServer.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DABinDataStreamer1 + ExportedDataTables = < + item + DataTable = dtComboDataset + LogicalName = 'ComboDataset' + end + item + DataTable = dtWindowsDir + LogicalName = 'DirectoryData' + end> + BeforeGetDatasetData = DataAbstractServiceBeforeGetDatasetData + ValidateDatasetAccess = DataAbstractServiceValidateDatasetAccess + Height = 149 + Width = 326 + object Schema: TDASchema + ConnectionManager = dmServer.ConnectionManager + Datasets = <> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = < + item + Name = 'FK_Employees_Employees' + MasterDatasetName = 'Employees' + MasterFields = 'EmployeeID' + DetailDatasetName = 'Employees' + DetailFields = 'ReportsTo' + RelationshipType = rtForeignKey + end> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end + object dtComboDataset: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'AutoIncField' + DataType = datAutoInc + InPrimaryKey = True + end + item + Name = 'TextField' + DataType = datString + Size = 50 + DisplayWidth = 50 + end> + Params = < + item + Name = 'CustomParameter' + DataType = datString + Size = 50 + Value = '' + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'ComboDataset' + IndexDefs = <> + Left = 128 + Top = 56 + end + object dtWindowsDir: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'FileName' + DataType = datString + Size = 200 + DisplayWidth = 50 + InPrimaryKey = True + end + item + Name = 'FileSize' + DataType = datInteger + end> + Params = < + item + Name = 'Directory' + DataType = datString + Size = 200 + Value = '' + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'DirectoryData' + IndexDefs = <> + Left = 216 + Top = 56 + end + object DABinDataStreamer1: TDABinDataStreamer + Left = 128 + Top = 8 + end +end diff --git a/Source/Modulos/Gestor de informes/Servidor/NewService_Impl.pas b/Source/Modulos/Gestor de informes/Servidor/NewService_Impl.pas new file mode 100644 index 00000000..0586b541 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Servidor/NewService_Impl.pas @@ -0,0 +1,179 @@ +unit NewService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} uDABusinessProcessor, uDABin2DataStreamer, uDADataStreamer, + uDAScriptingProvider, uDAClasses, + FactuGES_Intf, uDAInterfaces, uDADataTable, uDAMemDataTable, uDABinAdapter; + + +const + { Dataset names for Schema } + ds_Employees = 'Employees'; + ds_Customers = 'Customers'; + ds_Regions = 'Regions'; + +type + { TNewService } + TNewService = class(TDataAbstractService, INewService) + dtComboDataset: TDAMemDataTable; + dtWindowsDir: TDAMemDataTable; + DABinDataStreamer1: TDABinDataStreamer; + Schema: TDASchema; + procedure DataAbstractServiceBeforeGetDatasetData(aSender: TObject; + const aDataset: IDADataset; const aIncludeSchema: Boolean; + const aMaxRecords: Integer); + procedure DataAbstractServiceValidateDatasetAccess(Sender: TObject; + const aConnection: IDAConnection; const aDatasetName: string; + const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + private + procedure FillComboDataset(const aDataset: IDAEditableDataset); + procedure FillWinDirDataset(const aDataset: IDAEditableDataset); + protected + { INewService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils; + +procedure Create_NewService(out anInstance: IUnknown); +begin + anInstance := TNewService.Create(nil); +end; + +procedure TNewService.FillComboDataset(const aDataset: IDAEditableDataset); +var + employees, + customers, + regions: IDADataset; + textfield: TDAField; +begin +{ + with aDataset do begin + // Opens the in memory data table + Open; + textfield := FieldByName('TextField'); + + // Adds 3 dummy records + Insert; + textfield.AsString := 'String A'; + Post; + + Insert; + textfield.AsString := 'String B'; + Post; + + Insert; + textfield.AsString := 'String C'; + Post; + + // Fetches data from other datasets, according to the value of the parameter "CustomParameter" + if (Pos('EMPLOYEES', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + employees := Schema.NewDataset(Connection, ds_Employees, [], [], TRUE); + while not employees.EOF do begin + Insert; + textfield.AsString := employees.FieldByName('FirstName').AsString + ' ' + employees.FieldByName('LastName').AsString; + Post; + + employees.Next; + end; + employees:=nil; + end; + if (Pos('CUSTOMERS', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + customers := Schema.NewDataset(Connection, ds_Customers, [], [], TRUE); + while not customers.EOF do begin + Insert; + textfield.AsString := customers.FieldByName('CompanyName').AsString; + Post; + + customers.Next; + end; + customers := nil; + end; + if (Pos('REGIONS', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + regions := Schema.NewDataset(Connection, ds_Regions, [], [], TRUE); + while not regions.EOF do begin + Insert; + textfield.AsString := regions.FieldByName('RegionDescription').AsString; + Post; + + regions.Next; + end; + regions := nil; + end; + end; +} +end; + +procedure TNewService.FillWinDirDataset(const aDataset: IDAEditableDataset); +var + dirinfo: TSearchRec; +begin + aDataset.Open; +{ + if (FindFirst(IncludeTrailingPathDelimiter(aDataset.ParamByName('Directory').AsString) + '*.*', faArchive, dirinfo) = 0) then repeat + aDataset.Insert; + + aDataset.FieldByName('FileName').AsString := dirinfo.Name; + aDataset.FieldByName('FileSize').AsInteger := dirinfo.Size; + + aDataset.Post; + until (FindNext(dirinfo) <> 0); +} +end; + +procedure TNewService.DataAbstractServiceBeforeGetDatasetData( + aSender: TObject; const aDataset: IDADataset; + const aIncludeSchema: Boolean; const aMaxRecords: Integer); +begin + if SameText(aDataset.LogicalName, dtComboDataset.LogicalName) then + FillComboDataset((dtComboDataset as IDAEditableDataset)) + else if SameText(aDataset.LogicalName, dtWindowsDir.LogicalName) then + FillWinDirDataset((dtWindowsDir as IDAEditableDataset)); +end; + +procedure TNewService.DataAbstractServiceValidateDatasetAccess( + Sender: TObject; const aConnection: IDAConnection; + const aDatasetName: string; const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + + procedure FillParameters(aDataSet: TDAMemDataTable); + var + i: integer; + begin + for i := Low(aParamNames) to High(aParamNames) do + aDataset.ParamByName(aParamNames[i]).Value := aParamValues[i]; + end; + +begin + if SameText(aDatasetName, dtComboDataset.LogicalName) then + FillParameters(dtComboDataset) + else if SameText(aDatasetName, dtWindowsDir.LogicalName) then + FillParameters(dtWindowsDir) +end; + +initialization + TROClassFactory.Create('NewService', Create_NewService, TNewService_Invoker); + +finalization + +end. + diff --git a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.dcu b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.dcu new file mode 100644 index 00000000..5370956d Binary files /dev/null and b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.dcu differ diff --git a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.dfm b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.dfm new file mode 100644 index 00000000..0b32f5d2 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.dfm @@ -0,0 +1,109 @@ +object srvGestorInformes: TsrvGestorInformes + OldCreateOrder = True + SessionManager = dmServer.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = Bin2DataStreamer + ExportedDataTables = < + item + DataTable = dtComboDataset + LogicalName = 'ComboDataset' + end + item + DataTable = dtWindowsDir + LogicalName = 'DirectoryData' + end> + BeforeGetDatasetData = DataAbstractServiceBeforeGetDatasetData + ValidateDatasetAccess = DataAbstractServiceValidateDatasetAccess + Height = 162 + Width = 313 + object Schema: TDASchema + ConnectionManager = dmServer.ConnectionManager + Datasets = <> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = < + item + Name = 'FK_Employees_Employees' + MasterDatasetName = 'Employees' + MasterFields = 'EmployeeID' + DetailDatasetName = 'Employees' + DetailFields = 'ReportsTo' + RelationshipType = rtForeignKey + end> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 64 + end + object dtComboDataset: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'AutoIncField' + DataType = datAutoInc + InPrimaryKey = True + end + item + Name = 'TextField' + DataType = datString + Size = 50 + DisplayWidth = 50 + end> + Params = < + item + Name = 'CustomParameter' + DataType = datString + Size = 50 + Value = '' + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalDataStreamer = Bin2DataStreamer + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'ComboDataset' + IndexDefs = <> + Left = 128 + Top = 56 + end + object dtWindowsDir: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'FileName' + DataType = datString + Size = 200 + DisplayWidth = 50 + InPrimaryKey = True + end + item + Name = 'FileSize' + DataType = datInteger + end> + Params = < + item + Name = 'Directory' + DataType = datString + Size = 200 + Value = '' + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalDataStreamer = Bin2DataStreamer + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'DirectoryData' + IndexDefs = <> + Left = 216 + Top = 56 + end + object Bin2DataStreamer: TDABin2DataStreamer + Left = 32 + Top = 8 + end +end diff --git a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas new file mode 100644 index 00000000..c519059c --- /dev/null +++ b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas @@ -0,0 +1,198 @@ +unit srvGestorInformes_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} uDABusinessProcessor, uDABin2DataStreamer, uDADataStreamer, + uDAScriptingProvider, uDAClasses, + FactuGES_Intf, uDAInterfaces, uDADataTable, uDAMemDataTable, uDABinAdapter; + + +const + { Dataset names for Schema } + ds_Employees = 'Employees'; + ds_Customers = 'Customers'; + ds_Regions = 'Regions'; + +type + { TGestorInformes } + TsrvGestorInformes = class(TDataAbstractService, IsrvGestorInformes) + dtComboDataset: TDAMemDataTable; + dtWindowsDir: TDAMemDataTable; + Schema: TDASchema; + Bin2DataStreamer: TDABin2DataStreamer; + procedure DataAbstractServiceBeforeGetDatasetData(aSender: TObject; + const aDataset: IDADataset; const aIncludeSchema: Boolean; + const aMaxRecords: Integer); + procedure DataAbstractServiceValidateDatasetAccess(Sender: TObject; + const aConnection: IDAConnection; const aDatasetName: string; + const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + private + procedure FillComboDataset(const aDataset: IDAEditableDataset); + procedure FillWinDirDataset(const aDataset: IDAEditableDataset); + + public + function GetInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils, Dialogs, uRptFacturasCliente_Server; + +procedure Create_srvGestorInformes(out anInstance: IUnknown); +begin + anInstance := TsrvGestorInformes.Create(nil); +end; + +procedure TsrvGestorInformes.FillComboDataset(const aDataset: IDAEditableDataset); +var + employees, + customers, + regions: IDADataset; + textfield: TDAField; +begin +{ + with aDataset do begin + // Opens the in memory data table + Open; + textfield := FieldByName('TextField'); + + // Adds 3 dummy records + Insert; + textfield.AsString := 'String A'; + Post; + + Insert; + textfield.AsString := 'String B'; + Post; + + Insert; + textfield.AsString := 'String C'; + Post; + + // Fetches data from other datasets, according to the value of the parameter "CustomParameter" + if (Pos('EMPLOYEES', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + employees := Schema.NewDataset(Connection, ds_Employees, [], [], TRUE); + while not employees.EOF do begin + Insert; + textfield.AsString := employees.FieldByName('FirstName').AsString + ' ' + employees.FieldByName('LastName').AsString; + Post; + + employees.Next; + end; + employees:=nil; + end; + if (Pos('CUSTOMERS', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + customers := Schema.NewDataset(Connection, ds_Customers, [], [], TRUE); + while not customers.EOF do begin + Insert; + textfield.AsString := customers.FieldByName('CompanyName').AsString; + Post; + + customers.Next; + end; + customers := nil; + end; + if (Pos('REGIONS', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + regions := Schema.NewDataset(Connection, ds_Regions, [], [], TRUE); + while not regions.EOF do begin + Insert; + textfield.AsString := regions.FieldByName('RegionDescription').AsString; + Post; + + regions.Next; + end; + regions := nil; + end; + end; +} +end; + +procedure TsrvGestorInformes.FillWinDirDataset(const aDataset: IDAEditableDataset); +var + dirinfo: TSearchRec; +begin + aDataset.Open; +{ + if (FindFirst(IncludeTrailingPathDelimiter(aDataset.ParamByName('Directory').AsString) + '*.*', faArchive, dirinfo) = 0) then repeat +} + aDataset.Insert; + + aDataset.FieldByName('FileName').AsString := 'hola'; + aDataset.FieldByName('FileSize').AsInteger := 10; + + aDataset.Post; +{ + until (FindNext(dirinfo) <> 0); +} +end; + +function TsrvGestorInformes.GetInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: DateTime; const FechaFin: DateTime; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; +var + AReportGenerator : TRptFacturasCliente; +begin + AReportGenerator := TRptFacturasCliente.Create(nil); + try + Result := AReportGenerator.GenerarInformeIVA(IdEmpresa, FechaInicio, FechaFin, ListaIDClientes, Desglosado, ImporteMinimo); + finally + FreeAndNIL(AReportGenerator); + end; +end; + +procedure TsrvGestorInformes.DataAbstractServiceBeforeGetDatasetData( + aSender: TObject; const aDataset: IDADataset; + const aIncludeSchema: Boolean; const aMaxRecords: Integer); +begin + if SameText(aDataset.LogicalName, dtComboDataset.LogicalName) then + FillComboDataset((dtComboDataset as IDAEditableDataset)) + else if SameText(aDataset.LogicalName, dtWindowsDir.LogicalName) then + FillWinDirDataset((dtWindowsDir as IDAEditableDataset)); +end; + +procedure TsrvGestorInformes.DataAbstractServiceValidateDatasetAccess( + Sender: TObject; const aConnection: IDAConnection; + const aDatasetName: string; const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + + procedure FillParameters(aDataSet: TDAMemDataTable); + var + i: integer; + begin + for i := Low(aParamNames) to High(aParamNames) do + begin + showmessage(aParamValues[i]); + aDataset.ParamByName(aParamNames[i]).Value := aParamValues[i]; + end; + end; + +begin + if SameText(aDatasetName, dtComboDataset.LogicalName) then + FillParameters(dtComboDataset) + else if SameText(aDatasetName, dtWindowsDir.LogicalName) then + FillParameters(dtWindowsDir) +end; + +initialization + TROClassFactory.Create('srvGestorInformes', Create_srvGestorInformes, TsrvGestorInformes_Invoker); + +finalization + +end. + diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dcu b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dcu new file mode 100644 index 00000000..0dbda05f Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dcu differ diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk new file mode 100644 index 00000000..1135dc15 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk @@ -0,0 +1,70 @@ +package GestorInformes_view; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$IMPLICITBUILD OFF} + +requires + GUIBase, + vcl, + rtl, + PNG_D10, + PngComponentsD10, + vclactnband, + vclx, + tb2k_d10, + tbx_d10, + JvCoreD11R, + vcldb, + dbrtl, + vcljpg, + Jcl, + JclVcl, + JvSystemD11R, + JvStdCtrlsD11R, + JvPageCompsD11R, + frx11, + fs11, + frxe11, + GestorInformes_controller, + cxLibraryD11, + dxThemeD11, + dxGDIPlusD11, + cxEditorsD11, + cxDataD11, + dxLayoutControlD11, + dxComnD11, + Contactos_view, + DataAbstract_Core_D11, + dsnap, + adortl, + RemObjects_Core_D11; + +contains + uGestorInformesViewRegister in 'uGestorInformesViewRegister.pas', + uEditorGestorInformesReport in 'uEditorGestorInformesReport.pas' {fEditorGestorInformesReport: TfEditorElegirFacturasCliente}, + uViewPeriodoFechas in 'uViewPeriodoFechas.pas' {frViewPeriodoFechas: TFrame}, + uViewFiltroImportes in 'uViewFiltroImportes.pas' {frViewFiltroImportes: TFrame}, + uViewFiltroClientes in 'uViewFiltroClientes.pas' {frViewFiltroClientes: TFrame}; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj new file mode 100644 index 00000000..f098162f --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj @@ -0,0 +1,576 @@ + + + + {cdba3fdf-b755-404b-b9f9-ebf0ce885115} + GestorInformes_view.dpk + Debug + AnyCPU + DCC32 + ..\..\..\..\Output\Debug\Cliente\GestorInformes_view.bpl + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + ..\..\..\..\Output\Debug\Cliente + .\ + .\ + .\ + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\Lib + + + Delphi.Personality + Package + +FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0GestorInformes_view.dpk + + + + + MainSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fEditorGestorInformesReport
+ TfEditorElegirFacturasCliente +
+ + +
frViewFiltroClientes
+ TFrame +
+ +
frViewFiltroImportes
+ TFrame +
+ +
frViewPeriodoFechas
+ TFrame +
+ + + + + +
+
+ diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.identcache b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.identcache new file mode 100644 index 00000000..d7c2b3fb Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.identcache differ diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.rc b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res new file mode 100644 index 00000000..8b251f31 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res differ diff --git a/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.dcu b/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.dcu new file mode 100644 index 00000000..1a9448aa Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.dcu differ diff --git a/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.dfm b/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.dfm new file mode 100644 index 00000000..abbcc771 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.dfm @@ -0,0 +1,200 @@ +inherited fEditorGestorInformesReport: TfEditorGestorInformesReport + Caption = 'fEditorGestorInformesReport' + ClientHeight = 790 + ClientWidth = 895 + ExplicitWidth = 903 + ExplicitHeight = 824 + PixelsPerInch = 96 + TextHeight = 13 + inherited JvNavPanelHeader: TJvNavPanelHeader + Width = 895 + ExplicitWidth = 895 + inherited Image1: TImage + Left = 868 + ExplicitLeft = 868 + end + end + inherited TBXDock: TTBXDock + Width = 895 + ExplicitWidth = 895 + inherited tbxMenu: TTBXToolbar + ExplicitWidth = 895 + end + inherited TBXToolbar1: TTBXToolbar + ExplicitWidth = 591 + object TBXItem58: TTBXItem [0] + Action = actRefrescar + DisplayMode = nbdmImageAndText + Images = SmallImages + end + end + end + inherited StatusBar: TJvStatusBar + Top = 771 + Width = 895 + ExplicitTop = 771 + ExplicitWidth = 895 + end + object dxLayoutControl1: TdxLayoutControl [3] + Left = 0 + Top = 102 + Width = 895 + Height = 275 + Align = alTop + TabOrder = 3 + TabStop = False + inline frViewPeriodoFechas1: TfrViewPeriodoFechas + Left = 10 + Top = 10 + Width = 450 + Height = 75 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 0 + ReadOnly = False + ExplicitLeft = 10 + ExplicitTop = 10 + ExplicitWidth = 450 + inherited TBXDockablePanel1: TTBXDockablePanel + ExplicitWidth = 450 + ExplicitHeight = 75 + inherited dxLayoutControl1: TdxLayoutControl + Width = 795 + Align = alLeft + ExplicitWidth = 795 + ExplicitHeight = 75 + inherited cbPeriodo: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + inherited edtFechaIni: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + inherited edtFechaFin: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + end + end + end + inline frViewFiltroImportes1: TfrViewFiltroImportes + Left = 466 + Top = 10 + Width = 318 + Height = 70 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 1 + ReadOnly = False + ExplicitLeft = 466 + ExplicitTop = 10 + ExplicitHeight = 70 + inherited dxLayoutControl1: TdxLayoutControl + Height = 70 + ExplicitHeight = 70 + inherited eImporte: TcxSpinEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + end + end + inline frViewFiltroClientes1: TfrViewFiltroClientes + Left = 10 + Top = 91 + Width = 795 + Height = 170 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + ReadOnly = False + ExplicitLeft = 10 + ExplicitTop = 91 + ExplicitWidth = 795 + ExplicitHeight = 170 + inherited dxLayoutControl1: TdxLayoutControl + Width = 795 + Height = 41 + ExplicitWidth = 795 + ExplicitHeight = 41 + inherited edtlNombre: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 200 + Width = 200 + end + inherited edtNIFCIF: TcxDBTextEdit + Left = 544 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 544 + ExplicitWidth = 100 + Width = 100 + end + end + inherited Panel1: TPanel + Width = 795 + ExplicitWidth = 795 + end + inherited GroupBox1: TGroupBox + Width = 795 + ExplicitWidth = 795 + end + end + object dxLayoutControl1Group_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object dxLayoutControl1Group1: TdxLayoutGroup + AutoAligns = [aaHorizontal] + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item1: TdxLayoutItem + AutoAligns = [aaHorizontal] + Control = frViewPeriodoFechas1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item2: TdxLayoutItem + Control = frViewFiltroImportes1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + end + object dxLayoutControl1Item3: TdxLayoutItem + Control = frViewFiltroClientes1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.pas b/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.pas new file mode 100644 index 00000000..0d29b7fb --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uEditorGestorInformesReport.pas @@ -0,0 +1,134 @@ +unit uEditorGestorInformesReport; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uEditorPreview, frxExportText, frxExportRTF, frxExportMail, + frxExportXLS, frxExportImage, frxExportPDF, frxClass, frxDCtrl, frxGradient, + frxChBox, frxCross, frxRich, frxOLE, frxBarcode, JvAppStorage, + JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList, + StdActns, ActnList, ComCtrls, JvExComCtrls, JvStatusBar, TB2ExtItems, + TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, + JvExControls, JvNavigationPane, uIEditorGestorInformesReport, uCustomView, + uViewBase, uViewPeriodoFechas, uViewDatosYSeleccionClienteBase, + uViewFiltroClientes, dxLayoutControl, cxControls, uViewFiltroImportes, + FactuGES_Intf; + +type + TfEditorGestorInformesReport = class(TfEditorPreview, IEditorGestorInformesReport) + frViewPeriodoFechas1: TfrViewPeriodoFechas; + frViewFiltroClientes1: TfrViewFiltroClientes; + frViewFiltroImportes1: TfrViewFiltroImportes; + dxLayoutControl1Group_Root: TdxLayoutGroup; + dxLayoutControl1: TdxLayoutControl; + dxLayoutControl1Item1: TdxLayoutItem; + dxLayoutControl1Item2: TdxLayoutItem; + dxLayoutControl1Item3: TdxLayoutItem; + dxLayoutControl1Group1: TdxLayoutGroup; + TBXItem58: TTBXItem; + procedure actRefrescarExecute(Sender: TObject); + private + FListaIDClientes: TIntegerArray; + function GetFechaFin: TDateTime; + function GetFechaInicio: TDateTime; + function GetListaIDClientes: TIntegerArray; + function GetImporteMinimo: Currency; + function GetDesglosadoCliente: Boolean; + procedure OnClienteChanged(Sender: TObject); + + procedure RefrescarInforme; + + public + property FechaInicio: TDateTime read GetFechaInicio; + property FechaFin: TDateTime read GetFechaFin; + property ListaIDClientes: TIntegerArray read GetListaIDClientes; + property DesglosadoCliente: Boolean read GetDesglosadoCliente; + property ImporteMinimo: Currency read getImporteMinimo; + + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + +implementation + +{$R *.dfm} + +uses uROTypes, uGestorInformesController, uFactuGES_App; + +{ TfEditorGestorInformesReport } + +procedure TfEditorGestorInformesReport.actRefrescarExecute(Sender: TObject); +begin + inherited; + RefrescarInforme; +end; + +constructor TfEditorGestorInformesReport.Create(AOwner: TComponent); +begin + inherited; + FListaIDClientes := TIntegerArray.Create; + frViewFiltroClientes1.OnClienteChanged := OnClienteChanged; +end; + +destructor TfEditorGestorInformesReport.Destroy; +begin + FListaIDClientes.Free; + frViewFiltroClientes1.OnClienteChanged := Nil; + inherited; +end; + +function TfEditorGestorInformesReport.GetDesglosadoCliente: Boolean; +begin + if frViewFiltroClientes1.cbxDesglosado.Enabled then + Result := frViewFiltroClientes1.cbxDesglosado.Checked + else + Result := False; +end; + +function TfEditorGestorInformesReport.GetFechaFin: TDateTime; +begin + Result := frViewPeriodoFechas1.edtFechaFin.Date; +end; + +function TfEditorGestorInformesReport.GetFechaInicio: TDateTime; +begin + Result := frViewPeriodoFechas1.edtFechaIni.Date; +end; + +function TfEditorGestorInformesReport.GetImporteMinimo: Currency; +begin + if frViewFiltroImportes1.eImporte.Enabled then + Result := frViewFiltroImportes1.eImporte.Value + else + Result := 0; +end; + +function TfEditorGestorInformesReport.GetListaIDClientes: TIntegerArray; +begin + Result := FListaIDClientes; +end; + +procedure TfEditorGestorInformesReport.OnClienteChanged(Sender: TObject); +begin + FListaIDClientes.Clear; + if Assigned(frViewFiltroClientes1.Cliente) then + FListaIDClientes.Add(frViewFiltroClientes1.Cliente.ID); +end; + +procedure TfEditorGestorInformesReport.RefrescarInforme; +var + AStream: Binary; +begin + try + AStream := (Controller as IGestorInformesController).DataModule.GetInformeIVAClientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); + LoadFromStream(AStream); + Report.ShowPreparedReport; + + finally + FreeAndNil(AStream); + end; +end; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.dcu b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.dcu new file mode 100644 index 00000000..64e77c74 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.dcu differ diff --git a/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas new file mode 100644 index 00000000..4e58f07c --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas @@ -0,0 +1,23 @@ +unit uGestorInformesViewRegister; + +interface + +procedure RegisterViews; +procedure UnregisterViews; + +implementation + +uses + uEditorRegistryUtils, uEditorGestorInformesReport; + +procedure RegisterViews; +begin + EditorRegistry.RegisterClass(TfEditorGestorInformesReport, 'EditorGestorInformesReport'); +end; + +procedure UnregisterViews; +begin + EditorRegistry.UnRegisterClass(TfEditorGestorInformesReport); +end; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.dcu b/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.dcu new file mode 100644 index 00000000..19590076 Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.dcu differ diff --git a/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.dfm b/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.dfm new file mode 100644 index 00000000..e2894886 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.dfm @@ -0,0 +1,167 @@ +inherited frViewFiltroClientes: TfrViewFiltroClientes + Width = 694 + Height = 184 + ExplicitWidth = 694 + ExplicitHeight = 184 + inherited dxLayoutControl1: TdxLayoutControl + Top = 129 + Width = 694 + Height = 55 + ExplicitTop = 129 + ExplicitWidth = 694 + ExplicitHeight = 55 + DesignSize = ( + 694 + 55) + object edtlNombre: TcxDBTextEdit [0] + Left = 56 + Top = 10 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + DataBinding.DataField = 'NOMBRE' + DataBinding.DataSource = dsCliente + Enabled = False + ParentFont = False + Properties.ReadOnly = True + Properties.UseLeftAlignmentOnEditing = False + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.HotTrack = False + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleDisabled.TextColor = clWindowText + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 0 + Height = 21 + Width = 200 + end + object edtNIFCIF: TcxDBTextEdit [1] + Left = 481 + Top = 10 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + DataBinding.DataField = 'NIF_CIF' + DataBinding.DataSource = dsCliente + Enabled = False + ParentFont = False + Properties.ReadOnly = True + Properties.UseLeftAlignmentOnEditing = False + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.HotTrack = False + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleDisabled.TextColor = clWindowText + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 1 + Height = 21 + Width = 100 + end + inherited dxLayoutControl1Group_Root: TdxLayoutGroup + LayoutDirection = ldHorizontal + object dxLayoutControl1Item1: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Nombre:' + Control = edtlNombre + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item2: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'NIF/CIF:' + Control = edtNIFCIF + ControlOptions.ShowBorder = False + end + end + end + inherited Panel1: TPanel + Top = 94 + Width = 694 + ExplicitTop = 94 + ExplicitWidth = 694 + inherited bElegirCliente: TBitBtn + ExplicitLeft = 4 + ExplicitTop = 4 + end + inherited bNuevoCliente: TBitBtn + ExplicitLeft = 266 + ExplicitTop = 4 + end + inherited bVerFicha: TBitBtn + ExplicitLeft = 121 + ExplicitTop = 4 + end + end + object GroupBox1: TGroupBox [2] + Left = 0 + Top = 0 + Width = 694 + Height = 94 + Margins.Left = 0 + Margins.Top = 0 + Margins.Right = 0 + Margins.Bottom = 0 + Align = alTop + Caption = 'Elija una de las siguientes opciones para generar el listado' + Ctl3D = False + ParentCtl3D = False + TabOrder = 2 + object rd1: TRadioButton + Left = 16 + Top = 24 + Width = 321 + Height = 17 + Caption = 'Listar informe de todos los clientes' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = rd1Click + end + object rd2: TRadioButton + Left = 16 + Top = 56 + Width = 361 + Height = 17 + Caption = 'Listar informe del cliente siguiente' + TabOrder = 1 + OnClick = rd2Click + end + object cbxDesglosado: TCheckBox + Left = 261 + Top = 24 + Width = 282 + Height = 17 + Caption = 'Desglosar por cliente' + TabOrder = 2 + end + end + inherited ActionList1: TActionList + inherited actElegirContacto: TAction + Enabled = False + end + inherited actAnadirContacto: TAction + Enabled = False + Visible = False + end + inherited actVerContacto: TAction + Enabled = False + end + inherited actElegirDireccion: TAction + Enabled = False + end + inherited actElegirPersonaContacto: TAction + Enabled = False + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.pas b/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.pas new file mode 100644 index 00000000..a9108757 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewFiltroClientes.pas @@ -0,0 +1,51 @@ +unit uViewFiltroClientes; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uViewDatosYSeleccionClienteBase, ImgList, PngImageList, ActnList, DB, + uDAInterfaces, uDADataTable, StdCtrls, Buttons, ExtCtrls, dxLayoutControl, + cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit; + +type + TfrViewFiltroClientes = class(TfrViewDatosYSeleccionClienteBase) + dxLayoutControl1Item1: TdxLayoutItem; + edtlNombre: TcxDBTextEdit; + dxLayoutControl1Item2: TdxLayoutItem; + edtNIFCIF: TcxDBTextEdit; + GroupBox1: TGroupBox; + rd1: TRadioButton; + rd2: TRadioButton; + cbxDesglosado: TCheckBox; + procedure rd1Click(Sender: TObject); + procedure rd2Click(Sender: TObject); + end; + +implementation +{$R *.dfm} + +procedure TfrViewFiltroClientes.rd1Click(Sender: TObject); +begin + inherited; + if rd1.Checked then + begin + cbxDesglosado.Enabled := True; + actElegirContacto.Enabled := False; + actVerContacto.Enabled := False; + Cliente := Nil; + end; +end; + +procedure TfrViewFiltroClientes.rd2Click(Sender: TObject); +begin + inherited; + if rd2.Checked then + begin + cbxDesglosado.Enabled := False; + actElegirContacto.Enabled := True; + actVerContacto.Enabled := True; + end; +end; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.dcu b/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.dcu new file mode 100644 index 00000000..ade8e34e Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.dcu differ diff --git a/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.dfm b/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.dfm new file mode 100644 index 00000000..9deaa50a --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.dfm @@ -0,0 +1,63 @@ +inherited frViewFiltroImportes: TfrViewFiltroImportes + Width = 318 + Height = 44 + ExplicitWidth = 318 + ExplicitHeight = 44 + object dxLayoutControl1: TdxLayoutControl + Left = 0 + Top = 0 + Width = 318 + Height = 44 + Align = alClient + TabOrder = 0 + TabStop = False + object CheckBox1: TCheckBox + Left = 10 + Top = 10 + Width = 159 + Height = 17 + Caption = 'Solo facturas que superen:' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = CheckBox1Click + end + object eImporte: TcxSpinEdit + Left = 175 + Top = 10 + Enabled = False + Properties.Alignment.Horz = taRightJustify + Properties.DisplayFormat = ',0.00 '#8364';-,0.00 '#8364 + Properties.EditFormat = ',0.00 '#8364';-,0.00 '#8364 + Properties.UseDisplayFormatWhenEditing = True + Properties.ValueType = vtFloat + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.HotTrack = False + Style.LookAndFeel.SkinName = '' + Style.ButtonStyle = bts3D + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 1 + Width = 121 + end + object dxLayoutControl1Group_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item1: TdxLayoutItem + Caption = 'CheckBox1' + ShowCaption = False + Control = CheckBox1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item2: TdxLayoutItem + Control = eImporte + ControlOptions.ShowBorder = False + end + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.pas b/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.pas new file mode 100644 index 00000000..665ab1f4 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewFiltroImportes.pas @@ -0,0 +1,33 @@ +unit uViewFiltroImportes; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uViewBase, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxSpinEdit, + dxLayoutControl, StdCtrls, cxControls; + +type + TfrViewFiltroImportes = class(TfrViewBase) + dxLayoutControl1Group_Root: TdxLayoutGroup; + dxLayoutControl1: TdxLayoutControl; + CheckBox1: TCheckBox; + dxLayoutControl1Item1: TdxLayoutItem; + eImporte: TcxSpinEdit; + dxLayoutControl1Item2: TdxLayoutItem; + procedure CheckBox1Click(Sender: TObject); + end; + +implementation +{$R *.dfm} + +procedure TfrViewFiltroImportes.CheckBox1Click(Sender: TObject); +begin + inherited; + if not CheckBox1.Checked then + eImporte.Enabled := True + else + eImporte.Enabled := False; +end; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.dcu b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.dcu new file mode 100644 index 00000000..c167352f Binary files /dev/null and b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.dcu differ diff --git a/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.dfm b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.dfm new file mode 100644 index 00000000..13fbebd4 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.dfm @@ -0,0 +1,171 @@ +inherited frViewPeriodoFechas: TfrViewPeriodoFechas + Width = 769 + Height = 75 + ExplicitWidth = 769 + ExplicitHeight = 75 + object TBXDockablePanel1: TTBXDockablePanel + Left = 0 + Top = 0 + Align = alClient + Caption = 'TBXDockablePanel1' + FloatingWidth = 128 + FloatingHeight = 128 + SupportedDocks = [dkStandardDock, dkMultiDock] + TabOrder = 0 + object dxLayoutControl1: TdxLayoutControl + Left = 0 + Top = 0 + Width = 769 + Height = 75 + Align = alClient + ParentBackground = True + TabOrder = 0 + TabStop = False + LookAndFeel = dxLayoutStandardLookAndFeel1 + DesignSize = ( + 769 + 75) + object cbPeriodo: TcxComboBox + Left = 55 + Top = 37 + RepositoryItem = cxRepositoryPeriodos + Anchors = [akLeft, akTop, akRight] + Properties.OnChange = cbPeriodoPropertiesChange + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.HotTrack = False + Style.LookAndFeel.Kind = lfStandard + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + Style.ButtonStyle = bts3D + Style.PopupBorderStyle = epbsFrame3D + StyleDisabled.LookAndFeel.Kind = lfStandard + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.Kind = lfStandard + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.Kind = lfStandard + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 2 + Text = 'Este mes' + Width = 385 + end + object edtFechaIni: TcxDateEdit + Left = 55 + Top = 10 + Properties.DateButtons = [btnToday] + Properties.PostPopupValueOnTab = True + Properties.SaveTime = False + Properties.ShowTime = False + Properties.OnValidate = edtFechaIni2PropertiesValidate + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.HotTrack = False + Style.LookAndFeel.Kind = lfStandard + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + Style.ButtonStyle = bts3D + Style.PopupBorderStyle = epbsFrame3D + StyleDisabled.LookAndFeel.Kind = lfStandard + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.Kind = lfStandard + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.Kind = lfStandard + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 0 + Width = 170 + end + object edtFechaFin: TcxDateEdit + Left = 268 + Top = 10 + Properties.DateButtons = [btnToday] + Properties.PostPopupValueOnTab = True + Properties.SaveTime = False + Properties.ShowTime = False + Properties.OnValidate = edtFechaFinPropertiesValidate + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.HotTrack = False + Style.LookAndFeel.Kind = lfStandard + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + Style.ButtonStyle = bts3D + Style.PopupBorderStyle = epbsFrame3D + StyleDisabled.LookAndFeel.Kind = lfStandard + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.Kind = lfStandard + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.Kind = lfStandard + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 1 + Width = 170 + end + object dxLayoutGroup1: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object dxLayoutGroup2: TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Desde:' + Control = edtFechaIni + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'Hasta:' + Control = edtFechaFin + ControlOptions.ShowBorder = False + end + end + object dxLayoutItem1: TdxLayoutItem + AutoAligns = [aaVertical] + Caption = 'Periodo:' + Control = cbPeriodo + ControlOptions.ShowBorder = False + end + end + end + end + object cxRepository: TcxEditRepository + Left = 184 + Top = 32 + object cxRepositoryPeriodos: TcxEditRepositoryComboBoxItem + Properties.BeepOnError = True + Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 10 + Properties.ImmediatePost = True + Properties.ImmediateUpdateText = True + Properties.Items.Strings = ( + 'Hoy' + 'Ayer' + 'Esta semana' + 'Este mes' + 'Este a'#241'o' + #218'ltimos 7 d'#237'as' + #218'ltimos 30 d'#237'as' + #218'ltimos 3 meses' + 'Mes anterior' + 'A'#241'o anterior' + 'Personalizado') + Properties.PostPopupValueOnTab = True + Properties.ReadOnly = False + end + end + object dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList + Left = 136 + Top = 16 + object dxLayoutStandardLookAndFeel1: TdxLayoutStandardLookAndFeel + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.pas b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.pas new file mode 100644 index 00000000..ca10d796 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.pas @@ -0,0 +1,206 @@ +unit uViewPeriodoFechas; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxGraphics, cxEdit, cxDropDownEdit, cxCalendar, StdCtrls, + cxControls, cxContainer, cxTextEdit, cxMaskEdit, TBXDkPanels, + cxEditRepositoryItems, dxLayoutControl, dxLayoutLookAndFeels, uViewBase, + Mask, JvExMask, JvToolEdit, TB2Dock; + +type + IViewPeriodoFechas = interface + ['{793084E2-873E-4C57-8BD6-9087816CCF3A}'] + end; + + TfrViewPeriodoFechas = class(TfrViewBase, IViewPeriodoFechas) + cxRepository: TcxEditRepository; + cxRepositoryPeriodos: TcxEditRepositoryComboBoxItem; + dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList; + dxLayoutStandardLookAndFeel1: TdxLayoutStandardLookAndFeel; + TBXDockablePanel1: TTBXDockablePanel; + dxLayoutControl1: TdxLayoutControl; + cbPeriodo: TcxComboBox; + edtFechaIni: TcxDateEdit; + edtFechaFin: TcxDateEdit; + dxLayoutGroup1: TdxLayoutGroup; + dxLayoutGroup2: TdxLayoutGroup; + dxLayoutControl1Item2: TdxLayoutItem; + dxLayoutControl1Item3: TdxLayoutItem; + dxLayoutItem1: TdxLayoutItem; + procedure cbPeriodoPropertiesChange(Sender: TObject); + procedure edtFechaIni2PropertiesValidate(Sender: TObject; + var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); + procedure edtFechaFinPropertiesValidate(Sender: TObject; + var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); + private + function GetFechaFinal: TDateTime; + function GetFechaInicial: TDateTime; + procedure SetFechaFinal(const Value: TDateTime); + procedure SetFechaInicial(const Value: TDateTime); + public + procedure Hoy; + procedure Ayer; + procedure EstaSemana; + procedure EsteMes; + procedure EsteAno; + procedure Ultimos7dias; + procedure Ultimos30dias; + procedure Ultimos3meses; + procedure MesAnterior; + procedure AnoAnterior; + procedure Personalizado; + property FechaInicial : TDateTime read GetFechaInicial write SetFechaInicial; + property FechaFinal : TDateTime read GetFechaFinal write SetFechaFinal; + constructor Create(AOwner: TComponent); override; + end; + +implementation + +uses DateUtils; + +{$R *.dfm} + +procedure TfrViewPeriodoFechas.AnoAnterior; +begin + edtFechaIni.Date := StartOfTheYear(IncYear(Today, -1)); + edtFechaFin.Date := EndOfTheYear(IncYear(Today, -1)); +end; + +procedure TfrViewPeriodoFechas.Ayer; +begin + edtFechaIni.Date := Yesterday; + edtFechaFin.Date := Yesterday; +end; + +procedure TfrViewPeriodoFechas.EstaSemana; +begin + edtFechaIni.Date := StartOfTheWeek(Today); + edtFechaFin.Date := EndOfTheWeek(Today); +end; + +procedure TfrViewPeriodoFechas.EsteAno; +begin + edtFechaIni.Date := StartOfTheYear(Today); + edtFechaFin.Date := EndOfTheYear(Today); +end; + +procedure TfrViewPeriodoFechas.EsteMes; +begin + edtFechaIni.Date := StartOfTheMonth(Today); + edtFechaFin.Date := EndOfTheMonth(Today); +end; + +function TfrViewPeriodoFechas.GetFechaFinal: TDateTime; +begin + Result := DateOf(edtFechaFin.Date); +end; + +function TfrViewPeriodoFechas.GetFechaInicial: TDateTime; +begin + Result := DateOf(edtFechaIni.Date); +end; + +procedure TfrViewPeriodoFechas.Hoy; +begin + edtFechaIni.Date := Today; + edtFechaFin.Date := Today; +end; + +procedure TfrViewPeriodoFechas.MesAnterior; +begin + edtFechaIni.Date := StartOfTheMonth(IncMonth(Today, -1)); + edtFechaFin.Date := EndOfTheMonth(IncMonth(Today, -1)); +end; + +procedure TfrViewPeriodoFechas.Personalizado; +begin + edtFechaIni.SetFocus; +end; + +procedure TfrViewPeriodoFechas.SetFechaFinal(const Value: TDateTime); +begin + edtFechaFin.Date := Value; +end; + +procedure TfrViewPeriodoFechas.SetFechaInicial(const Value: TDateTime); +begin + edtFechaIni.Date := Value; +end; + +procedure TfrViewPeriodoFechas.Ultimos30dias; +begin + edtFechaIni.Date := IncDay(Today, -30); + edtFechaFin.Date := Today +end; + +procedure TfrViewPeriodoFechas.Ultimos3meses; +begin + edtFechaIni.Date := IncMonth(Today, -3); + edtFechaFin.Date := Today +end; + +procedure TfrViewPeriodoFechas.Ultimos7dias; +begin + edtFechaIni.Date := IncDay(Today, -7); + edtFechaFin.Date := Today +end; + +procedure TfrViewPeriodoFechas.cbPeriodoPropertiesChange(Sender: TObject); +begin + case (Sender as TcxComboBox).ItemIndex of + 0 : Hoy; + 1 : Ayer; + 2 : EstaSemana; + 3 : EsteMes; + 4 : EsteAno; + 5 : Ultimos7dias; + 6 : Ultimos30dias; + 7 : Ultimos3meses; + 8 : MesAnterior; + 9 : AnoAnterior; + else + Personalizado; + end; +end; + +constructor TfrViewPeriodoFechas.Create(AOwner: TComponent); +begin + inherited; + cbPeriodo.ItemIndex := 3; + EsteMes; +end; + +procedure TfrViewPeriodoFechas.edtFechaIni2PropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); +begin + inherited; + if DisplayValue <> edtFechaIni.Date then + cbPeriodo.ItemIndex := 12; + if DisplayValue > edtFechaFin.Date then + begin + edtFechaFin.EditText := DisplayValue; + edtFechaFin.ValidateEdit(True); + end; +end; + +procedure TfrViewPeriodoFechas.edtFechaFinPropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); +begin + inherited; + if DisplayValue <> edtFechaFin.Date then + cbPeriodo.ItemIndex := 12; + if DisplayValue < edtFechaIni.Date then + begin + edtFechaIni.EditText := DisplayValue; + edtFechaIni.ValidateEdit(True); + end; +end; + +end. + diff --git a/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.pas.bak b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.pas.bak new file mode 100644 index 00000000..c937783b --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewPeriodoFechas.pas.bak @@ -0,0 +1,206 @@ +unit uViewPeriodoFechas; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxGraphics, cxEdit, cxDropDownEdit, cxCalendar, StdCtrls, + cxControls, cxContainer, cxTextEdit, cxMaskEdit, TBXDkPanels, + cxEditRepositoryItems, dxLayoutControl, dxLayoutLookAndFeels, uViewBase, + Mask, JvExMask, JvToolEdit, uViewInformeBaseParametros, TB2Dock; + +type + IViewPeriodoFechas = interface(IViewInformeBaseParametros) + ['{793084E2-873E-4C57-8BD6-9087816CCF3A}'] + end; + + TfrViewPeriodoFechas = class(TfrViewInformeBaseParametros, IViewPeriodoFechas) + cxRepository: TcxEditRepository; + cxRepositoryPeriodos: TcxEditRepositoryComboBoxItem; + dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList; + dxLayoutStandardLookAndFeel1: TdxLayoutStandardLookAndFeel; + TBXDockablePanel1: TTBXDockablePanel; + dxLayoutControl1: TdxLayoutControl; + cbPeriodo: TcxComboBox; + edtFechaIni: TcxDateEdit; + edtFechaFin: TcxDateEdit; + dxLayoutGroup1: TdxLayoutGroup; + dxLayoutGroup2: TdxLayoutGroup; + dxLayoutControl1Item2: TdxLayoutItem; + dxLayoutControl1Item3: TdxLayoutItem; + dxLayoutItem1: TdxLayoutItem; + procedure cbPeriodoPropertiesChange(Sender: TObject); + procedure edtFechaIni2PropertiesValidate(Sender: TObject; + var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); + procedure edtFechaFinPropertiesValidate(Sender: TObject; + var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); + private + function GetFechaFinal: TDateTime; + function GetFechaInicial: TDateTime; + procedure SetFechaFinal(const Value: TDateTime); + procedure SetFechaInicial(const Value: TDateTime); + public + procedure Hoy; + procedure Ayer; + procedure EstaSemana; + procedure EsteMes; + procedure EsteAno; + procedure Ultimos7dias; + procedure Ultimos30dias; + procedure Ultimos3meses; + procedure MesAnterior; + procedure AnoAnterior; + procedure Personalizado; + property FechaInicial : TDateTime read GetFechaInicial write SetFechaInicial; + property FechaFinal : TDateTime read GetFechaFinal write SetFechaFinal; + constructor Create(AOwner: TComponent); override; + end; + +implementation + +uses DateUtils; + +{$R *.dfm} + +procedure TfrViewPeriodoFechas.AnoAnterior; +begin + edtFechaIni.Date := StartOfTheYear(IncYear(Today, -1)); + edtFechaFin.Date := EndOfTheYear(IncYear(Today, -1)); +end; + +procedure TfrViewPeriodoFechas.Ayer; +begin + edtFechaIni.Date := Yesterday; + edtFechaFin.Date := Yesterday; +end; + +procedure TfrViewPeriodoFechas.EstaSemana; +begin + edtFechaIni.Date := StartOfTheWeek(Today); + edtFechaFin.Date := EndOfTheWeek(Today); +end; + +procedure TfrViewPeriodoFechas.EsteAno; +begin + edtFechaIni.Date := StartOfTheYear(Today); + edtFechaFin.Date := EndOfTheYear(Today); +end; + +procedure TfrViewPeriodoFechas.EsteMes; +begin + edtFechaIni.Date := StartOfTheMonth(Today); + edtFechaFin.Date := EndOfTheMonth(Today); +end; + +function TfrViewPeriodoFechas.GetFechaFinal: TDateTime; +begin + Result := DateOf(edtFechaFin.Date); +end; + +function TfrViewPeriodoFechas.GetFechaInicial: TDateTime; +begin + Result := DateOf(edtFechaIni.Date); +end; + +procedure TfrViewPeriodoFechas.Hoy; +begin + edtFechaIni.Date := Today; + edtFechaFin.Date := Today; +end; + +procedure TfrViewPeriodoFechas.MesAnterior; +begin + edtFechaIni.Date := StartOfTheMonth(IncMonth(Today, -1)); + edtFechaFin.Date := EndOfTheMonth(IncMonth(Today, -1)); +end; + +procedure TfrViewPeriodoFechas.Personalizado; +begin + edtFechaIni.SetFocus; +end; + +procedure TfrViewPeriodoFechas.SetFechaFinal(const Value: TDateTime); +begin + edtFechaFin.Date := Value; +end; + +procedure TfrViewPeriodoFechas.SetFechaInicial(const Value: TDateTime); +begin + edtFechaIni.Date := Value; +end; + +procedure TfrViewPeriodoFechas.Ultimos30dias; +begin + edtFechaIni.Date := IncDay(Today, -30); + edtFechaFin.Date := Today +end; + +procedure TfrViewPeriodoFechas.Ultimos3meses; +begin + edtFechaIni.Date := IncMonth(Today, -3); + edtFechaFin.Date := Today +end; + +procedure TfrViewPeriodoFechas.Ultimos7dias; +begin + edtFechaIni.Date := IncDay(Today, -7); + edtFechaFin.Date := Today +end; + +procedure TfrViewPeriodoFechas.cbPeriodoPropertiesChange(Sender: TObject); +begin + case (Sender as TcxComboBox).ItemIndex of + 0 : Hoy; + 1 : Ayer; + 2 : EstaSemana; + 3 : EsteMes; + 4 : EsteAno; + 5 : Ultimos7dias; + 6 : Ultimos30dias; + 7 : Ultimos3meses; + 8 : MesAnterior; + 9 : AnoAnterior; + else + Personalizado; + end; +end; + +constructor TfrViewPeriodoFechas.Create(AOwner: TComponent); +begin + inherited; + cbPeriodo.ItemIndex := 3; + EsteMes; +end; + +procedure TfrViewPeriodoFechas.edtFechaIni2PropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); +begin + inherited; + if DisplayValue <> edtFechaIni.Date then + cbPeriodo.ItemIndex := 12; + if DisplayValue > edtFechaFin.Date then + begin + edtFechaFin.EditText := DisplayValue; + edtFechaFin.ValidateEdit(True); + end; +end; + +procedure TfrViewPeriodoFechas.edtFechaFinPropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); +begin + inherited; + if DisplayValue <> edtFechaFin.Date then + cbPeriodo.ItemIndex := 12; + if DisplayValue < edtFechaIni.Date then + begin + edtFechaIni.EditText := DisplayValue; + edtFechaIni.ValidateEdit(True); + end; +end; + +end. +