Segunda subida del informe de beneficios

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@1041 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2011-03-03 18:24:58 +00:00
parent fb99ab580b
commit 087de0a24d
3 changed files with 302 additions and 302 deletions

File diff suppressed because one or more lines are too long

View File

@ -1450,50 +1450,65 @@ object RptFacturasCliente: TRptFacturasCliente
'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' +
'IMPORTE_TOTAL, 0)) as BENEFICIO_ANO1,'#10'case'#10'when (periodo_ingreso' +
's1.IMPORTE_TOTAL = 0) then (100 - ((coalesce(periodo_ingresos1.I' +
'MPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0))*1' +
'00))'#10'else ((((coalesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coa' +
'lesce(periodo_gastos1.IMPORTE_TOTAL, 0))*100)/periodo_ingresos1.' +
'IMPORTE_TOTAL))'#10'end as Porcentaje_Beneficios_Ano1,'#10#10'periodo_ingr' +
'esos2.ANO as Ano2, periodo_ingresos2.IMPORTE_TOTAL as INGRESOS_A' +
'NO2,'#10'periodo_gastos2.ANO as Ano2, periodo_gastos2.IMPORTE_TOTAL ' +
'as GASTOS_ANO2,'#10'(coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - ' +
'coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)) as BENEFICIO_ANO2,'#10'c' +
'ase'#10'when (periodo_ingresos2.IMPORTE_TOTAL = 0) then (100 - ((coa' +
'lesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gas' +
'tos2.IMPORTE_TOTAL, 0))*100))'#10'else ((((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
')*100)/periodo_ingresos2.IMPORTE_TOTAL))'#10'end as Porcentaje_Benef' +
'icios_Ano2,'#10#10'(periodo_ingresos1.IMPORTE_TOTAL - periodo_ingresos' +
'2.IMPORTE_TOTAL) as Diferencia_Ingresos,'#10'case'#10'when (periodo_ingr' +
'esos2.IMPORTE_TOTAL = 0) then (100 - ((periodo_ingresos1.IMPORTE' +
'_TOTAL - periodo_ingresos2.IMPORTE_TOTAL)*100))'#10'else (((periodo_' +
'ingresos1.IMPORTE_TOTAL - periodo_ingresos2.IMPORTE_TOTAL)*100)/' +
'periodo_ingresos2.IMPORTE_TOTAL)'#10'end as Porcentaje_Aumento_Ingre' +
'sos,'#10#10'(periodo_gastos1.IMPORTE_TOTAL - periodo_gastos2.IMPORTE_T' +
'OTAL) as Diferencia_Gastos,'#10'case'#10'when (periodo_gastos2.IMPORTE_T' +
'OTAL = 0) then (100 - ((periodo_gastos1.IMPORTE_TOTAL - periodo_' +
'gastos2.IMPORTE_TOTAL)*100))'#10'else (((periodo_gastos1.IMPORTE_TOT' +
'AL - periodo_gastos2.IMPORTE_TOTAL)*100)/periodo_gastos2.IMPORTE' +
'_TOTAL)'#10'end as Porcentaje_Aumento_Gastos,'#10#10'((coalesce(periodo_in' +
'gresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOT' +
'AL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coales' +
'ce(periodo_gastos2.IMPORTE_TOTAL, 0))) as Diferencia_Beneficios,' +
#10#10'case'#10'when ((coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coa' +
'lesce(periodo_gastos2.IMPORTE_TOTAL, 0)) = 0) then (100 - (((coa' +
'lesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gas' +
'tos1.IMPORTE_TOTAL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TO' +
'TAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))*100))'#10'els' +
'e (((((coalesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(p' +
'eriodo_gastos1.IMPORTE_TOTAL, 0)) - (coalesce(periodo_ingresos2.' +
'IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))' +
'*100) / (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce' +
'(periodo_gastos2.IMPORTE_TOTAL, 0))))'#10'end as Porcentaje_Aumento_' +
'Beneficios'#10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA' +
', comp1.ANO, TRIMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMP' +
'ORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_E' +
'MPRESA1'#10'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) ' +
'periodo_ingresos1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left joi' +
'n'#10'(select comp2.ID_EMPRESA, comp2.ANO, TRIMESTRE as NFILA, SUM(c' +
'omp2.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR co' +
'mp2'#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, T' +
'RIMESTRE as NFILA, SUM(comp3.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'fro' +
'm V_INF_FAC_CLIENTE comp3'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (A' +
'NO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingres' +
'os2 on (VALOR = periodo_ingresos2.NFILA)'#10#10'left join'#10'(select comp' +
'4.ID_EMPRESA, comp4.ANO, TRIMESTRE as NFILA, SUM(comp4.IMPORTE_T' +
'OTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'where ID_E' +
'MPRESA = :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'TRIMESTRAL'#39#10'order by valor asc'#10
StatementType = stSQL
ColumnMappings = <
item
@ -1567,6 +1582,14 @@ object RptFacturasCliente: TRptFacturasCliente
item
DatasetField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
TableField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
end
item
DatasetField = 'PORCENTAJE_BENEFICIOS_ANO1'
TableField = 'PORCENTAJE_BENEFICIOS_ANO1'
end
item
DatasetField = 'PORCENTAJE_BENEFICIOS_ANO2'
TableField = 'PORCENTAJE_BENEFICIOS_ANO2'
end>
end>
Name = 'InformeListadoBeneficiosGrafCompTrimestral'
@ -1600,6 +1623,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO1'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO1'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
@ -1620,6 +1647,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO2'
DataType = datCurrency
end
item
Name = 'DIFERENCIA_INGRESOS'
DataType = datCurrency
@ -1673,50 +1704,65 @@ object RptFacturasCliente: TRptFacturasCliente
'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' +
'IMPORTE_TOTAL, 0)) as BENEFICIO_ANO1,'#10'case'#10'when (periodo_ingreso' +
's1.IMPORTE_TOTAL = 0) then (100 - ((coalesce(periodo_ingresos1.I' +
'MPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0))*1' +
'00))'#10'else ((((coalesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coa' +
'lesce(periodo_gastos1.IMPORTE_TOTAL, 0))*100)/periodo_ingresos1.' +
'IMPORTE_TOTAL))'#10'end as Porcentaje_Beneficios_Ano1,'#10#10'periodo_ingr' +
'esos2.ANO as Ano2, periodo_ingresos2.IMPORTE_TOTAL as INGRESOS_A' +
'NO2,'#10'periodo_gastos2.ANO as Ano2, periodo_gastos2.IMPORTE_TOTAL ' +
'as GASTOS_ANO2,'#10'(coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - ' +
'coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)) as BENEFICIO_ANO2,'#10'c' +
'ase'#10'when (periodo_ingresos2.IMPORTE_TOTAL = 0) then (100 - ((coa' +
'lesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gas' +
'tos2.IMPORTE_TOTAL, 0))*100))'#10'else ((((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
')*100)/periodo_ingresos2.IMPORTE_TOTAL))'#10'end as Porcentaje_Benef' +
'icios_Ano2,'#10#10'(periodo_ingresos1.IMPORTE_TOTAL - periodo_ingresos' +
'2.IMPORTE_TOTAL) as Diferencia_Ingresos,'#10'case'#10'when (periodo_ingr' +
'esos2.IMPORTE_TOTAL = 0) then (100 - ((periodo_ingresos1.IMPORTE' +
'_TOTAL - periodo_ingresos2.IMPORTE_TOTAL)*100))'#10'else (((periodo_' +
'ingresos1.IMPORTE_TOTAL - periodo_ingresos2.IMPORTE_TOTAL)*100)/' +
'periodo_ingresos2.IMPORTE_TOTAL)'#10'end as Porcentaje_Aumento_Ingre' +
'sos,'#10#10'(periodo_gastos1.IMPORTE_TOTAL - periodo_gastos2.IMPORTE_T' +
'OTAL) as Diferencia_Gastos,'#10'case'#10'when (periodo_gastos2.IMPORTE_T' +
'OTAL = 0) then (100 - ((periodo_gastos1.IMPORTE_TOTAL - periodo_' +
'gastos2.IMPORTE_TOTAL)*100))'#10'else (((periodo_gastos1.IMPORTE_TOT' +
'AL - periodo_gastos2.IMPORTE_TOTAL)*100)/periodo_gastos2.IMPORTE' +
'_TOTAL)'#10'end as Porcentaje_Aumento_Gastos,'#10#10'((coalesce(periodo_in' +
'gresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOT' +
'AL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coales' +
'ce(periodo_gastos2.IMPORTE_TOTAL, 0))) as Diferencia_Beneficios,' +
#10#10'case'#10'when ((coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coa' +
'lesce(periodo_gastos2.IMPORTE_TOTAL, 0)) = 0) then (100 - (((coa' +
'lesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gas' +
'tos1.IMPORTE_TOTAL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TO' +
'TAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))*100))'#10'els' +
'e (((((coalesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(p' +
'eriodo_gastos1.IMPORTE_TOTAL, 0)) - (coalesce(periodo_ingresos2.' +
'IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))' +
'*100) / (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce' +
'(periodo_gastos2.IMPORTE_TOTAL, 0))))'#10'end as Porcentaje_Aumento_' +
'Beneficios'#10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA' +
', comp1.ANO, MES as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPORTE_T' +
'OTAL'#10'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA' +
'1'#10'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) period' +
'o_ingresos1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(sel' +
'ect comp2.ID_EMPRESA, comp2.ANO, MES as NFILA, SUM(comp2.IMPORTE' +
'_TOTAL) as IMPORTE_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 b' +
'y 1 desc,2 asc) periodo_gastos1 on (VALOR = periodo_gastos1.NFIL' +
'A)'#10#10'left join'#10'(select comp3.ID_EMPRESA, comp3.ANO, MES 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, MES as NFILA, SUM(comp4.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'f' +
'rom V_INF_FAC_PROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'an' +
'd (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_ga' +
'stos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where periodo= '#39'MENSU' +
'AL'#39#10'order by valor asc'#10
StatementType = stSQL
ColumnMappings = <
item
@ -1790,6 +1836,14 @@ object RptFacturasCliente: TRptFacturasCliente
item
DatasetField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
TableField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
end
item
DatasetField = 'PORCENTAJE_BENEFICIOS_ANO1'
TableField = 'PORCENTAJE_BENEFICIOS_ANO1'
end
item
DatasetField = 'PORCENTAJE_BENEFICIOS_ANO2'
TableField = 'PORCENTAJE_BENEFICIOS_ANO2'
end>
end>
Name = 'InformeListadoBeneficiosGrafCompMensual'
@ -1823,6 +1877,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO1'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO1'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
@ -1843,6 +1901,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO2'
DataType = datCurrency
end
item
Name = 'DIFERENCIA_INGRESOS'
DataType = datCurrency
@ -1896,50 +1958,65 @@ object RptFacturasCliente: TRptFacturasCliente
'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' +
'IMPORTE_TOTAL, 0)) as BENEFICIO_ANO1,'#10'case'#10'when (periodo_ingreso' +
's1.IMPORTE_TOTAL = 0) then (100 - ((coalesce(periodo_ingresos1.I' +
'MPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0))*1' +
'00))'#10'else ((((coalesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coa' +
'lesce(periodo_gastos1.IMPORTE_TOTAL, 0))*100)/periodo_ingresos1.' +
'IMPORTE_TOTAL))'#10'end as Porcentaje_Beneficios_Ano1,'#10#10'periodo_ingr' +
'esos2.ANO as Ano2, periodo_ingresos2.IMPORTE_TOTAL as INGRESOS_A' +
'NO2,'#10'periodo_gastos2.ANO as Ano2, periodo_gastos2.IMPORTE_TOTAL ' +
'as GASTOS_ANO2,'#10'(coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - ' +
'coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)) as BENEFICIO_ANO2,'#10'c' +
'ase'#10'when (periodo_ingresos2.IMPORTE_TOTAL = 0) then (100 - ((coa' +
'lesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gas' +
'tos2.IMPORTE_TOTAL, 0))*100))'#10'else ((((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
')*100)/periodo_ingresos2.IMPORTE_TOTAL))'#10'end as Porcentaje_Benef' +
'icios_Ano2,'#10#10'(periodo_ingresos1.IMPORTE_TOTAL - periodo_ingresos' +
'2.IMPORTE_TOTAL) as Diferencia_Ingresos,'#10'case'#10'when (periodo_ingr' +
'esos2.IMPORTE_TOTAL = 0) then (100 - ((periodo_ingresos1.IMPORTE' +
'_TOTAL - periodo_ingresos2.IMPORTE_TOTAL)*100))'#10'else (((periodo_' +
'ingresos1.IMPORTE_TOTAL - periodo_ingresos2.IMPORTE_TOTAL)*100)/' +
'periodo_ingresos2.IMPORTE_TOTAL)'#10'end as Porcentaje_Aumento_Ingre' +
'sos,'#10#10'(periodo_gastos1.IMPORTE_TOTAL - periodo_gastos2.IMPORTE_T' +
'OTAL) as Diferencia_Gastos,'#10'case'#10'when (periodo_gastos2.IMPORTE_T' +
'OTAL = 0) then (100 - ((periodo_gastos1.IMPORTE_TOTAL - periodo_' +
'gastos2.IMPORTE_TOTAL)*100))'#10'else (((periodo_gastos1.IMPORTE_TOT' +
'AL - periodo_gastos2.IMPORTE_TOTAL)*100)/periodo_gastos2.IMPORTE' +
'_TOTAL)'#10'end as Porcentaje_Aumento_Gastos,'#10#10'((coalesce(periodo_in' +
'gresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOT' +
'AL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coales' +
'ce(periodo_gastos2.IMPORTE_TOTAL, 0))) as Diferencia_Beneficios,' +
#10#10'case'#10'when ((coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coa' +
'lesce(periodo_gastos2.IMPORTE_TOTAL, 0)) = 0) then (100 - (((coa' +
'lesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gas' +
'tos1.IMPORTE_TOTAL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TO' +
'TAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))*100))'#10'els' +
'e (((((coalesce(periodo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(p' +
'eriodo_gastos1.IMPORTE_TOTAL, 0)) - (coalesce(periodo_ingresos2.' +
'IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))' +
'*100) / (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce' +
'(periodo_gastos2.IMPORTE_TOTAL, 0))))'#10'end as Porcentaje_Aumento_' +
'Beneficios'#10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA' +
', comp1.ANO, SEMESTRE as NFILA, SUM(comp1.IMPORTE_TOTAL) as IMPO' +
'RTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EM' +
'PRESA1'#10'and (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) p' +
'eriodo_ingresos1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join' +
#10'(select comp2.ID_EMPRESA, comp2.ANO, SEMESTRE as NFILA, SUM(com' +
'p2.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp' +
'2'#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_ga' +
'stos1.NFILA)'#10#10'left join'#10'(select comp3.ID_EMPRESA, comp3.ANO, SEM' +
'ESTRE as NFILA, SUM(comp3.IMPORTE_TOTAL) as IMPORTE_TOTAL'#10'from V' +
'_INF_FAC_CLIENTE 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 = periodo_ingresos2.NFILA)'#10#10'left join'#10'(select comp4.I' +
'D_EMPRESA, comp4.ANO, SEMESTRE as NFILA, SUM(comp4.IMPORTE_TOTAL' +
') as IMPORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'where ID_EMPRE' +
'SA = :ID_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 de' +
'sc,2 asc) periodo_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'w' +
'here periodo= '#39'SEMESTRAL'#39#10'order by valor asc'#10
StatementType = stSQL
ColumnMappings = <
item
@ -2013,6 +2090,14 @@ object RptFacturasCliente: TRptFacturasCliente
item
DatasetField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
TableField = 'PORCENTAJE_AUMENTO_BENEFICIOS'
end
item
DatasetField = 'PORCENTAJE_BENEFICIOS_ANO1'
TableField = 'PORCENTAJE_BENEFICIOS_ANO1'
end
item
DatasetField = 'PORCENTAJE_BENEFICIOS_ANO2'
TableField = 'PORCENTAJE_BENEFICIOS_ANO2'
end>
end>
Name = 'InformeListadoBeneficiosGrafCompSemestral'
@ -2046,6 +2131,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO1'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO1'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
@ -2066,6 +2155,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO2'
DataType = datCurrency
end
item
Name = 'DIFERENCIA_INGRESOS'
DataType = datCurrency
@ -2883,182 +2976,52 @@ object RptFacturasCliente: TRptFacturasCliente
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 39065.872423495400000000
ReportOptions.LastChange = 39920.656640081000000000
ReportOptions.CreateDate = 37800.807714351900000000
ReportOptions.LastChange = 40605.777136655100000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'procedure Chart1OnBeforePrint(Sender: TfrxComponent);'
'begin'
'{ '
' if (<frxDBInformeListadoFacturasGrafComp."ANO1"> <> 0) then ' +
' '
' TLineSeries(Chart1.Series[0]).Title := '#39'Total Facturado '#39' +' +
' IntToStr(<frxDBInformeListadoFacturasGrafComp."ANO1">);'
''
'procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent);'
' if (<frxDBInformeListadoFacturasGrafComp."ANO2"> <> 0) then'
' TLineSeries(Chart1.Series[1]).Title := '#39'Total Facturado '#39' +' +
' IntToStr(<frxDBInformeListadoFacturasGrafComp."ANO2">)'
' else'
' Chart1.Series[1].Active := False;'
'} '
'end;'
''
'procedure Memo16OnBeforePrint(Sender: TfrxComponent);'
'var'
' Cadena: String;'
' Valor:Double; '
'begin'
'{ DatosEmpresa.Lines.Clear;'
' if (<frxDBCabecera."TELEFONO_1_EMPRESA"> <> '#39#39') then'
' Cadena := '#39'TLF: '#39' + <frxDBCabecera."TELEFONO_1_EMPRESA">;'
' if (<frxDBCabecera."FAX_EMPRESA"> <> '#39#39') then'
'{ '
' Cadena := Cadena + '#39' FAX: '#39' + <frxDBCabecera."FAX_EMPRESA' +
'">;'
' DatosEmpresa.Lines.Add(Cadena);'
'}'
'end;'
''
'procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent);'
'begin'
'{ NombreEmpresa.Lines.Clear;'
' NombreEmpresa.Lines.Add(<frxDBCabecera."NOMBRE_EMPRESA">);'
'}'
'end;'
''
'procedure DireccionEnvioOnBeforePrint(Sender: TfrxComponent);'
'var'
' ACadena : String;'
'begin'
'{ ACadena := '#39#39';'
' DireccionEnvio.Lines.Clear;'
' if (<frxDBCabecera."REFERENCIA_CLIENTE"> <> '#39#39') then'
' ACadena := <frxDBCabecera."REFERENCIA_CLIENTE">;'
''
' if (<frxDBCabecera."PERSONA_CONTACTO"> <> '#39#39') then'
' Valor := SUM(<frxDBInformeListadoFacturasGrafComp."IMPORTE_TOT' +
'AL1">) * 100; '
' ACadena := ACadena + '#39' '#39' + <frxDBCabecera."PERSONA_CONTACT' +
'O">;'
''
' DireccionEnvio.Lines.Add(ACadena);'
' ACadena := '#39#39';'
' DireccionEnvio.Lines.Add(<frxDBCabecera."CALLE">);'
' if (<frxDBCabecera."CODIGO_POSTAL"> <> '#39#39') then'
' ACadena := <frxDBCabecera."CODIGO_POSTAL"> + '#39' '#39';'
' if (<frxDBCabecera."POBLACION"> <> '#39#39') then'
' ACadena := ACadena + <frxDBCabecera."CODIGO_POSTAL">;'
''
' if (ACadena <> '#39#39') then'
' DireccionEnvio.Lines.Add(ACadena);'
''
' if (<frxDBCabecera."PROVINCIA"> <> '#39#39') then'
' DireccionEnvio.Lines.Add(<frxDBCabecera."PROVINCIA">);'
''
' if (<frxDBCabecera."TELEFONO"> <> '#39#39') then'
' DireccionEnvio.Lines.Add(<frxDBCabecera."TELEFONO">);'
'}'
'end;'
''
'procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if not Engine.FinalPass then'
' Set('#39'TotalPaginas'#39', (<TotalPaginas> + 1));'
''
' if Engine.FinalPass then'
' Set('#39'Pagina'#39', (<Pagina> + 1)); '
'end;'
''
'procedure frxReportOnStartReport(Sender: TfrxComponent);'
'begin'
' Set('#39'Pagina'#39', 0);'
' Set('#39'TotalPaginas'#39', 0);'
' Set('#39'Capitulo'#39', 0);'
' Set('#39'NumCapitulos'#39', 0); '
'end;'
''
'procedure Memo4OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if (Length(<frxDBCabecera."OBSERVACIONES">) = 0) then'
' Memo4.Visible := False; '
'end;'
''
'procedure Memo22OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if (<frxDBCabecera."DESCUENTO"> = 0) then'
' begin '
' Subtotal.Text := '#39'Base imponible:'#39';'
' BaseImponible.Text := '#39'Importe total:'#39'; '
' BaseImponible.Font.Style := fsBold;'
''
' ImpBaseImponible.Text := FormatFloat('#39'#,##0.00 '#8364#39', <frxDBCa' +
'becera."IMPORTE_TOTAL">);'
' ImpBaseImponible.Font.Style := fsBold; '
' '
' Descuento.Text := '#39'[<frxDBCabecera."IVA">]% IVA:'#39';'
' ImpDescuento.Text := '#39'[frxDBCabecera."IMPORTE_IVA"]'#39';'
' Memo11.Color := $00CCFFCC;'
''
' if (<frxDBCabecera."IMPORTE_RETENCION"> > 0) then'
' begin '
' BaseImponible.Text := '#39'Total certificaci'#243'n:'#39';'
' IVA.Text := FormatFloat('#39'#,##0.00 %'#39',<frxDBCabecera."RET' +
'ENCION">) + '#39' Retenci'#243'n:'#39'; '
' ImpIVA.Text := FormatFloat('#39'-#,##0.00 '#8364#39',<frxDBCabecera.' +
'"IMPORTE_RETENCION">);'
' ImporteTotal.Text := '#39'TOTAL FACTURA'#39'; ' +
' ' +
' '
' ImpImporteTotal.Text := FormatFloat('#39'#,##0.00 '#8364#39', (<frxD' +
'BCabecera."IMPORTE_TOTAL"> - <frxDBCabecera."IMPORTE_RETENCION">' +
')); '
' end '
' else'
' begin'
' IVA.Visible := False;'
' ImpIVA.Visible := False;'
' ImporteTotal.Visible := False;'
' ImpImporteTotal.Visible := False;'
' Memo16.Visible := False; '
' Memo17.Visible := False;'
' end;'
' end'
' if (SUM(<frxDBInformeListadoFacturasGrafComp."IMPORTE_TOTAL">)' +
' = 0) then'
' Valor := 100 - Valor '
' else'
' begin '
' if (<frxDBCabecera."IMPORTE_RETENCION"> > 0) then'
' begin'
' ImporteTotal.Text := '#39'Total certificaci'#243'n:'#39'; '
' Retencion.Visible := True;'
' ImpRetencion.Visible := True;'
' LinRetencion.Visible := True; '
' TotalFacturaRet.Visible := True;'
' ImpTotalFacturaRet.Visible := True;'
' LinImporteTotalFacturaRet.Visible := True; '
' end'
' end '
'end;'
''
'procedure Memo39OnBeforePrint(Sender: TfrxComponent);'
'begin'
' Memo39.Clear; '
' if (<frxDBCabecera."TIPO"> = '#39'F'#39') then'
' Memo39.Text := '#39'FACTURA'#39' ' +
' '
' else'
' Memo39.Text := '#39'ABONO'#39'; '
'end;'
' Valor := 100 - (Valor/SUM(<frxDBInformeListadoFacturasGrafC' +
'omp."IMPORTE_TOTAL">)); '
''
'procedure Picture4OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if (<VerSello> = 1) then'
' Picture4.Visible := True'
' else'
' Picture4.Visible := False; '
'end;'
''
'procedure eCopiaOnBeforePrint(Sender: TfrxComponent);'
'begin'
' if (<VerCopia> = 1) then'
' begin '
' eCopia.Visible := True; '
' Picture4.Visible := False; '
' end '
' else'
' eCopia.Visible := False; '
' memo16.lines.add(FormatFloat('#39'#,##0.00 %'#39',Valor));'
'} '
'end;'
''
'begin'
''
'end.')
'end. ')
ShowProgress = False
StoreInDFM = False
OnStartReport = 'frxReportOnStartReport'
@ -3852,6 +3815,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO1'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO1'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
@ -3872,6 +3839,10 @@ object RptFacturasCliente: TRptFacturasCliente
Name = 'BENEFICIO_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE_BENEFICIOS_ANO2'
DataType = datCurrency
end
item
Name = 'DIFERENCIA_INGRESOS'
DataType = datCurrency

View File

@ -100,10 +100,10 @@ type
frxDBInformeListadoClientesMayorDescuentoResumen: TfrxDBDataset;
DADSInformeListadoClientesMayorDescuentoResumen: TDADataSource;
tbl_InformeListadoClientesMayorDescuentoResumen: TDAMemDataTable;
schReport: TDASchema;
tbl_InformeListadoBeneficiosGrafCompMensual: TDAMemDataTable;
tbl_InformeListadoBeneficiosGrafCompTrimestral: TDAMemDataTable;
tbl_InformeListadoBeneficiosGrafCompSemestral: TDAMemDataTable;
schReport: TDASchema;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
private