object RptAlbaranesProveedor: TRptAlbaranesProveedor
  OldCreateOrder = True
  OnCreate = DataModuleCreate
  OnDestroy = DataModuleDestroy
  Height = 471
  Width = 448
  object DADSCabecera: TDADataSource
    DataSet = tbl_Cabecera.Dataset
    DataTable = tbl_Cabecera
    Left = 264
    Top = 72
  end
  object DADSDetalles: TDADataSource
    DataSet = tbl_Detalles.Dataset
    DataTable = tbl_Detalles
    Left = 344
    Top = 72
  end
  object frxRichObject1: TfrxRichObject
    Left = 280
    Top = 360
  end
  object frxBarCodeObject1: TfrxBarCodeObject
    Left = 344
    Top = 360
  end
  object frxOLEObject1: TfrxOLEObject
    Left = 280
    Top = 408
  end
  object frxCrossObject1: TfrxCrossObject
    Left = 344
    Top = 408
  end
  object frxCheckBoxObject1: TfrxCheckBoxObject
    Left = 280
    Top = 256
  end
  object frxGradientObject1: TfrxGradientObject
    Left = 344
    Top = 256
  end
  object frxChartObject1: TfrxChartObject
    Left = 280
    Top = 304
  end
  object schReport: TDASchema
    ConnectionManager = dmServer.ConnectionManager
    Datasets = <
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'select ID_EMPRESA,'#10'extract (year from FECHA_ALBARAN) as ANO,'#10'ext' +
              'ract (month from FECHA_ALBARAN) as MES,'#10'case'#10'when extract (month' +
              ' from FECHA_ALBARAN) = 1 then '#39'ENERO - '#39' || extract (year from F' +
              'ECHA_ALBARAN)'#10'when extract (month from FECHA_ALBARAN) = 2 then '#39 +
              'FEBRERO - '#39' || extract (year from FECHA_ALBARAN)'#10'when extract (m' +
              'onth from FECHA_ALBARAN) = 3 then '#39'MARZO - '#39' || extract (year fr' +
              'om FECHA_ALBARAN)'#10'when extract (month from FECHA_ALBARAN) = 4 th' +
              'en '#39'ABRIL - '#39' || extract (year from FECHA_ALBARAN)'#10'when extract ' +
              '(month from FECHA_ALBARAN) = 5 then '#39'MAYO - '#39' || extract (year f' +
              'rom FECHA_ALBARAN)'#10'when extract (month from FECHA_ALBARAN) = 6 t' +
              'hen '#39'JUNIO - '#39' || extract (year from FECHA_ALBARAN)'#10'when extract' +
              ' (month from FECHA_ALBARAN) = 7 then '#39'JULIO - '#39' || extract (year' +
              ' from FECHA_ALBARAN)'#10'when extract (month from FECHA_ALBARAN) = 8' +
              ' then '#39'AGOSTO - '#39' || extract (year from FECHA_ALBARAN)'#10'when extr' +
              'act (month from FECHA_ALBARAN) = 9 then '#39'SEPTIEMBRE - '#39' || extra' +
              'ct (year from FECHA_ALBARAN)'#10'when extract (month from FECHA_ALBA' +
              'RAN) = 10 then '#39'OCTUBRE - '#39' || extract (year from FECHA_ALBARAN)' +
              #10'when extract (month from FECHA_ALBARAN) = 11 then '#39'NOVIEMBRE - ' +
              #39' || extract (year from FECHA_ALBARAN)'#10'when extract (month from ' +
              'FECHA_ALBARAN) = 12 then '#39'DICIEMBRE - '#39' || extract (year from FE' +
              'CHA_ALBARAN)'#10'end as TITULO,'#10'REFERENCIA,  ID_PROVEEDOR, NOMBRE, F' +
              'ECHA_ALBARAN, IMPORTE_TOTAL'#10'from V_ALBARANES_PROVEEDOR'#10'where {wh' +
              'ere}'#10'order by ANO, MES, NOMBRE'#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_EMPRESA'
                TableField = 'ID_EMPRESA'
              end
              item
                DatasetField = 'ANO'
                TableField = 'ANO'
              end
              item
                DatasetField = 'MES'
                TableField = 'MES'
              end
              item
                DatasetField = 'TITULO'
                TableField = 'TITULO'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'ID_PROVEEDOR'
                TableField = 'ID_PROVEEDOR'
              end
              item
                DatasetField = 'NOMBRE'
                TableField = 'NOMBRE'
              end
              item
                DatasetField = 'FECHA_ALBARAN'
                TableField = 'FECHA_ALBARAN'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end>
          end>
        Name = 'InformeListadoPedidos'
        Fields = <
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
          end
          item
            Name = 'ANO'
            DataType = datSmallInt
          end
          item
            Name = 'MES'
            DataType = datSmallInt
          end
          item
            Name = 'TITULO'
            DataType = datString
            Size = 19
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'ID_PROVEEDOR'
            DataType = datInteger
          end
          item
            Name = 'NOMBRE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'FECHA_ALBARAN'
            DataType = datDateTime
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
          end>
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datInteger
            Value = '11'
            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 = 'FECHA_ALBARAN'
                TableField = 'FECHA_ALBARAN'
              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 = 'CODIGO_CLIENTE'
                TableField = 'CODIGO_CLIENTE'
              end
              item
                DatasetField = 'ID_ALMACEN'
                TableField = 'ID_ALMACEN'
              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
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'TIPO'
                TableField = 'TIPO'
              end>
          end>
        Name = 'Informe_Cabecera'
        Fields = <
          item
            Name = 'ID'
            DataType = datInteger
            InPrimaryKey = True
          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>
      end
      item
        Params = <
          item
            Name = 'ID_ALBARAN'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'ALBARANES_PROVEEDOR_DETALLES'
            SQL = 
              'SELECT DET.ID, DET.ID_ALBARAN,'#10'       DET.POSICION, DET.TIPO_DET' +
              'ALLE,'#10'       ARTICULOS.REFERENCIA, DET.CONCEPTO, DET.CANTIDAD,'#10' ' +
              '      DET.UNIDAD_MEDIDA, DET.IMPORTE_UNIDAD - (DET.IMPORTE_UNIDA' +
              'D * (COALESCE(DET.DESCUENTO,0) / 100)) as IMPORTE_UNIDAD, DET.IM' +
              'PORTE_TOTAL,'#10'       ARTICULOS_PROVEEDORES.REFERENCIA_PROV as REF' +
              'ERENCIA_PROVEEDOR,'#10'       ARTICULOS.REFERENCIA_FABR as REFERENCI' +
              'A_FABRICANTE'#10'FROM ALBARANES_PROVEEDOR_DETALLES DET'#10'LEFT OUTER JO' +
              'IN ARTICULOS ON (DET.ID_ARTICULO = ARTICULOS.ID)'#10'LEFT JOIN ALBAR' +
              'ANES_PROVEEDOR ON (ALBARANES_PROVEEDOR.ID = DET.ID_ALBARAN)'#10'LEFT' +
              ' JOIN ARTICULOS_PROVEEDORES ON ((ARTICULOS_PROVEEDORES.ID_ARTICU' +
              'LO = ARTICULOS.ID) AND (ARTICULOS_PROVEEDORES.ID_PROVEEDOR = ALB' +
              'ARANES_PROVEEDOR.ID_PROVEEDOR))'#10'WHERE DET.ID_ALBARAN = :ID_ALBAR' +
              'AN 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 = '<unknown>'
                SQLOrigin = '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 = '<unknown>'
                SQLOrigin = 'REFERENCIA_PROVEEDOR'
              end
              item
                DatasetField = 'REFERENCIA_FABRICANTE'
                TableField = '<unknown>'
                SQLOrigin = 'REFERENCIA_FABRICANTE'
              end>
          end>
        Name = 'Informe_Detalles'
        Fields = <
          item
            Name = 'ID'
            DataType = datInteger
            InPrimaryKey = True
          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>
      end>
    JoinDataTables = <>
    UnionDataTables = <>
    Commands = <>
    RelationShips = <>
    UpdateRules = <>
    Version = 0
    Left = 48
    Top = 16
  end
  object frxReport: TfrxReport
    Version = '4.3'
    DotMatrixReport = False
    EngineOptions.DoublePass = True
    IniFile = '\Software\Fast Reports'
    PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
    PreviewOptions.Zoom = 1.000000000000000000
    PrintOptions.Printer = 'Por defecto'
    PrintOptions.PrintOnSheet = 0
    ReportOptions.CreateDate = 39065.872423495400000000
    ReportOptions.LastChange = 39829.854499780090000000
    ScriptLanguage = 'PascalScript'
    ScriptText.Strings = (
      ''
      'procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent);'
      'var'
      '  Cadena: String;'
      'begin'
      '{  DatosEmpresa.Lines.Clear;'
      '  if (<frxDBCabecera."TELEFONO_1_EMPRESA"> <> '#39#39') then'
      '       Cadena := '#39'TLF: '#39' + <frxDBCabecera."TELEFONO_1_EMPRESA">;'
      '  if (<frxDBCabecera."FAX_EMPRESA"> <> '#39#39') then'
      
        '       Cadena := Cadena + '#39' FAX: '#39' + <frxDBCabecera."FAX_EMPRESA' +
        '">;'
      '  DatosEmpresa.Lines.Add(Cadena);'
      '}'
      'end;'
      ''
      'procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent);'
      'begin'
      '{  NombreEmpresa.Lines.Clear;'
      '  NombreEmpresa.Lines.Add(<frxDBCabecera."NOMBRE_EMPRESA">);'
      '}'
      'end;'
      ''
      'procedure Memo35OnBeforePrint(Sender: TfrxComponent);'
      'begin'
      
        '{  if not <ImprimirPrecio> then                                 ' +
        '                   '
      '       Memo35.Lines.Clear;}          '
      'end;'
      ''
      'procedure Memo36OnBeforePrint(Sender: TfrxComponent);'
      'begin'
      
        '{  if not <ImprimirPrecio> then                                 ' +
        '                   '
      '       Memo36.Lines.Clear;}          '
      'end;'
      ''
      'procedure Memo6OnBeforePrint(Sender: TfrxComponent);'
      'begin'
      
        '{  if not <ImprimirRefProveedor> then                           ' +
        '                         '
      '       Memo6.Lines.Clear;}          '
      'end;'
      ''
      'procedure PageHeader2OnBeforePrint(Sender: TfrxComponent);'
      'begin'
      '   if not Engine.FinalPass then'
      '     Set('#39'TotalPaginas'#39', (<TotalPaginas> + 1));'
      ''
      '  if Engine.FinalPass then'
      '     Set('#39'Pagina'#39', (<Pagina> + 1));    '
      'end;'
      ''
      'procedure frxReportOnStartReport(Sender: TfrxComponent);'
      'begin'
      '  Set('#39'Pagina'#39', 0);'
      '  Set('#39'TotalPaginas'#39', 0);      '
      'end;'
      ''
      'procedure Memo21OnBeforePrint(Sender: TfrxComponent);'
      'begin'
      '  if (<frxDBCabecera."TIPO"> = '#39'D'#39') then'
      '  begin              '
      '       Memo21.Lines.Clear;'
      '       Memo21.Lines.Add('#39'ORDEN DE DEVOLUCION'#39');'
      '  end;                     '
      'end;'
      ''
      'begin'
      ''
      'end.')
    ShowProgress = False
    StoreInDFM = False
    OnStartReport = 'frxReportOnStartReport'
    Left = 145
    Top = 16
  end
  object frxDBCabecera: TfrxDBDataset
    UserName = 'frxDBCabecera'
    CloseDataSource = False
    DataSource = DADSCabecera
    Left = 264
    Top = 16
  end
  object frxDBDetalles: TfrxDBDataset
    UserName = 'frxDBDetalles'
    CloseDataSource = False
    DataSource = DADSDetalles
    Left = 344
    Top = 16
  end
  object IBDatabase1: TIBDatabase
    DatabaseName = 'C:\Codigo Tecsitel\Database\FACTUGES.FDB'
    Params.Strings = (
      'user_name=sysdba'
      'password=masterkey'
      'lc_ctype=ISO8859_1')
    LoginPrompt = False
    DefaultTransaction = IBTransaction1
    Left = 40
    Top = 256
  end
  object IBTransaction1: TIBTransaction
    Left = 40
    Top = 312
  end
  object DataSource1: TDataSource
    DataSet = cabecera
    Left = 176
    Top = 256
  end
  object DataSource3: TDataSource
    DataSet = detalles
    Left = 176
    Top = 320
  end
  object detalles: TIBQuery
    Database = IBDatabase1
    Transaction = IBTransaction1
    SQL.Strings = (
      
        'SELECT ALBARANES_PROVEEDOR_DETALLES.ID, ALBARANES_PROVEEDOR_DETA' +
        'LLES.ID_ALBARAN,'
      
        '       ALBARANES_PROVEEDOR_DETALLES.POSICION, ALBARANES_PROVEEDO' +
        'R_DETALLES.TIPO_DETALLE,'
      
        '       F_RTFTOTEXT(ALBARANES_PROVEEDOR_DETALLES.CONCEPTO) as CON' +
        'CEPTO, ALBARANES_PROVEEDOR_DETALLES.CANTIDAD,'
      '       ALBARANES_PROVEEDOR_DETALLES.UNIDAD_MEDIDA,'
      
        '       ALBARANES_PROVEEDOR_DETALLES.IMPORTE_UNIDAD, ALBARANES_PR' +
        'OVEEDOR_DETALLES.IMPORTE_TOTAL,'
      '       ARTICULOS.REFERENCIA'
      'FROM ALBARANES_PROVEEDOR_DETALLES'
      
        '     LEFT JOIN ARTICULOS ON (ALBARANES_PROVEEDOR_DETALLES.ID_ART' +
        'ICULO = ARTICULOS.ID)'
      'WHERE'
      '     ID_ALBARAN = :ID_ALBARAN AND (VISIBLE <> 0)'
      'ORDER BY ID_ALBARAN, POSICION')
    Left = 112
    Top = 320
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'ID_ALBARAN'
        ParamType = ptUnknown
      end>
    object detallesID: TIntegerField
      FieldName = 'ID'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."ID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object detallesID_ALBARAN: TIntegerField
      FieldName = 'ID_ALBARAN'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."ID_ALBARAN"'
      Required = True
    end
    object detallesPOSICION: TIntegerField
      FieldName = 'POSICION'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."POSICION"'
    end
    object detallesTIPO_DETALLE: TIBStringField
      FieldName = 'TIPO_DETALLE'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."TIPO_DETALLE"'
      Size = 10
    end
    object detallesCONCEPTO: TIBStringField
      FieldName = 'CONCEPTO'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."CONCEPTO"'
      Size = 254
    end
    object detallesCANTIDAD: TIntegerField
      FieldName = 'CANTIDAD'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."CANTIDAD"'
    end
    object detallesIMPORTE_UNIDAD: TIBBCDField
      FieldName = 'IMPORTE_UNIDAD'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."IMPORTE_UNIDAD"'
      Precision = 18
      Size = 2
    end
    object detallesIMPORTE_TOTAL: TIBBCDField
      FieldName = 'IMPORTE_TOTAL'
      Origin = '"ALBARANES_CLIENTE_DETALLES"."IMPORTE_TOTAL"'
      Precision = 18
      Size = 2
    end
    object detallesREFERENCIA: TIBStringField
      FieldName = 'REFERENCIA'
      Origin = '"ARTICULOS"."REFERENCIA"'
      Size = 255
    end
  end
  object cabecera: TIBQuery
    Database = IBDatabase1
    Transaction = IBTransaction1
    SQL.Strings = (
      'SELECT'
      '  V_ALBARANES_PROVEEDOR.ID, V_ALBARANES_PROVEEDOR.ID_EMPRESA,'
      '  V_ALBARANES_PROVEEDOR.ID_PROVEEDOR,'
      '  V_ALBARANES_PROVEEDOR.FECHA_ALBARAN,'
      '  V_ALBARANES_PROVEEDOR.REFERENCIA,'
      '  V_ALBARANES_PROVEEDOR.REFERENCIA_PROVEEDOR,'
      '  V_ALBARANES_PROVEEDOR.OBSERVACIONES,'
      '  CONTACTOS.NIF_CIF, CONTACTOS.NOMBRE,'
      '  V_ALBARANES_PROVEEDOR.PERSONA_CONTACTO,'
      
        '  COALESCE(CONTACTOS_DIRECCIONES.CALLE, CONTACTOS.CALLE) AS CALL' +
        'E,'
      
        '  COALESCE(CONTACTOS_DIRECCIONES.POBLACION, CONTACTOS.POBLACION)' +
        ' AS POBLACION,'
      
        '  COALESCE(CONTACTOS_DIRECCIONES.PROVINCIA, CONTACTOS.PROVINCIA)' +
        ' AS PROVINCIA,'
      
        '  COALESCE(CONTACTOS_DIRECCIONES.CODIGO_POSTAL, CONTACTOS.CODIGO' +
        '_POSTAL) AS CODIGO_POSTAL'
      'FROM'
      '  V_ALBARANES_PROVEEDOR'
      
        '  INNER JOIN CONTACTOS ON (CONTACTOS.ID = V_ALBARANES_PROVEEDOR.' +
        'ID_PROVEEDOR)'
      
        '  LEFT OUTER JOIN CONTACTOS_DIRECCIONES ON (CONTACTOS_DIRECCIONE' +
        'S.ID = V_ALBARANES_PROVEEDOR.ID_DIRECCION)'
      'WHERE V_ALBARANES_PROVEEDOR.ID = 11')
    Left = 112
    Top = 256
  end
  object tbl_Cabecera: TDAMemDataTable
    RemoteUpdatesOptions = []
    Fields = <
      item
        Name = 'ID'
        DataType = datInteger
        InPrimaryKey = True
      end
      item
        Name = 'ID_EMPRESA'
        DataType = datInteger
      end
      item
        Name = 'ID_PROVEEDOR'
        DataType = datInteger
      end
      item
        Name = 'FECHA_ALBARAN'
        DataType = datDateTime
      end
      item
        Name = 'REFERENCIA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'REFERENCIA_PROVEEDOR'
        DataType = datString
        Size = 255
      end
      item
        Name = 'NIF_CIF'
        DataType = datString
        Size = 15
      end
      item
        Name = 'NOMBRE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'PERSONA_CONTACTO'
        DataType = datString
        Size = 255
      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>
    Params = <
      item
        Name = 'ID'
        DataType = datInteger
        Value = '11'
        ParamType = daptInput
      end>
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    LocalSchema = schReport
    LocalDataStreamer = DABin2DataStreamer1
    DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
    MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
    LogicalName = 'Informe_Cabecera'
    IndexDefs = <>
    Left = 264
    Top = 128
  end
  object tbl_Detalles: TDAMemDataTable
    RemoteUpdatesOptions = []
    Fields = <
      item
        Name = 'ID'
        DataType = datInteger
        InPrimaryKey = True
      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 = 'CONCEPTO'
        DataType = datString
        Size = 32765
      end
      item
        Name = 'CANTIDAD'
        DataType = datFloat
      end
      item
        Name = 'UNIDAD_MEDIDA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'IMPORTE_UNIDAD'
        DataType = datCurrency
      end
      item
        Name = 'IMPORTE_TOTAL'
        DataType = datCurrency
      end
      item
        Name = 'REFERENCIA'
        DataType = datString
        Size = 255
      end>
    Params = <
      item
        Name = 'ID_ALBARAN'
        DataType = datInteger
        Value = '11'
        ParamType = daptInput
      end>
    MasterParamsMappings.Strings = (
      'ID_ALBARAN=ID')
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    LocalSchema = schReport
    LocalDataStreamer = DABin2DataStreamer1
    DetailFields = 'ID_ALBARAN'
    DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
    MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
    LogicalName = 'Informe_Detalles'
    IndexDefs = <>
    Left = 344
    Top = 128
  end
  object frxPDFExport1: TfrxPDFExport
    ShowDialog = False
    UseFileCache = True
    ShowProgress = False
    PrintOptimized = True
    Outline = False
    Author = 'FactuGES'
    Subject = 'FactuGES'
    Background = False
    Creator = 'FactuGES'
    HTMLTags = True
    Left = 344
    Top = 304
  end
  object DABin2DataStreamer1: TDABin2DataStreamer
    Left = 48
    Top = 88
  end
end
