object srvContratosCliente: TsrvContratosCliente OldCreateOrder = True OnCreate = DARemoteServiceCreate ConnectionName = 'IBX' ServiceSchema = schContratosCliente ServiceDataStreamer = Bin2DataStreamer ExportedDataTables = <> Height = 230 Width = 346 object schContratosCliente: TDASchema ConnectionManager = dmServer.ConnectionManager DataDictionary = DADataDictionary Datasets = < item Params = <> Statements = < item Connection = 'IBX' ConnectionType = 'Interbase' Default = True TargetTable = 'PRESUPUESTOS_VALORES' Name = 'IBX' StatementType = stAutoSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end item DatasetField = 'ID_PROPIEDAD' TableField = 'ID_PROPIEDAD' end item DatasetField = 'DESCRIPCION' TableField = 'DESCRIPCION' end> end> Name = 'Valores' Fields = < item Name = 'ID' DataType = datInteger Required = True InPrimaryKey = True end item Name = 'ID_PROPIEDAD' DataType = datInteger end item Name = 'DESCRIPCION' DataType = datString Size = 2000 end> end item Params = <> Statements = < item Connection = 'IBX' ConnectionType = 'Interbase' Default = True TargetTable = 'PRESUPUESTOS_PROPIEDADES' Name = 'IBX' SQL = 'select ID,'#10' DESCRIPCION,'#10' case WHEN ID_PADRE IS NULL' + ' THEN ID'#10' ELSE ID_PADRE'#10' end AS ID_PROPIEDAD_VA' + 'LORES'#10#10'from presupuestos_propiedades'#10#10'WHERE {Where}'#10 StatementType = stSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end item DatasetField = 'DESCRIPCION' TableField = 'DESCRIPCION' end item DatasetField = 'ID_PROPIEDAD_VALORES' TableField = '' SQLOrigin = 'ID_PROPIEDAD_VALORES' end> end> Name = 'Propiedades' Fields = < item Name = 'ID' DataType = datInteger Required = True InPrimaryKey = True end item Name = 'DESCRIPCION' DataType = datString Size = 50 end item Name = 'ID_PROPIEDAD_VALORES' DataType = datInteger end> end item Params = <> Statements = < item Connection = 'IBX' ConnectionType = 'Interbase' Default = True Name = 'IBX' SQL = 'select ANO from'#10'(select distinct(substr(FECHA_CONTRATO, 1,4)) as' + ' ANO'#10'from contratos_cliente'#10'order by 1 desc)'#10#10'UNION ALL'#10#10'select ' + 'distinct '#39'Todos'#39' as ANO'#10'from empresas'#10 StatementType = stSQL ColumnMappings = < item DatasetField = 'ANO' TableField = 'ANO' end> end> Name = 'ListaAnosContratos' Fields = < item Name = 'ANO' DataType = datString Size = 254 end> end item Params = <> Statements = < item Connection = 'IBX' ConnectionType = 'Interbase' Default = True TargetTable = 'V_CONTRATOS_BENEFICIOS' Name = 'IBX' SQL = 'SELECT '#10' ID, REFERENCIA, FECHA_CONTRATO, NOMBRE, NIF_CIF, IMP' + 'ORTE_NETO, '#10' IMPORTE_DESCUENTO, BASE_IMPONIBLE, IMPORTE_FACTU' + 'RAS_PROVEEDOR, '#10' IMPORTE_BENEFICIO, PORCENTAJE_BENEFICIO'#10' FR' + 'OM'#10' V_CONTRATOS_BENEFICIOS'#10' WHERE {Where}' StatementType = stSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end item DatasetField = 'REFERENCIA' TableField = 'REFERENCIA' end item DatasetField = 'FECHA_CONTRATO' TableField = 'FECHA_CONTRATO' end item DatasetField = 'NOMBRE' TableField = 'NOMBRE' end item DatasetField = 'NIF_CIF' TableField = 'NIF_CIF' end item DatasetField = 'IMPORTE_NETO' TableField = 'IMPORTE_NETO' end item DatasetField = 'IMPORTE_DESCUENTO' TableField = 'IMPORTE_DESCUENTO' end item DatasetField = 'BASE_IMPONIBLE' TableField = 'BASE_IMPONIBLE' end item DatasetField = 'IMPORTE_FACTURAS_PROVEEDOR' TableField = 'IMPORTE_FACTURAS_PROVEEDOR' end item DatasetField = 'IMPORTE_BENEFICIO' TableField = 'IMPORTE_BENEFICIO' end item DatasetField = 'PORCENTAJE_BENEFICIO' TableField = 'PORCENTAJE_BENEFICIO' end> end> Name = 'ContratosClienteBeneficios' Fields = < item Name = 'ID' DataType = datInteger end item Name = 'REFERENCIA' DataType = datString Size = 255 end item Name = 'FECHA_CONTRATO' DataType = datDateTime end item Name = 'NOMBRE' DataType = datString Size = 255 end item Name = 'NIF_CIF' DataType = datString Size = 15 end item Name = 'IMPORTE_NETO' DataType = datCurrency end item Name = 'IMPORTE_DESCUENTO' DataType = datCurrency end item Name = 'BASE_IMPONIBLE' DataType = datCurrency end item Name = 'IMPORTE_FACTURAS_PROVEEDOR' DataType = datCurrency end item Name = 'IMPORTE_BENEFICIO' DataType = datCurrency end item Name = 'PORCENTAJE_BENEFICIO' DataType = datCurrency end> end item Params = <> Statements = < item Connection = 'IBX' Default = True TargetTable = 'V_CONTRATOS_CLIENTE' StatementType = stAutoSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end item DatasetField = 'ID_EMPRESA' TableField = 'ID_EMPRESA' end item DatasetField = 'ID_CLIENTE' TableField = 'ID_CLIENTE' end item DatasetField = 'NOMBRE_CLIENTE' TableField = 'NOMBRE_CLIENTE' end item DatasetField = 'NOMBRE_COMERCIAL_CLIENTE' TableField = 'NOMBRE_COMERCIAL_CLIENTE' end item DatasetField = 'NIF_CIF' TableField = 'NIF_CIF' end item DatasetField = 'NOMBRE' TableField = 'NOMBRE' end item DatasetField = 'CALLE' TableField = 'CALLE' end item DatasetField = 'POBLACION' TableField = 'POBLACION' end item DatasetField = 'PROVINCIA' TableField = 'PROVINCIA' end item DatasetField = 'CODIGO_POSTAL' TableField = 'CODIGO_POSTAL' end item DatasetField = 'REFERENCIA' TableField = 'REFERENCIA' end item DatasetField = 'FECHA_CONTRATO' TableField = 'FECHA_CONTRATO' end item DatasetField = 'SITUACION' TableField = 'SITUACION' end item DatasetField = 'FORMA_PAGO' TableField = 'FORMA_PAGO' end item DatasetField = 'PLAZO_ENTREGA' TableField = 'PLAZO_ENTREGA' end item DatasetField = 'OBSERVACIONES' TableField = 'OBSERVACIONES' end item DatasetField = 'INCIDENCIAS' TableField = 'INCIDENCIAS' end item DatasetField = 'INCIDENCIAS_ACTIVAS' TableField = 'INCIDENCIAS_ACTIVAS' end item DatasetField = 'FECHA_ALTA' TableField = 'FECHA_ALTA' end item DatasetField = 'FECHA_MODIFICACION' TableField = 'FECHA_MODIFICACION' end item DatasetField = 'USUARIO' TableField = 'USUARIO' end item DatasetField = 'RECARGO_EQUIVALENCIA' TableField = 'RECARGO_EQUIVALENCIA' end item DatasetField = 'RE' TableField = 'RE' end item DatasetField = 'IMPORTE_RE' TableField = 'IMPORTE_RE' end item DatasetField = 'ID_TIPO_IVA' TableField = 'ID_TIPO_IVA' end item DatasetField = 'IVA' TableField = 'IVA' end item DatasetField = 'IMPORTE_IVA' TableField = 'IMPORTE_IVA' end item DatasetField = 'IMPORTE_NETO' TableField = 'IMPORTE_NETO' end item DatasetField = 'IMPORTE_PORTE' TableField = 'IMPORTE_PORTE' end item DatasetField = 'ID_TIENDA' TableField = 'ID_TIENDA' end item DatasetField = 'TIENDA' TableField = 'TIENDA' 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 = 'IMPORTE_TOTAL' TableField = 'IMPORTE_TOTAL' end item DatasetField = 'ID_FORMA_PAGO' TableField = 'ID_FORMA_PAGO' end item DatasetField = 'ID_VENDEDOR' TableField = 'ID_VENDEDOR' end item DatasetField = 'VENDEDOR' TableField = 'VENDEDOR' end item DatasetField = 'PERSONA_CONTACTO' TableField = 'PERSONA_CONTACTO' end item DatasetField = 'REF_CLIENTE' TableField = 'REF_CLIENTE' end item DatasetField = 'TELEFONO' TableField = 'TELEFONO' end item DatasetField = 'MOVIL' TableField = 'MOVIL' end item DatasetField = 'ID_DIRECCION' TableField = 'ID_DIRECCION' end item DatasetField = 'TIPO_CONTRATO' TableField = 'TIPO_CONTRATO' end> end> Name = 'ContratosCliente' Fields = < item Name = 'ID' DataType = datAutoInc GeneratorName = 'GEN_PRESUPUESTOS_CLI_ID' ServerAutoRefresh = True DictionaryEntry = 'ContratosCliente_ID' InPrimaryKey = True end item Name = 'ID_EMPRESA' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_EMPRESA' end item Name = 'ID_CLIENTE' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_CLIENTE' end item Name = 'NOMBRE_CLIENTE' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_NOMBRE_CLIENTE' end item Name = 'REF_CLIENTE' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_REF_CLIENTE' end item Name = 'NOMBRE_COMERCIAL_CLIENTE' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_NOMBRE_COMERCIAL_CLIENTE' end item Name = 'NIF_CIF' DataType = datString Size = 15 ServerAutoRefresh = True DictionaryEntry = 'ContratosCliente_NIF_CIF' end item Name = 'NOMBRE' DataType = datString Size = 255 ServerAutoRefresh = True DictionaryEntry = 'ContratosCliente_NOMBRE' end item Name = 'ID_DIRECCION' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_DIRECCION' end item Name = 'CALLE' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_CALLE' end item Name = 'POBLACION' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_POBLACION' end item Name = 'PROVINCIA' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_PROVINCIA' end item Name = 'CODIGO_POSTAL' DataType = datString Size = 10 DictionaryEntry = 'ContratosCliente_CODIGO_POSTAL' end item Name = 'TELEFONO' DataType = datString Size = 25 DictionaryEntry = 'ContratosCliente_TELEFONO' end item Name = 'MOVIL' DataType = datString Size = 25 DictionaryEntry = 'ContratosCliente_MOVIL' end item Name = 'REFERENCIA' DataType = datString Size = 255 ServerAutoRefresh = True DictionaryEntry = 'ContratosCliente_REFERENCIA' end item Name = 'FECHA_CONTRATO' DataType = datDateTime DictionaryEntry = 'ContratosCliente_FECHA_CONTRATO' end item Name = 'SITUACION' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_SITUACION' end item Name = 'FORMA_PAGO' DataType = datMemo DictionaryEntry = 'ContratosCliente_FORMA_PAGO' end item Name = 'PLAZO_ENTREGA' DataType = datMemo DictionaryEntry = 'ContratosCliente_PLAZO_ENTREGA' end item Name = 'OBSERVACIONES' DataType = datMemo DictionaryEntry = 'ContratosCliente_OBSERVACIONES' end item Name = 'INCIDENCIAS' DataType = datMemo DictionaryEntry = 'ContratosCliente_INCIDENCIAS' end item Name = 'INCIDENCIAS_ACTIVAS' DataType = datInteger DictionaryEntry = 'ContratosCliente_INCIDENCIAS_ACTIVAS' end item Name = 'FECHA_ALTA' DataType = datDateTime DictionaryEntry = 'ContratosCliente_FECHA_ALTA' end item Name = 'FECHA_MODIFICACION' DataType = datDateTime DictionaryEntry = 'ContratosCliente_FECHA_MODIFICACION' end item Name = 'USUARIO' DataType = datString Size = 20 DictionaryEntry = 'ContratosCliente_USUARIO' end item Name = 'RECARGO_EQUIVALENCIA' DataType = datSmallInt DictionaryEntry = 'ContratosCliente_RECARGO_EQUIVALENCIA' end item Name = 'RE' DataType = datFloat DictionaryEntry = 'ContratosCliente_RE' end item Name = 'IMPORTE_RE' DataType = datCurrency DictionaryEntry = 'ContratosCliente_IMPORTE_RE' end item Name = 'ID_TIPO_IVA' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_TIPO_IVA' end item Name = 'IVA' DataType = datFloat DictionaryEntry = 'ContratosCliente_IVA' end item Name = 'IMPORTE_IVA' DataType = datCurrency DictionaryEntry = 'ContratosCliente_IMPORTE_IVA' end item Name = 'IMPORTE_NETO' DataType = datCurrency DictionaryEntry = 'ContratosCliente_IMPORTE_NETO' end item Name = 'IMPORTE_PORTE' DataType = datCurrency DictionaryEntry = 'ContratosCliente_IMPORTE_PORTE' end item Name = 'ID_TIENDA' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_TIENDA' end item Name = 'TIENDA' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_TIENDA' end item Name = 'BASE_IMPONIBLE' DataType = datCurrency DictionaryEntry = 'ContratosCliente_BASE_IMPONIBLE' end item Name = 'DESCUENTO' DataType = datFloat DictionaryEntry = 'ContratosCliente_DESCUENTO' end item Name = 'IMPORTE_DESCUENTO' DataType = datCurrency DictionaryEntry = 'ContratosCliente_IMPORTE_DESCUENTO' end item Name = 'IMPORTE_TOTAL' DataType = datCurrency DictionaryEntry = 'ContratosCliente_IMPORTE_TOTAL' end item Name = 'ID_FORMA_PAGO' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_FORMA_PAGO' end item Name = 'ID_VENDEDOR' DataType = datInteger DictionaryEntry = 'ContratosCliente_ID_VENDEDOR' end item Name = 'VENDEDOR' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_VENDEDOR' end item Name = 'PERSONA_CONTACTO' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_PERSONA_CONTACTO' end item Name = 'TIPO_CONTRATO' DataType = datString Size = 255 DictionaryEntry = 'ContratosCliente_TIPO_CONTRATO' end> end item Params = <> Statements = < item Connection = 'IBX' ConnectionType = 'Interbase' Default = True TargetTable = 'PRESUPUESTOS_CLIENTE_CAPITULOS' Name = 'IBX' StatementType = stAutoSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end item DatasetField = 'POSICION' TableField = 'POSICION' end item DatasetField = 'TIPO_DETALLE' TableField = 'TIPO_DETALLE' end item DatasetField = 'TIPO_ARTICULO' TableField = 'TIPO_ARTICULO' end item DatasetField = 'ID_ARTICULO' TableField = 'ID_ARTICULO' end item DatasetField = 'CONCEPTO' TableField = 'CONCEPTO' end> end> Name = 'TiposCapitulos' Description = 'No tocar es la lista de distintos capitulos existentes' Fields = < item Name = 'ID' DataType = datInteger Required = True InPrimaryKey = True end item Name = 'POSICION' DataType = datInteger end item Name = 'TIPO_DETALLE' DataType = datString Size = 10 end item Name = 'TIPO_ARTICULO' DataType = datString Size = 2 end item Name = 'ID_ARTICULO' DataType = datInteger end item Name = 'CONCEPTO' DataType = datString Size = 2000 end> end item Params = <> Statements = < item Connection = 'IBX' Default = True TargetTable = 'CONTRATOS_CLIENTE_DETALLES' SQL = 'SELECT'#10' CONTRATOS_CLIENTE_DETALLES.ID, CONTRATOS_CLIENTE_DETA' + 'LLES.ID_CONTRATO,'#10' CONTRATOS_CLIENTE_DETALLES.POSICION, CONTR' + 'ATOS_CLIENTE_DETALLES.TIPO_DETALLE,'#10' CONTRATOS_CLIENTE_DETALL' + 'ES.CONCEPTO, CONTRATOS_CLIENTE_DETALLES.CANTIDAD,'#10' CONTRATOS_' + 'CLIENTE_DETALLES.IMPORTE_UNIDAD, CONTRATOS_CLIENTE_DETALLES.IMPO' + 'RTE_TOTAL,'#10' CONTRATOS_CLIENTE_DETALLES.VISIBLE,'#10#10' CONTRATO' + 'S_CLIENTE_DETALLES.ID_ARTICULO, CONTRATOS_CLIENTE_DETALLES.TIPO_' + 'ARTICULO,'#10' CONTRATOS_CLIENTE_DETALLES.DESCUENTO,'#10' CONTRATO' + 'S_CLIENTE_DETALLES.IMPORTE_PORTE,'#10' PRESUPUESTOS_PROPIEDADES.D' + 'ESCRIPCION as REFERENCIA,'#10' '#39#39' as REFERENCIA_PROVEEDOR /*Es ne' + 'cesario para que no fallen los detalles porque los detalles son ' + 'comunes para la rama de cliente y de proveedor*/'#10#10'FROM CONTRATOS' + '_CLIENTE_DETALLES'#10'LEFT JOIN PRESUPUESTOS_PROPIEDADES ON (PRESUPU' + 'ESTOS_PROPIEDADES.ID = CONTRATOS_CLIENTE_DETALLES.ID_ARTICULO)'#10'w' + 'here {where}'#10'ORDER BY POSICION;'#10#10 StatementType = stSQL ColumnMappings = < item DatasetField = 'ID' TableField = 'ID' end item DatasetField = 'ID_CONTRATO' TableField = 'ID_CONTRATO' end item DatasetField = 'POSICION' TableField = 'POSICION' end item DatasetField = 'TIPO_DETALLE' TableField = 'TIPO_DETALLE' end item DatasetField = 'CONCEPTO' TableField = 'CONCEPTO' end item DatasetField = 'CANTIDAD' TableField = 'CANTIDAD' end item DatasetField = 'IMPORTE_UNIDAD' TableField = 'IMPORTE_UNIDAD' end item DatasetField = 'IMPORTE_TOTAL' TableField = 'IMPORTE_TOTAL' end item DatasetField = 'VISIBLE' TableField = 'VISIBLE' end item DatasetField = 'ID_ARTICULO' TableField = 'ID_ARTICULO' end item DatasetField = 'TIPO_ARTICULO' TableField = 'TIPO_ARTICULO' end item DatasetField = 'DESCUENTO' TableField = 'DESCUENTO' end item DatasetField = 'IMPORTE_PORTE' TableField = 'IMPORTE_PORTE' end item DatasetField = 'REFERENCIA' TableField = '' SQLOrigin = 'REFERENCIA' end item DatasetField = 'REFERENCIA_PROVEEDOR' TableField = '' SQLOrigin = 'REFERENCIA_PROVEEDOR' end> end> Name = 'ContratosCliente_Detalles' Fields = < item Name = 'ID' DataType = datAutoInc GeneratorName = 'GEN_PRESUPUESTOS_CLI_DETALLE_ID' InPrimaryKey = True end item Name = 'ID_CONTRATO' DataType = datInteger end item Name = 'POSICION' DataType = datInteger end item Name = 'TIPO_DETALLE' DataType = datString Size = 10 end item Name = 'CONCEPTO' DataType = datString Size = 2000 end item Name = 'CANTIDAD' DataType = datCurrency end item Name = 'IMPORTE_UNIDAD' DataType = datCurrency end item Name = 'IMPORTE_TOTAL' DataType = datCurrency end item Name = 'VISIBLE' DataType = datSmallInt end item Name = 'ID_ARTICULO' DataType = datInteger end item Name = 'TIPO_ARTICULO' DataType = datString Size = 2 end item Name = 'DESCUENTO' DataType = datFloat end item Name = 'IMPORTE_PORTE' DataType = datCurrency end item Name = 'REFERENCIA' DataType = datString Size = 50 end item Name = 'REFERENCIA_PROVEEDOR' DataType = datString end> end> JoinDataTables = <> UnionDataTables = <> Commands = < item Params = < item Name = 'TIPO_CONTRATO' DataType = datString Size = 255 Value = '' end item Name = 'ID' DataType = datAutoInc GeneratorName = 'GEN_CONTRATOS_CLI_ID' Value = '' end item Name = 'ID_CLIENTE' DataType = datInteger Value = '' end item Name = 'NIF_CIF' DataType = datString Size = 15 Value = '' end item Name = 'NOMBRE' DataType = datString Size = 255 Value = '' end item Name = 'ID_DIRECCION' DataType = datInteger Value = '' end item Name = 'CALLE' DataType = datString Size = 255 Value = '' end item Name = 'POBLACION' DataType = datString Size = 255 Value = '' end item Name = 'PROVINCIA' DataType = datString Size = 255 Value = '' end item Name = 'CODIGO_POSTAL' DataType = datString Size = 10 Value = '' end item Name = 'REFERENCIA' DataType = datString Size = 255 Value = '' end item Name = 'FECHA_CONTRATO' DataType = datDateTime Value = '' end item Name = 'SITUACION' DataType = datString Size = 255 Value = '' end item Name = 'FORMA_PAGO' DataType = datMemo Value = '' end item Name = 'PLAZO_ENTREGA' DataType = datMemo Value = '' end item Name = 'OBSERVACIONES' DataType = datMemo Value = '' end item Name = 'INCIDENCIAS' DataType = datMemo Value = '' end item Name = 'INCIDENCIAS_ACTIVAS' DataType = datSmallInt Value = '' end item Name = 'USUARIO' DataType = datString Size = 30 Value = '' end item Name = 'IMPORTE_NETO' DataType = datCurrency Value = '' end item Name = 'IMPORTE_PORTE' DataType = datCurrency Value = '' end item Name = 'DESCUENTO' DataType = datFloat Value = '' end item Name = 'IMPORTE_DESCUENTO' DataType = datCurrency Value = '' end item Name = 'BASE_IMPONIBLE' DataType = datCurrency Value = '' end item Name = 'ID_TIPO_IVA' DataType = datInteger Value = '' end item Name = 'IVA' DataType = datFloat Value = '' end item Name = 'IMPORTE_IVA' DataType = datCurrency Value = '' end item Name = 'IMPORTE_TOTAL' DataType = datCurrency Value = '' end item Name = 'ID_FORMA_PAGO' DataType = datInteger Value = '' end item Name = 'ID_TIENDA' DataType = datInteger Value = '' end item Name = 'ID_VENDEDOR' DataType = datInteger Value = '' end item Name = 'PERSONA_CONTACTO' DataType = datString Size = 255 Value = '' end item Name = 'RE' DataType = datFloat Value = '' end item Name = 'IMPORTE_RE' DataType = datCurrency Value = '' end item Name = 'RECARGO_EQUIVALENCIA' DataType = datSmallInt Value = '' end item Name = 'TELEFONO' DataType = datString Size = 25 Value = '' end item Name = 'MOVIL' DataType = datString Size = 25 Value = '' end> Statements = < item Connection = 'IBX' Default = True TargetTable = 'CONTRATOS_CLIENTE' SQL = 'INSERT'#10' INTO CONTRATOS_CLIENTE'#10' (ID, ID_CLIENTE, NIF_CIF, NO' + 'MBRE, ID_DIRECCION, CALLE, POBLACION, PROVINCIA,'#10' CODIGO_POS' + 'TAL, REFERENCIA, FECHA_CONTRATO, SITUACION, FORMA_PAGO,'#10' PLA' + 'ZO_ENTREGA, OBSERVACIONES, INCIDENCIAS, INCIDENCIAS_ACTIVAS, FEC' + 'HA_ALTA,'#10' USUARIO, IMPORTE_NETO, IMPORTE_PORTE, DESCUENTO, I' + 'MPORTE_DESCUENTO,'#10' BASE_IMPONIBLE, ID_TIPO_IVA, IVA, IMPORTE' + '_IVA,'#10' IMPORTE_TOTAL, ID_FORMA_PAGO, ID_TIENDA, ID_VENDEDOR,' + ' PERSONA_CONTACTO,'#10' RE, IMPORTE_RE, RECARGO_EQUIVALENCIA, TE' + 'LEFONO, MOVIL, TIPO_CONTRATO)'#10' VALUES'#10' (:ID, :ID_CLIENTE, :N' + 'IF_CIF, :NOMBRE, :ID_DIRECCION, :CALLE, :POBLACION, :PROVINCIA,'#10 + ' :CODIGO_POSTAL, :REFERENCIA, :FECHA_CONTRATO, :SITUACION, :' + 'FORMA_PAGO,'#10' :PLAZO_ENTREGA, :OBSERVACIONES, :INCIDENCIAS, :' + 'INCIDENCIAS_ACTIVAS, CURRENT_TIMESTAMP,'#10' :USUARIO, :IMPORTE_' + 'NETO, :IMPORTE_PORTE, :DESCUENTO, :IMPORTE_DESCUENTO,'#10' :BASE' + '_IMPONIBLE, :ID_TIPO_IVA, :IVA, :IMPORTE_IVA, :IMPORTE_TOTAL, :I' + 'D_FORMA_PAGO,'#10' :ID_TIENDA, :ID_VENDEDOR, :PERSONA_CONTACTO, ' + ':RE, :IMPORTE_RE, :RECARGO_EQUIVALENCIA,'#10' :TELEFONO, :MOVIL,' + ' :TIPO_CONTRATO)'#10#10 StatementType = stSQL ColumnMappings = <> end> Name = 'Insert_ContratosCliente' end item Params = < item Name = 'OLD_ID' DataType = datAutoInc Value = '0' end> Statements = < item Connection = 'IBX' Default = True TargetTable = 'CONTRATOS_CLIENTE' SQL = 'DELETE '#10' FROM'#10' CONTRATOS_CLIENTE'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> Name = 'Delete_ContratosCliente' end item Params = < item Name = 'TIPO_CONTRATO' DataType = datString Size = 255 Value = '' end item Name = 'ID' DataType = datInteger Value = '' end item Name = 'ID_CLIENTE' DataType = datInteger Value = '' end item Name = 'NIF_CIF' DataType = datString Size = 15 Value = '' end item Name = 'NOMBRE' DataType = datString Size = 255 Value = '' end item Name = 'ID_DIRECCION' DataType = datInteger Value = '' end item Name = 'CALLE' DataType = datString Size = 255 Value = '' end item Name = 'POBLACION' DataType = datString Size = 255 Value = '' end item Name = 'PROVINCIA' DataType = datString Size = 255 Value = '' end item Name = 'CODIGO_POSTAL' DataType = datString Size = 10 Value = '' end item Name = 'REFERENCIA' DataType = datString Size = 255 Value = '' end item Name = 'FECHA_CONTRATO' DataType = datDateTime Value = '' end item Name = 'SITUACION' DataType = datString Size = 255 Value = '' end item Name = 'FORMA_PAGO' DataType = datMemo Value = '' end item Name = 'PLAZO_ENTREGA' DataType = datMemo Value = '' end item Name = 'OBSERVACIONES' DataType = datMemo Value = '' end item Name = 'INCIDENCIAS' DataType = datMemo Value = '' end item Name = 'INCIDENCIAS_ACTIVAS' DataType = datSmallInt Value = '' end item Name = 'USUARIO' DataType = datString Size = 30 Value = '' end item Name = 'IMPORTE_NETO' DataType = datCurrency Value = '' end item Name = 'IMPORTE_PORTE' DataType = datCurrency Value = '' end item Name = 'DESCUENTO' DataType = datFloat Value = '' end item Name = 'IMPORTE_DESCUENTO' DataType = datCurrency Value = '' end item Name = 'BASE_IMPONIBLE' DataType = datCurrency Value = '' end item Name = 'ID_TIPO_IVA' DataType = datInteger Value = '' end item Name = 'IVA' DataType = datFloat Value = '' end item Name = 'IMPORTE_IVA' DataType = datCurrency Value = '' end item Name = 'IMPORTE_TOTAL' DataType = datCurrency Value = '' end item Name = 'ID_FORMA_PAGO' DataType = datInteger Value = '' end item Name = 'ID_TIENDA' DataType = datInteger Value = '' end item Name = 'ID_VENDEDOR' DataType = datInteger Value = '' end item Name = 'PERSONA_CONTACTO' DataType = datString Size = 255 Value = '' end item Name = 'RE' DataType = datFloat Value = '' end item Name = 'IMPORTE_RE' DataType = datCurrency Value = '' end item Name = 'RECARGO_EQUIVALENCIA' DataType = datSmallInt Value = '' end item Name = 'TELEFONO' DataType = datString Size = 25 Value = '' end item Name = 'MOVIL' DataType = datString Size = 25 Value = '' end item Name = 'OLD_ID' Value = '' end> Statements = < item Connection = 'IBX' TargetTable = 'CONTRATOS_CLIENTE' SQL = 'UPDATE CONTRATOS_CLIENTE'#10' SET '#10' ID = :ID,'#10' ID_CLIENTE = :' + 'ID_CLIENTE,'#10' NIF_CIF = :NIF_CIF,'#10' NOMBRE = :NOMBRE,'#10' ID' + '_DIRECCION = :ID_DIRECCION,'#10' CALLE = :CALLE,'#10' POBLACION = ' + ':POBLACION,'#10' PROVINCIA = :PROVINCIA,'#10' CODIGO_POSTAL = :COD' + 'IGO_POSTAL,'#10' REFERENCIA = :REFERENCIA,'#10' FECHA_CONTRATO = :' + 'FECHA_CONTRATO,'#10' SITUACION = :SITUACION,'#10' FORMA_PAGO = :FO' + 'RMA_PAGO,'#10' PLAZO_ENTREGA = :PLAZO_ENTREGA,'#10' OBSERVACIONES ' + '= :OBSERVACIONES,'#10' INCIDENCIAS = :INCIDENCIAS,'#10' INCIDENCIA' + 'S_ACTIVAS = :INCIDENCIAS_ACTIVAS,'#10' FECHA_MODIFICACION = CURRE' + 'NT_TIMESTAMP,'#10' USUARIO = :USUARIO,'#10' IMPORTE_NETO = :IMPORT' + 'E_NETO,'#10' IMPORTE_PORTE = :IMPORTE_PORTE,'#10' DESCUENTO = :DES' + 'CUENTO,'#10' IMPORTE_DESCUENTO = :IMPORTE_DESCUENTO,'#10' BASE_IMP' + 'ONIBLE = :BASE_IMPONIBLE,'#10' ID_TIPO_IVA = :ID_TIPO_IVA,'#10' IV' + 'A = :IVA,'#10' IMPORTE_IVA = :IMPORTE_IVA,'#10' IMPORTE_TOTAL = :I' + 'MPORTE_TOTAL,'#10' ID_FORMA_PAGO = :ID_FORMA_PAGO,'#10' ID_TIENDA ' + '= :ID_TIENDA,'#10' ID_VENDEDOR = :ID_VENDEDOR,'#10' PERSONA_CONTAC' + 'TO = :PERSONA_CONTACTO,'#10' RE = :RE,'#10' IMPORTE_RE = :IMPORTE_' + 'RE,'#10' RECARGO_EQUIVALENCIA = :RECARGO_EQUIVALENCIA,'#10' TELEFO' + 'NO = :TELEFONO,'#10' MOVIL = :MOVIL,'#10' TIPO_CONTRATO = :TIPO_CO' + 'NTRATO'#10' WHERE'#10' (ID = :OLD_ID)'#10#10 StatementType = stSQL ColumnMappings = <> end> Name = 'Update_ContratosCliente' end item Params = < item Name = 'ID' DataType = datAutoInc GeneratorName = 'GEN_CONTRATOS_CLI_DETALLE_ID' Value = '' end item Name = 'ID_CONTRATO' DataType = datInteger Value = '' end item Name = 'POSICION' DataType = datInteger Value = '' end item Name = 'TIPO_DETALLE' DataType = datString Size = 10 Value = '' end item Name = 'CONCEPTO' DataType = datString Size = 2000 Value = '' end item Name = 'CANTIDAD' DataType = datCurrency Value = '' end item Name = 'IMPORTE_UNIDAD' DataType = datCurrency Value = '' end item Name = 'IMPORTE_TOTAL' DataType = datCurrency Value = '' end item Name = 'VISIBLE' DataType = datSmallInt Value = '' end item Name = 'ID_ARTICULO' DataType = datInteger Value = '' end item Name = 'TIPO_ARTICULO' DataType = datString Size = 2 Value = '' end item Name = 'DESCUENTO' DataType = datFloat Value = '' end item Name = 'IMPORTE_PORTE' DataType = datCurrency Value = '' end> Statements = < item Connection = 'IBX' Default = True TargetTable = 'CONTRATOS_CLIENTE_DETALLES' SQL = 'INSERT'#10' INTO CONTRATOS_CLIENTE_DETALLES'#10' (ID, ID_CONTRATO, P' + 'OSICION, TIPO_DETALLE, CONCEPTO, CANTIDAD,'#10' IMPORTE_UNIDAD, ' + 'IMPORTE_TOTAL, VISIBLE, ID_ARTICULO, TIPO_ARTICULO,'#10' DESCUEN' + 'TO, IMPORTE_PORTE, FECHA_ALTA)'#10' VALUES'#10' (:ID, :ID_CONTRATO, ' + ':POSICION, :TIPO_DETALLE, :CONCEPTO,'#10' :CANTIDAD, :IMPORTE_UN' + 'IDAD, :IMPORTE_TOTAL, :VISIBLE,'#10' :ID_ARTICULO, :TIPO_ARTICUL' + 'O, :DESCUENTO, :IMPORTE_PORTE, CURRENT_TIMESTAMP)'#10 StatementType = stSQL ColumnMappings = <> end> Name = 'Insert_ContratosCliente_Detalles' end item Params = < item Name = 'OLD_ID' DataType = datAutoInc Value = '0' end> Statements = < item Connection = 'IBX' Default = True TargetTable = 'CONTRATOS_CLIENTE_DETALLES' SQL = 'DELETE '#10' FROM'#10' CONTRATOS_CLIENTE_DETALLES'#10' WHERE'#10' (ID = ' + ':OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> Name = 'Delete_ContratosCliente_Detalles' end item Params = < item Name = 'ID' DataType = datInteger Value = '' end item Name = 'ID_CONTRATO' DataType = datInteger Value = '' end item Name = 'POSICION' DataType = datInteger Value = '' end item Name = 'TIPO_DETALLE' DataType = datString Size = 10 Value = '' end item Name = 'CONCEPTO' DataType = datString Size = 2000 Value = '' end item Name = 'CANTIDAD' DataType = datCurrency Value = '' end item Name = 'IMPORTE_UNIDAD' DataType = datCurrency Value = '' end item Name = 'IMPORTE_TOTAL' DataType = datCurrency Value = '' end item Name = 'VISIBLE' DataType = datSmallInt Value = '' end item Name = 'ID_ARTICULO' DataType = datInteger Value = '' end item Name = 'TIPO_ARTICULO' DataType = datString Size = 2 Value = '' end item Name = 'DESCUENTO' DataType = datFloat Value = '' end item Name = 'IMPORTE_PORTE' DataType = datCurrency Value = '' end item Name = 'OLD_ID' Value = '' end> Statements = < item Connection = 'IBX' Default = True TargetTable = 'CONTRATOS_CLIENTE_DETALLES' SQL = 'UPDATE CONTRATOS_CLIENTE_DETALLES'#10' SET '#10' ID = :ID,'#10' ID_CO' + 'NTRATO = :ID_CONTRATO,'#10' POSICION = :POSICION, '#10' TIPO_DETAL' + 'LE = :TIPO_DETALLE, '#10' CONCEPTO = :CONCEPTO, '#10' CANTIDAD = :' + 'CANTIDAD, '#10' IMPORTE_UNIDAD = :IMPORTE_UNIDAD,'#10' IMPORTE_TOT' + 'AL = :IMPORTE_TOTAL, '#10' VISIBLE = :VISIBLE, '#10' ID_ARTICULO =' + ' :ID_ARTICULO, '#10' TIPO_ARTICULO = :TIPO_ARTICULO,'#10' DESCUENT' + 'O = :DESCUENTO, '#10' IMPORTE_PORTE = :IMPORTE_PORTE,'#10' FECHA_M' + 'ODIFICACION = CURRENT_TIMESTAMP'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> Name = 'Update_ContratosCliente_Detalles' end> RelationShips = < item Name = 'FK_Propiedades_Valores' MasterDatasetName = 'Propiedades' MasterFields = 'ID_PROPIEDAD_VALORES' DetailDatasetName = 'Valores' DetailFields = 'ID_PROPIEDAD' RelationshipType = rtForeignKey end item Name = 'FK_ContratosCliente_Detalles' MasterDatasetName = 'ContratosCliente' MasterFields = 'ID' DetailDatasetName = 'ContratosCliente_Detalles' DetailFields = 'ID_CONTRATO' RelationshipType = rtForeignKey end> UpdateRules = < item Name = 'Insert ContratosCliente' DoUpdate = False DoDelete = False DatasetName = 'ContratosCliente' FailureBehavior = fbRaiseException end item Name = 'Insert ContratosCliente_Detalles' DoUpdate = False DoDelete = False DatasetName = 'ContratosCliente_Detalles' FailureBehavior = fbRaiseException end item Name = 'Update ContratosCliente' DoInsert = False DoDelete = False DatasetName = 'ContratosCliente' FailureBehavior = fbRaiseException end item Name = 'Update ContratosCliente_Detalles' DoInsert = False DoDelete = False DatasetName = 'ContratosCliente_Detalles' FailureBehavior = fbRaiseException end item Name = 'Delete ContratosCliente_Detalles' DoUpdate = False DoInsert = False DatasetName = 'ContratosCliente_Detalles' FailureBehavior = fbRaiseException end item Name = 'Delete ContratosCliente' DoUpdate = False DoInsert = False DatasetName = 'ContratosCliente' FailureBehavior = fbRaiseException end> Version = 0 Left = 48 Top = 24 end object DADataDictionary: TDADataDictionary Fields = < item Name = 'ContratosCliente_ID' DataType = datAutoInc GeneratorName = 'GEN_PRESUPUESTOS_CLI_ID' Required = True DisplayLabel = 'ID' ServerAutoRefresh = True end item Name = 'ContratosCliente_ID_EMPRESA' DataType = datInteger DisplayLabel = 'ID_EMPRESA' end item Name = 'ContratosCliente_FECHA_DECISION' DataType = datDateTime DisplayLabel = 'Fecha decisi'#243'n' end item Name = 'ContratosCliente_REFERENCIA' DataType = datString Size = 255 DisplayLabel = 'Referencia' end item Name = 'ContratosCliente_SITUACION' DataType = datString Size = 255 DisplayLabel = 'Situaci'#243'n' end item Name = 'ContratosCliente_ID_CLIENTE' DataType = datInteger DisplayLabel = 'ID_CLIENTE' end item Name = 'ContratosCliente_NIF_CIF' DataType = datString Size = 15 DisplayLabel = 'NIF/CIF' end item Name = 'ContratosCliente_OBSERVACIONES' DataType = datMemo DisplayLabel = 'Observaciones' end item Name = 'ContratosCliente_INCIDENCIAS' DataType = datMemo DisplayLabel = 'INCIDENCIAS' end item Name = 'ContratosCliente_INCIDENCIAS_ACTIVAS' DataType = datInteger DisplayLabel = 'INCIDENCIAS_ACTIVAS' end item Name = 'ContratosCliente_FECHA_ALTA' DataType = datDateTime DisplayLabel = 'FECHA_ALTA' end item Name = 'ContratosCliente_FECHA_MODIFICACION' DataType = datDateTime DisplayLabel = 'FECHA_MODIFICACION' end item Name = 'ContratosCliente_USUARIO' DataType = datString Size = 20 DisplayLabel = 'USUARIO' end item Name = 'ContratosCliente_IMPORTE_NETO' DataType = datCurrency DisplayLabel = 'Importe neto' Alignment = taRightJustify end item Name = 'ContratosCliente_PERSONA_CONTACTO' DataType = datString Size = 255 DisplayLabel = 'Persona de contacto' end item Name = 'ContratosCliente_IMPORTE_PORTE' DataType = datCurrency DisplayLabel = 'Importe del porte' Alignment = taRightJustify end item Name = 'ContratosCliente_DESCUENTO' DataType = datFloat DisplayLabel = 'Descuento' DisplayFormat = ',0.00 %;-,0.00 %' Alignment = taRightJustify end item Name = 'ContratosCliente_IMPORTE_DESCUENTO' DataType = datCurrency DisplayLabel = 'Importe dto.' Alignment = taRightJustify end item Name = 'ContratosCliente_BASE_IMPONIBLE' DataType = datCurrency DisplayLabel = 'Base imponible' Alignment = taRightJustify end item Name = 'ContratosCliente_IVA' DataType = datFloat DisplayLabel = 'IVA' DisplayFormat = ',0.00 %;-,0.00 %' Alignment = taRightJustify end item Name = 'ContratosCliente_IMPORTE_IVA' DataType = datCurrency DisplayLabel = 'Importe IVA' Alignment = taRightJustify end item Name = 'ContratosCliente_IMPORTE_TOTAL' DataType = datCurrency DisplayLabel = 'Importe total' Alignment = taRightJustify end item Name = 'ContratosCliente_ID_FORMA_PAGO' DataType = datInteger DisplayLabel = 'ID_FORMA_PAGO' end item Name = 'ContratosCliente_Detalles_ID' DataType = datAutoInc GeneratorName = 'GEN_PRESUPUESTOS_CLI_DETALLE_ID' Required = True DisplayLabel = 'ID' ServerAutoRefresh = True end item Name = 'ContratosCliente_Detalles_ID_PRESUPUESTO' DataType = datInteger Required = True end item Name = 'ContratosCliente_Detalles_POSICION' DataType = datInteger DisplayLabel = 'POSICION' end item Name = 'ContratosCliente_Detalles_TIPO_DETALLE' DataType = datString Size = 25 DisplayLabel = 'TIPO_DETALLE' end item Name = 'ContratosCliente_Detalles_CONCEPTO' DataType = datString Size = 2000 DisplayLabel = 'Concepto' end item Name = 'ContratosCliente_Detalles_CANTIDAD' DataType = datFloat DisplayLabel = 'Cantidad' Alignment = taRightJustify end item Name = 'ContratosCliente_Detalles_IMPORTE_UNIDAD' DataType = datCurrency DisplayLabel = 'Importe unidad' Alignment = taRightJustify end item Name = 'ContratosCliente_Detalles_IMPORTE_TOTAL' DataType = datCurrency DisplayLabel = 'Importe total' Alignment = taRightJustify end item Name = 'ContratosCliente_Detalles_VISIBLE' DataType = datInteger DisplayLabel = 'VISIBLE' end item Name = 'ContratosCliente_Detalles_ID_ARTICULO' DataType = datInteger DisplayLabel = 'ID_ARTICULO' end item Name = 'ContratosCliente_Detalles_DESCUENTO' DataType = datFloat DisplayLabel = 'Descuento' DisplayFormat = ',0.00 %;-,0.00 %' Alignment = taRightJustify end item Name = 'ContratosCliente_Detalles_IMPORTE_PORTE' DataType = datCurrency DisplayLabel = 'Importe porte' Alignment = taRightJustify end item Name = 'ContratosCliente_Detalles_REFERENCIA' DataType = datString Size = 255 DisplayLabel = 'Referencia' end item Name = 'ContratosCliente_Detalles_REFERENCIA_PROVEEDOR' DataType = datString Size = 255 DisplayLabel = 'Ref. proveedor' end item Name = 'ContratosCliente_Detalles_UNIDAD_MEDIDA' DataType = datString Size = 255 DisplayLabel = 'Unidad de medida' end item Name = 'ContratosCliente_CALLE' DataType = datString Size = 255 DisplayLabel = 'Calle' end item Name = 'ContratosCliente_POBLACION' DataType = datString Size = 255 DisplayLabel = 'Poblaci'#243'n' end item Name = 'ContratosCliente_PROVINCIA' DataType = datString Size = 255 end item Name = 'ContratosCliente_CODIGO_POSTAL' DataType = datString Size = 10 DisplayLabel = 'C'#243'd. postal' end item Name = 'ContratosCliente_TELEFONO' DataType = datString Size = 25 DisplayLabel = 'Tel'#233'fono' end item Name = 'ContratosCliente_MOVIL' DataType = datString Size = 25 DisplayLabel = 'M'#243'vil' end item Name = 'ContratosCliente_FECHA_CONTRATO' DataType = datDateTime DisplayLabel = 'Fecha contrato' end item Name = 'ContratosCliente_FORMA_PAGO' DataType = datMemo end item Name = 'ContratosCliente_RECARGO_EQUIVALENCIA' DataType = datSmallInt end item Name = 'ContratosCliente_RE' DataType = datFloat end item Name = 'ContratosCliente_IMPORTE_RE' DataType = datCurrency DisplayLabel = 'Importe RE' end item Name = 'ContratosCliente_ID_TIPO_IVA' DataType = datInteger end item Name = 'ContratosCliente_ID_TIENDA' DataType = datInteger end item Name = 'ContratosCliente_TIENDA' DataType = datString Size = 255 end item Name = 'ContratosCliente_ID_VENDEDOR' DataType = datInteger end item Name = 'ContratosCliente_VENDEDOR' DataType = datString Size = 255 DisplayLabel = 'Vendedor' end item Name = 'ContratosCliente_REF_CLIENTE' DataType = datString Size = 255 DisplayLabel = 'Ref. Cliente' end item Name = 'ContratosCliente_NOMBRE_CLIENTE' DataType = datString Size = 255 end item Name = 'ContratosCliente_NOMBRE_COMERCIAL_CLIENTE' DataType = datString Size = 255 end item Name = 'ContratosCliente_NOMBRE' DataType = datString Size = 255 ServerAutoRefresh = True end item Name = 'ContratosCliente_PLAZO_ENTREGA' DataType = datMemo end item Name = 'ContratosCliente_ID_DIRECCION' DataType = datInteger end item Name = 'ContratosCliente_TIPO_CONTRATO' DataType = datString Size = 255 DisplayLabel = 'Tipo' end> Left = 48 Top = 152 end object Bin2DataStreamer: TDABin2DataStreamer Left = 48 Top = 88 end object bpContratosCliente: TDABusinessProcessor Schema = schContratosCliente InsertCommandName = 'Insert_ContratosCliente' DeleteCommandName = 'Delete_ContratosCliente' UpdateCommandName = 'Update_ContratosCliente' ReferencedDataset = 'ContratosCliente' ProcessorOptions = [poAutoGenerateRefreshDataset, poPrepareCommands] UpdateMode = updWhereKeyOnly Left = 232 Top = 24 end object bpContratosClienteDetalles: TDABusinessProcessor Schema = schContratosCliente InsertCommandName = 'Insert_ContratosCliente_Detalles' DeleteCommandName = 'Delete_ContratosCliente_Detalles' UpdateCommandName = 'Update_ContratosCliente_Detalles' ReferencedDataset = 'ContratosCliente_Detalles' ProcessorOptions = [poAutoGenerateRefreshDataset, poPrepareCommands] UpdateMode = updWhereKeyOnly Left = 232 Top = 96 end end