diff --git a/Build/Build.fbl6 b/Build/Build.fbl6 index 40e1751..a684bfd 100644 Binary files a/Build/Build.fbl6 and b/Build/Build.fbl6 differ diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 0199316..794612f 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -13,6 +13,12 @@ DEFAULT CHARACTER SET ISO8859_1; /**** User Defined Functions ****/ /******************************************************************************/ +DECLARE EXTERNAL FUNCTION DIV + INTEGER, + INTEGER +RETURNS DOUBLE PRECISION BY VALUE +ENTRY_POINT 'IB_UDF_div' MODULE_NAME 'ib_udf'; + DECLARE EXTERNAL FUNCTION F_RTFTOTEXT CString(32767) RETURNS CString(32767) @@ -257,6 +263,13 @@ SET GENERATOR GEN_USUARIOS_ID TO 1; /**** Tables ****/ /******************************************************************************/ +CREATE TABLE PERIODOS_AUX ( + ID INTEGER, + PERIODO VARCHAR(20) COLLATE ES_ES, + VALOR SMALLINT, + DESCRIPCION VARCHAR(20) COLLATE ES_ES +); + CREATE TABLE IMPRESIONES ( ID TIPO_ID NOT NULL /* TIPO_ID = INTEGER */, ID_TABLA TIPO_ID /* TIPO_ID = INTEGER */, @@ -4125,6 +4138,72 @@ AND (ARTICULOS.ID is not null) AND (ARTICULOS.COMISIONABLE = 1) ; +CREATE VIEW V_INF_FAC_CLIENTE_TOTAL_ANO( + ID_EMPRESA, + ANO, + IMPORTE_TOTAL) +AS +select ID_EMPRESA, EXTRACT(YEAR FROM FECHA_FACTURA) as ANO, SUM(IMPORTE_TOTAL) as IMPORTE_TOTAL +from FACTURAS_CLIENTE +group by 1,2 +; + +CREATE VIEW V_INF_FAC_PROVEEDOR_TOTAL_ANO( + ID_EMPRESA, + ANO, + IMPORTE_TOTAL) +AS +select ID_EMPRESA, EXTRACT(YEAR FROM FECHA_FACTURA) as ANO, SUM(IMPORTE_TOTAL) as IMPORTE_TOTAL +from FACTURAS_PROVEEDOR +group by 1,2 +; + +CREATE VIEW V_INF_FAC_CLIENTE( + ID_EMPRESA, + ANO, + SEMESTRE, + TRIMESTRE, + MES, + FECHA_FACTURA, + ID_CLIENTE, + NOMBRE, + IMPORTE_DESCUENTO, + IMPORTE_TOTAL, + IMPORTE_TOTAL_ANO) +AS +select f.ID_EMPRESA, EXTRACT(YEAR FROM f.FECHA_FACTURA) as ANO, +CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA),8)+1) AS SMALLINT) as SEMESTRE, +CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA),4)+1) AS SMALLINT) as TRIMESTRE, +EXTRACT(MONTH FROM f.FECHA_FACTURA) as MES, +f.FECHA_FACTURA, f.ID_CLIENTE, f.NOMBRE, f.IMPORTE_DESCUENTO, f.IMPORTE_TOTAL, v.importe_total as IMPORTE_TOTAL_ANO +from FACTURAS_CLIENTE f +inner join V_INF_FAC_CLIENTE_TOTAL_ANO v on ((v.id_empresa = f.id_empresa) and (v.Ano = EXTRACT(YEAR FROM f.FECHA_FACTURA))) +order by 1,2,3,4,5 asc +; + +CREATE VIEW V_INF_FAC_PROVEEDOR( + ID_EMPRESA, + ANO, + SEMESTRE, + TRIMESTRE, + MES, + FECHA_FACTURA, + ID_PROVEEDOR, + NOMBRE, + IMPORTE_DESCUENTO, + IMPORTE_TOTAL, + IMPORTE_TOTAL_ANO) +AS +select f.ID_EMPRESA, EXTRACT(YEAR FROM f.FECHA_FACTURA) as ANO, +CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA),8)+1) AS SMALLINT) as SEMESTRE, +CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA),4)+1) AS SMALLINT) as TRIMESTRE, +EXTRACT(MONTH FROM f.FECHA_FACTURA) as MES, +f.FECHA_FACTURA, f.ID_PROVEEDOR, f.NOMBRE, f.IMPORTE_DESCUENTO, f.IMPORTE_TOTAL, v.importe_total as IMPORTE_TOTAL_ANO +from FACTURAS_PROVEEDOR f +inner join V_INF_FAC_PROVEEDOR_TOTAL_ANO v on ((v.id_empresa = f.id_empresa) and (v.Ano = EXTRACT(YEAR FROM f.FECHA_FACTURA))) +order by 1,2,3,4,5 asc +; + /******************************************************************************/ /**** Primary Keys ****/ /******************************************************************************/ diff --git a/Database/scripts/factuges_sysdata.sql b/Database/scripts/factuges_sysdata.sql index 4a7505f..91d50f1 100644 --- a/Database/scripts/factuges_sysdata.sql +++ b/Database/scripts/factuges_sysdata.sql @@ -2,6 +2,26 @@ SET SQL DIALECT 3; SET NAMES UTF8; +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (1, 'MENSUAL', 1, 'Ene'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (2, 'MENSUAL', 2, 'Feb'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (3, 'MENSUAL', 3, 'Mar'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (4, 'MENSUAL', 4, 'Abr'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (5, 'MENSUAL', 5, 'May'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (6, 'MENSUAL', 6, 'Jun'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (7, 'MENSUAL', 7, 'Jul'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (8, 'MENSUAL', 8, 'Ago'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (9, 'MENSUAL', 9, 'Sep'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (10, 'MENSUAL', 10, 'Oct'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (11, 'MENSUAL', 11, 'Nov'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (12, 'MENSUAL', 12, 'Dic'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (13, 'SEMESTRAL', 1, 'Primer semestre'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (14, 'SEMESTRAL', 2, 'Segundo semestre'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (15, 'TRIMESTRAL', 1, 'Primer trimestre'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (16, 'TRIMESTRAL', 2, 'Segundo trimestre'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (17, 'TRIMESTRAL', 3, 'Tercer trimestre'); +INSERT INTO PERIODOS_AUX (ID, PERIODO, VALOR, DESCRIPCION) VALUES (18, 'TRIMESTRAL', 4, 'Cuarto trimestre'); +COMMIT WORK; + INSERT INTO CATEGORIAS (ID, CATEGORIA) VALUES (1, 'CLIENTE'); INSERT INTO CATEGORIAS (ID, CATEGORIA) VALUES (2, 'PROVEEDOR'); INSERT INTO CATEGORIAS (ID, CATEGORIA) VALUES (3, 'AGENTE'); diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index bbd92a3..92998e3 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -45,6 +45,8 @@ Package FalseTrueFalseLibreria base de FactuGESFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 + + Microsoft Office 2000 Sample Automation Server Wrapper Components Microsoft Office XP Sample Automation Server Wrapper Components Base.dpk @@ -58,63 +60,63 @@
DataModuleImpresiones
TDataModule + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DataModuleRegistroCorreos
TDataModule
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fConfigurarConexion
TForm diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index abe386c..6ca73f3 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -53,7 +53,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse4110FalseFalseFalseFalseFalse30821252Rodax Software S.L.4.1.1.0FactuGESFactuGES4.1.1.0FactuGES.dprFalse +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse4120FalseFalseFalseFalseFalse30821252Rodax Software S.L.4.1.2.0FactuGESFactuGES4.1.2.0FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index 83a8c67..d20d366 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 4,1,0,0 -PRODUCTVERSION 4,1,0,0 +FILEVERSION 4,1,2,0 +PRODUCTVERSION 4,1,2,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "4.1.0.0\0" + VALUE "FileVersion", "4.1.2.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "4.1.0.0\0" + VALUE "ProductVersion", "4.1.2.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index eb36dcb..372bc84 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Cliente/uBootStrap.pas b/Source/Cliente/uBootStrap.pas index 9bb858b..53f29c7 100644 --- a/Source/Cliente/uBootStrap.pas +++ b/Source/Cliente/uBootStrap.pas @@ -52,7 +52,7 @@ begin LoadModule('Inventario_plugin.bpl'); LoadModule('HistoricoMovimientos_plugin.bpl'); -// LoadModule('GestorInformes_plugin.bpl'); + LoadModule('GestorInformes_plugin.bpl'); LoadModule('Comisiones_plugin.bpl'); LoadModule('BancaElectronica_plugin.bpl'); LoadModule('TiendaWeb_plugin.bpl'); diff --git a/Source/GUIBase/uEditorPreview.pas b/Source/GUIBase/uEditorPreview.pas index d4a6df2..bd09d01 100644 --- a/Source/GUIBase/uEditorPreview.pas +++ b/Source/GUIBase/uEditorPreview.pas @@ -171,7 +171,7 @@ type function GetTitle: string; procedure PonerTitulos(const ATitulo: String = ''); override; function GetController : IControllerBase; - procedure SetController (const Value : IControllerBase); + procedure SetController (const Value : IControllerBase); virtual; procedure SetListaID (const Value : TIntegerList); function GetListaID : TIntegerList; diff --git a/Source/Informes/1/InformeIVAClientes.fr3 b/Source/Informes/1/InformeIVAClientes.fr3 index 26ad5a3..9228acf 100644 --- a/Source/Informes/1/InformeIVAClientes.fr3 +++ b/Source/Informes/1/InformeIVAClientes.fr3 @@ -1,61 +1,61 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/Source/Informes/1/InformeIVAClientesDesglosado.fr3 b/Source/Informes/1/InformeIVAClientesDesglosado.fr3 index a83d27e..8fdb2c3 100644 --- a/Source/Informes/1/InformeIVAClientesDesglosado.fr3 +++ b/Source/Informes/1/InformeIVAClientesDesglosado.fr3 @@ -1,64 +1,64 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - + diff --git a/Source/Informes/1/InformeIVAProveedores.fr3 b/Source/Informes/1/InformeIVAProveedores.fr3 index fbabd19..6a7a040 100644 --- a/Source/Informes/1/InformeIVAProveedores.fr3 +++ b/Source/Informes/1/InformeIVAProveedores.fr3 @@ -1,62 +1,62 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - + + + + + diff --git a/Source/Informes/1/InformeIVAProveedoresDesglosado.fr3 b/Source/Informes/1/InformeIVAProveedoresDesglosado.fr3 index 23916d5..b7f52f8 100644 --- a/Source/Informes/1/InformeIVAProveedoresDesglosado.fr3 +++ b/Source/Informes/1/InformeIVAProveedoresDesglosado.fr3 @@ -1,65 +1,65 @@ - + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - + diff --git a/Source/Informes/1/InformeListadoFacturasCliente.fr3 b/Source/Informes/1/InformeListadoFacturasCliente.fr3 index 125e3a9..cf2cb06 100644 --- a/Source/Informes/1/InformeListadoFacturasCliente.fr3 +++ b/Source/Informes/1/InformeListadoFacturasCliente.fr3 @@ -1,63 +1,63 @@ - + - - - - - - + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/Source/Informes/1/InformeListadoFacturasClienteDesglosado.fr3 b/Source/Informes/1/InformeListadoFacturasClienteDesglosado.fr3 index 87ba4bf..0da747a 100644 --- a/Source/Informes/1/InformeListadoFacturasClienteDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoFacturasClienteDesglosado.fr3 @@ -1,67 +1,67 @@ - + - - - - - - + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - + diff --git a/Source/Informes/1/InformeListadoFacturasClienteGrafComp.fr3 b/Source/Informes/1/InformeListadoFacturasClienteGrafComp.fr3 new file mode 100644 index 0000000..535a2f7 --- /dev/null +++ b/Source/Informes/1/InformeListadoFacturasClienteGrafComp.fr3 @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/1/InformeListadoFacturasClientePendientes.fr3 b/Source/Informes/1/InformeListadoFacturasClientePendientes.fr3 index d606d18..04878a5 100644 --- a/Source/Informes/1/InformeListadoFacturasClientePendientes.fr3 +++ b/Source/Informes/1/InformeListadoFacturasClientePendientes.fr3 @@ -1,39 +1,39 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + diff --git a/Source/Informes/1/InformeListadoFacturasClientePendientesDesglosado.fr3 b/Source/Informes/1/InformeListadoFacturasClientePendientesDesglosado.fr3 index 92daa20..2adf9b2 100644 --- a/Source/Informes/1/InformeListadoFacturasClientePendientesDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoFacturasClientePendientesDesglosado.fr3 @@ -1,42 +1,42 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + - + diff --git a/Source/Informes/1/InformeListadoFacturasProveedor.fr3 b/Source/Informes/1/InformeListadoFacturasProveedor.fr3 index 08c222b..5cfb246 100644 --- a/Source/Informes/1/InformeListadoFacturasProveedor.fr3 +++ b/Source/Informes/1/InformeListadoFacturasProveedor.fr3 @@ -1,63 +1,63 @@ - + - - - - - - + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + diff --git a/Source/Informes/1/InformeListadoFacturasProveedorDesglosado.fr3 b/Source/Informes/1/InformeListadoFacturasProveedorDesglosado.fr3 index fc826c3..dda1102 100644 --- a/Source/Informes/1/InformeListadoFacturasProveedorDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoFacturasProveedorDesglosado.fr3 @@ -1,67 +1,67 @@ - + - - - - - - + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - + diff --git a/Source/Informes/1/InformeListadoFacturasProveedorGrafComp.fr3 b/Source/Informes/1/InformeListadoFacturasProveedorGrafComp.fr3 new file mode 100644 index 0000000..083b0bf --- /dev/null +++ b/Source/Informes/1/InformeListadoFacturasProveedorGrafComp.fr3 @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/1/InformeListadoFacturasProveedorPendientes.fr3 b/Source/Informes/1/InformeListadoFacturasProveedorPendientes.fr3 index 8b48839..3755b76 100644 --- a/Source/Informes/1/InformeListadoFacturasProveedorPendientes.fr3 +++ b/Source/Informes/1/InformeListadoFacturasProveedorPendientes.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - + + + - + - - + + - - - + + + - - + + diff --git a/Source/Informes/1/InformeListadoFacturasProveedorPendientesDesglosado.fr3 b/Source/Informes/1/InformeListadoFacturasProveedorPendientesDesglosado.fr3 index 66dbfd4..90e57a3 100644 --- a/Source/Informes/1/InformeListadoFacturasProveedorPendientesDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoFacturasProveedorPendientesDesglosado.fr3 @@ -1,58 +1,58 @@ - + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - + + - - - + + + - - + + - + diff --git a/Source/Informes/1/InformeListadoPedidos.fr3 b/Source/Informes/1/InformeListadoPedidos.fr3 index d53f918..c98e69d 100644 --- a/Source/Informes/1/InformeListadoPedidos.fr3 +++ b/Source/Informes/1/InformeListadoPedidos.fr3 @@ -1,53 +1,53 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + diff --git a/Source/Informes/1/InformeListadoPedidosDesglosado.fr3 b/Source/Informes/1/InformeListadoPedidosDesglosado.fr3 index 973c331..1b8b4eb 100644 --- a/Source/Informes/1/InformeListadoPedidosDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoPedidosDesglosado.fr3 @@ -1,56 +1,56 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/1/InformeListadoPresupuestos.fr3 b/Source/Informes/1/InformeListadoPresupuestos.fr3 index 7a6781b..cb4a8f6 100644 --- a/Source/Informes/1/InformeListadoPresupuestos.fr3 +++ b/Source/Informes/1/InformeListadoPresupuestos.fr3 @@ -1,53 +1,53 @@ - + - - - - - - + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - - + + + + - - - + + + - - - + + + diff --git a/Source/Informes/1/InformeListadoPresupuestosDesglosado.fr3 b/Source/Informes/1/InformeListadoPresupuestosDesglosado.fr3 index 118f5ee..f6e5b32 100644 --- a/Source/Informes/1/InformeListadoPresupuestosDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoPresupuestosDesglosado.fr3 @@ -1,56 +1,56 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/1/InformeListadoRecibosCliPendientes.fr3 b/Source/Informes/1/InformeListadoRecibosCliPendientes.fr3 index e474289..126d1e5 100644 --- a/Source/Informes/1/InformeListadoRecibosCliPendientes.fr3 +++ b/Source/Informes/1/InformeListadoRecibosCliPendientes.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - + - - - + + + - - - + + + - - + + diff --git a/Source/Informes/1/InformeListadoRecibosCliPendientesDesglosado.fr3 b/Source/Informes/1/InformeListadoRecibosCliPendientesDesglosado.fr3 index 78b8dd0..d65cc73 100644 --- a/Source/Informes/1/InformeListadoRecibosCliPendientesDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoRecibosCliPendientesDesglosado.fr3 @@ -1,58 +1,58 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - + - - - + + + - - - + + + - - + + - + diff --git a/Source/Informes/1/InformeListadoRecibosCliente.fr3 b/Source/Informes/1/InformeListadoRecibosCliente.fr3 index 47ddd65..6dfc975 100644 --- a/Source/Informes/1/InformeListadoRecibosCliente.fr3 +++ b/Source/Informes/1/InformeListadoRecibosCliente.fr3 @@ -1,52 +1,52 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - + - - - + + + - - + + - - - + + + diff --git a/Source/Informes/1/InformeListadoRecibosClienteDesglosado.fr3 b/Source/Informes/1/InformeListadoRecibosClienteDesglosado.fr3 index 3b7324a..46d67e0 100644 --- a/Source/Informes/1/InformeListadoRecibosClienteDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoRecibosClienteDesglosado.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - - + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/1/InformeListadoRecibosProvPendientes.fr3 b/Source/Informes/1/InformeListadoRecibosProvPendientes.fr3 index 3e83274..342e477 100644 --- a/Source/Informes/1/InformeListadoRecibosProvPendientes.fr3 +++ b/Source/Informes/1/InformeListadoRecibosProvPendientes.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - + - - - + + + - - - + + + - - + + diff --git a/Source/Informes/1/InformeListadoRecibosProvPendientesDesglosado.fr3 b/Source/Informes/1/InformeListadoRecibosProvPendientesDesglosado.fr3 index 41ebe34..c135f24 100644 --- a/Source/Informes/1/InformeListadoRecibosProvPendientesDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoRecibosProvPendientesDesglosado.fr3 @@ -1,57 +1,57 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - - + + + - - + + - + diff --git a/Source/Informes/1/InformeListadoRecibosProveedor.fr3 b/Source/Informes/1/InformeListadoRecibosProveedor.fr3 index bfdd68a..325e646 100644 --- a/Source/Informes/1/InformeListadoRecibosProveedor.fr3 +++ b/Source/Informes/1/InformeListadoRecibosProveedor.fr3 @@ -1,51 +1,51 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - - - + + + - - + + - - - + + + diff --git a/Source/Informes/1/InformeListadoRecibosProveedorDesglosado.fr3 b/Source/Informes/1/InformeListadoRecibosProveedorDesglosado.fr3 index 72c5c63..b268fc3 100644 --- a/Source/Informes/1/InformeListadoRecibosProveedorDesglosado.fr3 +++ b/Source/Informes/1/InformeListadoRecibosProveedorDesglosado.fr3 @@ -1,54 +1,54 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/2/InformeListadoFacturasCliente.fr3 b/Source/Informes/2/InformeListadoFacturasCliente.fr3 index 8f71b0f..981899e 100644 --- a/Source/Informes/2/InformeListadoFacturasCliente.fr3 +++ b/Source/Informes/2/InformeListadoFacturasCliente.fr3 @@ -1,63 +1,63 @@ - + - - - - - - + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/Source/Informes/2/InformeListadoFacturasClienteDesglosado.fr3 b/Source/Informes/2/InformeListadoFacturasClienteDesglosado.fr3 index 59ac922..b5d3f4e 100644 --- a/Source/Informes/2/InformeListadoFacturasClienteDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoFacturasClienteDesglosado.fr3 @@ -1,66 +1,66 @@ - + - - - - - - + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - + diff --git a/Source/Informes/2/InformeListadoFacturasClienteGrafComp.fr3 b/Source/Informes/2/InformeListadoFacturasClienteGrafComp.fr3 new file mode 100644 index 0000000..f9755ca --- /dev/null +++ b/Source/Informes/2/InformeListadoFacturasClienteGrafComp.fr3 @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/2/InformeListadoFacturasClientePendientes.fr3 b/Source/Informes/2/InformeListadoFacturasClientePendientes.fr3 index 256d0bb..f5a6e56 100644 --- a/Source/Informes/2/InformeListadoFacturasClientePendientes.fr3 +++ b/Source/Informes/2/InformeListadoFacturasClientePendientes.fr3 @@ -1,39 +1,39 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + diff --git a/Source/Informes/2/InformeListadoFacturasClientePendientesDesglosado.fr3 b/Source/Informes/2/InformeListadoFacturasClientePendientesDesglosado.fr3 index 4987383..53126b5 100644 --- a/Source/Informes/2/InformeListadoFacturasClientePendientesDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoFacturasClientePendientesDesglosado.fr3 @@ -1,42 +1,42 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + - + diff --git a/Source/Informes/2/InformeListadoFacturasProveedor.fr3 b/Source/Informes/2/InformeListadoFacturasProveedor.fr3 index e92b6e3..7f4ed09 100644 --- a/Source/Informes/2/InformeListadoFacturasProveedor.fr3 +++ b/Source/Informes/2/InformeListadoFacturasProveedor.fr3 @@ -1,5 +1,5 @@ - + @@ -7,8 +7,8 @@ - - + + diff --git a/Source/Informes/2/InformeListadoFacturasProveedorDesglosado.fr3 b/Source/Informes/2/InformeListadoFacturasProveedorDesglosado.fr3 index 0aae7ef..c9c69cc 100644 --- a/Source/Informes/2/InformeListadoFacturasProveedorDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoFacturasProveedorDesglosado.fr3 @@ -1,69 +1,69 @@ - + - - - - - - - - + + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - + diff --git a/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 b/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 new file mode 100644 index 0000000..cbb96ba --- /dev/null +++ b/Source/Informes/2/InformeListadoFacturasProveedorGrafComp.fr3 @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/2/InformeListadoFacturasProveedorPendientes.fr3 b/Source/Informes/2/InformeListadoFacturasProveedorPendientes.fr3 index 08f01fe..7463443 100644 --- a/Source/Informes/2/InformeListadoFacturasProveedorPendientes.fr3 +++ b/Source/Informes/2/InformeListadoFacturasProveedorPendientes.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - + + - - - + + + - - + + diff --git a/Source/Informes/2/InformeListadoFacturasProveedorPendientesDesglosado.fr3 b/Source/Informes/2/InformeListadoFacturasProveedorPendientesDesglosado.fr3 index e43a37b..0d61e22 100644 --- a/Source/Informes/2/InformeListadoFacturasProveedorPendientesDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoFacturasProveedorPendientesDesglosado.fr3 @@ -1,58 +1,58 @@ - + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - + + - - - + + + - - + + - + diff --git a/Source/Informes/2/InformeListadoPedidos.fr3 b/Source/Informes/2/InformeListadoPedidos.fr3 index 9d97bfd..b86518b 100644 --- a/Source/Informes/2/InformeListadoPedidos.fr3 +++ b/Source/Informes/2/InformeListadoPedidos.fr3 @@ -1,53 +1,53 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + diff --git a/Source/Informes/2/InformeListadoPedidosDesglosado.fr3 b/Source/Informes/2/InformeListadoPedidosDesglosado.fr3 index 30a76f6..6693ab9 100644 --- a/Source/Informes/2/InformeListadoPedidosDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoPedidosDesglosado.fr3 @@ -1,56 +1,56 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/2/InformeListadoPresupuestos.fr3 b/Source/Informes/2/InformeListadoPresupuestos.fr3 index 233c06d..575ce5a 100644 --- a/Source/Informes/2/InformeListadoPresupuestos.fr3 +++ b/Source/Informes/2/InformeListadoPresupuestos.fr3 @@ -1,53 +1,53 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + diff --git a/Source/Informes/2/InformeListadoPresupuestosDesglosado.fr3 b/Source/Informes/2/InformeListadoPresupuestosDesglosado.fr3 index de86647..41eec88 100644 --- a/Source/Informes/2/InformeListadoPresupuestosDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoPresupuestosDesglosado.fr3 @@ -1,56 +1,56 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/2/InformeListadoRecibosCliPendientes.fr3 b/Source/Informes/2/InformeListadoRecibosCliPendientes.fr3 index 191ae4b..bfd2bb1 100644 --- a/Source/Informes/2/InformeListadoRecibosCliPendientes.fr3 +++ b/Source/Informes/2/InformeListadoRecibosCliPendientes.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - + - - - + + + - - - + + + - - + + diff --git a/Source/Informes/2/InformeListadoRecibosCliPendientesDesglosado.fr3 b/Source/Informes/2/InformeListadoRecibosCliPendientesDesglosado.fr3 index bd598f6..883c542 100644 --- a/Source/Informes/2/InformeListadoRecibosCliPendientesDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoRecibosCliPendientesDesglosado.fr3 @@ -1,58 +1,58 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - + - - - + + + - - - + + + - - + + - + diff --git a/Source/Informes/2/InformeListadoRecibosCliente.fr3 b/Source/Informes/2/InformeListadoRecibosCliente.fr3 index e11ffda..6d155de 100644 --- a/Source/Informes/2/InformeListadoRecibosCliente.fr3 +++ b/Source/Informes/2/InformeListadoRecibosCliente.fr3 @@ -1,52 +1,52 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - + - - - + + + - - + + - - - + + + diff --git a/Source/Informes/2/InformeListadoRecibosClienteDesglosado.fr3 b/Source/Informes/2/InformeListadoRecibosClienteDesglosado.fr3 index bc4c287..9049eb8 100644 --- a/Source/Informes/2/InformeListadoRecibosClienteDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoRecibosClienteDesglosado.fr3 @@ -1,55 +1,55 @@ - + - - - - - - + + + + + + - - + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - + + - - - + + + - - + + - - - + + + - + diff --git a/Source/Informes/2/InformeListadoRecibosProvPendientes.fr3 b/Source/Informes/2/InformeListadoRecibosProvPendientes.fr3 index 7a0e59c..7ef32ff 100644 --- a/Source/Informes/2/InformeListadoRecibosProvPendientes.fr3 +++ b/Source/Informes/2/InformeListadoRecibosProvPendientes.fr3 @@ -1,54 +1,54 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - - + + + - - + + diff --git a/Source/Informes/2/InformeListadoRecibosProvPendientesDesglosado.fr3 b/Source/Informes/2/InformeListadoRecibosProvPendientesDesglosado.fr3 index 5dbdb29..7b27c41 100644 --- a/Source/Informes/2/InformeListadoRecibosProvPendientesDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoRecibosProvPendientesDesglosado.fr3 @@ -1,57 +1,57 @@ - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - - + + + - - + + - + diff --git a/Source/Informes/2/InformeListadoRecibosProveedor.fr3 b/Source/Informes/2/InformeListadoRecibosProveedor.fr3 index 52dcd98..410f6fc 100644 --- a/Source/Informes/2/InformeListadoRecibosProveedor.fr3 +++ b/Source/Informes/2/InformeListadoRecibosProveedor.fr3 @@ -1,51 +1,51 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - + + - - - + + + - - + + - - + + diff --git a/Source/Informes/2/InformeListadoRecibosProveedorDesglosado.fr3 b/Source/Informes/2/InformeListadoRecibosProveedorDesglosado.fr3 index e8abe49..f4daab9 100644 --- a/Source/Informes/2/InformeListadoRecibosProveedorDesglosado.fr3 +++ b/Source/Informes/2/InformeListadoRecibosProveedorDesglosado.fr3 @@ -1,54 +1,54 @@ - + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - + + - - - + + + - - + + - - + + - + diff --git a/Source/Informes/CertificadoTrabajos.rdx b/Source/Informes/CertificadoTrabajos.rdx deleted file mode 100644 index 473290a..0000000 Binary files a/Source/Informes/CertificadoTrabajos.rdx and /dev/null differ diff --git a/Source/Informes/InfFichaEmpleado.fr3 b/Source/Informes/InfFichaEmpleado.fr3 deleted file mode 100644 index 75b3433..0000000 --- a/Source/Informes/InfFichaEmpleado.fr3 +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/Informes/Marca ISO.JPG b/Source/Informes/Marca ISO.JPG deleted file mode 100644 index d7dbd6f..0000000 Binary files a/Source/Informes/Marca ISO.JPG and /dev/null differ diff --git a/Source/Informes/f.gif b/Source/Informes/f.gif deleted file mode 100644 index 7912bff..0000000 Binary files a/Source/Informes/f.gif and /dev/null differ diff --git a/Source/Informes/f.jpg b/Source/Informes/f.jpg deleted file mode 100644 index 15d042a..0000000 Binary files a/Source/Informes/f.jpg and /dev/null differ diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm index ccf3895..ad9596a 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm @@ -2,11 +2,536 @@ object RptFacturasCliente: TRptFacturasCliente OldCreateOrder = True OnCreate = DataModuleCreate OnDestroy = DataModuleDestroy - Height = 513 - Width = 933 + Height = 678 + Width = 977 object schReport: TDASchema ConnectionManager = dmServer.ConnectionManager Datasets = < + item + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select P.ANO, C.REFERENCIA, COALESCE(C.NOMBRE, P.NOMBRE) as NOMB' + + 'RE,'#10'SUM(P.IMPORTE_DESCUENTO) as IMPORTE_DESCUENTO, SUM(P.IMPORTE' + + '_TOTAL) as IMPORTE_TOTAL,'#10'(SUM(P.IMPORTE_TOTAL) - SUM(P.IMPORTE_' + + 'DESCUENTO)) as IMPORTE_COBRADO,'#10'case when SUM(P.IMPORTE_TOTAL) =' + + ' 0 then 0'#10'else ((SUM(P.IMPORTE_DESCUENTO) * 100) / SUM(P.IMPORTE' + + '_TOTAL)) end as PORCENTAJE'#10#10'from V_INF_FAC_CLIENTE P'#10'left join C' + + 'ONTACTOS C on P.ID_CLIENTE = C.ID'#10#10'where p.ID_EMPRESA = :ID_EMPR' + + 'ESA'#10'and P.ANO = :ANO'#10'group by 1,2,3'#10'order by 1,5 desc'#10'rows 1 to ' + + ':NTOP'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ANO' + TableField = 'ANO' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'IMPORTE_DESCUENTO' + TableField = 'IMPORTE_DESCUENTO' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'IMPORTE_COBRADO' + TableField = 'IMPORTE_COBRADO' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoClientesMayorDescuentoResumen' + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_DESCUENTO' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'IMPORTE_COBRADO' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' + + 'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' + + '1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' + + 'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' + + 'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' + + ') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' + + 'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' + + #10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' + + 'O, SEMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10 + + 'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and' + + ' (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 on' + + ' (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA, c' + + 'omp2.ANO, SEMESTRE as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMPORTE' + + '_TOTAL'#10'from V_INF_FAC_CLIENTE comp2'#10'where ID_EMPRESA = :ID_EMPRE' + + 'SA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) peri' + + 'odo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'SEMESTRAL'#39#10'ord' + + 'er by valor asc'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'VALOR' + TableField = 'VALOR' + end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'ANO1' + TableField = 'ANO1' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'ANO2' + TableField = 'ANO2' + end + item + DatasetField = 'IMPORTE_TOTAL1' + TableField = 'IMPORTE_TOTAL1' + end + item + DatasetField = 'DIFERENCIA' + TableField = 'DIFERENCIA' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoFacturasGrafCompSemestral' + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' + + 'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' + + '1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' + + 'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' + + 'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' + + ') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' + + 'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' + + #10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' + + 'O, MES as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from ' + + 'V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (ANO' + + ' = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 on (VAL' + + 'OR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA, comp2.' + + 'ANO, MES as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'fro' + + 'm V_INF_FAC_CLIENTE comp2'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (A' + + 'NO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo2 on (V' + + 'ALOR = periodo2.NFILA)'#10#10'where periodo= '#39'MENSUAL'#39#10'order by valor ' + + 'asc'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'VALOR' + TableField = 'VALOR' + end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'ANO1' + TableField = 'ANO1' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'ANO2' + TableField = 'ANO2' + end + item + DatasetField = 'IMPORTE_TOTAL1' + TableField = 'IMPORTE_TOTAL1' + end + item + DatasetField = 'DIFERENCIA' + TableField = 'DIFERENCIA' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoFacturasGrafCompMensual' + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select P.ANO, C.REFERENCIA, COALESCE(C.NOMBRE, P.NOMBRE) as NOMB' + + 'RE, p.Importe_TOTAL_ANO,'#10'COUNT(P.FECHA_FACTURA) as NUMFAC, SUM(P' + + '.IMPORTE_TOTAL) as IMPORTE_TOTAL,'#10'((SUM(P.IMPORTE_TOTAL)*100)/p.' + + 'Importe_TOTAL_ANO) as PORCENTAJE'#10#10'from V_INF_FAC_CLIENTE P'#10'left ' + + 'join CONTACTOS C on P.ID_CLIENTE = C.ID'#10#10'where p.ID_EMPRESA = :I' + + 'D_EMPRESA'#10'and P.ANO = :ANO'#10'group by 1,2,3,4'#10'order by 1,6 desc'#10'ro' + + 'ws 1 to :NTOP'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ANO' + TableField = 'ANO' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'IMPORTE_TOTAL_ANO' + TableField = 'IMPORTE_TOTAL_ANO' + end + item + DatasetField = 'NUMFAC' + TableField = 'NUMFAC' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoClientesMayorFacturacionResumen' + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_TOTAL_ANO' + DataType = datCurrency + end + item + Name = 'NUMFAC' + DataType = datInteger + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' + + 'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' + + '1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' + + 'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' + + 'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' + + ') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' + + 'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' + + #10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' + + 'O, TRIMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL' + + #10'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'an' + + 'd (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 o' + + 'n (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA, ' + + 'comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMPOR' + + 'TE_TOTAL'#10'from V_INF_FAC_CLIENTE comp2'#10'where ID_EMPRESA = :ID_EMP' + + 'RESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) pe' + + 'riodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'TRIMESTRAL'#39#10 + + 'order by valor asc'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'VALOR' + TableField = 'VALOR' + end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'ANO1' + TableField = 'ANO1' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'ANO2' + TableField = 'ANO2' + end + item + DatasetField = 'IMPORTE_TOTAL1' + TableField = 'IMPORTE_TOTAL1' + end + item + DatasetField = 'DIFERENCIA' + TableField = 'DIFERENCIA' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoFacturasGrafCompTrimestral' + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end item Params = < item @@ -2344,4 +2869,347 @@ object RptFacturasCliente: TRptFacturasCliente Left = 48 Top = 88 end + object frxDBInformeListadoFacturasGrafComp: TfrxDBDataset + UserName = 'frxDBInformeListadoFacturasGrafComp' + CloseDataSource = False + DataSource = DASInformeListadoFacturasGrafComp + BCDToCurrency = False + Left = 824 + Top = 224 + end + object DASInformeListadoFacturasGrafComp: TDADataSource + Left = 824 + Top = 272 + end + object tbl_InformeListadoFacturasGrafCompMensual: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoFacturasGrafCompMensual' + IndexDefs = <> + Left = 824 + Top = 328 + end + object tbl_InformeListadoFacturasGrafCompTrimestral: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoFacturasGrafCompTrimestral' + IndexDefs = <> + Left = 824 + Top = 384 + end + object tbl_InformeListadoFacturasGrafCompSemestral: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoFacturasGrafCompSemestral' + IndexDefs = <> + Left = 824 + Top = 440 + end + object frxDBInformeListadoClientesMayorFacturacionResumen: TfrxDBDataset + UserName = 'frxDBInformeListadoClientesMayorFacturacionResumen' + CloseDataSource = False + DataSource = DADSInformeListadoClientesMayorFacturacionResumen + BCDToCurrency = False + Left = 320 + Top = 488 + end + object DADSInformeListadoClientesMayorFacturacionResumen: TDADataSource + DataSet = tbl_InformeListadoClientesMayorFacturacionResumen.Dataset + DataTable = tbl_InformeListadoClientesMayorFacturacionResumen + Left = 320 + Top = 544 + end + object tbl_InformeListadoClientesMayorFacturacionResumen: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_TOTAL_ANO' + DataType = datCurrency + end + item + Name = 'NUMFAC' + DataType = datInteger + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoClientesMayorFacturacionResumen' + IndexDefs = <> + Left = 320 + Top = 600 + end + object frxDBInformeListadoClientesMayorDescuentoResumen: TfrxDBDataset + UserName = 'frxDBInformeListadoClientesMayorDescuentoResumen' + CloseDataSource = False + DataSource = DADSInformeListadoClientesMayorDescuentoResumen + BCDToCurrency = False + Left = 624 + Top = 488 + end + object DADSInformeListadoClientesMayorDescuentoResumen: TDADataSource + DataSet = tbl_InformeListadoClientesMayorDescuentoResumen.Dataset + DataTable = tbl_InformeListadoClientesMayorDescuentoResumen + Left = 624 + Top = 544 + end + object tbl_InformeListadoClientesMayorDescuentoResumen: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_DESCUENTO' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'IMPORTE_COBRADO' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoClientesMayorDescuentoResumen' + IndexDefs = <> + Left = 624 + Top = 600 + end end diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas index db596be..42a7186 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas @@ -90,6 +90,17 @@ type tbl_InformeListadoFacturasResumen: TDAMemDataTable; Bin2DataStreamer: TDABin2DataStreamer; schReport: TDASchema; + frxDBInformeListadoFacturasGrafComp: TfrxDBDataset; + DASInformeListadoFacturasGrafComp: TDADataSource; + tbl_InformeListadoFacturasGrafCompMensual: TDAMemDataTable; + tbl_InformeListadoFacturasGrafCompTrimestral: TDAMemDataTable; + tbl_InformeListadoFacturasGrafCompSemestral: TDAMemDataTable; + frxDBInformeListadoClientesMayorFacturacionResumen: TfrxDBDataset; + DADSInformeListadoClientesMayorFacturacionResumen: TDADataSource; + tbl_InformeListadoClientesMayorFacturacionResumen: TDAMemDataTable; + frxDBInformeListadoClientesMayorDescuentoResumen: TfrxDBDataset; + DADSInformeListadoClientesMayorDescuentoResumen: TDADataSource; + tbl_InformeListadoClientesMayorDescuentoResumen: TDAMemDataTable; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); procedure frxReportGetValue(const VarName: string; var Value: Variant); @@ -100,17 +111,23 @@ type FFechaFin: Variant; FFechaVenInicio: Variant; FFechaVenFin: Variant; + FAno1: Variant; + FAno2: Variant; + FIntervalo: Variant; FListaIDClientes: TIntegerArray; FListaNombresClientes : TStringList; FImporteMinimo: Currency; FDesglosado : Boolean; FShowLogotipo: Boolean; + FTopN: Integer; //Genera cada una de las facturas a imprimir procedure _GenerarFactura(const ID: Integer; const VerSello: Boolean = True; const VerCopia: Boolean = True); procedure PrepararTablaInforme(ATabla: TDAMemDataTable); procedure PrepararTablaResumenInforme(ATabla: IDADataset); + procedure PrepararTablaInformeGrafComp(ATabla: TDAMemDataTable); + procedure PrepararTablaResumenInformeGrafComp(ATabla: TDAMemDataTable); function _GenerarInforme(const TipoInforme: String): Binary; procedure IniciarParametrosInforme; procedure RecuperarNombresClientes; @@ -120,6 +137,7 @@ type function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary; end; implementation @@ -128,7 +146,7 @@ implementation uses uSistemaFunc, StrUtils, uDataModuleServer, schFacturasClienteClient_Intf, - uROServer, DataAbstract4_Intf; + uROServer, DataAbstract4_Intf, srvGestorInformes_Impl; const rptFacturaCliente = 'InfFacturaCliente.fr3'; @@ -138,6 +156,7 @@ const rptInformeListadoFacturasClienteDesglosado = 'InformeListadoFacturasClienteDesglosado.fr3'; rptInformeListadoFactuasClientePendiente = 'InformeListadoFacturasClientePendientes.fr3'; rptInformeListadoFactuasClientePendienteDesglosado = 'InformeListadoFacturasClientePendientesDesglosado.fr3'; + rptInformeListadoFacturasClienteGrafComp = 'InformeListadoFacturasClienteGrafComp.fr3'; { Dataset names for schReport } ds_InformeListadoFacturasResumen = 'InformeListadoFacturasResumen'; @@ -215,6 +234,59 @@ begin end; end; +function TRptFacturasCliente.GenerarInformeFacturasGrafComp( + const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant; + const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary; +var + AStream: TMemoryStream; + AInforme: Variant; + +begin + FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" + + AStream := TMemoryStream.Create; + try + //Inicializamos parametros + FIdEmpresa := IdEmpresa; + FAno1 := Ano1; + FAno2 := Ano2; + FIntervalo := Intervalo; + FTopN := TopN; + + if Assigned(FListaIDClientes) then + FListaIDClientes.Free; + FListaIDClientes := ListaIDClientes; + + //Preparamos la tabla correspondiente y la abrimos para el informe + if (FIntervalo = CTE_MENSUAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompMensual) + else if (FIntervalo = CTE_TRIMESTRAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompTrimestral) + else + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompSemestral); + + //Se preparan las tablas del listado resumen del informe + PrepararTablaResumenInformeGrafComp(tbl_InformeListadoClientesMayorFacturacionResumen); + PrepararTablaResumenInformeGrafComp(tbl_InformeListadoClientesMayorDescuentoResumen); + + Result := Binary.Create; + + AInforme := DarRutaFichero(DarRutaInformes, rptInformeListadoFacturasClienteGrafComp, IntTostr(FIdEmpresa)); + if VarIsNull(AInforme) then + raise Exception.Create (('Error Servidor: GenerarInformeFacturasGrafComp, no encuentra informe ' + rptInformeListadoFacturasClienteGrafComp)); + + frxReport.LoadFromFile(AInforme, True); +// IniciarParametrosInforme; + + frxReport.PrepareReport(False); + frxReport.PreviewPages.SaveToStream(Result); + + finally + AStream.Free; + FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" + end; +end; + function TRptFacturasCliente.GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; var ATipoInforme: String; @@ -525,6 +597,20 @@ begin end; end; +procedure TRptFacturasCliente.PrepararTablaInformeGrafComp( + ATabla: TDAMemDataTable); +begin + if ATabla.Active then + ATabla.Active := False; + + DASInformeListadoFacturasGrafComp.DataTable := ATabla; + ATabla.ParamByName('ID_EMPRESA1').AsInteger := FIdEmpresa; + ATabla.ParamByName('ID_EMPRESA2').AsInteger := FIdEmpresa; + ATabla.ParamByName('ANO1').AsVariant := FAno1; + ATabla.ParamByName('ANO2').AsVariant := FAno2; + ATabla.Active := True; +end; + procedure TRptFacturasCliente.PrepararTablaResumenInforme(ATabla: IDADataset); var i: Integer; @@ -574,6 +660,18 @@ begin ATabla.Where.AddText(AWhereStr); end; +procedure TRptFacturasCliente.PrepararTablaResumenInformeGrafComp( + ATabla: TDAMemDataTable); +begin + if ATabla.Active then + ATabla.Active := False; + + ATabla.ParamByName('ID_EMPRESA').AsInteger := FIdEmpresa; + ATabla.ParamByName('ANO').AsVariant := FAno1; + ATabla.ParamByName('NTOP').AsInteger := FTopN; + ATabla.Active := True; +end; + procedure TRptFacturasCliente.RecuperarNombresClientes; var AContactosService : IsrvContactos; diff --git a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas index 680db59..c2e164f 100644 --- a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas +++ b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas @@ -31,12 +31,16 @@ type const IncludeSchema: Boolean; const MaxRecords: Integer); procedure DARemoteServiceCreate(Sender: TObject); procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string); - private + protected { IsrvFacturasCliente methods } function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean = True; const VerCopia: Boolean = True): Binary; function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean = True): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean = True): Binary; + + public + function DarListaAnos: StringArray; + end; implementation @@ -77,6 +81,24 @@ begin bpFacturasCliente.BusinessRulesID := BIZ_SERVER_FACTURAS_CLIENTE; end; +function TsrvFacturasCliente.DarListaAnos: StringArray; +var + dsAnos : IDADataset; +begin + Result := StringArray.Create(); + try + dsAnos := schFacturasCliente.NewDataset(Connection, 'ListaAnosFacturas', '', True); + while not dsAnos.EOF do + begin + Result.Add(dsAnos.Fields[0].AsString); + dsAnos.Next; + end; + finally + dsAnos.Close; + dsAnos := NIL; + end; +end; + procedure TsrvFacturasCliente.DataAbstractServiceBeforeAcquireConnection( aSender: TObject; var aConnectionName: string); begin diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm index 1ec80e0..ad33f86 100644 --- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm +++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm @@ -2,7 +2,7 @@ object RptFacturasProveedor: TRptFacturasProveedor OldCreateOrder = True OnCreate = DataModuleCreate OnDestroy = DataModuleDestroy - Height = 513 + Height = 684 Width = 933 object schReport: TDASchema ConnectionManager = dmServer.ConnectionManager @@ -46,6 +46,531 @@ object RptFacturasProveedor: TRptFacturasProveedor DataType = datCurrency end> end + item + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select P.ANO, C.REFERENCIA, COALESCE(C.NOMBRE, P.NOMBRE) as NOMB' + + 'RE, p.Importe_TOTAL_ANO,'#10'COUNT(P.FECHA_FACTURA) as NUMFAC, SUM(P' + + '.IMPORTE_TOTAL) as IMPORTE_TOTAL,'#10'((SUM(P.IMPORTE_TOTAL)*100)/p.' + + 'Importe_TOTAL_ANO) as PORCENTAJE'#10#10'from V_INF_FAC_PROVEEDOR P'#10'lef' + + 't join CONTACTOS C on P.ID_PROVEEDOR = C.ID'#10#10'where p.ID_EMPRESA ' + + '= :ID_EMPRESA'#10'and P.ANO = :ANO'#10'group by 1,2,3,4'#10'order by 1,6 des' + + 'c'#10'rows 1 to :NTOP'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ANO' + TableField = 'ANO' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'IMPORTE_TOTAL_ANO' + TableField = 'IMPORTE_TOTAL_ANO' + end + item + DatasetField = 'NUMFAC' + TableField = 'NUMFAC' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoProveedoresMayorFacturacionResumen' + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_TOTAL_ANO' + DataType = datCurrency + end + item + Name = 'NUMFAC' + DataType = datInteger + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select P.ANO, C.REFERENCIA, COALESCE(C.NOMBRE, P.NOMBRE) as NOMB' + + 'RE,'#10'SUM(P.IMPORTE_DESCUENTO) as IMPORTE_DESCUENTO, SUM(P.IMPORTE' + + '_TOTAL) as IMPORTE_TOTAL,'#10'(SUM(P.IMPORTE_TOTAL) - SUM(P.IMPORTE_' + + 'DESCUENTO)) as IMPORTE_COBRADO,'#10'case when SUM(P.IMPORTE_TOTAL) =' + + ' 0 then 0'#10'else ((SUM(P.IMPORTE_DESCUENTO) * 100) / SUM(P.IMPORTE' + + '_TOTAL)) end as PORCENTAJE'#10#10'from V_INF_FAC_PROVEEDOR P'#10'left join' + + ' CONTACTOS C on P.ID_PROVEEDOR = C.ID'#10#10'where p.ID_EMPRESA = :ID_' + + 'EMPRESA'#10'and P.ANO = :ANO'#10'group by 1,2,3'#10'order by 1,5 desc'#10'rows 1' + + ' to :NTOP'#10#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ANO' + TableField = 'ANO' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'IMPORTE_DESCUENTO' + TableField = 'IMPORTE_DESCUENTO' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'IMPORTE_COBRADO' + TableField = 'IMPORTE_COBRADO' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoProveedoresMayorDescuentoResumen' + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_DESCUENTO' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'IMPORTE_COBRADO' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' + + 'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' + + '1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' + + 'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' + + 'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' + + ') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' + + 'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' + + #10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' + + 'O, TRIMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL' + + #10'from V_INF_FAC_PROVEEDOR comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10 + + 'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1' + + ' on (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA' + + ', comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMP' + + 'ORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMPRESA = :ID' + + '_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc' + + ') periodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'TRIMESTR' + + 'AL'#39#10'order by valor asc'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'VALOR' + TableField = 'VALOR' + end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'ANO1' + TableField = 'ANO1' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'ANO2' + TableField = 'ANO2' + end + item + DatasetField = 'IMPORTE_TOTAL1' + TableField = 'IMPORTE_TOTAL1' + end + item + DatasetField = 'DIFERENCIA' + TableField = 'DIFERENCIA' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoFacturasGrafCompTrimestral' + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' + + 'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' + + '1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' + + 'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' + + 'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' + + ') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' + + 'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' + + #10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' + + 'O, SEMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10 + + 'from V_INF_FAC_PROVEEDOR comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'a' + + 'nd (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 ' + + 'on (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA,' + + ' comp2.ANO, SEMESTRE as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMPOR' + + 'TE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMPRESA = :ID_E' + + 'MPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) ' + + 'periodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'SEMESTRAL'#39 + + #10'order by valor asc'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'VALOR' + TableField = 'VALOR' + end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'ANO1' + TableField = 'ANO1' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'ANO2' + TableField = 'ANO2' + end + item + DatasetField = 'IMPORTE_TOTAL1' + TableField = 'IMPORTE_TOTAL1' + end + item + DatasetField = 'DIFERENCIA' + TableField = 'DIFERENCIA' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoFacturasGrafCompSemestral' + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end + item + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' + + 'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' + + '1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' + + 'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' + + 'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' + + ') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' + + 'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' + + #10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' + + 'O, MES as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from ' + + 'V_INF_FAC_PROVEEDOR comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (A' + + 'NO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 on (V' + + 'ALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA, comp' + + '2.ANO, MES as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'f' + + 'rom V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'an' + + 'd (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo2 o' + + 'n (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'MENSUAL'#39#10'order by va' + + 'lor asc'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'VALOR' + TableField = 'VALOR' + end + item + DatasetField = 'DESCRIPCION' + TableField = 'DESCRIPCION' + end + item + DatasetField = 'ANO1' + TableField = 'ANO1' + end + item + DatasetField = 'IMPORTE_TOTAL' + TableField = 'IMPORTE_TOTAL' + end + item + DatasetField = 'ANO2' + TableField = 'ANO2' + end + item + DatasetField = 'IMPORTE_TOTAL1' + TableField = 'IMPORTE_TOTAL1' + end + item + DatasetField = 'DIFERENCIA' + TableField = 'DIFERENCIA' + end + item + DatasetField = 'PORCENTAJE' + TableField = 'PORCENTAJE' + end> + end> + Name = 'InformeListadoFacturasGrafCompMensual' + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + end item Params = < item @@ -1226,32 +1751,32 @@ object RptFacturasProveedor: TRptFacturasProveedor Top = 142 end object frxCheckBoxObject1: TfrxCheckBoxObject - Left = 296 - Top = 288 + Left = 240 + Top = 208 end object frxChartObject1: TfrxChartObject - Left = 296 - Top = 336 + Left = 240 + Top = 256 end object frxGradientObject1: TfrxGradientObject - Left = 360 - Top = 288 + Left = 304 + Top = 208 end object frxCrossObject1: TfrxCrossObject - Left = 360 - Top = 440 + Left = 304 + Top = 360 end object frxOLEObject1: TfrxOLEObject - Left = 296 - Top = 440 + Left = 240 + Top = 360 end object frxBarCodeObject1: TfrxBarCodeObject - Left = 360 - Top = 392 + Left = 304 + Top = 312 end object frxRichObject1: TfrxRichObject - Left = 296 - Top = 392 + Left = 240 + Top = 312 end object frxReport: TfrxReport Version = '4.7.71' @@ -1345,8 +1870,8 @@ object RptFacturasProveedor: TRptFacturasProveedor FitWindow = False CenterWindow = False PrintScaling = False - Left = 424 - Top = 288 + Left = 368 + Top = 208 end object tbl_InformeListadoFacturas: TDAMemDataTable RemoteUpdatesOptions = [] @@ -1924,4 +2449,347 @@ object RptFacturasProveedor: TRptFacturasProveedor Left = 424 Top = 128 end + object frxDBInformeListadoFacturasGrafComp: TfrxDBDataset + UserName = 'frxDBInformeListadoFacturasGrafComp' + CloseDataSource = False + DataSource = DASInformeListadoFacturasGrafComp + BCDToCurrency = False + Left = 96 + Top = 376 + end + object DASInformeListadoFacturasGrafComp: TDADataSource + Left = 96 + Top = 424 + end + object tbl_InformeListadoFacturasGrafCompMensual: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoFacturasGrafCompMensual' + IndexDefs = <> + Left = 96 + Top = 480 + end + object tbl_InformeListadoFacturasGrafCompTrimestral: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoFacturasGrafCompTrimestral' + IndexDefs = <> + Left = 96 + Top = 536 + end + object tbl_InformeListadoFacturasGrafCompSemestral: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'VALOR' + DataType = datSmallInt + end + item + Name = 'DESCRIPCION' + DataType = datString + Size = 20 + end + item + Name = 'ANO1' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'ANO2' + DataType = datSmallInt + end + item + Name = 'IMPORTE_TOTAL1' + DataType = datCurrency + end + item + Name = 'DIFERENCIA' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA1' + Value = '' + end + item + Name = 'ANO1' + Value = '' + end + item + Name = 'ID_EMPRESA2' + Value = '' + end + item + Name = 'ANO2' + Value = '' + end> + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoFacturasGrafCompSemestral' + IndexDefs = <> + Left = 96 + Top = 592 + end + object frxDBInformeListadoProveedoresMayorFacturacionResumen: TfrxDBDataset + UserName = 'frxDBInformeListadoProveedoresMayorFacturacionResumen' + CloseDataSource = False + DataSource = DADSInformeListadoProveedoresMayorFacturacionResumen + BCDToCurrency = False + Left = 304 + Top = 504 + end + object DADSInformeListadoProveedoresMayorFacturacionResumen: TDADataSource + DataSet = tbl_InformeListadoProveedoresMayorFacturacionResumen.Dataset + DataTable = tbl_InformeListadoProveedoresMayorFacturacionResumen + Left = 304 + Top = 560 + end + object tbl_InformeListadoProveedoresMayorFacturacionResumen: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_TOTAL_ANO' + DataType = datCurrency + end + item + Name = 'NUMFAC' + DataType = datInteger + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoProveedoresMayorFacturacionResumen' + IndexDefs = <> + Left = 304 + Top = 616 + end + object frxDBInformeListadoProveedoresMayorDescuentoResumen: TfrxDBDataset + UserName = 'frxDBInformeListadoProveedoresMayorDescuentoResumen' + CloseDataSource = False + DataSource = DADSInformeListadoProveedoresMayorDescuentoResumen + BCDToCurrency = False + Left = 608 + Top = 504 + end + object DADSInformeListadoProveedoresMayorDescuentoResumen: TDADataSource + DataSet = tbl_InformeListadoProveedoresMayorDescuentoResumen.Dataset + DataTable = tbl_InformeListadoProveedoresMayorDescuentoResumen + Left = 608 + Top = 560 + end + object tbl_InformeListadoProveedoresMayorDescuentoResumen: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ANO' + DataType = datSmallInt + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end + item + Name = 'IMPORTE_DESCUENTO' + DataType = datCurrency + end + item + Name = 'IMPORTE_TOTAL' + DataType = datCurrency + end + item + Name = 'IMPORTE_COBRADO' + DataType = datCurrency + end + item + Name = 'PORCENTAJE' + DataType = datCurrency + end> + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ANO' + Value = '' + end + item + Name = 'NTOP' + Value = '' + end> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = schReport + LocalDataStreamer = Bin2DataStreamer + LogicalName = 'InformeListadoProveedoresMayorDescuentoResumen' + IndexDefs = <> + Left = 608 + Top = 616 + end end diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas index e7784c6..86a86a7 100644 --- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas +++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas @@ -43,10 +43,21 @@ type DADSCabecera: TDADataSource; frxDBCabecera: TfrxDBDataset; frxDBDetalles: TfrxDBDataset; - schReport: TDASchema; frxDBVencimientos: TfrxDBDataset; DADSVencimientos: TDADataSource; tbl_Vencimientos: TDAMemDataTable; + schReport: TDASchema; + frxDBInformeListadoFacturasGrafComp: TfrxDBDataset; + DASInformeListadoFacturasGrafComp: TDADataSource; + tbl_InformeListadoFacturasGrafCompMensual: TDAMemDataTable; + tbl_InformeListadoFacturasGrafCompTrimestral: TDAMemDataTable; + tbl_InformeListadoFacturasGrafCompSemestral: TDAMemDataTable; + frxDBInformeListadoProveedoresMayorFacturacionResumen: TfrxDBDataset; + DADSInformeListadoProveedoresMayorFacturacionResumen: TDADataSource; + tbl_InformeListadoProveedoresMayorFacturacionResumen: TDAMemDataTable; + frxDBInformeListadoProveedoresMayorDescuentoResumen: TfrxDBDataset; + DADSInformeListadoProveedoresMayorDescuentoResumen: TDADataSource; + tbl_InformeListadoProveedoresMayorDescuentoResumen: TDAMemDataTable; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); private @@ -56,10 +67,14 @@ type FFechaFin: Variant; FFechaVenInicio: Variant; FFechaVenFin: Variant; + FAno1: Variant; + FAno2: Variant; + FIntervalo: Variant; FListaIDProveedores: TIntegerArray; FListaNombresProveedores: TStringList; FImporteMinimo: Currency; FDesglosado : Boolean; + FTopN: Integer; //Genera cada una de las facturas a imprimir procedure _GenerarFactura(const ID: Integer); @@ -67,6 +82,8 @@ type procedure RecuperarNombresProveedores; procedure PrepararTablaInforme(ATabla: TDAMemDataTable); procedure PrepararTablaResumenInforme(ATabla: IDADataset); + procedure PrepararTablaInformeGrafComp(ATabla: TDAMemDataTable); + procedure PrepararTablaResumenInformeGrafComp(ATabla: TDAMemDataTable); procedure IniciarParametrosInforme; function _GenerarInforme(const TipoInforme: String): Binary; public @@ -75,6 +92,7 @@ type function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; const TopN: Integer): Binary; end; implementation @@ -83,7 +101,7 @@ implementation uses uSistemaFunc, StrUtils, uDataModuleServer, schFacturasProveedorClient_Intf, - uROServer, DataAbstract4_Intf; + uROServer, DataAbstract4_Intf, srvGestorInformes_Impl; const rptFacturaProveedor = 'InfFacturaProveedor.fr3'; @@ -94,6 +112,7 @@ const rptInformeListadoFacturasProveedorDesglosado = 'InformeListadoFacturasProveedorDesglosado.fr3'; rptInformeListadoFactuasProveedorPendiente = 'InformeListadoFacturasProveedorPendientes.fr3'; rptInformeListadoFactuasProveedorPendienteDesglosado = 'InformeListadoFacturasProveedorPendientesDesglosado.fr3'; + rptInformeListadoFacturasProveedorGrafComp = 'InformeListadoFacturasProveedorGrafComp.fr3'; { Dataset names for schReport } ds_InformeListadoFacturasResumen = 'InformeListadoFacturasResumen'; @@ -147,6 +166,59 @@ begin end; end; +function TRptFacturasProveedor.GenerarInformeFacturasGrafComp( + const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant; + const ListaIDProveedores: TIntegerArray; const TopN: Integer): Binary; +var + AStream: TMemoryStream; + AInforme: Variant; + +begin + FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" + + AStream := TMemoryStream.Create; + try + //Inicializamos parametros + FIdEmpresa := IdEmpresa; + FAno1 := Ano1; + FAno2 := Ano2; + FIntervalo := Intervalo; + FTopN := TopN; + + if Assigned(FListaIDProveedores) then + FListaIDProveedores.Free; + FListaIDProveedores := ListaIDProveedores; + + //Preparamos la tabla correspondiente y la abrimos para el informe + if (FIntervalo = CTE_MENSUAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompMensual) + else if (FIntervalo = CTE_TRIMESTRAL) then + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompTrimestral) + else + PrepararTablaInformeGrafComp(tbl_InformeListadoFacturasGrafCompSemestral); + + //Se preparan las tablas del listado resumen del informe + PrepararTablaResumenInformeGrafComp(tbl_InformeListadoProveedoresMayorFacturacionResumen); + PrepararTablaResumenInformeGrafComp(tbl_InformeListadoProveedoresMayorDescuentoResumen); + + Result := Binary.Create; + + AInforme := DarRutaFichero(DarRutaInformes, rptInformeListadoFacturasProveedorGrafComp, IntTostr(FIdEmpresa)); + if VarIsNull(AInforme) then + raise Exception.Create (('Error Servidor: GenerarInformeFacturasGrafComp, no encuentra informe ' + rptInformeListadoFacturasProveedorGrafComp)); + + frxReport.LoadFromFile(AInforme, True); +// IniciarParametrosInforme; + + frxReport.PrepareReport(False); + frxReport.PreviewPages.SaveToStream(Result); + + finally + AStream.Free; + FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" + end; +end; + function TRptFacturasProveedor.GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; @@ -493,6 +565,19 @@ begin end; end; +procedure TRptFacturasProveedor.PrepararTablaInformeGrafComp(ATabla: TDAMemDataTable); +begin + if ATabla.Active then + ATabla.Active := False; + + DASInformeListadoFacturasGrafComp.DataTable := ATabla; + ATabla.ParamByName('ID_EMPRESA1').AsInteger := FIdEmpresa; + ATabla.ParamByName('ID_EMPRESA2').AsInteger := FIdEmpresa; + ATabla.ParamByName('ANO1').AsVariant := FAno1; + ATabla.ParamByName('ANO2').AsVariant := FAno2; + ATabla.Active := True; +end; + procedure TRptFacturasProveedor.PrepararTablaResumenInforme(ATabla: IDADataset); var i: Integer; @@ -542,6 +627,17 @@ begin ATabla.Where.AddText(AWhereStr); end; +procedure TRptFacturasProveedor.PrepararTablaResumenInformeGrafComp(ATabla: TDAMemDataTable); +begin + if ATabla.Active then + ATabla.Active := False; + + ATabla.ParamByName('ID_EMPRESA').AsInteger := FIdEmpresa; + ATabla.ParamByName('ANO').AsVariant := FAno1; + ATabla.ParamByName('NTOP').AsInteger := FTopN; + ATabla.Active := True; +end; + procedure TRptFacturasProveedor.RecuperarNombresProveedores; var AContactosService : IsrvContactos; diff --git a/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.pas b/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.pas index 6d95fbc..1cb7247 100644 --- a/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.pas +++ b/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.pas @@ -38,6 +38,9 @@ type function GenerarInforme(const ListaID: TIntegerArray): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + public + function DarListaAnos: StringArray; + end; implementation @@ -76,6 +79,24 @@ begin bpFacturasProveedor.BusinessRulesID := BIZ_SERVER_FACTURAS_PROVEEDOR; end; +function TsrvFacturasProveedor.DarListaAnos: StringArray; +var + dsAnos : IDADataset; +begin + Result := StringArray.Create(); + try + dsAnos := schFacturasProveedor.NewDataset(Connection, 'ListaAnosFacturas', '', True); + while not dsAnos.EOF do + begin + Result.Add(dsAnos.Fields[0].AsString); + dsAnos.Next; + end; + finally + dsAnos.Close; + dsAnos := NIL; + end; +end; + procedure TsrvFacturasProveedor.DataAbstractServiceBeforeAcquireConnection( aSender: TObject; var aConnectionName: string); begin diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk index 99f6187..078e537 100644 --- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk +++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk @@ -43,6 +43,8 @@ contains uIEditorInformeFacturasProveedorReport in 'View\uIEditorInformeFacturasProveedorReport.pas', uIEditorInformePresupuestosReport in 'View\uIEditorInformePresupuestosReport.pas', uIEditorInformeRecibosProveedorReport in 'View\uIEditorInformeRecibosProveedorReport.pas', - uIEditorInformePedidosReport in 'View\uIEditorInformePedidosReport.pas'; + uIEditorInformePedidosReport in 'View\uIEditorInformePedidosReport.pas', + uIEditorInformeFacturasProveedorReportGrafComp in 'View\uIEditorInformeFacturasProveedorReportGrafComp.pas', + uIEditorInformeFacturasClienteReportGrafComp in 'View\uIEditorInformeFacturasClienteReportGrafComp.pas'; end. diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj index 7435613..1983ef9 100644 --- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj +++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj @@ -45,8 +45,10 @@ + + diff --git a/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeFacturasClienteReportGrafComp.pas b/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeFacturasClienteReportGrafComp.pas new file mode 100644 index 0000000..63691ae --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeFacturasClienteReportGrafComp.pas @@ -0,0 +1,30 @@ +unit uIEditorInformeFacturasClienteReportGrafComp; + +interface + +uses + FactuGES_Intf, uIEditorInformeBase; + +type + IEditorInformeFacturasClienteReportGrafComp = interface(IEditorInformeBase) + ['{12EA329F-37E3-4583-A54E-BE146C8E9D8A}'] + + function GetIntervalo: Variant; + function GetAno1: Variant; + function GetAno2: Variant; + function GetNTop: Variant; + + function GetListaIDClientes: TIntegerArray; + + property Intervalo: Variant read GetIntervalo; + property Ano1: Variant read GetAno1; + property Ano2: Variant read GetAno2; + property NTop: Variant read GetNTop; + + property ListaIDClientes: TIntegerArray read GetListaIDClientes; + end; + + +implementation + +end. diff --git a/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeFacturasProveedorReportGrafComp.pas b/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeFacturasProveedorReportGrafComp.pas new file mode 100644 index 0000000..07d360b --- /dev/null +++ b/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeFacturasProveedorReportGrafComp.pas @@ -0,0 +1,30 @@ +unit uIEditorInformeFacturasProveedorReportGrafComp; + +interface + +uses + FactuGES_Intf, uIEditorInformeBase; + +type + IEditorInformeFacturasProveedorReportGrafComp = interface(IEditorInformeBase) + ['{1F80F45F-AAD6-460D-9E68-AD4492009926}'] + + function GetIntervalo: Variant; + function GetAno1: Variant; + function GetAno2: Variant; + function GetNTop: Variant; + + function GetListaIDProveedores: TIntegerArray; + + property Intervalo: Variant read GetIntervalo; + property Ano1: Variant read GetAno1; + property Ano2: Variant read GetAno2; + property NTop: Variant read GetNTop; + + property ListaIDProveedores: TIntegerArray read GetListaIDProveedores; + end; + + +implementation + +end. diff --git a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas index 39161e6..3890e79 100644 --- a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas +++ b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas @@ -14,6 +14,7 @@ type property DataModule: IDataModuleGestorInformes read GetDataModule; // procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false); // procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false); + function DarListaIntervalos: TStringList; //MODULO PRESUPUESTOS DE CLIENTE procedure VerInformeListadoPresupuestos; @@ -22,6 +23,8 @@ type procedure VerInformeIVAClientes; procedure VerInformeListadoFacturasCli; procedure VerInformeListadoFacturasCliPendientes; + procedure VerInformeFacturasCliGrafComp; + function DarListaAnosFacturasCli: TStringList; //MODULO RECIBOS DE CLIENTE procedure VerInformeListadoRecibosCliPendientes; @@ -34,6 +37,8 @@ type procedure VerInformeIVAProveedores; procedure VerInformeListadoFacturasProv; procedure VerInformeListadoFacturasProvPendientes; + procedure VerInformeFacturasProvGrafComp; + function DarListaAnosFacturasProv: TStringList; //MODULO RECIBOS DE PROVEEDOR procedure VerInformeListadoRecibosProvPendientes; @@ -64,6 +69,8 @@ type } property DataModule: IDataModuleGestorInformes read GetDataModule; + function DarListaIntervalos: TStringList; + //MODULO PRESUPUESTOS DE CLIENTE procedure VerInformeListadoPresupuestos; @@ -71,6 +78,8 @@ type procedure VerInformeIVAClientes; procedure VerInformeListadoFacturasCli; procedure VerInformeListadoFacturasCliPendientes; + procedure VerInformeFacturasCliGrafComp; + function DarListaAnosFacturasCli: TStringList; //MODULO RECIBOS DE CLIENTE procedure VerInformeListadoRecibosCliPendientes; @@ -83,6 +92,8 @@ type procedure VerInformeIVAProveedores; procedure VerInformeListadoFacturasProv; procedure VerInformeListadoFacturasProvPendientes; + procedure VerInformeFacturasProvGrafComp; + function DarListaAnosFacturasProv: TStringList; //MODULO RECIBOS DE PROVEEDOR procedure VerInformeListadoRecibosProvPendientes; @@ -104,7 +115,8 @@ uses uIEditorInformeIVAProveedoresReport, uIEditorInformeFacturasProveedorReport, uIEditorInformeFacturasProveedorPendientesReport, uIEditorInformeRecibosProveedorReport, uIEditorInformeRecibosProvPendientesReport, - uIEditorInformePedidosReport; + uIEditorInformePedidosReport, uIEditorInformeFacturasClienteReportGrafComp, + uIEditorInformeFacturasProveedorReportGrafComp; {procedure CopiarArticulosPedido(AOrigen: IBizDetallesPedidoCliente; @@ -264,6 +276,21 @@ begin Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf); end; +function TGestorInformesController.DarListaAnosFacturasCli: TStringList; +begin + Result := FDataModule.DarListaAnosFacturasCli; +end; + +function TGestorInformesController.DarListaAnosFacturasProv: TStringList; +begin + Result := FDataModule.DarListaAnosFacturasProv; +end; + +function TGestorInformesController.DarListaIntervalos: TStringList; +begin + Result := FDataModule.DarListaIntervalos; +end; + destructor TGestorInformesController.Destroy; begin FDataModule := Nil; @@ -275,6 +302,54 @@ begin Result := FDataModule; end; +procedure TGestorInformesController.VerInformeFacturasCliGrafComp; +var + AStream: Binary; + AEditor : IEditorInformeFacturasClienteReportGrafComp; +begin + AEditor := NIL; + CreateEditor('EditorInformeFacturasClienteReportGrafComp', IEditorInformeFacturasClienteReportGrafComp, AEditor); + if Assigned(AEditor) then + try + AEditor.Controller := Self; + AEditor.Title := 'Informe comparativo de facturación de clientes'; + + AStream := FDataModule.GenerarInformeFacturasCliGrafComp(AppFactuGES.EmpresaActiva.ID, + AEditor.Intervalo, AEditor.Ano1, AEditor.Ano2, AEditor.ListaIDClientes, AEditor.NTop); + + AEditor.LoadFromStream(AStream); + AEditor.Preview; + finally + AEditor.Release; + AEditor := Nil; + FreeAndNil(AStream); + end; +end; + +procedure TGestorInformesController.VerInformeFacturasProvGrafComp; +var + AStream: Binary; + AEditor : IEditorInformeFacturasProveedorReportGrafComp; +begin + AEditor := NIL; + CreateEditor('EditorInformeFacturasProveedorReportGrafComp', IEditorInformeFacturasProveedorReportGrafComp, AEditor); + if Assigned(AEditor) then + try + AEditor.Controller := Self; + AEditor.Title := 'Informe comparativo de facturación de proveedores'; + + AStream := FDataModule.GenerarInformeFacturasProvGrafComp(AppFactuGES.EmpresaActiva.ID, + AEditor.Intervalo, AEditor.Ano1, AEditor.Ano2, AEditor.ListaIDProveedores, AEditor.NTop); + + AEditor.LoadFromStream(AStream); + AEditor.Preview; + finally + AEditor.Release; + AEditor := Nil; + FreeAndNil(AStream); + end; +end; + procedure TGestorInformesController.VerInformeIVAClientes; var AStream: Binary; diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm index 03b96bd..d4b8f8d 100644 --- a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm +++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.dfm @@ -10,12 +10,12 @@ inherited DataModuleGestorInformes: TDataModuleGestorInformes Top = 16 end object rda_GestorInformes: TDARemoteDataAdapter + DataStreamer = Bin2DataStreamer GetSchemaCall.RemoteService = RORemoteService GetDataCall.RemoteService = RORemoteService UpdateDataCall.RemoteService = RORemoteService GetScriptsCall.RemoteService = RORemoteService RemoteService = RORemoteService - DataStreamer = Bin2DataStreamer Left = 43 Top = 135 end @@ -47,8 +47,6 @@ inherited DataModuleGestorInformes: TDataModuleGestorInformes 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 diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas index 1731b9a..324736e 100644 --- a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas +++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas @@ -21,6 +21,7 @@ type procedure DAClientDataModuleCreate(Sender: TObject); public // function GetItems : IBizFacturaCliente; + function DarListaIntervalos: TStringList; //MODULO PRESUPUESTOS DE CLIENTE function GenerarInformeListadoPresupuestos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -29,6 +30,8 @@ type function GenerarInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasCli(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; Const NTop: Variant): Binary; + function DarListaAnosFacturasCli: TStringList; //MODULO RECIBOS DE CLIENTE function GenerarInformeListadoRecibosCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -41,6 +44,8 @@ type function GenerarInformeIVAProveedores(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasProv(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; Const NTop: Variant): Binary; + function DarListaAnosFacturasProv: TStringList; //MODULO RECIBOS DE CLIENTE function GenerarInformeListadoRecibosProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -55,7 +60,7 @@ implementation uses uDataModuleConexion, uDataTableUtils, cxControls, - Dialogs; + Dialogs, DataAbstract4_Intf; { TdmPresupuestos } @@ -65,6 +70,74 @@ begin RORemoteService.Message := dmConexion.Message; end; +function TDataModuleGestorInformes.DarListaAnosFacturasCli: TStringList; +var + i: Integer; + AResultado : StringArray; +begin + Result := Nil; + try + AResultado := (RORemoteService as IsrvGestorInformes).DarListaAnosFacturasCli; + Result := TStringList.Create; + for i:= 0 to AResultado.Count - 1 do + Result.Add(AResultado.Items[i]); + finally + FreeANDNIL(AResultado) + end; +end; + +function TDataModuleGestorInformes.DarListaAnosFacturasProv: TStringList; +var + i: Integer; + AResultado : StringArray; +begin + Result := Nil; + try + AResultado := (RORemoteService as IsrvGestorInformes).DarListaAnosFacturasProv; + Result := TStringList.Create; + for i:= 0 to AResultado.Count - 1 do + Result.Add(AResultado.Items[i]); + finally + FreeANDNIL(AResultado) + end; +end; + +function TDataModuleGestorInformes.DarListaIntervalos: TStringList; +var + i: Integer; + AResultado : StringArray; +begin + Result := Nil; + try + AResultado := (RORemoteService as IsrvGestorInformes).DarListaIntervalos; + Result := TStringList.Create; + for i:= 0 to AResultado.Count - 1 do + Result.Add(AResultado.Items[i]); + finally + FreeANDNIL(AResultado) + end; +end; + +function TDataModuleGestorInformes.GenerarInformeFacturasCliGrafComp( + const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant; + const ListaIDClientes: TIntegerArray; const NTop: Variant): Binary; +begin + try + Result := (RORemoteService as IsrvGestorInformes).GenerarInformeFacturasCliGrafComp(IdEmpresa, Intervalo, Ano1, Ano2, ListaIdClientes, NTop); + finally + end; +end; + +function TDataModuleGestorInformes.GenerarInformeFacturasProvGrafComp( + const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant; + const ListaIDProveedores: TIntegerArray; const NTop: Variant): Binary; +begin + try + Result := (RORemoteService as IsrvGestorInformes).GenerarInformeFacturasProvGrafComp(IdEmpresa, Intervalo, Ano1, Ano2, ListaIdProveedores, NTop); + finally + end; +end; + function TDataModuleGestorInformes.GenerarInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; begin try diff --git a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas index 1e85096..3281a26 100644 --- a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas +++ b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas @@ -3,12 +3,13 @@ unit uIDataModuleGestorInformes; interface uses - uROTypes, FactuGES_Intf; + uROTypes, Classes, FactuGES_Intf; type IDataModuleGestorInformes = interface ['{65FB8E9E-5218-43DC-80AD-BDB4383B7064}'] // function GetItems: IBizFacturaCliente; + function DarListaIntervalos: TStringList; procedure getInforme; //MODULO PRESUPUESTOS DE CLIENTE @@ -18,6 +19,8 @@ type function GenerarInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasCli(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; Const NTop: Variant): Binary; + function DarListaAnosFacturasCli: TStringList; //MODULO RECIBOS DE CLIENTE function GenerarInformeListadoRecibosCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -30,6 +33,8 @@ type function GenerarInformeIVAProveedores(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasProv(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; Const NTop: Variant): Binary; + function DarListaAnosFacturasProv: TStringList; //MODULO RECIBOS DE CLIENTE function GenerarInformeListadoRecibosProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm index 9b80ff8..76c1677 100644 --- a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm +++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm @@ -46,63 +46,95 @@ object PluginGestorInformes: TPluginGestorInformes object actInformeFacturasCliente: TAction Category = 'Facturas de cliente' Caption = 'Listado de facturas de cliente' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeFacturasClienteExecute end object actInformeFacturasClientePendientes: TAction Category = 'Facturas de cliente' Caption = 'Listado de facturas de cliente pendientes' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeFacturasClientePendientesExecute end object actInformeFacturasClienteIVA: TAction Category = 'Facturas de cliente' Caption = 'Listado de IVA de facturas de cliente' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeFacturasClienteIVAExecute end object actInformeRecibosCliente: TAction Category = 'Recibos de cliente' Caption = 'Listado de recibos de cliente' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeRecibosClienteExecute end object actInformeRecibosCliPendientes: TAction Category = 'Recibos de cliente' Caption = 'Listado de recibos de cliente pendientes' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeRecibosCliPendientesExecute end object actInformeFacturasProveedor: TAction Category = 'Facturas de proveedor' Caption = 'Listado de facturas de proveedor' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeFacturasProveedorExecute end object actInformeFacturasProveedorPendientes: TAction Category = 'Facturas de proveedor' Caption = 'Listado de facturas de proveedor pendientes' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeFacturasProveedorPendientesExecute end object actInformeFacturasProveedorIVA: TAction Category = 'Facturas de proveedor' Caption = 'Listado de IVA de facturas de proveedor' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeFacturasProveedorIVAExecute end object actInformeRecibosProveedor: TAction Category = 'Recibos de proveedor' Caption = 'Listado de recibos de proveedor' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeRecibosProveedorExecute end object actInformeRecibosProvPendientes: TAction Category = 'Recibos de proveedor' Caption = 'Listado de recibos de proveedor pendientes' + Enabled = False ImageIndex = 0 + Visible = False OnExecute = actInformeRecibosProvPendientesExecute end + object actInformeFacturasClienteGrafComp: TAction + Category = 'Facturas de cliente' + Caption = 'Informe comparativo de facturaci'#243'n de clientes' + ImageIndex = 0 + OnExecute = actInformeFacturasClienteGrafCompExecute + end + object actInformeFacturasProveedorGrafComp: TAction + Category = 'Facturas de proveedor' + Caption = 'Informe comparativo de facturaci'#243'n de proveedores' + ImageIndex = 0 + OnExecute = actInformeFacturasProveedorGrafCompExecute + end end object MainMenu: TMainMenu Images = LargeImages @@ -162,6 +194,16 @@ object PluginGestorInformes: TPluginGestorInformes Tag = 130 Action = actInformeRecibosProvPendientes end + object N5: TMenuItem + Tag = 140 + Caption = '-' + end + object Informecomparativodefacturacindeclientes1: TMenuItem + Action = actInformeFacturasClienteGrafComp + end + object Informecomparativodefacturacindeproveedores1: TMenuItem + Action = actInformeFacturasProveedorGrafComp + end end end object SmallImages: TPngImageList diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas index 766a0a0..716c987 100644 --- a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas +++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas @@ -41,6 +41,11 @@ type N4: TMenuItem; Listadoderecibosdeproveedor1: TMenuItem; Listadoderecibosdeproveedorpendientes1: TMenuItem; + actInformeFacturasClienteGrafComp: TAction; + actInformeFacturasProveedorGrafComp: TAction; + N5: TMenuItem; + Informecomparativodefacturacindeclientes1: TMenuItem; + Informecomparativodefacturacindeproveedores1: TMenuItem; procedure actInformeFacturasClienteExecute(Sender: TObject); procedure actInformeFacturasClientePendientesExecute(Sender: TObject); procedure actInformeFacturasClienteIVAExecute(Sender: TObject); @@ -51,6 +56,8 @@ type procedure actInformeFacturasProveedorIVAExecute(Sender: TObject); procedure actInformeRecibosProveedorExecute(Sender: TObject); procedure actInformeRecibosProvPendientesExecute(Sender: TObject); + procedure actInformeFacturasClienteGrafCompExecute(Sender: TObject); + procedure actInformeFacturasProveedorGrafCompExecute(Sender: TObject); private FController : IGestorInformesController; public @@ -80,6 +87,12 @@ begin FController.VerInformeListadoFacturasCli; end; +procedure TPluginGestorInformes.actInformeFacturasClienteGrafCompExecute( + Sender: TObject); +begin + FController.VerInformeFacturasCliGrafComp; +end; + procedure TPluginGestorInformes.actInformeFacturasClienteIVAExecute( Sender: TObject); begin @@ -98,6 +111,12 @@ begin FController.VerInformeListadoFacturasProv; end; +procedure TPluginGestorInformes.actInformeFacturasProveedorGrafCompExecute( + Sender: TObject); +begin + FController.VerInformeFacturasProvGrafComp; +end; + procedure TPluginGestorInformes.actInformeFacturasProveedorIVAExecute( Sender: TObject); begin diff --git a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas index 6419edd..0c23d10 100644 --- a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas +++ b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas @@ -25,12 +25,19 @@ const ds_Customers = 'Customers'; ds_Regions = 'Regions'; + CTE_MENSUAL = 'Mensual'; + CTE_TRIMESTRAL = 'Trimestral'; + CTE_SEMESTRAL = 'Semestral'; + type { TGestorInformes } TsrvGestorInformes = class(TDataAbstractService, IsrvGestorInformes) Schema: TDASchema; Bin2DataStreamer: TDABin2DataStreamer; public + //MODULO DE INFORMES + function DarListaIntervalos: StringArray; + //MODULO PRESUPUESTOS CLIENTE function GenerarInformeListadoPresupuestos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -39,6 +46,9 @@ type function GenerarInformeListadoFacturasCli(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary; + function DarListaAnosFacturasCli: StringArray; + //MODULO RECIBOS CLIENTE function GenerarInformeListadoRecibosCliente(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoRecibosCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -51,6 +61,9 @@ type function GenerarInformeListadoFacturasProv(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; const TopN: Integer): Binary; + function DarListaAnosFacturasProv: StringArray; + //MODULO RECIBOS PROVEEDOR function GenerarInformeListadoRecibosProveedor(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoRecibosProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; @@ -62,13 +75,76 @@ implementation uses {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils, Dialogs, uRptPresupuestosCliente_Server, uRptFacturasCliente_Server, uRptRecibosCliente_Server, - uRptPedidosProveedor_Server, uRptFacturasProveedor_Server, uRptRecibosProveedor_Server; + uRptPedidosProveedor_Server, uRptFacturasProveedor_Server, uRptRecibosProveedor_Server, + srvFacturasProveedor_Impl, srvFacturasCliente_Impl; procedure Create_srvGestorInformes(out anInstance: IUnknown); begin anInstance := TsrvGestorInformes.Create(nil); end; +function TsrvGestorInformes.DarListaAnosFacturasCli: StringArray; +var + AServer : TsrvFacturasCliente; +begin + Result := Nil; + AServer := TsrvFacturasCliente.Create(nil); + try + Result := AServer.DarListaAnos; + finally + FreeAndNIL(AServer); + end; +end; + +function TsrvGestorInformes.DarListaAnosFacturasProv: StringArray; +var + AServer : TsrvFacturasProveedor; +begin + Result := Nil; + AServer := TsrvFacturasProveedor.Create(nil); + try + Result := AServer.DarListaAnos; + finally + FreeAndNIL(AServer); + end; +end; + +function TsrvGestorInformes.DarListaIntervalos: StringArray; +begin + Result := StringArray.Create(); + Result.Add(CTE_MENSUAL); + Result.Add(CTE_TRIMESTRAL); + Result.Add(CTE_SEMESTRAL); +end; + +function TsrvGestorInformes.GenerarInformeFacturasCliGrafComp( + const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant; + const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary; +var + AReportGenerator : TRptFacturasCliente; +begin + AReportGenerator := TRptFacturasCliente.Create(nil); + try + Result := AReportGenerator.GenerarInformeFacturasGrafComp(IdEmpresa, Intervalo, Ano1, Ano2, ListaIDClientes, TopN); + finally + FreeAndNIL(AReportGenerator); + end; +end; + +function TsrvGestorInformes.GenerarInformeFacturasProvGrafComp( + const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant; + const ListaIDProveedores: TIntegerArray; const TopN: Integer): Binary; +var + AReportGenerator : TRptFacturasProveedor; +begin + AReportGenerator := TRptFacturasProveedor.Create(nil); + try + Result := AReportGenerator.GenerarInformeFacturasGrafComp(IdEmpresa, Intervalo, Ano1, Ano2, ListaIDProveedores, TopN); + finally + FreeAndNIL(AReportGenerator); + end; +end; + function TsrvGestorInformes.GenerarInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; var AReportGenerator : TRptFacturasCliente; diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk index 958b473..e67154e 100644 --- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk +++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk @@ -64,7 +64,10 @@ requires dxLayoutControlD11, dxComnD11, cxEditorsD11, - cxDataD11; + cxDataD11, + fqb110, + bdertl, + dxCoreD11; contains uGestorInformesViewRegister in 'uGestorInformesViewRegister.pas', @@ -85,6 +88,9 @@ contains uEditorInformeFacturasProveedorReport in 'uEditorInformeFacturasProveedorReport.pas' {fEditorInformeFacturasProveedorReport: TForm}, uEditorInformePedidosReport in 'uEditorInformePedidosReport.pas' {fEditorInformePedidosReport: TForm}, uEditorInformeRecibosProveedorReport in 'uEditorInformeRecibosProveedorReport.pas' {fEditorInformeRecibosProveedorReport: TForm}, - uEditorInformePresupuestosReport in 'uEditorInformePresupuestosReport.pas' {fEditorInformePresupuestosReport: TForm}; + uEditorInformePresupuestosReport in 'uEditorInformePresupuestosReport.pas' {fEditorInformePresupuestosReport: TForm}, + uViewIntervaloComparativo in 'uViewIntervaloComparativo.pas' {frViewIntervaloComparativo: TFrame}, + uEditorInformeFacturasClienteReportGrafComp in 'uEditorInformeFacturasClienteReportGrafComp.pas' {fEditorInformeFacturasClienteReportGrafComp: TForm}, + uEditorInformeFacturasProveedorReportGrafComp in 'uEditorInformeFacturasProveedorReportGrafComp.pas' {fEditorInformeFacturasProveedorReportGrafComp: TForm}; end. diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj index 6a768ff..bb868ee 100644 --- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj +++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj @@ -40,6 +40,7 @@ + @@ -51,9 +52,11 @@ + + @@ -84,6 +87,10 @@
fEditorInformeFacturasClienteReport
T
+ +
fEditorInformeFacturasClienteReportGrafComp
+ TForm +
fEditorInformeFacturasProveedorPendientesReport
TForm @@ -92,6 +99,10 @@
fEditorInformeFacturasProveedorReport
TForm
+ +
fEditorInformeFacturasProveedorReportGrafComp
+ TForm +
fEditorInformeIVAClientesReport
TForm @@ -105,7 +116,7 @@ TForm
-
fEditorInformePresupuestoReport
+
fEditorInformePresupuestosReport
TForm
@@ -137,6 +148,10 @@
frViewFiltroProveedores
TFrame
+ +
frViewIntervaloComparativo
+ TFrame +
frViewParametrosInforme
TFrame diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.dfm b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.dfm new file mode 100644 index 0000000..49de23e --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.dfm @@ -0,0 +1,175 @@ +inherited fEditorInformeFacturasClienteReportGrafComp: TfEditorInformeFacturasClienteReportGrafComp + Caption = 'fEditorInformeFacturasClienteReportGrafComp' + ClientHeight = 655 + ClientWidth = 895 + ExplicitWidth = 903 + ExplicitHeight = 689 + 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 = 636 + Width = 895 + ExplicitTop = 636 + ExplicitWidth = 895 + end + inherited TBXMultiDockIzquierdo: TTBXMultiDock + Height = 534 + ExplicitHeight = 534 + end + inherited TBXMultiDockDerecho: TTBXMultiDock + Left = 703 + Width = 192 + Height = 534 + ExplicitLeft = 703 + ExplicitWidth = 192 + ExplicitHeight = 534 + inherited pnlParametros: TTBXDockablePanel + DockedWidth = 188 + ExplicitWidth = 192 + ExplicitHeight = 518 + inherited TBXDockablePanel1: TTBXDockablePanel + Top = 368 + ExplicitTop = 368 + ExplicitWidth = 188 + inherited TBXButton1: TTBXButton + AlignWithMargins = True + Left = 3 + Top = 3 + Width = 182 + Height = 37 + Margins.Left = 8 + Margins.Top = 8 + Margins.Right = 8 + Margins.Bottom = 8 + Align = alTop + ExplicitLeft = 3 + ExplicitTop = 3 + ExplicitWidth = 182 + ExplicitHeight = 37 + end + end + inline frViewIntervaloComparativo1: TfrViewIntervaloComparativo + Left = 0 + Top = 0 + Width = 188 + Height = 182 + Align = alTop + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 1 + ReadOnly = False + ExplicitWidth = 188 + inherited TBXAlignmentPanel2: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited Label3: TLabel + Width = 106 + end + inherited cbIntervalo: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end + inherited TBXLabel2: TTBXLabel + Width = 188 + ExplicitWidth = 188 + end + inherited TBXAlignmentPanel3: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited lis: TLabel + Width = 19 + end + inherited cbAno1: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end + inherited TBXAlignmentPanel1: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited Label1: TLabel + Width = 88 + end + inherited cbAno2: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end + end + inline frViewFiltroClientes1: TfrViewFiltroClientes + Left = 0 + Top = 182 + Width = 188 + Height = 195 + Align = alTop + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + Visible = False + ReadOnly = False + ExplicitTop = 182 + ExplicitWidth = 188 + inherited TBXLabel2: TTBXLabel + Width = 188 + ExplicitWidth = 188 + end + inherited bElegirCliente: TBitBtn + Width = 119 + ExplicitWidth = 119 + end + inherited edtCliente: TcxTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 152 + Width = 152 + end + end + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.pas b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.pas new file mode 100644 index 0000000..5cf547e --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.pas @@ -0,0 +1,178 @@ +unit uEditorInformeFacturasClienteReportGrafComp; + +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, uCustomView, + uViewBase, uViewPeriodoFechas, uControllerBase, + dxLayoutControl, cxControls, uViewFiltroImportes, + FactuGES_Intf, TBXDkPanels, uEditorInformeBase, + uIEditorInformeBase, uViewParametrosInforme, uIEditorInformeFacturasClienteReportGrafComp, + uViewIntervaloComparativo, uViewFiltroClientes; + +type + TfEditorInformeFacturasClienteReportGrafComp = class(TfEditorInformeBase, IEditorInformeFacturasClienteReportGrafComp) + TBXItem58: TTBXItem; + frViewIntervaloComparativo1: TfrViewIntervaloComparativo; + frViewFiltroClientes1: TfrViewFiltroClientes; + procedure actRefrescarExecute(Sender: TObject); + procedure FormShow(Sender: TObject); + + private + FListaIDClientes: TIntegerArray; + function GetIntervalo: Variant; + function GetAno1: Variant; + function GetAno2: Variant; + function GetListaIDClientes: TIntegerArray; + function GetNTop: Variant; + + procedure RefrescarInforme; + + protected + procedure SetController (const Value : IControllerBase); override; + + public + property Intervalo: Variant read GetIntervalo; + property Ano1: Variant read GetAno1; + property Ano2: Variant read GetAno2; + property ListaIDClientes: TIntegerArray read GetListaIDClientes; + property NTop: Variant read GetNTop; + + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + +implementation + +{$R *.dfm} + +uses uROTypes, DateUtils, uGestorInformesController, uFactuGES_App; + +{ TfEditorGestorInformesReport } + +procedure TfEditorInformeFacturasClienteReportGrafComp.actRefrescarExecute(Sender: TObject); +begin + inherited; + RefrescarInforme; +end; + +constructor TfEditorInformeFacturasClienteReportGrafComp.Create(AOwner: TComponent); +begin + inherited; + FListaIDClientes := TIntegerArray.Create; +end; + +destructor TfEditorInformeFacturasClienteReportGrafComp.Destroy; +begin + FListaIDClientes.Free; + inherited; +end; + +procedure TfEditorInformeFacturasClienteReportGrafComp.FormShow(Sender: TObject); +begin + inherited; + actTodaPagina.Execute; +end; + +function TfEditorInformeFacturasClienteReportGrafComp.GetIntervalo: Variant; +begin + Result := frViewIntervaloComparativo1.cbIntervalo.EditValue; +end; + +function TfEditorInformeFacturasClienteReportGrafComp.GetAno1: Variant; +begin + Result := frViewIntervaloComparativo1.cbAno1.EditValue; +end; + +function TfEditorInformeFacturasClienteReportGrafComp.GetAno2: Variant; +begin + Result := frViewIntervaloComparativo1.cbAno2.EditValue; +end; + +function TfEditorInformeFacturasClienteReportGrafComp.GetListaIDClientes: TIntegerArray; +begin + FListaIDClientes.Clear; + if Assigned(frViewFiltroClientes1.Cliente) then + FListaIDClientes.Add(frViewFiltroClientes1.Cliente.ID); + + Result := FListaIDClientes; +end; + +function TfEditorInformeFacturasClienteReportGrafComp.GetNTop: Variant; +begin + Result := 5; +end; + +procedure TfEditorInformeFacturasClienteReportGrafComp.RefrescarInforme; +var + AStream: Binary; +begin + ShowHourglassCursor; + try + + AStream := (Controller as IGestorInformesController).DataModule.GenerarInformeFacturasCliGrafComp( + AppFactuGES.EmpresaActiva.ID, + Intervalo, + Ano1, + Ano2, + ListaIDClientes, + NTop); + + LoadFromStream(AStream); + Report.ShowPreparedReport; + finally + FreeAndNil(AStream); + HideHourglassCursor; + end; +end; + +procedure TfEditorInformeFacturasClienteReportGrafComp.SetController( + const Value: IControllerBase); +var + AListaAnos: TStringList; + AListaIntervalos: TStringList; + i: Integer; + +begin + inherited; + + AListaIntervalos := (Controller as IGestorInformesController).DarListaIntervalos; + AListaAnos := (Controller as IGestorInformesController).DarListaAnosFacturasCli; + + if Assigned(AListaIntervalos) then + begin + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.BeginUpdate; + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.Clear; + for i := 0 to AListaIntervalos.Count - 1 do + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.Append(AListaIntervalos.Strings[i]); + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.EndUpdate; + end; + + if Assigned(AListaAnos) then + begin + frViewIntervaloComparativo1.cbAno1.Properties.Items.BeginUpdate; + frViewIntervaloComparativo1.cbAno2.Properties.Items.BeginUpdate; + frViewIntervaloComparativo1.cbAno1.Properties.Items.Clear; + frViewIntervaloComparativo1.cbAno2.Properties.Items.Clear; + for i := 0 to AListaAnos.Count - 1 do + begin + frViewIntervaloComparativo1.cbAno1.Properties.Items.Append(AListaAnos.Strings[i]); + frViewIntervaloComparativo1.cbAno2.Properties.Items.Append(AListaAnos.Strings[i]); + end; + frViewIntervaloComparativo1.cbAno1.Properties.Items.EndUpdate; + frViewIntervaloComparativo1.cbAno2.Properties.Items.EndUpdate; + end; + + frViewIntervaloComparativo1.cbIntervalo.ItemIndex := 0; + frViewIntervaloComparativo1.cbAno1.ItemIndex := 0; +end; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm new file mode 100644 index 0000000..bb5f932 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm @@ -0,0 +1,176 @@ +inherited fEditorInformeFacturasProveedorReportGrafComp: TfEditorInformeFacturasProveedorReportGrafComp + Caption = 'fEditorInformeFacturasProveedorReportGrafComp' + ClientHeight = 655 + ClientWidth = 895 + ExplicitWidth = 903 + ExplicitHeight = 689 + 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 = 636 + Width = 895 + ExplicitTop = 636 + ExplicitWidth = 895 + end + inherited TBXMultiDockIzquierdo: TTBXMultiDock + Height = 534 + ExplicitHeight = 534 + end + inherited TBXMultiDockDerecho: TTBXMultiDock + Left = 703 + Width = 192 + Height = 534 + ExplicitLeft = 703 + ExplicitWidth = 192 + ExplicitHeight = 534 + inherited pnlParametros: TTBXDockablePanel + DockedWidth = 188 + ExplicitWidth = 192 + ExplicitHeight = 518 + inherited TBXDockablePanel1: TTBXDockablePanel + Top = 368 + ExplicitTop = 368 + ExplicitWidth = 188 + inherited TBXButton1: TTBXButton + AlignWithMargins = True + Left = 3 + Top = 3 + Width = 182 + Height = 37 + Margins.Left = 8 + Margins.Top = 8 + Margins.Right = 8 + Margins.Bottom = 8 + Align = alTop + ExplicitLeft = 3 + ExplicitTop = 3 + ExplicitWidth = 182 + ExplicitHeight = 37 + end + end + inline frViewIntervaloComparativo1: TfrViewIntervaloComparativo + Left = 0 + Top = 0 + Width = 188 + Height = 182 + Align = alTop + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 1 + ReadOnly = False + ExplicitTop = 195 + ExplicitWidth = 188 + inherited TBXAlignmentPanel2: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited Label3: TLabel + Width = 106 + end + inherited cbIntervalo: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end + inherited TBXLabel2: TTBXLabel + Width = 188 + ExplicitWidth = 188 + end + inherited TBXAlignmentPanel3: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited lis: TLabel + Width = 19 + end + inherited cbAno1: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end + inherited TBXAlignmentPanel1: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited Label1: TLabel + Width = 88 + end + inherited cbAno2: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end + end + inline frViewFiltroProveedores1: TfrViewFiltroProveedores + Left = 0 + Top = 182 + Width = 188 + Height = 195 + Align = alTop + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + Visible = False + ReadOnly = False + ExplicitTop = 182 + ExplicitWidth = 188 + inherited TBXLabel2: TTBXLabel + Width = 188 + ExplicitWidth = 188 + end + inherited bElegirProveedor: TBitBtn + Width = 119 + ExplicitWidth = 119 + end + inherited edtProveedor: TcxTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 152 + Width = 152 + end + end + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.pas b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.pas new file mode 100644 index 0000000..3fe6a93 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.pas @@ -0,0 +1,179 @@ +unit uEditorInformeFacturasProveedorReportGrafComp; + +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, uCustomView, + uViewBase, uViewPeriodoFechas, uControllerBase, + dxLayoutControl, cxControls, uViewFiltroImportes, + FactuGES_Intf, TBXDkPanels, uEditorInformeBase, + uIEditorInformeBase, uViewParametrosInforme, uIEditorInformeFacturasProveedorReportGrafComp, + uViewIntervaloComparativo, uViewFiltroProveedores; + +type + TfEditorInformeFacturasProveedorReportGrafComp = class(TfEditorInformeBase, IEditorInformeFacturasProveedorReportGrafComp) + TBXItem58: TTBXItem; + frViewIntervaloComparativo1: TfrViewIntervaloComparativo; + frViewFiltroProveedores1: TfrViewFiltroProveedores; + procedure actRefrescarExecute(Sender: TObject); + procedure FormShow(Sender: TObject); + + private + FListaIDProveedores: TIntegerArray; + function GetIntervalo: Variant; + function GetAno1: Variant; + function GetAno2: Variant; + function GetListaIDProveedores: TIntegerArray; + function GetNTop: Variant; + + procedure RefrescarInforme; + + protected + procedure SetController (const Value : IControllerBase); override; + + public + property Intervalo: Variant read GetIntervalo; + property Ano1: Variant read GetAno1; + property Ano2: Variant read GetAno2; + property ListaIDProveedores: TIntegerArray read GetListaIDProveedores; + property NTop: Variant read GetNTop; + + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + +implementation + +{$R *.dfm} + +uses uROTypes, DateUtils, uGestorInformesController, uFactuGES_App; + +{ TfEditorGestorInformesReport } + +procedure TfEditorInformeFacturasProveedorReportGrafComp.actRefrescarExecute(Sender: TObject); +begin + inherited; + RefrescarInforme; +end; + +constructor TfEditorInformeFacturasProveedorReportGrafComp.Create(AOwner: TComponent); +begin + inherited; + FListaIDProveedores := TIntegerArray.Create; +end; + +destructor TfEditorInformeFacturasProveedorReportGrafComp.Destroy; +begin + FListaIDProveedores.Free; + inherited; +end; + +procedure TfEditorInformeFacturasProveedorReportGrafComp.FormShow( + Sender: TObject); +begin + inherited; + actTodaPagina.Execute; +end; + +function TfEditorInformeFacturasProveedorReportGrafComp.GetIntervalo: Variant; +begin + Result := frViewIntervaloComparativo1.cbIntervalo.EditValue; +end; + +function TfEditorInformeFacturasProveedorReportGrafComp.GetAno1: Variant; +begin + Result := frViewIntervaloComparativo1.cbAno1.EditValue; +end; + +function TfEditorInformeFacturasProveedorReportGrafComp.GetAno2: Variant; +begin + Result := frViewIntervaloComparativo1.cbAno2.EditValue; +end; + +function TfEditorInformeFacturasProveedorReportGrafComp.GetListaIDProveedores: TIntegerArray; +begin + FListaIDProveedores.Clear; + if Assigned(frViewFiltroProveedores1.Proveedor) then + FListaIDProveedores.Add(frViewFiltroProveedores1.Proveedor.ID); + + Result := FListaIDProveedores; +end; + +function TfEditorInformeFacturasProveedorReportGrafComp.GetNTop: Variant; +begin + Result := 5; +end; + +procedure TfEditorInformeFacturasProveedorReportGrafComp.RefrescarInforme; +var + AStream: Binary; +begin + ShowHourglassCursor; + try + + AStream := (Controller as IGestorInformesController).DataModule.GenerarInformeFacturasProvGrafComp( + AppFactuGES.EmpresaActiva.ID, + Intervalo, + Ano1, + Ano2, + ListaIDProveedores, + NTop); + + LoadFromStream(AStream); + Report.ShowPreparedReport; + finally + FreeAndNil(AStream); + HideHourglassCursor; + end; +end; + +procedure TfEditorInformeFacturasProveedorReportGrafComp.SetController( + const Value: IControllerBase); +var + AListaAnos: TStringList; + AListaIntervalos: TStringList; + i: Integer; + +begin + inherited; + + AListaIntervalos := (Controller as IGestorInformesController).DarListaIntervalos; + AListaAnos := (Controller as IGestorInformesController).DarListaAnosFacturasProv; + + if Assigned(AListaIntervalos) then + begin + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.BeginUpdate; + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.Clear; + for i := 0 to AListaIntervalos.Count - 1 do + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.Append(AListaIntervalos.Strings[i]); + frViewIntervaloComparativo1.cbIntervalo.Properties.Items.EndUpdate; + end; + + if Assigned(AListaAnos) then + begin + frViewIntervaloComparativo1.cbAno1.Properties.Items.BeginUpdate; + frViewIntervaloComparativo1.cbAno2.Properties.Items.BeginUpdate; + frViewIntervaloComparativo1.cbAno1.Properties.Items.Clear; + frViewIntervaloComparativo1.cbAno2.Properties.Items.Clear; + for i := 0 to AListaAnos.Count - 1 do + begin + frViewIntervaloComparativo1.cbAno1.Properties.Items.Append(AListaAnos.Strings[i]); + frViewIntervaloComparativo1.cbAno2.Properties.Items.Append(AListaAnos.Strings[i]); + end; + frViewIntervaloComparativo1.cbAno1.Properties.Items.EndUpdate; + frViewIntervaloComparativo1.cbAno2.Properties.Items.EndUpdate; + end; + + frViewIntervaloComparativo1.cbIntervalo.ItemIndex := 0; + frViewIntervaloComparativo1.cbAno1.ItemIndex := 0; +end; + +end. diff --git a/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas index 8c2f0a6..6ed1a14 100644 --- a/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas +++ b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas @@ -14,7 +14,9 @@ uses uEditorInformePresupuestosReport, uEditorInformePedidosReport, uEditorInformeIVAProveedoresReport, uEditorInformeFacturasProveedorReport, uEditorInformeFacturasProveedorPendientesReport, - uEditorInformeRecibosProveedorReport, uEditorInformeRecibosProvPendientesReport; + uEditorInformeRecibosProveedorReport, uEditorInformeRecibosProvPendientesReport, + + uEditorInformeFacturasProveedorReportGrafComp, uEditorInformeFacturasClienteReportGrafComp; procedure RegisterViews; begin @@ -31,6 +33,9 @@ begin EditorRegistry.RegisterClass(TfEditorInformeFacturasProveedorPendientesReport, 'EditorInformeFacturasProveedorPendientesReport'); EditorRegistry.RegisterClass(TfEditorInformeRecibosProveedorReport, 'EditorInformeRecibosProveedorReport'); EditorRegistry.RegisterClass(TfEditorInformeRecibosProvPendientesReport, 'EditorInformeRecibosProvPendientesReport'); + + EditorRegistry.RegisterClass(TfEditorInformeFacturasProveedorReportGrafComp, 'EditorInformeFacturasProveedorReportGrafComp'); + EditorRegistry.RegisterClass(TfEditorInformeFacturasClienteReportGrafComp, 'EditorInformeFacturasClienteReportGrafComp'); end; procedure UnregisterViews; @@ -48,6 +53,9 @@ begin EditorRegistry.UnRegisterClass(TfEditorInformeFacturasProveedorPendientesReport); EditorRegistry.UnRegisterClass(TfEditorInformeRecibosProveedorReport); EditorRegistry.UnRegisterClass(TfEditorInformeRecibosProvPendientesReport); + + EditorRegistry.UnRegisterClass(TfEditorInformeFacturasProveedorReportGrafComp); + EditorRegistry.UnRegisterClass(TfEditorInformeFacturasClienteReportGrafComp); end; end. diff --git a/Source/Modulos/Gestor de informes/Views/uViewIntervaloComparativo.dfm b/Source/Modulos/Gestor de informes/Views/uViewIntervaloComparativo.dfm new file mode 100644 index 0000000..27364fe --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewIntervaloComparativo.dfm @@ -0,0 +1,178 @@ +inherited frViewIntervaloComparativo: TfrViewIntervaloComparativo + Width = 451 + Height = 182 + Align = alTop + ExplicitWidth = 451 + ExplicitHeight = 182 + object TBXAlignmentPanel2: TTBXAlignmentPanel + AlignWithMargins = True + Left = 3 + Top = 32 + Width = 445 + Height = 42 + Margins.Left = 5 + Margins.Top = 5 + Margins.Right = 5 + Align = alTop + AutoSize = True + TabOrder = 0 + DesignSize = ( + 445 + 42) + object Label3: TLabel + Left = 5 + Top = 5 + Width = 435 + Height = 13 + Align = alTop + Caption = 'Intervalo comparativo' + Transparent = True + ExplicitWidth = 106 + end + object cbIntervalo: TcxComboBox + Left = 3 + Top = 21 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownListStyle = lsFixedList + 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 = 429 + end + end + object TBXLabel2: TTBXLabel + Left = 0 + Top = 0 + Width = 451 + Height = 29 + Margins.Top = 5 + Margins.Bottom = 10 + Align = alTop + Caption = 'Periodo' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = True + ParentFont = False + Underline = True + end + object TBXAlignmentPanel3: TTBXAlignmentPanel + AlignWithMargins = True + Left = 3 + Top = 80 + Width = 445 + Height = 42 + Margins.Left = 5 + Margins.Top = 5 + Margins.Right = 5 + Align = alTop + AutoSize = True + TabOrder = 2 + DesignSize = ( + 445 + 42) + object lis: TLabel + Left = 5 + Top = 5 + Width = 435 + Height = 13 + Align = alTop + Caption = 'A'#241'o' + Transparent = True + ExplicitWidth = 19 + end + object cbAno1: TcxComboBox + Left = 3 + Top = 21 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownListStyle = lsFixedList + 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 = 429 + end + end + object TBXAlignmentPanel1: TTBXAlignmentPanel + AlignWithMargins = True + Left = 3 + Top = 128 + Width = 445 + Height = 42 + Margins.Left = 5 + Margins.Top = 5 + Margins.Right = 5 + Align = alTop + AutoSize = True + TabOrder = 3 + DesignSize = ( + 445 + 42) + object Label1: TLabel + Left = 5 + Top = 5 + Width = 435 + Height = 13 + Align = alTop + Caption = 'Comparar con a'#241'o' + Transparent = True + ExplicitWidth = 88 + end + object cbAno2: TcxComboBox + Left = 3 + Top = 21 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownListStyle = lsFixedList + 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 = 429 + end + end +end diff --git a/Source/Modulos/Gestor de informes/Views/uViewIntervaloComparativo.pas b/Source/Modulos/Gestor de informes/Views/uViewIntervaloComparativo.pas new file mode 100644 index 0000000..7d16d29 --- /dev/null +++ b/Source/Modulos/Gestor de informes/Views/uViewIntervaloComparativo.pas @@ -0,0 +1,92 @@ +unit uViewIntervaloComparativo; + +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, uViewParametrosInforme; + +type + IViewPeriodoFechas = interface(IViewParametrosInforme) + ['{793084E2-873E-4C57-8BD6-9087816CCF3A}'] + end; + + TfrViewIntervaloComparativo = class(TfrViewParametrosInforme, IViewPeriodoFechas) + TBXLabel2: TTBXLabel; + TBXAlignmentPanel2: TTBXAlignmentPanel; + Label3: TLabel; + TBXAlignmentPanel3: TTBXAlignmentPanel; + lis: TLabel; + cbIntervalo: TcxComboBox; + cbAno1: TcxComboBox; + TBXAlignmentPanel1: TTBXAlignmentPanel; + Label1: TLabel; + cbAno2: TcxComboBox; + + private + function GetIntervalo: Variant; + function GetAno1: Variant; + function GetAno2: Variant; + procedure SetIntervalo(const Value: Variant); + procedure SetAno1(const Value: Variant); + procedure SetAno2(const Value: Variant); + + public + property Intevalo : Variant read GetIntervalo write SetIntervalo; + property Ano1 : Variant read GetAno1 write SetAno1; + property Ano2 : Variant read GetAno2 write SetAno2; + constructor Create(AOwner: TComponent); override; + end; + +implementation + +uses DateUtils; + +{$R *.dfm} + + + +function TfrViewIntervaloComparativo.GetIntervalo: Variant; +begin + Result := cbIntervalo.EditValue; +end; + +function TfrViewIntervaloComparativo.GetAno1: Variant; +begin + Result := cbAno1.EditValue; +end; + +function TfrViewIntervaloComparativo.GetAno2: Variant; +begin + Result := cbAno2.EditValue; +end; + +procedure TfrViewIntervaloComparativo.SetIntervalo(const Value: Variant); +begin + cbIntervalo.EditValue := Value; +end; + +procedure TfrViewIntervaloComparativo.SetAno1(const Value: Variant); +begin + cbAno1.EditValue := Value; +end; + +procedure TfrViewIntervaloComparativo.SetAno2(const Value: Variant); +begin + cbAno2.EditValue := Value; +end; + +constructor TfrViewIntervaloComparativo.Create(AOwner: TComponent); +begin + inherited; +// cbPeriodo.ItemIndex := 0; +// cbPeriodo2.ItemIndex := 0; +// EsteMes(TFecha); +end; + + +end. + diff --git a/Source/Modulos/Informe margen por articulo/Controller/View/uIEditorInfMargenArticulo.pas b/Source/Modulos/Informe margen por articulo/Controller/View/uIEditorInfMargenArticulo.pas index 3436c9f..9f905d4 100644 --- a/Source/Modulos/Informe margen por articulo/Controller/View/uIEditorInfMargenArticulo.pas +++ b/Source/Modulos/Informe margen por articulo/Controller/View/uIEditorInfMargenArticulo.pas @@ -3,10 +3,10 @@ unit uIEditorInfMargenArticulo; interface uses - uEditorInformeBase, uBizInfMargenArticulo, uInfMargenArticuloController; + uEditorInformeBaseInforme, uBizInfMargenArticulo, uInfMargenArticuloController; type - IEditorInfMargenArticulo = interface(IEditorInformeBase) + IEditorInfMargenArticulo = interface(IEditorInformeBaseInforme) ['{3DB261D6-07D9-4835-B7E1-592DA827AFDE}'] function GetController : IInfMargenArticuloController; procedure SetController (const Value : IInfMargenArticuloController); diff --git a/Source/Modulos/Informe margen por articulo/Data/InfMargenArticulo_data.drc b/Source/Modulos/Informe margen por articulo/Data/InfMargenArticulo_data.drc index 1725309..d78fb0d 100644 --- a/Source/Modulos/Informe margen por articulo/Data/InfMargenArticulo_data.drc +++ b/Source/Modulos/Informe margen por articulo/Data/InfMargenArticulo_data.drc @@ -14,4 +14,4 @@ END /* C:\Codigo\Source\Modulos\Informe margen por articulo\Data\uDataModuleInfMargenArticulo.dfm */ /* C:\Codigo\Source\Modulos\Informe margen por articulo\Data\InfMargenArticulo_data.res */ -/* c:\temp\dtf186.tmp */ +/* c:\temp\dtf300.tmp */ diff --git a/Source/Modulos/Informe margen por articulo/Model/InfMargenArticulo_model.drc b/Source/Modulos/Informe margen por articulo/Model/InfMargenArticulo_model.drc index 0282902..6a1ff25 100644 --- a/Source/Modulos/Informe margen por articulo/Model/InfMargenArticulo_model.drc +++ b/Source/Modulos/Informe margen por articulo/Model/InfMargenArticulo_model.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo\Source\Modulos\Informe margen por articulo\Model\InfMargenArticulo_model.res */ -/* c:\temp\dtf184.tmp */ +/* c:\temp\dtf2FE.tmp */ diff --git a/Source/Modulos/Informe margen por articulo/Views/InfMargenArticulo_view.drc b/Source/Modulos/Informe margen por articulo/Views/InfMargenArticulo_view.drc index 47d7730..8451955 100644 --- a/Source/Modulos/Informe margen por articulo/Views/InfMargenArticulo_view.drc +++ b/Source/Modulos/Informe margen por articulo/Views/InfMargenArticulo_view.drc @@ -16,4 +16,4 @@ END /* C:\Codigo\Source\Modulos\Informe margen por articulo\Views\uViewInfMargenArticulo.dfm */ /* C:\Codigo\Source\Modulos\Informe margen por articulo\Views\uEditorInfMargenArticulo.dfm */ /* C:\Codigo\Source\Modulos\Informe margen por articulo\Views\InfMargenArticulo_view.res */ -/* c:\temp\dtf18A.tmp */ +/* c:\temp\dtf304.tmp */ diff --git a/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.dfm b/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.dfm index 0c5b619..03dd890 100644 --- a/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.dfm +++ b/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.dfm @@ -281,7 +281,7 @@ inherited fEditorInfMargenArticulo: TfEditorInfMargenArticulo Width = 659 ExplicitWidth = 659 end - inherited frViewPeriodoFechas1: TfrViewPeriodoFechas + inherited frViewPeriodoFechasInforme1: TfrViewPeriodoFechasInforme Width = 659 ExplicitWidth = 659 inherited TBXDockablePanel1: TTBXDockablePanel diff --git a/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.pas b/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.pas index 8713364..a490263 100644 --- a/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.pas +++ b/Source/Modulos/Informe margen por articulo/Views/uEditorInfMargenArticulo.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, uEditorInformeBase, DB, uDADataTable, JvAppStorage, + Dialogs, uEditorInformeBaseInforme, DB, uDADataTable, JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uBizInformes, @@ -16,7 +16,7 @@ uses type - TfEditorInfMargenArticulo = class(TfEditorInformeBase, IEditorInfMargenArticulo) + TfEditorInfMargenArticulo = class(TfEditorInformeBaseInforme, IEditorInfMargenArticulo) TBXSeparatorItem16: TTBXSeparatorItem; tbxiExpandir: TTBXItem; tbxiContraer: TTBXItem; @@ -303,8 +303,8 @@ begin LeftTitle.Add(FInforme.DESCRIPCION); RightTitle.Clear; -// RightTitle.Add(DateToStr(frViewInfMargenArticulo1.frViewPeriodoFechas1.edtFechaIni.Date) + -// ' - ' + DateToStr(frViewInfMargenArticulo1.frViewPeriodoFechas1.edtFechaFin.Date)); +// RightTitle.Add(DateToStr(frViewInfMargenArticulo1.frViewPeriodoFechasInforme1.edtFechaIni.Date) + +// ' - ' + DateToStr(frViewInfMargenArticulo1.frViewPeriodoFechasInforme1.edtFechaFin.Date)); // RightTitle.Add(frViewInfMargenArticulo1.frViewInfMargenArticuloGrid1.FocusedView.DataController.Filter.FilterText); end; end; diff --git a/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.dfm b/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.dfm index bfd6c48..e1385bd 100644 --- a/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.dfm +++ b/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.dfm @@ -97,7 +97,7 @@ inherited frViewInfMargenArticulo: TfrViewInfMargenArticulo ExplicitTop = 71 ExplicitWidth = 780 end - inline frViewPeriodoFechas1: TfrViewPeriodoFechas + inline frViewPeriodoFechasInforme1: TfrViewPeriodoFechasInforme Left = 0 Top = 0 Width = 780 diff --git a/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.pas b/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.pas index 28c7415..46f5b4f 100644 --- a/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.pas +++ b/Source/Modulos/Informe margen por articulo/Views/uViewInfMargenArticulo.pas @@ -12,7 +12,7 @@ uses cxDBData, cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid, cxTextEdit, uViewFiltros, uBizInfMargenArticulo, - uViewPeriodoFechas, uViewInfMargenArticuloGrid, cxContainer, uViewFiltroBase, + uViewPeriodoFechasInforme, uViewInfMargenArticuloGrid, cxContainer, uViewFiltroBase, uDADataTable, uInfMargenArticuloController, uDAInterfaces, uIDataModuleInfMargenArticulo; type @@ -30,7 +30,7 @@ type TfrViewInfMargenArticulo = class(TfrViewInformeBase, IViewInfMargenArticulo) actPeriodoFechas: TAction; frViewInfMargenArticuloGrid1: TfrViewInfMargenArticuloGrid; - frViewPeriodoFechas1: TfrViewPeriodoFechas; + frViewPeriodoFechasInforme1: TfrViewPeriodoFechasInforme; dsVentasTerminadas: TDADataSource; procedure actRefrescarExecute(Sender: TObject); procedure actPeriodoFechasExecute(Sender: TObject); @@ -190,7 +190,7 @@ begin ShowHourglassCursor; actRefrescar.Enabled := False; - AWhere := '''' + ReplaceStr(DateToStr(frViewPeriodoFechas1.FechaInicial),'/','.') + ''' and ''' + ReplaceStr(DateToStr(frViewPeriodoFechas1.FechaFinal),'/','.') + ''''; + AWhere := '''' + ReplaceStr(DateToStr(frViewPeriodoFechasInforme1.FechaInicial),'/','.') + ''' and ''' + ReplaceStr(DateToStr(frViewPeriodoFechasInforme1.FechaFinal),'/','.') + ''''; // FiltrarEmpresa(Result); frViewInfMargenArticuloGrid1.OnViewChanged := nil; @@ -223,11 +223,11 @@ begin { LoadSchema; - ParamByName('FECHAINI').AsDateTime := frViewPeriodoFechas1.FechaInicial; - ParamByName('FECHAFIN').AsDateTime := frViewPeriodoFechas1.FechaFinal; + ParamByName('FECHAINI').AsDateTime := frViewPeriodoFechasInforme1.FechaInicial; + ParamByName('FECHAFIN').AsDateTime := frViewPeriodoFechasInforme1.FechaFinal; -// ParamByName('FECHAINI2').AsDateTime := frViewPeriodoFechas1.FechaInicial; //'12.12.2000'; -// ParamByName('FECHAFIN2').AsDateTime := frViewPeriodoFechas1.FechaFinal; +// ParamByName('FECHAINI2').AsDateTime := frViewPeriodoFechasInforme1.FechaInicial; //'12.12.2000'; +// ParamByName('FECHAFIN2').AsDateTime := frViewPeriodoFechasInforme1.FechaFinal; } Active := True; diff --git a/Source/Modulos/Informe ventas por articulo/Controller/View/uIEditorInfVentasArticulo.pas b/Source/Modulos/Informe ventas por articulo/Controller/View/uIEditorInfVentasArticulo.pas index 15c3278..12ae503 100644 --- a/Source/Modulos/Informe ventas por articulo/Controller/View/uIEditorInfVentasArticulo.pas +++ b/Source/Modulos/Informe ventas por articulo/Controller/View/uIEditorInfVentasArticulo.pas @@ -3,10 +3,10 @@ unit uIEditorInfVentasArticulo; interface uses - uEditorInformeBase, uBizInfVentasArticulo, uInfVentasArticuloController; + uEditorInformeBaseInforme, uBizInfVentasArticulo, uInfVentasArticuloController; type - IEditorInfVentasArticulo = interface(IEditorInformeBase) + IEditorInfVentasArticulo = interface(IEditorInformeBaseInforme) ['{707DEF28-4ADB-444B-A03D-C20E12A8F5E0}'] function GetController : IInfVentasArticuloController; procedure SetController (const Value : IInfVentasArticuloController); diff --git a/Source/Modulos/Informe ventas por articulo/Data/InfVentasArticulo_data.drc b/Source/Modulos/Informe ventas por articulo/Data/InfVentasArticulo_data.drc index 4ee5cc0..1872610 100644 --- a/Source/Modulos/Informe ventas por articulo/Data/InfVentasArticulo_data.drc +++ b/Source/Modulos/Informe ventas por articulo/Data/InfVentasArticulo_data.drc @@ -14,4 +14,4 @@ END /* C:\Codigo\Source\Modulos\Informe ventas por articulo\Data\uDataModuleInfVentasArticulo.dfm */ /* C:\Codigo\Source\Modulos\Informe ventas por articulo\Data\InfVentasArticulo_data.res */ -/* c:\temp\dtf17C.tmp */ +/* c:\temp\dtf2F6.tmp */ diff --git a/Source/Modulos/Informe ventas por articulo/Model/InfVentasArticulo_model.drc b/Source/Modulos/Informe ventas por articulo/Model/InfVentasArticulo_model.drc index beb2474..ee0cc54 100644 --- a/Source/Modulos/Informe ventas por articulo/Model/InfVentasArticulo_model.drc +++ b/Source/Modulos/Informe ventas por articulo/Model/InfVentasArticulo_model.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo\Source\Modulos\Informe ventas por articulo\Model\InfVentasArticulo_model.res */ -/* c:\temp\dtf17A.tmp */ +/* c:\temp\dtf2F4.tmp */ diff --git a/Source/Modulos/Informe ventas por articulo/Views/InfVentasArticulo_view.drc b/Source/Modulos/Informe ventas por articulo/Views/InfVentasArticulo_view.drc index c4b6ea2..831a662 100644 --- a/Source/Modulos/Informe ventas por articulo/Views/InfVentasArticulo_view.drc +++ b/Source/Modulos/Informe ventas por articulo/Views/InfVentasArticulo_view.drc @@ -16,4 +16,4 @@ END /* C:\Codigo\Source\Modulos\Informe ventas por articulo\Views\uViewInfVentasArticulo.dfm */ /* C:\Codigo\Source\Modulos\Informe ventas por articulo\Views\uEditorInfVentasArticulo.dfm */ /* C:\Codigo\Source\Modulos\Informe ventas por articulo\Views\InfVentasArticulo_view.res */ -/* c:\temp\dtf180.tmp */ +/* c:\temp\dtf2FA.tmp */ diff --git a/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.dfm b/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.dfm index 6175a62..a561797 100644 --- a/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.dfm +++ b/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.dfm @@ -307,7 +307,7 @@ inherited fEditorInfVentasArticulo: TfEditorInfVentasArticulo Width = 879 ExplicitWidth = 879 end - inherited frViewPeriodoFechas1: TfrViewPeriodoFechas + inherited frViewPeriodoFechasInforme1: TfrViewPeriodoFechasInforme Width = 879 ExplicitWidth = 879 inherited TBXDockablePanel1: TTBXDockablePanel diff --git a/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.pas b/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.pas index 35de7b3..f941110 100644 --- a/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.pas +++ b/Source/Modulos/Informe ventas por articulo/Views/uEditorInfVentasArticulo.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, uEditorInformeBase, DB, uDADataTable, JvAppStorage, + Dialogs, uEditorInformeBaseInforme, DB, uDADataTable, JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uBizInformes, @@ -18,7 +18,7 @@ uses type - TfEditorInfVentasArticulo = class(TfEditorInformeBase, IEditorInfVentasArticulo) + TfEditorInfVentasArticulo = class(TfEditorInformeBaseInforme, IEditorInfVentasArticulo) TBXSeparatorItem16: TTBXSeparatorItem; tbxiExpandir: TTBXItem; tbxiContraer: TTBXItem; @@ -281,8 +281,8 @@ begin LeftTitle.Add(FInforme.DESCRIPCION); RightTitle.Clear; - RightTitle.Add(DateToStr(frViewInfVentasArticulo1.frViewPeriodoFechas1.edtFechaIni.Date) + - ' - ' + DateToStr(frViewInfVentasArticulo1.frViewPeriodoFechas1.edtFechaFin.Date)); + RightTitle.Add(DateToStr(frViewInfVentasArticulo1.frViewPeriodoFechasInforme1.edtFechaIni.Date) + + ' - ' + DateToStr(frViewInfVentasArticulo1.frViewPeriodoFechasInforme1.edtFechaFin.Date)); RightTitle.Add(frViewInfVentasArticulo1.frViewInfVentasArticuloGrid1.FocusedView.DataController.Filter.FilterText); end; end; diff --git a/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.dfm b/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.dfm index 6eda3f9..5e9d3b1 100644 --- a/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.dfm +++ b/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.dfm @@ -135,7 +135,7 @@ inherited frViewInfVentasArticulo: TfrViewInfVentasArticulo ExplicitTop = 76 ExplicitWidth = 679 end - inline frViewPeriodoFechas1: TfrViewPeriodoFechas + inline frViewPeriodoFechasInforme1: TfrViewPeriodoFechasInforme Left = 0 Top = 0 Width = 679 diff --git a/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.pas b/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.pas index 39808e3..86cf69c 100644 --- a/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.pas +++ b/Source/Modulos/Informe ventas por articulo/Views/uViewInfVentasArticulo.pas @@ -12,7 +12,7 @@ uses cxDBData, cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid, cxTextEdit, uViewFiltros, uBizInfVentasArticulo, uInfVentasArticuloController, - uViewPeriodoFechas, uViewInfVentasArticuloGrid, uDADataTable, uViewFiltroBase, + uViewPeriodoFechasInforme, uViewInfVentasArticuloGrid, uDADataTable, uViewFiltroBase, uDAInterfaces; type @@ -28,7 +28,7 @@ type end; TfrViewInfVentasArticulo = class(TfrViewInformeBase, IViewInfVentasArticulo) - frViewPeriodoFechas1: TfrViewPeriodoFechas; + frViewPeriodoFechasInforme1: TfrViewPeriodoFechasInforme; actPeriodoFechas: TAction; frViewInfVentasArticuloGrid1: TfrViewInfVentasArticuloGrid; dsVentasTerminadas: TDADataSource; @@ -122,7 +122,7 @@ begin ShowHourglassCursor; actRefrescar.Enabled := False; - AWhere := ' ( ' + fld_InfVentasArticuloFECHA_FACTURA + ' between ''' + ReplaceStr(DateToStr(frViewPeriodoFechas1.FechaInicial),'/','.') + ''' and ''' + ReplaceStr(DateToStr(frViewPeriodoFechas1.FechaFinal),'/','.') + ''') '; + AWhere := ' ( ' + fld_InfVentasArticuloFECHA_FACTURA + ' between ''' + ReplaceStr(DateToStr(frViewPeriodoFechasInforme1.FechaInicial),'/','.') + ''' and ''' + ReplaceStr(DateToStr(frViewPeriodoFechasInforme1.FechaFinal),'/','.') + ''') '; frViewInfVentasArticuloGrid1.OnViewChanged := nil; frViewInfVentasArticuloGrid1.OnFilterChanged := nil; @@ -156,8 +156,8 @@ begin with Datos.DataTable.DynamicWhere do begin // (FECHAINI >= ) - Condicion := NewBinaryExpression(NewField('', fld_InfVentasArticuloFECHA_FACTURA), NewConstant(frViewPeriodoFechas1.FechaInicial, datDateTime), dboGreaterOrEqual); - Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_InfVentasArticuloFECHA_FACTURA), NewConstant(frViewPeriodoFechas1.FechaFinal, datDateTime), dboLessOrEqual), Condicion, dboAnd); + Condicion := NewBinaryExpression(NewField('', fld_InfVentasArticuloFECHA_FACTURA), NewConstant(frViewPeriodoFechasInforme1.FechaInicial, datDateTime), dboGreaterOrEqual); + Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_InfVentasArticuloFECHA_FACTURA), NewConstant(frViewPeriodoFechasInforme1.FechaFinal, datDateTime), dboLessOrEqual), Condicion, dboAnd); if IsEmpty then Expression := Condicion @@ -182,10 +182,10 @@ begin end } -//showmessage(DateToStr(frViewPeriodoFechas1.FechaInicial)); -//showmessage(DateToStr(frViewPeriodoFechas1.FechaFinal)); -// ParamByName('FECHAINI').AsDateTime := frViewPeriodoFechas1.FechaInicial; -// ParamByName('FECHAFIN').AsDateTime := frViewPeriodoFechas1.FechaFinal; +//showmessage(DateToStr(frViewPeriodoFechasInforme1.FechaInicial)); +//showmessage(DateToStr(frViewPeriodoFechasInforme1.FechaFinal)); +// ParamByName('FECHAINI').AsDateTime := frViewPeriodoFechasInforme1.FechaInicial; +// ParamByName('FECHAFIN').AsDateTime := frViewPeriodoFechasInforme1.FechaFinal; Active := True; diff --git a/Source/Modulos/Informes base/Controller/InformesBase_controller.drc b/Source/Modulos/Informes base/Controller/InformesBase_controller.drc index 885dd11..b1a5f58 100644 --- a/Source/Modulos/Informes base/Controller/InformesBase_controller.drc +++ b/Source/Modulos/Informes base/Controller/InformesBase_controller.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo\Source\Modulos\Informes base\Controller\InformesBase_controller.res */ -/* c:\temp\dtf170.tmp */ +/* c:\temp\dtf2EA.tmp */ diff --git a/Source/Modulos/Informes base/Data/Informes_data.drc b/Source/Modulos/Informes base/Data/Informes_data.drc index 2b6b393..3eb17bb 100644 --- a/Source/Modulos/Informes base/Data/Informes_data.drc +++ b/Source/Modulos/Informes base/Data/Informes_data.drc @@ -14,4 +14,4 @@ END /* C:\Codigo\Source\Modulos\Informes base\Data\uDataModuleInformes.dfm */ /* C:\Codigo\Source\Modulos\Informes base\Data\Informes_data.res */ -/* c:\temp\dtf16A.tmp */ +/* c:\temp\dtf2E4.tmp */ diff --git a/Source/Modulos/Informes base/Model/Informes_model.drc b/Source/Modulos/Informes base/Model/Informes_model.drc index b559c57..5970762 100644 --- a/Source/Modulos/Informes base/Model/Informes_model.drc +++ b/Source/Modulos/Informes base/Model/Informes_model.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo\Source\Modulos\Informes base\Model\Informes_model.res */ -/* c:\temp\dtf168.tmp */ +/* c:\temp\dtf2E2.tmp */ diff --git a/Source/Modulos/Informes base/Views/InformesBase_view.dpk b/Source/Modulos/Informes base/Views/InformesBase_view.dpk index e0af6ec..54c73de 100644 --- a/Source/Modulos/Informes base/Views/InformesBase_view.dpk +++ b/Source/Modulos/Informes base/Views/InformesBase_view.dpk @@ -39,8 +39,8 @@ contains uViewSumarios in 'uViewSumarios.pas' {frViewSumarios: TFrame}, uViewFiltros in 'uViewFiltros.pas' {frViewFiltros: TFrame}, uViewInformeBase in 'uViewInformeBase.pas' {frViewInformeBase: TFrame}, - uEditorInformeBase in 'uEditorInformeBase.pas' {fEditorInformeBase: TfEditorInformeBase}, - uViewPeriodoFechas in 'uViewPeriodoFechas.pas' {frViewPeriodoFechas: TFrame}, + uEditorInformeBaseInforme in 'uEditorInformeBaseInforme.pas' {fEditorInformeBaseInforme: TfEditorInformeBase}, + uViewPeriodoFechasInforme in 'uViewPeriodoFechasInforme.pas' {frViewPeriodoFechasInforme: TFrame}, uFormPropiedadesInforme in 'uFormPropiedadesInforme.pas'; end. diff --git a/Source/Modulos/Informes base/Views/InformesBase_view.dproj b/Source/Modulos/Informes base/Views/InformesBase_view.dproj index 47fdb91..f1bc7cf 100644 --- a/Source/Modulos/Informes base/Views/InformesBase_view.dproj +++ b/Source/Modulos/Informes base/Views/InformesBase_view.dproj @@ -40,19 +40,6 @@ Package FalseTrueFalseTrueFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0InformesBase_view.dpk - - - - - - - - - - - - - ExpressVerticalGrid by Developer Express Inc. @@ -66,8 +53,8 @@ - -
fEditorInformeBase
+ +
fEditorInformeBaseInforme
TfEditorInformeBase
@@ -95,8 +82,8 @@
frViewInformeBaseParametros
TFrame
- -
frViewPeriodoFechas
+ +
frViewPeriodoFechasInforme
TFrame
diff --git a/Source/Modulos/Informes base/Views/Informes_view.drc b/Source/Modulos/Informes base/Views/Informes_view.drc index 80b9708..b9a491d 100644 --- a/Source/Modulos/Informes base/Views/Informes_view.drc +++ b/Source/Modulos/Informes base/Views/Informes_view.drc @@ -15,4 +15,4 @@ END /* C:\Codigo\Source\Modulos\Informes base\Views\uViewInformes.dfm */ /* C:\Codigo\Source\Modulos\Informes base\Views\uEditorInformes.dfm */ /* C:\Codigo\Source\Modulos\Informes base\Views\Informes_view.res */ -/* c:\temp\dtf174.tmp */ +/* c:\temp\dtf2EE.tmp */ diff --git a/Source/Modulos/Informes base/Views/uEditorInformeBase.dfm b/Source/Modulos/Informes base/Views/uEditorInformeBaseInforme.dfm similarity index 98% rename from Source/Modulos/Informes base/Views/uEditorInformeBase.dfm rename to Source/Modulos/Informes base/Views/uEditorInformeBaseInforme.dfm index 0ab5d2e..f668e63 100644 --- a/Source/Modulos/Informes base/Views/uEditorInformeBase.dfm +++ b/Source/Modulos/Informes base/Views/uEditorInformeBaseInforme.dfm @@ -1,4 +1,4 @@ -inherited fEditorInformeBase: TfEditorInformeBase +inherited fEditorInformeBaseInforme: TfEditorInformeBaseInforme Left = 499 Top = 302 Caption = '' @@ -78,13 +78,13 @@ inherited fEditorInformeBase: TfEditorInformeBase inherited pgPaginas: TPageControl Top = 105 Height = 334 - ExplicitTop = 102 - ExplicitHeight = 340 + ExplicitTop = 105 + ExplicitHeight = 334 inherited pagGeneral: TTabSheet ExplicitLeft = 4 ExplicitTop = 24 - ExplicitWidth = 644 - ExplicitHeight = 312 + ExplicitWidth = 887 + ExplicitHeight = 306 end end inherited StatusBar: TJvStatusBar diff --git a/Source/Modulos/Informes base/Views/uEditorInformeBase.pas b/Source/Modulos/Informes base/Views/uEditorInformeBaseInforme.pas similarity index 78% rename from Source/Modulos/Informes base/Views/uEditorInformeBase.pas rename to Source/Modulos/Informes base/Views/uEditorInformeBaseInforme.pas index 2c67190..18c2eb1 100644 --- a/Source/Modulos/Informes base/Views/uEditorInformeBase.pas +++ b/Source/Modulos/Informes base/Views/uEditorInformeBaseInforme.pas @@ -1,4 +1,4 @@ -unit uEditorInformeBase; +unit uEditorInformeBaseInforme; interface @@ -13,7 +13,7 @@ uses cxContainer, cxEdit, cxLabel; type - IEditorInformeBase = interface(IEditorDBItem) + IEditorInformeBaseInforme = interface(IEditorDBItem) ['{E8DB0818-75F8-4575-A30E-25B6599A757F}'] function GetInforme: IBizInforme; procedure SetInforme(const Value: IBizInforme); @@ -21,7 +21,7 @@ type end; - TfEditorInformeBase = class(TfEditorDBItem, IEditorInformeBase) + TfEditorInformeBaseInforme = class(TfEditorDBItem, IEditorInformeBaseInforme) actPropiedades: TAction; TBXSeparatorItem14: TTBXSeparatorItem; tbxiPropiedades: TTBXItem; @@ -71,12 +71,12 @@ uses { TfEditorControlBase } -function TfEditorInformeBase.GetInforme: IBizInforme; +function TfEditorInformeBaseInforme.GetInforme: IBizInforme; begin Result := FInforme; end; -function TfEditorInformeBase.GetModified: Boolean; +function TfEditorInformeBaseInforme.GetModified: Boolean; begin if (AppFactuGES.UsuarioActivo.LOGIN <> 'admin') then Result := False @@ -84,7 +84,7 @@ begin Result := inherited GetModified; end; -procedure TfEditorInformeBase.SetInforme(const Value: IBizInforme); +procedure TfEditorInformeBaseInforme.SetInforme(const Value: IBizInforme); begin FInforme := Value; dsDataTable.DataTable := FInforme.DataTable; @@ -95,7 +95,7 @@ begin FViewInforme.Informe := FInforme; end; -procedure TfEditorInformeBase.tbxEditFiltroChange(Sender: TObject; const Text: string); +procedure TfEditorInformeBaseInforme.tbxEditFiltroChange(Sender: TObject; const Text: string); begin inherited; if not Assigned(FViewInforme) then @@ -113,7 +113,7 @@ begin actQuitarFiltro.Execute; end; -procedure TfEditorInformeBase.actPropiedadesExecute(Sender: TObject); +procedure TfEditorInformeBaseInforme.actPropiedadesExecute(Sender: TObject); begin inherited; @@ -141,7 +141,7 @@ begin end; end; -procedure TfEditorInformeBase.actQuitarFiltroExecute(Sender: TObject); +procedure TfEditorInformeBaseInforme.actQuitarFiltroExecute(Sender: TObject); begin inherited; if Assigned(FViewInforme) then @@ -156,7 +156,7 @@ begin end; end; -procedure TfEditorInformeBase.ComprobarPrivilegios; +procedure TfEditorInformeBaseInforme.ComprobarPrivilegios; begin if (AppFactuGES.UsuarioActivo.LOGIN <> 'admin') then begin @@ -179,7 +179,7 @@ begin end; } -procedure TfEditorInformeBase.PonerTitulos(const ATitulo: string); +procedure TfEditorInformeBaseInforme.PonerTitulos(const ATitulo: string); var FTitulo : String; begin @@ -197,43 +197,43 @@ begin Self.Caption := FTitulo + ' (' + AppFactuGES.EmpresaActiva.NOMBRE + ')'; end; -procedure TfEditorInformeBase.actGuardarCerrarUpdate(Sender: TObject); +procedure TfEditorInformeBaseInforme.actGuardarCerrarUpdate(Sender: TObject); begin inherited; // (Sender as TAction).Enabled := Assigned(FInforme) and (FInforme.EsModificable); end; -procedure TfEditorInformeBase.actGuardarUpdate(Sender: TObject); +procedure TfEditorInformeBaseInforme.actGuardarUpdate(Sender: TObject); begin inherited; // (Sender as TAction).Enabled := Assigned(FInforme) and (FInforme.EsModificable); end; -procedure TfEditorInformeBase.actPrevisualizarExecute(Sender: TObject); +procedure TfEditorInformeBaseInforme.actPrevisualizarExecute(Sender: TObject); begin RellenarCabeceraInforme; inherited; end; -procedure TfEditorInformeBase.RellenarCabeceraInforme; +procedure TfEditorInformeBaseInforme.RellenarCabeceraInforme; begin inherited; // end; -procedure TfEditorInformeBase.RestaurarConfiguracion; +procedure TfEditorInformeBaseInforme.RestaurarConfiguracion; begin // end; -procedure TfEditorInformeBase.actImprimirExecute(Sender: TObject); +procedure TfEditorInformeBaseInforme.actImprimirExecute(Sender: TObject); begin RellenarCabeceraInforme; inherited; end; -procedure TfEditorInformeBase.actEliminarExecute(Sender: TObject); +procedure TfEditorInformeBaseInforme.actEliminarExecute(Sender: TObject); begin { if not FInforme.EsModificable then diff --git a/Source/Modulos/Informes base/Views/uViewPeriodoFechas.dfm b/Source/Modulos/Informes base/Views/uViewPeriodoFechasInforme.dfm similarity index 93% rename from Source/Modulos/Informes base/Views/uViewPeriodoFechas.dfm rename to Source/Modulos/Informes base/Views/uViewPeriodoFechasInforme.dfm index d6aca5f..94ed683 100644 --- a/Source/Modulos/Informes base/Views/uViewPeriodoFechas.dfm +++ b/Source/Modulos/Informes base/Views/uViewPeriodoFechasInforme.dfm @@ -1,4 +1,4 @@ -inherited frViewPeriodoFechas: TfrViewPeriodoFechas +inherited frViewPeriodoFechasInforme: TfrViewPeriodoFechasInforme Width = 769 Height = 75 ExplicitWidth = 769 @@ -12,9 +12,6 @@ inherited frViewPeriodoFechas: TfrViewPeriodoFechas FloatingHeight = 128 SupportedDocks = [dkStandardDock, dkMultiDock] TabOrder = 0 - ExplicitTop = 3 - ExplicitWidth = 128 - ExplicitHeight = 128 object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 @@ -23,9 +20,8 @@ inherited frViewPeriodoFechas: TfrViewPeriodoFechas Align = alClient ParentBackground = True TabOrder = 0 + TabStop = False LookAndFeel = dxLayoutStandardLookAndFeel1 - ExplicitWidth = 455 - ExplicitHeight = 74 DesignSize = ( 769 75) diff --git a/Source/Modulos/Informes base/Views/uViewPeriodoFechas.pas b/Source/Modulos/Informes base/Views/uViewPeriodoFechasInforme.pas similarity index 75% rename from Source/Modulos/Informes base/Views/uViewPeriodoFechas.pas rename to Source/Modulos/Informes base/Views/uViewPeriodoFechasInforme.pas index c937783..0b98cab 100644 --- a/Source/Modulos/Informes base/Views/uViewPeriodoFechas.pas +++ b/Source/Modulos/Informes base/Views/uViewPeriodoFechasInforme.pas @@ -1,4 +1,4 @@ -unit uViewPeriodoFechas; +unit uViewPeriodoFechasInforme; interface @@ -14,7 +14,7 @@ type ['{793084E2-873E-4C57-8BD6-9087816CCF3A}'] end; - TfrViewPeriodoFechas = class(TfrViewInformeBaseParametros, IViewPeriodoFechas) + TfrViewPeriodoFechasInforme = class(TfrViewInformeBaseParametros, IViewPeriodoFechas) cxRepository: TcxEditRepository; cxRepositoryPeriodos: TcxEditRepositoryComboBoxItem; dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList; @@ -64,92 +64,92 @@ uses DateUtils; {$R *.dfm} -procedure TfrViewPeriodoFechas.AnoAnterior; +procedure TfrViewPeriodoFechasInforme.AnoAnterior; begin edtFechaIni.Date := StartOfTheYear(IncYear(Today, -1)); edtFechaFin.Date := EndOfTheYear(IncYear(Today, -1)); end; -procedure TfrViewPeriodoFechas.Ayer; +procedure TfrViewPeriodoFechasInforme.Ayer; begin edtFechaIni.Date := Yesterday; edtFechaFin.Date := Yesterday; end; -procedure TfrViewPeriodoFechas.EstaSemana; +procedure TfrViewPeriodoFechasInforme.EstaSemana; begin edtFechaIni.Date := StartOfTheWeek(Today); edtFechaFin.Date := EndOfTheWeek(Today); end; -procedure TfrViewPeriodoFechas.EsteAno; +procedure TfrViewPeriodoFechasInforme.EsteAno; begin edtFechaIni.Date := StartOfTheYear(Today); edtFechaFin.Date := EndOfTheYear(Today); end; -procedure TfrViewPeriodoFechas.EsteMes; +procedure TfrViewPeriodoFechasInforme.EsteMes; begin edtFechaIni.Date := StartOfTheMonth(Today); edtFechaFin.Date := EndOfTheMonth(Today); end; -function TfrViewPeriodoFechas.GetFechaFinal: TDateTime; +function TfrViewPeriodoFechasInforme.GetFechaFinal: TDateTime; begin Result := DateOf(edtFechaFin.Date); end; -function TfrViewPeriodoFechas.GetFechaInicial: TDateTime; +function TfrViewPeriodoFechasInforme.GetFechaInicial: TDateTime; begin Result := DateOf(edtFechaIni.Date); end; -procedure TfrViewPeriodoFechas.Hoy; +procedure TfrViewPeriodoFechasInforme.Hoy; begin edtFechaIni.Date := Today; edtFechaFin.Date := Today; end; -procedure TfrViewPeriodoFechas.MesAnterior; +procedure TfrViewPeriodoFechasInforme.MesAnterior; begin edtFechaIni.Date := StartOfTheMonth(IncMonth(Today, -1)); edtFechaFin.Date := EndOfTheMonth(IncMonth(Today, -1)); end; -procedure TfrViewPeriodoFechas.Personalizado; +procedure TfrViewPeriodoFechasInforme.Personalizado; begin edtFechaIni.SetFocus; end; -procedure TfrViewPeriodoFechas.SetFechaFinal(const Value: TDateTime); +procedure TfrViewPeriodoFechasInforme.SetFechaFinal(const Value: TDateTime); begin edtFechaFin.Date := Value; end; -procedure TfrViewPeriodoFechas.SetFechaInicial(const Value: TDateTime); +procedure TfrViewPeriodoFechasInforme.SetFechaInicial(const Value: TDateTime); begin edtFechaIni.Date := Value; end; -procedure TfrViewPeriodoFechas.Ultimos30dias; +procedure TfrViewPeriodoFechasInforme.Ultimos30dias; begin edtFechaIni.Date := IncDay(Today, -30); edtFechaFin.Date := Today end; -procedure TfrViewPeriodoFechas.Ultimos3meses; +procedure TfrViewPeriodoFechasInforme.Ultimos3meses; begin edtFechaIni.Date := IncMonth(Today, -3); edtFechaFin.Date := Today end; -procedure TfrViewPeriodoFechas.Ultimos7dias; +procedure TfrViewPeriodoFechasInforme.Ultimos7dias; begin edtFechaIni.Date := IncDay(Today, -7); edtFechaFin.Date := Today end; -procedure TfrViewPeriodoFechas.cbPeriodoPropertiesChange(Sender: TObject); +procedure TfrViewPeriodoFechasInforme.cbPeriodoPropertiesChange(Sender: TObject); begin case (Sender as TcxComboBox).ItemIndex of 0 : Hoy; @@ -167,14 +167,14 @@ begin end; end; -constructor TfrViewPeriodoFechas.Create(AOwner: TComponent); +constructor TfrViewPeriodoFechasInforme.Create(AOwner: TComponent); begin inherited; cbPeriodo.ItemIndex := 3; EsteMes; end; -procedure TfrViewPeriodoFechas.edtFechaIni2PropertiesValidate( +procedure TfrViewPeriodoFechasInforme.edtFechaIni2PropertiesValidate( Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); begin @@ -188,7 +188,7 @@ begin end; end; -procedure TfrViewPeriodoFechas.edtFechaFinPropertiesValidate( +procedure TfrViewPeriodoFechasInforme.edtFechaFinPropertiesValidate( Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); begin diff --git a/Source/Modulos/Pedidos de cliente/Controller/PedidosCliente_controller.drc b/Source/Modulos/Pedidos de cliente/Controller/PedidosCliente_controller.drc index f579044..546fb10 100644 --- a/Source/Modulos/Pedidos de cliente/Controller/PedidosCliente_controller.drc +++ b/Source/Modulos/Pedidos de cliente/Controller/PedidosCliente_controller.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo\Source\Modulos\Pedidos de cliente\Controller\PedidosCliente_controller.RES */ -/* c:\temp\dtf1BE.tmp */ +/* c:\temp\dtf338.tmp */ diff --git a/Source/Modulos/Pedidos de cliente/Data/PedidosCliente_data.drc b/Source/Modulos/Pedidos de cliente/Data/PedidosCliente_data.drc index 2c72e5f..d1895fc 100644 --- a/Source/Modulos/Pedidos de cliente/Data/PedidosCliente_data.drc +++ b/Source/Modulos/Pedidos de cliente/Data/PedidosCliente_data.drc @@ -14,4 +14,4 @@ END /* C:\Codigo\Source\Modulos\Pedidos de cliente\Data\uDataModulePedidosCliente.dfm */ /* C:\Codigo\Source\Modulos\Pedidos de cliente\Data\PedidosCliente_data.RES */ -/* c:\temp\dtf1BC.tmp */ +/* c:\temp\dtf336.tmp */ diff --git a/Source/Modulos/Pedidos de cliente/Model/PedidosCliente_model.drc b/Source/Modulos/Pedidos de cliente/Model/PedidosCliente_model.drc index 75ec362..2e7f5cc 100644 --- a/Source/Modulos/Pedidos de cliente/Model/PedidosCliente_model.drc +++ b/Source/Modulos/Pedidos de cliente/Model/PedidosCliente_model.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo\Source\Modulos\Pedidos de cliente\Model\PedidosCliente_model.RES */ -/* c:\temp\dtf1BA.tmp */ +/* c:\temp\dtf334.tmp */ diff --git a/Source/Modulos/Pedidos de cliente/Plugin/PedidosCliente_plugin.drc b/Source/Modulos/Pedidos de cliente/Plugin/PedidosCliente_plugin.drc index 7a8896f..932ef02 100644 --- a/Source/Modulos/Pedidos de cliente/Plugin/PedidosCliente_plugin.drc +++ b/Source/Modulos/Pedidos de cliente/Plugin/PedidosCliente_plugin.drc @@ -14,4 +14,4 @@ END /* C:\Codigo\Source\Modulos\Pedidos de cliente\Plugin\uPluginPedidosCliente.dfm */ /* C:\Codigo\Source\Modulos\Pedidos de cliente\Plugin\PedidosCliente_plugin.RES */ -/* c:\temp\dtf222.tmp */ +/* c:\temp\dtf39C.tmp */ diff --git a/Source/Modulos/Pedidos de cliente/Views/PedidosCliente_view.drc b/Source/Modulos/Pedidos de cliente/Views/PedidosCliente_view.drc index 9bc08be..e76f204 100644 --- a/Source/Modulos/Pedidos de cliente/Views/PedidosCliente_view.drc +++ b/Source/Modulos/Pedidos de cliente/Views/PedidosCliente_view.drc @@ -26,4 +26,4 @@ END /* C:\Codigo\Source\Modulos\Pedidos de cliente\Views\uEditorElegirArticulosPedidoCliente.dfm */ /* C:\Codigo\Source\Modulos\Pedidos de cliente\Views\uEditorDireccionEntregaPedidoCliente.dfm */ /* C:\Codigo\Source\Modulos\Pedidos de cliente\Views\PedidosCliente_view.RES */ -/* c:\temp\dtf220.tmp */ +/* c:\temp\dtf39A.tmp */ diff --git a/Source/Modulos/Tienda web/Data/TiendaWeb_data.drc b/Source/Modulos/Tienda web/Data/TiendaWeb_data.drc index 813041a..72d5378 100644 --- a/Source/Modulos/Tienda web/Data/TiendaWeb_data.drc +++ b/Source/Modulos/Tienda web/Data/TiendaWeb_data.drc @@ -14,4 +14,4 @@ END /* C:\Codigo\Source\Modulos\Tienda web\Data\uDataModuleTiendaWeb.dfm */ /* C:\Codigo\Source\Modulos\Tienda web\Data\TiendaWeb_data.res */ -/* c:\temp\dtf1D4.tmp */ +/* c:\temp\dtf34E.tmp */ diff --git a/Source/Servicios/FactuGES.RODL b/Source/Servicios/FactuGES.RODL index 265a29a..94870b6 100644 --- a/Source/Servicios/FactuGES.RODL +++ b/Source/Servicios/FactuGES.RODL @@ -296,6 +296,12 @@ + + + + + + @@ -320,6 +326,12 @@ + + + + + + @@ -924,6 +936,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Servicios/FactuGES_Intf.pas b/Source/Servicios/FactuGES_Intf.pas index 96a4165..d6725ce 100644 --- a/Source/Servicios/FactuGES_Intf.pas +++ b/Source/Servicios/FactuGES_Intf.pas @@ -525,6 +525,7 @@ type function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean; const VerCopia: Boolean): Binary; function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; + function DarListaAnos: StringArray; end; { CosrvFacturasCliente } @@ -540,6 +541,7 @@ type function GenerarInforme(const ListaID: TIntegerArray; const VerSello: Boolean; const VerCopia: Boolean): Binary; function GenerarInformeEnWord(const ID: Integer; const VerSello: Boolean): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerSello: Boolean): Binary; + function DarListaAnos: StringArray; end; { IsrvFacturasProveedor } @@ -547,6 +549,7 @@ type ['{7655160C-7023-452E-BB0E-C97E29B915E7}'] function GenerarInforme(const ListaID: TIntegerArray): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + function DarListaAnos: StringArray; end; { CosrvFacturasProveedor } @@ -561,6 +564,7 @@ type function GenerarInforme(const ListaID: TIntegerArray): Binary; function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; + function DarListaAnos: StringArray; end; { IsrvPresupuestosCliente } @@ -815,6 +819,13 @@ type const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoPedidos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function DarListaAnosFacturasProv: StringArray; + function DarListaAnosFacturasCli: StringArray; + function DarListaIntervalos: StringArray; + function GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; + const TopN: Integer): Binary; + function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; + const TopN: Integer): Binary; end; { CosrvGestorInformes } @@ -851,6 +862,13 @@ type const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; function GenerarInformeListadoPedidos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; + function DarListaAnosFacturasProv: StringArray; + function DarListaAnosFacturasCli: StringArray; + function DarListaIntervalos: StringArray; + function GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; + const TopN: Integer): Binary; + function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; + const TopN: Integer): Binary; end; { IsrvComisiones } @@ -1953,6 +1971,22 @@ begin end end; +function TsrvFacturasCliente_Proxy.DarListaAnos: StringArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarListaAnos'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + { CosrvFacturasProveedor } class function CosrvFacturasProveedor.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvFacturasProveedor; @@ -2001,6 +2035,22 @@ begin end end; +function TsrvFacturasProveedor_Proxy.DarListaAnos: StringArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarListaAnos'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + { CosrvPresupuestosCliente } class function CosrvPresupuestosCliente.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvPresupuestosCliente; @@ -2883,6 +2933,100 @@ begin end end; +function TsrvGestorInformes_Proxy.DarListaAnosFacturasProv: StringArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarListaAnosFacturasProv'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TsrvGestorInformes_Proxy.DarListaAnosFacturasCli: StringArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarListaAnosFacturasCli'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TsrvGestorInformes_Proxy.DarListaIntervalos: StringArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarListaIntervalos'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TsrvGestorInformes_Proxy.GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; + const TopN: Integer): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeFacturasProvGrafComp'); + __Message.Write('IdEmpresa', TypeInfo(Integer), IdEmpresa, []); + __Message.Write('Intervalo', TypeInfo(Variant), Intervalo, []); + __Message.Write('Ano1', TypeInfo(Variant), Ano1, []); + __Message.Write('Ano2', TypeInfo(Variant), Ano2, []); + __Message.Write('ListaIDProveedores', TypeInfo(FactuGES_Intf.TIntegerArray), ListaIDProveedores, []); + __Message.Write('TopN', TypeInfo(Integer), TopN, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TsrvGestorInformes_Proxy.GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; + const TopN: Integer): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeFacturasCliGrafComp'); + __Message.Write('IdEmpresa', TypeInfo(Integer), IdEmpresa, []); + __Message.Write('Intervalo', TypeInfo(Variant), Intervalo, []); + __Message.Write('Ano1', TypeInfo(Variant), Ano1, []); + __Message.Write('Ano2', TypeInfo(Variant), Ano2, []); + __Message.Write('ListaIDClientes', TypeInfo(FactuGES_Intf.TIntegerArray), ListaIDClientes, []); + __Message.Write('TopN', TypeInfo(Integer), TopN, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + { CosrvComisiones } class function CosrvComisiones.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvComisiones; diff --git a/Source/Servicios/FactuGES_Invk.pas b/Source/Servicios/FactuGES_Invk.pas index 8d12607..7c49ef0 100644 --- a/Source/Servicios/FactuGES_Invk.pas +++ b/Source/Servicios/FactuGES_Invk.pas @@ -173,6 +173,7 @@ type procedure Invoke_GenerarInforme(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); procedure Invoke_GenerarInformeEnWord(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); procedure Invoke_GenerarInformeEnPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_DarListaAnos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); end; TsrvFacturasProveedor_Invoker = class(TDataAbstractService_Invoker) @@ -183,6 +184,7 @@ type published procedure Invoke_GenerarInforme(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); procedure Invoke_GenerarInformeEnPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_DarListaAnos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); end; TsrvPresupuestosCliente_Invoker = class(TDataAbstractService_Invoker) @@ -307,6 +309,11 @@ type procedure Invoke_GenerarInformeListadoRecibosProvPendientes(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); procedure Invoke_GenerarInformeListadoPresupuestos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); procedure Invoke_GenerarInformeListadoPedidos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_DarListaAnosFacturasProv(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_DarListaAnosFacturasCli(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_DarListaIntervalos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GenerarInformeFacturasProvGrafComp(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GenerarInformeFacturasCliGrafComp(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); end; TsrvComisiones_Invoker = class(TDataAbstractService_Invoker) @@ -1023,6 +1030,31 @@ begin end; end; +procedure TsrvFacturasCliente_Invoker.Invoke_DarListaAnos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function DarListaAnos: StringArray; } +var + lResult: DataAbstract4_Intf.StringArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IsrvFacturasCliente).DarListaAnos; + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvFacturasCliente', 'DarListaAnosResponse'); + __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + { TsrvFacturasProveedor_Invoker } constructor TsrvFacturasProveedor_Invoker.Create; @@ -1091,6 +1123,31 @@ begin end; end; +procedure TsrvFacturasProveedor_Invoker.Invoke_DarListaAnos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function DarListaAnos: StringArray; } +var + lResult: DataAbstract4_Intf.StringArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IsrvFacturasProveedor).DarListaAnos; + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvFacturasProveedor', 'DarListaAnosResponse'); + __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + { TsrvPresupuestosCliente_Invoker } constructor TsrvPresupuestosCliente_Invoker.Create; @@ -2430,6 +2487,163 @@ begin end; end; +procedure TsrvGestorInformes_Invoker.Invoke_DarListaAnosFacturasProv(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function DarListaAnosFacturasProv: StringArray; } +var + lResult: DataAbstract4_Intf.StringArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IsrvGestorInformes).DarListaAnosFacturasProv; + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorInformes', 'DarListaAnosFacturasProvResponse'); + __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TsrvGestorInformes_Invoker.Invoke_DarListaAnosFacturasCli(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function DarListaAnosFacturasCli: StringArray; } +var + lResult: DataAbstract4_Intf.StringArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IsrvGestorInformes).DarListaAnosFacturasCli; + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorInformes', 'DarListaAnosFacturasCliResponse'); + __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TsrvGestorInformes_Invoker.Invoke_DarListaIntervalos(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function DarListaIntervalos: StringArray; } +var + lResult: DataAbstract4_Intf.StringArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IsrvGestorInformes).DarListaIntervalos; + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorInformes', 'DarListaIntervalosResponse'); + __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TsrvGestorInformes_Invoker.Invoke_GenerarInformeFacturasProvGrafComp(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GenerarInformeFacturasProvGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDProveedores: TIntegerArray; + const TopN: Integer): Binary; } +var + IdEmpresa: Integer; + Intervalo: Variant; + Ano1: Variant; + Ano2: Variant; + ListaIDProveedores: FactuGES_Intf.TIntegerArray; + TopN: Integer; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + ListaIDProveedores := nil; + lResult := nil; + try + __Message.Read('IdEmpresa', TypeInfo(Integer), IdEmpresa, []); + __Message.Read('Intervalo', TypeInfo(Variant), Intervalo, []); + __Message.Read('Ano1', TypeInfo(Variant), Ano1, []); + __Message.Read('Ano2', TypeInfo(Variant), Ano2, []); + __Message.Read('ListaIDProveedores', TypeInfo(FactuGES_Intf.TIntegerArray), ListaIDProveedores, []); + __Message.Read('TopN', TypeInfo(Integer), TopN, []); + + lResult := (__Instance as IsrvGestorInformes).GenerarInformeFacturasProvGrafComp(IdEmpresa, Intervalo, Ano1, Ano2, ListaIDProveedores, TopN); + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorInformes', 'GenerarInformeFacturasProvGrafCompResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(ListaIDProveedores); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TsrvGestorInformes_Invoker.Invoke_GenerarInformeFacturasCliGrafComp(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; + const TopN: Integer): Binary; } +var + IdEmpresa: Integer; + Intervalo: Variant; + Ano1: Variant; + Ano2: Variant; + ListaIDClientes: FactuGES_Intf.TIntegerArray; + TopN: Integer; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + ListaIDClientes := nil; + lResult := nil; + try + __Message.Read('IdEmpresa', TypeInfo(Integer), IdEmpresa, []); + __Message.Read('Intervalo', TypeInfo(Variant), Intervalo, []); + __Message.Read('Ano1', TypeInfo(Variant), Ano1, []); + __Message.Read('Ano2', TypeInfo(Variant), Ano2, []); + __Message.Read('ListaIDClientes', TypeInfo(FactuGES_Intf.TIntegerArray), ListaIDClientes, []); + __Message.Read('TopN', TypeInfo(Integer), TopN, []); + + lResult := (__Instance as IsrvGestorInformes).GenerarInformeFacturasCliGrafComp(IdEmpresa, Intervalo, Ano1, Ano2, ListaIDClientes, TopN); + + __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorInformes', 'GenerarInformeFacturasCliGrafCompResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(ListaIDClientes); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + { TsrvComisiones_Invoker } constructor TsrvComisiones_Invoker.Create; diff --git a/Source/Servicios/RODLFile.res b/Source/Servicios/RODLFile.res index 7bb3a35..57f2031 100644 Binary files a/Source/Servicios/RODLFile.res and b/Source/Servicios/RODLFile.res differ diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index b475b21..87c8068 100644 Binary files a/Source/Servidor/FactuGES_Server.RES and b/Source/Servidor/FactuGES_Server.RES differ diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index c920c4c..871511f 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -35,7 +35,7 @@ Delphi.Personality - FalseTrueFalse/standaloneTrueFalse4110FalseFalseFalseFalseFalse308212524.1.1.04.1.1.0miƩrcoles, 12 de enero de 2011 18:17 + FalseTrueFalse/standaloneTrueFalse4120FalseFalseFalseFalseFalse308212524.1.2.04.1.2.0miƩrcoles, 09 de febrero de 2011 19:22 ExpressPrinting System by Developer Express Inc. FactuGES_Server.dprFalse diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index 0742d8b..3f83661 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo\Resources\Iconos\Servidor.ico" 1 VERSIONINFO -FILEVERSION 4,1,0,0 -PRODUCTVERSION 4,1,0,0 +FILEVERSION 4,1,2,0 +PRODUCTVERSION 4,1,2,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -12,9 +12,9 @@ BEGIN BEGIN BLOCK "0C0A04E4" BEGIN - VALUE "FileVersion", "4.1.0.0\0" - VALUE "ProductVersion", "4.1.0.0\0" - VALUE "CompileDate", "jueves, 02 de diciembre de 2010 12:10\0" + VALUE "FileVersion", "4.1.2.0\0" + VALUE "ProductVersion", "4.1.2.0\0" + VALUE "CompileDate", "viernes, 11 de febrero de 2011 13:14\0" END END BLOCK "VarFileInfo"