This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES2/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm

5587 lines
183 KiB
Plaintext

object RptFacturasCliente: TRptFacturasCliente
OldCreateOrder = True
OnCreate = DataModuleCreate
OnDestroy = DataModuleDestroy
Height = 715
Width = 977
object schReport: TDASchema
ConnectionManager = dmServer.ConnectionManager
Datasets = <
item
Params = <
item
Name = 'ID_EMPRESA'
Value = ''
end
item
Name = 'ANO'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end
item
Name = 'NTOP'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select REFERENCIA, NOMBRE, sum(ANO1) as ANO1, sum (ANO2) as ANO2' +
', sum (IMPORTE_DESCUENTO) as IMPORTE_DESCUENTO,'#10'sum (IMPORTE_DES' +
'CUENTO2) as IMPORTE_DESCUENTO2, sum (IMPORTE_TOTAL) as IMPORTE_T' +
'OTAL, sum (IMPORTE_COBRADO) as IMPORTE_COBRADO,'#10'sum (PORCENTAJE)' +
' as PORCENTAJE'#10'from'#10'('#10'select C.REFERENCIA as REFERENCIA, COALESC' +
'E(C.NOMBRE, P.NOMBRE) as NOMBRE, P.ANO as ANO1, 0 as ANO2,'#10'SUM(P' +
'.IMPORTE_DESCUENTO) as IMPORTE_DESCUENTO, 0 as IMPORTE_DESCUENTO' +
'2, SUM(P.IMPORTE_NETO) as IMPORTE_TOTAL,'#10'SUM(P.IMPORTE_TOTAL) as' +
' IMPORTE_COBRADO,'#10'case when SUM(P.IMPORTE_NETO) = 0 then 0'#10'else ' +
'((SUM(P.IMPORTE_DESCUENTO) * 100) / SUM(P.IMPORTE_NETO)) end as ' +
'PORCENTAJE'#10#10'from V_INF_FAC_DET_CLIENTE P'#10'left join CONTACTOS C o' +
'n P.ID_CLIENTE = C.ID'#10'where p.ID_EMPRESA = :ID_EMPRESA'#10'and P.ANO' +
' = :ANO'#10'group by 1,2,3,4'#10#10'union'#10#10'select C2.REFERENCIA as REFEREN' +
'CIA, COALESCE(C2.NOMBRE, P2.NOMBRE) as NOMBRE, 0 as ANO1, P2.ANO' +
' as ANO2,'#10' 0 as IMPORTE_DESCUENTO, SUM(P2.IMPORTE_DESCUENTO) as ' +
'IMPORTE_DESCUENTO2, 0 as IMPORTE_TOTAL,'#10' 0 as IMPORTE_COBRADO, 0' +
' as PORCENTAJE'#10'from V_INF_FAC_DET_CLIENTE P2'#10'left join CONTACTOS' +
' C2 on P2.ID_CLIENTE = C2.ID'#10'where p2.ID_EMPRESA = :ID_EMPRESA'#10'a' +
'nd P2.ANO = :ANO2'#10'group by 1,2,3,4,5'#10')'#10#10'group by 1,2'#10'having (sum' +
'(ANO1) > 0)'#10'order by 3,5 desc'#10'rows 1 to :NTOP'#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'IMPORTE_DESCUENTO'
TableField = 'IMPORTE_DESCUENTO'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'IMPORTE_COBRADO'
TableField = 'IMPORTE_COBRADO'
end
item
DatasetField = 'PORCENTAJE'
TableField = 'PORCENTAJE'
end
item
DatasetField = 'ANO1'
TableField = 'ANO1'
end
item
DatasetField = 'ANO2'
TableField = 'ANO2'
end
item
DatasetField = 'IMPORTE_DESCUENTO2'
TableField = 'IMPORTE_DESCUENTO2'
end>
end>
Name = 'InformeListadoClientesMayorDescuentoResumen'
Fields = <
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'ANO1'
DataType = datLargeInt
end
item
Name = 'ANO2'
DataType = datLargeInt
end
item
Name = 'IMPORTE_DESCUENTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DESCUENTO2'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'IMPORTE_COBRADO'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datDecimal
end>
end
item
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' +
'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' +
'1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' +
'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' +
'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' +
') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' +
'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' +
#10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' +
'O, SEMESTRE as NFILA, SUM(comp1.BASE_IMPONIBLE) as IMPORTE_TOTAL' +
#10'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'an' +
'd (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 o' +
'n (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA, ' +
'comp2.ANO, SEMESTRE as NFILA, SUM(comp2.BASE_IMPONIBLE) as IMPOR' +
'TE_TOTAL'#10'from V_INF_FAC_CLIENTE comp2'#10'where ID_EMPRESA = :ID_EMP' +
'RESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) pe' +
'riodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'SEMESTRAL'#39#10'o' +
'rder by valor asc'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'VALOR'
TableField = 'VALOR'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'ANO1'
TableField = 'ANO1'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'ANO2'
TableField = 'ANO2'
end
item
DatasetField = 'IMPORTE_TOTAL1'
TableField = 'IMPORTE_TOTAL1'
end
item
DatasetField = 'DIFERENCIA'
TableField = 'DIFERENCIA'
end
item
DatasetField = 'PORCENTAJE'
TableField = 'PORCENTAJE'
end>
end>
Name = 'InformeListadoFacturasGrafCompSemestral'
Fields = <
item
Name = 'VALOR'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ANO1'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL1'
DataType = datCurrency
end
item
Name = 'DIFERENCIA'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' +
'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' +
'1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' +
'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' +
'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' +
') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' +
'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' +
#10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' +
'O, MES as NFILA, SUM(comp1.BASE_IMPONIBLE) 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) periodo1 on (VA' +
'LOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA, comp2' +
'.ANO, MES as NFILA, SUM(comp2.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'f' +
'rom V_INF_FAC_CLIENTE comp2'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and ' +
'(ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo2 on ' +
'(VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'MENSUAL'#39#10'order by valo' +
'r asc'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'VALOR'
TableField = 'VALOR'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'ANO1'
TableField = 'ANO1'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'ANO2'
TableField = 'ANO2'
end
item
DatasetField = 'IMPORTE_TOTAL1'
TableField = 'IMPORTE_TOTAL1'
end
item
DatasetField = 'DIFERENCIA'
TableField = 'DIFERENCIA'
end
item
DatasetField = 'PORCENTAJE'
TableField = 'PORCENTAJE'
end>
end>
Name = 'InformeListadoFacturasGrafCompMensual'
Fields = <
item
Name = 'VALOR'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ANO1'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL1'
DataType = datCurrency
end
item
Name = 'DIFERENCIA'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ID_EMPRESA'
Value = ''
end
item
Name = 'ANO'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end
item
Name = 'NTOP'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select REFERENCIA, NOMBRE, sum(ANO1) as ANO1, sum (ANO2) as ANO2' +
', sum (Importe_TOTAL_ANO) as IMPORTE_TOTAL_ANO,'#10'sum (NUMFAC) as ' +
'NUMFAC, sum (IMPORTE_TOTAL) as IMPORTE_TOTAL_ANO1, sum (IMPORTE_' +
'TOTAL_ANO2) as IMPORTE_TOTAL_ANO2,'#10'sum (PORCENTAJE) as PORCENTAJ' +
'E'#10'from'#10'('#10'select C.REFERENCIA as REFERENCIA, COALESCE(C.NOMBRE, P' +
'.NOMBRE) as NOMBRE, P.ANO as ANO1, 0 as ANO2, p.Importe_TOTAL_AN' +
'O,'#10'COUNT(P.FECHA_FACTURA) as NUMFAC, SUM(P.BASE_IMPONIBLE) as IM' +
'PORTE_TOTAL, 0 as IMPORTE_TOTAL_ANO2,'#10'((SUM(P.BASE_IMPONIBLE)*10' +
'0)/p.Importe_TOTAL_ANO) as PORCENTAJE'#10'from V_INF_FAC_CLIENTE P'#10'l' +
'eft join CONTACTOS C on P.ID_CLIENTE = C.ID'#10'where p.ID_EMPRESA =' +
' :ID_EMPRESA'#10'and P.ANO = :ANO'#10'group by 1,2,3,4,5'#10#10'union'#10#10'select ' +
'C2.REFERENCIA as REFERENCIA, COALESCE(C2.NOMBRE, P2.NOMBRE) as N' +
'OMBRE, 0 as ANO1, P2.ANO as ANO2, 0 as Importe_TOTAL_ANO,'#10'0 as N' +
'UMFAC, 0 as IMPORTE_TOTAL, SUM(P2.BASE_IMPONIBLE) as IMPORTE_TOT' +
'AL_ANO2, 0 as PORCENTAJE'#10'from V_INF_FAC_CLIENTE P2'#10'left join CON' +
'TACTOS C2 on P2.ID_CLIENTE = C2.ID'#10'where p2.ID_EMPRESA = :ID_EMP' +
'RESA'#10'and P2.ANO = :ANO2'#10'group by 1,2,3,4,5,6,7'#10')'#10#10'group by 1,2'#10'h' +
'aving (sum(ANO1) > 0)'#10'order by 3,7 desc'#10'rows 1 to :NTOP'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'IMPORTE_TOTAL_ANO'
TableField = 'IMPORTE_TOTAL_ANO'
end
item
DatasetField = 'NUMFAC'
TableField = 'NUMFAC'
end
item
DatasetField = 'PORCENTAJE'
TableField = 'PORCENTAJE'
end
item
DatasetField = 'ANO1'
TableField = 'ANO1'
end
item
DatasetField = 'ANO2'
TableField = 'ANO2'
end
item
DatasetField = 'IMPORTE_TOTAL_ANO1'
TableField = 'IMPORTE_TOTAL_ANO1'
end
item
DatasetField = 'IMPORTE_TOTAL_ANO2'
TableField = 'IMPORTE_TOTAL_ANO2'
end>
end>
Name = 'InformeListadoClientesMayorFacturacionResumen'
Fields = <
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'ANO1'
DataType = datLargeInt
end
item
Name = 'ANO2'
DataType = datLargeInt
end
item
Name = 'IMPORTE_TOTAL_ANO'
DataType = datCurrency
end
item
Name = 'NUMFAC'
DataType = datLargeInt
end
item
Name = 'IMPORTE_TOTAL_ANO1'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select VALOR, DESCRIPCION, periodo1.ANO as Ano1, periodo1.IMPORT' +
'E_TOTAL, periodo2.ANO as Ano2, periodo2.IMPORTE_TOTAL,'#10#10'(periodo' +
'1.IMPORTE_TOTAL - periodo2.IMPORTE_TOTAL) as Diferencia,'#10'/*SOLO ' +
'COMPARAREMOS CUANDO EL SEGUNDO A'#209'O SEA DIFERENTE DE 0, comparati' +
'va de A'#241'o1 respecto A'#241'o2*/'#10'case'#10'when (periodo1.IMPORTE_TOTAL = 0' +
') then (100 - (periodo2.IMPORTE_TOTAL*100))'#10'else (100 - ((period' +
'o2.IMPORTE_TOTAL*100)/periodo1.IMPORTE_TOTAL))'#10'end as Porcentaje' +
#10#10'FROM'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.AN' +
'O, TRIMESTRE as NFILA, SUM(comp1.BASE_IMPONIBLE) as IMPORTE_TOTA' +
'L'#10'from V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'a' +
'nd (ANO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo1 ' +
'on (VALOR = periodo1.NFILA)'#10#10'left join'#10'(select comp2.ID_EMPRESA,' +
' comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.BASE_IMPONIBLE) as IMP' +
'ORTE_TOTAL'#10'from V_INF_FAC_CLIENTE comp2'#10'where ID_EMPRESA = :ID_E' +
'MPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) ' +
'periodo2 on (VALOR = periodo2.NFILA)'#10#10'where periodo= '#39'TRIMESTRAL' +
#39#10'order by valor asc'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'VALOR'
TableField = 'VALOR'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'ANO1'
TableField = 'ANO1'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'ANO2'
TableField = 'ANO2'
end
item
DatasetField = 'IMPORTE_TOTAL1'
TableField = 'IMPORTE_TOTAL1'
end
item
DatasetField = 'DIFERENCIA'
TableField = 'DIFERENCIA'
end
item
DatasetField = 'PORCENTAJE'
TableField = 'PORCENTAJE'
end>
end>
Name = 'InformeListadoFacturasGrafCompTrimestral'
Fields = <
item
Name = 'VALOR'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ANO1'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL1'
DataType = datCurrency
end
item
Name = 'DIFERENCIA'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ID'
DataType = datInteger
Value = '1'
ParamType = daptInput
end>
Statements = <
item
Connection = 'IBX'
SQL =
'SELECT'#10' FACTURAS_CLIENTE.ID, FACTURAS_CLIENTE.REFERENCIA, FAC' +
'TURAS_CLIENTE.FECHA_FACTURA,'#10' CASE WHEN (FACTURAS_CLIENTE.IMP' +
'ORTE_TOTAL < 0) THEN '#39'A'#39' ELSE '#39'F'#39' END AS TIPO,'#10'/*'#10' v_facturas' +
'_cliente.situacion,'#10'*/'#10' FACTURAS_CLIENTE.BASE_IMPONIBLE, FACT' +
'URAS_CLIENTE.DESCUENTO, FACTURAS_CLIENTE.IMPORTE_DESCUENTO,'#10' ' +
'FACTURAS_CLIENTE.IVA, FACTURAS_CLIENTE.IMPORTE_IVA,'#10' FACTURAS' +
'_CLIENTE.RE, FACTURAS_CLIENTE.IMPORTE_RE,'#10' FACTURAS_CLIENTE.I' +
'MPORTE_TOTAL,'#10' FACTURAS_CLIENTE.OBSERVACIONES, FORMAS_PAGO.DE' +
'SCRIPCION AS FORMA_PAGO, FACTURAS_CLIENTE.ID_CLIENTE,'#10' FACTUR' +
'AS_CLIENTE.NIF_CIF, FACTURAS_CLIENTE.NOMBRE, FACTURAS_CLIENTE.CA' +
'LLE,'#10' FACTURAS_CLIENTE.PROVINCIA, FACTURAS_CLIENTE.CODIGO_POS' +
'TAL, FACTURAS_CLIENTE.POBLACION,'#10#10' CONTACTOS_DATOS_BANCO.TITU' +
'LAR,'#10' CONTACTOS_DATOS_BANCO.ENTIDAD,'#10' CONTACTOS_DATOS_BANC' +
'O.SUCURSAL,'#10' CONTACTOS_DATOS_BANCO.DC,'#10' CONTACTOS_DATOS_BA' +
'NCO.CUENTA,'#10#10' ID_EMPRESA, EMPRESAS.NIF_CIF as NIF_CIF_EMPRESA' +
', EMPRESAS.RAZON_SOCIAL,'#10' EMPRESAS.CALLE as CALLE_EMPRESA, EM' +
'PRESAS.POBLACION as POBLACION_EMPRESA,'#10' EMPRESAS.PROVINCIA as' +
' PROVINCIA_EMPRESA, EMPRESAS.CODIGO_POSTAL as CODIGO_POSTAL_EMPR' +
'ESA,'#10' EMPRESAS.TELEFONO_1, EMPRESAS.FAX, EMPRESAS.MOVIL_1, EM' +
'PRESAS.EMAIL_1,'#10' EMPRESAS.PAGINA_WEB, EMPRESAS.REGISTRO_MERCA' +
'NTIL, EMPRESAS.LOGOTIPO,'#10' CONTACTOS.IDIOMA_ISO,'#10' FACTURAS_' +
'CLIENTE.PAIS'#10#10'FROM FACTURAS_CLIENTE'#10#10'LEFT JOIN EMPRESAS ON EMPRE' +
'SAS.ID = ID_EMPRESA'#10'LEFT JOIN CONTACTOS ON CONTACTOS.ID = ID_CLI' +
'ENTE'#10'LEFT JOIN FORMAS_PAGO ON (FORMAS_PAGO.ID = FACTURAS_CLIENTE' +
'.ID_FORMA_PAGO)'#10'LEFT JOIN CONTACTOS_DATOS_BANCO ON (CONTACTOS_DA' +
'TOS_BANCO.ID_CONTACTO = FACTURAS_CLIENTE.ID_CLIENTE)'#10#10'WHERE FACT' +
'URAS_CLIENTE.ID = :ID'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID'
TableField = 'ID'
end
item
DatasetField = 'ID_EMPRESA'
TableField = 'ID_EMPRESA'
end
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'TIPO'
TableField = 'TIPO'
end
item
DatasetField = 'FECHA_FACTURA'
TableField = 'FECHA_FACTURA'
end
item
DatasetField = 'BASE_IMPONIBLE'
TableField = 'BASE_IMPONIBLE'
end
item
DatasetField = 'DESCUENTO'
TableField = 'DESCUENTO'
end
item
DatasetField = 'IMPORTE_DESCUENTO'
TableField = 'IMPORTE_DESCUENTO'
end
item
DatasetField = 'IVA'
TableField = 'IVA'
end
item
DatasetField = 'IMPORTE_IVA'
TableField = 'IMPORTE_IVA'
end
item
DatasetField = 'RE'
TableField = 'RE'
end
item
DatasetField = 'IMPORTE_RE'
TableField = 'IMPORTE_RE'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'OBSERVACIONES'
TableField = 'OBSERVACIONES'
end
item
DatasetField = 'NIF_CIF'
TableField = 'NIF_CIF'
end
item
DatasetField = 'ID_CLIENTE'
TableField = 'ID_CLIENTE'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'CALLE'
TableField = 'CALLE'
end
item
DatasetField = 'PROVINCIA'
TableField = 'PROVINCIA'
end
item
DatasetField = 'POBLACION'
TableField = 'POBLACION'
end
item
DatasetField = 'CODIGO_POSTAL'
TableField = 'CODIGO_POSTAL'
end
item
DatasetField = 'FORMA_PAGO'
TableField = 'FORMA_PAGO'
end
item
DatasetField = 'TITULAR'
TableField = 'TITULAR'
end
item
DatasetField = 'ENTIDAD'
TableField = 'ENTIDAD'
end
item
DatasetField = 'SUCURSAL'
TableField = 'SUCURSAL'
end
item
DatasetField = 'DC'
TableField = 'DC'
end
item
DatasetField = 'CUENTA'
TableField = 'CUENTA'
end
item
DatasetField = 'NIF_CIF_EMPRESA'
TableField = 'NIF_CIF_EMPRESA'
end
item
DatasetField = 'RAZON_SOCIAL'
TableField = 'RAZON_SOCIAL'
end
item
DatasetField = 'CALLE_EMPRESA'
TableField = 'CALLE_EMPRESA'
end
item
DatasetField = 'POBLACION_EMPRESA'
TableField = 'POBLACION_EMPRESA'
end
item
DatasetField = 'PROVINCIA_EMPRESA'
TableField = 'PROVINCIA_EMPRESA'
end
item
DatasetField = 'CODIGO_POSTAL_EMPRESA'
TableField = 'CODIGO_POSTAL_EMPRESA'
end
item
DatasetField = 'TELEFONO_1'
TableField = 'TELEFONO_1'
end
item
DatasetField = 'FAX'
TableField = 'FAX'
end
item
DatasetField = 'MOVIL_1'
TableField = 'MOVIL_1'
end
item
DatasetField = 'EMAIL_1'
TableField = 'EMAIL_1'
end
item
DatasetField = 'PAGINA_WEB'
TableField = 'PAGINA_WEB'
end
item
DatasetField = 'REGISTRO_MERCANTIL'
TableField = 'REGISTRO_MERCANTIL'
end
item
DatasetField = 'LOGOTIPO'
TableField = 'LOGOTIPO'
end
item
DatasetField = 'IDIOMA_ISO'
TableField = 'IDIOMA_ISO'
end
item
DatasetField = 'PAIS'
TableField = 'PAIS'
end>
end>
Name = 'InformeFacturasCliente'
Fields = <
item
Name = 'ID'
DataType = datInteger
DictionaryEntry = 'FacturasCliente_ID'
InPrimaryKey = True
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_REFERENCIA'
end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
DictionaryEntry = 'FacturasCliente_FECHA_FACTURA'
end
item
Name = 'TIPO'
DataType = datString
Size = 1
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_BASE_IMPONIBLE'
end
item
Name = 'DESCUENTO'
DataType = datFloat
DictionaryEntry = 'FacturasCliente_DESCUENTO'
end
item
Name = 'IMPORTE_DESCUENTO'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO'
end
item
Name = 'IVA'
DataType = datFloat
DictionaryEntry = 'FacturasCliente_IVA'
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_IMPORTE_IVA'
end
item
Name = 'RE'
DataType = datFloat
end
item
Name = 'IMPORTE_RE'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_IMPORTE_TOTAL'
end
item
Name = 'OBSERVACIONES'
DataType = datMemo
DictionaryEntry = 'FacturasCliente_OBSERVACIONES'
end
item
Name = 'FORMA_PAGO'
DataType = datString
Size = 255
end
item
Name = 'ID_CLIENTE'
DataType = datInteger
DictionaryEntry = 'FacturasCliente_ID_CLIENTE'
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
DictionaryEntry = 'FacturasCliente_NIF_CIF'
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_NOMBRE'
end
item
Name = 'CALLE'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_CALLE'
end
item
Name = 'PROVINCIA'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_PROVINCIA'
end
item
Name = 'CODIGO_POSTAL'
DataType = datString
Size = 10
DictionaryEntry = 'FacturasCliente_CODIGO_POSTAL'
end
item
Name = 'POBLACION'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_POBLACION'
end
item
Name = 'TITULAR'
DataType = datString
Size = 255
end
item
Name = 'ENTIDAD'
DataType = datString
Size = 15
end
item
Name = 'SUCURSAL'
DataType = datString
Size = 15
end
item
Name = 'DC'
DataType = datString
Size = 15
end
item
Name = 'CUENTA'
DataType = datString
Size = 15
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
DictionaryEntry = 'FacturasCliente_ID_EMPRESA'
end
item
Name = 'NIF_CIF_EMPRESA'
DataType = datString
Size = 15
end
item
Name = 'RAZON_SOCIAL'
DataType = datString
Size = 255
end
item
Name = 'CALLE_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'POBLACION_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'PROVINCIA_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'CODIGO_POSTAL_EMPRESA'
DataType = datString
Size = 10
end
item
Name = 'TELEFONO_1'
DataType = datString
Size = 25
end
item
Name = 'FAX'
DataType = datString
Size = 25
end
item
Name = 'MOVIL_1'
DataType = datString
Size = 25
end
item
Name = 'EMAIL_1'
DataType = datString
Size = 255
end
item
Name = 'PAGINA_WEB'
DataType = datString
Size = 255
end
item
Name = 'REGISTRO_MERCANTIL'
DataType = datString
Size = 255
end
item
Name = 'LOGOTIPO'
DataType = datBlob
end
item
Name = 'IDIOMA_ISO'
DataType = datString
Size = 2
end
item
Name = 'PAIS'
DataType = datString
Size = 255
end>
ReadOnly = True
end
item
Params = <
item
Name = 'ID_FACTURA'
DataType = datInteger
Value = '2'
ParamType = daptInput
end>
Statements = <
item
Connection = 'IBX'
SQL =
'SELECT'#10' DET.ID, DET.ID_FACTURA, DET.POSICION, DET.TIPO_DETALL' +
'E, ARTICULOS.REFERENCIA,'#10' DET.CONCEPTO, DET.CANTIDAD, DET.UNI' +
'DAD_MEDIDA, DET.IMPORTE_UNIDAD,'#10' DET.DESCUENTO, DET.IMPORTE_T' +
'OTAL, DET.VISIBLE'#10'FROM FACTURAS_CLIENTE_DETALLES AS DET'#10'LEFT OUT' +
'ER JOIN ARTICULOS ON (ARTICULOS.ID = DET.ID_ARTICULO)'#10'WHERE DET.' +
'ID_FACTURA = :ID_FACTURA AND {Where}'#10'ORDER BY DET.ID_FACTURA, DE' +
'T.POSICION;'#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID'
TableField = 'ID'
end
item
DatasetField = 'ID_FACTURA'
TableField = 'ID_FACTURA'
end
item
DatasetField = 'POSICION'
TableField = 'POSICION'
end
item
DatasetField = 'TIPO_DETALLE'
TableField = 'TIPO_DETALLE'
end
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'CONCEPTO'
TableField = 'CONCEPTO'
end
item
DatasetField = 'CANTIDAD'
TableField = 'CANTIDAD'
end
item
DatasetField = 'UNIDAD_MEDIDA'
TableField = 'UNIDAD_MEDIDA'
end
item
DatasetField = 'IMPORTE_UNIDAD'
TableField = 'IMPORTE_UNIDAD'
end
item
DatasetField = 'DESCUENTO'
TableField = 'DESCUENTO'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'VISIBLE'
TableField = 'VISIBLE'
end>
end>
Name = 'InformeFacturasCliente_Detalles'
Fields = <
item
Name = 'ID'
DataType = datInteger
InPrimaryKey = True
end
item
Name = 'ID_FACTURA'
DataType = datInteger
end
item
Name = 'POSICION'
DataType = datInteger
end
item
Name = 'TIPO_DETALLE'
DataType = datString
Size = 25
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'CONCEPTO'
DataType = datString
Size = 2000
end
item
Name = 'CANTIDAD'
DataType = datCurrency
end
item
Name = 'UNIDAD_MEDIDA'
DataType = datString
Size = 255
end
item
Name = 'IMPORTE_UNIDAD'
DataType = datCurrency
end
item
Name = 'DESCUENTO'
DataType = datFloat
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'VISIBLE'
DataType = datSmallInt
end>
end
item
Params = <
item
Name = 'ID_FACTURA'
Value = ''
ParamType = daptInput
end>
Statements = <
item
Connection = 'IBX'
SQL =
'SELECT'#10' V_RECIBOS_CLIENTE.ID_FACTURA, V_RECIBOS_CLIENTE.FECHA' +
'_VENCIMIENTO, V_RECIBOS_CLIENTE.IMPORTE_TOTAL'#10'FROM V_RECIBOS_CLI' +
'ENTE'#10'WHERE V_RECIBOS_CLIENTE.ID_FACTURA = :ID_FACTURA'#10'ORDER BY V' +
'_RECIBOS_CLIENTE.FECHA_VENCIMIENTO'#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_FACTURA'
TableField = 'ID_FACTURA'
end
item
DatasetField = 'FECHA_VENCIMIENTO'
TableField = 'FECHA_VENCIMIENTO'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end>
end>
Name = 'InformeFacturasCliente_Vencimientos'
Fields = <
item
Name = 'ID_FACTURA'
DataType = datInteger
end
item
Name = 'FECHA_VENCIMIENTO'
DataType = datDateTime
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
end
item
Params = <>
Statements = <
item
Connection = 'IBX'
TargetTable = 'V_FACTURAS_CLIENTE'
SQL =
'select ID_EMPRESA,'#10'extract (year from fecha_factura) as ANO,'#10'ext' +
'ract (month from fecha_factura) as MES,'#10'case'#10'when extract (month' +
' from fecha_factura) = 1 then '#39'ENERO - '#39' || extract (year from f' +
'echa_factura)'#10'when extract (month from fecha_factura) = 2 then '#39 +
'FEBRERO - '#39' || extract (year from fecha_factura)'#10'when extract (m' +
'onth from fecha_factura) = 3 then '#39'MARZO - '#39' || extract (year fr' +
'om fecha_factura)'#10'when extract (month from fecha_factura) = 4 th' +
'en '#39'ABRIL - '#39' || extract (year from fecha_factura)'#10'when extract ' +
'(month from fecha_factura) = 5 then '#39'MAYO - '#39' || extract (year f' +
'rom fecha_factura)'#10'when extract (month from fecha_factura) = 6 t' +
'hen '#39'JUNIO - '#39' || extract (year from fecha_factura)'#10'when extract' +
' (month from fecha_factura) = 7 then '#39'JULIO - '#39' || extract (year' +
' from fecha_factura)'#10'when extract (month from fecha_factura) = 8' +
' then '#39'AGOSTO - '#39' || extract (year from fecha_factura)'#10'when extr' +
'act (month from fecha_factura) = 9 then '#39'SEPTIEMBRE - '#39' || extra' +
'ct (year from fecha_factura)'#10'when extract (month from fecha_fact' +
'ura) = 10 then '#39'OCTUBRE - '#39' || extract (year from fecha_factura)' +
#10'when extract (month from fecha_factura) = 11 then '#39'NOVIEMBRE - ' +
#39' || extract (year from fecha_factura)'#10'when extract (month from ' +
'fecha_factura) = 12 then '#39'DICIEMBRE - '#39' || extract (year from fe' +
'cha_factura)'#10'end as TITULO,'#10'REFERENCIA, ID_CLIENTE, NOMBRE, SIT' +
'UACION, NIF_CIF, FECHA_FACTURA, fecha_vencimiento, BASE_IMPONIBL' +
'E, IMPORTE_IVA, IMPORTE_TOTAL'#10#10'from V_facturas_cliente'#10'where {wh' +
'ere}'#10'order by ANO, MES, FECHA_FACTURA, NOMBRE'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_EMPRESA'
TableField = 'ID_EMPRESA'
end
item
DatasetField = 'MES'
TableField = '<unknown>'
SQLOrigin = 'MES'
end
item
DatasetField = 'TITULO'
TableField = '<unknown>'
SQLOrigin = 'TITULO'
end
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'ID_CLIENTE'
TableField = 'ID_CLIENTE'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'SITUACION'
TableField = 'SITUACION'
end
item
DatasetField = 'NIF_CIF'
TableField = 'NIF_CIF'
end
item
DatasetField = 'FECHA_FACTURA'
TableField = 'FECHA_FACTURA'
end
item
DatasetField = 'BASE_IMPONIBLE'
TableField = 'BASE_IMPONIBLE'
end
item
DatasetField = 'IMPORTE_IVA'
TableField = 'IMPORTE_IVA'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end
item
DatasetField = 'ANO'
TableField = '<unknown>'
SQLOrigin = 'ANO'
end
item
DatasetField = 'FECHA_VENCIMIENTO'
TableField = 'FECHA_VENCIMIENTO'
end>
end>
Name = 'InformeListadoFacturas'
Fields = <
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'TITULO'
DataType = datString
Size = 19
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'ID_CLIENTE'
DataType = datInteger
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'SITUACION'
DataType = datString
Size = 19
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
end
item
Name = 'FECHA_VENCIMIENTO'
DataType = datDateTime
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
end
item
Params = <>
Statements = <
item
Connection = 'IBX'
TargetTable = 'V_FACTURAS_CLIENTE'
SQL =
'select ID_EMPRESA,'#10'extract (year from fecha_vencimiento) as ANO,' +
#10'extract (month from fecha_vencimiento) as MES,'#10'case'#10'when extrac' +
't (month from fecha_vencimiento) = 1 then '#39'ENERO - '#39' || extract ' +
'(year from fecha_vencimiento)'#10'when extract (month from fecha_ven' +
'cimiento) = 2 then '#39'FEBRERO - '#39' || extract (year from fecha_venc' +
'imiento)'#10'when extract (month from fecha_vencimiento) = 3 then '#39'M' +
'ARZO - '#39' || extract (year from fecha_vencimiento)'#10'when extract (' +
'month from fecha_vencimiento) = 4 then '#39'ABRIL - '#39' || extract (ye' +
'ar from fecha_vencimiento)'#10'when extract (month from fecha_vencim' +
'iento) = 5 then '#39'MAYO - '#39' || extract (year from fecha_vencimient' +
'o)'#10'when extract (month from fecha_vencimiento) = 6 then '#39'JUNIO -' +
' '#39' || extract (year from fecha_vencimiento)'#10'when extract (month ' +
'from fecha_vencimiento) = 7 then '#39'JULIO - '#39' || extract (year fro' +
'm fecha_vencimiento)'#10'when extract (month from fecha_vencimiento)' +
' = 8 then '#39'AGOSTO - '#39' || extract (year from fecha_vencimiento)'#10'w' +
'hen extract (month from fecha_vencimiento) = 9 then '#39'SEPTIEMBRE ' +
'- '#39' || extract (year from fecha_vencimiento)'#10'when extract (month' +
' from fecha_vencimiento) = 10 then '#39'OCTUBRE - '#39' || extract (year' +
' from fecha_vencimiento)'#10'when extract (month from fecha_vencimie' +
'nto) = 11 then '#39'NOVIEMBRE - '#39' || extract (year from fecha_vencim' +
'iento)'#10'when extract (month from fecha_vencimiento) = 12 then '#39'DI' +
'CIEMBRE - '#39' || extract (year from fecha_vencimiento)'#10'end as TITU' +
'LO,'#10'REFERENCIA, ID_CLIENTE, NOMBRE, SITUACION, NIF_CIF, fecha_f' +
'actura, fecha_vencimiento, BASE_IMPONIBLE, IMPORTE_IVA, IMPORTE_' +
'TOTAL'#10#10'from V_facturas_cliente'#10'where {where}'#10'order by ANO, MES, ' +
'fecha_vencimiento, NOMBRE'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_EMPRESA'
TableField = 'ID_EMPRESA'
end
item
DatasetField = 'ANO'
TableField = '<unknown>'
SQLOrigin = 'ANO'
end
item
DatasetField = 'MES'
TableField = '<unknown>'
SQLOrigin = 'MES'
end
item
DatasetField = 'TITULO'
TableField = '<unknown>'
SQLOrigin = 'TITULO'
end
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'ID_CLIENTE'
TableField = 'ID_CLIENTE'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'SITUACION'
TableField = 'SITUACION'
end
item
DatasetField = 'NIF_CIF'
TableField = 'NIF_CIF'
end
item
DatasetField = 'FECHA_FACTURA'
TableField = 'FECHA_FACTURA'
end
item
DatasetField = 'FECHA_VENCIMIENTO'
TableField = 'FECHA_VENCIMIENTO'
end
item
DatasetField = 'BASE_IMPONIBLE'
TableField = 'BASE_IMPONIBLE'
end
item
DatasetField = 'IMPORTE_IVA'
TableField = 'IMPORTE_IVA'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end>
end>
Name = 'InformeListadoFacturasPendientes'
Fields = <
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'TITULO'
DataType = datString
Size = 19
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'ID_CLIENTE'
DataType = datInteger
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'SITUACION'
DataType = datString
Size = 19
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
end
item
Name = 'FECHA_VENCIMIENTO'
DataType = datDateTime
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
end
item
Params = <>
Statements = <
item
Connection = 'IBX'
TargetTable = 'V_FACTURAS_CLIENTE'
SQL =
'select ID_EMPRESA,'#10'extract (year from fecha_factura) as ANO,'#10'ext' +
'ract (month from fecha_factura) as MES,'#10'case'#10'when extract (month' +
' from fecha_factura) = 1 then '#39'ENERO - '#39' || extract (year from f' +
'echa_factura)'#10'when extract (month from fecha_factura) = 2 then '#39 +
'FEBRERO - '#39' || extract (year from fecha_factura)'#10'when extract (m' +
'onth from fecha_factura) = 3 then '#39'MARZO - '#39' || extract (year fr' +
'om fecha_factura)'#10'when extract (month from fecha_factura) = 4 th' +
'en '#39'ABRIL - '#39' || extract (year from fecha_factura)'#10'when extract ' +
'(month from fecha_factura) = 5 then '#39'MAYO - '#39' || extract (year f' +
'rom fecha_factura)'#10'when extract (month from fecha_factura) = 6 t' +
'hen '#39'JUNIO - '#39' || extract (year from fecha_factura)'#10'when extract' +
' (month from fecha_factura) = 7 then '#39'JULIO - '#39' || extract (year' +
' from fecha_factura)'#10'when extract (month from fecha_factura) = 8' +
' then '#39'AGOSTO - '#39' || extract (year from fecha_factura)'#10'when extr' +
'act (month from fecha_factura) = 9 then '#39'SEPTIEMBRE - '#39' || extra' +
'ct (year from fecha_factura)'#10'when extract (month from fecha_fact' +
'ura) = 10 then '#39'OCTUBRE - '#39' || extract (year from fecha_factura)' +
#10'when extract (month from fecha_factura) = 11 then '#39'NOVIEMBRE - ' +
#39' || extract (year from fecha_factura)'#10'when extract (month from ' +
'fecha_factura) = 12 then '#39'DICIEMBRE - '#39' || extract (year from fe' +
'cha_factura)'#10'end as TITULO,'#10'sum(BASE_IMPONIBLE) as BASE_IMPONIBL' +
'E,'#10'sum(IMPORTE_IVA) as IMPORTE_IVA,'#10'sum(IMPORTE_TOTAL) AS IMPORT' +
'E_TOTAL'#10'from V_facturas_cliente'#10'group by 1,2,3,4'#10'order by 1,2,3,' +
'4'#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_EMPRESA'
TableField = 'ID_EMPRESA'
end
item
DatasetField = 'ANO'
TableField = '<unknown>'
SQLOrigin = 'ANO'
end
item
DatasetField = 'MES'
TableField = '<unknown>'
SQLOrigin = 'MES'
end
item
DatasetField = 'TITULO'
TableField = '<unknown>'
SQLOrigin = 'TITULO'
end
item
DatasetField = 'BASE_IMPONIBLE'
TableField = 'BASE_IMPONIBLE'
end
item
DatasetField = 'IMPORTE_IVA'
TableField = 'IMPORTE_IVA'
end
item
DatasetField = 'IMPORTE_TOTAL'
TableField = 'IMPORTE_TOTAL'
end>
end>
Name = 'InformeListadoFacturasResumen'
Fields = <
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'TITULO'
DataType = datString
Size = 19
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ID_EMPRESA'
Value = ''
end
item
Name = 'ANO'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end
item
Name = 'NTOP'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
SQL =
'select REFERENCIA, NOMBRE, sum(ANO1) as ANO1, sum (ANO2) as ANO2' +
', sum (IMPORTE_TOTAL_ANO) as IMPORTE_TOTAL_ANO,'#10'sum (IMPORTE_TOT' +
'AL_ANO1) as IMPORTE_TOTAL_ANO1, sum (IMPORTE_TOTAL_ANO2) as IMPO' +
'RTE_TOTAL_ANO2,'#10'sum (PORCENTAJE) as PORCENTAJE'#10'from'#10'('#10'select C.R' +
'EFERENCIA as REFERENCIA, COALESCE(C.NOMBRE, '#39'Agente no asignado'#39 +
') as NOMBRE, P.ANO as ANO1, 0 as ANO2,'#10'p.IMPORTE_TOTAL_ANO, SUM(' +
'P.IMPORTE_TOTAL) as IMPORTE_TOTAL_ANO1, 0 as IMPORTE_TOTAL_ANO2,' +
#10' ((SUM(P.IMPORTE_TOTAL)*100)/p.IMPORTE_TOTAL_ANO) as PORCENTAJE' +
#10#10'from V_INF_FAC_DET_CLIENTE P'#10'left join CONTACTOS C on P.ID_AGE' +
'NTE = C.ID'#10'left join AGENTES_DATOS AD on P.ID_AGENTE = AD.ID_AGE' +
'NTE'#10'where p.ID_EMPRESA = :ID_EMPRESA'#10'and P.ANO = :ANO'#10'and AD.FEC' +
'HA_BAJA is null'#10'group by 1,2,3,4,5'#10#10'union'#10#10'select C2.REFERENCIA ' +
'as REFERENCIA, COALESCE(C2.NOMBRE, '#39'Agente no asignado'#39') as NOMB' +
'RE, 0 as ANO1, P2.ANO as ANO2,'#10' 0 as IMPORTE_TOTAL_ANO, 0 as IMP' +
'ORTE_TOTAL_ANO1, SUM(P2.IMPORTE_TOTAL) as IMPORTE_TOTAL_ANO2,'#10' 0' +
' as PORCENTAJE'#10'from V_INF_FAC_DET_CLIENTE P2'#10'left join CONTACTOS' +
' C2 on P2.ID_AGENTE = C2.ID'#10'left join AGENTES_DATOS AD2 on P2.ID' +
'_AGENTE = AD2.ID_AGENTE'#10'where p2.ID_EMPRESA = :ID_EMPRESA'#10'and P2' +
'.ANO = :ANO2'#10'and AD2.FECHA_BAJA is null'#10'group by 1,2,3,4,5,6'#10')'#10#10 +
'group by 1,2'#10'having (sum(ANO1) > 0)'#10'order by 3,6 desc'#10'rows 1 to ' +
':NTOP'#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'IMPORTE_TOTAL_ANO'
TableField = 'IMPORTE_TOTAL_ANO'
end
item
DatasetField = 'PORCENTAJE'
TableField = 'PORCENTAJE'
end
item
DatasetField = 'ANO1'
TableField = 'ANO1'
end
item
DatasetField = 'ANO2'
TableField = 'ANO2'
end
item
DatasetField = 'IMPORTE_TOTAL_ANO1'
TableField = 'IMPORTE_TOTAL_ANO1'
end
item
DatasetField = 'IMPORTE_TOTAL_ANO2'
TableField = 'IMPORTE_TOTAL_ANO2'
end>
end>
Name = 'InformeListadoAgentesMayorFacturacionResumen'
Fields = <
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'ANO1'
DataType = datLargeInt
end
item
Name = 'ANO2'
DataType = datLargeInt
end
item
Name = 'IMPORTE_TOTAL_ANO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_ANO1'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
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'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)/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'case when periodo_ing' +
'resos2.ANO is null then 0'#10'else'#10'((coalesce(periodo_ingresos1.IMPO' +
'RTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0)) - (c' +
'oalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_g' +
'astos2.IMPORTE_TOTAL, 0)))'#10'end as Diferencia_Beneficios,'#10#10'case w' +
'hen periodo_ingresos2.ANO is null then 0'#10'else'#10'case'#10'when ((coales' +
'ce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos' +
'2.IMPORTE_TOTAL, 0)) = 0) then (100 - (((coalesce(periodo_ingres' +
'os1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, ' +
'0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(p' +
'eriodo_gastos2.IMPORTE_TOTAL, 0)))*100))'#10'else (((((coalesce(peri' +
'odo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPOR' +
'TE_TOTAL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - ' +
'coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))*100) / (coalesce(pe' +
'riodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMP' +
'ORTE_TOTAL, 0))))'#10'end'#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.BASE_IMPONIBLE) 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.BASE_IMPONIBLE) as IMP' +
'ORTE_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.BAS' +
'E_IMPONIBLE) 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'orde' +
'r by 1 desc,2 asc) periodo_ingresos2 on (VALOR = periodo_ingreso' +
's2.NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA, comp4.ANO, MES as' +
' NFILA, SUM(comp4.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'from V_INF_FA' +
'C_PROVEEDOR comp4'#10'where ID_EMPRESA = :ID_EMPRESA2'#10'and (ANO = :AN' +
'O2)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_gastos2 on (VA' +
'LOR = periodo_gastos2.NFILA)'#10#10#10'where periodo= '#39'MENSUAL'#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 = 'PORCENTAJE_BENEFICIOS_ANO1'
TableField = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_ANO2'
TableField = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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'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)/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'case when periodo_ing' +
'resos2.ANO is null then 0'#10'else'#10'((coalesce(periodo_ingresos1.IMPO' +
'RTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0)) - (c' +
'oalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_g' +
'astos2.IMPORTE_TOTAL, 0)))'#10'end as Diferencia_Beneficios,'#10#10'case w' +
'hen periodo_ingresos2.ANO is null then 0'#10'else'#10'case'#10'when ((coales' +
'ce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos' +
'2.IMPORTE_TOTAL, 0)) = 0) then (100 - (((coalesce(periodo_ingres' +
'os1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, ' +
'0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(p' +
'eriodo_gastos2.IMPORTE_TOTAL, 0)))*100))'#10'else (((((coalesce(peri' +
'odo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPOR' +
'TE_TOTAL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - ' +
'coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))*100) / (coalesce(pe' +
'riodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMP' +
'ORTE_TOTAL, 0))))'#10'end'#10'end as Porcentaje_Aumento_Beneficios'#10#10#10'FRO' +
'M'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, TR' +
'IMESTRE as NFILA, SUM(comp1.BASE_IMPONIBLE) as IMPORTE_TOTAL'#10'fro' +
'm V_INF_FAC_CLIENTE comp1'#10'where ID_EMPRESA = :ID_EMPRESA1'#10'and (A' +
'NO = :ANO1)'#10'group by 1,2,3'#10'order by 1 desc,2 asc) periodo_ingres' +
'os1 on (VALOR = periodo_ingresos1.NFILA)'#10#10'left join'#10'(select comp' +
'2.ID_EMPRESA, comp2.ANO, TRIMESTRE as NFILA, SUM(comp2.BASE_IMPO' +
'NIBLE) 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 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 N' +
'FILA, SUM(comp3.BASE_IMPONIBLE) 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 (VALO' +
'R = periodo_ingresos2.NFILA)'#10#10'left join'#10'(select comp4.ID_EMPRESA' +
', comp4.ANO, TRIMESTRE as NFILA, SUM(comp4.BASE_IMPONIBLE) as IM' +
'PORTE_TOTAL'#10'from V_INF_FAC_PROVEEDOR comp4'#10'where ID_EMPRESA = :I' +
'D_EMPRESA2'#10'and (ANO = :ANO2)'#10'group by 1,2,3'#10'order by 1 desc,2 as' +
'c) periodo_gastos2 on (VALOR = periodo_gastos2.NFILA)'#10#10#10'where pe' +
'riodo= '#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 = 'PORCENTAJE_BENEFICIOS_ANO1'
TableField = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_ANO2'
TableField = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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'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)/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'case when periodo_ing' +
'resos2.ANO is null then 0'#10'else'#10'((coalesce(periodo_ingresos1.IMPO' +
'RTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, 0)) - (c' +
'oalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_g' +
'astos2.IMPORTE_TOTAL, 0)))'#10'end as Diferencia_Beneficios,'#10#10'case w' +
'hen periodo_ingresos2.ANO is null then 0'#10'else'#10'case'#10'when ((coales' +
'ce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos' +
'2.IMPORTE_TOTAL, 0)) = 0) then (100 - (((coalesce(periodo_ingres' +
'os1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPORTE_TOTAL, ' +
'0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(p' +
'eriodo_gastos2.IMPORTE_TOTAL, 0)))*100))'#10'else (((((coalesce(peri' +
'odo_ingresos1.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos1.IMPOR' +
'TE_TOTAL, 0)) - (coalesce(periodo_ingresos2.IMPORTE_TOTAL, 0) - ' +
'coalesce(periodo_gastos2.IMPORTE_TOTAL, 0)))*100) / (coalesce(pe' +
'riodo_ingresos2.IMPORTE_TOTAL, 0) - coalesce(periodo_gastos2.IMP' +
'ORTE_TOTAL, 0))))'#10'end'#10'end as Porcentaje_Aumento_Beneficios'#10#10#10'FRO' +
'M'#10'periodos_aux'#10'left join'#10'(select comp1.ID_EMPRESA, comp1.ANO, SE' +
'MESTRE as NFILA, SUM(comp1.BASE_IMPONIBLE) 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, SEMESTRE as NFILA, SUM(comp2.BASE_IMPONI' +
'BLE) 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, SEMESTRE as NFIL' +
'A, SUM(comp3.BASE_IMPONIBLE) 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, SEMESTRE as NFILA, SUM(comp4.BASE_IMPONIBLE) 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'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 = 'PORCENTAJE_BENEFICIOS_ANO1'
TableField = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_ANO2'
TableField = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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 = 'ANO1'
Value = '2012'
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
Value = '1'
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select SEN.ID_AGENTE, COALESCE(C.NOMBRE, '#39'SIN ASIGNAR'#39') || '#39' ('#39' ' +
'|| CLIENTES_TOTALES.NUM_CLIENTES_TOTALES || '#39')'#39' as AGENTE, ANO, ' +
'MES,'#10' P.descripcion,'#10#10' sum(ALTAS_CLIENTE) as ALTAS_CLIENTE' +
','#10#10' sum(CLIENTES_ACTIVOS) as CLIENTES_TOTALES,'#10#10' sum(CANTI' +
'DAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(IMPORTE_OBJETIVO) as IMP' +
'ORTE_OBJETIVO,'#10#10' sum(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGU' +
'IDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA, sum(CANTIDAD_T' +
'OTAL_CONSEGUIDA) as CANTIDAD_TOTAL_CONSEGUIDA,'#10' sum(IMPORTE_C' +
'ONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPOR' +
'TE_DEVUELTO, sum(IMPORTE_TOTAL_CONSEGUIDO) as IMPORTE_TOTAL_CONS' +
'EGUIDO,'#10#10' (sum(CANTIDAD_TOTAL_CONSEGUIDA) - sum(CANTIDAD_OBJE' +
'TIVO)) as CANTIDAD_RESULTADO,'#10' (sum(IMPORTE_TOTAL_CONSEGUIDO)' +
' - sum(IMPORTE_OBJETIVO)) as IMPORTE_RESULTADO,'#10#10' case when (' +
'sum(CANTIDAD_TOTAL_CONSEGUIDA) <> 0) then (sum(IMPORTE_TOTAL_CON' +
'SEGUIDO)/sum(CANTIDAD_TOTAL_CONSEGUIDA))'#10' else 0'#10' end as I' +
'MPORTE_MEDIO_UNIDAD,'#10#10' case when (sum(CLIENTES_ACTIVOS) <> 0)' +
' then (sum(IMPORTE_TOTAL_CONSEGUIDO)/sum(CLIENTES_ACTIVOS))'#10' ' +
'else 0'#10' end as IMPORTE_MEDIO_CLIENTE'#10#10#10'from'#10'('#10'select AO.ID_AG' +
'ENTE, AO.ANO, AO.MES,'#10'0 as ALTAS_CLIENTE,'#10'0 as CLIENTES_ACTIVOS,' +
#10'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(AO.IMPORTE_' +
'OBJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CA' +
'NTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IMPORTE_CO' +
'NSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONSEGUIDO'#10'f' +
'rom V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join contactos C on (C.I' +
'D = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,2,3'#10#10'UNION A' +
'LL'#10#10'select ID_AGENTE, ANO, MES,'#10'0 as ALTAS_CLIENTE,'#10'0 as CLIENTE' +
'S_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'sum(CA' +
'NTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA' +
') as CANTIDAD_DEVUELTA, (sum(CANTIDAD_CONSEGUIDA) + sum(CANTIDAD' +
'_DEVUELTA)) as CANTIDAD_TOTAL_CONSEGUIDA,'#10'sum(IMPORTE_CONSEGUIDO' +
') as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEVUEL' +
'TO, (sum(IMPORTE_CONSEGUIDO) + sum(IMPORTE_DEVUELTO)) as IMPORTE' +
'_TOTAL_CONSEGUIDO'#10'from v_inf_objetivos_facturas'#10'where ((v_inf_ob' +
'jetivos_facturas.id_empresa = :ID_EMPRESA) and (v_inf_objetivos_' +
'facturas.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'select ID_AGEN' +
'TE, ANO, MES,'#10'count(ID_CLIENTE) as ALTAS_CLIENTE,'#10'0 as CLIENTES_' +
'ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CAN' +
'TIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CO' +
'NSEGUIDA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as I' +
'MPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_obj_clientes_agentes'#10'where (A' +
'NO = :ANO1)'#10'group by 1,2,3'#10#10'union all'#10#10'select ID_AGENTE, ANO, ME' +
'S,'#10'0 as ALTAS_CLIENTE,'#10'count(distinct ID_CLIENTE) as CLIENTES_AC' +
'TIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CANTI' +
'DAD_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONS' +
'EGUIDA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMP' +
'ORTE_TOTAL_CONSEGUIDO'#10'from v_inf_obj_cli_activos_fac_age'#10'where (' +
'ANO = :ANO1) and (v_inf_obj_cli_activos_fac_age.ID_EMPRESA = :ID' +
'_EMPRESA)'#10'group by 1,2,3'#10#10') SEN'#10#10'left join periodos_aux P on ((P' +
'.periodo = '#39'MENSUAL'#39') and (P.valor = MES))'#10'left join contactos C' +
' on (C.ID = SEN.ID_AGENTE)'#10'left join agentes_datos AD on (AD.id_' +
'agente = SEN.ID_AGENTE)'#10#10'left join'#10'('#10'select coalesce(ID_AGENTE, ' +
'-1) as ID_AGENTE, count(ID_CLIENTE) as NUM_CLIENTES_TOTALES'#10'from' +
' clientes_datos'#10'group by 1'#10') CLIENTES_TOTALES on (CLIENTES_TOTAL' +
'ES.ID_AGENTE = SEN.id_Agente)'#10#10'where AD.FECHA_BAJA is null'#10'and {' +
'where}'#10'group by 1,2,3,4,5'#10'order by 1,2,3,4,5'#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
end
item
DatasetField = 'MES'
TableField = 'MES'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
end
item
DatasetField = 'IMPORTE_OBJETIVO'
TableField = 'IMPORTE_OBJETIVO'
end
item
DatasetField = 'CANTIDAD_CONSEGUIDA'
TableField = 'CANTIDAD_CONSEGUIDA'
end
item
DatasetField = 'CANTIDAD_DEVUELTA'
TableField = 'CANTIDAD_DEVUELTA'
end
item
DatasetField = 'CANTIDAD_TOTAL_CONSEGUIDA'
TableField = 'CANTIDAD_TOTAL_CONSEGUIDA'
end
item
DatasetField = 'IMPORTE_CONSEGUIDO'
TableField = 'IMPORTE_CONSEGUIDO'
end
item
DatasetField = 'IMPORTE_DEVUELTO'
TableField = 'IMPORTE_DEVUELTO'
end
item
DatasetField = 'IMPORTE_TOTAL_CONSEGUIDO'
TableField = 'IMPORTE_TOTAL_CONSEGUIDO'
end
item
DatasetField = 'CANTIDAD_RESULTADO'
TableField = 'CANTIDAD_RESULTADO'
end
item
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end
item
DatasetField = 'IMPORTE_MEDIO_UNIDAD'
TableField = 'IMPORTE_MEDIO_UNIDAD'
end
item
DatasetField = 'IMPORTE_MEDIO_CLIENTE'
TableField = 'IMPORTE_MEDIO_CLIENTE'
end>
end>
Name = 'InformeListadoObjetivosMensual'
Fields = <
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'AGENTE'
DataType = datString
Size = 269
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ALTAS_CLIENTE'
DataType = datLargeInt
end
item
Name = 'CLIENTES_TOTALES'
DataType = datLargeInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datLargeInt
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_UNIDAD'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_CLIENTE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ANO1'
Value = '2012'
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
Value = '1'
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select SEN.ID_AGENTE, COALESCE(C.NOMBRE, '#39'SIN ASIGNAR'#39') || '#39' ('#39' ' +
'|| CLIENTES_TOTALES.NUM_CLIENTES_TOTALES || '#39')'#39' as AGENTE, ANO, ' +
'SEMESTRE,'#10' P.descripcion,'#10#10' sum(ALTAS_CLIENTE) as ALTAS_CL' +
'IENTE,'#10#10' sum(CLIENTES_ACTIVOS) as CLIENTES_TOTALES,'#10#10' sum(' +
'CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(IMPORTE_OBJETIVO) a' +
's IMPORTE_OBJETIVO,'#10#10' sum(CANTIDAD_CONSEGUIDA) as CANTIDAD_CO' +
'NSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA, sum(CANTI' +
'DAD_TOTAL_CONSEGUIDA) as CANTIDAD_TOTAL_CONSEGUIDA,'#10' sum(IMPO' +
'RTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as ' +
'IMPORTE_DEVUELTO, sum(IMPORTE_TOTAL_CONSEGUIDO) as IMPORTE_TOTAL' +
'_CONSEGUIDO,'#10#10' (sum(CANTIDAD_TOTAL_CONSEGUIDA) - sum(CANTIDAD' +
'_OBJETIVO)) as CANTIDAD_RESULTADO,'#10' (sum(IMPORTE_TOTAL_CONSEG' +
'UIDO) - sum(IMPORTE_OBJETIVO)) as IMPORTE_RESULTADO,'#10#10' case w' +
'hen (sum(CANTIDAD_TOTAL_CONSEGUIDA) <> 0) then (sum(IMPORTE_TOTA' +
'L_CONSEGUIDO)/sum(CANTIDAD_TOTAL_CONSEGUIDA))'#10' else 0'#10' end' +
' as IMPORTE_MEDIO_UNIDAD,'#10#10' case when (sum(CLIENTES_ACTIVOS) ' +
'<> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/sum(CLIENTES_ACTIVOS))' +
#10' else 0'#10' end as IMPORTE_MEDIO_CLIENTE'#10#10#10'from'#10'('#10'select AO.' +
'ID_AGENTE, AO.ANO, AO.SEMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'0 as CLIENTE' +
'S_ACTIVOS,'#10'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(A' +
'O.IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUID' +
'A, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as ' +
'IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CO' +
'NSEGUIDO'#10'from V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join contactos' +
' C on (C.ID = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,2,' +
'3'#10#10'UNION ALL'#10#10'select ID_AGENTE, ANO, SEMESTRE,'#10'0 as ALTAS_CLIENT' +
'E,'#10'0 as CLIENTES_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_O' +
'BJETIVO,'#10'sum(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CA' +
'NTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA, (sum(CANTIDAD_CONSEGUIDA)' +
' + sum(CANTIDAD_DEVUELTA)) as CANTIDAD_TOTAL_CONSEGUIDA,'#10'sum(IMP' +
'ORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as' +
' IMPORTE_DEVUELTO, (sum(IMPORTE_CONSEGUIDO) + sum(IMPORTE_DEVUEL' +
'TO)) as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_objetivos_facturas'#10'w' +
'here ((v_inf_objetivos_facturas.id_empresa = :ID_EMPRESA) and (v' +
'_inf_objetivos_facturas.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10 +
#10'select ID_AGENTE, ANO, SEMESTRE,'#10'count(ID_CLIENTE) as ALTAS_CLI' +
'ENTE,'#10'0 as CLIENTES_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORT' +
'E_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 ' +
'as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPO' +
'RTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_obj_clien' +
'tes_agentes'#10'where (ANO = :ANO1)'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'selec' +
't ID_AGENTE, ANO, SEMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'count(distinct I' +
'D_CLIENTE) as CLIENTES_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMP' +
'ORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA,' +
' 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IMPORTE_CONSEGUIDO, 0 as I' +
'MPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_obj_cl' +
'i_activos_fac_age'#10'where (ANO = :ANO1) and (v_inf_obj_cli_activos' +
'_fac_age.ID_EMPRESA = :ID_EMPRESA)'#10'group by 1,2,3'#10#10') SEN'#10#10'left j' +
'oin periodos_aux P on ((P.periodo = '#39'SEMESTRAL'#39') and (P.valor = ' +
'SEMESTRE))'#10'left join contactos C on (C.ID = SEN.ID_AGENTE)'#10'left ' +
'join agentes_datos AD on (AD.id_agente = SEN.ID_AGENTE)'#10#10'left jo' +
'in'#10'('#10'select coalesce(ID_AGENTE, -1) as ID_AGENTE, count(ID_CLIEN' +
'TE) as NUM_CLIENTES_TOTALES'#10'from clientes_datos'#10'group by 1'#10') CLI' +
'ENTES_TOTALES on (CLIENTES_TOTALES.ID_AGENTE = SEN.id_Agente)'#10#10'w' +
'here AD.FECHA_BAJA is null'#10'and {where}'#10'group by 1,2,3,4,5'#10'order ' +
'by 1,2,3,4,5'#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
end
item
DatasetField = 'SEMESTRE'
TableField = 'SEMESTRE'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
end
item
DatasetField = 'IMPORTE_OBJETIVO'
TableField = 'IMPORTE_OBJETIVO'
end
item
DatasetField = 'CANTIDAD_CONSEGUIDA'
TableField = 'CANTIDAD_CONSEGUIDA'
end
item
DatasetField = 'CANTIDAD_DEVUELTA'
TableField = 'CANTIDAD_DEVUELTA'
end
item
DatasetField = 'CANTIDAD_TOTAL_CONSEGUIDA'
TableField = 'CANTIDAD_TOTAL_CONSEGUIDA'
end
item
DatasetField = 'IMPORTE_CONSEGUIDO'
TableField = 'IMPORTE_CONSEGUIDO'
end
item
DatasetField = 'IMPORTE_DEVUELTO'
TableField = 'IMPORTE_DEVUELTO'
end
item
DatasetField = 'IMPORTE_TOTAL_CONSEGUIDO'
TableField = 'IMPORTE_TOTAL_CONSEGUIDO'
end
item
DatasetField = 'CANTIDAD_RESULTADO'
TableField = 'CANTIDAD_RESULTADO'
end
item
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end
item
DatasetField = 'IMPORTE_MEDIO_UNIDAD'
TableField = 'IMPORTE_MEDIO_UNIDAD'
end
item
DatasetField = 'IMPORTE_MEDIO_CLIENTE'
TableField = 'IMPORTE_MEDIO_CLIENTE'
end>
end>
Name = 'InformeListadoObjetivosSemestral'
Fields = <
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'AGENTE'
DataType = datString
Size = 255
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'SEMESTRE'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'CLIENTES_TOTALES'
DataType = datInteger
end
item
Name = 'ALTAS_CLIENTE'
DataType = datLargeInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datLargeInt
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_UNIDAD'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_CLIENTE'
DataType = datCurrency
end>
end
item
Params = <
item
Name = 'ANO1'
Value = '2012'
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
Value = '1'
end>
Statements = <
item
Connection = 'IBX'
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select SEN.ID_AGENTE, COALESCE(C.NOMBRE, '#39'SIN ASIGNAR'#39') || '#39' ('#39' ' +
'|| CLIENTES_TOTALES.NUM_CLIENTES_TOTALES || '#39')'#39' as AGENTE, ANO, ' +
'TRIMESTRE,'#10' P.descripcion,'#10#10' sum(ALTAS_CLIENTE) as ALTAS_C' +
'LIENTE,'#10#10' sum(CLIENTES_ACTIVOS) as CLIENTES_TOTALES,'#10#10' sum' +
'(CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(IMPORTE_OBJETIVO) ' +
'as IMPORTE_OBJETIVO,'#10#10' sum(CANTIDAD_CONSEGUIDA) as CANTIDAD_C' +
'ONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA, sum(CANT' +
'IDAD_TOTAL_CONSEGUIDA) as CANTIDAD_TOTAL_CONSEGUIDA,'#10' sum(IMP' +
'ORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as' +
' IMPORTE_DEVUELTO, sum(IMPORTE_TOTAL_CONSEGUIDO) as IMPORTE_TOTA' +
'L_CONSEGUIDO,'#10#10' (sum(CANTIDAD_TOTAL_CONSEGUIDA) - sum(CANTIDA' +
'D_OBJETIVO)) as CANTIDAD_RESULTADO,'#10' (sum(IMPORTE_TOTAL_CONSE' +
'GUIDO) - sum(IMPORTE_OBJETIVO)) as IMPORTE_RESULTADO,'#10#10' case ' +
'when (sum(CANTIDAD_TOTAL_CONSEGUIDA) <> 0) then (sum(IMPORTE_TOT' +
'AL_CONSEGUIDO)/sum(CANTIDAD_TOTAL_CONSEGUIDA))'#10' else 0'#10' en' +
'd as IMPORTE_MEDIO_UNIDAD,'#10#10' case when (sum(CLIENTES_ACTIVOS)' +
' <> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/sum(CLIENTES_ACTIVOS)' +
')'#10' else 0'#10' end as IMPORTE_MEDIO_CLIENTE'#10#10#10'from'#10'('#10'select AO' +
'.ID_AGENTE, AO.ANO, AO.TRIMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'0 as CLIEN' +
'TES_ACTIVOS,'#10'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum' +
'(AO.IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGU' +
'IDA, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 a' +
's IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_' +
'CONSEGUIDO'#10'from V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join contact' +
'os C on (C.ID = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,' +
'2,3'#10#10'UNION ALL'#10#10'select ID_AGENTE, ANO, TRIMESTRE,'#10'0 as ALTAS_CLI' +
'ENTE,'#10'0 as CLIENTES_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORT' +
'E_OBJETIVO,'#10'sum(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum' +
'(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA, (sum(CANTIDAD_CONSEGUI' +
'DA) + sum(CANTIDAD_DEVUELTA)) as CANTIDAD_TOTAL_CONSEGUIDA,'#10'sum(' +
'IMPORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO)' +
' as IMPORTE_DEVUELTO, (sum(IMPORTE_CONSEGUIDO) + sum(IMPORTE_DEV' +
'UELTO)) as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_objetivos_factura' +
's'#10'where ((v_inf_objetivos_facturas.id_empresa = :ID_EMPRESA) and' +
' (v_inf_objetivos_facturas.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION A' +
'LL'#10#10'select ID_AGENTE, ANO, TRIMESTRE,'#10'count(ID_CLIENTE) as ALTAS' +
'_CLIENTE,'#10'0 as CLIENTES_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 as IM' +
'PORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA' +
', 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IMPORTE_CONSEGUIDO, 0 as ' +
'IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_obj_c' +
'lientes_agentes'#10'where (ANO = :ANO1)'#10'group by 1,2,3'#10#10'UNION ALL'#10#10's' +
'elect ID_AGENTE, ANO, TRIMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'count(disti' +
'nct ID_CLIENTE) as CLIENTES_ACTIVOS,'#10'0 as CANTIDAD_OBJETIVO, 0 a' +
's IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVU' +
'ELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IMPORTE_CONSEGUIDO, 0' +
' as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_o' +
'bj_cli_activos_fac_age'#10'where (ANO = :ANO1) and (v_inf_obj_cli_ac' +
'tivos_fac_age.ID_EMPRESA = :ID_EMPRESA)'#10'group by 1,2,3'#10#10') SEN'#10#10'l' +
'eft join periodos_aux P on ((P.periodo = '#39'TRIMESTRAL'#39') and (P.va' +
'lor = TRIMESTRE))'#10'left join contactos C on (C.ID = SEN.ID_AGENTE' +
')'#10'left join agentes_datos AD on (AD.id_agente = SEN.ID_AGENTE)'#10#10 +
'left join'#10'('#10'select coalesce(ID_AGENTE, -1) as ID_AGENTE, count(I' +
'D_CLIENTE) as NUM_CLIENTES_TOTALES'#10'from clientes_datos'#10'group by ' +
'1'#10') CLIENTES_TOTALES on (CLIENTES_TOTALES.ID_AGENTE = SEN.id_Age' +
'nte)'#10#10'where FECHA_BAJA is null'#10'and {where}'#10'group by 1,2,3,4,5'#10'or' +
'der by 1,2,3,4,5'#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
end
item
DatasetField = 'TRIMESTRE'
TableField = 'TRIMESTRE'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
end
item
DatasetField = 'IMPORTE_OBJETIVO'
TableField = 'IMPORTE_OBJETIVO'
end
item
DatasetField = 'CANTIDAD_CONSEGUIDA'
TableField = 'CANTIDAD_CONSEGUIDA'
end
item
DatasetField = 'CANTIDAD_DEVUELTA'
TableField = 'CANTIDAD_DEVUELTA'
end
item
DatasetField = 'CANTIDAD_TOTAL_CONSEGUIDA'
TableField = 'CANTIDAD_TOTAL_CONSEGUIDA'
end
item
DatasetField = 'IMPORTE_CONSEGUIDO'
TableField = 'IMPORTE_CONSEGUIDO'
end
item
DatasetField = 'IMPORTE_DEVUELTO'
TableField = 'IMPORTE_DEVUELTO'
end
item
DatasetField = 'IMPORTE_TOTAL_CONSEGUIDO'
TableField = 'IMPORTE_TOTAL_CONSEGUIDO'
end
item
DatasetField = 'CANTIDAD_RESULTADO'
TableField = 'CANTIDAD_RESULTADO'
end
item
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end
item
DatasetField = 'IMPORTE_MEDIO_UNIDAD'
TableField = 'IMPORTE_MEDIO_UNIDAD'
end
item
DatasetField = 'IMPORTE_MEDIO_CLIENTE'
TableField = 'IMPORTE_MEDIO_CLIENTE'
end>
end>
Name = 'InformeListadoObjetivosTrimestral'
Fields = <
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'AGENTE'
DataType = datString
Size = 255
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'TRIMESTRE'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'CLIENTES_TOTALES'
DataType = datInteger
end
item
Name = 'ALTAS_CLIENTE'
DataType = datLargeInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datLargeInt
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_UNIDAD'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_CLIENTE'
DataType = datCurrency
end>
end>
JoinDataTables = <>
UnionDataTables = <>
Commands = <>
RelationShips = <>
UpdateRules = <>
Version = 0
Left = 48
Top = 16
end
object DataDictionary: TDADataDictionary
Fields = <
item
Name = 'FacturasCliente_ID'
DataType = datAutoInc
Required = True
DisplayLabel = 'ID'
end
item
Name = 'FacturasCliente_ID_EMPRESA'
DataType = datInteger
DisplayLabel = 'ID_EMPRESA'
end
item
Name = 'FacturasCliente_ID_CONTRATO'
DataType = datInteger
DisplayLabel = 'ID_CONTRATO'
end
item
Name = 'FacturasCliente_FECHA_FACTURA'
DataType = datDateTime
DisplayLabel = 'Fecha de las factura'
end
item
Name = 'FacturasCliente_VENCIMIENTO'
DataType = datInteger
DisplayLabel = 'Vencimiento'
end
item
Name = 'FacturasCliente_SITUACION'
DataType = datString
Size = 255
DisplayLabel = 'Situaci'#243'n'
end
item
Name = 'FacturasCliente_BASE_IMPONIBLE'
DataType = datFloat
DisplayLabel = 'Base imponible'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_IMPORTE_DESCUENTO'
DataType = datFloat
DisplayLabel = 'Importe dto.'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_IMPORTE_IVA'
DataType = datFloat
DisplayLabel = 'Importe IVA'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_IMPORTE_TOTAL'
DataType = datFloat
DisplayLabel = 'Importe total'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_FORMA_PAGO'
DataType = datMemo
DisplayLabel = 'Forma de pago'
end
item
Name = 'FacturasCliente_ID_CLIENTE'
DataType = datInteger
DisplayLabel = 'ID_CLIENTE'
end
item
Name = 'FacturasCliente_NIF_CIF'
DataType = datString
Size = 15
DisplayLabel = 'NIF/CIF'
end
item
Name = 'FacturasCliente_CODIGO_POSTAL'
DataType = datString
Size = 10
DisplayLabel = 'C'#243'd. postal'
end
item
Name = 'FacturasCliente_FECHA_ALTA'
DataType = datDateTime
DisplayLabel = 'FECHA_ALTA'
end
item
Name = 'FacturasCliente_FECHA_MODIFICACION'
DataType = datDateTime
DisplayLabel = 'FECHA_MODIFICACION'
end
item
Name = 'FacturasCliente_OBSERVACIONES'
DataType = datMemo
DisplayLabel = 'Observaciones'
end
item
Name = 'FacturasCliente_NOMBRE'
DataType = datString
Size = 100
DisplayLabel = 'Cliente'
end
item
Name = 'FacturasCliente_CALLE'
DataType = datString
Size = 150
DisplayLabel = 'Direcci'#243'n'
end
item
Name = 'FacturasCliente_PROVINCIA'
DataType = datString
Size = 30
DisplayLabel = 'Provincia'
end
item
Name = 'FacturasCliente_POBLACION'
DataType = datString
Size = 150
DisplayLabel = 'Poblaci'#243'n'
end
item
Name = 'FacturasCliente_IVA'
DataType = datFloat
DisplayLabel = 'IVA'
end
item
Name = 'FacturasCliente_USUARIO'
DataType = datString
Size = 100
DisplayLabel = 'USUARIO'
end
item
Name = 'FacturasCliente_REFERENCIA'
DataType = datString
Size = 20
DisplayLabel = 'Referencia'
end
item
Name = 'FacturasCliente_DESCUENTO'
DataType = datFloat
DisplayLabel = 'Dto.'
end
item
Name = 'FacturasCliente_Detalles_ID'
DataType = datAutoInc
Required = True
DisplayLabel = 'ID'
end
item
Name = 'FacturasCliente_Detalles_ID_FACTURA'
DataType = datInteger
DisplayLabel = 'ID_FACTURA'
end
item
Name = 'FacturasCliente_Detalles_TIPO_DETALLE'
DataType = datString
Size = 25
DisplayLabel = 'Tipo detalle'
end
item
Name = 'FacturasCliente_Detalles_CONCEPTO'
DataType = datString
Size = 2000
DisplayLabel = 'Concepto'
end
item
Name = 'FacturasCliente_Detalles_IMPORTE_UNIDAD'
DataType = datFloat
DisplayLabel = 'Importe unidad'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_Detalles_IMPORTE_TOTAL'
DataType = datFloat
DisplayLabel = 'Importe total'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_Detalles_VISIBLE'
DataType = datInteger
DisplayLabel = #191'Visible?'
end
item
Name = 'FacturasCliente_Detalles_POSICION'
DataType = datInteger
DisplayLabel = 'Posici'#243'n'
end
item
Name = 'FacturasCliente_Detalles_CANTIDAD'
DataType = datInteger
DisplayLabel = 'Cantidad'
end>
Left = 46
Top = 158
end
object frxDBCabecera: TfrxDBDataset
UserName = 'frxDBCabecera'
CloseDataSource = False
DataSource = DADSCabecera
BCDToCurrency = False
Left = 264
Top = 16
end
object frxDBDetalles: TfrxDBDataset
UserName = 'frxDBDetalles'
CloseDataSource = False
DataSource = DADSDetalles
BCDToCurrency = False
Left = 344
Top = 16
end
object IBDatabase1: TIBDatabase
DatabaseName = 'C:\Codigo\Output\Debug\Database\FACTUGES.FDB'
Params.Strings = (
'user_name=sysdba'
'password=masterkey'
'lc_ctype=ISO8859_1')
LoginPrompt = False
DefaultTransaction = IBTransaction1
Left = 48
Top = 296
end
object IBTransaction1: TIBTransaction
Left = 48
Top = 352
end
object DataSource1: TDataSource
DataSet = cabecera
Left = 216
Top = 296
end
object DataSource2: TDataSource
DataSet = detalles
Left = 216
Top = 352
end
object cabecera: TIBQuery
Database = IBDatabase1
Transaction = IBTransaction1
SQL.Strings = (
'select'
' v_facturas_cliente.id, v_facturas_cliente.id_empresa,'
' v_facturas_cliente.referencia, v_facturas_cliente.tipo,'
' v_facturas_cliente.fecha_factura, v_facturas_cliente.base_imp' +
'onible,'
' v_facturas_cliente.situacion, v_facturas_cliente.descuento,'
' v_facturas_cliente.importe_descuento, v_facturas_cliente.iva,'
' v_facturas_cliente.importe_iva, v_facturas_cliente.re,'
' v_facturas_cliente.importe_re, v_facturas_cliente.importe_tot' +
'al,'
' v_facturas_cliente.observaciones, v_facturas_cliente.nif_cif,'
' v_facturas_cliente.id_cliente, v_facturas_cliente.nombre,'
' v_facturas_cliente.calle, v_facturas_cliente.provincia,'
' v_facturas_cliente.poblacion, v_facturas_cliente.codigo_posta' +
'l,'
' v_facturas_cliente.recargo_equivalencia, v_facturas_cliente.i' +
'mporte_neto,'
' v_facturas_cliente.importe_porte, formas_pago.descripcion as ' +
'FORMA_PAGO,'
' v_facturas_cliente.DATOS_BANCARIOS'
'from v_facturas_cliente'
' left outer join formas_pago on (formas_pago.id = v_facturas_c' +
'liente.id_forma_pago)'
'WHERE V_FACTURAS_CLIENTE.ID = 2')
Left = 136
Top = 296
object cabeceraID: TIntegerField
FieldName = 'ID'
Origin = '"V_FACTURAS_CLIENTE"."ID"'
end
object cabeceraID_EMPRESA: TIntegerField
FieldName = 'ID_EMPRESA'
Origin = '"V_FACTURAS_CLIENTE"."ID_EMPRESA"'
end
object cabeceraREFERENCIA: TIBStringField
FieldName = 'REFERENCIA'
Origin = '"V_FACTURAS_CLIENTE"."REFERENCIA"'
Size = 255
end
object cabeceraTIPO: TIBStringField
FieldKind = fkInternalCalc
FieldName = 'TIPO'
Origin = '"V_FACTURAS_CLIENTE"."TIPO"'
ProviderFlags = []
ReadOnly = True
FixedChar = True
Size = 1
end
object cabeceraFECHA_FACTURA: TDateField
FieldName = 'FECHA_FACTURA'
Origin = '"V_FACTURAS_CLIENTE"."FECHA_FACTURA"'
end
object cabeceraBASE_IMPONIBLE: TIBBCDField
FieldName = 'BASE_IMPONIBLE'
Origin = '"V_FACTURAS_CLIENTE"."BASE_IMPONIBLE"'
Precision = 18
Size = 2
end
object cabeceraSITUACION: TIBStringField
FieldKind = fkInternalCalc
FieldName = 'SITUACION'
Origin = '"V_FACTURAS_CLIENTE"."SITUACION"'
ProviderFlags = []
ReadOnly = True
FixedChar = True
Size = 19
end
object cabeceraDESCUENTO: TFloatField
FieldName = 'DESCUENTO'
Origin = '"V_FACTURAS_CLIENTE"."DESCUENTO"'
end
object cabeceraIMPORTE_DESCUENTO: TIBBCDField
FieldName = 'IMPORTE_DESCUENTO'
Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_DESCUENTO"'
Precision = 18
Size = 2
end
object cabeceraIVA: TFloatField
FieldName = 'IVA'
Origin = '"V_FACTURAS_CLIENTE"."IVA"'
end
object cabeceraIMPORTE_IVA: TIBBCDField
FieldName = 'IMPORTE_IVA'
Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_IVA"'
Precision = 18
Size = 2
end
object cabeceraRE: TFloatField
FieldName = 'RE'
Origin = '"V_FACTURAS_CLIENTE"."RE"'
end
object cabeceraIMPORTE_RE: TIBBCDField
FieldName = 'IMPORTE_RE'
Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_RE"'
Precision = 18
Size = 2
end
object cabeceraIMPORTE_TOTAL: TIBBCDField
FieldName = 'IMPORTE_TOTAL'
Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_TOTAL"'
Precision = 18
Size = 2
end
object cabeceraOBSERVACIONES: TMemoField
FieldName = 'OBSERVACIONES'
Origin = '"V_FACTURAS_CLIENTE"."OBSERVACIONES"'
ProviderFlags = [pfInUpdate]
BlobType = ftMemo
Size = 8
end
object cabeceraNIF_CIF: TIBStringField
FieldName = 'NIF_CIF'
Origin = '"V_FACTURAS_CLIENTE"."NIF_CIF"'
Size = 15
end
object cabeceraID_CLIENTE: TIntegerField
FieldName = 'ID_CLIENTE'
Origin = '"V_FACTURAS_CLIENTE"."ID_CLIENTE"'
end
object cabeceraNOMBRE: TIBStringField
FieldName = 'NOMBRE'
Origin = '"V_FACTURAS_CLIENTE"."NOMBRE"'
Size = 255
end
object cabeceraCALLE: TIBStringField
FieldName = 'CALLE'
Origin = '"V_FACTURAS_CLIENTE"."CALLE"'
Size = 255
end
object cabeceraPROVINCIA: TIBStringField
FieldName = 'PROVINCIA'
Origin = '"V_FACTURAS_CLIENTE"."PROVINCIA"'
Size = 255
end
object cabeceraPOBLACION: TIBStringField
FieldName = 'POBLACION'
Origin = '"V_FACTURAS_CLIENTE"."POBLACION"'
Size = 255
end
object cabeceraCODIGO_POSTAL: TIBStringField
FieldName = 'CODIGO_POSTAL'
Origin = '"V_FACTURAS_CLIENTE"."CODIGO_POSTAL"'
Size = 10
end
object cabeceraRECARGO_EQUIVALENCIA: TSmallintField
FieldName = 'RECARGO_EQUIVALENCIA'
Origin = '"V_FACTURAS_CLIENTE"."RECARGO_EQUIVALENCIA"'
end
object cabeceraIMPORTE_NETO: TIBBCDField
FieldName = 'IMPORTE_NETO'
Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_NETO"'
Precision = 18
Size = 2
end
object cabeceraIMPORTE_PORTE: TIBBCDField
FieldName = 'IMPORTE_PORTE'
Origin = '"V_FACTURAS_CLIENTE"."IMPORTE_PORTE"'
Precision = 18
Size = 2
end
object cabeceraFORMA_PAGO: TIBStringField
FieldName = 'FORMA_PAGO'
Origin = '"FORMAS_PAGO"."DESCRIPCION"'
Size = 255
end
object cabeceraDATOS_BANCARIOS: TIBStringField
FieldName = 'DATOS_BANCARIOS'
Origin = '"V_FACTURAS_CLIENTE"."DATOS_BANCARIOS"'
Size = 255
end
end
object detalles: TIBQuery
Database = IBDatabase1
Transaction = IBTransaction1
SQL.Strings = (
'SELECT'
' DET.ID, DET.ID_FACTURA, DET.POSICION, DET.TIPO_DETALLE, ARTI' +
'CULOS.REFERENCIA,'
' DET.CONCEPTO, DET.CANTIDAD, DET.IMPORTE_UNIDAD, DET.DESCUENT' +
'O,'
' DET.IMPORTE_TOTAL, DET.VISIBLE'
'FROM FACTURAS_CLIENTE_DETALLES DET'
'LEFT OUTER JOIN ARTICULOS ON (ARTICULOS.ID = DET.ID_ARTICULO)'
'WHERE DET.ID_FACTURA = 2 AND DET.VISIBLE = 1 '
'ORDER BY DET.ID_FACTURA, DET.POSICION;')
Left = 136
Top = 352
object detallesID: TIntegerField
FieldName = 'ID'
Origin = '"FACTURAS_CLIENTE_DETALLES"."ID"'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
Required = True
end
object detallesID_FACTURA: TIntegerField
FieldName = 'ID_FACTURA'
Origin = '"FACTURAS_CLIENTE_DETALLES"."ID_FACTURA"'
Required = True
end
object detallesPOSICION: TIntegerField
FieldName = 'POSICION'
Origin = '"FACTURAS_CLIENTE_DETALLES"."POSICION"'
end
object detallesTIPO_DETALLE: TIBStringField
FieldName = 'TIPO_DETALLE'
Origin = '"FACTURAS_CLIENTE_DETALLES"."TIPO_DETALLE"'
Size = 10
end
object detallesCONCEPTO: TIBStringField
FieldName = 'CONCEPTO'
Origin = '"FACTURAS_CLIENTE_DETALLES"."CONCEPTO"'
Size = 2000
end
object detallesCANTIDAD: TIntegerField
FieldName = 'CANTIDAD'
Origin = '"FACTURAS_CLIENTE_DETALLES"."CANTIDAD"'
end
object detallesIMPORTE_UNIDAD: TIBBCDField
FieldName = 'IMPORTE_UNIDAD'
Origin = '"FACTURAS_CLIENTE_DETALLES"."IMPORTE_UNIDAD"'
Precision = 18
Size = 2
end
object detallesDESCUENTO: TFloatField
FieldName = 'DESCUENTO'
Origin = '"FACTURAS_CLIENTE_DETALLES"."DESCUENTO"'
end
object detallesIMPORTE_TOTAL: TIBBCDField
FieldName = 'IMPORTE_TOTAL'
Origin = '"FACTURAS_CLIENTE_DETALLES"."IMPORTE_TOTAL"'
Precision = 18
Size = 2
end
object detallesVISIBLE: TSmallintField
FieldName = 'VISIBLE'
Origin = '"FACTURAS_CLIENTE_DETALLES"."VISIBLE"'
end
object detallesREFERENCIA: TIBStringField
FieldName = 'REFERENCIA'
Origin = '"ARTICULOS"."REFERENCIA"'
Size = 255
end
end
object DADSCabecera: TDADataSource
DataSet = tbl_Cabecera.Dataset
DataTable = tbl_Cabecera
Left = 264
Top = 72
end
object DADSDetalles: TDADataSource
DataSet = tbl_Detalles.Dataset
DataTable = tbl_Detalles
Left = 344
Top = 72
end
object tbl_Detalles: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID'
DataType = datInteger
InPrimaryKey = True
end
item
Name = 'ID_FACTURA'
DataType = datInteger
end
item
Name = 'POSICION'
DataType = datInteger
end
item
Name = 'TIPO_DETALLE'
DataType = datString
Size = 25
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'CONCEPTO'
DataType = datString
Size = 2000
end
item
Name = 'CANTIDAD'
DataType = datCurrency
end
item
Name = 'UNIDAD_MEDIDA'
DataType = datString
Size = 255
end
item
Name = 'IMPORTE_UNIDAD'
DataType = datCurrency
end
item
Name = 'DESCUENTO'
DataType = datFloat
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'VISIBLE'
DataType = datSmallInt
end>
Params = <
item
Name = 'ID_FACTURA'
DataType = datInteger
Value = '2'
ParamType = daptInput
end>
MasterParamsMappings.Strings = (
'ID_FACTURA=ID')
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeFacturasCliente_Detalles'
IndexDefs = <>
Left = 344
Top = 128
end
object tbl_Cabecera: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID'
DataType = datInteger
DictionaryEntry = 'FacturasCliente_ID'
InPrimaryKey = True
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_REFERENCIA'
end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
DictionaryEntry = 'FacturasCliente_FECHA_FACTURA'
end
item
Name = 'TIPO'
DataType = datString
Size = 1
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_BASE_IMPONIBLE'
end
item
Name = 'DESCUENTO'
DataType = datFloat
DictionaryEntry = 'FacturasCliente_DESCUENTO'
end
item
Name = 'IMPORTE_DESCUENTO'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO'
end
item
Name = 'IVA'
DataType = datFloat
DictionaryEntry = 'FacturasCliente_IVA'
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_IMPORTE_IVA'
end
item
Name = 'RE'
DataType = datFloat
end
item
Name = 'IMPORTE_RE'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
DictionaryEntry = 'FacturasCliente_IMPORTE_TOTAL'
end
item
Name = 'OBSERVACIONES'
DataType = datMemo
DictionaryEntry = 'FacturasCliente_OBSERVACIONES'
end
item
Name = 'FORMA_PAGO'
DataType = datString
Size = 255
end
item
Name = 'ID_CLIENTE'
DataType = datInteger
DictionaryEntry = 'FacturasCliente_ID_CLIENTE'
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
DictionaryEntry = 'FacturasCliente_NIF_CIF'
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_NOMBRE'
end
item
Name = 'CALLE'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_CALLE'
end
item
Name = 'PROVINCIA'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_PROVINCIA'
end
item
Name = 'CODIGO_POSTAL'
DataType = datString
Size = 10
DictionaryEntry = 'FacturasCliente_CODIGO_POSTAL'
end
item
Name = 'POBLACION'
DataType = datString
Size = 255
DictionaryEntry = 'FacturasCliente_POBLACION'
end
item
Name = 'TITULAR'
DataType = datString
Size = 255
end
item
Name = 'ENTIDAD'
DataType = datString
Size = 15
end
item
Name = 'SUCURSAL'
DataType = datString
Size = 15
end
item
Name = 'DC'
DataType = datString
Size = 15
end
item
Name = 'CUENTA'
DataType = datString
Size = 15
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
DictionaryEntry = 'FacturasCliente_ID_EMPRESA'
end
item
Name = 'NIF_CIF_EMPRESA'
DataType = datString
Size = 15
end
item
Name = 'RAZON_SOCIAL'
DataType = datString
Size = 255
end
item
Name = 'CALLE_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'POBLACION_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'PROVINCIA_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'CODIGO_POSTAL_EMPRESA'
DataType = datString
Size = 10
end
item
Name = 'TELEFONO_1'
DataType = datString
Size = 25
end
item
Name = 'FAX'
DataType = datString
Size = 25
end
item
Name = 'MOVIL_1'
DataType = datString
Size = 25
end
item
Name = 'EMAIL_1'
DataType = datString
Size = 255
end
item
Name = 'PAGINA_WEB'
DataType = datString
Size = 255
end
item
Name = 'REGISTRO_MERCANTIL'
DataType = datString
Size = 255
end
item
Name = 'LOGOTIPO'
DataType = datBlob
end
item
Name = 'IDIOMA_ISO'
DataType = datString
Size = 2
end
item
Name = 'PAIS'
DataType = datString
Size = 255
end>
Params = <
item
Name = 'ID'
DataType = datInteger
Value = '1'
ParamType = daptInput
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeFacturasCliente'
IndexDefs = <>
Left = 264
Top = 128
end
object frxCheckBoxObject1: TfrxCheckBoxObject
Left = 296
Top = 288
end
object frxChartObject1: TfrxChartObject
Left = 296
Top = 336
end
object frxGradientObject1: TfrxGradientObject
Left = 360
Top = 288
end
object frxCrossObject1: TfrxCrossObject
Left = 360
Top = 440
end
object frxOLEObject1: TfrxOLEObject
Left = 296
Top = 440
end
object frxBarCodeObject1: TfrxBarCodeObject
Left = 360
Top = 392
end
object frxRichObject1: TfrxRichObject
Left = 296
Top = 392
end
object frxReport: TfrxReport
Version = '4.7.71'
DotMatrixReport = False
EngineOptions.DoublePass = True
IniFile = '\Software\Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
PreviewOptions.OutlineWidth = 180
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = 'Default'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 37871.995398692100000000
ReportOptions.LastChange = 41807.760751527780000000
ReportOptions.VersionBuild = '1'
ReportOptions.VersionMajor = '12'
ReportOptions.VersionMinor = '13'
ReportOptions.VersionRelease = '1'
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'procedure DatosClienteOnBeforePrint(Sender: TfrxComponent);'
'var'
' ACadena : String; '
'begin'
' DatosCliente.Lines.Clear;'
' DatosCliente.Lines.Add(<frxDBCabecera."CALLE">);'
''
' if (<frxDBCabecera."CODIGO_POSTAL"> <> '#39#39')'
' or (<frxDBCabecera."POBLACION"> <> '#39#39') then'
' DatosCliente.Lines.Add(<frxDBCabecera."CODIGO_POSTAL"> + '#39' ' +
' '#39' + <frxDBCabecera."POBLACION">);'
''
' ACadena := '#39#39';'
' if (<frxDBCabecera."PROVINCIA"> <> '#39#39') then'
' ACadena := <frxDBCabecera."PROVINCIA">;'
''
' if (<frxDBCabecera."PAIS"> <> '#39#39') then'
' ACadena := ACadena + '#39' - '#39' + <frxDBCabecera."PAIS">;'
' '
' DatosCliente.Lines.Add(ACadena); '
'end;'
''
'procedure BandaDetallesOnBeforePrint(Sender: TfrxComponent);'
'begin'
' BandaDetalles.StartNewPage := False;'
' BandaDetalles.Visible := True;'
' MemPrecio.Style := '#39'Concepto normal'#39';'
' MemCantidad.Style := '#39'Concepto normal'#39';'
' MemImpTotal.Style := '#39'Concepto normal'#39';'
' RichConcepto.Visible := True;'
' MemImpTotal.HideZeros := True; '
''
' case <frxDBDetalles."TIPO_DETALLE"> of'
' '#39'Salto'#39': begin'
' BandaDetalles.StartNewPage := True;'
' RichConcepto.Visible := False;'
' end;'
' '#39'Titulo'#39': begin'
' MemPrecio.Style := '#39'Concepto titulo'#39';'
' MemCantidad.Style := '#39'Concepto titulo'#39';'
' MemImpTotal.Style := '#39'Concepto titulo'#39';'
' end;'
' '#39'Concepto'#39': begin'
' MemPrecio.Style := '#39'Concepto normal'#39';'
' MemCantidad.Style := '#39'Concepto normal'#39';'
' MemImpTotal.Style := '#39'Concepto normal'#39';'
' end;'
' '#39'Subtotal'#39': begin'
' MemPrecio.Style := '#39'Concepto subtotal'#39';'
' MemCantidad.Style := '#39'Concepto subtotal'#39';'
' MemImpTotal.Style := '#39'Concepto subtotal'#39';'
' MemImpTotal.HideZeros := False; '
' end;'
' '#39'Descuento'#39': begin'
' BandaDetalles.Visible := False;'
' RichConcepto.Color := clNone;'
' end;'
' end;'
''
' RichConcepto.Color := MemImpTotal.Color;'
' RichConcepto.Frame := MemImpTotal.Frame;'
'end;'
''
'procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);'
'begin'
' Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1' +
'.Height - 1;'
'end;'
''
'procedure Memo20OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if (StrToFloat(<frxDBCabecera."RE">) = 0) then'
' begin'
' Memo21.Lines.Clear;'
' Memo29.Lines.Clear;'
' end;'
'end;'
''
'procedure Band2OnBeforePrint(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);'
'end;'
''
'procedure Overlay1OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if <ShowLogotipo> then'
' begin'
' Overlay1.Visible := True; ' +
' '
' end'
' else'
' begin '
' Overlay1.Visible := False; '
' end '
'end;'
''
'begin'
''
'end.')
ShowProgress = False
StoreInDFM = False
OnGetValue = frxReportGetValue
OnStartReport = 'frxReportOnStartReport'
Left = 145
Top = 16
end
object frxDBVencimientos: TfrxDBDataset
UserName = 'frxDBVencimientos'
CloseDataSource = False
DataSource = DADSVencimientos
BCDToCurrency = False
Left = 440
Top = 16
end
object DADSVencimientos: TDADataSource
DataSet = tbl_Vencimientos.Dataset
DataTable = tbl_Vencimientos
Left = 440
Top = 72
end
object tbl_Vencimientos: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID_FACTURA'
DataType = datInteger
end
item
Name = 'FECHA_VENCIMIENTO'
DataType = datDateTime
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
Params = <
item
Name = 'ID_FACTURA'
Value = ''
ParamType = daptInput
end>
MasterParamsMappings.Strings = (
'ID_FACTURA=ID')
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeFacturasCliente_Vencimientos'
IndexDefs = <>
Left = 440
Top = 128
end
object vencimientos: TIBQuery
Database = IBDatabase1
Transaction = IBTransaction1
SQL.Strings = (
'SELECT'
' V_RECIBOS_CLIENTE.FECHA_VENCIMIENTO, V_RECIBOS_CLIENTE.IMPOR' +
'TE_TOTAL'
'FROM V_RECIBOS_CLIENTE'
'WHERE V_RECIBOS_CLIENTE.ID_FACTURA = 2'
'ORDER BY V_RECIBOS_CLIENTE.FECHA_VENCIMIENTO')
Left = 136
Top = 408
object vencimientosFECHA_VENCIMIENTO: TDateField
FieldName = 'FECHA_VENCIMIENTO'
Origin = '"V_RECIBOS_CLIENTE"."FECHA_VENCIMIENTO"'
end
object vencimientosIMPORTE_TOTAL: TIBBCDField
FieldKind = fkInternalCalc
FieldName = 'IMPORTE_TOTAL'
Origin = '"V_RECIBOS_CLIENTE"."IMPORTE_TOTAL"'
ProviderFlags = []
ReadOnly = True
Precision = 18
Size = 2
end
end
object DataSource3: TDataSource
DataSet = vencimientos
Left = 216
Top = 408
end
object frxPDFExport1: TfrxPDFExport
ShowDialog = False
UseFileCache = True
ShowProgress = False
OverwritePrompt = False
PrintOptimized = True
Outline = False
Background = False
HTMLTags = True
Author = 'FactuGES'
Subject = 'FactuGES'
Creator = 'FactuGES'
ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
HideToolbar = False
HideMenubar = False
HideWindowUI = False
FitWindow = False
CenterWindow = False
PrintScaling = False
Left = 424
Top = 288
end
object tbl_InformeListadoFacturas: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'TITULO'
DataType = datString
Size = 19
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'ID_CLIENTE'
DataType = datInteger
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'SITUACION'
DataType = datString
Size = 19
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
end
item
Name = 'FECHA_VENCIMIENTO'
DataType = datDateTime
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
Params = <>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoFacturas'
IndexDefs = <>
Left = 576
Top = 128
end
object DADSInformeListadoFacturas: TDADataSource
DataSet = tbl_InformeListadoFacturas.Dataset
DataTable = tbl_InformeListadoFacturas
Left = 576
Top = 72
end
object frxDBInformeListadoFacturas: TfrxDBDataset
UserName = 'frxDBInformeListadoFacturas'
CloseDataSource = False
DataSource = DADSInformeListadoFacturas
BCDToCurrency = False
Left = 576
Top = 16
end
object frxDBInformeListadoFacturasPendientes: TfrxDBDataset
UserName = 'frxDBInformeListadoFacturasPendientes'
CloseDataSource = False
DataSource = DADSInformeListadoFacturasPendientes
BCDToCurrency = False
Left = 792
Top = 16
end
object DADSInformeListadoFacturasPendientes: TDADataSource
DataSet = tbl_InformeListadoFacturasPendientes.Dataset
DataTable = tbl_InformeListadoFacturasPendientes
Left = 792
Top = 72
end
object tbl_InformeListadoFacturasPendientes: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'TITULO'
DataType = datString
Size = 19
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'ID_CLIENTE'
DataType = datInteger
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'SITUACION'
DataType = datString
Size = 19
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
end
item
Name = 'FECHA_VENCIMIENTO'
DataType = datDateTime
end
item
Name = 'BASE_IMPONIBLE'
DataType = datCurrency
end
item
Name = 'IMPORTE_IVA'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
Params = <>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoFacturasPendientes'
IndexDefs = <>
Left = 792
Top = 128
end
object frxDBInformeListadoFacturasResumen: TfrxDBDataset
UserName = 'frxDBInformeListadoFacturasResumen'
CloseDataSource = True
DataSource = DADSInformeListadoFacturasResumen
BCDToCurrency = False
Left = 576
Top = 216
end
object DADSInformeListadoFacturasResumen: TDADataSource
DataSet = tbl_InformeListadoFacturasResumen.Dataset
DataTable = tbl_InformeListadoFacturasResumen
Left = 576
Top = 272
end
object tbl_InformeListadoFacturasResumen: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <>
Params = <>
MasterMappingMode = mmDataRequest
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
IndexDefs = <>
Left = 576
Top = 328
end
object Bin2DataStreamer: TDABin2DataStreamer
Left = 48
Top = 88
end
object frxDBInformeListadoFacturasGrafComp: TfrxDBDataset
UserName = 'frxDBInformeListadoFacturasGrafComp'
CloseDataSource = False
DataSource = DASInformeListadoFacturasGrafComp
BCDToCurrency = False
Left = 824
Top = 224
end
object DASInformeListadoFacturasGrafComp: TDADataSource
Left = 824
Top = 272
end
object tbl_InformeListadoFacturasGrafCompMensual: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'VALOR'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ANO1'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL1'
DataType = datCurrency
end
item
Name = 'DIFERENCIA'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoFacturasGrafCompMensual'
IndexDefs = <>
Left = 824
Top = 328
end
object tbl_InformeListadoFacturasGrafCompTrimestral: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'VALOR'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ANO1'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL1'
DataType = datCurrency
end
item
Name = 'DIFERENCIA'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoFacturasGrafCompTrimestral'
IndexDefs = <>
Left = 824
Top = 384
end
object tbl_InformeListadoFacturasGrafCompSemestral: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'VALOR'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'ANO1'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'ANO2'
DataType = datSmallInt
end
item
Name = 'IMPORTE_TOTAL1'
DataType = datCurrency
end
item
Name = 'DIFERENCIA'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
Params = <
item
Name = 'ID_EMPRESA1'
Value = ''
end
item
Name = 'ANO1'
Value = ''
end
item
Name = 'ID_EMPRESA2'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoFacturasGrafCompSemestral'
IndexDefs = <>
Left = 824
Top = 440
end
object frxDBInformeListadoClientesMayorFacturacionResumen: TfrxDBDataset
UserName = 'frxDBInformeListadoClientesMayorFacturacionResumen'
CloseDataSource = False
DataSource = DADSInformeListadoClientesMayorFacturacionResumen
BCDToCurrency = False
Left = 320
Top = 488
end
object DADSInformeListadoClientesMayorFacturacionResumen: TDADataSource
DataSet = tbl_InformeListadoClientesMayorFacturacionResumen.Dataset
DataTable = tbl_InformeListadoClientesMayorFacturacionResumen
Left = 320
Top = 544
end
object tbl_InformeListadoClientesMayorFacturacionResumen: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'ANO1'
DataType = datLargeInt
end
item
Name = 'ANO2'
DataType = datLargeInt
end
item
Name = 'IMPORTE_TOTAL_ANO'
DataType = datCurrency
end
item
Name = 'NUMFAC'
DataType = datLargeInt
end
item
Name = 'IMPORTE_TOTAL_ANO1'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
Params = <
item
Name = 'ID_EMPRESA'
Value = ''
end
item
Name = 'ANO'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end
item
Name = 'NTOP'
Value = ''
end>
MasterMappingMode = mmDataRequest
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoClientesMayorFacturacionResumen'
IndexDefs = <>
Left = 320
Top = 600
end
object frxDBInformeListadoClientesMayorDescuentoResumen: TfrxDBDataset
UserName = 'frxDBInformeListadoClientesMayorDescuentoResumen'
CloseDataSource = False
DataSource = DADSInformeListadoClientesMayorDescuentoResumen
BCDToCurrency = False
Left = 624
Top = 488
end
object DADSInformeListadoClientesMayorDescuentoResumen: TDADataSource
DataSet = tbl_InformeListadoClientesMayorDescuentoResumen.Dataset
DataTable = tbl_InformeListadoClientesMayorDescuentoResumen
Left = 624
Top = 544
end
object tbl_InformeListadoClientesMayorDescuentoResumen: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'ANO1'
DataType = datLargeInt
end
item
Name = 'ANO2'
DataType = datLargeInt
end
item
Name = 'IMPORTE_DESCUENTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DESCUENTO2'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end
item
Name = 'IMPORTE_COBRADO'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datDecimal
end>
Params = <
item
Name = 'ID_EMPRESA'
Value = ''
end
item
Name = 'ANO'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end
item
Name = 'NTOP'
Value = ''
end>
MasterMappingMode = mmDataRequest
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoClientesMayorDescuentoResumen'
IndexDefs = <>
Left = 624
Top = 600
end
object frxDBInformeListadoAgentesMayorFacturacionResumen: TfrxDBDataset
UserName = 'frxDBInformeListadoAgentesMayorFacturacionResumen'
CloseDataSource = False
DataSource = DADInformeListadoAgentesMayorFacturacionResumen
BCDToCurrency = False
Left = 64
Top = 488
end
object DADInformeListadoAgentesMayorFacturacionResumen: TDADataSource
DataSet = tbl_InformeListadoAgentesMayorFacturacionResumen.Dataset
DataTable = tbl_InformeListadoAgentesMayorFacturacionResumen
Left = 64
Top = 544
end
object tbl_InformeListadoAgentesMayorFacturacionResumen: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'ANO1'
DataType = datLargeInt
end
item
Name = 'ANO2'
DataType = datLargeInt
end
item
Name = 'IMPORTE_TOTAL_ANO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_ANO1'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_ANO2'
DataType = datCurrency
end
item
Name = 'PORCENTAJE'
DataType = datCurrency
end>
Params = <
item
Name = 'ID_EMPRESA'
Value = ''
end
item
Name = 'ANO'
Value = ''
end
item
Name = 'ANO2'
Value = ''
end
item
Name = 'NTOP'
Value = ''
end>
MasterMappingMode = mmDataRequest
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoAgentesMayorFacturacionResumen'
IndexDefs = <>
Left = 64
Top = 600
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 = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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
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 = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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_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 = 'PORCENTAJE_BENEFICIOS_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 = 'PORCENTAJE_BENEFICIOS_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 DADSInformeObjetivos: TDADataSource
DataSet = tbl_InformeObjetivosMensual.Dataset
DataTable = tbl_InformeObjetivosMensual
Left = 152
Top = 152
end
object frxDBInformeObjetivos: TfrxDBDataset
UserName = 'frxDBInformeObjetivos'
CloseDataSource = False
DataSource = DADSInformeObjetivos
BCDToCurrency = False
Left = 152
Top = 96
end
object tbl_InformeObjetivosMensual: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'AGENTE'
DataType = datString
Size = 255
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'CLIENTES_TOTALES'
DataType = datInteger
end
item
Name = 'ALTAS_CLIENTE'
DataType = datLargeInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datLargeInt
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_UNIDAD'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_CLIENTE'
DataType = datCurrency
end>
Params = <
item
Name = 'ANO1'
Value = '2012'
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
Value = '1'
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoObjetivosMensual'
IndexDefs = <>
Left = 64
Top = 216
end
object tbl_InformeObjetivosTrimestral: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'AGENTE'
DataType = datString
Size = 255
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'TRIMESTRE'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'CLIENTES_TOTALES'
DataType = datInteger
end
item
Name = 'ALTAS_CLIENTE'
DataType = datLargeInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datLargeInt
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_UNIDAD'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_CLIENTE'
DataType = datCurrency
end>
Params = <
item
Name = 'ANO1'
Value = '2012'
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
Value = '1'
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoObjetivosTrimestral'
IndexDefs = <>
Left = 192
Top = 216
end
object tbl_InformeObjetivosSemestral: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'AGENTE'
DataType = datString
Size = 255
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'SEMESTRE'
DataType = datSmallInt
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 20
end
item
Name = 'CLIENTES_TOTALES'
DataType = datInteger
end
item
Name = 'ALTAS_CLIENTE'
DataType = datLargeInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datLargeInt
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_UNIDAD'
DataType = datCurrency
end
item
Name = 'IMPORTE_MEDIO_CLIENTE'
DataType = datCurrency
end>
Params = <
item
Name = 'ANO1'
Value = '2012'
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
Value = '1'
end>
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
LogicalName = 'InformeListadoObjetivosSemestral'
IndexDefs = <>
Left = 312
Top = 216
end
end