diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql
index 4e6290f4..f955a10d 100644
--- a/Database/scripts/factuges.sql
+++ b/Database/scripts/factuges.sql
@@ -3502,8 +3502,8 @@ CREATE VIEW V_INF_FAC_CLIENTE(
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,
+CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA),7)+1) AS SMALLINT) as SEMESTRE,
+CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA)+2,3)) 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
@@ -3525,8 +3525,8 @@ CREATE VIEW V_INF_FAC_PROVEEDOR(
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,
+CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA),7)+1) AS SMALLINT) as SEMESTRE,
+CAST((DIV(EXTRACT(MONTH FROM f.FECHA_FACTURA)+2,3)) 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
diff --git a/Source/Informes/1/InformeListadoBeneficiosGrafComp.fr3 b/Source/Informes/1/InformeListadoBeneficiosGrafComp.fr3
new file mode 100644
index 00000000..818d5444
--- /dev/null
+++ b/Source/Informes/1/InformeListadoBeneficiosGrafComp.fr3
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm
index 12e36516..54789e9d 100644
--- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm
+++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm
@@ -2,7 +2,7 @@ object RptFacturasCliente: TRptFacturasCliente
OldCreateOrder = True
OnCreate = DataModuleCreate
OnDestroy = DataModuleDestroy
- Height = 657
+ Height = 821
Width = 974
object schReport: TDASchema
ConnectionManager = dmServer.ConnectionManager
@@ -1421,6 +1421,675 @@ object RptFacturasCliente: TRptFacturasCliente
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
+ SQL =
+ 'select VALOR, DESCRIPCION,'#10'periodo_ingresos1.ANO as Ano1, period' +
+ 'o_ingresos1.IMPORTE_TOTAL as INGRESOS_ANO1,'#10'periodo_gastos1.ANO ' +
+ 'as Ano1, periodo_gastos1.IMPORTE_TOTAL as GASTOS_ANO1,'#10'(coalesce' +
+ '(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.' +
+ 'IMPORTE_TOTAL, 0)) as BENEFICIO_ANO1,'#10#10'periodo_ingresos2.ANO as ' +
+ 'Ano2, periodo_ingresos2.IMPORTE_TOTAL as INGRESOS_ANO2,'#10'periodo_' +
+ 'gastos2.ANO as Ano2, periodo_gastos2.IMPORTE_TOTAL as GASTOS_ANO' +
+ '2,'#10'(coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(peri' +
+ 'odo_gastos2.IMPORTE_TOTAL, 0)) as BENEFICIO_ANO2,'#10#10#10'(periodo_ing' +
+ 'resos1.IMPORTE_TOTAL - periodo_ingresos2.IMPORTE_TOTAL) as Difer' +
+ 'encia_Ingresos,'#10'case'#10'when (periodo_ingresos1.IMPORTE_TOTAL = 0) ' +
+ 'then (100 - (periodo_ingresos2.IMPORTE_TOTAL*100))'#10'else (100 - (' +
+ '(periodo_ingresos2.IMPORTE_TOTAL*100)/periodo_ingresos1.IMPORTE_' +
+ 'TOTAL))'#10'end as Porcentaje_Aumento_Ingresos,'#10#10'(periodo_gastos1.IM' +
+ 'PORTE_TOTAL - periodo_gastos2.IMPORTE_TOTAL) as Diferencia_Gasto' +
+ 's,'#10'case'#10'when (periodo_gastos1.IMPORTE_TOTAL = 0) then (100 - (pe' +
+ 'riodo_gastos2.IMPORTE_TOTAL*100))'#10'else (100 - ((periodo_gastos2.' +
+ 'IMPORTE_TOTAL*100)/periodo_gastos1.IMPORTE_TOTAL))'#10'end as Porcen' +
+ 'taje_Aumento_Gastos,'#10#10'((coalesce(periodo_ingresos1.IMPORTE_TOTAL' +
+ ', 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0)) - (coalesce(p' +
+ 'eriodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IM' +
+ 'PORTE_TOTAL, 0))) as Diferencia_Beneficios,'#10#10'case'#10'when ((coalesc' +
+ 'e(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1' +
+ '.IMPORTE_TOTAL, 0)) = 0) then (100 - ((coalesce(periodo_ingresos' +
+ '2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)' +
+ ')*100))'#10'else (100 - (((coalesce(periodo_ingresos2.IMPORTE_TOTAL,' +
+ ' 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0))*100) / (coales' +
+ 'ce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos' +
+ '1.IMPORTE_TOTAL, 0))))'#10'end as Porcentaje_Aumento_Beneficios'#10#10'FRO' +
+ 'M'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, TR' +
+ 'IMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from' +
+ ' V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (AN' +
+ 'O = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingreso' +
+ 's1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp2' +
+ '.ID_EMPRESA, comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.IMPORTE_TO' +
+ 'TAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EM' +
+ 'PRESA = :ID_EMPRESA1'#10'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1' +
+ ' desc,2 asc) periodo_gastos1 on (VALOR = periodo_gastos1.NFILA)'#10 +
+ #10'left join'#10'(select comp3.ID_EMPRESA, comp3.ANO, TRIMESTRE as NFI' +
+ 'LA, SUM(comp3.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_CLI' +
+ 'ENTE comp3'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'gro' +
+ 'up by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingresos2 on (VALOR =' +
+ ' periodo_ingresos2.NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA, c' +
+ 'omp4.ANO, TRIMESTRE as NFILA, SUM(comp4.IMPORTE_TOTAL) as IMPORT' +
+ 'E_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EM' +
+ 'PRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) p' +
+ 'eriodo_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where period' +
+ 'o= '#39'TRIMESTRAL'#39#10'order by valor 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 = 'ANO2'
+ TableField = 'ANO2'
+ end
+ item
+ DatasetField = 'INGRESOS_ANO1'
+ TableField = 'INGRESOS_ANO1'
+ end
+ item
+ DatasetField = 'ANO11'
+ TableField = 'ANO11'
+ end
+ item
+ DatasetField = 'GASTOS_ANO1'
+ TableField = 'GASTOS_ANO1'
+ end
+ item
+ DatasetField = 'BENEFICIO_ANO1'
+ TableField = 'BENEFICIO_ANO1'
+ end
+ item
+ DatasetField = 'INGRESOS_ANO2'
+ TableField = 'INGRESOS_ANO2'
+ end
+ item
+ DatasetField = 'ANO21'
+ TableField = 'ANO21'
+ end
+ item
+ DatasetField = 'GASTOS_ANO2'
+ TableField = 'GASTOS_ANO2'
+ end
+ item
+ DatasetField = 'BENEFICIO_ANO2'
+ TableField = 'BENEFICIO_ANO2'
+ end
+ item
+ DatasetField = 'DIFERENCIA_INGRESOS'
+ TableField = 'DIFERENCIA_INGRESOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_INGRESOS'
+ TableField = 'PORCENTAJE_AUMENTO_INGRESOS'
+ end
+ item
+ DatasetField = 'DIFERENCIA_GASTOS'
+ TableField = 'DIFERENCIA_GASTOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_GASTOS'
+ TableField = 'PORCENTAJE_AUMENTO_GASTOS'
+ end
+ item
+ DatasetField = 'DIFERENCIA_BENEFICIOS'
+ TableField = 'DIFERENCIA_BENEFICIOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ TableField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ end>
+ end>
+ Name = 'InformeListadoBeneficiosGrafCompTrimestral'
+ Fields = <
+ item
+ Name = 'VALOR'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'DESCRIPCION'
+ DataType = datString
+ Size = 20
+ end
+ item
+ Name = 'ANO1'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO11'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO2'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO21'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_BENEFICIOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ 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
+ SQL =
+ 'select VALOR, DESCRIPCION,'#10'periodo_ingresos1.ANO as Ano1, period' +
+ 'o_ingresos1.IMPORTE_TOTAL as INGRESOS_ANO1,'#10'periodo_gastos1.ANO ' +
+ 'as Ano1, periodo_gastos1.IMPORTE_TOTAL as GASTOS_ANO1,'#10'(coalesce' +
+ '(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.' +
+ 'IMPORTE_TOTAL, 0)) as BENEFICIO_ANO1,'#10#10'periodo_ingresos2.ANO as ' +
+ 'Ano2, periodo_ingresos2.IMPORTE_TOTAL as INGRESOS_ANO2,'#10'periodo_' +
+ 'gastos2.ANO as Ano2, periodo_gastos2.IMPORTE_TOTAL as GASTOS_ANO' +
+ '2,'#10'(coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(peri' +
+ 'odo_gastos2.IMPORTE_TOTAL, 0)) as BENEFICIO_ANO2,'#10#10#10'(periodo_ing' +
+ 'resos1.IMPORTE_TOTAL - periodo_ingresos2.IMPORTE_TOTAL) as Difer' +
+ 'encia_Ingresos,'#10'case'#10'when (periodo_ingresos1.IMPORTE_TOTAL = 0) ' +
+ 'then (100 - (periodo_ingresos2.IMPORTE_TOTAL*100))'#10'else (100 - (' +
+ '(periodo_ingresos2.IMPORTE_TOTAL*100)/periodo_ingresos1.IMPORTE_' +
+ 'TOTAL))'#10'end as Porcentaje_Aumento_Ingresos,'#10#10'(periodo_gastos1.IM' +
+ 'PORTE_TOTAL - periodo_gastos2.IMPORTE_TOTAL) as Diferencia_Gasto' +
+ 's,'#10'case'#10'when (periodo_gastos1.IMPORTE_TOTAL = 0) then (100 - (pe' +
+ 'riodo_gastos2.IMPORTE_TOTAL*100))'#10'else (100 - ((periodo_gastos2.' +
+ 'IMPORTE_TOTAL*100)/periodo_gastos1.IMPORTE_TOTAL))'#10'end as Porcen' +
+ 'taje_Aumento_Gastos,'#10#10'((coalesce(periodo_ingresos1.IMPORTE_TOTAL' +
+ ', 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0)) - (coalesce(p' +
+ 'eriodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IM' +
+ 'PORTE_TOTAL, 0))) as Diferencia_Beneficios,'#10#10'case'#10'when ((coalesc' +
+ 'e(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1' +
+ '.IMPORTE_TOTAL, 0)) = 0) then (100 - ((coalesce(periodo_ingresos' +
+ '2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)' +
+ ')*100))'#10'else (100 - (((coalesce(periodo_ingresos2.IMPORTE_TOTAL,' +
+ ' 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0))*100) / (coales' +
+ 'ce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos' +
+ '1.IMPORTE_TOTAL, 0))))'#10'end as Porcentaje_Aumento_Beneficios'#10#10'FRO' +
+ 'M'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, ME' +
+ 'S 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 = :A' +
+ 'NO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingresos1 on ' +
+ '(VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp2.ID_EM' +
+ 'PRESA, comp2.ANO, MES as NFILA, SUM(comp2.IMPORTE_TOTAL) as IMPO' +
+ 'RTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMPRESA = :ID_' +
+ 'EMPRESA1'#10'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc)' +
+ ' periodo_gastos1 on (VALOR = periodo_gastos1.NFILA)'#10#10'left join'#10'(' +
+ 'select comp3.ID_EMPRESA, comp3.ANO, MES as NFILA, SUM(comp3.IMPO' +
+ 'RTE_TOTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp3'#10'where I' +
+ 'D_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order ' +
+ 'by 1 desc,2 asc) periodo_ingresos2 on (VALOR = periodo_ingresos2' +
+ '.NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA, comp4.ANO, MES as N' +
+ 'FILA, SUM(comp4.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_P' +
+ 'ROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)' +
+ #10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos2 on (VALOR' +
+ ' = periodo_gastos2.NFILA)'#10#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 = 'ANO2'
+ TableField = 'ANO2'
+ end
+ item
+ DatasetField = 'INGRESOS_ANO1'
+ TableField = 'INGRESOS_ANO1'
+ end
+ item
+ DatasetField = 'ANO11'
+ TableField = 'ANO11'
+ end
+ item
+ DatasetField = 'GASTOS_ANO1'
+ TableField = 'GASTOS_ANO1'
+ end
+ item
+ DatasetField = 'BENEFICIO_ANO1'
+ TableField = 'BENEFICIO_ANO1'
+ end
+ item
+ DatasetField = 'INGRESOS_ANO2'
+ TableField = 'INGRESOS_ANO2'
+ end
+ item
+ DatasetField = 'ANO21'
+ TableField = 'ANO21'
+ end
+ item
+ DatasetField = 'GASTOS_ANO2'
+ TableField = 'GASTOS_ANO2'
+ end
+ item
+ DatasetField = 'BENEFICIO_ANO2'
+ TableField = 'BENEFICIO_ANO2'
+ end
+ item
+ DatasetField = 'DIFERENCIA_INGRESOS'
+ TableField = 'DIFERENCIA_INGRESOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_INGRESOS'
+ TableField = 'PORCENTAJE_AUMENTO_INGRESOS'
+ end
+ item
+ DatasetField = 'DIFERENCIA_GASTOS'
+ TableField = 'DIFERENCIA_GASTOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_GASTOS'
+ TableField = 'PORCENTAJE_AUMENTO_GASTOS'
+ end
+ item
+ DatasetField = 'DIFERENCIA_BENEFICIOS'
+ TableField = 'DIFERENCIA_BENEFICIOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ TableField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ end>
+ end>
+ Name = 'InformeListadoBeneficiosGrafCompMensual'
+ Fields = <
+ item
+ Name = 'VALOR'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'DESCRIPCION'
+ DataType = datString
+ Size = 20
+ end
+ item
+ Name = 'ANO1'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO11'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO2'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO21'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_BENEFICIOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ 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
+ SQL =
+ 'select VALOR, DESCRIPCION,'#10'periodo_ingresos1.ANO as Ano1, period' +
+ 'o_ingresos1.IMPORTE_TOTAL as INGRESOS_ANO1,'#10'periodo_gastos1.ANO ' +
+ 'as Ano1, periodo_gastos1.IMPORTE_TOTAL as GASTOS_ANO1,'#10'(coalesce' +
+ '(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.' +
+ 'IMPORTE_TOTAL, 0)) as BENEFICIO_ANO1,'#10#10'periodo_ingresos2.ANO as ' +
+ 'Ano2, periodo_ingresos2.IMPORTE_TOTAL as INGRESOS_ANO2,'#10'periodo_' +
+ 'gastos2.ANO as Ano2, periodo_gastos2.IMPORTE_TOTAL as GASTOS_ANO' +
+ '2,'#10'(coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(peri' +
+ 'odo_gastos2.IMPORTE_TOTAL, 0)) as BENEFICIO_ANO2,'#10#10#10'(periodo_ing' +
+ 'resos1.IMPORTE_TOTAL - periodo_ingresos2.IMPORTE_TOTAL) as Difer' +
+ 'encia_Ingresos,'#10'case'#10'when (periodo_ingresos1.IMPORTE_TOTAL = 0) ' +
+ 'then (100 - (periodo_ingresos2.IMPORTE_TOTAL*100))'#10'else (100 - (' +
+ '(periodo_ingresos2.IMPORTE_TOTAL*100)/periodo_ingresos1.IMPORTE_' +
+ 'TOTAL))'#10'end as Porcentaje_Aumento_Ingresos,'#10#10'(periodo_gastos1.IM' +
+ 'PORTE_TOTAL - periodo_gastos2.IMPORTE_TOTAL) as Diferencia_Gasto' +
+ 's,'#10'case'#10'when (periodo_gastos1.IMPORTE_TOTAL = 0) then (100 - (pe' +
+ 'riodo_gastos2.IMPORTE_TOTAL*100))'#10'else (100 - ((periodo_gastos2.' +
+ 'IMPORTE_TOTAL*100)/periodo_gastos1.IMPORTE_TOTAL))'#10'end as Porcen' +
+ 'taje_Aumento_Gastos,'#10#10'((coalesce(periodo_ingresos1.IMPORTE_TOTAL' +
+ ', 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0)) - (coalesce(p' +
+ 'eriodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IM' +
+ 'PORTE_TOTAL, 0))) as Diferencia_Beneficios,'#10#10'case'#10'when ((coalesc' +
+ 'e(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1' +
+ '.IMPORTE_TOTAL, 0)) = 0) then (100 - ((coalesce(periodo_ingresos' +
+ '2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)' +
+ ')*100))'#10'else (100 - (((coalesce(periodo_ingresos2.IMPORTE_TOTAL,' +
+ ' 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0))*100) / (coales' +
+ 'ce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos' +
+ '1.IMPORTE_TOTAL, 0))))'#10'end as Porcentaje_Aumento_Beneficios'#10#10'FRO' +
+ 'M'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, SE' +
+ 'MESTRE 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) periodo_ingresos' +
+ '1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp2.' +
+ 'ID_EMPRESA, comp2.ANO, SEMESTRE as NFILA, SUM(comp2.IMPORTE_TOTA' +
+ 'L) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp2'#10'where ID_EMPR' +
+ 'ESA = :ID_EMPRESA1'#10'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 d' +
+ 'esc,2 asc) periodo_gastos1 on (VALOR = periodo_gastos1.NFILA)'#10#10'l' +
+ 'eft join'#10'(select comp3.ID_EMPRESA, comp3.ANO, SEMESTRE as NFILA,' +
+ ' SUM(comp3.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_CLIENT' +
+ 'E comp3'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group ' +
+ 'by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingresos2 on (VALOR = pe' +
+ 'riodo_ingresos2.NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA, comp' +
+ '4.ANO, SEMESTRE as NFILA, SUM(comp4.IMPORTE_TOTAL) as IMPORTE_TO' +
+ 'TAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRES' +
+ 'A2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) perio' +
+ 'do_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where periodo= '#39 +
+ 'SEMESTRAL'#39#10'order by valor 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 = 'ANO2'
+ TableField = 'ANO2'
+ end
+ item
+ DatasetField = 'INGRESOS_ANO1'
+ TableField = 'INGRESOS_ANO1'
+ end
+ item
+ DatasetField = 'ANO11'
+ TableField = 'ANO11'
+ end
+ item
+ DatasetField = 'GASTOS_ANO1'
+ TableField = 'GASTOS_ANO1'
+ end
+ item
+ DatasetField = 'BENEFICIO_ANO1'
+ TableField = 'BENEFICIO_ANO1'
+ end
+ item
+ DatasetField = 'INGRESOS_ANO2'
+ TableField = 'INGRESOS_ANO2'
+ end
+ item
+ DatasetField = 'ANO21'
+ TableField = 'ANO21'
+ end
+ item
+ DatasetField = 'GASTOS_ANO2'
+ TableField = 'GASTOS_ANO2'
+ end
+ item
+ DatasetField = 'BENEFICIO_ANO2'
+ TableField = 'BENEFICIO_ANO2'
+ end
+ item
+ DatasetField = 'DIFERENCIA_INGRESOS'
+ TableField = 'DIFERENCIA_INGRESOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_INGRESOS'
+ TableField = 'PORCENTAJE_AUMENTO_INGRESOS'
+ end
+ item
+ DatasetField = 'DIFERENCIA_GASTOS'
+ TableField = 'DIFERENCIA_GASTOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_GASTOS'
+ TableField = 'PORCENTAJE_AUMENTO_GASTOS'
+ end
+ item
+ DatasetField = 'DIFERENCIA_BENEFICIOS'
+ TableField = 'DIFERENCIA_BENEFICIOS'
+ end
+ item
+ DatasetField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ TableField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ end>
+ end>
+ Name = 'InformeListadoBeneficiosGrafCompSemestral'
+ Fields = <
+ item
+ Name = 'VALOR'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'DESCRIPCION'
+ DataType = datString
+ Size = 20
+ end
+ item
+ Name = 'ANO1'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO11'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO2'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO21'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_BENEFICIOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ DataType = datCurrency
+ end>
end>
JoinDataTables = <>
UnionDataTables = <>
@@ -2911,13 +3580,13 @@ object RptFacturasCliente: TRptFacturasCliente
CloseDataSource = False
DataSource = DADSInformeListadoClientesMayorFacturacionResumen
BCDToCurrency = False
- Left = 320
+ Left = 128
Top = 488
end
object DADSInformeListadoClientesMayorFacturacionResumen: TDADataSource
DataSet = tbl_InformeListadoClientesMayorFacturacionResumen.Dataset
DataTable = tbl_InformeListadoClientesMayorFacturacionResumen
- Left = 320
+ Left = 128
Top = 544
end
object tbl_InformeListadoClientesMayorFacturacionResumen: TDAMemDataTable
@@ -2974,7 +3643,7 @@ object RptFacturasCliente: TRptFacturasCliente
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoClientesMayorFacturacionResumen'
IndexDefs = <>
- Left = 320
+ Left = 128
Top = 600
end
object frxDBInformeListadoClientesMayorDescuentoResumen: TfrxDBDataset
@@ -2982,13 +3651,13 @@ object RptFacturasCliente: TRptFacturasCliente
CloseDataSource = False
DataSource = DADSInformeListadoClientesMayorDescuentoResumen
BCDToCurrency = False
- Left = 624
+ Left = 432
Top = 488
end
object DADSInformeListadoClientesMayorDescuentoResumen: TDADataSource
DataSet = tbl_InformeListadoClientesMayorDescuentoResumen.Dataset
DataTable = tbl_InformeListadoClientesMayorDescuentoResumen
- Left = 624
+ Left = 432
Top = 544
end
object tbl_InformeListadoClientesMayorDescuentoResumen: TDAMemDataTable
@@ -3045,7 +3714,316 @@ object RptFacturasCliente: TRptFacturasCliente
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoClientesMayorDescuentoResumen'
IndexDefs = <>
- Left = 624
+ Left = 432
Top = 600
end
+ object tbl_InformeListadoBeneficiosGrafCompMensual: 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 = 'INGRESOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO11'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO2'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO21'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_BENEFICIOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ 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 = 'InformeListadoBeneficiosGrafCompMensual'
+ IndexDefs = <>
+ Left = 824
+ Top = 600
+ end
+ object tbl_InformeListadoBeneficiosGrafCompTrimestral: 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 = 'INGRESOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO11'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO2'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO21'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_BENEFICIOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ 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 = 'InformeListadoBeneficiosGrafCompTrimestral'
+ IndexDefs = <>
+ Left = 824
+ Top = 544
+ end
+ object tbl_InformeListadoBeneficiosGrafCompSemestral: 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 = 'INGRESOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO11'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO1'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO2'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'INGRESOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'ANO21'
+ DataType = datSmallInt
+ end
+ item
+ Name = 'GASTOS_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'BENEFICIO_ANO2'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_INGRESOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_GASTOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'DIFERENCIA_BENEFICIOS'
+ DataType = datCurrency
+ end
+ item
+ Name = 'PORCENTAJE_AUMENTO_BENEFICIOS'
+ 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 = 'InformeListadoBeneficiosGrafCompSemestral'
+ IndexDefs = <>
+ Left = 824
+ Top = 496
+ 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 ded68fbf..b536f7e4 100644
--- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas
+++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas
@@ -101,6 +101,9 @@ type
DADSInformeListadoClientesMayorDescuentoResumen: TDADataSource;
tbl_InformeListadoClientesMayorDescuentoResumen: TDAMemDataTable;
schReport: TDASchema;
+ tbl_InformeListadoBeneficiosGrafCompMensual: TDAMemDataTable;
+ tbl_InformeListadoBeneficiosGrafCompTrimestral: TDAMemDataTable;
+ tbl_InformeListadoBeneficiosGrafCompSemestral: TDAMemDataTable;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
private
@@ -136,6 +139,7 @@ type
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;
+ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): Binary;
end;
implementation
@@ -155,6 +159,7 @@ const
rptInformeListadoFactuasClientePendiente = 'InformeListadoFacturasClientePendientes.fr3';
rptInformeListadoFactuasClientePendienteDesglosado = 'InformeListadoFacturasClientePendientesDesglosado.fr3';
rptInformeListadoFacturasClienteGrafComp = 'InformeListadoFacturasClienteGrafComp.fr3';
+ rptInformeListadoBeneficiosGrafComp = 'InformeListadoBeneficiosGrafComp.fr3';
{ Dataset names for schReport }
ds_InformeListadoFacturasResumen = 'InformeListadoFacturasResumen';
@@ -221,6 +226,48 @@ begin
end;
end;
+function TRptFacturasCliente.GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant): 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;
+
+ //Preparamos la tabla correspondiente y la abrimos para el informe
+ if (FIntervalo = CTE_MENSUAL) then
+ PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompMensual)
+ else if (FIntervalo = CTE_TRIMESTRAL) then
+ PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompTrimestral)
+ else
+ PrepararTablaInformeGrafComp(tbl_InformeListadoBeneficiosGrafCompSemestral);
+
+ Result := Binary.Create;
+
+ AInforme := DarRutaFichero(DarRutaInformes, rptInformeListadoBeneficiosGrafComp, IntTostr(FIdEmpresa));
+ if VarIsNull(AInforme) then
+ raise Exception.Create (('Error Servidor: GenerarInformeBeneficiosGrafComp, no encuentra informe ' + rptInformeListadoBeneficiosGrafComp));
+
+ 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.GenerarInformeFacturasGrafComp(
const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant;
const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary;
diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk
index 078e5376..75e21b59 100644
--- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk
+++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk
@@ -45,6 +45,7 @@ contains
uIEditorInformeRecibosProveedorReport in 'View\uIEditorInformeRecibosProveedorReport.pas',
uIEditorInformePedidosReport in 'View\uIEditorInformePedidosReport.pas',
uIEditorInformeFacturasProveedorReportGrafComp in 'View\uIEditorInformeFacturasProveedorReportGrafComp.pas',
- uIEditorInformeFacturasClienteReportGrafComp in 'View\uIEditorInformeFacturasClienteReportGrafComp.pas';
+ uIEditorInformeFacturasClienteReportGrafComp in 'View\uIEditorInformeFacturasClienteReportGrafComp.pas',
+ uIEditorInformeBeneficiosReportGrafComp in 'View\uIEditorInformeBeneficiosReportGrafComp.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 1983ef96..6227776d 100644
--- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj
+++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj
@@ -43,6 +43,7 @@
+
diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res
index 8b251f31..1641339f 100644
Binary files a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res and b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.res differ
diff --git a/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeBeneficiosReportGrafComp.pas b/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeBeneficiosReportGrafComp.pas
new file mode 100644
index 00000000..0e1aa9cc
--- /dev/null
+++ b/Source/Modulos/Gestor de informes/Controller/View/uIEditorInformeBeneficiosReportGrafComp.pas
@@ -0,0 +1,24 @@
+unit uIEditorInformeBeneficiosReportGrafComp;
+
+interface
+
+uses
+ FactuGES_Intf, uIEditorInformeBase;
+
+type
+ IEditorInformeBeneficiosReportGrafComp = interface(IEditorInformeBase)
+ ['{88554CB3-E8A6-4BC8-80CC-174D1FC614A5}']
+
+ function GetIntervalo: Variant;
+ function GetAno1: Variant;
+ function GetAno2: Variant;
+
+ property Intervalo: Variant read GetIntervalo;
+ property Ano1: Variant read GetAno1;
+ property Ano2: Variant read GetAno2;
+ end;
+
+
+implementation
+
+end.
diff --git a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas
index badb5ac7..16bf3729 100644
--- a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas
+++ b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas
@@ -25,6 +25,7 @@ type
procedure VerInformeListadoFacturasCliPendientes;
procedure VerInformeFacturasCliGrafComp;
function DarListaAnosFacturasCli: TStringList;
+ procedure VerInformeBeneficiosCliGrafComp;
//MODULO RECIBOS DE CLIENTE
procedure VerInformeListadoRecibosCliPendientes;
@@ -79,6 +80,7 @@ type
procedure VerInformeListadoFacturasCliPendientes;
procedure VerInformeFacturasCliGrafComp;
function DarListaAnosFacturasCli: TStringList;
+ procedure VerInformeBeneficiosCliGrafComp;
//MODULO RECIBOS DE CLIENTE
procedure VerInformeListadoRecibosCliPendientes;
@@ -116,7 +118,8 @@ uses
uIEditorInformeRecibosProvPendientesReport,
uIEditorInformePedidosReport,
uIEditorInformeFacturasProveedorReportGrafComp,
- uIEditorInformeFacturasClienteReportGrafComp;
+ uIEditorInformeFacturasClienteReportGrafComp,
+ uIEditorInformeBeneficiosReportGrafComp;
{procedure CopiarArticulosPedido(AOrigen: IBizDetallesPedidoCliente;
@@ -302,6 +305,30 @@ begin
Result := FDataModule;
end;
+procedure TGestorInformesController.VerInformeBeneficiosCliGrafComp;
+var
+ AStream: Binary;
+ AEditor : IEditorInformeBeneficiosReportGrafComp;
+begin
+ AEditor := NIL;
+ CreateEditor('EditorInformeBeneficiosReportGrafComp', IEditorInformeBeneficiosReportGrafComp, AEditor);
+ if Assigned(AEditor) then
+ try
+ AEditor.Controller := Self;
+ AEditor.Title := 'Informe comparativo de beneficios';
+
+ AStream := FDataModule.GenerarInformeBeneficiosGrafComp(AppFactuGES.EmpresaActiva.ID,
+ AEditor.Intervalo, AEditor.Ano1, AEditor.Ano2);
+
+ AEditor.LoadFromStream(AStream);
+ AEditor.Preview;
+ finally
+ AEditor.Release;
+ AEditor := Nil;
+ FreeAndNil(AStream);
+ end;
+end;
+
procedure TGestorInformesController.VerInformeFacturasCliGrafComp;
var
AStream: Binary;
diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas
index b95ec661..5b439958 100644
--- a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas
+++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas
@@ -32,6 +32,7 @@ type
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;
+ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): Binary;
//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;
@@ -118,6 +119,15 @@ begin
end;
end;
+function TDataModuleGestorInformes.GenerarInformeBeneficiosGrafComp(
+ const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant): Binary;
+begin
+ try
+ Result := (RORemoteService as IsrvGestorInformes).GenerarInformeBeneficiosGrafComp(IdEmpresa, Intervalo, Ano1, Ano2);
+ finally
+ end;
+end;
+
function TDataModuleGestorInformes.GenerarInformeFacturasCliGrafComp(
const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant;
const ListaIDClientes: TIntegerArray; Const NTop: Variant): Binary;
diff --git a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas
index 17d80eea..04e3419e 100644
--- a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas
+++ b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas
@@ -22,6 +22,7 @@ type
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;
+ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): Binary;
//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;
diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm
index 53a34f6e..715988f9 100644
--- a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm
+++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm
@@ -115,6 +115,12 @@ object PluginGestorInformes: TPluginGestorInformes
ImageIndex = 0
OnExecute = actInformeFacturasClienteGrafCompExecute
end
+ object actInformeBeneficiosGrafComp: TAction
+ Category = 'Facturas de cliente'
+ Caption = 'Informe comparativo de beneficios'
+ ImageIndex = 0
+ OnExecute = actInformeBeneficiosGrafCompExecute
+ end
end
object MainMenu: TMainMenu
Images = LargeImages
@@ -186,6 +192,10 @@ object PluginGestorInformes: TPluginGestorInformes
Tag = 160
Action = actInformeFacturasClienteGrafComp
end
+ object actInformeBeneficiosGrafComp1: TMenuItem
+ Tag = 170
+ Action = actInformeBeneficiosGrafComp
+ 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 b461b80f..31bbf71e 100644
--- a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas
+++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas
@@ -46,6 +46,8 @@ type
Informecomparativodefacturacindeproveedores1: TMenuItem;
actInformeFacturasClienteGrafComp: TAction;
Informecomparativodefacturacindeproveedores2: TMenuItem;
+ actInformeBeneficiosGrafComp: TAction;
+ actInformeBeneficiosGrafComp1: TMenuItem;
procedure actInformeFacturasClienteExecute(Sender: TObject);
procedure actInformeFacturasClientePendientesExecute(Sender: TObject);
procedure actInformeFacturasClienteIVAExecute(Sender: TObject);
@@ -58,6 +60,7 @@ type
procedure actInformeRecibosProvPendientesExecute(Sender: TObject);
procedure actInformeFacturasProveedorGrafCompExecute(Sender: TObject);
procedure actInformeFacturasClienteGrafCompExecute(Sender: TObject);
+ procedure actInformeBeneficiosGrafCompExecute(Sender: TObject);
private
FController : IGestorInformesController;
public
@@ -81,6 +84,12 @@ end;
exports
GetModule name GET_MODULE_FUNC;
+procedure TPluginGestorInformes.actInformeBeneficiosGrafCompExecute(
+ Sender: TObject);
+begin
+ FController.VerInformeBeneficiosCliGrafComp;
+end;
+
procedure TPluginGestorInformes.actInformeFacturasClienteExecute(
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 6dea5f7f..b7c708b7 100644
--- a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas
+++ b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas
@@ -48,6 +48,7 @@ type
function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary;
function DarListaAnosFacturasCli: StringArray;
+ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): Binary;
//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;
@@ -119,6 +120,19 @@ begin
Result.Add(CTE_SEMESTRAL);
end;
+function TsrvGestorInformes.GenerarInformeBeneficiosGrafComp(
+ const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant): Binary;
+var
+ AReportGenerator : TRptFacturasCliente;
+begin
+ AReportGenerator := TRptFacturasCliente.Create(nil);
+ try
+ Result := AReportGenerator.GenerarInformeBeneficiosGrafComp(IdEmpresa, Intervalo, Ano1, Ano2);
+ finally
+ FreeAndNIL(AReportGenerator);
+ end;
+end;
+
function TsrvGestorInformes.GenerarInformeFacturasCliGrafComp(
const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant;
const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary;
diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk
index f6b535fc..de7fcb99 100644
--- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk
+++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk
@@ -91,6 +91,7 @@ contains
uViewPeriodoFechas in 'uViewPeriodoFechas.pas' {frViewPeriodoFechas: TFrame},
uViewIntervaloComparativo in 'uViewIntervaloComparativo.pas' {frViewIntervaloComparativo: TFrame},
uEditorInformeFacturasClienteReportGrafComp in 'uEditorInformeFacturasClienteReportGrafComp.pas' {fEditorInformeFacturasClienteReportGrafComp: TForm},
- uEditorInformeFacturasProveedorReportGrafComp in 'uEditorInformeFacturasProveedorReportGrafComp.pas' {fEditorInformeFacturasProveedorReportGrafComp: TForm};
+ uEditorInformeFacturasProveedorReportGrafComp in 'uEditorInformeFacturasProveedorReportGrafComp.pas' {fEditorInformeFacturasProveedorReportGrafComp: TForm},
+ uEditorInformeBeneficiosReportGrafComp in 'uEditorInformeBeneficiosReportGrafComp.pas' {fEditorInformeBeneficiosReportGrafComp: 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 bb868ee7..c7f14895 100644
--- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj
+++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj
@@ -79,6 +79,10 @@
TForm
+
+
+ TForm
+
t
diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res
index 8b251f31..1641339f 100644
Binary files a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res and b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.res differ
diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformeBeneficiosReportGrafComp.dfm b/Source/Modulos/Gestor de informes/Views/uEditorInformeBeneficiosReportGrafComp.dfm
new file mode 100644
index 00000000..3cb01a20
--- /dev/null
+++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeBeneficiosReportGrafComp.dfm
@@ -0,0 +1,184 @@
+inherited fEditorInformeBeneficiosReportGrafComp: TfEditorInformeBeneficiosReportGrafComp
+ Caption = 'fEditorInformeBeneficiosReportGrafComp'
+ 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 = 230
+ 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
+ ExplicitHeight = 230
+ inherited TBXAlignmentPanel2: TTBXAlignmentPanel
+ Width = 182
+ ExplicitWidth = 182
+ inherited Label3: TLabel
+ Width = 172
+ 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 = 172
+ 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 = 172
+ end
+ inherited cbAno2: TcxComboBox
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
+ ExplicitWidth = 166
+ Width = 166
+ end
+ end
+ inherited TBXAlignmentPanel4: TTBXAlignmentPanel
+ Width = 182
+ Visible = False
+ ExplicitWidth = 182
+ inherited Label2: TLabel
+ Width = 172
+ end
+ end
+ end
+ inline frViewFiltroClientes1: TfrViewFiltroClientes
+ Left = 0
+ Top = 230
+ 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 = 230
+ 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/uEditorInformeBeneficiosReportGrafComp.pas b/Source/Modulos/Gestor de informes/Views/uEditorInformeBeneficiosReportGrafComp.pas
new file mode 100644
index 00000000..19473b75
--- /dev/null
+++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeBeneficiosReportGrafComp.pas
@@ -0,0 +1,176 @@
+unit uEditorInformeBeneficiosReportGrafComp;
+
+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, uIEditorInformeBeneficiosReportGrafComp,
+ uViewIntervaloComparativo, uViewFiltroClientes;
+
+type
+ TfEditorInformeBeneficiosReportGrafComp = class(TfEditorInformeBase, IEditorInformeBeneficiosReportGrafComp)
+ 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 TfEditorInformeBeneficiosReportGrafComp.actRefrescarExecute(Sender: TObject);
+begin
+ inherited;
+ RefrescarInforme;
+end;
+
+constructor TfEditorInformeBeneficiosReportGrafComp.Create(AOwner: TComponent);
+begin
+ inherited;
+ FListaIDClientes := TIntegerArray.Create;
+end;
+
+destructor TfEditorInformeBeneficiosReportGrafComp.Destroy;
+begin
+ FListaIDClientes.Free;
+ inherited;
+end;
+
+procedure TfEditorInformeBeneficiosReportGrafComp.FormShow(Sender: TObject);
+begin
+ inherited;
+ actTodaPagina.Execute;
+end;
+
+function TfEditorInformeBeneficiosReportGrafComp.GetIntervalo: Variant;
+begin
+ Result := frViewIntervaloComparativo1.cbIntervalo.EditValue;
+end;
+
+function TfEditorInformeBeneficiosReportGrafComp.GetAno1: Variant;
+begin
+ Result := frViewIntervaloComparativo1.cbAno1.EditValue;
+end;
+
+function TfEditorInformeBeneficiosReportGrafComp.GetAno2: Variant;
+begin
+ Result := frViewIntervaloComparativo1.cbAno2.EditValue;
+end;
+
+function TfEditorInformeBeneficiosReportGrafComp.GetListaIDClientes: TIntegerArray;
+begin
+ FListaIDClientes.Clear;
+ if Assigned(frViewFiltroClientes1.Cliente) then
+ FListaIDClientes.Add(frViewFiltroClientes1.Cliente.ID);
+
+ Result := FListaIDClientes;
+end;
+
+function TfEditorInformeBeneficiosReportGrafComp.GetNTop: Variant;
+begin
+ Result := frViewIntervaloComparativo1.stopN.Value;
+end;
+
+procedure TfEditorInformeBeneficiosReportGrafComp.RefrescarInforme;
+var
+ AStream: Binary;
+begin
+ ShowHourglassCursor;
+ try
+
+ AStream := (Controller as IGestorInformesController).DataModule.GenerarInformeBeneficiosGrafComp(
+ AppFactuGES.EmpresaActiva.ID,
+ Intervalo,
+ Ano1,
+ Ano2);
+
+ LoadFromStream(AStream);
+ Report.ShowPreparedReport;
+ finally
+ FreeAndNil(AStream);
+ HideHourglassCursor;
+ end;
+end;
+
+procedure TfEditorInformeBeneficiosReportGrafComp.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/uEditorInformeFacturasClienteReportGrafComp.dfm b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.dfm
index b56e9eb2..be9a7924 100644
--- a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.dfm
+++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasClienteReportGrafComp.dfm
@@ -157,8 +157,9 @@ inherited fEditorInformeFacturasClienteReportGrafComp: TfEditorInformeFacturasCl
Font.Style = []
ParentFont = False
TabOrder = 2
+ Visible = False
ReadOnly = False
- ExplicitTop = 182
+ ExplicitTop = 230
ExplicitWidth = 188
inherited TBXLabel2: TTBXLabel
Width = 188
diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm
index 5f1f8dd9..050f1cac 100644
--- a/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm
+++ b/Source/Modulos/Gestor de informes/Views/uEditorInformeFacturasProveedorReportGrafComp.dfm
@@ -157,8 +157,9 @@ inherited fEditorInformeFacturasProveedorReportGrafComp: TfEditorInformeFacturas
Font.Style = []
ParentFont = False
TabOrder = 2
+ Visible = False
ReadOnly = False
- ExplicitTop = 182
+ ExplicitTop = 230
ExplicitWidth = 188
inherited TBXLabel2: TTBXLabel
Width = 188
diff --git a/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas
index 072584e7..18166bf9 100644
--- a/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas
+++ b/Source/Modulos/Gestor de informes/Views/uGestorInformesViewRegister.pas
@@ -16,7 +16,7 @@ uses
uEditorInformeIVAProveedoresReport, uEditorInformeFacturasProveedorReport, uEditorInformeFacturasProveedorPendientesReport,
uEditorInformeRecibosProveedorReport, uEditorInformeRecibosProvPendientesReport,
- uEditorInformeFacturasProveedorReportGrafComp, uEditorInformeFacturasClienteReportGrafComp;
+ uEditorInformeFacturasProveedorReportGrafComp, uEditorInformeFacturasClienteReportGrafComp, uEditorInformeBeneficiosReportGrafComp;
procedure RegisterViews;
begin
@@ -36,6 +36,7 @@ begin
EditorRegistry.RegisterClass(TfEditorInformeFacturasProveedorReportGrafComp, 'EditorInformeFacturasProveedorReportGrafComp');
EditorRegistry.RegisterClass(TfEditorInformeFacturasClienteReportGrafComp, 'EditorInformeFacturasClienteReportGrafComp');
+ EditorRegistry.RegisterClass(TfEditorInformeBeneficiosReportGrafComp, 'EditorInformeBeneficiosReportGrafComp');
end;
procedure UnregisterViews;
@@ -55,7 +56,8 @@ begin
EditorRegistry.UnRegisterClass(TfEditorInformeRecibosProvPendientesReport);
EditorRegistry.UnRegisterClass(TfEditorInformeFacturasProveedorReportGrafComp);
- EditorRegistry.UnRegisterClass(TfEditorInformeFacturasClienteReportGrafComp);
+ EditorRegistry.UnRegisterClass(TfEditorInformeFacturasClienteReportGrafComp);
+ EditorRegistry.UnRegisterClass(TfEditorInformeBeneficiosReportGrafComp);
end;
end.
diff --git a/Source/Servicios/FactuGES.RODL b/Source/Servicios/FactuGES.RODL
index 0103943a..87fdcca4 100644
--- a/Source/Servicios/FactuGES.RODL
+++ b/Source/Servicios/FactuGES.RODL
@@ -756,6 +756,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Servicios/FactuGES_Intf.pas b/Source/Servicios/FactuGES_Intf.pas
index e1fe221c..d781df7c 100644
--- a/Source/Servicios/FactuGES_Intf.pas
+++ b/Source/Servicios/FactuGES_Intf.pas
@@ -779,6 +779,7 @@ type
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;
+ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): 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 GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant;
@@ -822,6 +823,7 @@ type
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;
+ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): 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 GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant;
@@ -2517,6 +2519,26 @@ begin
end
end;
+function TsrvGestorInformes_Proxy.GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): Binary;
+begin
+ try
+ result := nil;
+ __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeBeneficiosGrafComp');
+ __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.Finalize;
+
+ __TransportChannel.Dispatch(__Message);
+
+ __Message.Read('Result', TypeInfo(Binary), result, []);
+ finally
+ __Message.UnsetAttributes(__TransportChannel);
+ __Message.FreeStream;
+ end
+end;
+
function TsrvGestorInformes_Proxy.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;
begin
diff --git a/Source/Servicios/FactuGES_Invk.pas b/Source/Servicios/FactuGES_Invk.pas
index dc33640a..8cf44ced 100644
--- a/Source/Servicios/FactuGES_Invk.pas
+++ b/Source/Servicios/FactuGES_Invk.pas
@@ -299,6 +299,7 @@ type
procedure Invoke_GenerarInformeListadoFacturasProv(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);
+ procedure Invoke_GenerarInformeBeneficiosGrafComp(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
procedure Invoke_GenerarInformeListadoFacturasCliPendientes(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
procedure Invoke_GenerarInformeListadoFacturasProvPendientes(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
procedure Invoke_GenerarInformeListadoRecibosCliente(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
@@ -2002,6 +2003,40 @@ begin
end;
end;
+procedure TsrvGestorInformes_Invoker.Invoke_GenerarInformeBeneficiosGrafComp(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+{ function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant): Binary; }
+var
+ IdEmpresa: Integer;
+ Intervalo: Variant;
+ Ano1: Variant;
+ Ano2: Variant;
+ lResult: Binary;
+ __lObjectDisposer: TROObjectDisposer;
+begin
+ 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, []);
+
+ lResult := (__Instance as IsrvGestorInformes).GenerarInformeBeneficiosGrafComp(IdEmpresa, Intervalo, Ano1, Ano2);
+
+ __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorInformes', 'GenerarInformeBeneficiosGrafCompResponse');
+ __Message.Write('Result', TypeInfo(Binary), 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_GenerarInformeListadoFacturasCliPendientes(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
{ 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; }
diff --git a/Source/Servicios/RODLFILE.res b/Source/Servicios/RODLFILE.res
index 9e2b4522..88acce32 100644
Binary files a/Source/Servicios/RODLFILE.res and b/Source/Servicios/RODLFILE.res differ