object srvPedidosCliente: TsrvPedidosCliente
  OldCreateOrder = True
  OnCreate = DARemoteServiceCreate
  RequiresSession = True
  SessionManager = dmServer.SessionManager
  AcquireConnection = True
  ConnectionName = 'IBX'
  ServiceSchema = schPedidosCliente
  ServiceAdapter = DABINAdapter
  OnBeforeAcquireConnection = DARemoteServiceBeforeAcquireConnection
  OnBeforeGetDatasetData = DARemoteServiceBeforeGetDatasetData
  Height = 247
  Width = 347
  object schPedidosCliente: TDASchema
    ConnectionManager = dmServer.ConnectionManager
    DataDictionary = DADataDictionary
    Datasets = <
      item
        Params = <
          item
            Name = 'ID_PEDIDO'
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            SQL = 
              'SELECT '#10'    ID_PEDIDO, ID_ARTICULO, CANT_PEDIDA_CLIENTE, ID_PROV' +
              'EEDOR, '#10'    CANT_PEDIDA_PROVEEDOR, CANT_PENDIENTE_PEDIR'#10'  FROM'#10' ' +
              '   V_PED_CLI_ART_PEND_PEDIR_PROV'#10'  WHERE ID_PEDIDO = :ID_PEDIDO'
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_PEDIDO'
                TableField = 'ID_PEDIDO'
              end
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'CANT_PEDIDA_CLIENTE'
                TableField = 'CANT_PEDIDA_CLIENTE'
              end
              item
                DatasetField = 'ID_PROVEEDOR'
                TableField = 'ID_PROVEEDOR'
              end
              item
                DatasetField = 'CANT_PEDIDA_PROVEEDOR'
                TableField = 'CANT_PEDIDA_PROVEEDOR'
              end
              item
                DatasetField = 'CANT_PENDIENTE_PEDIR'
                TableField = 'CANT_PENDIENTE_PEDIR'
              end>
          end>
        Name = 'PedidoCliente_ArticulosPendientesPedirAProv'
        Fields = <
          item
            Name = 'ID_PEDIDO'
            DataType = datAutoInc
            BlobType = dabtUnknown
            DictionaryEntry = 'DarArticulosPendientesPedirAProv_ID_PEDIDO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'DarArticulosPendientesPedirAProv_ID_ARTICULO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANT_PEDIDA_CLIENTE'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'DarArticulosPendientesPedirAProv_CANT_PEDIDA_CLIENTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_PROVEEDOR'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'DarArticulosPendientesPedirAProv_ID_PROVEEDOR'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANT_PEDIDA_PROVEEDOR'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'DarArticulosPendientesPedirAProv_CANT_PEDIDA_PROVEEDOR'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANT_PENDIENTE_PEDIR'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'DarArticulosPendientesPedirAProv_CANT_PENDIENTE_PEDIR'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end
      item
        Params = <
          item
            Name = 'CODIGO'
            DataType = datString
            Size = 50
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'REFERENCIAS'
            SQL = 
              'SELECT'#10'      VALOR'#10'FROM'#10'    REFERENCIAS'#10'WHERE'#10'     CODIGO = :COD' +
              'IGO'#10'AND ID_EMPRESA = :ID_EMPRESA'
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'VALOR'
                TableField = 'VALOR'
              end>
          end>
        Name = 'DarReferencia'
        Fields = <
          item
            Name = 'VALOR'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DisplayWidth = 0
            Alignment = taLeftJustify
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE'
            SQL = 
              'SELECT ID,'#10'       ID_EMPRESA,'#10'       ID_CLIENTE,'#10'       NOMBRE,'#10 +
              '       REFERENCIA,'#10'       REFERENCIA_CLIENTE,'#10'       SITUACION,'#10 +
              '       FECHA_PEDIDO,'#10'       CALLE,'#10'       CODIGO_POSTAL,'#10'       ' +
              'POBLACION,'#10'       PROVINCIA,'#10'       PERSONA_CONTACTO,'#10'       TEL' +
              'EFONO,'#10'       OBSERVACIONES,'#10'       INCIDENCIAS,'#10'       INCIDENC' +
              'IAS_ACTIVAS,'#10'       FECHA_ALTA,'#10'       FECHA_MODIFICACION,'#10'     ' +
              '  USUARIO,'#10'       IMPORTE_NETO,'#10'       IMPORTE_PORTE,'#10'       DES' +
              'CUENTO,'#10'       IMPORTE_DESCUENTO,'#10'       BASE_IMPONIBLE,'#10'       ' +
              'IVA,'#10'       IMPORTE_IVA,'#10'       IMPORTE_TOTAL,'#10'       ID_FORMA_P' +
              'AGO,'#10'       REF_TIENDA_WEB,'#10'       FECHA_PREVISTA_ENVIO,'#10'       ' +
              'NUM_COPIAS'#10'FROM V_PEDIDOS_CLIENTE'
            StatementType = stSQL
            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'
                TableField = 'NOMBRE'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'REFERENCIA_CLIENTE'
                TableField = 'REFERENCIA_CLIENTE'
              end
              item
                DatasetField = 'SITUACION'
                TableField = 'SITUACION'
              end
              item
                DatasetField = 'FECHA_PEDIDO'
                TableField = 'FECHA_PEDIDO'
              end
              item
                DatasetField = 'CALLE'
                TableField = 'CALLE'
              end
              item
                DatasetField = 'CODIGO_POSTAL'
                TableField = 'CODIGO_POSTAL'
              end
              item
                DatasetField = 'POBLACION'
                TableField = 'POBLACION'
              end
              item
                DatasetField = 'PROVINCIA'
                TableField = 'PROVINCIA'
              end
              item
                DatasetField = 'PERSONA_CONTACTO'
                TableField = 'PERSONA_CONTACTO'
              end
              item
                DatasetField = 'TELEFONO'
                TableField = 'TELEFONO'
              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 = 'IMPORTE_NETO'
                TableField = 'IMPORTE_NETO'
              end
              item
                DatasetField = 'IMPORTE_PORTE'
                TableField = 'IMPORTE_PORTE'
              end
              item
                DatasetField = 'DESCUENTO'
                TableField = 'DESCUENTO'
              end
              item
                DatasetField = 'IMPORTE_DESCUENTO'
                TableField = 'IMPORTE_DESCUENTO'
              end
              item
                DatasetField = 'BASE_IMPONIBLE'
                TableField = 'BASE_IMPONIBLE'
              end
              item
                DatasetField = 'IVA'
                TableField = 'IVA'
              end
              item
                DatasetField = 'IMPORTE_IVA'
                TableField = 'IMPORTE_IVA'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'ID_FORMA_PAGO'
                TableField = 'ID_FORMA_PAGO'
              end
              item
                DatasetField = 'REF_TIENDA_WEB'
                TableField = 'REF_TIENDA_WEB'
              end
              item
                DatasetField = 'FECHA_PREVISTA_ENVIO'
                TableField = 'FECHA_PREVISTA_ENVIO'
              end
              item
                DatasetField = 'NUM_COPIAS'
                TableField = 'NUM_COPIAS'
              end>
          end>
        Name = 'PedidosCliente'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID'
            InPrimaryKey = True
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID_EMPRESA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_CLIENTE'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID_CLIENTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'NOMBRE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_NOMBRE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_REFERENCIA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA_CLIENTE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_REFERENCIA_CLIENTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'SITUACION'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_SITUACION'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_PEDIDO'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_PEDIDO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CALLE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_CALLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CODIGO_POSTAL'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_CODIGO_POSTAL'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'POBLACION'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_POBLACION'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'PROVINCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_PROVINCIA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'PERSONA_CONTACTO'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_PERSONA_CONTACTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'TELEFONO'
            DataType = datString
            Size = 25
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_TELEFONO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'OBSERVACIONES'
            DataType = datMemo
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_OBSERVACIONES'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'INCIDENCIAS'
            DataType = datMemo
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_INCIDENCIAS'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'INCIDENCIAS_ACTIVAS'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_INCIDENCIAS_ACTIVAS'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_ALTA'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_ALTA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_MODIFICACION'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_MODIFICACION'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'USUARIO'
            DataType = datString
            Size = 20
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_USUARIO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_NETO'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_NETO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_PORTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_DESCUENTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_DESCUENTO'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_DESCUENTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'BASE_IMPONIBLE'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_BASE_IMPONIBLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IVA'
            DataType = datFloat
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IVA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_IVA'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_IVA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_TOTAL'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_FORMA_PAGO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID_FORMA_PAGO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REF_TIENDA_WEB'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_REF_TIENDA_WEB'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_PREVISTA_ENVIO'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_PREVISTA_ENVIO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'NUM_COPIAS'
            DataType = datInteger
            BlobType = dabtUnknown
            DisplayWidth = 0
            Alignment = taLeftJustify
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end
      item
        Params = <
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE_DETALLES'
            SQL = 
              'SELECT PEDIDOS_CLIENTE_DETALLES.ID,'#10'       PEDIDOS_CLIENTE_DETAL' +
              'LES.ID_PEDIDO,'#10'       PEDIDOS_CLIENTE_DETALLES.POSICION,'#10'       ' +
              'PEDIDOS_CLIENTE_DETALLES.TIPO_DETALLE,'#10'       PEDIDOS_CLIENTE_DE' +
              'TALLES.ID_ARTICULO,'#10'       ARTICULOS.REFERENCIA,'#10'       ARTICULO' +
              'S.REFERENCIA_PROV as REFERENCIA_PROVEEDOR,'#10'       PEDIDOS_CLIENT' +
              'E_DETALLES.CONCEPTO,'#10'       PEDIDOS_CLIENTE_DETALLES.CANTIDAD,'#10' ' +
              '      PEDIDOS_CLIENTE_DETALLES.IMPORTE_UNIDAD,'#10'       PEDIDOS_CL' +
              'IENTE_DETALLES.DESCUENTO,'#10'       PEDIDOS_CLIENTE_DETALLES.IMPORT' +
              'E_PORTE,'#10'       PEDIDOS_CLIENTE_DETALLES.IMPORTE_TOTAL,'#10'       P' +
              'EDIDOS_CLIENTE_DETALLES.VISIBLE'#10'FROM PEDIDOS_CLIENTE_DETALLES'#10'  ' +
              '   LEFT JOIN ARTICULOS ON PEDIDOS_CLIENTE_DETALLES.ID_ARTICULO =' +
              ' ARTICULOS.ID'#10'WHERE'#10'     PEDIDOS_CLIENTE_DETALLES.ID_PEDIDO = :I' +
              'D_PEDIDO'#10'ORDER BY POSICION;'
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'CANTIDAD'
                TableField = 'CANTIDAD'
              end
              item
                DatasetField = 'POSICION'
                TableField = 'POSICION'
              end
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'TIPO_DETALLE'
                TableField = 'TIPO_DETALLE'
              end
              item
                DatasetField = 'CONCEPTO'
                TableField = 'CONCEPTO'
              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_PEDIDO'
                TableField = 'ID_PEDIDO'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'DESCUENTO'
                TableField = 'DESCUENTO'
              end
              item
                DatasetField = 'REFERENCIA_PROVEEDOR'
                TableField = 'REFERENCIA_PROVEEDOR'
              end
              item
                DatasetField = 'IMPORTE_PORTE'
                TableField = 'IMPORTE_PORTE'
              end>
          end>
        Name = 'PedidosCliente_Detalles'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_ID'
            InPrimaryKey = True
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_ID_PEDIDO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'POSICION'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'POSICIONCONCEPTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'TIPO_DETALLE'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_TIPO_DETALLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_REFERENCIA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_ID_ARTICULO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 2000
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_CONCEPTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANTIDAD'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'CANTIDAD'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_UNIDAD'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_IMPORTE_UNIDAD'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_IMPORTE_TOTAL'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_DESCUENTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_IMPORTE_PORTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'VISIBLE'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_VISIBLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA_PROVEEDOR'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_REFERENCIA_PROVEEDOR'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE'
            SQL = 
              'SELECT ID,'#10'       ID_EMPRESA,'#10'       ID_CLIENTE,'#10'       NOMBRE,'#10 +
              '       REFERENCIA,'#10'       REFERENCIA_CLIENTE,'#10'       SITUACION,'#10 +
              '       FECHA_PEDIDO,'#10'       CALLE,'#10'       CODIGO_POSTAL,'#10'       ' +
              'POBLACION,'#10'       PROVINCIA,'#10'       PERSONA_CONTACTO,'#10'       TEL' +
              'EFONO,'#10'       OBSERVACIONES,'#10'       INCIDENCIAS,'#10'       INCIDENC' +
              'IAS_ACTIVAS,'#10'       FECHA_ALTA,'#10'       FECHA_MODIFICACION,'#10'     ' +
              '  USUARIO,'#10'       IMPORTE_NETO,'#10'       IMPORTE_PORTE,'#10'       DES' +
              'CUENTO,'#10'       IMPORTE_DESCUENTO,'#10'       BASE_IMPONIBLE,'#10'       ' +
              'IVA,'#10'       IMPORTE_IVA,'#10'       IMPORTE_TOTAL,'#10'       ID_FORMA_P' +
              'AGO,'#10'       REF_TIENDA_WEB,'#10'       FECHA_PREVISTA_ENVIO,'#10'       ' +
              'NUM_COPIAS'#10'FROM V_PEDIDOS_CLIENTE'#10'WHERE'#10'     ID = :ID'
            StatementType = stSQL
            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'
                TableField = 'NOMBRE'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'REFERENCIA_CLIENTE'
                TableField = 'REFERENCIA_CLIENTE'
              end
              item
                DatasetField = 'SITUACION'
                TableField = 'SITUACION'
              end
              item
                DatasetField = 'FECHA_PEDIDO'
                TableField = 'FECHA_PEDIDO'
              end
              item
                DatasetField = 'CALLE'
                TableField = 'CALLE'
              end
              item
                DatasetField = 'CODIGO_POSTAL'
                TableField = 'CODIGO_POSTAL'
              end
              item
                DatasetField = 'POBLACION'
                TableField = 'POBLACION'
              end
              item
                DatasetField = 'PROVINCIA'
                TableField = 'PROVINCIA'
              end
              item
                DatasetField = 'PERSONA_CONTACTO'
                TableField = 'PERSONA_CONTACTO'
              end
              item
                DatasetField = 'TELEFONO'
                TableField = 'TELEFONO'
              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 = 'IMPORTE_NETO'
                TableField = 'IMPORTE_NETO'
              end
              item
                DatasetField = 'IMPORTE_PORTE'
                TableField = 'IMPORTE_PORTE'
              end
              item
                DatasetField = 'DESCUENTO'
                TableField = 'DESCUENTO'
              end
              item
                DatasetField = 'IMPORTE_DESCUENTO'
                TableField = 'IMPORTE_DESCUENTO'
              end
              item
                DatasetField = 'BASE_IMPONIBLE'
                TableField = 'BASE_IMPONIBLE'
              end
              item
                DatasetField = 'IVA'
                TableField = 'IVA'
              end
              item
                DatasetField = 'IMPORTE_IVA'
                TableField = 'IMPORTE_IVA'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'ID_FORMA_PAGO'
                TableField = 'ID_FORMA_PAGO'
              end
              item
                DatasetField = 'REF_TIENDA_WEB'
                TableField = 'REF_TIENDA_WEB'
              end
              item
                DatasetField = 'FECHA_PREVISTA_ENVIO'
                TableField = 'FECHA_PREVISTA_ENVIO'
              end
              item
                DatasetField = 'NUM_COPIAS'
                TableField = 'NUM_COPIAS'
              end>
          end>
        Name = 'PedidosCliente_Refresh'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID'
            InPrimaryKey = True
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID_EMPRESA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_CLIENTE'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID_CLIENTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'NOMBRE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_NOMBRE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DisplayWidth = 0
            DisplayLabel = 'Referencia'
            Alignment = taLeftJustify
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA_CLIENTE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DisplayWidth = 0
            Alignment = taLeftJustify
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'SITUACION'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DisplayWidth = 0
            DisplayLabel = 'Situaci'#243'n'
            Alignment = taLeftJustify
            ServerAutoRefresh = True
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_PEDIDO'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_PEDIDO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CALLE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_CALLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CODIGO_POSTAL'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_CODIGO_POSTAL'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'POBLACION'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_POBLACION'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'PROVINCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_PROVINCIA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'PERSONA_CONTACTO'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_PERSONA_CONTACTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'TELEFONO'
            DataType = datString
            Size = 25
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_TELEFONO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'OBSERVACIONES'
            DataType = datMemo
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_OBSERVACIONES'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'INCIDENCIAS'
            DataType = datMemo
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_INCIDENCIAS'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'INCIDENCIAS_ACTIVAS'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_INCIDENCIAS_ACTIVAS'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_ALTA'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_ALTA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_MODIFICACION'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_MODIFICACION'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'USUARIO'
            DataType = datString
            Size = 20
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_USUARIO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_NETO'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_NETO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_PORTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_DESCUENTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_DESCUENTO'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_DESCUENTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'BASE_IMPONIBLE'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_BASE_IMPONIBLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IVA'
            DataType = datFloat
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IVA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_IVA'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_IVA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_IMPORTE_TOTAL'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_FORMA_PAGO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_ID_FORMA_PAGO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REF_TIENDA_WEB'
            DataType = datInteger
            BlobType = dabtUnknown
            DisplayWidth = 0
            Alignment = taLeftJustify
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'FECHA_PREVISTA_ENVIO'
            DataType = datDateTime
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_FECHA_PREVISTA_ENVIO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'NUM_COPIAS'
            DataType = datInteger
            BlobType = dabtUnknown
            DisplayWidth = 0
            Alignment = taLeftJustify
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end
      item
        Params = <
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE_DETALLES'
            SQL = 
              'SELECT PEDIDOS_CLIENTE_DETALLES.ID,'#10'       PEDIDOS_CLIENTE_DETAL' +
              'LES.ID_PEDIDO,'#10'       PEDIDOS_CLIENTE_DETALLES.POSICION,'#10'       ' +
              'PEDIDOS_CLIENTE_DETALLES.TIPO_DETALLE,'#10'       PEDIDOS_CLIENTE_DE' +
              'TALLES.ID_ARTICULO,'#10'       ARTICULOS.REFERENCIA,'#10'       ARTICULO' +
              'S.REFERENCIA_PROV as REFERENCIA_PROVEEDOR,'#10'       PEDIDOS_CLIENT' +
              'E_DETALLES.CONCEPTO,'#10'       PEDIDOS_CLIENTE_DETALLES.CANTIDAD,'#10' ' +
              '      PEDIDOS_CLIENTE_DETALLES.IMPORTE_UNIDAD,'#10'       PEDIDOS_CL' +
              'IENTE_DETALLES.DESCUENTO,'#10'       PEDIDOS_CLIENTE_DETALLES.IMPORT' +
              'E_PORTE,'#10'       PEDIDOS_CLIENTE_DETALLES.IMPORTE_TOTAL,'#10'       P' +
              'EDIDOS_CLIENTE_DETALLES.VISIBLE'#10'FROM PEDIDOS_CLIENTE_DETALLES'#10'  ' +
              '   LEFT JOIN ARTICULOS ON PEDIDOS_CLIENTE_DETALLES.ID_ARTICULO =' +
              ' ARTICULOS.ID'#10'WHERE'#10'     PEDIDOS_CLIENTE_DETALLES.ID_PEDIDO = :I' +
              'D_PEDIDO'#10' AND PEDIDOS_CLIENTE_DETALLES.ID = :ID'#10'ORDER BY POSICIO' +
              'N;'
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'CANTIDAD'
                TableField = 'CANTIDAD'
              end
              item
                DatasetField = 'POSICION'
                TableField = 'POSICION'
              end
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'TIPO_DETALLE'
                TableField = 'TIPO_DETALLE'
              end
              item
                DatasetField = 'CONCEPTO'
                TableField = 'CONCEPTO'
              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_PEDIDO'
                TableField = 'ID_PEDIDO'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'DESCUENTO'
                TableField = 'DESCUENTO'
              end
              item
                DatasetField = 'REFERENCIA_PROVEEDOR'
                TableField = 'REFERENCIA_PROVEEDOR'
              end
              item
                DatasetField = 'IMPORTE_PORTE'
                TableField = 'IMPORTE_PORTE'
              end>
          end>
        Name = 'PedidosCliente_Detalles_Refresh'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_ID'
            InPrimaryKey = True
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_ID_PEDIDO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'POSICION'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'POSICIONCONCEPTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'TIPO_DETALLE'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_TIPO_DETALLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_REFERENCIA'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_ID_ARTICULO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 2000
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_CONCEPTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANTIDAD'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'CANTIDAD'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_UNIDAD'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_IMPORTE_UNIDAD'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_IMPORTE_TOTAL'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_DESCUENTO'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datCurrency
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_IMPORTE_PORTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'VISIBLE'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_VISIBLE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'REFERENCIA_PROVEEDOR'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidosCliente_Detalles_REFERENCIA_PROVEEDOR'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end
      item
        Params = <
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'V_PED_CLI_ARTICULOS'
            SQL = 
              'SELECT ID_ARTICULO,'#10'       CANTIDAD_PEDIDA AS CANTIDAD_PED,'#10'    ' +
              '   CANTIDAD_RESERVADA + CANTIDAD_ENVIADA + CANTIDAD_SERVIDA AS C' +
              'ANTIDAD_ALB,'#10'       CANTIDAD_PENDIENTE'#10'FROM V_PED_CLI_ARTICULOS'#10 +
              'WHERE ID_PEDIDO = :ID_PEDIDO AND'#10'      CANTIDAD_PENDIENTE > 0'
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'CANTIDAD_PED'
                TableField = 'CANTIDAD_PED'
              end
              item
                DatasetField = 'CANTIDAD_ALB'
                TableField = 'CANTIDAD_ALB'
              end
              item
                DatasetField = 'CANTIDAD_PENDIENTE'
                TableField = 'CANTIDAD_PENDIENTE'
              end>
          end>
        Name = 'PedidoCliente_Articulos_Pendientes'
        Fields = <
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidoCliente_Articulos_Pendientes_ID_ARTICULO'
            InPrimaryKey = True
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANTIDAD_PED'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidoCliente_Articulos_Pendientes_CANTIDAD_PED'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANTIDAD_ALB'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidoCliente_Articulos_Pendientes_CANTIDAD_ALB'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end
          item
            Name = 'CANTIDAD_PENDIENTE'
            DataType = datInteger
            BlobType = dabtUnknown
            DictionaryEntry = 'PedidoCliente_Articulos_Pendientes_CANTIDAD_PENDIENTE'
            InPrimaryKey = False
            Calculated = False
            Lookup = False
            LookupCache = False
          end>
        BusinessRulesClient.ScriptLanguage = rslPascalScript
        BusinessRulesServer.ScriptLanguage = rslPascalScript
      end>
    Commands = <
      item
        Params = <
          item
            Name = 'VALOR'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CODIGO'
            DataType = datString
            Size = 50
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'REFERENCIAS'
            SQL = 
              'UPDATE REFERENCIAS SET'#10'       VALOR = :VALOR'#10'WHERE CODIGO = :COD' +
              'IGO AND'#10'      ID_EMPRESA = :ID_EMPRESA'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'ModificarReferencia'
      end
      item
        Params = <
          item
            Name = 'CANTIDAD'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'POSICION'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'TIPO_DETALLE'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 2000
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_UNIDAD'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'VISIBLE'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE_DETALLES'
            SQL = 
              'INSERT'#10'  INTO PEDIDOS_CLIENTE_DETALLES'#10'    (CANTIDAD, POSICION, ' +
              'ID, TIPO_DETALLE, CONCEPTO, IMPORTE_UNIDAD, '#10'     IMPORTE_TOTAL,' +
              ' VISIBLE, ID_PEDIDO,'#10'     ID_ARTICULO, DESCUENTO, IMPORTE_PORTE)' +
              #10'  VALUES'#10'    (:CANTIDAD, :POSICION, :ID, :TIPO_DETALLE, :CONCEP' +
              'TO, '#10'     :IMPORTE_UNIDAD, :IMPORTE_TOTAL, :VISIBLE, :ID_PEDIDO,' +
              ' '#10'     :ID_ARTICULO, :DESCUENTO, :IMPORTE_PORTE)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_PedidosCliente_Detalles'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE_DETALLES'
            SQL = 
              'DELETE '#10'  FROM'#10'    PEDIDOS_CLIENTE_DETALLES'#10'  WHERE'#10'    (ID = :O' +
              'LD_ID)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_PedidosCliente_Detalles'
      end
      item
        Params = <
          item
            Name = 'CANTIDAD'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'POSICION'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'TIPO_DETALLE'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 2000
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_UNIDAD'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'VISIBLE'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_PEDIDO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'OLD_ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE_DETALLES'
            SQL = 
              'UPDATE PEDIDOS_CLIENTE_DETALLES'#10'  SET '#10'    CANTIDAD = :CANTIDAD,' +
              ' '#10'    POSICION = :POSICION, '#10'    ID = :ID, '#10'    TIPO_DETALLE = :' +
              'TIPO_DETALLE, '#10'    CONCEPTO = :CONCEPTO, '#10'    IMPORTE_UNIDAD = :' +
              'IMPORTE_UNIDAD, '#10'    IMPORTE_TOTAL = :IMPORTE_TOTAL, '#10'    VISIBL' +
              'E = :VISIBLE, '#10'    ID_PEDIDO = :ID_PEDIDO, '#10'    ID_ARTICULO = :I' +
              'D_ARTICULO,'#10'    DESCUENTO = :DESCUENTO,'#10'    IMPORTE_PORTE = :IMP' +
              'ORTE_PORTE'#10'  WHERE'#10'    (ID = :OLD_ID)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_PedidosCliente_Detalles'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_CLIENTE'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'USUARIO'
            DataType = datString
            Size = 20
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_PEDIDO'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CALLE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CODIGO_POSTAL'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'POBLACION'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'PROVINCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'PERSONA_CONTACTO'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'TELEFONO'
            DataType = datString
            Size = 25
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REFERENCIA_CLIENTE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'INCIDENCIAS'
            DataType = datMemo
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'INCIDENCIAS_ACTIVAS'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'OBSERVACIONES'
            DataType = datMemo
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_ALTA'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_MODIFICACION'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_NETO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'BASE_IMPONIBLE'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IVA'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_IVA'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_FORMA_PAGO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REF_TIENDA_WEB'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_PREVISTA_ENVIO'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE'
            SQL = 
              'INSERT'#10'  INTO PEDIDOS_CLIENTE'#10'    (ID, ID_EMPRESA, ID_CLIENTE, U' +
              'SUARIO, FECHA_PEDIDO, '#10'     CALLE, CODIGO_POSTAL, POBLACION, PRO' +
              'VINCIA, PERSONA_CONTACTO, '#10'     TELEFONO, REFERENCIA, REFERENCIA' +
              '_CLIENTE, IMPORTE_TOTAL, INCIDENCIAS,'#10'     INCIDENCIAS_ACTIVAS, ' +
              'OBSERVACIONES, FECHA_ALTA, FECHA_MODIFICACION,'#10'     IMPORTE_NETO' +
              ', IMPORTE_PORTE, DESCUENTO,'#10'     IMPORTE_DESCUENTO, BASE_IMPONIB' +
              'LE, IVA, IMPORTE_IVA, '#10'     ID_FORMA_PAGO, REF_TIENDA_WEB, FECHA' +
              '_PREVISTA_ENVIO)'#10'  VALUES'#10'    (:ID, :ID_EMPRESA, :ID_CLIENTE, :U' +
              'SUARIO, :FECHA_PEDIDO, '#10'     :CALLE, :CODIGO_POSTAL, :POBLACION,' +
              ' :PROVINCIA, :PERSONA_CONTACTO, '#10'     :TELEFONO, :REFERENCIA, :R' +
              'EFERENCIA_CLIENTE, :IMPORTE_TOTAL, :INCIDENCIAS,'#10'     :INCIDENCI' +
              'AS_ACTIVAS, :OBSERVACIONES, :FECHA_ALTA,'#10'     :FECHA_MODIFICACIO' +
              'N, :IMPORTE_NETO, :IMPORTE_PORTE,'#10'     :DESCUENTO, :IMPORTE_DESC' +
              'UENTO, :BASE_IMPONIBLE, :IVA, '#10'     :IMPORTE_IVA, :ID_FORMA_PAGO' +
              ', :REF_TIENDA_WEB, :FECHA_PREVISTA_ENVIO)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_PedidosCliente'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE'
            SQL = 'DELETE '#10'  FROM'#10'    PEDIDOS_CLIENTE'#10'  WHERE'#10'    (ID = :OLD_ID)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_PedidosCliente'
      end
      item
        Params = <
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_CLIENTE'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'USUARIO'
            DataType = datString
            Size = 20
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_PEDIDO'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CALLE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'CODIGO_POSTAL'
            DataType = datString
            Size = 10
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'POBLACION'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'PROVINCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'PERSONA_CONTACTO'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'TELEFONO'
            DataType = datString
            Size = 25
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REFERENCIA_CLIENTE'
            DataType = datString
            Size = 255
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'INCIDENCIAS'
            DataType = datMemo
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'INCIDENCIAS_ACTIVAS'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'OBSERVACIONES'
            DataType = datMemo
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_ALTA'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_MODIFICACION'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_NETO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_PORTE'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_DESCUENTO'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'BASE_IMPONIBLE'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IVA'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'IMPORTE_IVA'
            DataType = datFloat
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_FORMA_PAGO'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REF_TIENDA_WEB'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'FECHA_PREVISTA_ENVIO'
            DataType = datDateTime
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'OLD_ID'
            DataType = datInteger
            BlobType = dabtUnknown
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'PEDIDOS_CLIENTE'
            SQL = 
              'UPDATE PEDIDOS_CLIENTE'#10'  SET '#10'    ID_EMPRESA = :ID_EMPRESA,'#10'    ' +
              'ID_CLIENTE = :ID_CLIENTE, '#10'    USUARIO = :USUARIO, '#10'    FECHA_PE' +
              'DIDO = :FECHA_PEDIDO, '#10'    CALLE = :CALLE, '#10'    CODIGO_POSTAL = ' +
              ':CODIGO_POSTAL, '#10'    POBLACION = :POBLACION, '#10'    PROVINCIA = :P' +
              'ROVINCIA, '#10'    PERSONA_CONTACTO = :PERSONA_CONTACTO, '#10'    TELEFO' +
              'NO = :TELEFONO, '#10'    REFERENCIA = :REFERENCIA, '#10'    REFERENCIA_C' +
              'LIENTE = :REFERENCIA_CLIENTE,'#10'    IMPORTE_TOTAL = :IMPORTE_TOTAL' +
              ', '#10'    INCIDENCIAS = :INCIDENCIAS, '#10'    INCIDENCIAS_ACTIVAS = :I' +
              'NCIDENCIAS_ACTIVAS, '#10'    OBSERVACIONES = :OBSERVACIONES, '#10'    FE' +
              'CHA_ALTA = :FECHA_ALTA,'#10'    FECHA_MODIFICACION = :FECHA_MODIFICA' +
              'CION,'#10'    IMPORTE_NETO = :IMPORTE_NETO,'#10'    IMPORTE_PORTE = :IMP' +
              'ORTE_PORTE, '#10'    DESCUENTO = :DESCUENTO, '#10'    IMPORTE_DESCUENTO ' +
              '= :IMPORTE_DESCUENTO, '#10'    BASE_IMPONIBLE = :BASE_IMPONIBLE, '#10'  ' +
              '  IVA = :IVA, '#10'    IMPORTE_IVA = :IMPORTE_IVA, '#10'    ID_FORMA_PAG' +
              'O = :ID_FORMA_PAGO,'#10'    REF_TIENDA_WEB = :REF_TIENDA_WEB,'#10'    FE' +
              'CHA_PREVISTA_ENVIO = :FECHA_PREVISTA_ENVIO'#10'  WHERE'#10'    (ID = :OL' +
              'D_ID)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_PedidosCliente'
      end>
    RelationShips = <>
    UpdateRules = <
      item
        Name = 'Insert PedidosCliente'
        DoUpdate = False
        DoInsert = True
        DoDelete = False
        DatasetName = 'PedidosCliente'
        FailureBehaviour = fbRaiseException
      end
      item
        Name = 'Insert PedidosCliente_Detalles'
        DoUpdate = False
        DoInsert = True
        DoDelete = False
        DatasetName = 'PedidosCliente_Detalles'
        FailureBehaviour = fbRaiseException
      end
      item
        Name = 'Update PedidosCliente'
        DoUpdate = True
        DoInsert = False
        DoDelete = False
        DatasetName = 'PedidosCliente'
        FailureBehaviour = fbRaiseException
      end
      item
        Name = 'Update PedidosCliente_Detalles'
        DoUpdate = True
        DoInsert = False
        DoDelete = False
        DatasetName = 'PedidosCliente_Detalles'
        FailureBehaviour = fbRaiseException
      end
      item
        Name = 'Delete PedidosCliente_Detalles'
        DoUpdate = False
        DoInsert = False
        DoDelete = True
        DatasetName = 'PedidosCliente_Detalles'
        FailureBehaviour = fbRaiseException
      end
      item
        Name = 'Delete PedidosCliente'
        DoUpdate = False
        DoInsert = False
        DoDelete = True
        DatasetName = 'PedidosCliente'
        FailureBehaviour = fbRaiseException
      end>
    Left = 48
    Top = 24
  end
  object DABINAdapter: TDABINAdapter
    Left = 48
    Top = 80
  end
  object bpPedidosCliente: TDABusinessProcessor
    Schema = schPedidosCliente
    InsertCommandName = 'Insert_PedidosCliente'
    DeleteCommandName = 'Delete_PedidosCliente'
    UpdateCommandName = 'Update_PedidosCliente'
    RefreshDatasetName = 'PedidosCliente_Refresh'
    ReferencedDataset = 'PedidosCliente'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 192
    Top = 24
  end
  object bpPedidosCliente_Detalles: TDABusinessProcessor
    Schema = schPedidosCliente
    InsertCommandName = 'Insert_PedidosCliente_Detalles'
    DeleteCommandName = 'Delete_PedidosCliente_Detalles'
    UpdateCommandName = 'Update_PedidosCliente_Detalles'
    RefreshDatasetName = 'PedidosCliente_Detalles_Refresh'
    ReferencedDataset = 'PedidosCliente_Detalles'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 192
    Top = 80
  end
  object DADataDictionary: TDADataDictionary
    Fields = <
      item
        Name = 'PedidosCliente_ID'
        DataType = datAutoInc
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_ID_EMPRESA'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_EMPRESA'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_ID_CLIENTE'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_CLIENTE'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_NOMBRE'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Nombre del cliente'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_FECHA_PEDIDO'
        DataType = datDateTime
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Fecha pedido'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_CALLE'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Calle'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_CODIGO_POSTAL'
        DataType = datString
        Size = 10
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'C'#243'd. postal'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_POBLACION'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Poblaci'#243'n'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_PROVINCIA'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Provincia'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_PERSONA_CONTACTO'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Persona de contacto'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_TELEFONO'
        DataType = datString
        Size = 25
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Tel'#233'fono'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_OBSERVACIONES'
        DataType = datMemo
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Observaciones'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_INCIDENCIAS'
        DataType = datMemo
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'INCIDENCIAS'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_INCIDENCIAS_ACTIVAS'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'INCIDENCIAS_ACTIVAS'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_FECHA_ALTA'
        DataType = datDateTime
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'FECHA_ALTA'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_FECHA_MODIFICACION'
        DataType = datDateTime
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'FECHA_MODIFICACION'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_USUARIO'
        DataType = datString
        Size = 20
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'USUARIO'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_IMPORTE_NETO'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe neto'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_IMPORTE_PORTE'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe del porte'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_DESCUENTO'
        DataType = datFloat
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Descuento'
        DisplayFormat = ',0.00 %;-,0.00 %'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_IMPORTE_DESCUENTO'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe dto.'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_BASE_IMPONIBLE'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Base imponible'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_IVA'
        DataType = datFloat
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'IVA'
        DisplayFormat = ',0.00 %;-,0.00 %'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_IMPORTE_IVA'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe IVA'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_IMPORTE_TOTAL'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe total'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_ID_FORMA_PAGO'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_FORMA_PAGO'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_ID'
        DataType = datAutoInc
        BlobType = dabtUnknown
        Required = True
        DisplayWidth = 0
        DisplayLabel = 'ID'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_ID_PEDIDO'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_PEDIDO'
        Alignment = taLeftJustify
      end
      item
        Name = 'POSICIONCONCEPTO'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'POSICION'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_TIPO_DETALLE'
        DataType = datString
        Size = 10
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'TIPO_DETALLE'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_REFERENCIA'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Referencia'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_ID_ARTICULO'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_ARTICULO'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_CONCEPTO'
        DataType = datString
        Size = 2000
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'CONCEPTO'
        Alignment = taLeftJustify
      end
      item
        Name = 'CANTIDAD'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_Detalles_IMPORTE_UNIDAD'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe unidad'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_Detalles_IMPORTE_TOTAL'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe total'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_Detalles_DESCUENTO'
        DataType = datFloat
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Descuento'
        DisplayFormat = ',0.00 %;-,0.00 %'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_Detalles_IMPORTE_PORTE'
        DataType = datCurrency
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Importe porte'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidosCliente_Detalles_VISIBLE'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'VISIBLE'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_Detalles_REFERENCIA_PROVEEDOR'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Ref. proveedor'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidoCliente_Articulos_Pendientes_ID_ARTICULO'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_ARTICULO'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidoCliente_Articulos_Pendientes_CANTIDAD_PED'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Cantidad en pedido'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidoCliente_Articulos_Pendientes_CANTIDAD_ALB'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Cantidad en albaranes'
        Alignment = taRightJustify
      end
      item
        Name = 'PedidoCliente_Articulos_Pendientes_CANTIDAD_PENDIENTE'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Cantidad pendiente'
        Alignment = taRightJustify
      end
      item
        Name = 'DarArticulosPendientesPedirAProv_ID_PEDIDO'
        DataType = datAutoInc
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_PEDIDO'
        Alignment = taLeftJustify
      end
      item
        Name = 'DarArticulosPendientesPedirAProv_ID_ARTICULO'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_ARTICULO'
        Alignment = taLeftJustify
      end
      item
        Name = 'DarArticulosPendientesPedirAProv_CANT_PEDIDA_CLIENTE'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Cant. pedida por cliente'
        Alignment = taLeftJustify
      end
      item
        Name = 'DarArticulosPendientesPedirAProv_ID_PROVEEDOR'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'ID_PROVEEDOR'
        Alignment = taLeftJustify
      end
      item
        Name = 'DarArticulosPendientesPedirAProv_CANT_PEDIDA_PROVEEDOR'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Cant. pedida a proveedor'
        Alignment = taLeftJustify
      end
      item
        Name = 'DarArticulosPendientesPedirAProv_CANT_PENDIENTE_PEDIR'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Cant. pendiente pedir'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_FECHA_PREVISTA_ENVIO'
        DataType = datDateTime
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Fecha de entrega prevista'
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_REFERENCIA'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Referencia'
        Alignment = taLeftJustify
        ServerAutoRefresh = True
      end
      item
        Name = 'PedidosCliente_REFERENCIA_CLIENTE'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        Alignment = taLeftJustify
      end
      item
        Name = 'PedidosCliente_SITUACION'
        DataType = datString
        Size = 255
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'Situaci'#243'n'
        Alignment = taLeftJustify
        ServerAutoRefresh = True
      end
      item
        Name = 'PedidosCliente_REF_TIENDA_WEB'
        DataType = datInteger
        BlobType = dabtUnknown
        DisplayWidth = 0
        DisplayLabel = 'REF_TIENDA_WEB'
        Alignment = taLeftJustify
      end>
    Left = 48
    Top = 152
  end
end
