object albaranes: Talbaranes
  Left = 0
  Top = 0
  Caption = 'Albaranes'
  ClientHeight = 764
  ClientWidth = 1056
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  KeyPreview = True
  OldCreateOrder = True
  Position = poOwnerFormCenter
  WindowState = wsMaximized
  OnKeyDown = FormKeyDown
  OnKeyPress = FormKeyPress
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object PageControl1: TPageControl
    Left = 0
    Top = 42
    Width = 1056
    Height = 722
    ActivePage = TabSheet1
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 0
    TabPosition = tpBottom
    object TabSheet1: TTabSheet
      Caption = 'Detalles'
      object Panel1: TPanel
        Left = 0
        Top = 0
        Width = 1048
        Height = 690
        Align = alClient
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
        TabOrder = 0
        object Panel2: TPanel
          Left = 1
          Top = 1
          Width = 1046
          Height = 155
          Align = alTop
          TabOrder = 0
          object Label6: TLabel
            Left = 525
            Top = 1
            Width = 94
            Height = 13
            Alignment = taRightJustify
            Caption = 'Datos del cliente'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ParentFont = False
          end
          object Label7: TLabel
            Left = 526
            Top = 74
            Width = 98
            Height = 13
            Alignment = taRightJustify
            Caption = 'Datos del destino'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ParentFont = False
          end
          object DBText3: TDBText
            Left = 597
            Top = 15
            Width = 210
            Height = 13
            DataField = 'nomcliente'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText4: TDBText
            Left = 526
            Top = 95
            Width = 210
            Height = 13
            DataField = 'nomdestino'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText5: TDBText
            Left = 526
            Top = 25
            Width = 165
            Height = 13
            DataField = 'direccion'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText6: TDBText
            Left = 525
            Top = 36
            Width = 42
            Height = 13
            DataField = 'codpost'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText7: TDBText
            Left = 525
            Top = 47
            Width = 210
            Height = 13
            DataField = 'provincia'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText8: TDBText
            Left = 525
            Top = 58
            Width = 210
            Height = 13
            DataField = 'paiscliente'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText9: TDBText
            Left = 568
            Top = 36
            Width = 170
            Height = 13
            DataField = 'poblacion'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText10: TDBText
            Left = 525
            Top = 15
            Width = 46
            Height = 13
            DataField = 'nif'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText11: TDBText
            Left = 526
            Top = 106
            Width = 167
            Height = 13
            DataField = 'direcciondestino'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText12: TDBText
            Left = 566
            Top = 117
            Width = 170
            Height = 13
            DataField = 'poblaciondestino'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText13: TDBText
            Left = 526
            Top = 117
            Width = 42
            Height = 13
            DataField = 'codpostdestino'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText14: TDBText
            Left = 526
            Top = 127
            Width = 210
            Height = 13
            DataField = 'poblaciondestino'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object DBText15: TDBText
            Left = 526
            Top = 138
            Width = 210
            Height = 13
            DataField = 'paisdestino'
            DataSource = dsalbaranes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -9
            Font.Name = 'Tahoma'
            Font.Style = []
            ParentFont = False
          end
          object Panel3: TPanel
            Left = 1
            Top = 1
            Width = 518
            Height = 153
            Align = alLeft
            Alignment = taLeftJustify
            Enabled = False
            TabOrder = 0
            object Label1: TLabel
              Left = 43
              Top = 4
              Width = 16
              Height = 13
              Alignment = taRightJustify
              Caption = 'N'#186':'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label2: TLabel
              Left = 17
              Top = 23
              Width = 42
              Height = 13
              Alignment = taRightJustify
              Caption = 'Cliente:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label3: TLabel
              Left = 13
              Top = 42
              Width = 46
              Height = 13
              Alignment = taRightJustify
              Caption = 'Destino:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label4: TLabel
              Left = 124
              Top = 4
              Width = 6
              Height = 13
              Caption = '/'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label5: TLabel
              Left = 185
              Top = 4
              Width = 36
              Height = 13
              Alignment = taRightJustify
              Caption = 'Fecha:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label15: TLabel
              Left = 26
              Top = 118
              Width = 34
              Height = 13
              Alignment = taRightJustify
              Caption = 'Obsv.:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label16: TLabel
              Left = 16
              Top = 62
              Width = 43
              Height = 13
              Alignment = taRightJustify
              Caption = 'F. Pago:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label17: TLabel
              Left = 352
              Top = 129
              Width = 101
              Height = 13
              Alignment = taRightJustify
              Caption = 'Coste Transporte:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label20: TLabel
              Left = 13
              Top = 82
              Width = 43
              Height = 13
              Alignment = taRightJustify
              Caption = 'Cuenta:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label21: TLabel
              Left = 231
              Top = 23
              Width = 54
              Height = 13
              Alignment = taRightJustify
              Caption = 'Comisi'#243'n:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label22: TLabel
              Left = 323
              Top = 23
              Width = 13
              Height = 13
              Alignment = taRightJustify
              Caption = '%'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object DBText1: TDBText
              Left = 235
              Top = 82
              Width = 30
              Height = 17
              DataField = 'cciban'
              DataSource = dsqcuentas
            end
            object DBText2: TDBText
              Left = 270
              Top = 82
              Width = 30
              Height = 17
              DataField = 'ccentidad'
              DataSource = dsqcuentas
            end
            object DBText16: TDBText
              Left = 306
              Top = 82
              Width = 30
              Height = 17
              DataField = 'ccoficina'
              DataSource = dsqcuentas
            end
            object DBText17: TDBText
              Left = 344
              Top = 82
              Width = 15
              Height = 17
              DataField = 'ccdc'
              DataSource = dsqcuentas
            end
            object DBText18: TDBText
              Left = 366
              Top = 82
              Width = 80
              Height = 17
              DataField = 'cccc'
              DataSource = dsqcuentas
            end
            object Label27: TLabel
              Left = 1
              Top = 103
              Width = 55
              Height = 13
              Alignment = taRightJustify
              Caption = 'R/Pedido:'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label28: TLabel
              Left = 232
              Top = 103
              Width = 53
              Height = 13
              Alignment = taRightJustify
              Caption = 'Matr'#237'cula'
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object comboserie: TDBLookupComboBox
              Left = 62
              Top = 1
              Width = 61
              Height = 21
              DataField = 'serie'
              DataSource = dsalbaranes
              KeyField = 'id'
              ListField = 'id'
              ListFieldIndex = 1
              ListSource = dsqseries
              TabOrder = 0
              OnCloseUp = comboserieCloseUp
              OnEnter = btaanteriorClick
            end
            object DBEdit1: TDBEdit
              Left = 131
              Top = 1
              Width = 46
              Height = 21
              DataField = 'id'
              DataSource = dsalbaranes
              TabOrder = 1
            end
            object comboclientes: TDBLookupComboBox
              Left = 62
              Top = 21
              Width = 167
              Height = 21
              DataField = 'idcliente'
              DataSource = dsalbaranes
              DropDownWidth = 300
              KeyField = 'id'
              ListField = 'nombre_corto'
              ListSource = dsqclientes
              TabOrder = 3
              OnCloseUp = comboclientesCloseUp
            end
            object combodestinos: TDBLookupComboBox
              Left = 62
              Top = 40
              Width = 167
              Height = 21
              DataField = 'iddestino'
              DataSource = dsalbaranes
              DropDownWidth = 300
              KeyField = 'codigo'
              ListField = 'descripcion'
              ListSource = dsqdestinos
              TabOrder = 4
              OnCloseUp = combodestinosCloseUp
            end
            object DBEdit2: TDBEdit
              Left = 227
              Top = 0
              Width = 60
              Height = 21
              DataField = 'fecha'
              DataSource = dsalbaranes
              TabOrder = 2
            end
            object DBCheckBox1: TDBCheckBox
              Left = 376
              Top = 3
              Width = 135
              Height = 17
              Alignment = taLeftJustify
              Caption = 'Facturado'
              DataField = 'facturado'
              DataSource = dsalbaranes
              TabOrder = 9
              ValueChecked = '1'
              ValueUnchecked = '0'
            end
            object DBMemo1: TDBMemo
              Left = 376
              Top = 26
              Width = 135
              Height = 48
              DataField = 'documento'
              DataSource = dsalbaranes
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -9
              Font.Name = 'Tahoma'
              Font.Style = []
              ParentFont = False
              TabOrder = 10
            end
            object DBMemo2: TDBMemo
              Left = 62
              Top = 120
              Width = 284
              Height = 32
              DataField = 'observaciones'
              DataSource = dsalbaranes
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -9
              Font.Name = 'Tahoma'
              Font.Style = []
              ParentFont = False
              TabOrder = 7
            end
            object comboformapago: TDBLookupComboBox
              Left = 62
              Top = 60
              Width = 167
              Height = 21
              DataField = 'idformapago'
              DataSource = dsalbaranes
              DropDownWidth = 300
              KeyField = 'id'
              ListField = 'descripcion'
              ListSource = dsqformaspago
              TabOrder = 5
            end
            object costetrans: TDBEdit
              Left = 458
              Top = 127
              Width = 57
              Height = 21
              DataField = 'coste_transporte'
              DataSource = dsalbaranes
              TabOrder = 8
            end
            object combocuenta: TDBLookupComboBox
              Left = 62
              Top = 80
              Width = 167
              Height = 21
              DataField = 'ccid'
              DataSource = dsalbaranes
              DropDownWidth = 300
              KeyField = 'id'
              ListField = 'banco;cciban;ccentidad;ccoficina;ccdc;cccc'
              ListSource = dsqcuentas
              TabOrder = 6
            end
            object comision: TDBEdit
              Left = 291
              Top = 20
              Width = 26
              Height = 21
              DataField = 'comision'
              DataSource = dsalbaranes
              TabOrder = 11
            end
            object DBEdit6: TDBEdit
              Left = 62
              Top = 100
              Width = 167
              Height = 21
              DataField = 'referencia'
              DataSource = dsalbaranes
              TabOrder = 12
            end
            object DBEdit11: TDBEdit
              Left = 291
              Top = 100
              Width = 167
              Height = 21
              DataField = 'prov_transporte'
              DataSource = dsalbaranes
              TabOrder = 13
            end
          end
        end
        object Panel5: TPanel
          Left = 1
          Top = 577
          Width = 1046
          Height = 112
          Align = alBottom
          TabOrder = 1
          object Panel16: TPanel
            Left = 249
            Top = 1
            Width = 322
            Height = 110
            Align = alLeft
            TabOrder = 2
            object Label10: TLabel
              Left = 15
              Top = 69
              Width = 54
              Height = 13
              Alignment = taRightJustify
              Caption = 'N'#186' Palets:'
              FocusControl = DBEdit5
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label12: TLabel
              Left = 203
              Top = 28
              Width = 32
              Height = 13
              Caption = 'I.V.A.:'
              FocusControl = DBEdit7
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label13: TLabel
              Left = 145
              Top = 7
              Width = 90
              Height = 13
              Caption = 'Base Imponible:'
              FocusControl = DBEdit8
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label14: TLabel
              Left = 203
              Top = 48
              Width = 32
              Height = 13
              Caption = 'Total:'
              FocusControl = DBEdit9
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label18: TLabel
              Left = 6
              Top = 8
              Width = 64
              Height = 13
              Alignment = taRightJustify
              Caption = 'Peso Bruto:'
              FocusControl = DBEdit10
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label8: TLabel
              Left = 4
              Top = 49
              Width = 66
              Height = 13
              Alignment = taRightJustify
              Caption = 'Peso Venta:'
              FocusControl = DBEdit3
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object Label9: TLabel
              Left = 10
              Top = 29
              Width = 59
              Height = 13
              Alignment = taRightJustify
              Caption = 'Peso Neto:'
              FocusControl = DBEdit4
              Font.Charset = DEFAULT_CHARSET
              Font.Color = clWindowText
              Font.Height = -11
              Font.Name = 'Tahoma'
              Font.Style = [fsBold]
              ParentFont = False
            end
            object DBEdit10: TDBEdit
              Left = 77
              Top = 6
              Width = 63
              Height = 21
              DataField = 'peso_bruto'
              DataSource = dsalbaranes
              Enabled = False
              TabOrder = 0
            end
            object DBEdit3: TDBEdit
              Left = 77
              Top = 46
              Width = 63
              Height = 21
              DataField = 'kilosventa'
              DataSource = dsalbaranes
              TabOrder = 1
            end
            object DBEdit4: TDBEdit
              Left = 77
              Top = 26
              Width = 63
              Height = 21
              DataField = 'kilos'
              DataSource = dsalbaranes
              TabOrder = 2
            end
            object DBEdit5: TDBEdit
              Left = 77
              Top = 66
              Width = 63
              Height = 21
              DataField = 'numpalets'
              DataSource = dsalbaranes
              TabOrder = 3
            end
            object DBEdit7: TDBEdit
              Left = 238
              Top = 25
              Width = 80
              Height = 21
              DataField = 'totaliva'
              DataSource = dsalbaranes
              Enabled = False
              TabOrder = 4
            end
            object DBEdit8: TDBEdit
              Left = 238
              Top = 5
              Width = 80
              Height = 21
              DataField = 'neto'
              DataSource = dsalbaranes
              Enabled = False
              TabOrder = 5
            end
            object DBEdit9: TDBEdit
              Left = 238
              Top = 45
              Width = 80
              Height = 21
              DataField = 'total'
              DataSource = dsalbaranes
              Enabled = False
              TabOrder = 6
            end
          end
          object Panel6: TPanel
            Left = 1
            Top = 1
            Width = 248
            Height = 110
            Align = alLeft
            TabOrder = 0
            object DBGrid1: TDBGrid
              Left = 1
              Top = 1
              Width = 246
              Height = 108
              Align = alClient
              DataSource = dsqalbaranesiva
              TabOrder = 0
              TitleFont.Charset = DEFAULT_CHARSET
              TitleFont.Color = clWindowText
              TitleFont.Height = -11
              TitleFont.Name = 'Tahoma'
              TitleFont.Style = []
              Columns = <
                item
                  Expanded = False
                  FieldName = 'base'
                  Title.Alignment = taCenter
                  Title.Caption = 'Base'
                  Visible = True
                end
                item
                  Expanded = False
                  FieldName = 'tipo'
                  Title.Alignment = taCenter
                  Title.Caption = '% IVA'
                  Visible = True
                end
                item
                  Expanded = False
                  FieldName = 'iva'
                  Title.Alignment = taCenter
                  Title.Caption = 'Total IVA'
                  Width = 84
                  Visible = True
                end>
            end
          end
          object Panel15: TPanel
            Left = 571
            Top = 1
            Width = 471
            Height = 110
            Align = alLeft
            TabOrder = 1
            object DBGrid6: TDBGrid
              Left = 269
              Top = 1
              Width = 188
              Height = 108
              Align = alLeft
              DataSource = dsalbaranespalets
              TabOrder = 0
              TitleFont.Charset = DEFAULT_CHARSET
              TitleFont.Color = clWindowText
              TitleFont.Height = -11
              TitleFont.Name = 'Tahoma'
              TitleFont.Style = []
              Columns = <
                item
                  Expanded = False
                  FieldName = 'tipo_palet'
                  Title.Alignment = taCenter
                  Title.Caption = 'Tipo Palet'
                  Width = 100
                  Visible = True
                end
                item
                  Expanded = False
                  FieldName = 'cantidad'
                  Title.Alignment = taCenter
                  Title.Caption = 'Ctd.'
                  Width = 50
                  Visible = True
                end>
            end
            object DBGrid7: TDBGrid
              Left = 1
              Top = 1
              Width = 235
              Height = 108
              Align = alLeft
              DataSource = dsalbarnaeslotes
              TabOrder = 1
              TitleFont.Charset = DEFAULT_CHARSET
              TitleFont.Color = clWindowText
              TitleFont.Height = -11
              TitleFont.Name = 'Tahoma'
              TitleFont.Style = []
              Columns = <
                item
                  Expanded = False
                  FieldName = 'lote'
                  Title.Alignment = taCenter
                  Title.Caption = 'Lote'
                  Width = 100
                  Visible = True
                end
                item
                  Expanded = False
                  FieldName = 'variedad'
                  Title.Alignment = taCenter
                  Title.Caption = 'Variedad'
                  Width = 100
                  Visible = True
                end>
            end
            object Panel17: TPanel
              Left = 236
              Top = 1
              Width = 33
              Height = 108
              Align = alLeft
              TabOrder = 2
              object Button10: TButton
                Left = 1
                Top = 1
                Width = 31
                Height = 26
                Align = alTop
                Font.Charset = DEFAULT_CHARSET
                Font.Color = clWindowText
                Font.Height = -11
                Font.Name = 'Tahoma'
                Font.Style = [fsBold]
                ImageAlignment = iaBottom
                ImageIndex = 1
                Images = BASE.listaiconos
                ParentFont = False
                TabOrder = 0
                WordWrap = True
                OnClick = Button10Click
              end
            end
            object Panel18: TPanel
              Left = 457
              Top = 1
              Width = 33
              Height = 108
              Align = alLeft
              TabOrder = 3
              object Button11: TButton
                Left = 1
                Top = 1
                Width = 31
                Height = 26
                Align = alTop
                Font.Charset = DEFAULT_CHARSET
                Font.Color = clWindowText
                Font.Height = -11
                Font.Name = 'Tahoma'
                Font.Style = [fsBold]
                ImageAlignment = iaBottom
                ImageIndex = 1
                Images = BASE.listaiconos
                ParentFont = False
                TabOrder = 0
                WordWrap = True
                OnClick = Button11Click
              end
            end
          end
        end
        object DBGrid2: TDBGrid
          Left = 1
          Top = 156
          Width = 895
          Height = 421
          Align = alClient
          DataSource = dsalbaranesdetalle
          Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit, dgMultiSelect, dgTitleClick, dgTitleHotTrack]
          TabOrder = 2
          TitleFont.Charset = DEFAULT_CHARSET
          TitleFont.Color = clWindowText
          TitleFont.Height = -11
          TitleFont.Name = 'Tahoma'
          TitleFont.Style = []
          OnColExit = DBGrid2ColExit
          OnDrawColumnCell = DBGrid2DrawColumnCell
          OnKeyDown = DBGrid2KeyDown
          Columns = <
            item
              Expanded = False
              FieldName = 'idarticulo'
              Title.Caption = 'Referencia'
              Width = 60
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'descripcion'
              Title.Caption = 'Descripci'#243'n'
              Width = 211
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'cal'
              Title.Caption = 'Cal.'
              Width = 30
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'lote'
              Width = 58
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'palets'
              Title.Caption = 'N'#186' palet Env'#237'o'
              Width = 73
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'bultos'
              Title.Caption = 'Bultos'
              Width = 49
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'pesobruto'
              Title.Caption = 'Bruto'
              Width = 47
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'cantidad'
              Title.Caption = 'Cantidad'
              Width = 47
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'precio'
              Title.Caption = 'Precio'
              Width = 63
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'tipoiva'
              Title.Caption = '% Iva'
              Width = 38
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'descuento'
              Title.Caption = '% Desc.'
              Width = 43
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'base'
              Title.Caption = 'Bruto'
              Width = 60
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'total'
              Title.Caption = 'Neto'
              Width = 55
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'pais'
              Title.Caption = 'Origen'
              Width = 105
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'coste_comision'
              Title.Caption = 'Comisi'#243'n'
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'coste_transporte'
              Title.Caption = 'Cte. Tte.'
              Width = 50
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'coste_otros'
              Title.Caption = 'O.Ct/Kg.'
              Width = 42
              Visible = True
            end
            item
              Expanded = False
              FieldName = 'idfactura'
              Title.Caption = 'Factura'
              Width = 42
              Visible = True
            end>
        end
        object Panel7: TPanel
          Left = 896
          Top = 156
          Width = 151
          Height = 421
          Align = alRight
          TabOrder = 3
          object Label19: TLabel
            Left = 55
            Top = 163
            Width = 35
            Height = 13
            Alignment = taRightJustify
            Caption = 'Precio'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ParentFont = False
          end
          object Button4: TButton
            Left = 1
            Top = 1
            Width = 149
            Height = 40
            Align = alTop
            Caption = 'Eliminar linea'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ImageAlignment = iaBottom
            ImageIndex = 1
            Images = BASE.listaiconos
            ParentFont = False
            TabOrder = 0
            WordWrap = True
            OnClick = Button4Click
          end
          object Edit1: TEdit
            Left = 24
            Top = 182
            Width = 89
            Height = 21
            Alignment = taCenter
            TabOrder = 1
            Text = '0.0'
            OnEnter = Edit1Enter
          end
          object Button1: TButton
            Left = 1
            Top = 121
            Width = 149
            Height = 40
            Align = alTop
            Caption = 'Actualizar Precio'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ImageAlignment = iaBottom
            ImageIndex = 72
            Images = BASE.listaiconos
            ParentFont = False
            TabOrder = 2
            OnClick = Button1Click
          end
          object Button2: TButton
            Left = 1
            Top = 41
            Width = 149
            Height = 40
            Align = alTop
            Caption = 'A'#241'adir linea comisi'#243'n'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ImageAlignment = iaBottom
            ImageIndex = 72
            Images = BASE.listaiconos
            ParentFont = False
            TabOrder = 3
            OnClick = Button2Click
          end
          object Button5: TButton
            Left = 1
            Top = 81
            Width = 149
            Height = 40
            Align = alTop
            Caption = 'A'#241'adir linea transporte'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ImageAlignment = iaBottom
            ImageIndex = 72
            Images = BASE.listaiconos
            ParentFont = False
            TabOrder = 4
            OnClick = Button5Click
          end
        end
      end
    end
    object TabSheet2: TTabSheet
      Caption = 'Listado'
      ImageIndex = 1
      object gridalbaranesaexcel: TDBGrid
        Left = 0
        Top = 0
        Width = 823
        Height = 690
        Align = alClient
        DataSource = dsqalbaranesclientes
        Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit, dgMultiSelect, dgTitleClick, dgTitleHotTrack]
        TabOrder = 2
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -16
        TitleFont.Name = 'Tahoma'
        TitleFont.Style = [fsBold]
        Visible = False
        Columns = <
          item
            Expanded = False
            FieldName = 'serie'
            Title.Caption = 'Serie'
            Width = 50
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'id'
            Title.Caption = 'Albaran'
            Width = 65
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'documento'
            Title.Caption = 'Documento'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'fecha'
            Title.Caption = 'Fecha'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'nif'
            Title.Caption = 'NIF'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'nomcliente'
            Title.Caption = 'Cliente'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'nomdestino'
            Title.Caption = 'Destino'
            Width = 210
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'neto'
            Title.Caption = 'Base'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'total'
            Title.Caption = 'Total'
            Width = 65
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'idarticulo'
            Title.Caption = 'Referencia'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'descripcion'
            Title.Caption = 'Descripcion'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'cal'
            Title.Caption = 'Calibre-Calidad'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'lote'
            Title.Caption = 'Lote'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'parcela'
            Title.Caption = 'Parcela'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'bultos_1'
            Title.Caption = 'Bultos'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'cantidad'
            Title.Caption = 'Cantidad'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'precio'
            Title.Caption = 'Precio'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'descuento'
            Title.Caption = 'Descuento'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'tipoiva'
            Title.Caption = 'Tipo iva'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'iva'
            Title.Caption = 'Iva'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'total_1'
            Title.Caption = 'Total'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'coste_transporte'
            Title.Caption = 'Coste Transporte/kg'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'coste_otros'
            Title.Caption = 'Otros Costes/kg'
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'coste_comision'
            Visible = True
          end>
      end
      object Panel11: TPanel
        Left = 823
        Top = 0
        Width = 225
        Height = 690
        Align = alRight
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 1
        object Panel8: TPanel
          Left = 1
          Top = 1
          Width = 223
          Height = 32
          Align = alTop
          Caption = 'Filtros/Busquedas'
          TabOrder = 0
        end
        object Panel9: TPanel
          Left = 1
          Top = 33
          Width = 223
          Height = 58
          Align = alTop
          TabOrder = 1
          object Label11: TLabel
            Left = 10
            Top = 34
            Width = 47
            Height = 13
            Caption = 'N'#250'mero:'
            Visible = False
          end
          object Label23: TLabel
            Left = 32
            Top = 9
            Width = 32
            Height = 13
            Caption = 'Serie:'
          end
          object Edit2: TEdit
            Left = 86
            Top = 32
            Width = 100
            Height = 21
            TabOrder = 0
            Visible = False
          end
          object comboserie2: TDBLookupComboBox
            Left = 86
            Top = 5
            Width = 100
            Height = 21
            KeyField = 'id'
            ListField = 'id'
            ListFieldIndex = 1
            ListSource = dsqseries2
            TabOrder = 1
            OnCloseUp = comboserie2CloseUp
          end
        end
        object RadioGroup1: TRadioGroup
          Left = 1
          Top = 91
          Width = 223
          Height = 55
          Align = alTop
          TabOrder = 2
          Visible = False
        end
        object RadioButton1: TRadioButton
          Left = 11
          Top = 100
          Width = 176
          Height = 17
          Caption = 'Facturados'
          TabOrder = 3
          Visible = False
        end
        object RadioButton2: TRadioButton
          Left = 11
          Top = 123
          Width = 166
          Height = 17
          Caption = 'Pendientes'
          TabOrder = 4
          Visible = False
        end
        object Panel10: TPanel
          Left = 1
          Top = 146
          Width = 223
          Height = 70
          Align = alTop
          TabOrder = 5
          Visible = False
          object Label24: TLabel
            Left = 64
            Top = 6
            Width = 43
            Height = 13
            Caption = 'Periodo'
          end
          object Label34: TLabel
            Left = 5
            Top = 25
            Width = 38
            Height = 13
            Caption = 'Desde:'
          end
          object Label35: TLabel
            Left = 7
            Top = 44
            Width = 36
            Height = 13
            Caption = 'Hasta:'
          end
          object fdesde: TDateTimePicker
            Left = 64
            Top = 25
            Width = 88
            Height = 21
            Date = 44047.513392430550000000
            Time = 44047.513392430550000000
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ParentFont = False
            TabOrder = 0
          end
          object fhasta: TDateTimePicker
            Left = 64
            Top = 45
            Width = 88
            Height = 21
            Date = 44047.513392430550000000
            Time = 44047.513392430550000000
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clWindowText
            Font.Height = -11
            Font.Name = 'Tahoma'
            Font.Style = [fsBold]
            ParentFont = False
            TabOrder = 1
          end
        end
        object Panel12: TPanel
          Left = 1
          Top = 332
          Width = 223
          Height = 116
          Align = alTop
          TabOrder = 6
          Visible = False
          object Label32: TLabel
            Left = 5
            Top = 6
            Width = 52
            Height = 13
            Caption = 'Destinos:'
          end
          object Button8: TButton
            Left = 196
            Top = 52
            Width = 22
            Height = 21
            ImageIndex = 3
            Images = BASE.listaiconos
            TabOrder = 0
          end
          object DBGrid4: TDBGrid
            Left = 1
            Top = 25
            Width = 221
            Height = 90
            Align = alBottom
            TabOrder = 1
            TitleFont.Charset = DEFAULT_CHARSET
            TitleFont.Color = clWindowText
            TitleFont.Height = -11
            TitleFont.Name = 'Tahoma'
            TitleFont.Style = [fsBold]
          end
          object Edit4: TEdit
            Left = 64
            Top = 2
            Width = 154
            Height = 21
            TabOrder = 2
          end
        end
        object Panel13: TPanel
          Left = 1
          Top = 216
          Width = 223
          Height = 116
          Align = alTop
          TabOrder = 7
          Visible = False
          object Label25: TLabel
            Left = 5
            Top = 6
            Width = 42
            Height = 13
            Caption = 'Cliente:'
          end
          object Button6: TButton
            Left = 196
            Top = 52
            Width = 22
            Height = 21
            ImageIndex = 3
            Images = BASE.listaiconos
            TabOrder = 0
          end
          object DBGrid5: TDBGrid
            Left = 1
            Top = 25
            Width = 221
            Height = 90
            Align = alBottom
            TabOrder = 1
            TitleFont.Charset = DEFAULT_CHARSET
            TitleFont.Color = clWindowText
            TitleFont.Height = -11
            TitleFont.Name = 'Tahoma'
            TitleFont.Style = [fsBold]
          end
          object Edit3: TEdit
            Left = 64
            Top = 2
            Width = 154
            Height = 21
            TabOrder = 2
          end
        end
        object Panel14: TPanel
          Left = 1
          Top = 448
          Width = 223
          Height = 81
          Align = alTop
          TabOrder = 8
          object Button3: TButton
            Left = 62
            Top = 6
            Width = 99
            Height = 30
            Caption = 'A Excel'
            ImageIndex = 0
            TabOrder = 0
            OnClick = Button3Click
          end
          object Button9: TButton
            Left = 62
            Top = 42
            Width = 99
            Height = 31
            Caption = 'Exportar a Edi'
            TabOrder = 1
            OnClick = Button9Click
          end
        end
      end
      object DBGrid3: TDBGrid
        Left = 0
        Top = 0
        Width = 823
        Height = 690
        Align = alClient
        DataSource = dsalbaranes
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit, dgMultiSelect, dgTitleClick, dgTitleHotTrack]
        ParentFont = False
        TabOrder = 0
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'Tahoma'
        TitleFont.Style = []
        OnDrawColumnCell = DBGrid3DrawColumnCell
        OnDblClick = DBGrid3DblClick
        OnTitleClick = DBGrid3TitleClick
        Columns = <
          item
            Expanded = False
            FieldName = 'serie'
            Title.Caption = 'Serie'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 40
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'id'
            Title.Caption = 'N'#186
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 36
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'fecha'
            Title.Caption = 'Fecha'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 48
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'idcliente'
            Title.Caption = 'ClienteId'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 62
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'nif'
            Title.Caption = 'NIF'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 98
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'nomcliente'
            Title.Caption = 'Cliente'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 221
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'nomdestino'
            Title.Caption = 'Destino'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 183
            Visible = True
          end
          item
            Expanded = False
            FieldName = 'total'
            Title.Caption = 'Total'
            Title.Font.Charset = DEFAULT_CHARSET
            Title.Font.Color = clWindowText
            Title.Font.Height = -13
            Title.Font.Name = 'Tahoma'
            Title.Font.Style = [fsBold]
            Width = 84
            Visible = True
          end>
      end
    end
  end
  object Panel4: TPanel
    Left = 0
    Top = 0
    Width = 1056
    Height = 42
    Align = alTop
    TabOrder = 1
    object Label26: TLabel
      Left = 855
      Top = 5
      Width = 28
      Height = 13
      Caption = 'Serie:'
    end
    object Label29: TLabel
      Left = 857
      Top = 23
      Width = 47
      Height = 13
      Caption = 'Informes:'
    end
    object btAcancelar: TButton
      Left = 221
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Cancelar'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 3
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 3
      OnClick = btAcancelarClick
    end
    object btAmodificar: TButton
      Left = 111
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Editar'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 2
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 4
      OnClick = btAmodificarClick
    end
    object btAborrar: TButton
      Left = 1
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Borrar'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 1
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 1
      OnClick = btAborrarClick
    end
    object btAnuevo: TButton
      Left = 56
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Nuevo'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 0
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 0
      OnClick = btAnuevoClick
    end
    object btAguardar: TButton
      Left = 166
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Guardar'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 140
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 2
      OnClick = btAguardarClick
    end
    object btaimprimir: TButton
      Left = 735
      Top = 1
      Width = 58
      Height = 40
      Align = alLeft
      Caption = 'Imprimir'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 10
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 5
      OnClick = btaimprimirClick
    end
    object btaimportar: TButton
      Left = 386
      Top = 1
      Width = 85
      Height = 40
      Align = alLeft
      Caption = 'Desde pedido'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 73
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 6
      WordWrap = True
      OnClick = btaimportarClick
    end
    object btafacturar: TButton
      Left = 471
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Facturar'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 80
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 7
      OnClick = btafacturarClick
    end
    object btasiguiente: TButton
      Left = 331
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Siguiente'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 146
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 8
      OnClick = btasiguienteClick
    end
    object btaanterior: TButton
      Left = 276
      Top = 1
      Width = 55
      Height = 40
      Align = alLeft
      Caption = 'Anterior'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 26
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 9
      OnClick = btaanteriorClick
    end
    object listaimpresion: TComboBox
      Left = 526
      Top = 1
      Width = 209
      Height = 21
      Align = alLeft
      ItemIndex = 0
      TabOrder = 10
      Text = 'Impresi'#243'n agrupada'
      Items.Strings = (
        'Impresi'#243'n agrupada'
        'Impresi'#243'n detallada')
    end
    object btaduplicar: TButton
      Left = 793
      Top = 1
      Width = 58
      Height = 40
      Align = alLeft
      Caption = 'Duplicar'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaBottom
      ImageIndex = 23
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 11
      OnClick = btaduplicarClick
    end
    object Button7: TButton
      Left = 1015
      Top = 1
      Width = 40
      Height = 40
      Hint = 'Materiales Auxiliares'
      Align = alRight
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ImageAlignment = iaCenter
      ImageIndex = 124
      Images = BASE.listaiconos
      ParentFont = False
      TabOrder = 12
      OnClick = Button7Click
    end
    object comboformulario: TDBLookupComboBox
      Left = 525
      Top = 21
      Width = 211
      Height = 21
      DropDownWidth = 300
      KeyField = 'id'
      ListField = 'descripcion'
      ListSource = dsqformularios
      TabOrder = 13
    end
    object DBLookupComboBox1: TDBLookupComboBox
      Left = 909
      Top = 1
      Width = 100
      Height = 21
      KeyField = 'id'
      ListField = 'id'
      ListFieldIndex = 1
      ListSource = dsqseries2
      TabOrder = 14
      OnCloseUp = comboserie2CloseUp
    end
    object ComboBox1: TComboBox
      Left = 910
      Top = 21
      Width = 99
      Height = 21
      TabOrder = 15
      Text = 'Impresi'#243'n agrupada'
      Items.Strings = (
        'Informe de trazabilidad'
        'Informe albaranes sin facturar')
    end
  end
  object dsalbaranes: TDataSource
    DataSet = albaranes
    OnStateChange = dsalbaranesStateChange
    OnDataChange = dsalbaranesDataChange
    Left = 336
    Top = 232
  end
  object dsalbaranesdetalle: TDataSource
    DataSet = albaranesdetalle
    Left = 400
    Top = 234
  end
  object albaranes: TZQuery
    Connection = DM.DBagrigest
    BeforePost = albaranesBeforePost
    BeforeDelete = albaranesBeforeDelete
    SQL.Strings = (
      'select * from albaranes order by serie desc, id desc')
    Params = <>
    MasterFields = 'id'
    MasterSource = DM.dsempresa
    LinkedFields = 'idempresa'
    Left = 336
    Top = 272
    object albaranesid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object albaranesidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object albaranesidcliente: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object albaranesiddestino: TWideStringField
      FieldName = 'iddestino'
      Required = True
      Size = 40
    end
    object albaranesnif: TWideStringField
      FieldName = 'nif'
      Size = 22
    end
    object albaranesdireccion: TWideStringField
      FieldName = 'direccion'
      Size = 50
    end
    object albaranespoblacion: TWideStringField
      FieldName = 'poblacion'
      Size = 50
    end
    object albaranesprovincia: TWideStringField
      FieldName = 'provincia'
      Size = 50
    end
    object albaranescodpost: TWideStringField
      FieldName = 'codpost'
      Size = 10
    end
    object albaranesfecha: TDateField
      FieldName = 'fecha'
      Required = True
      DisplayFormat = 'dd/mm/yy'
      EditMask = '!99/99/00;1;_'
    end
    object albaranesreferencia: TWideStringField
      FieldName = 'referencia'
      Size = 50
    end
    object albaranestelefono: TWideStringField
      FieldName = 'telefono'
      Size = 30
    end
    object albaranesnomcliente: TWideStringField
      FieldName = 'nomcliente'
      Size = 50
    end
    object albaranespaiscliente: TWideStringField
      FieldName = 'paiscliente'
      Size = 50
    end
    object albaranesnomdestino: TWideStringField
      FieldName = 'nomdestino'
      Size = 50
    end
    object albaranesdirecciondestino: TWideStringField
      FieldName = 'direcciondestino'
      Size = 50
    end
    object albaranespoblaciondestino: TWideStringField
      FieldName = 'poblaciondestino'
      Size = 50
    end
    object albaranescodpostdestino: TWideStringField
      FieldName = 'codpostdestino'
      Size = 50
    end
    object albaranesprovinciadestino: TWideStringField
      FieldName = 'provinciadestino'
      Size = 50
    end
    object albaranespaisdestino: TWideStringField
      FieldName = 'paisdestino'
      Size = 50
    end
    object albaranesneto: TFloatField
      FieldName = 'neto'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranestotal: TFloatField
      FieldName = 'total'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranesfacturado: TIntegerField
      FieldName = 'facturado'
    end
    object albaranesdocumento: TWideStringField
      FieldName = 'documento'
      Size = 50
    end
    object albaranesdescuento_lin: TFloatField
      FieldName = 'descuento_lin'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranesdescuento_com: TFloatField
      FieldName = 'descuento_com'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranesdescuento_pp: TFloatField
      FieldName = 'descuento_pp'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranesdescuento_total: TFloatField
      FieldName = 'descuento_total'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranestotaliva: TFloatField
      FieldName = 'totaliva'
      Required = True
      DisplayFormat = '#0.00'
    end
    object albaranesobservaciones: TWideStringField
      FieldName = 'observaciones'
      Size = 500
    end
    object albaranesidfactura: TIntegerField
      FieldName = 'idfactura'
    end
    object albaranesserie: TWideStringField
      FieldName = 'serie'
      Required = True
      Size = 10
    end
    object albaranesbultos: TFloatField
      FieldName = 'bultos'
      Required = True
    end
    object albaraneskilos: TFloatField
      FieldName = 'kilos'
      Required = True
    end
    object albaranesidformapago: TIntegerField
      FieldName = 'idformapago'
      Required = True
    end
    object albaranescoste_transporte: TFloatField
      FieldName = 'coste_transporte'
    end
    object albaranespeso_bruto: TFloatField
      FieldName = 'peso_bruto'
    end
    object albaranesprov_transporte: TWideStringField
      FieldName = 'prov_transporte'
      Size = 40
    end
    object albaranescc_pago: TWideStringField
      FieldName = 'cc_pago'
      Size = 160
    end
    object albaranesccid: TIntegerField
      FieldName = 'ccid'
    end
    object albaranescccuentabancaria: TWideStringField
      FieldName = 'cccuentabancaria'
      Size = 160
    end
    object albaranescomision: TFloatField
      FieldName = 'comision'
      Required = True
    end
    object albaraneskilosventa: TFloatField
      FieldName = 'kilosventa'
    end
    object albaranesnumpalets: TFloatField
      FieldName = 'numpalets'
    end
  end
  object albaranesdetalle: TZQuery
    Connection = DM.DBagrigest
    BeforePost = albaranesdetalleBeforePost
    AfterPost = albaranesdetalleAfterPost
    BeforeDelete = albaranesdetalleBeforeDelete
    AfterDelete = albaranesdetalleAfterDelete
    SQL.Strings = (
      
        'select * from albaranes_detalles where idempresa=:empresa and se' +
        'rie=:serie and idalbaran=:albaran order by id')
    Params = <
      item
        DataType = ftUnknown
        Name = 'empresa'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'serie'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'albaran'
        ParamType = ptUnknown
      end>
    Left = 400
    Top = 266
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'empresa'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'serie'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'albaran'
        ParamType = ptUnknown
      end>
    object albaranesdetalleidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object albaranesdetalleidalbaran: TIntegerField
      FieldName = 'idalbaran'
      Required = True
    end
    object albaranesdetallecantidad: TFloatField
      FieldName = 'cantidad'
      DisplayFormat = '#0.00'
    end
    object albaranesdetalleprecio: TFloatField
      FieldName = 'precio'
      DisplayFormat = '#0.0000'
    end
    object albaranesdetalledescuento: TFloatField
      FieldName = 'descuento'
    end
    object albaranesdetallebase: TFloatField
      FieldName = 'base'
      DisplayFormat = '#0.00'
    end
    object albaranesdetallecal: TWideStringField
      FieldName = 'cal'
      Size = 40
    end
    object albaranesdetallebultos: TFloatField
      FieldName = 'bultos'
    end
    object albaranesdetalletipoiva: TFloatField
      FieldName = 'tipoiva'
    end
    object albaranesdetalleiva: TFloatField
      FieldName = 'iva'
    end
    object albaranesdetalletotal: TFloatField
      FieldName = 'total'
      DisplayFormat = '#0.00'
    end
    object albaranesdetalleid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object albaranesdetalletotaldescuento: TFloatField
      FieldName = 'totaldescuento'
    end
    object albaranesdetalleserie: TWideStringField
      FieldName = 'serie'
      Required = True
      Size = 10
    end
    object albaranesdetalleidarticulo: TWideStringField
      FieldName = 'idarticulo'
      Size = 50
    end
    object albaranesdetallelote: TWideStringField
      FieldName = 'lote'
      Size = 30
    end
    object albaranesdetallecoste_transporte: TFloatField
      FieldName = 'coste_transporte'
    end
    object albaranesdetallecoste_otros: TFloatField
      FieldName = 'coste_otros'
    end
    object albaranesdetallecoste_comision: TFloatField
      FieldName = 'coste_comision'
    end
    object albaranesdetalledescripcion: TWideStringField
      FieldName = 'descripcion'
      Size = 600
    end
    object albaranesdetallepesobruto: TFloatField
      FieldName = 'pesobruto'
    end
    object albaranesdetalleidfactura: TIntegerField
      FieldName = 'idfactura'
    end
    object albaranesdetallepalets: TFloatField
      FieldName = 'palets'
    end
    object albaranesdetallepais: TWideStringField
      FieldName = 'pais'
      Size = 90
    end
    object albaranesdetalleenvase: TWideStringField
      FieldName = 'envase'
      Size = 90
    end
    object albaranesdetallereferencia: TWideStringField
      FieldName = 'referencia'
      Size = 90
    end
    object albaranesdetalleean: TWideStringField
      FieldName = 'ean'
      Size = 90
    end
    object albaranesdetalleunidadescaja: TIntegerField
      FieldName = 'unidadescaja'
    end
  end
  object qseries: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      
        'select * from series_numericas order by activo desc,fechainicio ' +
        'desc,id ')
    Params = <>
    MasterFields = 'id'
    MasterSource = DM.dsempresa
    LinkedFields = 'ide'
    Left = 480
    Top = 272
    object qserieside: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qseriesid: TWideStringField
      FieldName = 'id'
      Required = True
      Size = 10
    end
    object qseriesfechainicio: TDateField
      FieldName = 'fechainicio'
      Required = True
    end
    object qseriesfechafin: TDateField
      FieldName = 'fechafin'
      Required = True
    end
    object qseriesnum_pedcliente: TIntegerField
      FieldName = 'num_pedcliente'
      Required = True
    end
    object qseriesnum_albaran: TIntegerField
      FieldName = 'num_albaran'
      Required = True
    end
    object qseriesnum_factura: TIntegerField
      FieldName = 'num_factura'
      Required = True
    end
    object qseriesnum_expedicion: TIntegerField
      FieldName = 'num_expedicion'
      Required = True
    end
    object qseriesnum_pedproveedor: TIntegerField
      FieldName = 'num_pedproveedor'
      Required = True
    end
    object qseriesimp_albaran: TWideStringField
      FieldName = 'imp_albaran'
      Size = 500
    end
    object qseriesimp_factura: TWideStringField
      FieldName = 'imp_factura'
      Size = 500
    end
    object qseriesactivo: TIntegerField
      FieldName = 'activo'
      Required = True
    end
    object qseriesnum_presupuesto: TIntegerField
      FieldName = 'num_presupuesto'
      Required = True
    end
  end
  object dsqseries: TDataSource
    DataSet = qseries
    Left = 480
    Top = 232
  end
  object dsqclientes: TDataSource
    DataSet = qclientes
    Left = 552
    Top = 232
  end
  object qclientes: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from clientes order by nombre')
    Params = <>
    Left = 552
    Top = 272
    object qclientesid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qclientesIdempresa: TIntegerField
      FieldName = 'Idempresa'
      Required = True
    end
    object qclientesnif: TWideStringField
      FieldName = 'nif'
      Required = True
      Size = 30
    end
    object qclientesnombre: TWideStringField
      FieldName = 'nombre'
      Required = True
      Size = 80
    end
    object qclientesnombre_corto: TWideStringField
      FieldName = 'nombre_corto'
      Required = True
      Size = 30
    end
    object qclientesdireccion: TWideStringField
      FieldName = 'direccion'
      Size = 80
    end
    object qclientespoblacion: TWideStringField
      FieldName = 'poblacion'
      Size = 80
    end
    object qclientescodpost: TWideStringField
      FieldName = 'codpost'
      Size = 10
    end
    object qclientesprovincia: TWideStringField
      FieldName = 'provincia'
      Size = 60
    end
    object qclientestelefono: TWideStringField
      FieldName = 'telefono'
      Size = 24
    end
    object qclientestelefono2: TWideStringField
      FieldName = 'telefono2'
      Size = 30
    end
    object qclientesmovil: TWideStringField
      FieldName = 'movil'
      Size = 30
    end
    object qclientesemail: TWideStringField
      FieldName = 'email'
      Size = 80
    end
    object qclientespersonacontacto: TWideStringField
      FieldName = 'personacontacto'
      Size = 80
    end
    object qclientescodigomercado: TIntegerField
      FieldName = 'codigomercado'
    end
    object qclientesactivo: TIntegerField
      FieldName = 'activo'
    end
    object qclientesobservaciones: TWideStringField
      FieldName = 'observaciones'
      Size = 500
    end
    object qclientesccontable: TIntegerField
      FieldName = 'ccontable'
    end
    object qclientesdescuento: TFloatField
      FieldName = 'descuento'
      Required = True
    end
    object qclientespais: TWideStringField
      FieldName = 'pais'
      Size = 50
    end
    object qclientesidformapago: TIntegerField
      FieldName = 'idformapago'
      Required = True
    end
    object qclientesexento_iva: TIntegerField
      FieldName = 'exento_iva'
      Required = True
    end
    object qclientescomision: TFloatField
      Alignment = taCenter
      FieldName = 'comision'
      Required = True
    end
  end
  object dsqdestinos: TDataSource
    DataSet = qdestinos
    Left = 616
    Top = 232
  end
  object qdestinos: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from clientes_destinos order by descripcion')
    Params = <>
    MasterFields = 'Idempresa;id'
    MasterSource = dsqclientes
    LinkedFields = 'idempresa;idcliente'
    Left = 616
    Top = 272
    object qdestinoscodigo: TWideStringField
      DisplayWidth = 15
      FieldName = 'codigo'
      Required = True
      Size = 40
    end
    object qdestinosidcliente: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object qdestinosidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object qdestinosdescripcion: TWideStringField
      FieldName = 'descripcion'
      Required = True
      Size = 80
    end
    object qdestinosseleccionado: TIntegerField
      FieldName = 'seleccionado'
      Required = True
    end
    object qdestinosactivo: TIntegerField
      FieldName = 'activo'
      Required = True
    end
    object qdestinosdireccion: TWideStringField
      FieldName = 'direccion'
      Size = 50
    end
    object qdestinospoblacion: TWideStringField
      FieldName = 'poblacion'
      Size = 50
    end
    object qdestinoscodpost: TWideStringField
      FieldName = 'codpost'
      Size = 10
    end
    object qdestinosprovincia: TWideStringField
      FieldName = 'provincia'
      Size = 50
    end
    object qdestinospais: TWideStringField
      FieldName = 'pais'
      Size = 50
    end
  end
  object dsqpedidos: TDataSource
    DataSet = qpedidos
    Left = 672
    Top = 232
  end
  object qpedidos: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      
        'select p.id,p.ide,p.idcliente,p.iddestino,p.fecha_pedido,p.fecha' +
        '_entrega,c.nombre_corto as cliente,d.descripcion as destino,p.pe' +
        'didocliente from pedidos p,clientes c,clientes_destinos d where '
      
        'p.ide=c.idempresa and p.idcliente=c.id and p.ide=d.idempresa and' +
        ' p.idcliente=d.idcliente and p.iddestino=d.codigo and'
      
        'p.id in (select pd.idpedido from pedidosdetalle pd where pd.idal' +
        'baran is null)')
    Params = <>
    MasterFields = 'Idempresa;idcliente;iddestino'
    MasterSource = dsalbaranes
    LinkedFields = 'Ide;idcliente;iddestino'
    Left = 680
    Top = 272
    object qpedidosid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qpedidoside: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qpedidosidcliente: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object qpedidosiddestino: TWideStringField
      FieldName = 'iddestino'
      Required = True
      Size = 40
    end
    object qpedidosfecha_pedido: TDateField
      FieldName = 'fecha_pedido'
      Required = True
    end
    object qpedidosfecha_entrega: TDateField
      FieldName = 'fecha_entrega'
    end
    object qpedidoscliente: TWideStringField
      FieldName = 'cliente'
      Required = True
      Size = 80
    end
    object qpedidosdestino: TWideStringField
      FieldName = 'destino'
      Required = True
      Size = 80
    end
    object qpedidospedidocliente: TWideStringField
      FieldName = 'pedidocliente'
      Size = 40
    end
  end
  object dsqpedidosdetalle: TDataSource
    DataSet = qpedidosdetalle
    Left = 720
    Top = 232
  end
  object qpedidosdetalle: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from pedidosdetalle where idalbaran is null')
    Params = <>
    MasterFields = 'ide;id'
    MasterSource = dsqpedidos
    LinkedFields = 'ide;idpedido'
    Left = 720
    Top = 272
    object qpedidosdetalleid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qpedidosdetalleide: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qpedidosdetalleidpedido: TIntegerField
      FieldName = 'idpedido'
      Required = True
    end
    object qpedidosdetalleidcliente: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object qpedidosdetalleidproductocli: TWideStringField
      FieldName = 'idproductocli'
      Required = True
      Size = 30
    end
    object qpedidosdetalleidenvase: TWideStringField
      FieldName = 'idenvase'
      Required = True
      Size = 30
    end
    object qpedidosdetalledesc_envase: TWideStringField
      FieldName = 'desc_envase'
      Required = True
      Size = 100
    end
    object qpedidosdetalledesc_producto: TWideStringField
      FieldName = 'desc_producto'
      Required = True
      Size = 100
    end
    object qpedidosdetallecantidad: TFloatField
      FieldName = 'cantidad'
      Required = True
    end
    object qpedidosdetallecantidadservida: TFloatField
      FieldName = 'cantidadservida'
    end
    object qpedidosdetallepalets: TIntegerField
      FieldName = 'palets'
    end
    object qpedidosdetalleref: TWideStringField
      FieldName = 'ref'
      Size = 30
    end
    object qpedidosdetalleean: TWideStringField
      FieldName = 'ean'
      Size = 30
    end
    object qpedidosdetallemarca: TWideStringField
      FieldName = 'marca'
      Required = True
      Size = 40
    end
    object qpedidosdetalleobservaciones: TWideStringField
      FieldName = 'observaciones'
      Size = 500
    end
    object qpedidosdetalleidcajapropia: TWideStringField
      FieldName = 'idcajapropia'
      Required = True
      Size = 30
    end
    object qpedidosdetalleidalbaran: TWideStringField
      FieldName = 'idalbaran'
      Size = 22
    end
    object qpedidosdetalleidexpedicion: TWideStringField
      FieldName = 'idexpedicion'
      Size = 22
    end
    object qpedidosdetalledesc_envpropio: TWideStringField
      FieldName = 'desc_envpropio'
      Size = 100
    end
    object qpedidosdetalleidcalidad: TWideStringField
      FieldName = 'idcalidad'
      Size = 30
    end
    object qpedidosdetalleidacabado: TWideStringField
      FieldName = 'idacabado'
      Size = 30
    end
    object qpedidosdetalledesc_calidad: TWideStringField
      FieldName = 'desc_calidad'
      Size = 100
    end
    object qpedidosdetalledesc_acabado: TWideStringField
      FieldName = 'desc_acabado'
      Size = 100
    end
    object qpedidosdetalleidformatopropio: TIntegerField
      FieldName = 'idformatopropio'
    end
    object qpedidosdetalledesc_formatopropio: TWideStringField
      FieldName = 'desc_formatopropio'
      Size = 100
    end
    object qpedidosdetalleunidadescaja: TIntegerField
      FieldName = 'unidadescaja'
    end
    object qpedidosdetallefecha_caducidad: TDateField
      FieldName = 'fecha_caducidad'
    end
    object qpedidosdetalleprecio: TFloatField
      FieldName = 'precio'
    end
  end
  object dsqalbaranesiva: TDataSource
    DataSet = qalbaranesiva
    Left = 592
    Top = 328
  end
  object qalbaranesiva: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from albaranes_iva order by tipo desc')
    Params = <>
    MasterFields = 'idempresa;id;serie'
    MasterSource = dsalbaranes
    LinkedFields = 'ide;idalbaran;serie'
    Left = 592
    Top = 368
    object qalbaranesivaidalbaran: TIntegerField
      FieldName = 'idalbaran'
      Required = True
    end
    object qalbaranesivaide: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qalbaranesivabase: TFloatField
      FieldName = 'base'
      Required = True
      DisplayFormat = '#0.00'
    end
    object qalbaranesivatipo: TFloatField
      FieldName = 'tipo'
      Required = True
    end
    object qalbaranesivaiva: TFloatField
      FieldName = 'iva'
      Required = True
      DisplayFormat = '#0.00'
    end
    object qalbaranesivaserie: TWideStringField
      FieldName = 'serie'
      Required = True
      Size = 10
    end
  end
  object dsqpedidos2: TDataSource
    DataSet = qpedidos2
    Left = 680
    Top = 320
  end
  object dsqpedidosdetalle2: TDataSource
    DataSet = qpedidosdetalle2
    Left = 728
    Top = 320
  end
  object qpedidosdetalle2: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from pedidosdetalle where idalbaran is not null')
    Params = <>
    MasterFields = 'ide;id'
    MasterSource = dsqpedidos2
    LinkedFields = 'ide;idpedido'
    Left = 728
    Top = 360
    object qpedidosdetalle2id: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qpedidosdetalle2ide: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qpedidosdetalle2idpedido: TIntegerField
      FieldName = 'idpedido'
      Required = True
    end
    object qpedidosdetalle2idcliente: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object qpedidosdetalle2idproductocli: TWideStringField
      FieldName = 'idproductocli'
      Required = True
      Size = 30
    end
    object qpedidosdetalle2idenvase: TWideStringField
      FieldName = 'idenvase'
      Required = True
      Size = 30
    end
    object qpedidosdetalle2desc_envase: TWideStringField
      FieldName = 'desc_envase'
      Required = True
      Size = 100
    end
    object qpedidosdetalle2desc_producto: TWideStringField
      FieldName = 'desc_producto'
      Required = True
      Size = 100
    end
    object qpedidosdetalle2cantidad: TFloatField
      FieldName = 'cantidad'
      Required = True
    end
    object qpedidosdetalle2cantidadservida: TFloatField
      FieldName = 'cantidadservida'
    end
    object qpedidosdetalle2palets: TIntegerField
      FieldName = 'palets'
    end
    object qpedidosdetalle2ref: TWideStringField
      FieldName = 'ref'
      Size = 30
    end
    object qpedidosdetalle2ean: TWideStringField
      FieldName = 'ean'
      Size = 30
    end
    object qpedidosdetalle2marca: TWideStringField
      FieldName = 'marca'
      Required = True
      Size = 40
    end
    object qpedidosdetalle2observaciones: TWideStringField
      FieldName = 'observaciones'
      Size = 500
    end
    object qpedidosdetalle2idcajapropia: TWideStringField
      FieldName = 'idcajapropia'
      Required = True
      Size = 30
    end
    object qpedidosdetalle2idalbaran: TWideStringField
      FieldName = 'idalbaran'
      Size = 22
    end
    object qpedidosdetalle2idexpedicion: TWideStringField
      FieldName = 'idexpedicion'
      Size = 22
    end
  end
  object qpedidos2: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      
        'select p.id,p.ide,p.idcliente,p.iddestino,p.fecha_pedido,p.fecha' +
        '_entrega,c.nombre_corto as cliente,d.descripcion as destino,p.pe' +
        'didocliente from pedidos p,clientes c,clientes_destinos d where '
      
        'p.ide=c.idempresa and p.idcliente=c.id and p.ide=d.idempresa and' +
        ' p.idcliente=d.idcliente and p.iddestino=d.codigo and'
      
        'p.id in (select pd.idpedido from pedidosdetalle pd where pd.idal' +
        'baran is not null)')
    Params = <>
    MasterFields = 'Idempresa;idcliente;iddestino'
    MasterSource = dsalbaranes
    LinkedFields = 'Ide;idcliente;iddestino'
    Left = 680
    Top = 360
    object IntegerField8: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object IntegerField9: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object IntegerField10: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object WideStringField11: TWideStringField
      FieldName = 'iddestino'
      Required = True
      Size = 40
    end
    object DateField1: TDateField
      FieldName = 'fecha_pedido'
      Required = True
    end
    object DateField2: TDateField
      FieldName = 'fecha_entrega'
    end
    object WideStringField12: TWideStringField
      FieldName = 'cliente'
      Required = True
      Size = 80
    end
    object WideStringField13: TWideStringField
      FieldName = 'destino'
      Required = True
      Size = 80
    end
    object qpedidos2pedidocliente: TWideStringField
      FieldName = 'pedidocliente'
      Size = 40
    end
  end
  object infalbaran: TfrxDBDataset
    UserName = 'infalbaran'
    CloseDataSource = False
    DataSource = dsalbaranes
    BCDToCurrency = False
    Left = 824
    Top = 96
  end
  object infdetallealbaran: TfrxDBDataset
    UserName = 'infdetallealbaran'
    CloseDataSource = False
    OpenDataSource = False
    BCDToCurrency = False
    Left = 832
    Top = 48
  end
  object infalbaranivas: TfrxDBDataset
    UserName = 'infalbaranivas'
    CloseDataSource = False
    DataSource = dsqalbaranesiva
    BCDToCurrency = False
    Left = 824
    Top = 144
  end
  object informe: TfrxReport
    Version = '6.9.3'
    DotMatrixReport = False
    IniFile = '\Software\Fast Reports'
    PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
    PreviewOptions.Zoom = 1.000000000000000000
    PrintOptions.Printer = 'Default'
    PrintOptions.PrintOnSheet = 0
    ReportOptions.CreateDate = 43972.308234201400000000
    ReportOptions.LastChange = 45713.796279131940000000
    ScriptLanguage = 'PascalScript'
    ScriptText.Strings = (
      ''
      'begin'
      ''
      'end.')
    Left = 880
    Top = 48
    Datasets = <
      item
        DataSet = infalbaran
        DataSetName = 'infalbaran'
      end
      item
        DataSet = infalbaranivas
        DataSetName = 'infalbaranivas'
      end
      item
        DataSet = infdetallealbaran
        DataSetName = 'infdetallealbaran'
      end
      item
        DataSet = BASE.INFEMPRESA
        DataSetName = 'INFEMPRESA'
      end>
    Variables = <>
    Style = <>
    object Data: TfrxDataPage
      Height = 1000.000000000000000000
      Width = 1000.000000000000000000
    end
    object Page1: TfrxReportPage
      PaperWidth = 210.000000000000000000
      PaperHeight = 297.000000000000000000
      PaperSize = 9
      LeftMargin = 10.000000000000000000
      RightMargin = 10.000000000000000000
      TopMargin = 10.000000000000000000
      BottomMargin = 10.000000000000000000
      Frame.Typ = []
      MirrorMode = []
      object MasterData1: TfrxMasterData
        FillType = ftBrush
        Frame.Typ = []
        Height = 18.897637800000000000
        Top = 313.700990000000000000
        Width = 718.110700000000000000
        DataSet = infalbaran
        DataSetName = 'infalbaran'
        RowCount = 0
        StartNewPage = True
        object Memo4: TfrxMemoView
          AllowVectorExport = True
          Width = 154.960730000000000000
          Height = 18.897650000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            'DESCRIPCION')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo5: TfrxMemoView
          AllowVectorExport = True
          Left = 391.280766660000000000
          Width = 44.703463330000000000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'PALLETS')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo6: TfrxMemoView
          AllowVectorExport = True
          Left = 481.178416670000000000
          Width = 56.262523330000000000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            'UNIDADES')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo7: TfrxMemoView
          AllowVectorExport = True
          Left = 630.435683330000000000
          Width = 86.278293330000000000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            'ORIGEN')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo8: TfrxMemoView
          AllowVectorExport = True
          Left = 154.910636660000000000
          Width = 72.504020000000000000
          Height = 18.897650000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            'ENVASE')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo9: TfrxMemoView
          AllowVectorExport = True
          Left = 300.286023340000000000
          Width = 91.842609999999990000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            'EAN')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo39: TfrxMemoView
          AllowVectorExport = True
          Left = 227.771800000000000000
          Width = 72.504020000000000000
          Height = 18.897650000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            'REF')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo40: TfrxMemoView
          AllowVectorExport = True
          Left = 436.425480000000000000
          Width = 44.703463330000000000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'BULTOS')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo41: TfrxMemoView
          AllowVectorExport = True
          Left = 537.693260000000000000
          Width = 44.703463330000000000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'P.NETO')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo42: TfrxMemoView
          AllowVectorExport = True
          Left = 581.827150000000000000
          Width = 48.482993330000000000
          Height = 18.897650000000000000
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'P.BRUTO')
          ParentFont = False
          VAlign = vaCenter
        end
        object Line2: TfrxLineView
          AllowVectorExport = True
          Top = 17.007874015748030000
          Width = 718.110700000000000000
          Color = clBlack
          Frame.Typ = [ftTop]
        end
      end
      object PageHeader1: TfrxPageHeader
        FillType = ftBrush
        Frame.Typ = []
        Height = 235.099276060000000000
        Top = 18.897650000000000000
        Width = 718.110700000000000000
        object Shape1: TfrxShapeView
          AllowVectorExport = True
          Left = 366.614173228346000000
          Top = 32.089053330000000000
          Width = 340.735003330000000000
          Height = 54.435683330000000000
          Frame.Typ = []
          Shape = skRoundRectangle
        end
        object Shape2: TfrxShapeView
          AllowVectorExport = True
          Left = 3.779293230000000000
          Top = 153.700680010000000000
          Width = 342.666666660000000000
          Height = 69.553803330000000000
          Frame.Typ = []
          Shape = skRoundRectangle
        end
        object frxDBDataset1nomcliente: TfrxMemoView
          AllowVectorExport = True
          Left = 11.338345910000000000
          Top = 13.469696680000000000
          Width = 365.963513330000000000
          Height = 96.682436659999990000
          DataSet = infalbaran
          DataSetName = 'infalbaran'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[infalbaran."nomcliente"]'
            '[infalbaran."direccion"]'
            '[infalbaran."codpost"]  [infalbaran."poblacion"]'
            '[infalbaran."provincia"]'
            '[infalbaran."paiscliente"]'
            '[infalbaran."nif"]')
          ParentFont = False
        end
        object Memo1: TfrxMemoView
          AllowVectorExport = True
          Left = 378.055350000000000000
          Top = 36.013543340000000000
          Width = 70.899566670000000000
          Height = 49.994743330000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = [fsBold]
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'Albaran n'#186':'
            'Fecha:'
            'Pedido:')
          ParentFont = False
        end
        object Line22: TfrxLineView
          AllowVectorExport = True
          Left = -49.600000000000000000
          Top = 15.886580000000000000
          Height = 68.031496060000000000
          Color = clBlack
          Frame.Typ = [ftLeft]
        end
        object INFEMPRESAnombre: TfrxMemoView
          AllowVectorExport = True
          Left = 11.338590000000000000
          Top = 154.960730000000000000
          Width = 355.275820000000000000
          Height = 60.472480000000000000
          DataSet = BASE.INFEMPRESA
          DataSetName = 'INFEMPRESA'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[INFEMPRESA."nombre"]'
            '[INFEMPRESA."direccion"]'
            
              '[INFEMPRESA."codpost"] [INFEMPRESA."poblacion"] [INFEMPRESA."pro' +
              'vincia"]')
          ParentFont = False
          Formats = <
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end>
        end
        object Memo2: TfrxMemoView
          AllowVectorExport = True
          Left = 452.543600000000000000
          Top = 35.015770000000010000
          Width = 335.466666670000000000
          Height = 49.994743330000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[infalbaran."serie"]/ [infalbaran."id"]'
            '[infalbaran."fecha"]'
            '[infalbaran."REFERENCIA"]')
          ParentFont = False
          Formats = <
            item
            end
            item
            end
            item
            end
            item
            end>
        end
        object Memo10: TfrxMemoView
          AllowVectorExport = True
          Left = 11.118120000000000000
          Top = 132.283550000000000000
          Width = 127.592516670000000000
          Height = 19.758503330000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = [fsBold]
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'ALMACEN DE CARGA')
          ParentFont = False
        end
        object Shape3: TfrxShapeView
          AllowVectorExport = True
          Left = 370.393940000000000000
          Top = 153.700680010000000000
          Width = 342.666666660000000000
          Height = 69.553803330000000000
          Frame.Typ = []
          Shape = skRoundRectangle
        end
        object Memo37: TfrxMemoView
          AllowVectorExport = True
          Left = 377.732766770000000000
          Top = 132.283550000000000000
          Width = 59.560976670000000000
          Height = 19.758503330000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = [fsBold]
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'DESTINO')
          ParentFont = False
        end
        object Memo38: TfrxMemoView
          AllowVectorExport = True
          Left = 377.953000000000000000
          Top = 154.960730000000000000
          Width = 365.963513330000000000
          Height = 66.446196660000000000
          DataSet = infalbaran
          DataSetName = 'infalbaran'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[infalbaran."nomdestino"]'
            '[infalbaran."direcciondestino"]'
            '[infalbaran."codpostdestino"]  [infalbaran."poblaciondestino"]'
            '[infalbaran."provinciadestino"]')
          ParentFont = False
          Formats = <
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end
            item
            end>
        end
      end
      object DetailData1: TfrxDetailData
        FillType = ftBrush
        Frame.Typ = []
        Height = 18.897637800000000000
        Top = 355.275820000000000000
        Width = 718.110700000000000000
        DataSet = infdetallealbaran
        DataSetName = 'infdetallealbaran'
        FooterAfterEach = True
        RowCount = 0
        Stretched = True
        object Memo12: TfrxMemoView
          AllowVectorExport = True
          Left = 154.960629920000000000
          Width = 72.566929130000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataField = 'envase'
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[infdetallealbaran."envase"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo20: TfrxMemoView
          AllowVectorExport = True
          Width = 154.960730000000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataField = 'descripcion'
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[infdetallealbaran."descripcion"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo21: TfrxMemoView
          AllowVectorExport = True
          Left = 391.181102360000000000
          Width = 44.598425200000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.0f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[infdetallealbaran."palets"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo22: TfrxMemoView
          AllowVectorExport = True
          Left = 436.535433070000000000
          Width = 44.598425200000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataField = 'bultos'
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.0f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[infdetallealbaran."bultos"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo23: TfrxMemoView
          AllowVectorExport = True
          Left = 481.133858270000000000
          Width = 56.314960630000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.0f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            
              '[<infdetallealbaran."bultos">*<infdetallealbaran."unidadescaja">' +
              ']'
            '')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo24: TfrxMemoView
          AllowVectorExport = True
          Left = 227.905511810000000000
          Width = 72.566929130000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataField = 'referencia'
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[infdetallealbaran."referencia"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo25: TfrxMemoView
          AllowVectorExport = True
          Left = 300.472440940000000000
          Width = 91.842519690000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[infdetallealbaran."ean"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo43: TfrxMemoView
          AllowVectorExport = True
          Left = 537.826771649999900000
          Width = 44.598425200000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.2f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            '[infdetallealbaran."cantidad"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo44: TfrxMemoView
          AllowVectorExport = True
          Left = 581.669291340000000000
          Width = 48.377952760000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.2f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            '[infdetallealbaran."pesobruto"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo45: TfrxMemoView
          AllowVectorExport = True
          Left = 630.425196850000000000
          Width = 86.173228350000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataField = 'pais'
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.3f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[infdetallealbaran."pais"]')
          ParentFont = False
          VAlign = vaCenter
        end
      end
      object ReportSummary1: TfrxReportSummary
        FillType = ftBrush
        Frame.Typ = []
        Height = 294.803340000000000000
        Top = 480.000310000000000000
        Width = 718.110700000000000000
        PrintAtBottom = True
        object Memo26: TfrxMemoView
          AllowVectorExport = True
          Left = 15.118120000000000000
          Top = 3.779530000000022000
          Width = 260.787570000000000000
          Height = 18.897650000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = [ftBottom]
          Memo.UTF8W = (
            'TIPO PALET                                            CARGADOS')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo27: TfrxMemoView
          AllowVectorExport = True
          Left = 15.118120000000000000
          Top = 113.385900000000000000
          Width = 260.787570000000000000
          Height = 30.236240000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            'MATRICULAS:'
            'Firma Transportista:')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo28: TfrxMemoView
          AllowVectorExport = True
          Left = 279.685220000000000000
          Top = 113.385900000000000000
          Width = 154.960730000000000000
          Height = 30.236240000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            'Firma y sello del cliente:')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo29: TfrxMemoView
          AllowVectorExport = True
          Left = 464.882190000000000000
          Width = 215.433210000000000000
          Height = 22.677180000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = [ftBottom]
          Memo.UTF8W = (
            'LOTES:')
          ParentFont = False
          VAlign = vaCenter
        end
        object PALETS: TfrxMemoView
          AllowVectorExport = True
          Left = 15.118120000000000000
          Top = 30.236240000000010000
          Width = 188.976500000000000000
          Height = 79.370130000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[PALETS]')
          ParentFont = False
        end
        object LOTES: TfrxMemoView
          AllowVectorExport = True
          Left = 464.882190000000000000
          Top = 30.236240000000010000
          Width = 90.708720000000000000
          Height = 79.370130000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[LOTES]')
          ParentFont = False
        end
        object cantidad: TfrxMemoView
          AllowVectorExport = True
          Left = 207.874150000000000000
          Top = 30.236240000000010000
          Width = 68.031540000000010000
          Height = 79.370130000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            '[CANTIDAD]')
          ParentFont = False
        end
        object VARIEDAD: TfrxMemoView
          AllowVectorExport = True
          Left = 559.370440000000000000
          Top = 30.236240000000010000
          Width = 117.165430000000000000
          Height = 79.370130000000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          Memo.UTF8W = (
            '[VARIEDAD]')
          ParentFont = False
        end
      end
      object ColumnFooter1: TfrxColumnFooter
        FillType = ftBrush
        Frame.Typ = []
        Height = 22.677180000000000000
        Top = 434.645950000000000000
        Width = 718.110700000000000000
        object Memo30: TfrxMemoView
          AllowVectorExport = True
          Left = 392.071120000000000000
          Top = 1.000000000000000000
          Width = 44.598425200000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.0f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[SUM(<infdetallealbaran."palets">,DetailData1)]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo31: TfrxMemoView
          AllowVectorExport = True
          Left = 437.425450710000000000
          Top = 1.000000000000000000
          Width = 44.598425200000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.0f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haCenter
          Memo.UTF8W = (
            '[SUM(<infdetallealbaran."bultos">,DetailData1)]'
            '')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo32: TfrxMemoView
          AllowVectorExport = True
          Left = 482.023875910000000000
          Top = 1.000000000000000000
          Width = 56.314960630000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.0f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            
              '[SUM(<infdetallealbaran."bultos">*<infdetallealbaran."unidadesca' +
              'ja">,DetailData1)]'
            '')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo33: TfrxMemoView
          AllowVectorExport = True
          Left = 538.716789289999900000
          Top = 1.000000000000000000
          Width = 44.598425200000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.2f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            '[SUM(<infdetallealbaran."cantidad">,DetailData1)]'
            '')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo34: TfrxMemoView
          AllowVectorExport = True
          Left = 582.559308980000000000
          Top = 1.000000000000000000
          Width = 48.377952760000000000
          Height = 18.897650000000000000
          StretchMode = smMaxHeight
          DataSet = infdetallealbaran
          DataSetName = 'infdetallealbaran'
          DisplayFormat.FormatStr = '%2.2f'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Century Gothic'
          Font.Style = []
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            '[SUM(<infdetallealbaran."pesobruto">,DetailData1)]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo35: TfrxMemoView
          AllowVectorExport = True
          Left = 257.008040000000000000
          Width = 127.592516670000000000
          Height = 19.758503330000000000
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Century Gothic'
          Font.Style = [fsBold]
          Frame.Typ = []
          HAlign = haRight
          Memo.UTF8W = (
            'TOTALES')
          ParentFont = False
        end
        object Line1: TfrxLineView
          AllowVectorExport = True
          Width = 718.110700000000000000
          Color = clBlack
          Frame.Typ = [ftTop]
        end
      end
    end
  end
  object qaux: TZQuery
    Connection = DM.DBagrigest
    Params = <>
    Left = 552
    Top = 104
  end
  object dsqformaspago: TDataSource
    DataSet = qformaspago
    Left = 480
    Top = 320
  end
  object qformaspago: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from formas_pago order by descripcion')
    Params = <>
    MasterFields = 'id'
    MasterSource = DM.dsempresa
    LinkedFields = 'ide'
    Left = 480
    Top = 360
    object qformaspagoide: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qformaspagoid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qformaspagocodigo: TWideStringField
      FieldName = 'codigo'
      Required = True
      Size = 40
    end
    object qformaspagodescripcion: TWideStringField
      FieldName = 'descripcion'
      Required = True
      Size = 200
    end
    object qformaspagodias: TIntegerField
      FieldName = 'dias'
      Required = True
    end
  end
  object qarticulos: TZReadOnlyQuery
    Connection = DM.DBagrigest
    BeforeOpen = qarticulosBeforeOpen
    SQL.Strings = (
      
        'select * from articulosf where activo=1 and facturable=1 order b' +
        'y descripcion')
    Params = <>
    Left = 256
    Top = 328
    object qarticulosidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object qarticulosid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qarticuloscodigo: TWideStringField
      FieldName = 'codigo'
      Required = True
      Size = 40
    end
    object qarticulosdescripcion: TWideStringField
      FieldName = 'descripcion'
      Required = True
      Size = 100
    end
    object qarticulosfamilia: TIntegerField
      FieldName = 'familia'
    end
    object qarticulosprovhab: TIntegerField
      FieldName = 'provhab'
    end
    object qarticulostipoiva: TIntegerField
      FieldName = 'tipoiva'
      Required = True
    end
    object qarticulospreciocoste: TFloatField
      FieldName = 'preciocoste'
      Required = True
    end
    object qarticulosmargen: TFloatField
      FieldName = 'margen'
      Required = True
    end
    object qarticulosbeneficio: TFloatField
      FieldName = 'beneficio'
      Required = True
    end
    object qarticulospvp: TFloatField
      FieldName = 'pvp'
      Required = True
    end
    object qarticulosstock: TFloatField
      FieldName = 'stock'
      Required = True
    end
    object qarticulosult_preciocompra: TFloatField
      FieldName = 'ult_preciocompra'
      Required = True
    end
    object qarticulosfacturable: TIntegerField
      FieldName = 'facturable'
      Required = True
    end
    object qarticulosobservaciones: TWideStringField
      FieldName = 'observaciones'
      Size = 500
    end
    object qarticulosimagen: TBlobField
      FieldName = 'imagen'
    end
    object qarticulosactivo: TIntegerField
      FieldName = 'activo'
      Required = True
    end
    object qarticulosvalor_almacen: TFloatField
      FieldName = 'valor_almacen'
      Required = True
    end
    object qarticulosstock_minimo: TFloatField
      FieldName = 'stock_minimo'
      Required = True
    end
    object qarticulosavisar_stock: TIntegerField
      FieldName = 'avisar_stock'
      Required = True
    end
    object qarticuloscontrolar_traza: TIntegerField
      FieldName = 'controlar_traza'
    end
    object qarticulospeso: TFloatField
      FieldName = 'peso'
      Required = True
    end
  end
  object dsqarticulos: TDataSource
    DataSet = qarticulos
    Left = 256
    Top = 288
  end
  object qtipos_iva: TZReadOnlyQuery
    Connection = DM.DBagrigest
    BeforeOpen = qarticulosBeforeOpen
    SQL.Strings = (
      'select * from tipos_iva')
    Params = <>
    MasterFields = 'tipoiva'
    MasterSource = dsqarticulos
    LinkedFields = 'id'
    Left = 288
    Top = 360
    object qtipos_ivaid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qtipos_ivadescripcion: TWideStringField
      FieldName = 'descripcion'
      Required = True
      Size = 50
    end
    object qtipos_ivatipo: TIntegerField
      FieldName = 'tipo'
      Required = True
    end
    object qtipos_ivatipo_req: TFloatField
      FieldName = 'tipo_req'
      Required = True
    end
  end
  object dsqtiposiva: TDataSource
    DataSet = qtipos_iva
    Left = 240
    Top = 80
  end
  object qalbaranesclientes: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      
        '(select a.*,ad.*,l.parcela from albaranes a,albaranes_detalles a' +
        'd,lotes l where l.idempresa=ad.idempresa and l.codigo=ad.lote an' +
        'd a.idempresa=ad.idempresa and a.serie=ad.serie and a.id=ad.idal' +
        'baran and a.serie='#39'22'#39' AND A.ID=1) '
      ' union ALL'
      
        '(select a.*,ad.*,'#39' '#39' as parcela from albaranes a,albaranes_detal' +
        'les ad where ad.lote is null and a.idempresa=ad.idempresa and a.' +
        'serie=ad.serie and a.id=ad.idalbaran and a.serie='#39'22'#39' AND A.ID=1' +
        ')   order by fecha desc')
    Params = <>
    MasterFields = 'Idempresa;id'
    LinkedFields = 'idempresa;idcliente'
    Left = 384
    Top = 328
    object qalbaranesclientesserie: TWideStringField
      FieldName = 'serie'
      ReadOnly = True
      Size = 10
    end
    object qalbaranesclientesid: TIntegerField
      FieldName = 'id'
      ReadOnly = True
    end
    object qalbaranesclientesidempresa: TIntegerField
      FieldName = 'idempresa'
      ReadOnly = True
    end
    object qalbaranesclientesidcliente: TIntegerField
      FieldName = 'idcliente'
      ReadOnly = True
    end
    object qalbaranesclientesiddestino: TWideStringField
      FieldName = 'iddestino'
      ReadOnly = True
      Size = 40
    end
    object qalbaranesclientesnif: TWideStringField
      FieldName = 'nif'
      ReadOnly = True
      Size = 22
    end
    object qalbaranesclientesdireccion: TWideStringField
      FieldName = 'direccion'
      ReadOnly = True
      Size = 100
    end
    object qalbaranesclientespoblacion: TWideStringField
      FieldName = 'poblacion'
      ReadOnly = True
      Size = 100
    end
    object qalbaranesclientesprovincia: TWideStringField
      FieldName = 'provincia'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientescodpost: TWideStringField
      FieldName = 'codpost'
      ReadOnly = True
      Size = 10
    end
    object qalbaranesclientesfecha: TDateField
      FieldName = 'fecha'
      ReadOnly = True
    end
    object qalbaranesclientesreferencia: TWideStringField
      FieldName = 'referencia'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientestelefono: TWideStringField
      FieldName = 'telefono'
      ReadOnly = True
      Size = 30
    end
    object qalbaranesclientesnomcliente: TWideStringField
      FieldName = 'nomcliente'
      ReadOnly = True
      Size = 100
    end
    object qalbaranesclientespaiscliente: TWideStringField
      FieldName = 'paiscliente'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientesnomdestino: TWideStringField
      FieldName = 'nomdestino'
      ReadOnly = True
      Size = 100
    end
    object qalbaranesclientesdirecciondestino: TWideStringField
      FieldName = 'direcciondestino'
      ReadOnly = True
      Size = 100
    end
    object qalbaranesclientespoblaciondestino: TWideStringField
      FieldName = 'poblaciondestino'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientescodpostdestino: TWideStringField
      FieldName = 'codpostdestino'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientesprovinciadestino: TWideStringField
      FieldName = 'provinciadestino'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientespaisdestino: TWideStringField
      FieldName = 'paisdestino'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientesneto: TFloatField
      FieldName = 'neto'
      ReadOnly = True
    end
    object qalbaranesclientestotal: TFloatField
      FieldName = 'total'
      ReadOnly = True
    end
    object qalbaranesclientesfacturado: TIntegerField
      FieldName = 'facturado'
      ReadOnly = True
    end
    object qalbaranesclientesdocumento: TWideStringField
      FieldName = 'documento'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientesdescuento_lin: TFloatField
      FieldName = 'descuento_lin'
      ReadOnly = True
    end
    object qalbaranesclientesdescuento_com: TFloatField
      FieldName = 'descuento_com'
      ReadOnly = True
    end
    object qalbaranesclientesdescuento_pp: TFloatField
      FieldName = 'descuento_pp'
      ReadOnly = True
    end
    object qalbaranesclientesdescuento_total: TFloatField
      FieldName = 'descuento_total'
      ReadOnly = True
    end
    object qalbaranesclientestotaliva: TFloatField
      FieldName = 'totaliva'
      ReadOnly = True
    end
    object qalbaranesclientesobservaciones: TWideStringField
      FieldName = 'observaciones'
      ReadOnly = True
      Size = 500
    end
    object qalbaranesclientesidfactura: TIntegerField
      FieldName = 'idfactura'
      ReadOnly = True
    end
    object qalbaranesclientesbultos: TFloatField
      FieldName = 'bultos'
      ReadOnly = True
    end
    object qalbaranesclienteskilos: TFloatField
      FieldName = 'kilos'
      ReadOnly = True
    end
    object qalbaranesclientesidformapago: TIntegerField
      FieldName = 'idformapago'
      ReadOnly = True
    end
    object qalbaranesclientescc_pago: TWideStringField
      FieldName = 'cc_pago'
      ReadOnly = True
      Size = 160
    end
    object qalbaranesclientescoste_transporte: TFloatField
      FieldName = 'coste_transporte'
      ReadOnly = True
    end
    object qalbaranesclientespeso_bruto: TFloatField
      FieldName = 'peso_bruto'
      ReadOnly = True
    end
    object qalbaranesclientesprov_transporte: TWideStringField
      FieldName = 'prov_transporte'
      ReadOnly = True
      Size = 40
    end
    object qalbaranesclientesccid: TIntegerField
      FieldName = 'ccid'
      ReadOnly = True
    end
    object qalbaranesclientescccuentabancaria: TWideStringField
      FieldName = 'cccuentabancaria'
      ReadOnly = True
      Size = 160
    end
    object qalbaranesclientescomision: TFloatField
      FieldName = 'comision'
      ReadOnly = True
    end
    object qalbaranesclienteskilosventa: TFloatField
      FieldName = 'kilosventa'
      ReadOnly = True
    end
    object qalbaranesclientesnumpalets: TFloatField
      FieldName = 'numpalets'
      ReadOnly = True
    end
    object qalbaranesclientesid_1: TIntegerField
      FieldName = 'id_1'
      ReadOnly = True
    end
    object qalbaranesclientesidempresa_1: TIntegerField
      FieldName = 'idempresa_1'
      ReadOnly = True
    end
    object qalbaranesclientesserie_1: TWideStringField
      FieldName = 'serie_1'
      ReadOnly = True
      Size = 10
    end
    object qalbaranesclientesidalbaran: TIntegerField
      FieldName = 'idalbaran'
      ReadOnly = True
    end
    object qalbaranesclientesidarticulo: TWideStringField
      FieldName = 'idarticulo'
      ReadOnly = True
      Size = 50
    end
    object qalbaranesclientesdescripcion: TWideStringField
      FieldName = 'descripcion'
      ReadOnly = True
      Size = 100
    end
    object qalbaranesclientescal: TWideStringField
      FieldName = 'cal'
      ReadOnly = True
      Size = 40
    end
    object qalbaranesclienteslote: TWideStringField
      FieldName = 'lote'
      ReadOnly = True
      Size = 30
    end
    object qalbaranesclientesbultos_1: TFloatField
      FieldName = 'bultos_1'
      ReadOnly = True
    end
    object qalbaranesclientescantidad: TFloatField
      FieldName = 'cantidad'
      ReadOnly = True
    end
    object qalbaranesclientesprecio: TFloatField
      FieldName = 'precio'
      ReadOnly = True
    end
    object qalbaranesclientesdescuento: TFloatField
      FieldName = 'descuento'
      ReadOnly = True
    end
    object qalbaranesclientestotaldescuento: TFloatField
      FieldName = 'totaldescuento'
      ReadOnly = True
    end
    object qalbaranesclientesbase: TFloatField
      FieldName = 'base'
      ReadOnly = True
    end
    object qalbaranesclientestipoiva: TFloatField
      FieldName = 'tipoiva'
      ReadOnly = True
    end
    object qalbaranesclientesiva: TFloatField
      FieldName = 'iva'
      ReadOnly = True
    end
    object qalbaranesclientestotal_1: TFloatField
      FieldName = 'total_1'
      ReadOnly = True
    end
    object qalbaranesclientescoste_transporte_1: TFloatField
      FieldName = 'coste_transporte_1'
      ReadOnly = True
    end
    object qalbaranesclientescoste_otros: TFloatField
      FieldName = 'coste_otros'
      ReadOnly = True
    end
    object qalbaranesclientescoste_comision: TFloatField
      FieldName = 'coste_comision'
      ReadOnly = True
    end
    object qalbaranesclientespesobruto: TFloatField
      FieldName = 'pesobruto'
      ReadOnly = True
    end
    object qalbaranesclientesidfactura_1: TIntegerField
      FieldName = 'idfactura_1'
      ReadOnly = True
    end
    object qalbaranesclientesparcela: TWideStringField
      FieldName = 'parcela'
      ReadOnly = True
      Size = 30
    end
  end
  object dsqalbaranesclientes: TDataSource
    DataSet = qalbaranesclientes
    Left = 320
    Top = 336
  end
  object SaveDialog1: TSaveDialog
    Left = 296
    Top = 8
  end
  object frxPDFExport1: TfrxPDFExport
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    DataOnly = False
    EmbedFontsIfProtected = False
    InteractiveFormsFontSubset = 'A-Z,a-z,0-9,#43-#47 '
    OpenAfterExport = False
    PrintOptimized = False
    Outline = False
    Background = False
    HTMLTags = True
    Quality = 95
    Transparency = False
    Author = 'FastReport'
    Subject = 'FastReport PDF export'
    Creator = 'FastReport'
    ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
    HideToolbar = False
    HideMenubar = False
    HideWindowUI = False
    FitWindow = False
    CenterWindow = False
    PrintScaling = False
    PdfA = False
    PDFStandard = psNone
    PDFVersion = pv17
    Left = 880
    Top = 96
  end
  object dsfacturas: TDataSource
    DataSet = facturas
    Left = 432
    Top = 64
  end
  object dsfacturasdetalle: TDataSource
    DataSet = facturasdetalle
    Left = 496
    Top = 66
  end
  object facturasdetalle: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from facturas_detalles')
    Params = <>
    MasterFields = 'idempresa;id'
    MasterSource = dsfacturas
    LinkedFields = 'idempresa;idfactura'
    Left = 488
    Top = 106
    object facturasdetalleid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object facturasdetalleidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object facturasdetalleidfactura: TIntegerField
      FieldName = 'idfactura'
      Required = True
    end
    object facturasdetalleidarticulo: TWideStringField
      FieldName = 'idarticulo'
      Size = 50
    end
    object facturasdetalledescripcion: TWideStringField
      FieldName = 'descripcion'
      Size = 100
    end
    object facturasdetallecal: TWideStringField
      FieldName = 'cal'
      Size = 40
    end
    object facturasdetallelote: TWideStringField
      FieldName = 'lote'
      Size = 30
    end
    object facturasdetallecantidad: TFloatField
      FieldName = 'cantidad'
      DisplayFormat = '#0.00'
    end
    object facturasdetalleprecio: TFloatField
      FieldName = 'precio'
      DisplayFormat = '#0.0000'
    end
    object facturasdetalledescuento: TFloatField
      FieldName = 'descuento'
      DisplayFormat = '#0.00'
    end
    object facturasdetalletotaldescuento: TFloatField
      FieldName = 'totaldescuento'
      DisplayFormat = '#0.00'
    end
    object facturasdetallebase: TFloatField
      FieldName = 'base'
      DisplayFormat = '#0.00'
    end
    object facturasdetalletipoiva: TFloatField
      FieldName = 'tipoiva'
      DisplayFormat = '#0.00'
    end
    object facturasdetalleiva: TFloatField
      FieldName = 'iva'
      DisplayFormat = '#0.00'
    end
    object facturasdetalletotal: TFloatField
      FieldName = 'total'
      DisplayFormat = '#0.00'
    end
    object facturasdetalleserie: TWideStringField
      FieldName = 'serie'
      Required = True
      Size = 10
    end
    object facturasdetallebultos: TFloatField
      FieldName = 'bultos'
    end
    object facturasdetallecoste_transporte: TFloatField
      FieldName = 'coste_transporte'
    end
    object facturasdetallecoste_otros: TFloatField
      FieldName = 'coste_otros'
    end
    object facturasdetallecoste_comision: TFloatField
      FieldName = 'coste_comision'
    end
  end
  object facturas: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from facturas order by serie desc, id desc')
    Params = <>
    MasterFields = 'id'
    MasterSource = DM.dsempresa
    LinkedFields = 'idempresa'
    Left = 432
    Top = 104
    object facturasid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object facturasidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object facturasidcliente: TIntegerField
      FieldName = 'idcliente'
      Required = True
    end
    object facturasiddestino: TWideStringField
      FieldName = 'iddestino'
      Required = True
      Size = 40
    end
    object facturasnif: TWideStringField
      FieldName = 'nif'
      Size = 22
    end
    object facturasdireccion: TWideStringField
      FieldName = 'direccion'
      Size = 100
    end
    object facturaspoblacion: TWideStringField
      FieldName = 'poblacion'
      Size = 100
    end
    object facturasprovincia: TWideStringField
      FieldName = 'provincia'
      Size = 50
    end
    object facturascodpost: TWideStringField
      FieldName = 'codpost'
      Size = 10
    end
    object facturasfecha: TDateField
      FieldName = 'fecha'
      Required = True
      DisplayFormat = 'dd/mm/yy'
    end
    object facturasreferencia: TWideStringField
      FieldName = 'referencia'
      Size = 50
    end
    object facturastelefono: TWideStringField
      FieldName = 'telefono'
      Size = 30
    end
    object facturasnomcliente: TWideStringField
      FieldName = 'nomcliente'
      Size = 100
    end
    object facturaspaiscliente: TWideStringField
      FieldName = 'paiscliente'
      Size = 50
    end
    object facturasnomdestino: TWideStringField
      FieldName = 'nomdestino'
      Size = 100
    end
    object facturasdirecciondestino: TWideStringField
      FieldName = 'direcciondestino'
      Size = 100
    end
    object facturaspoblaciondestino: TWideStringField
      FieldName = 'poblaciondestino'
      Size = 50
    end
    object facturascodpostdestino: TWideStringField
      FieldName = 'codpostdestino'
      Size = 50
    end
    object facturasprovinciadestino: TWideStringField
      FieldName = 'provinciadestino'
      Size = 50
    end
    object facturaspaisdestino: TWideStringField
      FieldName = 'paisdestino'
      Size = 50
    end
    object facturasneto: TFloatField
      FieldName = 'neto'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturastotal: TFloatField
      FieldName = 'total'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturasdocumento: TWideStringField
      FieldName = 'documento'
      Size = 50
    end
    object facturasdescuento_lin: TFloatField
      FieldName = 'descuento_lin'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturasdescuento_com: TFloatField
      FieldName = 'descuento_com'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturasdescuento_pp: TFloatField
      FieldName = 'descuento_pp'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturasdescuento_total: TFloatField
      FieldName = 'descuento_total'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturastotaliva: TFloatField
      FieldName = 'totaliva'
      Required = True
      DisplayFormat = '#0.00'
    end
    object facturasobservaciones: TWideStringField
      FieldName = 'observaciones'
      Size = 510
    end
    object facturasserie: TWideStringField
      FieldName = 'serie'
      Required = True
      Size = 10
    end
    object facturasbultos: TFloatField
      FieldName = 'bultos'
      Required = True
    end
    object facturaskilos: TFloatField
      FieldName = 'kilos'
      Required = True
    end
    object facturasidformapago: TIntegerField
      FieldName = 'idformapago'
      Required = True
    end
    object facturascobrado: TIntegerField
      FieldName = 'cobrado'
    end
    object facturascomision: TFloatField
      FieldName = 'comision'
    end
    object facturascoste_transporte: TFloatField
      FieldName = 'coste_transporte'
    end
  end
  object qcuentas: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from cuentas_bancarias order by banco')
    Params = <>
    MasterFields = 'id'
    MasterSource = DM.dsempresa
    LinkedFields = 'ide'
    Left = 248
    Top = 176
    object qcuentaside: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qcuentasid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qcuentasbanco: TWideStringField
      FieldName = 'banco'
      Required = True
      Size = 100
    end
    object qcuentascciban: TWideStringField
      FieldName = 'cciban'
      Required = True
      Size = 8
    end
    object qcuentasccentidad: TWideStringField
      FieldName = 'ccentidad'
      Required = True
      Size = 8
    end
    object qcuentasccoficina: TWideStringField
      FieldName = 'ccoficina'
      Required = True
      Size = 8
    end
    object qcuentasccdc: TWideStringField
      FieldName = 'ccdc'
      Required = True
      Size = 4
    end
    object qcuentascccc: TWideStringField
      FieldName = 'cccc'
      Required = True
    end
  end
  object dsqcuentas: TDataSource
    DataSet = qcuentas
    Left = 168
    Top = 120
  end
  object dsqseries2: TDataSource
    DataSet = qseries2
    OnDataChange = dsqseries2DataChange
    Left = 256
    Top = 384
  end
  object qseries2: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      
        'select * from series_numericas order by activo desc,fechainicio ' +
        'desc,id ')
    Params = <>
    MasterFields = 'id'
    MasterSource = DM.dsempresa
    LinkedFields = 'ide'
    Left = 256
    Top = 424
    object qseries2ide: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qseries2id: TWideStringField
      FieldName = 'id'
      Required = True
      Size = 10
    end
    object qseries2fechainicio: TDateField
      FieldName = 'fechainicio'
      Required = True
    end
    object qseries2fechafin: TDateField
      FieldName = 'fechafin'
      Required = True
    end
    object qseries2num_pedcliente: TIntegerField
      FieldName = 'num_pedcliente'
      Required = True
    end
    object qseries2num_albaran: TIntegerField
      FieldName = 'num_albaran'
      Required = True
    end
    object qseries2num_factura: TIntegerField
      FieldName = 'num_factura'
      Required = True
    end
    object qseries2num_expedicion: TIntegerField
      FieldName = 'num_expedicion'
      Required = True
    end
    object qseries2num_pedproveedor: TIntegerField
      FieldName = 'num_pedproveedor'
      Required = True
    end
    object qseries2imp_albaran: TWideStringField
      FieldName = 'imp_albaran'
      Size = 500
    end
    object qseries2imp_factura: TWideStringField
      FieldName = 'imp_factura'
      Size = 500
    end
    object qseries2activo: TIntegerField
      FieldName = 'activo'
      Required = True
    end
    object qseries2num_presupuesto: TIntegerField
      FieldName = 'num_presupuesto'
      Required = True
    end
  end
  object qformularios: TZReadOnlyQuery
    Connection = DM.DBagrigest
    BeforeOpen = qarticulosBeforeOpen
    SQL.Strings = (
      
        'select * from formatosimpresion where aplicar_a='#39'ALBARANES'#39' orde' +
        'r by aplicar_a,pordefecto desc,descripcion')
    Params = <>
    Left = 752
    Top = 152
    object qformularioside: TIntegerField
      FieldName = 'ide'
      Required = True
    end
    object qformulariosid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qformulariosformulario: TWideStringField
      FieldName = 'formulario'
      Size = 80
    end
    object qformulariosdescripcion: TWideStringField
      FieldName = 'descripcion'
      Size = 160
    end
    object qformulariosaplicar_a: TWideStringField
      FieldName = 'aplicar_a'
      Size = 80
    end
    object qformulariospordefecto: TIntegerField
      FieldName = 'pordefecto'
      ReadOnly = True
    end
  end
  object dsqformularios: TDataSource
    DataSet = qformularios
    Left = 752
    Top = 112
  end
  object qedi_cabalbaran: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from edi_cabalbaran order by pos_inicio')
    Params = <>
    Left = 104
    Top = 200
    object qedi_cabalbarancampo: TWideStringField
      FieldName = 'campo'
      Required = True
      Size = 40
    end
    object qedi_cabalbarantipo: TWideStringField
      FieldName = 'tipo'
      Size = 2
    end
    object qedi_cabalbaranlongitud: TFloatField
      FieldName = 'longitud'
    end
    object qedi_cabalbaranpos_inicio: TIntegerField
      FieldName = 'pos_inicio'
    end
    object qedi_cabalbaranpos_fin: TIntegerField
      FieldName = 'pos_fin'
    end
  end
  object qedi_detalbaran: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from edi_detalbaran order by pos_inicio')
    Params = <>
    Left = 104
    Top = 256
    object qedi_detalbarancampo: TWideStringField
      FieldName = 'campo'
      Required = True
      Size = 40
    end
    object qedi_detalbarantipo: TWideStringField
      FieldName = 'tipo'
      Size = 2
    end
    object qedi_detalbaranlongitud: TFloatField
      FieldName = 'longitud'
    end
    object qedi_detalbaranpos_inicio: TIntegerField
      FieldName = 'pos_inicio'
    end
    object qedi_detalbaranpos_fin: TIntegerField
      FieldName = 'pos_fin'
    end
  end
  object qedi_embalbaran: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from edi_embalbaran order by pos_inicio')
    Params = <>
    Left = 104
    Top = 312
    object qedi_embalbarancampo: TWideStringField
      FieldName = 'campo'
      Required = True
      Size = 40
    end
    object qedi_embalbarantipo: TWideStringField
      FieldName = 'tipo'
      Size = 2
    end
    object qedi_embalbaranlongitud: TFloatField
      FieldName = 'longitud'
    end
    object qedi_embalbaranpos_inicio: TIntegerField
      FieldName = 'pos_inicio'
    end
    object qedi_embalbaranpos_fin: TIntegerField
      FieldName = 'pos_fin'
    end
  end
  object qedi_lugaresentrega: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from edi_lugaresentrega order by pos_inicio')
    Params = <>
    Left = 104
    Top = 368
    object qedi_lugaresentregacampo: TWideStringField
      FieldName = 'campo'
      Required = True
      Size = 40
    end
    object qedi_lugaresentregatipo: TWideStringField
      FieldName = 'tipo'
      Size = 2
    end
    object qedi_lugaresentregalongitud: TFloatField
      FieldName = 'longitud'
    end
    object qedi_lugaresentregapos_inicio: TIntegerField
      FieldName = 'pos_inicio'
    end
    object qedi_lugaresentregapos_fin: TIntegerField
      FieldName = 'pos_fin'
    end
  end
  object qedi_marcasembalaje: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'select * from edi_marcasembalaje order by pos_inicio')
    Params = <>
    Left = 104
    Top = 416
    object qedi_marcasembalajecampo: TWideStringField
      FieldName = 'campo'
      Required = True
      Size = 40
    end
    object qedi_marcasembalajetipo: TWideStringField
      FieldName = 'tipo'
      Size = 2
    end
    object qedi_marcasembalajelongitud: TFloatField
      FieldName = 'longitud'
    end
    object qedi_marcasembalajepos_inicio: TIntegerField
      FieldName = 'pos_inicio'
    end
    object qedi_marcasembalajepos_fin: TIntegerField
      FieldName = 'pos_fin'
    end
  end
  object qedicabecera: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'SELECT CONCAT(SERIE,ID) AS IDCAB,'
      
        '(SELECT IDPEDIDO FROM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SE' +
        'RIE,'#39'/'#39',A.ID) LIMIT 1) AS NUMDES,'
      #39'351'#39' AS TIPO,'
      
        '(SELECT FECHA_CARGA FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FROM ' +
        'PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID) LIMIT 1)' +
        ') AS FECDES,  '
      
        '(SELECT FECHA_ENTREGA FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FRO' +
        'M PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID) LIMIT ' +
        '1)) AS FECENT,'
      
        '(SELECT ALBARANCLIENTE FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FR' +
        'OM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID) LIMIT' +
        ' 1)) AS ALBARANCLIENTE,'
      'CONCAT(SERIE,ID) AS NUMALB,'
      
        '(SELECT FECHA_PEDIDO FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FROM' +
        ' PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID) LIMIT 1' +
        ')) AS FECPED,  '
      'FECHA AS FECALB,'
      
        '(SELECT PEDIDOCLIENTE FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FRO' +
        'M PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID) LIMIT ' +
        '1)) AS NUMPED,'
      '(SELECT EAN FROM EMPRESA WHERE ID=A.IDEMPRESA) AS ORIGEN,'
      
        '(SELECT EAN2 FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIENTE ' +
        'AND CODIGO=A.IDDESTINO) AS DESTINO,'
      
        '(SELECT EANRECEPTOR FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDC' +
        'LIENTE AND CODIGO=A.IDDESTINO) AS ULTCONS,'
      '(SELECT EAN FROM CLIENTES WHERE ID=A.IDCLIENTE) AS PROVEEDO,'
      
        '(SELECT EAN FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIENTE A' +
        'ND CODIGO=A.IDDESTINO) AS COMPRADO,'
      
        '(SELECT EAN FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIENTE A' +
        'ND CODIGO=A.IDDESTINO) AS RECEPTOR,'
      
        '(SELECT SUM(CANTIDAD) FROM ALBARANES_DETALLES WHERE IDALBARAN=A.' +
        'ID AND SERIE=A.SERIE) AS TOTQTY,'
      
        '(SELECT FECHA_CARGA FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FROM ' +
        'PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID) LIMIT 1)' +
        ') AS FECENV,'
      
        '(select personacontacto from clientes where id=a.idcliente) as c' +
        'odprov,'
      
        '(select nombre from empresa where id=a.idempresa) as NOMBREEMISO' +
        'R, '
      '(select cif from empresa where id=a.idempresa) as NIFEMISOR,'
      
        '(SELECT DESCRIPCION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDC' +
        'LIENTE AND CODIGO=A.IDDESTINO) AS NOMBRERECEPTOR,'
      
        '(SELECT DESCRIPCION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDC' +
        'LIENTE AND CODIGO=A.IDDESTINO) AS NOMBRECOMPRADOR,'
      
        '(SELECT NOMBRE FROM CLIENTES WHERE ID=A.IDCLIENTE) as NOMBREPROV' +
        'EEDOR, '
      
        '(SELECT DESCRIPCION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDC' +
        'LIENTE AND CODIGO=A.IDDESTINO) AS NOMBREPTOENTREGA,'
      
        '(select DIRECCION from empresa where id=a.idempresa) as DIRECCIO' +
        'NEMISOR, '
      
        '(select POBLACION from empresa where id=a.idempresa) as POBLACIO' +
        'NEMISOR, '
      
        '(select PROVINCIA from empresa where id=a.idempresa) as PROVINCI' +
        'AEMISOR, '
      '(select CODPOST from empresa where id=a.idempresa) as CPEMISOR, '
      
        '(SELECT DIRECCION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS DIRECCIONCOMPRADOR,'
      
        '(SELECT POBLACION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS POBLACIONCOMPRADOR,'
      
        '(SELECT PROVINCIA FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS PROVINCIACOMPRADOR,'
      
        '(SELECT CODPOST FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIEN' +
        'TE AND CODIGO=A.IDDESTINO) AS CPCOMPRADOR,'
      
        '(SELECT DIRECCION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS DIRECCIONPTOENTREGA,'
      
        '(SELECT POBLACION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS POBLACIONPTOENTREGA,'
      
        '(SELECT PROVINCIA FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS PROVINCIAPTOENTREGA,'
      
        '(SELECT CODPOST FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIEN' +
        'TE AND CODIGO=A.IDDESTINO) AS CPPTOENTREGA,'
      
        '(SELECT DIRECCION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS DIRECCIONRECEPTOR,'
      
        '(SELECT POBLACION FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS POBLACIONRECEPTOR,'
      
        '(SELECT PROVINCIA FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLI' +
        'ENTE AND CODIGO=A.IDDESTINO) AS PROVINCIARECEPTOR,'
      
        '(SELECT CODPOST FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIEN' +
        'TE AND CODIGO=A.IDDESTINO) AS CPRECEPTOR,'
      '(SELECT NIF FROM CLIENTES WHERE ID=A.IDCLIENTE) AS NIFPROVEEDOR,'
      'NETO AS IMPTOTBRUTO,'
      'NETO AS IMPTOTNETO,'
      #39'EUR'#39' AS MONEDA,'
      'A.PESO_BRUTO AS PESOBRUTOT,'
      
        '(SELECT SUM(CANTIDAD) FROM ALBARANES_DETALLES WHERE IDALBARAN=A.' +
        'ID AND SERIE=A.SERIE) AS PESONETTOT,'
      
        '(SELECT SUM(BULTOS) FROM ALBARANES_DETALLES WHERE IDALBARAN=A.ID' +
        ' AND SERIE=A.SERIE) AS NUMTOTBUL,'
      #39'31'#39' AS MEDIOTRAN,'
      
        '(SELECT DEP FROM CLIENTES_DESTINOS WHERE IDCLIENTE=A.IDCLIENTE A' +
        'ND CODIGO=A.IDDESTINO) AS DPTO,'
      '(SELECT EAN FROM CLIENTES WHERE ID=A.IDCLIENTE) AS ORDENADOR'
      ' FROM albaranes A'
      ''
      'WHERE SERIE=:SERIE AND ID=:ALBARAN')
    Params = <
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    Left = 96
    Top = 504
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    object qedicabeceraIDCAB: TWideStringField
      FieldName = 'IDCAB'
      ReadOnly = True
      Size = 34
    end
    object qedicabeceraNUMDES: TIntegerField
      FieldName = 'NUMDES'
      ReadOnly = True
    end
    object qedicabeceraTIPO: TWideStringField
      FieldName = 'TIPO'
      ReadOnly = True
      Size = 6
    end
    object qedicabeceraFECDES: TDateField
      FieldName = 'FECDES'
      ReadOnly = True
    end
    object qedicabeceraFECENT: TDateField
      FieldName = 'FECENT'
      ReadOnly = True
    end
    object qedicabeceraNUMALB: TWideStringField
      FieldName = 'NUMALB'
      ReadOnly = True
      Size = 34
    end
    object qedicabeceraFECALB: TDateField
      FieldName = 'FECALB'
      Required = True
    end
    object qedicabeceraNUMPED: TWideStringField
      FieldName = 'NUMPED'
      ReadOnly = True
      Size = 40
    end
    object qedicabeceraORIGEN: TWideStringField
      FieldName = 'ORIGEN'
      ReadOnly = True
      Size = 26
    end
    object qedicabeceraDESTINO: TWideStringField
      FieldName = 'DESTINO'
      ReadOnly = True
      Size = 26
    end
    object qedicabeceraPROVEEDO: TWideStringField
      FieldName = 'PROVEEDO'
      ReadOnly = True
      Size = 26
    end
    object qedicabeceraCOMPRADO: TWideStringField
      FieldName = 'COMPRADO'
      ReadOnly = True
      Size = 26
    end
    object qedicabeceraRECEPTOR: TWideStringField
      FieldName = 'RECEPTOR'
      ReadOnly = True
      Size = 26
    end
    object qedicabeceraTOTQTY: TFloatField
      FieldName = 'TOTQTY'
      ReadOnly = True
    end
    object qedicabeceraFECENV: TDateField
      FieldName = 'FECENV'
      ReadOnly = True
    end
    object qedicabeceracodprov: TWideStringField
      FieldName = 'codprov'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraNOMBREEMISOR: TWideStringField
      FieldName = 'NOMBREEMISOR'
      ReadOnly = True
      Size = 120
    end
    object qedicabeceraNIFEMISOR: TWideStringField
      FieldName = 'NIFEMISOR'
      ReadOnly = True
      Size = 18
    end
    object qedicabeceraNOMBRERECEPTOR: TWideStringField
      FieldName = 'NOMBRERECEPTOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraNOMBRECOMPRADOR: TWideStringField
      FieldName = 'NOMBRECOMPRADOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraNOMBREPROVEEDOR: TWideStringField
      FieldName = 'NOMBREPROVEEDOR'
      ReadOnly = True
      Size = 120
    end
    object qedicabeceraNOMBREPTOENTREGA: TWideStringField
      FieldName = 'NOMBREPTOENTREGA'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraDIRECCIONEMISOR: TWideStringField
      FieldName = 'DIRECCIONEMISOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraPOBLACIONEMISOR: TWideStringField
      FieldName = 'POBLACIONEMISOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraPROVINCIAEMISOR: TWideStringField
      FieldName = 'PROVINCIAEMISOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraCPEMISOR: TWideStringField
      FieldName = 'CPEMISOR'
      ReadOnly = True
      Size = 10
    end
    object qedicabeceraDIRECCIONCOMPRADOR: TWideStringField
      FieldName = 'DIRECCIONCOMPRADOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraPOBLACIONCOMPRADOR: TWideStringField
      FieldName = 'POBLACIONCOMPRADOR'
      ReadOnly = True
      Size = 80
    end
    object qedicabeceraPROVINCIACOMPRADOR: TWideStringField
      FieldName = 'PROVINCIACOMPRADOR'
      ReadOnly = True
      Size = 60
    end
    object qedicabeceraCPCOMPRADOR: TWideStringField
      FieldName = 'CPCOMPRADOR'
      ReadOnly = True
      Size = 10
    end
    object qedicabeceraDIRECCIONPTOENTREGA: TWideStringField
      FieldName = 'DIRECCIONPTOENTREGA'
      ReadOnly = True
      Size = 50
    end
    object qedicabeceraPOBLACIONPTOENTREGA: TWideStringField
      FieldName = 'POBLACIONPTOENTREGA'
      ReadOnly = True
      Size = 50
    end
    object qedicabeceraPROVINCIAPTOENTREGA: TWideStringField
      FieldName = 'PROVINCIAPTOENTREGA'
      ReadOnly = True
      Size = 50
    end
    object qedicabeceraCPPTOENTREGA: TWideStringField
      FieldName = 'CPPTOENTREGA'
      ReadOnly = True
      Size = 10
    end
    object qedicabeceraDIRECCIONRECEPTOR: TWideStringField
      FieldName = 'DIRECCIONRECEPTOR'
      ReadOnly = True
      Size = 50
    end
    object qedicabeceraPOBLACIONRECEPTOR: TWideStringField
      FieldName = 'POBLACIONRECEPTOR'
      ReadOnly = True
      Size = 50
    end
    object qedicabeceraPROVINCIARECEPTOR: TWideStringField
      FieldName = 'PROVINCIARECEPTOR'
      ReadOnly = True
      Size = 50
    end
    object qedicabeceraCPRECEPTOR: TWideStringField
      FieldName = 'CPRECEPTOR'
      ReadOnly = True
      Size = 10
    end
    object qedicabeceraNIFPROVEEDOR: TWideStringField
      FieldName = 'NIFPROVEEDOR'
      ReadOnly = True
      Size = 30
    end
    object qedicabeceraIMPTOTBRUTO: TFloatField
      FieldName = 'IMPTOTBRUTO'
      Required = True
    end
    object qedicabeceraIMPTOTNETO: TFloatField
      FieldName = 'IMPTOTNETO'
      Required = True
    end
    object qedicabeceraMONEDA: TWideStringField
      FieldName = 'MONEDA'
      ReadOnly = True
      Size = 6
    end
    object qedicabeceraPESOBRUTOT: TFloatField
      FieldName = 'PESOBRUTOT'
    end
    object qedicabeceraPESONETTOT: TFloatField
      FieldName = 'PESONETTOT'
      ReadOnly = True
    end
    object qedicabeceraNUMTOTBUL: TFloatField
      FieldName = 'NUMTOTBUL'
      ReadOnly = True
    end
    object qedicabeceraMEDIOTRAN: TWideStringField
      FieldName = 'MEDIOTRAN'
      ReadOnly = True
      Size = 4
    end
    object qedicabeceraORDENADOR: TWideStringField
      FieldName = 'ORDENADOR'
      ReadOnly = True
      Size = 26
    end
    object qedicabeceraFECPED: TDateField
      FieldName = 'FECPED'
      ReadOnly = True
    end
    object qedicabeceraDPTO: TWideStringField
      FieldName = 'DPTO'
      ReadOnly = True
      Size = 34
    end
    object qedicabeceraALBARANCLIENTE: TWideStringField
      FieldName = 'ALBARANCLIENTE'
      ReadOnly = True
      Size = 90
    end
    object qedicabeceraULTCONS: TWideStringField
      FieldName = 'ULTCONS'
      ReadOnly = True
      Size = 26
    end
  end
  object qediembalajes: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'SELECT REPLACE(IDALBARAN,'#39'/'#39','#39#39') AS IDCAB,'
      
        '(SELECT ID FROM CLIENTES_FORMATOARTICULOS WHERE IDFORMATO=(SELEC' +
        'T IDENVASE FROM pedidosdetalle WHERE ID=A.IDPEDIDO)) AS IDEMB,'
      
        '(select palets+1 from albaranes_detalles where idarticulo=a.id l' +
        'imit 1) AS CPSO,'
      #39'1'#39' AS CPSPADRE,'
      'cast(sum(NUM_ENVASES) as unsigned) AS CANTEMB,'
      #39'0'#39' AS TIPEMB,'
      
        '(SELECT DESC_ENVASE FROM pedidosdetalle WHERE ID=A.IDPEDIDO) AS ' +
        'DESCEMB,'
      #39'1'#39' AS PAGRET,'
      'codssc AS SSCC1,'
      'cast(sum(NUM_ENVASES) as unsigned) AS BULTPALET,'
      
        '(SELECT idacabado FROM pedidosdetalle WHERE ID=A.IDPEDIDO) AS FO' +
        'RMATO,'
      #39'0'#39' AS IDLIN,'
      #39'1'#39' AS IDMARCA,'
      
        '(SELECT MARCA FROM CLIENTES_FORMATOARTICULOS WHERE IDFORMATO=(SE' +
        'LECT IDENVASE FROM pedidosdetalle WHERE ID=A.IDPEDIDO)) AS MARCA' +
        '1,'
      
        '(SELECT FECHA_ELAVORACION FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO' +
        ' FROM PEDIDOSDETALLE WHERE ID=A.IDPEDIDO)) AS FECENV,'
      'LOTES_DETALLE AS LOTE '
      ''
      ' FROM EA_PESADAS A'
      ''
      'WHERE IDALBARAN=:ALBARAN group by cpso'
      'UNION ALL'
      'SELECT REPLACE(IDALBARAN,'#39'/'#39','#39#39') AS IDCAB,'
      #39'0'#39' AS IDEMB,'
      #39'1'#39' AS CPSO,'
      #39#39' AS CPSPADRE,'
      'sum(PALETS) AS CANTEMB,'
      #39'08'#39' AS TIPEMB,'
      #39'PALET'#39' AS DESCEMB,'
      #39'1'#39' AS PAGRET,'
      
        '(select codssc from ea_pesadas where idalbaran=a.idalbaran limit' +
        ' 1) AS SSCC1,'
      'cast(0 as unsigned) AS BULTPALET,'
      #39' '#39' AS FORMATO,'
      #39'0'#39' AS IDLIN,'
      #39'0'#39' AS IDMARCA,'
      #39' '#39' AS MARCA1,'
      
        '(SELECT FECHA_ELAVORACION FROM PEDIDOS WHERE ID=IDPEDIDO) AS FEC' +
        'ENV,'
      #39' '#39' AS LOTE'
      ' FROM PEDIDOSDETALLE A'
      
        ' WHERE IDALBARAN=:ALBARAN ORDER BY CAST(cpso AS INTEGER), CANTEM' +
        'B'
      ''
      '')
    Params = <
      item
        DataType = ftWideString
        Name = 'ALBARAN'
        ParamType = ptUnknown
        Value = #39'23/1499'#39
      end>
    Left = 96
    Top = 552
    ParamData = <
      item
        DataType = ftWideString
        Name = 'ALBARAN'
        ParamType = ptUnknown
        Value = #39'23/1499'#39
      end>
    object qediembalajesIDCAB: TWideStringField
      FieldName = 'IDCAB'
      Size = 22
    end
    object qediembalajesIDEMB: TWideStringField
      FieldName = 'IDEMB'
      ReadOnly = True
      Size = 30
    end
    object qediembalajesCPSO: TWideStringField
      FieldName = 'CPSO'
      ReadOnly = True
      Size = 34
    end
    object qediembalajesCPSPADRE: TWideStringField
      FieldName = 'CPSPADRE'
      ReadOnly = True
      Size = 2
    end
    object qediembalajesCANTEMB: TLargeintField
      FieldName = 'CANTEMB'
      ReadOnly = True
    end
    object qediembalajesTIPEMB: TWideStringField
      FieldName = 'TIPEMB'
      ReadOnly = True
      Size = 4
    end
    object qediembalajesDESCEMB: TWideStringField
      FieldName = 'DESCEMB'
      ReadOnly = True
      Size = 100
    end
    object qediembalajesPAGRET: TWideStringField
      FieldName = 'PAGRET'
      ReadOnly = True
      Size = 2
    end
    object qediembalajesSSCC1: TWideStringField
      FieldName = 'SSCC1'
      Size = 100
    end
    object qediembalajesBULTPALET: TFloatField
      FieldName = 'BULTPALET'
      ReadOnly = True
    end
    object qediembalajesFORMATO: TWideStringField
      FieldName = 'FORMATO'
      ReadOnly = True
      Size = 30
    end
    object qediembalajesIDLIN: TWideStringField
      FieldName = 'IDLIN'
      ReadOnly = True
      Size = 2
    end
    object qediembalajesIDMARCA: TWideStringField
      FieldName = 'IDMARCA'
      ReadOnly = True
      Size = 2
    end
    object qediembalajesMARCA1: TWideStringField
      FieldName = 'MARCA1'
      ReadOnly = True
      Size = 40
    end
    object qediembalajesFECENV: TDateField
      FieldName = 'FECENV'
      ReadOnly = True
    end
    object qediembalajesLOTE: TWideStringField
      FieldName = 'LOTE'
      Size = 60
    end
  end
  object qedilocalizaciones: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'SELECT CONCAT(A.SERIE,A.IDALBARAN) AS IDCAB,'
      'PALETS+1 AS IDEMB,'
      #39'0'#39' AS IDLIN,'
      
        '(SELECT IDDESTINO FROM ALBARANES WHERE SERIE=A.SERIE AND ID=A.ID' +
        'ALBARAN) AS IDLOC,'
      
        '(SELECT NOMDESTINO FROM ALBARANES WHERE SERIE=A.SERIE AND ID=A.I' +
        'DALBARAN) AS LUGAR,'
      
        '(SELECT FECHA_ENTREGA FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FRO' +
        'M PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.IDALBARAN)' +
        ' LIMIT 1)) AS FECENV,'
      'BULTOS AS CANTIDAD,'
      'CANTIDAD AS CANTKGM,'
      
        '(SELECT NOMDESTINO FROM ALBARANES WHERE SERIE=A.SERIE AND ID=A.I' +
        'DALBARAN) AS NOMBREPTOENTREGA,'
      #39'KGM'#39' AS UMEDIDA'
      ' FROM albaranes_detalles A'
      ''
      
        'WHERE IDALBARAN=:ALBARAN AND SERIE=:SERIE group by idarticulo OR' +
        'DER BY IDEMB')
    Params = <
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end>
    Left = 96
    Top = 600
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end>
    object qedilocalizacionesIDCAB: TWideStringField
      FieldName = 'IDCAB'
      ReadOnly = True
      Size = 34
    end
    object qedilocalizacionesIDEMB: TFloatField
      FieldName = 'IDEMB'
    end
    object qedilocalizacionesIDLIN: TWideStringField
      FieldName = 'IDLIN'
      ReadOnly = True
      Size = 2
    end
    object qedilocalizacionesIDLOC: TWideStringField
      FieldName = 'IDLOC'
      ReadOnly = True
      Size = 40
    end
    object qedilocalizacionesLUGAR: TWideStringField
      FieldName = 'LUGAR'
      ReadOnly = True
      Size = 100
    end
    object qedilocalizacionesFECENV: TDateField
      FieldName = 'FECENV'
      ReadOnly = True
    end
    object qedilocalizacionesCANTIDAD: TFloatField
      FieldName = 'CANTIDAD'
    end
    object qedilocalizacionesCANTKGM: TFloatField
      FieldName = 'CANTKGM'
    end
    object qedilocalizacionesNOMBREPTOENTREGA: TWideStringField
      FieldName = 'NOMBREPTOENTREGA'
      ReadOnly = True
      Size = 100
    end
    object qedilocalizacionesUMEDIDA: TWideStringField
      FieldName = 'UMEDIDA'
      ReadOnly = True
      Size = 6
    end
  end
  object qedilinalbaran: TZReadOnlyQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      'SELECT CONCAT(A.SERIE,A.IDALBARAN) AS IDCAB,'
      
        '(SELECT ID FROM CLIENTES_FORMATOARTICULOS WHERE IDFORMATO=(SELEC' +
        'T IDENVASE FROM pedidosdetalle WHERE ID=(SELECT IDPEDIDO FROM EA' +
        '_PESADAS WHERE ID=IDARTICULO AND IDALBARAN IS NOT NULL LIMIT 1))' +
        ') AS IDEMB,'
      'cast(PALETS+1 as unsigned) AS CPSO,'
      #39'0'#39' AS IDLIN,'
      
        '(SELECT EAN FROM PEDIDOSDETALLE WHERE ID=(SELECT IDPEDIDO FROM E' +
        'A_PESADAS WHERE ID=IDARTICULO AND IDALBARAN IS NOT NULL LIMIT 1)' +
        ') AS EAN,'
      
        '(SELECT CONCAT(COALESCE(IDPRODUCTOCLI,"000"),COALESCE(IDENVASE,"' +
        '000"),COALESCE(IDACABADO,"000")) FROM PEDIDOSDETALLE WHERE ID=(S' +
        'ELECT IDPEDIDO FROM EA_PESADAS WHERE ID=A.IDARTICULO AND IDALBAR' +
        'AN IS NOT NULL LIMIT 1)) AS REFPROV,'
      
        '(SELECT CAST(ID AS UNSIGNED) FROM PEDIDOS WHERE ID=(SELECT  IDPE' +
        'DIDO FROM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.ID' +
        'ALBARAN) LIMIT 1)) AS NUMEXP,'
      
        '(SELECT DUN14 FROM PEDIDOSDETALLE WHERE ID=(SELECT IDPEDIDO FROM' +
        ' EA_PESADAS WHERE ID=IDARTICULO AND IDALBARAN IS NOT NULL LIMIT ' +
        '1)) AS NUMEXP2,'
      'A.DESCRIPCION AS DESCRIP,'
      
        '(SELECT if ((SELECT cast(UNIDADESCAJA as unsigned) FROM PEDIDOSD' +
        'ETALLE WHERE ID=(SELECT IDPEDIDO FROM EA_PESADAS WHERE ID=A.IDAR' +
        'TICULO AND IDALBARAN IS NOT NULL LIMIT 1))=0,'
      
        'sum(A.bultos),(SELECT num_envases FROM EA_PESADAS WHERE IDALBARA' +
        'N IS NOT NULL AND ID=A.IDARTICULO LIMIT 1)*(SELECT cast(UNIDADES' +
        'CAJA as unsigned) FROM PEDIDOSDETALLE WHERE ID=(SELECT IDPEDIDO ' +
        'FROM EA_PESADAS WHERE ID=A.IDARTICULO AND IDALBARAN IS NOT NULL ' +
        'LIMIT 1)))) AS CENVFAC,'
      
        '(SELECT cast(UNIDADESCAJA as unsigned) FROM PEDIDOSDETALLE WHERE' +
        ' ID=(SELECT IDPEDIDO FROM EA_PESADAS WHERE ID=IDARTICULO AND IDA' +
        'LBARAN IS NOT NULL limit 1)) AS CUEXP,'
      
        '(select if ((SELECT cast(UNIDADESCAJA as unsigned) FROM PEDIDOSD' +
        'ETALLE WHERE ID=(SELECT IDPEDIDO FROM EA_PESADAS WHERE ID=IDARTI' +
        'CULO AND IDALBARAN IS NOT NULL LIMIT 1))=0,'#39'KGM'#39','#39'PEC'#39')) AS UNIC' +
        'ANT,'
      
        '(SELECT PEDIDOCLIENTE FROM PEDIDOS WHERE ID=(SELECT  IDPEDIDO FR' +
        'OM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.IDALBARAN' +
        ') LIMIT 1)) AS NUMPED,'
      
        '(SELECT ALBARANCLIENTE FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FR' +
        'OM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.IDALBARAN' +
        ') LIMIT 1)) AS ALBARANCLIENTE,'
      'CONCAT(A.SERIE,A.IDALBARAN) AS NUMALB,'
      
        '(SELECT CODSSC FROM EA_PESADAS WHERE IDALBARAN IS NOT NULL AND I' +
        'D=A.IDARTICULO LIMIT 1) AS SSCC,'
      
        '(SELECT FECHA_ELAVORACION FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO' +
        ' FROM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.IDALBA' +
        'RAN) LIMIT 1)) AS FECENV,'
      
        '(SELECT FECHA_ELAVORACION FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO' +
        ' FROM PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.IDALBA' +
        'RAN) LIMIT 1)) AS FECCON,'
      
        '(SELECT LOTES_DETALLE FROM EA_PESADAS WHERE IDALBARAN IS NOT NUL' +
        'L AND ID=IDARTICULO LIMIT 1) AS LOTE,'
      'sum(CANTIDAD) AS CANTLOC1,'
      
        '(SELECT NOMDESTINO FROM ALBARANES WHERE SERIE=A.SERIE AND ID=A.I' +
        'DALBARAN) AS NOMBREPTOENTREGA,'
      
        '(SELECT FECHA_PEDIDO FROM PEDIDOS WHERE ID=(SELECT IDPEDIDO FROM' +
        ' PEDIDOSDETALLE WHERE IDALBARAN=CONCAT(A.SERIE,'#39'/'#39',A.IDALBARAN) ' +
        'LIMIT 1)) AS FECPED,'
      
        '(SELECT FECHA FROM ALBARANES WHERE SERIE=A.SERIE AND ID=A.IDALBA' +
        'RAN) AS FECALB,'
      'sum(CANTIDAD) AS PESTOTLIN,'
      
        '(SELECT FECHA_CADUCIDAD FROM PEDIDOSDETALLE WHERE ID=(SELECT IDP' +
        'EDIDO FROM EA_PESADAS WHERE ID=IDARTICULO AND IDALBARAN IS NOT N' +
        'ULL limit 1)) AS FECCADET,'
      'sum(PESOBRUTO) AS PESOBRUTO,'
      'sum(CANTIDAD) AS PESONETO,'
      
        '(SELECT IDVARIEDAD FROM PEDIDOSDETALLE WHERE ID=(SELECT IDPEDIDO' +
        ' FROM EA_PESADAS WHERE ID=IDARTICULO AND IDALBARAN IS NOT NULL l' +
        'imit 1)) AS TEXTO4,'
      
        '(SELECT IDPAIS FROM PEDIDOSDETALLE WHERE ID=(SELECT IDPEDIDO FRO' +
        'M EA_PESADAS WHERE ID=IDARTICULO AND IDALBARAN IS NOT NULL limit' +
        ' 1)) AS TEXTO5'
      ' FROM albaranes_detalles A'
      
        'WHERE IDALBARAN=:ALBARAN AND SERIE=:SERIE  group by idarticulo o' +
        'rder by cpso,cantidad'
      '')
    Params = <
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end>
    Left = 96
    Top = 648
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end>
    object qedilinalbaranIDCAB: TWideStringField
      FieldName = 'IDCAB'
      ReadOnly = True
      Size = 34
    end
    object qedilinalbaranIDEMB: TWideStringField
      FieldName = 'IDEMB'
      ReadOnly = True
      Size = 30
    end
    object qedilinalbaranCPSO: TFloatField
      FieldName = 'CPSO'
      ReadOnly = True
    end
    object qedilinalbaranIDLIN: TWideStringField
      FieldName = 'IDLIN'
      ReadOnly = True
      Size = 2
    end
    object qedilinalbaranEAN: TWideStringField
      FieldName = 'EAN'
      ReadOnly = True
      Size = 30
    end
    object qedilinalbaranREFPROV: TWideStringField
      FieldName = 'REFPROV'
      ReadOnly = True
      Size = 90
    end
    object qedilinalbaranNUMEXP: TFloatField
      FieldName = 'NUMEXP'
      ReadOnly = True
    end
    object qedilinalbaranDESCRIP: TWideStringField
      FieldName = 'DESCRIP'
      Size = 100
    end
    object qedilinalbaranCENVFAC: TFloatField
      FieldName = 'CENVFAC'
    end
    object qedilinalbaranCUEXP: TFloatField
      FieldName = 'CUEXP'
      ReadOnly = True
    end
    object qedilinalbaranUNICANT: TWideStringField
      FieldName = 'UNICANT'
      ReadOnly = True
      Size = 6
    end
    object qedilinalbaranNUMPED: TWideStringField
      FieldName = 'NUMPED'
      ReadOnly = True
      Size = 40
    end
    object qedilinalbaranNUMALB: TWideStringField
      FieldName = 'NUMALB'
      ReadOnly = True
      Size = 34
    end
    object qedilinalbaranSSCC: TWideStringField
      FieldName = 'SSCC'
      ReadOnly = True
      Size = 100
    end
    object qedilinalbaranFECENV: TDateField
      FieldName = 'FECENV'
      ReadOnly = True
    end
    object qedilinalbaranFECCON: TDateField
      FieldName = 'FECCON'
      ReadOnly = True
    end
    object qedilinalbaranLOTE: TWideStringField
      FieldName = 'LOTE'
      ReadOnly = True
      Size = 60
    end
    object qedilinalbaranCANTLOC1: TFloatField
      FieldName = 'CANTLOC1'
    end
    object qedilinalbaranNOMBREPTOENTREGA: TWideStringField
      FieldName = 'NOMBREPTOENTREGA'
      ReadOnly = True
      Size = 100
    end
    object qedilinalbaranFECPED: TDateField
      FieldName = 'FECPED'
      ReadOnly = True
    end
    object qedilinalbaranFECALB: TDateField
      FieldName = 'FECALB'
      ReadOnly = True
    end
    object qedilinalbaranPESTOTLIN: TFloatField
      FieldName = 'PESTOTLIN'
    end
    object qedilinalbaranFECCADET: TDateField
      FieldName = 'FECCADET'
      ReadOnly = True
    end
    object qedilinalbaranPESOBRUTO: TFloatField
      FieldName = 'PESOBRUTO'
    end
    object qedilinalbaranPESONETO: TFloatField
      FieldName = 'PESONETO'
      ReadOnly = True
    end
    object qedilinalbaranALBARANCLIENTE: TWideStringField
      FieldName = 'ALBARANCLIENTE'
      ReadOnly = True
      Size = 90
    end
    object qedilinalbaranTEXTO4: TWideStringField
      FieldName = 'TEXTO4'
      ReadOnly = True
      Size = 90
    end
    object qedilinalbaranTEXTO5: TWideStringField
      FieldName = 'TEXTO5'
      ReadOnly = True
      Size = 90
    end
    object qedilinalbaranNUMEXP2: TWideStringField
      FieldName = 'NUMEXP2'
      ReadOnly = True
      Size = 28
    end
  end
  object qalbaraneslotes: TZQuery
    Connection = DM.DBagrigest
    AfterInsert = qalbaraneslotesAfterInsert
    SQL.Strings = (
      
        'select * from albaranes_lotes where ide=:EMPRESA and ids=:SERIE ' +
        'and ida=:ALBARAN order by variedad'
      '')
    Params = <
      item
        DataType = ftUnknown
        Name = 'EMPRESA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    Left = 720
    Top = 480
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'EMPRESA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    object qalbaraneslotesid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qalbaranesloteside: TIntegerField
      FieldName = 'ide'
    end
    object qalbaraneslotesids: TWideStringField
      FieldName = 'ids'
      Size = 10
    end
    object qalbaraneslotesida: TIntegerField
      FieldName = 'ida'
    end
    object qalbaranesloteslote: TWideStringField
      FieldName = 'lote'
      Size = 90
    end
    object qalbaraneslotesvariedad: TWideStringField
      FieldName = 'variedad'
      Size = 90
    end
  end
  object qalbaranespalets: TZQuery
    Connection = DM.DBagrigest
    AfterInsert = qalbaranespaletsAfterInsert
    SQL.Strings = (
      
        'select * from albaranes_palets where ide=:EMPRESA and ids=:SERIE' +
        ' and ida=:ALBARAN order by cantidad desc')
    Params = <
      item
        DataType = ftUnknown
        Name = 'EMPRESA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    Left = 624
    Top = 480
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'EMPRESA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    object qalbaranespaletsid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object qalbaranespaletside: TIntegerField
      FieldName = 'ide'
    end
    object qalbaranespaletsids: TWideStringField
      FieldName = 'ids'
      Size = 10
    end
    object qalbaranespaletsida: TIntegerField
      FieldName = 'ida'
    end
    object qalbaranespaletscantidad: TIntegerField
      FieldName = 'cantidad'
    end
    object qalbaranespaletstipo_palet: TWideStringField
      FieldName = 'tipo_palet'
      Size = 90
    end
  end
  object dsalbaranespalets: TDataSource
    DataSet = qalbaranespalets
    Left = 640
    Top = 424
  end
  object dsalbarnaeslotes: TDataSource
    DataSet = qalbaraneslotes
    Left = 720
    Top = 432
  end
  object qinsertarfacturasdetalles: TZQuery
    Connection = DM.DBagrigest
    SQL.Strings = (
      
        'insert into facturas_detalles (idempresa,serie,idfactura,idartic' +
        'ulo,descripcion,cal,lote,bultos,cantidad,precio,descuento,totald' +
        'escuento,base,tipoiva,iva,total,coste_transporte,coste_comision,' +
        'coste_otros,palets,idalbaran,pesobruto,pais,envase,referencia,ea' +
        'n,unidadescaja,mprima,parcela,formato) '
      '('
      
        'SELECT :EMPRESA as idempresa,:SERIE as serie,:FACTURA as idfactu' +
        'ra,idarticulo,descripcion,cal,lote,bultos,cantidad,precio,descue' +
        'nto,totaldescuento,base,tipoiva,iva,total,coste_transporte,coste' +
        '_comision,coste_otros,palets,idalbaran,pesobruto,pais,envase,ref' +
        'erencia,ean,unidadescaja,mprima,parcela,formato FROM albaranes_d' +
        'etalles where (idalbaran,idempresa,serie) in (select id,idempres' +
        'a,serie from albaranes where idfactura=:FACTURA and idempresa=:E' +
        'MPRESA and serie=:SERIE and id=:ALBARAN)'
      ')')
    Params = <
      item
        DataType = ftUnknown
        Name = 'EMPRESA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'FACTURA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
    Left = 832
    Top = 208
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'EMPRESA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'FACTURA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALBARAN'
        ParamType = ptUnknown
      end>
  end
  object albaranesdetallegrupo: TZQuery
    Connection = DM.DBagrigest
    BeforePost = albaranesdetalleBeforePost
    AfterPost = albaranesdetalleAfterPost
    BeforeDelete = albaranesdetalleBeforeDelete
    AfterDelete = albaranesdetalleAfterDelete
    SQL.Strings = (
      
        'select idempresa,idalbaran,sum(cantidad) as cantidad,precio,desc' +
        'uento,sum(base) as base,descripcion,cal,sum(palets) as palets,su' +
        'm(bultos) as bultos,tipoiva,sum(iva) as iva,sum(total) as total,' +
        'id,'#39#39' as idarticulo,sum(totaldescuento) as totaldescuento,'#39#39' as ' +
        'lote,serie,coste_transporte,coste_otros,coste_comision,sum(pesob' +
        'ruto) as pesobruto,idfactura,pais,envase,referencia,ean,unidades' +
        'caja from albaranes_detalles '
      'where idempresa=:empresa and serie=:serie and idalbaran=:albaran'
      'group by idempresa,descripcion,cal,precio order by id;')
    Params = <
      item
        DataType = ftUnknown
        Name = 'empresa'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'serie'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'albaran'
        ParamType = ptUnknown
      end>
    Left = 400
    Top = 434
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'empresa'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'serie'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'albaran'
        ParamType = ptUnknown
      end>
    object albaranesdetallegrupoidempresa: TIntegerField
      FieldName = 'idempresa'
      Required = True
    end
    object albaranesdetallegrupoidalbaran: TIntegerField
      FieldName = 'idalbaran'
      Required = True
    end
    object albaranesdetallegrupocantidad: TFloatField
      FieldName = 'cantidad'
      ReadOnly = True
    end
    object albaranesdetallegrupoprecio: TFloatField
      FieldName = 'precio'
    end
    object albaranesdetallegrupodescuento: TFloatField
      FieldName = 'descuento'
    end
    object albaranesdetallegrupobase: TFloatField
      FieldName = 'base'
      ReadOnly = True
    end
    object albaranesdetallegrupodescripcion: TWideStringField
      FieldName = 'descripcion'
      Size = 100
    end
    object albaranesdetallegrupocal: TWideStringField
      FieldName = 'cal'
      Size = 40
    end
    object albaranesdetallegrupopalets: TFloatField
      FieldName = 'palets'
      ReadOnly = True
    end
    object albaranesdetallegrupobultos: TFloatField
      FieldName = 'bultos'
      ReadOnly = True
    end
    object albaranesdetallegrupotipoiva: TFloatField
      FieldName = 'tipoiva'
    end
    object albaranesdetallegrupoiva: TFloatField
      FieldName = 'iva'
      ReadOnly = True
    end
    object albaranesdetallegrupototal: TFloatField
      FieldName = 'total'
      ReadOnly = True
    end
    object albaranesdetallegrupoid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object albaranesdetallegrupoidarticulo: TWideStringField
      FieldName = 'idarticulo'
      ReadOnly = True
      Size = 0
    end
    object albaranesdetallegrupototaldescuento: TFloatField
      FieldName = 'totaldescuento'
      ReadOnly = True
    end
    object albaranesdetallegrupolote: TWideStringField
      FieldName = 'lote'
      ReadOnly = True
      Size = 0
    end
    object albaranesdetallegruposerie: TWideStringField
      FieldName = 'serie'
      Required = True
      Size = 10
    end
    object albaranesdetallegrupocoste_transporte: TFloatField
      FieldName = 'coste_transporte'
    end
    object albaranesdetallegrupocoste_otros: TFloatField
      FieldName = 'coste_otros'
    end
    object albaranesdetallegrupocoste_comision: TFloatField
      FieldName = 'coste_comision'
    end
    object albaranesdetallegrupopesobruto: TFloatField
      FieldName = 'pesobruto'
      ReadOnly = True
    end
    object albaranesdetallegrupoidfactura: TIntegerField
      FieldName = 'idfactura'
    end
    object albaranesdetallegrupopais: TWideStringField
      FieldName = 'pais'
      Size = 90
    end
    object albaranesdetallegrupoenvase: TWideStringField
      FieldName = 'envase'
      Size = 90
    end
    object albaranesdetallegruporeferencia: TWideStringField
      FieldName = 'referencia'
      Size = 90
    end
    object albaranesdetallegrupoean: TWideStringField
      FieldName = 'ean'
      Size = 90
    end
    object albaranesdetallegrupounidadescaja: TIntegerField
      FieldName = 'unidadescaja'
    end
  end
end
