object RptFacturasProveedor: TRptFacturasProveedor
  OldCreateOrder = True
  OnCreate = DataModuleCreate
  OnDestroy = DataModuleDestroy
  Height = 405
  Width = 763
  object frxRichObject1: TfrxRichObject
    Left = 48
    Top = 296
  end
  object frxBarCodeObject1: TfrxBarCodeObject
    Left = 144
    Top = 296
  end
  object frxOLEObject1: TfrxOLEObject
    Left = 48
    Top = 344
  end
  object frxCrossObject1: TfrxCrossObject
    Left = 144
    Top = 344
  end
  object frxCheckBoxObject1: TfrxCheckBoxObject
    Left = 256
    Top = 296
  end
  object frxGradientObject1: TfrxGradientObject
    Left = 360
    Top = 296
  end
  object frxChartObject1: TfrxChartObject
    Left = 256
    Top = 344
  end
  object schReport: TDASchema
    ConnectionManager = dmServer.ConnectionManager
    DataDictionary = DataDictionary
    Datasets = <
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'v_facturas_proveedor'
            Name = 'IBX'
            SQL = 
              'select V_facturas_proveedor.ID_EMPRESA,'#10'contactos.REFERENCIA,'#10'co' +
              'ntactos.nif_cif,'#10'contactos.poblacion,'#10'V_facturas_proveedor.NOMBR' +
              'E,'#10'sum(V_facturas_proveedor.BASE_IMPONIBLE) as BASE_IMPONIBLE,'#10's' +
              'um(V_facturas_proveedor.IMPORTE_IVA) as IMPORTE_IVA,'#10'sum(V_factu' +
              'ras_proveedor.IMPORTE_TOTAL) AS IMPORTE_TOTAL'#10'from V_facturas_pr' +
              'oveedor'#10'left join contactos on (contactos.ID = V_facturas_provee' +
              'dor.ID_PROVEEDOR)'#10'group by 1,2,3,4,5'#10'order by 1,5,2,3,4'#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_EMPRESA'
                TableField = 'ID_EMPRESA'
              end
              item
                DatasetField = 'NOMBRE'
                TableField = 'NOMBRE'
              end
              item
                DatasetField = 'BASE_IMPONIBLE'
                TableField = 'BASE_IMPONIBLE'
              end
              item
                DatasetField = 'IMPORTE_IVA'
                TableField = 'IMPORTE_IVA'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'NIF_CIF'
                TableField = 'NIF_CIF'
              end
              item
                DatasetField = 'POBLACION'
                TableField = 'POBLACION'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end>
          end>
        Name = 'ListadoFacturasProveedorResumen'
        Fields = <
          item
            Name = 'ID_EMPRESA'
            DataType = datInteger
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 255
          end
          item
            Name = 'NIF_CIF'
            DataType = datString
            Size = 15
          end
          item
            Name = 'POBLACION'
            DataType = datString
            Size = 255
          end
          item
            Name = 'NOMBRE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'BASE_IMPONIBLE'
            DataType = datCurrency
          end
          item
            Name = 'IMPORTE_IVA'
            DataType = datCurrency
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'V_FACTURAS_PROVEEDOR'
            SQL = 
              'select ID_EMPRESA,'#10'extract (year from fecha_factura) as ANO,'#10'ext' +
              'ract (month from fecha_factura) as MES,'#10'case'#10'when extract (month' +
              ' from fecha_factura) = 1 then '#39'ENERO - '#39' || extract (year from f' +
              'echa_factura)'#10'when extract (month from fecha_factura) = 2 then '#39 +
              'FEBRERO - '#39' || extract (year from fecha_factura)'#10'when extract (m' +
              'onth from fecha_factura) = 3 then '#39'MARZO - '#39' || extract (year fr' +
              'om fecha_factura)'#10'when extract (month from fecha_factura) = 4 th' +
              'en '#39'ABRIL - '#39' || extract (year from fecha_factura)'#10'when extract ' +
              '(month from fecha_factura) = 5 then '#39'MAYO - '#39' || extract (year f' +
              'rom fecha_factura)'#10'when extract (month from fecha_factura) = 6 t' +
              'hen '#39'JUNIO - '#39' || extract (year from fecha_factura)'#10'when extract' +
              ' (month from fecha_factura) = 7 then '#39'JULIO - '#39' || extract (year' +
              ' from fecha_factura)'#10'when extract (month from fecha_factura) = 8' +
              ' then '#39'AGOSTO - '#39' || extract (year from fecha_factura)'#10'when extr' +
              'act (month from fecha_factura) = 9 then '#39'SEPTIEMBRE - '#39' || extra' +
              'ct (year from fecha_factura)'#10'when extract (month from fecha_fact' +
              'ura) = 10 then '#39'OCTUBRE - '#39' || extract (year from fecha_factura)' +
              #10'when extract (month from fecha_factura) = 11 then '#39'NOVIEMBRE - ' +
              #39' || extract (year from fecha_factura)'#10'when extract (month from ' +
              'fecha_factura) = 12 then '#39'DICIEMBRE - '#39' || extract (year from fe' +
              'cha_factura)'#10'end as TITULO,'#10'REFERENCIA, REFERENCIA_PROVEEDOR, ID' +
              '_PROVEEDOR, NOMBRE, SITUACION, NIF_CIF,'#10'FECHA_FACTURA, FECHA_VEN' +
              'CIMIENTO, BASE_IMPONIBLE, IMPORTE_IVA, IMPORTE_TOTAL'#10#10'from V_fac' +
              'turas_proveedor'#10'where {where}'#10'order by ANO, MES, FECHA_FACTURA, ' +
              'NOMBRE'#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_EMPRESA'
                TableField = 'ID_EMPRESA'
              end
              item
                DatasetField = 'MES'
                TableField = '<unknown>'
                SQLOrigin = 'MES'
              end
              item
                DatasetField = 'TITULO'
                TableField = '<unknown>'
                SQLOrigin = 'TITULO'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'ID_PROVEEDOR'
                TableField = 'ID_PROVEEDOR'
              end
              item
                DatasetField = 'NOMBRE'
                TableField = 'NOMBRE'
              end
              item
                DatasetField = 'SITUACION'
                TableField = 'SITUACION'
              end
              item
                DatasetField = 'NIF_CIF'
                TableField = 'NIF_CIF'
              end
              item
                DatasetField = 'FECHA_FACTURA'
                TableField = 'FECHA_FACTURA'
              end
              item
                DatasetField = 'BASE_IMPONIBLE'
                TableField = 'BASE_IMPONIBLE'
              end
              item
                DatasetField = 'IMPORTE_IVA'
                TableField = 'IMPORTE_IVA'
              end
              item
                DatasetField = 'IMPORTE_TOTAL'
                TableField = 'IMPORTE_TOTAL'
              end
              item
                DatasetField = 'ANO'
                TableField = '<unknown>'
                SQLOrigin = 'ANO'
              end
              item
                DatasetField = 'FECHA_VENCIMIENTO'
                TableField = 'FECHA_VENCIMIENTO'
              end
              item
                DatasetField = 'REFERENCIA_PROVEEDOR'
                TableField = 'REFERENCIA_PROVEEDOR'
              end>
          end>
        Name = 'ListadoFacturasProveedor'
        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 = 'REFERENCIA_PROVEEDOR'
            DataType = datString
            Size = 255
          end
          item
            Name = 'ID_PROVEEDOR'
            DataType = datInteger
          end
          item
            Name = 'NOMBRE'
            DataType = datString
            Size = 255
          end
          item
            Name = 'SITUACION'
            DataType = datString
            Size = 19
          end
          item
            Name = 'NIF_CIF'
            DataType = datString
            Size = 15
          end
          item
            Name = 'FECHA_FACTURA'
            DataType = datDateTime
          end
          item
            Name = 'FECHA_VENCIMIENTO'
            DataType = datDateTime
          end
          item
            Name = 'BASE_IMPONIBLE'
            DataType = datCurrency
          end
          item
            Name = 'IMPORTE_IVA'
            DataType = datCurrency
          end
          item
            Name = 'IMPORTE_TOTAL'
            DataType = datCurrency
          end>
      end>
    JoinDataTables = <>
    UnionDataTables = <>
    Commands = <>
    RelationShips = <>
    UpdateRules = <>
    Version = 0
    Left = 48
    Top = 16
  end
  object DataDictionary: TDADataDictionary
    Fields = <
      item
        Name = 'FacturasCliente_ID'
        DataType = datAutoInc
        Required = True
        DisplayLabel = 'ID'
      end
      item
        Name = 'FacturasCliente_ID_EMPRESA'
        DataType = datInteger
        DisplayLabel = 'ID_EMPRESA'
      end
      item
        Name = 'FacturasCliente_ID_CONTRATO'
        DataType = datInteger
        DisplayLabel = 'ID_CONTRATO'
      end
      item
        Name = 'FacturasCliente_FECHA_FACTURA'
        DataType = datDateTime
        DisplayLabel = 'Fecha de las factura'
      end
      item
        Name = 'FacturasCliente_VENCIMIENTO'
        DataType = datInteger
        DisplayLabel = 'Vencimiento'
      end
      item
        Name = 'FacturasCliente_SITUACION'
        DataType = datString
        Size = 255
        DisplayLabel = 'Situaci'#243'n'
      end
      item
        Name = 'FacturasCliente_BASE_IMPONIBLE'
        DataType = datFloat
        DisplayLabel = 'Base imponible'
        Alignment = taRightJustify
      end
      item
        Name = 'FacturasCliente_IMPORTE_DESCUENTO'
        DataType = datFloat
        DisplayLabel = 'Importe dto.'
        Alignment = taRightJustify
      end
      item
        Name = 'FacturasCliente_IMPORTE_IVA'
        DataType = datFloat
        DisplayLabel = 'Importe IVA'
        Alignment = taRightJustify
      end
      item
        Name = 'FacturasCliente_IMPORTE_TOTAL'
        DataType = datFloat
        DisplayLabel = 'Importe total'
        Alignment = taRightJustify
      end
      item
        Name = 'FacturasCliente_FORMA_PAGO'
        DataType = datMemo
        DisplayLabel = 'Forma de pago'
      end
      item
        Name = 'FacturasCliente_ID_CLIENTE'
        DataType = datInteger
        DisplayLabel = 'ID_CLIENTE'
      end
      item
        Name = 'FacturasCliente_NIF_CIF'
        DataType = datString
        Size = 15
        DisplayLabel = 'NIF/CIF'
      end
      item
        Name = 'FacturasCliente_CODIGO_POSTAL'
        DataType = datString
        Size = 10
        DisplayLabel = 'C'#243'd. postal'
      end
      item
        Name = 'FacturasCliente_FECHA_ALTA'
        DataType = datDateTime
        DisplayLabel = 'FECHA_ALTA'
      end
      item
        Name = 'FacturasCliente_FECHA_MODIFICACION'
        DataType = datDateTime
        DisplayLabel = 'FECHA_MODIFICACION'
      end
      item
        Name = 'FacturasCliente_OBSERVACIONES'
        DataType = datMemo
        DisplayLabel = 'Observaciones'
      end
      item
        Name = 'FacturasCliente_NOMBRE'
        DataType = datString
        Size = 100
        DisplayLabel = 'Cliente'
      end
      item
        Name = 'FacturasCliente_CALLE'
        DataType = datString
        Size = 150
        DisplayLabel = 'Direcci'#243'n'
      end
      item
        Name = 'FacturasCliente_PROVINCIA'
        DataType = datString
        Size = 30
        DisplayLabel = 'Provincia'
      end
      item
        Name = 'FacturasCliente_POBLACION'
        DataType = datString
        Size = 150
        DisplayLabel = 'Poblaci'#243'n'
      end
      item
        Name = 'FacturasCliente_IVA'
        DataType = datFloat
        DisplayLabel = 'IVA'
      end
      item
        Name = 'FacturasCliente_USUARIO'
        DataType = datString
        Size = 100
        DisplayLabel = 'USUARIO'
      end
      item
        Name = 'FacturasCliente_REFERENCIA'
        DataType = datString
        Size = 20
        DisplayLabel = 'Referencia'
      end
      item
        Name = 'FacturasCliente_DESCUENTO'
        DataType = datFloat
        DisplayLabel = 'Dto.'
      end
      item
        Name = 'FacturasCliente_Detalles_ID'
        DataType = datAutoInc
        Required = True
        DisplayLabel = 'ID'
      end
      item
        Name = 'FacturasCliente_Detalles_ID_FACTURA'
        DataType = datInteger
        DisplayLabel = 'ID_FACTURA'
      end
      item
        Name = 'FacturasCliente_Detalles_TIPO_DETALLE'
        DataType = datString
        Size = 10
        DisplayLabel = 'Tipo detalle'
      end
      item
        Name = 'FacturasCliente_Detalles_CONCEPTO'
        DataType = datString
        Size = 2000
        DisplayLabel = 'Concepto'
      end
      item
        Name = 'FacturasCliente_Detalles_IMPORTE_UNIDAD'
        DataType = datFloat
        DisplayLabel = 'Importe unidad'
        Alignment = taRightJustify
      end
      item
        Name = 'FacturasCliente_Detalles_IMPORTE_TOTAL'
        DataType = datFloat
        DisplayLabel = 'Importe total'
        Alignment = taRightJustify
      end
      item
        Name = 'FacturasCliente_Detalles_VISIBLE'
        DataType = datInteger
        DisplayLabel = #191'Visible?'
      end
      item
        Name = 'FacturasCliente_Detalles_POSICION'
        DataType = datInteger
        DisplayLabel = 'Posici'#243'n'
      end
      item
        Name = 'FacturasCliente_Detalles_CANTIDAD'
        DataType = datInteger
        DisplayLabel = 'Cantidad'
      end>
    Left = 46
    Top = 158
  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 = 37800.807714351900000000
    ReportOptions.LastChange = 39884.811485821760000000
    ScriptLanguage = 'PascalScript'
    ScriptText.Strings = (
      'procedure mContinuaOnBeforePrint(Sender: TfrxComponent);'
      'begin'
      ' if Engine.FinalPass then'
      '  begin'
      '    if (<Page#> = <TotalPages#>) then'
      '    begin                      '
      '       mContinua.Visible := False;'
      '    end                 '
      '    else'
      '    begin                '
      '       mContinua.Visible := True;'
      '    end               '
      '  end;               '
      'end;'
      ''
      'begin'
      ''
      'end.')
    ShowProgress = False
    StoreInDFM = False
    OnStartReport = 'frxReportOnStartReport'
    Left = 169
    Top = 16
  end
  object tbl_InformeListadoFacturas: TDAMemDataTable
    RemoteUpdatesOptions = []
    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 = 'SITUACION'
        DataType = datString
        Size = 19
      end
      item
        Name = 'NIF_CIF'
        DataType = datString
        Size = 15
      end
      item
        Name = 'FECHA'
        DataType = datDateTime
      end
      item
        Name = 'FECHA_FACTURA'
        DataType = datDateTime
      end
      item
        Name = 'BASE_IMPONIBLE'
        DataType = datCurrency
      end
      item
        Name = 'IMPORTE_IVA'
        DataType = datCurrency
      end
      item
        Name = 'IMPORTE_TOTAL'
        DataType = datCurrency
      end>
    Params = <>
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    LocalSchema = schReport
    LocalDataStreamer = Bin2DataStreamer
    LogicalName = 'ListadoFacturasProveedor'
    IndexDefs = <>
    Left = 464
    Top = 128
  end
  object DADSInformeListadoFacturas: TDADataSource
    DataSet = tbl_InformeListadoFacturas.Dataset
    DataTable = tbl_InformeListadoFacturas
    Left = 464
    Top = 72
  end
  object frxDBInformeListadoFacturas: TfrxDBDataset
    UserName = 'frxDBInformeListadoFacturas'
    CloseDataSource = True
    DataSource = DADSInformeListadoFacturas
    Left = 464
    Top = 16
  end
  object Bin2DataStreamer: TDABin2DataStreamer
    Left = 48
    Top = 80
  end
  object frxDBInformeListadoFacturasResumen: TfrxDBDataset
    UserName = 'frxDBInformeListadoFacturasResumen'
    CloseDataSource = True
    DataSource = DADSInformeListadoFacturasResumen
    Left = 648
    Top = 24
  end
  object DADSInformeListadoFacturasResumen: TDADataSource
    DataSet = tbl_InformeListadoFacturasResumen.Dataset
    DataTable = tbl_InformeListadoFacturasResumen
    Left = 648
    Top = 80
  end
  object tbl_InformeListadoFacturasResumen: TDAMemDataTable
    RemoteUpdatesOptions = []
    Fields = <>
    Params = <>
    MasterMappingMode = mmDataRequest
    LogChanges = False
    StreamingOptions = [soDisableEventsWhileStreaming]
    RemoteFetchEnabled = False
    IndexDefs = <>
    Left = 648
    Top = 136
  end
end
