object srvInventario: TsrvInventario
  OldCreateOrder = True
  ConnectionName = 'IBX'
  ServiceSchema = schInventario
  ServiceDataStreamer = Bin2DataStreamer
  ExportedDataTables = <>
  BeforeAcquireConnection = DataAbstractServiceBeforeAcquireConnection
  Height = 212
  Width = 335
  object schInventario: TDASchema
    ConnectionManager = dmServer.ConnectionManager
    DataDictionary = DataDictionary
    Datasets = <
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'V_INVENTARIO'
            SQL = 
              'SELECT'#10'    V_INVENTARIO.ID_ALMACEN, V_INVENTARIO.ID_ARTICULO, V_' +
              'INVENTARIO.NOMBRE as ALMACEN,'#10'    V_INVENTARIO.ID_EMPRESA, V_INV' +
              'ENTARIO.REFERENCIA, V_INVENTARIO.FAMILIA,'#10'    V_INVENTARIO.DESCR' +
              'IPCION, V_INVENTARIO.UNIDAD_MEDIDA, V_INVENTARIO.CAMPOTECNICO,'#10' ' +
              '   V_INVENTARIO.CODIGOTECNICO, V_INVENTARIO.DISENOTECNICO,'#10#10'/*  ' +
              '  REFERENCIA_PROV as REFERENCIA_PROVEEDOR, PRECIO_NETO, COSTE_UN' +
              'IDADES,  SE ELIMINAN LOS PRECIOS CON HASTA SABER QUE DECISIONES ' +
              'SE TOMAN*/'#10#10'    V_INVENTARIO.COLOR1, V_INVENTARIO.COLOR2,'#10'    V_' +
              'INVENTARIO.COLOR3, V_INVENTARIO.COLOR4,'#10'    V_INVENTARIO.COLOR5,' +
              ' V_INVENTARIO.COLOR6,'#10'    V_INVENTARIO.COLOR7, V_INVENTARIO.COLO' +
              'R8,'#10'    V_INVENTARIO.COLOR9, V_INVENTARIO.COLOR10,'#10'    V_INVENTA' +
              'RIO.COLOR11, V_INVENTARIO.COLOR12,'#10#10'    V_INVENTARIO.STOCK, V_IN' +
              'VENTARIO.UNIDADES_ALMACEN, V_INVENTARIO.RESERVA,'#10'    V_INVENTARI' +
              'O.PENDIENTE_RECEPCION, V_INVENTARIO.TIPO_ALMACEN,'#10#10'    /*'#10'    NO' +
              ' BORRAR YA QUE SIRVE PARA LAS ENTRADAS Y SALIDAS DE ALMACEN(TABL' +
              'A MOVIMIENTOS)'#10'    DEBERIA GENERAR UNA TABLA DE MOVIMIENTOS INDE' +
              'PENDIENTE DEL INVENTARIO PERO POR FALTA'#10'    DE TIEMPO Y FIABILID' +
              'AD YA QUE AHORA FUNCIONA TODO, CREAMOS ESTOS CAMPOS FICTICIOS'#10'  ' +
              '  */'#10#10'    0 as ID, 0 as CANTIDAD, current_date as FECHA_MOVIMIEN' +
              'TO, NULL as CAUSA, NULL as TIPO,'#10'    0 as ID_ALMACEN_RESERVA'#10#10#10'F' +
              'ROM V_INVENTARIO'#10'where {where}'#10'ORDER BY V_INVENTARIO.ID_ARTICULO' +
              #10#10#10#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_ALMACEN'
                TableField = 'ID_ALMACEN'
              end
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'ALMACEN'
                TableField = '<unknown>'
                SQLOrigin = 'ALMACEN'
              end
              item
                DatasetField = 'ID_EMPRESA'
                TableField = 'ID_EMPRESA'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'FAMILIA'
                TableField = 'FAMILIA'
              end
              item
                DatasetField = 'DESCRIPCION'
                TableField = 'DESCRIPCION'
              end
              item
                DatasetField = 'UNIDAD_MEDIDA'
                TableField = 'UNIDAD_MEDIDA'
              end
              item
                DatasetField = 'CAMPOTECNICO'
                TableField = 'CAMPOTECNICO'
              end
              item
                DatasetField = 'CODIGOTECNICO'
                TableField = 'CODIGOTECNICO'
              end
              item
                DatasetField = 'DISENOTECNICO'
                TableField = 'DISENOTECNICO'
              end
              item
                DatasetField = 'COLOR1'
                TableField = 'COLOR1'
              end
              item
                DatasetField = 'COLOR2'
                TableField = 'COLOR2'
              end
              item
                DatasetField = 'COLOR3'
                TableField = 'COLOR3'
              end
              item
                DatasetField = 'COLOR4'
                TableField = 'COLOR4'
              end
              item
                DatasetField = 'COLOR5'
                TableField = 'COLOR5'
              end
              item
                DatasetField = 'COLOR6'
                TableField = 'COLOR6'
              end
              item
                DatasetField = 'COLOR7'
                TableField = 'COLOR7'
              end
              item
                DatasetField = 'COLOR8'
                TableField = 'COLOR8'
              end
              item
                DatasetField = 'COLOR9'
                TableField = 'COLOR9'
              end
              item
                DatasetField = 'COLOR10'
                TableField = 'COLOR10'
              end
              item
                DatasetField = 'COLOR11'
                TableField = 'COLOR11'
              end
              item
                DatasetField = 'COLOR12'
                TableField = 'COLOR12'
              end
              item
                DatasetField = 'STOCK'
                TableField = 'STOCK'
              end
              item
                DatasetField = 'UNIDADES_ALMACEN'
                TableField = 'UNIDADES_ALMACEN'
              end
              item
                DatasetField = 'RESERVA'
                TableField = 'RESERVA'
              end
              item
                DatasetField = 'PENDIENTE_RECEPCION'
                TableField = 'PENDIENTE_RECEPCION'
              end
              item
                DatasetField = 'TIPO_ALMACEN'
                TableField = 'TIPO_ALMACEN'
              end
              item
                DatasetField = 'ID'
                TableField = '<unknown>'
                SQLOrigin = 'ID'
              end
              item
                DatasetField = 'CANTIDAD'
                TableField = '<unknown>'
                SQLOrigin = 'CANTIDAD'
              end
              item
                DatasetField = 'FECHA_MOVIMIENTO'
                TableField = '<unknown>'
                SQLOrigin = 'FECHA_MOVIMIENTO'
              end
              item
                DatasetField = 'CAUSA'
                TableField = '<unknown>'
                SQLOrigin = 'CAUSA'
              end
              item
                DatasetField = 'TIPO'
                TableField = '<unknown>'
                SQLOrigin = 'TIPO'
              end
              item
                DatasetField = 'ID_ALMACEN_RESERVA'
                TableField = '<unknown>'
                SQLOrigin = 'ID_ALMACEN_RESERVA'
              end>
          end>
        Name = 'Inventario'
        Fields = <
          item
            Name = 'ID_ALMACEN'
            DataType = datInteger
            DictionaryEntry = 'INVENTARIO_ID_ALMACEN'
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
            DictionaryEntry = 'INVENTARIO_ID_ARTICULO'
          end
          item
            Name = 'ALMACEN'
            DataType = datString
            Size = 255
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'INVENTARIO_REFERENCIA'
          end
          item
            Name = 'FAMILIA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'INVENTARIO_FAMILIA'
          end
          item
            Name = 'DESCRIPCION'
            DataType = datString
            Size = 255
            DictionaryEntry = 'INVENTARIO_DESCRIPCION'
          end
          item
            Name = 'UNIDAD_MEDIDA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'CAMPOTECNICO'
            DataType = datString
            Size = 200
          end
          item
            Name = 'CODIGOTECNICO'
            DataType = datString
            Size = 15
          end
          item
            Name = 'DISENOTECNICO'
            DataType = datString
            Size = 6
          end
          item
            Name = 'COLOR1'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR2'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR3'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR4'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR5'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR6'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR7'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR8'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR9'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR10'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR11'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR12'
            DataType = datLargeInt
          end
          item
            Name = 'STOCK'
            DataType = datFloat
            DictionaryEntry = 'INVENTARIO_STOCK'
          end
          item
            Name = 'UNIDADES_ALMACEN'
            DataType = datCurrency
          end
          item
            Name = 'RESERVA'
            DataType = datCurrency
          end
          item
            Name = 'PENDIENTE_RECEPCION'
            DataType = datCurrency
          end
          item
            Name = 'TIPO_ALMACEN'
            DataType = datString
            Size = 10
          end
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_MOVIMIENTOS_ID'
            DictionaryEntry = 'INVENTARIO_ID'
            InPrimaryKey = True
          end
          item
            Name = 'CANTIDAD'
            DataType = datFloat
            DictionaryEntry = 'INVENTARIO_CANTIDAD'
          end
          item
            Name = 'FECHA_MOVIMIENTO'
            DataType = datDateTime
            DictionaryEntry = 'INVENTARIO_FECHA_MOVIMIENTO'
          end
          item
            Name = 'CAUSA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'INVENTARIO_CAUSA'
          end
          item
            Name = 'TIPO'
            DataType = datString
            Size = 1
            DictionaryEntry = 'INVENTARIO_TIPO'
          end
          item
            Name = 'ID_ALMACEN_RESERVA'
            DataType = datInteger
          end>
      end
      item
        Params = <>
        Statements = <
          item
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'SELECT ID, ID_MOVIMIENTO, COLOR1, COLOR2, COLOR3, COLOR4, COLOR5' +
              ', COLOR6, COLOR7, COLOR8,'#10'       COLOR9, COLOR10, COLOR11, COLOR' +
              '12'#10'FROM MOVIMIENTOS_DETALLE_COLOR'#10'where {where}'#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'ID_MOVIMIENTO'
                TableField = 'ID_MOVIMIENTO'
              end
              item
                DatasetField = 'COLOR1'
                TableField = 'COLOR1'
              end
              item
                DatasetField = 'COLOR2'
                TableField = 'COLOR2'
              end
              item
                DatasetField = 'COLOR3'
                TableField = 'COLOR3'
              end
              item
                DatasetField = 'COLOR4'
                TableField = 'COLOR4'
              end
              item
                DatasetField = 'COLOR5'
                TableField = 'COLOR5'
              end
              item
                DatasetField = 'COLOR6'
                TableField = 'COLOR6'
              end
              item
                DatasetField = 'COLOR7'
                TableField = 'COLOR7'
              end
              item
                DatasetField = 'COLOR8'
                TableField = 'COLOR8'
              end
              item
                DatasetField = 'COLOR9'
                TableField = 'COLOR9'
              end
              item
                DatasetField = 'COLOR10'
                TableField = 'COLOR10'
              end
              item
                DatasetField = 'COLOR11'
                TableField = 'COLOR11'
              end
              item
                DatasetField = 'COLOR12'
                TableField = 'COLOR12'
              end>
          end>
        Name = 'Movimientos_Detalle_Color'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_MOVIMIENTOS_DET_COLOR_ID'
            DictionaryEntry = 'Movimientos_Detalle_Color_ID'
            InPrimaryKey = True
          end
          item
            Name = 'ID_MOVIMIENTO'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_ID_MOVIMIENTO'
          end
          item
            Name = 'COLOR1'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR1'
          end
          item
            Name = 'COLOR2'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR2'
          end
          item
            Name = 'COLOR3'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR3'
          end
          item
            Name = 'COLOR4'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR4'
          end
          item
            Name = 'COLOR5'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR5'
          end
          item
            Name = 'COLOR6'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR6'
          end
          item
            Name = 'COLOR7'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR7'
          end
          item
            Name = 'COLOR8'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR8'
          end
          item
            Name = 'COLOR9'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR9'
          end
          item
            Name = 'COLOR10'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR10'
          end
          item
            Name = 'COLOR11'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR11'
          end
          item
            Name = 'COLOR12'
            DataType = datInteger
            DictionaryEntry = 'Movimientos_Detalle_Color_COLOR12'
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'V_INV_DETALLE_RESERVAS'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'ID_EMPRESA'
                TableField = 'ID_EMPRESA'
              end
              item
                DatasetField = 'ID_ALMACEN'
                TableField = 'ID_ALMACEN'
              end
              item
                DatasetField = 'NOMBRE_ALMACEN'
                TableField = 'NOMBRE_ALMACEN'
              end
              item
                DatasetField = 'FECHA_RESERVA'
                TableField = 'FECHA_RESERVA'
              end
              item
                DatasetField = 'CAUSA_RESERVA'
                TableField = 'CAUSA_RESERVA'
              end
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'DESCRIPCION'
                TableField = 'DESCRIPCION'
              end
              item
                DatasetField = 'FAMILIA'
                TableField = 'FAMILIA'
              end
              item
                DatasetField = 'UNIDAD_MEDIDA'
                TableField = 'UNIDAD_MEDIDA'
              end
              item
                DatasetField = 'FABRICANTE'
                TableField = 'FABRICANTE'
              end
              item
                DatasetField = 'REFERENCIA_FABR'
                TableField = 'REFERENCIA_FABR'
              end
              item
                DatasetField = 'CANTIDAD'
                TableField = 'CANTIDAD'
              end
              item
                DatasetField = 'ID_ALMACEN_RESERVA'
                TableField = 'ID_ALMACEN_RESERVA'
              end
              item
                DatasetField = 'NOMBRE_ALMACEN_RESERVA'
                TableField = 'NOMBRE_ALMACEN_RESERVA'
              end
              item
                DatasetField = 'ID_EMPRESA_ALMACEN_RESERVA'
                TableField = 'ID_EMPRESA_ALMACEN_RESERVA'
              end>
          end>
        Name = 'DetalleReservas'
        Fields = <
          item
            Name = 'ID'
            DataType = datInteger
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
          end
          item
            Name = 'ID_ALMACEN'
            DataType = datInteger
          end
          item
            Name = 'NOMBRE_ALMACEN'
            DataType = datString
            Size = 255
          end
          item
            Name = 'FECHA_RESERVA'
            DataType = datDateTime
          end
          item
            Name = 'CAUSA_RESERVA'
            DataType = datString
            Size = 2000
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'DESCRIPCION'
            DataType = datString
            Size = 255
          end
          item
            Name = 'FAMILIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'UNIDAD_MEDIDA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'FABRICANTE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'REFERENCIA_FABR'
            DataType = datString
            Size = 255
          end
          item
            Name = 'CANTIDAD'
            DataType = datCurrency
          end
          item
            Name = 'ID_ALMACEN_RESERVA'
            DataType = datInteger
          end
          item
            Name = 'NOMBRE_ALMACEN_RESERVA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'ID_EMPRESA_ALMACEN_RESERVA'
            DataType = datInteger
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'V_INV_STOCK_COLOR'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_ALMACEN'
                TableField = 'ID_ALMACEN'
              end
              item
                DatasetField = 'ID_ARTICULO'
                TableField = 'ID_ARTICULO'
              end
              item
                DatasetField = 'COLOR1'
                TableField = 'COLOR1'
              end
              item
                DatasetField = 'COLOR2'
                TableField = 'COLOR2'
              end
              item
                DatasetField = 'COLOR3'
                TableField = 'COLOR3'
              end
              item
                DatasetField = 'COLOR4'
                TableField = 'COLOR4'
              end
              item
                DatasetField = 'COLOR5'
                TableField = 'COLOR5'
              end
              item
                DatasetField = 'COLOR6'
                TableField = 'COLOR6'
              end
              item
                DatasetField = 'COLOR7'
                TableField = 'COLOR7'
              end
              item
                DatasetField = 'COLOR8'
                TableField = 'COLOR8'
              end
              item
                DatasetField = 'COLOR9'
                TableField = 'COLOR9'
              end
              item
                DatasetField = 'COLOR10'
                TableField = 'COLOR10'
              end
              item
                DatasetField = 'COLOR11'
                TableField = 'COLOR11'
              end
              item
                DatasetField = 'COLOR12'
                TableField = 'COLOR12'
              end>
          end>
        Name = 'Inventario_Color'
        Fields = <
          item
            Name = 'ID_ALMACEN'
            DataType = datInteger
          end
          item
            Name = 'ID_ARTICULO'
            DataType = datInteger
          end
          item
            Name = 'COLOR1'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR2'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR3'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR4'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR5'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR6'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR7'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR8'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR9'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR10'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR11'
            DataType = datLargeInt
          end
          item
            Name = 'COLOR12'
            DataType = datLargeInt
          end>
      end>
    JoinDataTables = <>
    UnionDataTables = <>
    Commands = <
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'MOVIMIENTOS'
            Name = 'IBX'
            SQL = 'DELETE'#10'  FROM'#10'    MOVIMIENTOS'#10'  WHERE'#10'    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Reservas'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_MOVIMIENTOS_ID'
            Value = ''
          end
          item
            Name = 'ID_ALMACEN'
            Value = ''
          end
          item
            Name = 'ID_ARTICULO'
            Value = ''
          end
          item
            Name = 'FECHA_MOVIMIENTO'
            Value = ''
          end
          item
            Name = 'TIPO'
            Value = ''
          end
          item
            Name = 'CANTIDAD'
            Value = ''
          end
          item
            Name = 'CAUSA'
            Value = ''
          end
          item
            Name = 'ID_ALMACEN_RESERVA'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'MOVIMIENTOS'
            SQL = 
              'INSERT'#10'  INTO MOVIMIENTOS'#10'    (ID, ID_ALMACEN, ID_ARTICULO, FECH' +
              'A_MOVIMIENTO, TIPO, CANTIDAD, CAUSA, ID_ALMACEN_RESERVA)'#10'  VALUE' +
              'S'#10'    (:ID, :ID_ALMACEN, :ID_ARTICULO, :FECHA_MOVIMIENTO, :TIPO,' +
              ' :CANTIDAD, :CAUSA, :ID_ALMACEN_RESERVA)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_Inventario'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'MOVIMIENTOS'
            SQL = 'DELETE '#10'  FROM'#10'    MOVIMIENTOS'#10'  WHERE'#10'    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Inventario'
      end
      item
        Params = <
          item
            Name = 'ID'
            Value = ''
          end
          item
            Name = 'ID_ALMACEN'
            Value = ''
          end
          item
            Name = 'ID_ARTICULO'
            Value = ''
          end
          item
            Name = 'FECHA_MOVIMIENTO'
            Value = ''
          end
          item
            Name = 'TIPO'
            Value = ''
          end
          item
            Name = 'CANTIDAD'
            Value = ''
          end
          item
            Name = 'CAUSA'
            Value = ''
          end
          item
            Name = 'ID_ALMACEN_RESERVA'
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'MOVIMIENTOS'
            SQL = 
              'UPDATE MOVIMIENTOS'#10'  SET '#10'    ID = :ID,'#10'    ID_ALMACEN = :ID_ALM' +
              'ACEN,'#10'    ID_ARTICULO = :ID_ARTICULO,'#10'    FECHA_MOVIMIENTO = :FE' +
              'CHA_MOVIMIENTO,'#10'    TIPO = :TIPO,'#10'    CANTIDAD = :CANTIDAD,'#10'    ' +
              'CAUSA = :CAUSA,'#10'    ID_ALMACEN_RESERVA = :ID_ALMACEN_RESERVA'#10'  W' +
              'HERE'#10'    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_Inventario'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_MOVIMIENTOS_DET_COLOR_ID'
            Value = ''
          end
          item
            Name = 'ID_MOVIMIENTO'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR1'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR2'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR3'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR4'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR5'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR6'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR7'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR8'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR9'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR10'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR11'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR12'
            DataType = datInteger
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'MOVIMIENTOS_DETALLE_COLOR'
            SQL = 
              'INSERT'#10'  INTO MOVIMIENTOS_DETALLE_COLOR'#10'    (ID, ID_MOVIMIENTO, ' +
              'COLOR1, COLOR2, COLOR3, COLOR4, '#10'     COLOR5, COLOR6, COLOR7, CO' +
              'LOR8, COLOR9, COLOR10, COLOR11, '#10'     COLOR12)'#10'  VALUES'#10'    (:ID' +
              ', :ID_MOVIMIENTO, :COLOR1, :COLOR2, :COLOR3, :COLOR4,'#10'     :COLO' +
              'R5, :COLOR6, :COLOR7, :COLOR8, :COLOR9, :COLOR10, '#10'     :COLOR11' +
              ', :COLOR12)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_Movimientos_Detalle_Color'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            DataType = datInteger
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'MOVIMIENTOS_DETALLE_COLOR'
            SQL = 
              'DELETE '#10'  FROM'#10'    MOVIMIENTOS_DETALLE_COLOR'#10'  WHERE'#10'    (ID = :' +
              'OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Movimientos_Detalle_Color'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'ID_MOVIMIENTO'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR1'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR2'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR3'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR4'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR5'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR6'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR7'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR8'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR9'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR10'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR11'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'COLOR12'
            DataType = datInteger
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'MOVIMIENTOS_DETALLE_COLOR'
            SQL = 
              'UPDATE MOVIMIENTOS_DETALLE_COLOR'#10'  SET '#10'    ID = :ID, '#10'    ID_MO' +
              'VIMIENTO = :ID_MOVIMIENTO,'#10'    COLOR1 = :COLOR1, '#10'    COLOR2 = :' +
              'COLOR2, '#10'    COLOR3 = :COLOR3, '#10'    COLOR4 = :COLOR4, '#10'    COLOR' +
              '5 = :COLOR5, '#10'    COLOR6 = :COLOR6, '#10'    COLOR7 = :COLOR7, '#10'    ' +
              'COLOR8 = :COLOR8, '#10'    COLOR9 = :COLOR9, '#10'    COLOR10 = :COLOR10' +
              ', '#10'    COLOR11 = :COLOR11, '#10'    COLOR12 = :COLOR12'#10'  WHERE'#10'    (' +
              'ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_Movimientos_Detalle_Color'
      end>
    RelationShips = <
      item
        Name = 'FK_Movimientos_Detalle_Color'
        MasterDatasetName = 'Inventario'
        MasterFields = 'ID'
        DetailDatasetName = 'Movimientos_Detalle_Color'
        DetailFields = 'ID_MOVIMIENTO'
        RelationshipType = rtForeignKey
      end>
    UpdateRules = <
      item
        Name = 'Insert Inventario'
        DoUpdate = False
        DoDelete = False
        DatasetName = 'Inventario'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Insert Movimientos_Detalle_Color'
        DoUpdate = False
        DoDelete = False
        DatasetName = 'Movimientos_Detalle_Color'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Update Inventario'
        DoInsert = False
        DoDelete = False
        DatasetName = 'Inventario'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Update Movimientos_Detalle_Color'
        DoInsert = False
        DoDelete = False
        DatasetName = 'Movimientos_Detalle_Color'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Delete Movimientos_Detalle_Color'
        DoUpdate = False
        DoInsert = False
        DatasetName = 'Movimientos_Detalle_Color'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Delete Inventario'
        DoUpdate = False
        DoInsert = False
        DatasetName = 'Inventario'
        FailureBehavior = fbRaiseException
      end>
    Version = 0
    Left = 40
    Top = 16
  end
  object bpInventario: TDABusinessProcessor
    Schema = schInventario
    InsertCommandName = 'Insert_Inventario'
    DeleteCommandName = 'Delete_Inventario'
    UpdateCommandName = 'Update_Inventario'
    ReferencedDataset = 'INVENTARIO'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 208
    Top = 16
  end
  object DataDictionary: TDADataDictionary
    Fields = <
      item
        Name = 'INVENTARIO_ID_ALMACEN'
        DataType = datInteger
        DisplayLabel = 'ID_ALMACEN'
      end
      item
        Name = 'INVENTARIO_ID_ARTICULO'
        DataType = datInteger
        DisplayLabel = 'ID_ARTICULO'
      end
      item
        Name = 'INVENTARIO_ALMACEN'
        DataType = datString
        Size = 255
        DisplayLabel = 'ALMACEN'
      end
      item
        Name = 'INVENTARIO_ID_EMPRESA'
        DataType = datInteger
        DisplayLabel = 'ID_EMPRESA'
      end
      item
        Name = 'INVENTARIO_REFERENCIA_CLIENTE'
        DataType = datString
        Size = 255
        DisplayLabel = 'REFERENCIA_CLIENTE'
      end
      item
        Name = 'INVENTARIO_FAMILIA'
        DataType = datString
        Size = 255
        DisplayLabel = 'FAMILIA'
      end
      item
        Name = 'INVENTARIO_DESCRIPCION'
        DataType = datString
        Size = 255
        DisplayLabel = 'DESCRIPCION'
      end
      item
        Name = 'INVENTARIO_REFERENCIA_PROVEEDOR'
        DataType = datString
        Size = 255
        DisplayLabel = 'REFERENCIA_PROVEEDOR'
      end
      item
        Name = 'INVENTARIO_STOCK'
        DataType = datFloat
        DisplayLabel = 'Stock disponible'
      end
      item
        Name = 'INVENTARIO_RESERVA'
        DataType = datFloat
        DisplayLabel = 'Reservado'
      end
      item
        Name = 'INVENTARIO_PENDIENTE_RECEPCION'
        DataType = datFloat
        DisplayLabel = 'Pendiente de recibir'
      end
      item
        Name = 'INVENTARIO_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_MOVIMIENTOS_ID'
        ServerAutoRefresh = True
      end
      item
        Name = 'INVENTARIO_CANTIDAD'
        DataType = datFloat
      end
      item
        Name = 'INVENTARIO_FECHA_MOVIMIENTO'
        DataType = datDateTime
      end
      item
        Name = 'INVENTARIO_CAUSA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'INVENTARIO_TIPO'
        DataType = datString
        Size = 1
      end
      item
        Name = 'INVENTARIO_REFERENCIA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'INVENTARIO_REFERENCIA_PROV'
        DataType = datString
        Size = 255
      end
      item
        Name = 'INVENTARIO_UNIDADES_ALMACEN'
        DataType = datFloat
        DisplayLabel = 'U. Almac'#233'n'
      end
      item
        Name = 'INVENTARIO_PRECIO_NETO'
        DataType = datCurrency
        DisplayLabel = 'Precio unidad'
        Alignment = taRightJustify
      end
      item
        Name = 'INVENTARIO_COSTE_UNIDADES'
        DataType = datCurrency
        DisplayLabel = 'Coste unidades'
        Alignment = taRightJustify
      end
      item
        Name = 'DETALLE_RESERVAS_INV_ID_ALB'
        DataType = datInteger
        DisplayLabel = 'IdAlbaran'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_REFERENCIA_ALB'
        DataType = datString
        Size = 255
        DisplayLabel = 'Ref. albar'#225'n'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_SITUACION_ALB'
        DataType = datString
        Size = 9
        DisplayLabel = 'Situaci'#243'n'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_FECHA_PREVISTA_ENVIO_ALB'
        DataType = datDateTime
        DisplayLabel = 'Fecha prevista de envio'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_ID_ALMACEN_ALB'
        DataType = datInteger
        DisplayLabel = 'IdAlmac'#233'n'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_ALMACEN_ALB'
        DataType = datString
        Size = 255
        DisplayLabel = 'Almac'#233'n'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_ID_CLIENTE_ALB'
        DataType = datInteger
        DisplayLabel = 'IdCliente'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_CLIENTE_ALB'
        DataType = datString
        Size = 255
        DisplayLabel = 'Cliente'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_ID_ART'
        DataType = datInteger
        DisplayLabel = 'IdArticulo'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_FAMILIA_ART'
        DataType = datString
        Size = 255
        DisplayLabel = 'Familia'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_REFERENCIA_ART'
        DataType = datString
        Size = 255
        DisplayLabel = 'Referencia'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_REFERENCIA_PROV_ART'
        DataType = datString
        Size = 255
        DisplayLabel = 'Ref. proveedor'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_DESCRIPCION_ART'
        DataType = datString
        Size = 255
        DisplayLabel = 'Descripci'#243'n'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_CANTIDAD_ART'
        DataType = datFloat
        DisplayLabel = 'Reservado'
      end
      item
        Name = 'DETALLE_RESERVAS_INV_ID_EMPRESA'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_MOVIMIENTOS_DET_COLOR_ID'
        DisplayLabel = 'ID'
      end
      item
        Name = 'Movimientos_Detalle_Color_ID_MOVIMIENTO'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR1'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR2'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR3'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR4'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR5'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR6'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR7'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR8'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR9'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR10'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR11'
        DataType = datInteger
      end
      item
        Name = 'Movimientos_Detalle_Color_COLOR12'
        DataType = datInteger
      end>
    Left = 126
    Top = 14
  end
  object Bin2DataStreamer: TDABin2DataStreamer
    Left = 40
    Top = 80
  end
  object bpReservas: TDABusinessProcessor
    Schema = schInventario
    DeleteCommandName = 'Delete_Reservas'
    ReferencedDataset = 'DetalleReservas'
    ProcessorOptions = [poAutoGenerateRefreshDataset, poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 208
    Top = 72
  end
  object bpMovimientos_DetalleColor: TDABusinessProcessor
    Schema = schInventario
    InsertCommandName = 'Insert_Movimientos_Detalle_Color'
    DeleteCommandName = 'Delete_Movimientos_Detalle_Color'
    UpdateCommandName = 'Update_Movimientos_Detalle_Color'
    ReferencedDataset = 'Movimientos_Detalle_Color'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 208
    Top = 136
  end
end
