object RptWordAlbaranProveedor: TRptWordAlbaranProveedor
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Height = 223
  Width = 337
  object schReport: TDASchema
    ConnectionManager = dmServer.ConnectionManager
    DataDictionary = DataDictionary
    Datasets = <
      item
        IsPublic = False
        Params = <
          item
            Name = 'ID'
            Value = '3'
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            SQL = 
              'SELECT'#10'  ALBARANES_PROVEEDOR.ID,'#10'  ALBARANES_PROVEEDOR.ID_EMPRES' +
              'A,'#10'  ALBARANES_PROVEEDOR.TIPO,'#10'  ALBARANES_PROVEEDOR.REFERENCIA,' +
              #10'  ALBARANES_PROVEEDOR.FECHA_ALBARAN,'#10'  ALBARANES_PROVEEDOR.OBSE' +
              'RVACIONES,'#10'  CONTACTOS.NOMBRE,'#10'  COALESCE(CONTACTOS_DIRECCIONES.' +
              'FAX, CONTACTOS.FAX) AS FAX,'#10'  ALBARANES_PROVEEDOR.PERSONA_CONTAC' +
              'TO_PROV AS PERSONA_CONTACTO,'#10'  PROVEEDORES_DATOS.CODIGO_ASIGNADO' +
              ' AS CODIGO_CLIENTE,'#10'  ALBARANES_PROVEEDOR.ID_ALMACEN,'#10'  COALESCE' +
              '(ALMACENES.CALLE, ALBARANES_PROVEEDOR.CALLE) AS CALLE,'#10'  COALESC' +
              'E(ALMACENES.POBLACION, ALBARANES_PROVEEDOR.POBLACION) AS POBLACI' +
              'ON,'#10'  COALESCE(ALMACENES.PROVINCIA, ALBARANES_PROVEEDOR.PROVINCI' +
              'A) AS PROVINCIA,'#10'  COALESCE(ALMACENES.CODIGO_POSTAL, ALBARANES_P' +
              'ROVEEDOR.CODIGO_POSTAL) AS CODIGO_POSTAL,'#10'  ALBARANES_PROVEEDOR.' +
              'PERSONA_CONTACTO AS ENTREGAR_A,'#10'  ALBARANES_PROVEEDOR.IMPORTE_TO' +
              'TAL'#10'FROM'#10'  ALBARANES_PROVEEDOR'#10'  INNER JOIN CONTACTOS ON (CONTAC' +
              'TOS.ID = ALBARANES_PROVEEDOR.ID_PROVEEDOR)'#10'  LEFT OUTER JOIN PRO' +
              'VEEDORES_DATOS ON (PROVEEDORES_DATOS.ID_PROVEEDOR = ALBARANES_PR' +
              'OVEEDOR.ID_PROVEEDOR)'#10'  LEFT OUTER JOIN CONTACTOS_DIRECCIONES ON' +
              ' (CONTACTOS_DIRECCIONES.ID = ALBARANES_PROVEEDOR.ID_DIRECCION)'#10' ' +
              ' LEFT OUTER JOIN ALMACENES ON (ALMACENES.ID = ALBARANES_PROVEEDO' +
              'R.ID_ALMACEN)'#10'WHERE ALBARANES_PROVEEDOR.ID = :ID'#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'ID_EMPRESA'
                TableField = 'ID_EMPRESA'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'OBSERVACIONES'
                TableField = 'OBSERVACIONES'
              end
              item
                DatasetField = 'NOMBRE'
                TableField = 'NOMBRE'
              end
              item
                DatasetField = 'FAX'
                TableField = 'FAX'
              end
              item
                DatasetField = 'PERSONA_CONTACTO'
                TableField = 'PERSONA_CONTACTO'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'ID_ALMACEN'
                TableField = 'ID_ALMACEN'
              end
              item
                DatasetField = 'CODIGO_CLIENTE'
                TableField = 'CODIGO_CLIENTE'
              end
              item
                DatasetField = 'TIPO'
                TableField = 'TIPO'
              end
              item
                DatasetField = 'FECHA_ALBARAN'
                TableField = 'FECHA_ALBARAN'
              end
              item
                DatasetField = 'CALLE'
                TableField = 'CALLE'
              end
              item
                DatasetField = 'POBLACION'
                TableField = 'POBLACION'
              end
              item
                DatasetField = 'PROVINCIA'
                TableField = 'PROVINCIA'
              end
              item
                DatasetField = 'CODIGO_POSTAL'
                TableField = 'CODIGO_POSTAL'
              end
              item
                DatasetField = 'ENTREGAR_A'
                TableField = 'ENTREGAR_A'
              end>
          end>
        Name = 'Informe_Cabecera'
        Fields = <
          item
            Name = 'ID'
            DataType = datInteger
          end
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
          end
          item
            Name = 'TIPO'
            DataType = datString
            Size = 1
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'FECHA_ALBARAN'
            DataType = datDateTime
          end
          item
            Name = 'OBSERVACIONES'
            DataType = datMemo
          end
          item
            Name = 'NOMBRE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'FAX'
            DataType = datString
            Size = 25
          end
          item
            Name = 'PERSONA_CONTACTO'
            DataType = datString
            Size = 255
          end
          item
            Name = 'CODIGO_CLIENTE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'ID_ALMACEN'
            DataType = datInteger
          end
          item
            Name = 'CALLE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'POBLACION'
            DataType = datString
            Size = 255
          end
          item
            Name = 'PROVINCIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'CODIGO_POSTAL'
            DataType = datString
            Size = 10
          end
          item
            Name = 'ENTREGAR_A'
            DataType = datString
            Size = 255
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
          end>
        ReadOnly = True
      end
      item
        IsPublic = False
        Params = <
          item
            Name = 'ID_ALBARAN'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            SQL = 
              'SELECT DET.ID, DET.ID_ALBARAN,'#10'       DET.POSICION, DET.TIPO_DET' +
              'ALLE,'#10'       ARTICULOS.REFERENCIA, F_RTFTOTEXT(CONCEPTO) as CONC' +
              'EPTO, DET.CANTIDAD,'#10'       DET.UNIDAD_MEDIDA, DET.IMPORTE_UNIDAD' +
              ' - (DET.IMPORTE_UNIDAD * (COALESCE(DET.DESCUENTO,0) / 100)) as I' +
              'MPORTE_UNIDAD, DET.IMPORTE_TOTAL,'#10'       ARTICULOS_PROVEEDORES.R' +
              'EFERENCIA_PROV as REFERENCIA_PROVEEDOR,'#10'       ARTICULOS.REFEREN' +
              'CIA_FABR as REFERENCIA_FABRICANTE'#10'FROM ALBARANES_PROVEEDOR_DETAL' +
              'LES DET'#10'LEFT OUTER JOIN ARTICULOS ON (DET.ID_ARTICULO = ARTICULO' +
              'S.ID)'#10'LEFT JOIN ALBARANES_PROVEEDOR ON (ALBARANES_PROVEEDOR.ID =' +
              ' DET.ID_ALBARAN)'#10'LEFT JOIN ARTICULOS_PROVEEDORES ON ((ARTICULOS_' +
              'PROVEEDORES.ID_ARTICULO = ARTICULOS.ID) AND (ARTICULOS_PROVEEDOR' +
              'ES.ID_PROVEEDOR = ALBARANES_PROVEEDOR.ID_PROVEEDOR))'#10'WHERE DET.I' +
              'D_ALBARAN = :ID_ALBARAN AND DET.VISIBLE = 1 AND {Where}'#10'ORDER BY' +
              ' DET.ID_ALBARAN, DET.POSICION;'#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'ID_ALBARAN'
                TableField = 'ID_ALBARAN'
              end
              item
                DatasetField = 'POSICION'
                TableField = 'POSICION'
              end
              item
                DatasetField = 'TIPO_DETALLE'
                TableField = 'TIPO_DETALLE'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'CONCEPTO'
                TableField = 'CONCEPTO'
              end
              item
                DatasetField = 'CANTIDAD'
                TableField = 'CANTIDAD'
              end
              item
                DatasetField = 'UNIDAD_MEDIDA'
                TableField = 'UNIDAD_MEDIDA'
              end
              item
                DatasetField = 'IMPORTE_UNIDAD'
                TableField = 'IMPORTE_UNIDAD'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'REFERENCIA_PROVEEDOR'
                TableField = 'REFERENCIA_PROVEEDOR'
              end
              item
                DatasetField = 'REFERENCIA_FABRICANTE'
                TableField = 'REFERENCIA_FABRICANTE'
              end>
          end>
        Name = 'Informe_Detalles'
        Fields = <
          item
            Name = 'ID'
            DataType = datInteger
          end
          item
            Name = 'ID_ALBARAN'
            DataType = datInteger
          end
          item
            Name = 'POSICION'
            DataType = datInteger
          end
          item
            Name = 'TIPO_DETALLE'
            DataType = datString
            Size = 25
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 2000
          end
          item
            Name = 'CANTIDAD'
            DataType = datFloat
          end
          item
            Name = 'UNIDAD_MEDIDA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'IMPORTE_UNIDAD'
            DataType = datFloat
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
          end
          item
            Name = 'REFERENCIA_PROVEEDOR'
            DataType = datString
            Size = 255
          end
          item
            Name = 'REFERENCIA_FABRICANTE'
            DataType = datString
            Size = 255
          end>
        ReadOnly = True
      end>
    JoinDataTables = <>
    UnionDataTables = <>
    Commands = <>
    RelationShips = <>
    UpdateRules = <>
    Version = 0
    Left = 48
    Top = 16
  end
  object DataDictionary: TDADataDictionary
    Fields = <>
    Left = 46
    Top = 142
  end
  object DABin2DataStreamer: TDABin2DataStreamer
    Left = 48
    Top = 80
  end
  object tbl_Cabecera: TDAMemDataTable
    RemoteUpdatesOptions = []
    Fields = <
      item
        Name = 'ID'
        DataType = datInteger
      end
      item
        Name = 'ID_EMPRESA'
        DataType = datInteger
      end
      item
        Name = 'TIPO'
        DataType = datString
        Size = 1
      end
      item
        Name = 'REFERENCIA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'FECHA_ALBARAN'
        DataType = datDateTime
      end
      item
        Name = 'OBSERVACIONES'
        DataType = datMemo
      end
      item
        Name = 'NOMBRE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'FAX'
        DataType = datString
        Size = 25
      end
      item
        Name = 'PERSONA_CONTACTO'
        DataType = datString
        Size = 255
      end
      item
        Name = 'CODIGO_CLIENTE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'ID_ALMACEN'
        DataType = datInteger
      end
      item
        Name = 'CALLE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'POBLACION'
        DataType = datString
        Size = 255
      end
      item
        Name = 'PROVINCIA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'CODIGO_POSTAL'
        DataType = datString
        Size = 10
      end
      item
        Name = 'ENTREGAR_A'
        DataType = datString
        Size = 255
      end
      item
        Name = 'IMPORTE_TOTAL'
        DataType = datCurrency
      end>
    Params = <
      item
        Name = 'ID'
        Value = '3'
        ParamType = daptInput
      end>
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    LocalSchema = schReport
    LocalDataStreamer = DABin2DataStreamer
    LogicalName = 'Informe_Cabecera'
    IndexDefs = <>
    Left = 168
    Top = 16
  end
  object tbl_Detalles: TDAMemDataTable
    RemoteUpdatesOptions = []
    Fields = <
      item
        Name = 'ID'
        DataType = datInteger
      end
      item
        Name = 'ID_ALBARAN'
        DataType = datInteger
      end
      item
        Name = 'POSICION'
        DataType = datInteger
      end
      item
        Name = 'TIPO_DETALLE'
        DataType = datString
        Size = 25
      end
      item
        Name = 'REFERENCIA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'CONCEPTO'
        DataType = datString
        Size = 2000
      end
      item
        Name = 'CANTIDAD'
        DataType = datFloat
      end
      item
        Name = 'UNIDAD_MEDIDA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'IMPORTE_UNIDAD'
        DataType = datFloat
      end
      item
        Name = 'IMPORTE_TOTAL'
        DataType = datCurrency
      end
      item
        Name = 'REFERENCIA_PROVEEDOR'
        DataType = datString
        Size = 255
      end
      item
        Name = 'REFERENCIA_FABRICANTE'
        DataType = datString
        Size = 255
      end>
    Params = <
      item
        Name = 'ID_ALBARAN'
        Value = ''
        ParamType = daptInput
      end>
    MasterParamsMappings.Strings = (
      'ID_PRESUPUESTO=ID_PRESUPUESTO')
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    LocalSchema = schReport
    LocalDataStreamer = DABin2DataStreamer
    LogicalName = 'Informe_Detalles'
    IndexDefs = <>
    Left = 264
    Top = 16
  end
  object tbl_Empresa: TDAMemDataTable
    RemoteUpdatesOptions = []
    Fields = <>
    Params = <
      item
        Name = 'ID'
        Value = '31'
        ParamType = daptInput
      end>
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    LogicalName = 'Empresa'
    IndexDefs = <>
    Left = 168
    Top = 80
  end
end
