VERSION 5.00
Object = "{0F987290-56EE-11D0-9C43-00A0C90F29FC}#1.0#0"; "ActBar.ocx"
Object = "{B02F3647-766B-11CE-AF28-C3A2FBE76A13}#2.5#0"; "ss32x25.ocx"
Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#2.1#0"; "Flp32x20.ocx"
Object = "{AB3877A8-B7B2-11CF-9097-444553540000}#1.0#0"; "gtdate32.ocx"
Begin VB.Form FCO2020A 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Alta de Embargo"
   ClientHeight    =   8385
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11520
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Alta o Cambio de Embargos.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8385
   ScaleWidth      =   11520
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame fraFrame 
      Caption         =   "Tipos de Nómina"
      Height          =   5655
      Index           =   7
      Left            =   7320
      TabIndex        =   18
      Top             =   2040
      Visible         =   0   'False
      Width           =   4095
      Begin FPSpread.vaSpread sprDatos 
         Height          =   5055
         Left            =   120
         TabIndex        =   47
         Top             =   480
         Width           =   3855
         _Version        =   131077
         _ExtentX        =   6800
         _ExtentY        =   8916
         _StockProps     =   64
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         MaxCols         =   1
         MaxRows         =   1
         SpreadDesigner  =   "Alta o Cambio de Embargos.frx":030A
      End
      Begin VB.CheckBox chkTodos 
         Caption         =   "Todos"
         Height          =   195
         Left            =   120
         TabIndex        =   46
         Top             =   240
         Width           =   1215
      End
   End
   Begin VB.Frame fraFrame 
      Caption         =   "Datos Judiciales"
      Height          =   5655
      Index           =   2
      Left            =   120
      TabIndex        =   41
      Top             =   2040
      Visible         =   0   'False
      Width           =   3855
      Begin LpLib.fpCombo cboBanco 
         Height          =   330
         Left            =   1680
         TabIndex        =   17
         Top             =   2280
         Width           =   2055
         _Version        =   131072
         _ExtentX        =   3625
         _ExtentY        =   582
         _StockProps     =   68
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Text            =   ""
         Columns         =   0
         Sorted          =   0
         SelDrawFocusRect=   -1  'True
         ColumnSeparatorChar=   9
         ColumnSearch    =   -1
         ColumnWidthScale=   2
         RowHeight       =   -1
         MultiSelect     =   0
         WrapList        =   0   'False
         WrapWidth       =   0
         SelMax          =   -1
         AutoSearch      =   1
         SearchMethod    =   0
         VirtualMode     =   0   'False
         VRowCount       =   0
         DataSync        =   3
         ThreeDInsideStyle=   1
         ThreeDInsideHighlightColor=   -2147483633
         ThreeDInsideShadowColor=   -2147483642
         ThreeDInsideWidth=   1
         ThreeDOutsideStyle=   1
         ThreeDOutsideHighlightColor=   16777215
         ThreeDOutsideShadowColor=   -2147483632
         ThreeDOutsideWidth=   1
         ThreeDFrameWidth=   0
         BorderStyle     =   0
         BorderColor     =   -2147483642
         BorderWidth     =   1
         ThreeDOnFocusInvert=   0   'False
         ThreeDFrameColor=   -2147483633
         Appearance      =   0
         BorderDropShadow=   0
         BorderDropShadowColor=   -2147483632
         BorderDropShadowWidth=   3
         ScrollHScale    =   2
         ScrollHInc      =   0
         ColsFrozen      =   0
         ScrollBarV      =   1
         NoIntegralHeight=   0   'False
         HighestPrecedence=   0
         AllowColResize  =   0
         AllowColDragDrop=   0
         ReadOnly        =   0   'False
         VScrollSpecial  =   0   'False
         VScrollSpecialType=   0
         EnableKeyEvents =   -1  'True
         EnableTopChangeEvent=   -1  'True
         DataAutoHeadings=   -1  'True
         DataAutoSizeCols=   2
         SearchIgnoreCase=   -1  'True
         ColDesigner     =   "Alta o Cambio de Embargos.frx":0463
         ScrollBarH      =   1
         DataFieldList   =   ""
         ColumnEdit      =   -1
         ColumnBound     =   -1
         Style           =   2
         MaxDrop         =   8
         ListWidth       =   -1
         EditHeight      =   -1
         GrayAreaColor   =   -2147483633
         ListLeftOffset  =   -1
         ComboGap        =   7
         MaxEditLen      =   150
         VirtualPageSize =   0
         VirtualPagesAhead=   0
         ExtendCol       =   0
         ColumnLevels    =   1
         ListGrayAreaColor=   -2147483637
         GroupHeaderHeight=   -1
         GroupHeaderShow =   0   'False
         AllowGrpResize  =   0
         AllowGrpDragDrop=   0
         MergeAdjustView =   0   'False
         ColumnHeaderShow=   0   'False
         ColumnHeaderHeight=   -1
         GrpsFrozen      =   0
         BorderGrayAreaColor=   -2147483637
         ExtendRow       =   0
      End
      Begin VB.TextBox txtCiudad 
         Height          =   315
         Left            =   1695
         MaxLength       =   2
         TabIndex        =   26
         Top             =   4155
         Width           =   1455
      End
      Begin VB.TextBox txtOficinaBan 
         Height          =   315
         Index           =   1
         Left            =   1695
         MaxLength       =   4
         TabIndex        =   24
         Top             =   3690
         Width           =   1455
      End
      Begin VB.TextBox txtOficinaBan 
         Height          =   315
         Index           =   0
         Left            =   1695
         MaxLength       =   4
         TabIndex        =   22
         Top             =   3225
         Width           =   1455
      End
      Begin VB.TextBox txtCuenta 
         Height          =   315
         Left            =   1695
         MaxLength       =   12
         TabIndex        =   20
         Top             =   2730
         Width           =   1455
      End
      Begin VB.ComboBox cboClaseDeposito 
         Height          =   330
         ItemData        =   "Alta o Cambio de Embargos.frx":0665
         Left            =   1695
         List            =   "Alta o Cambio de Embargos.frx":067B
         Style           =   2  'Dropdown List
         TabIndex        =   11
         Top             =   810
         Width           =   2055
      End
      Begin VB.TextBox txtJuzgado 
         Height          =   315
         Left            =   1695
         MaxLength       =   12
         TabIndex        =   15
         Top             =   1785
         Width           =   1455
      End
      Begin VB.TextBox txtExpediente 
         Height          =   315
         Left            =   1695
         MaxLength       =   20
         TabIndex        =   13
         Top             =   1305
         Width           =   1455
      End
      Begin VB.TextBox txtOficina 
         Height          =   315
         Left            =   1680
         MaxLength       =   6
         TabIndex        =   9
         Top             =   345
         Width           =   1455
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Ciudad de Pago"
         Height          =   210
         Index           =   20
         Left            =   120
         TabIndex        =   25
         Top             =   4200
         Width           =   1125
      End
      Begin VB.Image imgF4City 
         Height          =   480
         Left            =   3240
         Picture         =   "Alta o Cambio de Embargos.frx":06FA
         Top             =   4170
         Width           =   480
      End
      Begin VB.Image imgOficina 
         Height          =   480
         Index           =   1
         Left            =   3255
         Picture         =   "Alta o Cambio de Embargos.frx":0A04
         Top             =   3705
         Width           =   480
      End
      Begin VB.Image imgOficina 
         Height          =   480
         Index           =   0
         Left            =   3255
         Picture         =   "Alta o Cambio de Embargos.frx":0D0E
         Top             =   3225
         Width           =   480
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Oficina Destino"
         Height          =   210
         Index           =   15
         Left            =   120
         TabIndex        =   23
         Top             =   3720
         Width           =   1095
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Oficina Origen"
         Height          =   210
         Index           =   13
         Left            =   120
         TabIndex        =   21
         Top             =   3240
         Width           =   1035
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Número de Cuenta"
         Height          =   210
         Index           =   19
         Left            =   120
         TabIndex        =   19
         Top             =   2760
         Width           =   1335
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Forma de Pago"
         Height          =   210
         Index           =   18
         Left            =   120
         TabIndex        =   16
         Top             =   2280
         Width           =   1080
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Número Expediente"
         Height          =   210
         Index           =   12
         Left            =   120
         TabIndex        =   12
         Top             =   1320
         Width           =   1395
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Código Juzgado"
         Height          =   210
         Index           =   7
         Left            =   120
         TabIndex        =   14
         Top             =   1800
         Width           =   1155
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Clase de depósito"
         Height          =   210
         Index           =   6
         Left            =   120
         TabIndex        =   10
         Top             =   840
         Width           =   1290
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Consecutivo Oficina"
         Height          =   210
         Index           =   4
         Left            =   120
         TabIndex        =   8
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.Frame fraFrame 
      Caption         =   "Valores del Embargo"
      Height          =   5655
      Index           =   3
      Left            =   4080
      TabIndex        =   61
      Top             =   2040
      Visible         =   0   'False
      Width           =   3135
      Begin VB.Frame fraFrame 
         Caption         =   "Base de descuento"
         Height          =   1155
         Index           =   5
         Left            =   120
         TabIndex        =   65
         Top             =   1680
         Width           =   2895
         Begin VB.OptionButton optCncBase 
            Caption         =   "Concepto"
            Height          =   255
            Left            =   240
            TabIndex        =   36
            Top             =   645
            Width           =   1215
         End
         Begin VB.OptionButton optAgrBase 
            Caption         =   "Agrupación"
            Height          =   255
            Left            =   240
            TabIndex        =   34
            Top             =   285
            Width           =   1215
         End
         Begin VB.TextBox txtAgrBase 
            Height          =   315
            Left            =   1560
            MaxLength       =   3
            TabIndex        =   35
            Top             =   285
            Width           =   495
         End
         Begin VB.TextBox txtCncBase 
            Height          =   315
            Left            =   1560
            MaxLength       =   5
            TabIndex        =   37
            Top             =   645
            Width           =   735
         End
         Begin VB.Image imgListaAg 
            Height          =   480
            Left            =   2400
            Picture         =   "Alta o Cambio de Embargos.frx":1018
            Top             =   285
            Width           =   480
         End
         Begin VB.Image imgListaCb 
            Height          =   480
            Left            =   2400
            Picture         =   "Alta o Cambio de Embargos.frx":1322
            Top             =   645
            Width           =   480
         End
      End
      Begin VB.TextBox txtCuotaFija 
         Height          =   315
         Left            =   1560
         MaxLength       =   14
         TabIndex        =   33
         Top             =   1320
         Width           =   1455
      End
      Begin VB.TextBox txtPorcentaje 
         Height          =   315
         Left            =   1560
         MaxLength       =   5
         TabIndex        =   31
         Top             =   960
         Width           =   735
      End
      Begin VB.TextBox txtMonto 
         Height          =   315
         Left            =   1560
         MaxLength       =   14
         TabIndex        =   29
         Top             =   600
         Width           =   1455
      End
      Begin VB.CheckBox chkQuintaParte 
         Alignment       =   1  'Right Justify
         Caption         =   "Quinta Parte "
         Height          =   210
         Left            =   195
         TabIndex        =   27
         Top             =   240
         Width           =   1575
      End
      Begin VB.CheckBox chkIncremento 
         Caption         =   "Incremento Automático Cuota Fija"
         Height          =   255
         Left            =   120
         TabIndex        =   38
         Top             =   2880
         Width           =   2895
      End
      Begin VB.Frame fraFrame 
         Caption         =   "Incremento Automatico"
         Enabled         =   0   'False
         Height          =   2295
         Index           =   6
         Left            =   120
         TabIndex        =   62
         Top             =   3240
         Width           =   2895
         Begin LpLib.fpCombo cboPorcentaje 
            Height          =   330
            Left            =   240
            TabIndex        =   39
            Top             =   600
            Width           =   2415
            _Version        =   131072
            _ExtentX        =   4260
            _ExtentY        =   582
            _StockProps     =   68
            Enabled         =   0   'False
            BackColor       =   -2147483643
            ForeColor       =   -2147483640
            Text            =   ""
            Columns         =   0
            Sorted          =   0
            SelDrawFocusRect=   -1  'True
            ColumnSeparatorChar=   9
            ColumnSearch    =   -1
            ColumnWidthScale=   2
            RowHeight       =   -1
            MultiSelect     =   0
            WrapList        =   0   'False
            WrapWidth       =   0
            SelMax          =   -1
            AutoSearch      =   1
            SearchMethod    =   0
            VirtualMode     =   0   'False
            VRowCount       =   0
            DataSync        =   3
            ThreeDInsideStyle=   1
            ThreeDInsideHighlightColor=   -2147483633
            ThreeDInsideShadowColor=   -2147483642
            ThreeDInsideWidth=   1
            ThreeDOutsideStyle=   1
            ThreeDOutsideHighlightColor=   16777215
            ThreeDOutsideShadowColor=   -2147483632
            ThreeDOutsideWidth=   1
            ThreeDFrameWidth=   0
            BorderStyle     =   0
            BorderColor     =   -2147483642
            BorderWidth     =   1
            ThreeDOnFocusInvert=   0   'False
            ThreeDFrameColor=   -2147483633
            Appearance      =   0
            BorderDropShadow=   0
            BorderDropShadowColor=   -2147483632
            BorderDropShadowWidth=   3
            ScrollHScale    =   2
            ScrollHInc      =   0
            ColsFrozen      =   0
            ScrollBarV      =   1
            NoIntegralHeight=   0   'False
            HighestPrecedence=   0
            AllowColResize  =   0
            AllowColDragDrop=   0
            ReadOnly        =   0   'False
            VScrollSpecial  =   0   'False
            VScrollSpecialType=   0
            EnableKeyEvents =   -1  'True
            EnableTopChangeEvent=   -1  'True
            DataAutoHeadings=   -1  'True
            DataAutoSizeCols=   2
            SearchIgnoreCase=   -1  'True
            ColDesigner     =   "Alta o Cambio de Embargos.frx":162C
            ScrollBarH      =   1
            DataFieldList   =   ""
            ColumnEdit      =   -1
            ColumnBound     =   -1
            Style           =   2
            MaxDrop         =   8
            ListWidth       =   -1
            EditHeight      =   -1
            GrayAreaColor   =   -2147483633
            ListLeftOffset  =   -1
            ComboGap        =   7
            MaxEditLen      =   150
            VirtualPageSize =   0
            VirtualPagesAhead=   0
            ExtendCol       =   0
            ColumnLevels    =   1
            ListGrayAreaColor=   -2147483637
            GroupHeaderHeight=   -1
            GroupHeaderShow =   0   'False
            AllowGrpResize  =   0
            AllowGrpDragDrop=   0
            MergeAdjustView =   0   'False
            ColumnHeaderShow=   0   'False
            ColumnHeaderHeight=   -1
            GrpsFrozen      =   0
            BorderGrayAreaColor=   -2147483637
            ExtendRow       =   0
         End
         Begin VB.ComboBox cboMes 
            Height          =   330
            ItemData        =   "Alta o Cambio de Embargos.frx":182E
            Left            =   120
            List            =   "Alta o Cambio de Embargos.frx":1856
            Style           =   2  'Dropdown List
            TabIndex        =   44
            Top             =   1920
            Width           =   1455
         End
         Begin VB.TextBox txtValor 
            Height          =   315
            Left            =   240
            TabIndex        =   43
            Top             =   1320
            Width           =   2415
         End
         Begin VB.OptionButton optValor 
            Caption         =   "Valor"
            Height          =   375
            Left            =   240
            TabIndex        =   42
            Top             =   960
            Width           =   2415
         End
         Begin VB.OptionButton optPorcentaje 
            Caption         =   "Porcentaje"
            Height          =   375
            Left            =   240
            TabIndex        =   40
            Top             =   240
            Width           =   2415
         End
         Begin VB.TextBox txtAnio 
            Height          =   315
            Left            =   1680
            TabIndex        =   45
            Top             =   1920
            Width           =   1095
         End
         Begin VB.Label lblLabels 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Mes Aumento:"
            Height          =   210
            Index           =   21
            Left            =   120
            TabIndex        =   64
            Top             =   1680
            Width           =   1035
         End
         Begin VB.Label lblLabels 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Desde el Año:"
            Height          =   210
            Index           =   22
            Left            =   1680
            TabIndex        =   63
            Top             =   1680
            Width           =   1020
         End
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "%"
         Height          =   210
         Index           =   5
         Left            =   2400
         TabIndex        =   66
         Top             =   960
         Width           =   150
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Cuota Fija"
         Height          =   210
         Index           =   10
         Left            =   240
         TabIndex        =   32
         Top             =   1320
         Width           =   705
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Monto Total"
         Height          =   210
         Index           =   8
         Left            =   240
         TabIndex        =   28
         Top             =   600
         Width           =   825
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Porcentaje"
         Height          =   210
         Index           =   14
         Left            =   240
         TabIndex        =   30
         Top             =   960
         Width           =   765
      End
   End
   Begin VB.Frame fraFrame 
      Caption         =   "Información del Demandante"
      Height          =   660
      Index           =   4
      Left            =   120
      TabIndex        =   55
      Top             =   1320
      Visible         =   0   'False
      Width           =   11295
      Begin VB.TextBox txtNombres 
         Height          =   315
         Left            =   8760
         MaxLength       =   50
         TabIndex        =   7
         Top             =   240
         Width           =   2415
      End
      Begin VB.TextBox txtApellidos 
         Height          =   315
         Left            =   5520
         MaxLength       =   20
         TabIndex        =   6
         Top             =   240
         Width           =   2415
      End
      Begin VB.TextBox txtIdDemandante 
         Height          =   315
         Left            =   3600
         MaxLength       =   11
         TabIndex        =   5
         Top             =   240
         Width           =   1095
      End
      Begin VB.ComboBox cboTipoID 
         Height          =   330
         ItemData        =   "Alta o Cambio de Embargos.frx":18BF
         Left            =   840
         List            =   "Alta o Cambio de Embargos.frx":18D8
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   240
         Width           =   2055
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Tipo Id."
         Height          =   210
         Index           =   9
         Left            =   240
         TabIndex        =   59
         Top             =   240
         Width           =   510
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Nombres"
         Height          =   210
         Index           =   17
         Left            =   8040
         TabIndex        =   58
         Top             =   240
         Width           =   645
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Apellidos"
         Height          =   210
         Index           =   16
         Left            =   4800
         TabIndex        =   57
         Top             =   240
         Width           =   660
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Número"
         Height          =   210
         Index           =   11
         Left            =   3000
         TabIndex        =   56
         Top             =   240
         Width           =   555
      End
   End
   Begin VB.Frame fraFrame 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Index           =   1
      Left            =   120
      TabIndex        =   51
      Top             =   600
      Visible         =   0   'False
      Width           =   11295
      Begin VB.TextBox txtSecuencia 
         Enabled         =   0   'False
         Height          =   315
         Left            =   3720
         MaxLength       =   5
         TabIndex        =   2
         Top             =   240
         Width           =   495
      End
      Begin VB.TextBox txtTrabajador 
         Height          =   315
         Left            =   1080
         MaxLength       =   10
         TabIndex        =   1
         Top             =   240
         Width           =   975
      End
      Begin GTMaskDate.GTMaskDate GTdEmbargo 
         Height          =   300
         HelpContextID   =   722
         Left            =   6105
         TabIndex        =   3
         Top             =   240
         Width           =   1320
         _Version        =   65537
         _ExtentX        =   2328
         _ExtentY        =   529
         _StockProps     =   77
         BackColor       =   -2147483643
         BeginProperty NullFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty CalFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty CalCaptionFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty CalDayCaptionFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty ToolTipFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Label lblTrabajador 
         BackStyle       =   0  'Transparent
         ForeColor       =   &H00800000&
         Height          =   255
         Left            =   7560
         TabIndex        =   60
         Top             =   240
         Width           =   3615
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Fecha del embargo"
         Height          =   210
         Index           =   3
         Left            =   4560
         TabIndex        =   54
         Top             =   240
         Width           =   1380
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Secuencia"
         Height          =   210
         Index           =   2
         Left            =   2760
         TabIndex        =   53
         Top             =   240
         Width           =   765
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Trabajador"
         Height          =   210
         Index           =   1
         Left            =   120
         TabIndex        =   52
         Top             =   240
         Width           =   780
      End
      Begin VB.Image imgListaTr 
         Height          =   480
         Left            =   2160
         Picture         =   "Alta o Cambio de Embargos.frx":1939
         Top             =   240
         Width           =   480
      End
   End
   Begin VB.Frame fraFrame 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Index           =   0
      Left            =   120
      TabIndex        =   48
      Top             =   0
      Width           =   11295
      Begin VB.TextBox txtConcepto 
         Height          =   315
         Left            =   2040
         MaxLength       =   5
         TabIndex        =   0
         Top             =   240
         Width           =   975
      End
      Begin VB.Label lblDescripcion 
         BackStyle       =   0  'Transparent
         Height          =   210
         Left            =   3720
         TabIndex        =   50
         Top             =   240
         Width           =   7365
      End
      Begin VB.Image imgListaCn 
         Height          =   480
         Left            =   3240
         Picture         =   "Alta o Cambio de Embargos.frx":1C43
         Top             =   240
         Width           =   480
      End
      Begin VB.Label lblLabels 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Concepto de Descuento"
         Height          =   210
         Index           =   0
         Left            =   120
         TabIndex        =   49
         Top             =   240
         Width           =   1740
      End
   End
   Begin ActiveBarLibraryCtl.ActiveBar abToolbar 
      Left            =   360
      Top             =   7800
      _ExtentX        =   847
      _ExtentY        =   847
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Bands           =   "Alta o Cambio de Embargos.frx":1F4D
   End
End
Attribute VB_Name = "FCO2020A"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private WithEvents clsSpread As NSpread
Attribute clsSpread.VB_VarHelpID = -1
Private MAdo As ODBC.ODBCDirecto
Private MiCx As Integer 'Conexión
Private MiX As Integer 'Ancho de la forma
Private MiY As Integer 'Alta de la forma
Private MbFirst As Boolean
Private MbCnValido As Boolean
Private MbCbValido As Boolean
Private MbTrValido As Boolean
Private MbAgValido As Boolean
Private MbHuboCambios As Boolean
Private MbOfOrigen As Boolean
Private MbOfDestino As Boolean
Private MsAgrEmb As String
Private MbCiudadPago As Boolean
Private MsSum As String

Private Sub abToolbar_Click(ByVal Tool As ActiveBarLibraryCtl.Tool)
    Select Case LCase(Tool.Name)
        Case "tlguarda": GuardarDatos
        Case "tlinicial": Inicializa
        Case "tlsalida": Unload Me
    End Select
End Sub

Private Sub cboBanco_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then SendEnter
End Sub

Private Sub cboClaseDeposito_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then SendEnter
End Sub

Private Sub cboTipoID_Click()
    If cboTipoID.ListIndex = 5 Or cboTipoID.ListIndex = 6 Then
        lblLabels(16) = "Razón Social"
        lblLabels(17).Visible = False
        txtNombres.Visible = False
        txtApellidos.MaxLength = 100
        txtApellidos.Left = 5900
        txtApellidos.Width = 4590
    Else
        lblLabels(16) = "Apellidos"
        txtNombres.MaxLength = 20
        txtNombres.Left = 8760
        txtNombres.Width = 2415
        txtNombres.Visible = True
        txtApellidos.MaxLength = 20
        txtApellidos.Left = 5520
        txtApellidos.Width = 2415
        txtApellidos.Visible = True
        lblLabels(17).Visible = True
    End If
End Sub

Private Sub cboTipoID_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then SendEnter
End Sub

Private Sub chkIncremento_Click()
    fraFrame(6).Enabled = chkIncremento.Value
End Sub

Private Sub chkQuintaParte_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then SendEnter
End Sub

Private Sub chkTodos_Click()
    Dim i As Integer
    If chkTodos.Value = 1 Then
        For i = 1 To sprDatos.MaxRows
            sprDatos.Row = i
            sprDatos.Col = 1
            sprDatos.Text = 1
        Next i
    Else
        For i = 1 To sprDatos.MaxRows
            sprDatos.Row = i
            sprDatos.Col = 1
            sprDatos.Text = 0
        Next i
    End If
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyF3: Unload Me
        Case vbKeyF11: GuardarDatos
    End Select
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyF4
            If LCase(ActiveControl.Name) = "txtconcepto" Then imgListaCn_Click
            If LCase(ActiveControl.Name) = "txttrabajador" Then imgListaTr_Click
            If LCase(ActiveControl.Name) = "txtcncbase" Then imgListaCb_Click
            If LCase(ActiveControl.Name) = "txtagrbase" Then imgListaAg_Click
            If LCase(ActiveControl.Name) = "txtoficinaban" Then imgOficina_Click ActiveControl.Index
            If LCase(ActiveControl.Name) = "txtciudad" Then imgF4City_Click
    End Select
End Sub

Private Sub Form_Load()
    MbFirst = True
    GbAError = False
    Me.Tag = GiVenMax%
    Gven(Val(Me.Tag)).icx = Gicx%
    MiCx = Gven(Val(Me.Tag)).icx
    Set MAdo = Gtc(MiCx).Ado
    If GbSinRegistrar Then RegistraVersion MAdo
    Caption = GsDsn & " / " & GsAbreviaturaCia & " - Alta Embargos"

    If Not MDIChild Then
        WindowState = 0
        Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
        Screen.MousePointer = vbDefault
    End If
       
    'Tamaño de la forma
    If Me.WindowState = 0 Then
        MiX = 11610
        MiY = 8865
        Me.Width = MiX
        Me.Height = MiY
    End If
                
    AsignaIconos abToolbar, 3, LINICIAL, LGUARDA, LSALIDA
    ToolInicioGrupo abToolbar, 3, True, 1
    
    GAdam.ConfiguraFecha GTdEmbargo, True
        
    RecuperaListaBancos
    RecuperaTiposAumento
    RecuperarParametros
    
    If MAdo.DBMS = "SQLSERVER" Then
        MsSum = "+"
    Else
        MsSum = "||"
    End If
    
    If GsLlave = "A" Then
        MbCnValido = False
        MbTrValido = False
        MbCbValido = False
        MbAgValido = False
        MbOfOrigen = False
        MbOfDestino = False
        MbCiudadPago = False
        GTdEmbargo.Text = Date
        cboTipoID.ListIndex = 1
    Else
        RecuperarDatos
    End If
    MbHuboCambios = False
    Screen.MousePointer = vbDefault
    
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If MbHuboCambios Then
        If clsMsgbox.Mensaje("¿Desea guardar los cambios?", mSiNoCancelar, mConfirma, GsTitMsg) = vbYes Then
            GuardarDatos
        End If
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set MAdo = Nothing
    Gtc(MiCx).ihijas = Gtc(MiCx).ihijas - 1
    Set FCO2020A = Nothing

End Sub

Private Sub GTdEmbargo_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        cboTipoID.SetFocus
    End If
End Sub

Private Sub imgF4City_Click()
    Screen.MousePointer = vbHourglass
    FCO2020C.Caption = GsDsn & " / " & GsCveCia & " - Ciudades de Pago"
    FCO2020C.Show 1
    If Trim(GsParamOUT(0)) <> "" Then
        txtCiudad = GsParamOUT(0)
        MbHuboCambios = True
    End If
End Sub

Private Sub imgListaAg_Click()
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT agr_conceptos, descripcion" & _
    " FROM agr_conceptos_ns WHERE 1=1"
    GsParamIN(1) = "agr_conceptos"
    GsParamIN(2) = "descripcion"
    GsParamIN(3) = "Agrupación"
    GsParamIN(4) = "Descripción"
    GsParamIN(5) = "Agrupaciones de Conceptos"
    GsParamIN(6) = ""
    frmLista.Show 1
    txtAgrBase = GsParamOUT(0)
    If Trim(txtAgrBase) <> "" Then
        MbHuboCambios = True
        MbAgValido = True
    End If
End Sub

Private Sub imgListaCb_Click()
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT concepto, descripcion" & _
    " FROM conceptos" & _
    " WHERE tipo_transaccion = 1"
    GsParamIN(1) = "concepto"
    GsParamIN(2) = "descripcion"
    GsParamIN(3) = "Concepto"
    GsParamIN(4) = "Descripcion"
    GsParamIN(5) = "Conceptos de Devengos"
    GsParamIN(6) = ""
    frmLista.Show 1
    txtCncBase = GsParamOUT(0)
    If Trim(txtCncBase) <> "" Then
        MbHuboCambios = True
        MbCbValido = True
    End If
End Sub

Private Sub imgListaCn_Click()
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT concepto, descripcion" & _
    " FROM conceptos" & _
    " WHERE concepto in (SELECT concepto FROM rel_conceptos_agr" & _
    " WHERE compania = '" & GsCveCia & "' And agr_conceptos = '" & MsAgrEmb & "')"
    GsParamIN(1) = "concepto"
    GsParamIN(2) = "descripcion"
    GsParamIN(3) = "Concepto"
    GsParamIN(4) = "Descripcion"
    GsParamIN(5) = "Conceptos de Descuento"
    GsParamIN(6) = ""
    frmLista.Show 1
    txtConcepto = GsParamOUT(0)
    lblDescripcion = GsParamOUT(1)
    If Trim(txtConcepto) <> "" Then
        MbHuboCambios = True
        MbCnValido = True
        MostrarControles
        txtConcepto.Enabled = False
    End If
End Sub

Private Function IndiceCombo(Combo As ComboBox, Dato As Integer) As Integer
    Dim i As Integer
    Dim j As Integer
    
    i = 0
    j = -1
    Do Until j > -1 Or i = Combo.ListCount
        If Combo.ItemData(i) = Dato Then j = i
        i = i + 1
    Loop
    IndiceCombo = j
End Function

Private Function IndiceComboFP(Combo As fpCombo, Dato As Integer) As Integer
    Dim i As Integer
    Dim j As Integer
    
    i = 0
    j = -1
    Do Until j > -1 Or i = Combo.ListCount
        Combo.Row = i
        If Combo.ItemData = Dato Then j = i
        i = i + 1
    Loop
    IndiceComboFP = j
End Function

Private Sub Inicializa()
    If clsMsgbox.Mensaje("¿Inicializar y perder los cambios?", mSiNoCancelar, mConfirma, GsTitMsg) <> vbYes Then Exit Sub
    lblDescripcion = ""
    fraFrame(1).Visible = False
    fraFrame(2).Visible = False
    fraFrame(3).Visible = False
    fraFrame(4).Visible = False
    fraFrame(7).Visible = False
    txtConcepto.Enabled = True
    txtConcepto.SetFocus
    txtTrabajador = ""
    lblTrabajador = ""
    txtSecuencia = ""
    txtIdDemandante = ""
    txtApellidos = ""
    txtNombres = ""
    txtOficina = ""
    txtExpediente = ""
    txtJuzgado = ""
    txtCuenta = ""
    txtMonto = ""
    txtPorcentaje = ""
    txtCuotaFija = ""
    txtAgrBase = ""
    txtCncBase = ""
    MbHuboCambios = False
End Sub

Private Sub MostrarControles()
    If Val(txtConcepto) < 32500 Then
        MAdo.Sql = "SELECT descripcion FROM conceptos" & _
        " WHERE concepto = " & Trim(txtConcepto) & _
        " AND concepto IN " & _
        " (SELECT concepto FROM rel_conceptos_agr" & _
        " WHERE compania = '" & GsCveCia & "'" & _
        " AND agr_conceptos = '" & MsAgrEmb & "')"
        MAdo.SendSQL
        If MAdo.EOF Then
            clsMsgbox.Mensaje "No existe el concepto de descuento o no pertenece al grupo de conceptos de embargos", mAceptar, minforma, GsTitMsg
        Else
            lblDescripcion = Trim(MAdo.GetField(1))
            fraFrame(1).Visible = True
            fraFrame(2).Visible = True
            fraFrame(3).Visible = True
            fraFrame(4).Visible = True
            fraFrame(7).Visible = True
            txtConcepto.Enabled = False
            txtTrabajador.SetFocus
        End If
    Else
        clsMsgbox.Mensaje "No existe el concepto de Embargo", mAceptar, minforma, GsTitMsg
        Exit Sub
    End If
    
    MAdo.Sql = _
    " SELECT 0,  a.tipo_nomina " & MsSum & " ' - ' " & MsSum & " b.descripcion " & _
    " FROM rel_conc_tipo_nomina a, tipos_nomina b " & _
    " WHERE a.tipo_nomina = b.tipo_nomina " & _
    " AND a.compania = '" & GsCveCia & "'" & _
    " AND a.concepto = " & txtConcepto.Text
    RenuevaDatos
End Sub

Private Sub imgListaTr_Click()
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT T.trabajador, REPLACE(T.nombre, '/',' ')" & _
    " FROM trabajadores T, trabajadores_grales TG, rel_usu_clase_nom u " & _
    " WHERE T.trabajador = TG.trabajador" & _
    " AND tg.clase_nomina = u.clase_nomina " & _
    " AND u.usuario = '" & GsUid & "' " & _
    " AND TG.compania = '" & GsCveCia & "'" & _
    " AND TG.sit_trabajador = 1"
    GsParamIN(1) = "T.trabajador"
    GsParamIN(2) = "T.nombre"
    GsParamIN(3) = "Trabajador"
    GsParamIN(4) = "Nombre"
    GsParamIN(5) = "Trabajadores"
    GsParamIN(6) = ""
    frmLista.Show 1
    If Trim(GsParamOUT(0)) <> "" Then
        txtTrabajador = GsParamOUT(0)
        lblTrabajador = GsParamOUT(1)
        MbHuboCambios = True
        MbTrValido = True
        HallarSecuencia
        GTdEmbargo.SetFocus
    End If
End Sub

Private Sub imgOficina_Click(Index As Integer)
    Screen.MousePointer = vbHourglass
    GsParamIN(0) = "SELECT cod_oficina, descripcion_oficina" & _
    " FROM fdt_embargos_oficinas WHERE compania = '" & GsCveCia & "'"
    GsParamIN(1) = "cod_oficina"
    GsParamIN(2) = "descripcion_oficina"
    GsParamIN(3) = "Concepto"
    GsParamIN(4) = "Descripcion"
    GsParamIN(5) = "Codigo Bancario (SBAN)"
    GsParamIN(6) = ""
    frmLista.Show 1
    If Trim(GsParamOUT(0)) <> "" Then
        txtOficinaBan(Index) = GsParamOUT(0)
        If Index = 0 Then MbOfOrigen = True
        If Index = 1 Then MbOfDestino = True
        MbHuboCambios = True
    End If
End Sub

Private Sub optAgrBase_Click()
    On Error Resume Next
    txtAgrBase.Enabled = Not (optAgrBase.Value = vbChecked)
    imgListaAg.Enabled = txtAgrBase.Enabled
    txtCncBase.Enabled = Not txtAgrBase.Enabled
    imgListaCb.Enabled = txtCncBase.Enabled
    If txtAgrBase.Enabled Then txtAgrBase.SetFocus: txtCncBase = ""
End Sub

Private Sub optCncBase_Click()
    txtCncBase.Enabled = Not (optCncBase.Value = vbChecked)
    imgListaCb.Enabled = txtCncBase.Enabled
    txtAgrBase.Enabled = Not txtCncBase.Enabled
    imgListaAg.Enabled = txtAgrBase.Enabled
    On Error Resume Next
    If txtCncBase.Enabled Then txtCncBase.SetFocus: txtAgrBase = ""
End Sub

Private Sub optPorcentaje_Click()
    If optPorcentaje.Value = True Then
        cboPorcentaje.Enabled = True
        txtValor.Enabled = False
    Else
        cboPorcentaje.Enabled = False
        txtValor.Enabled = True
    End If
End Sub

Private Sub optValor_Click()
    If optValor.Value = True Then
        cboPorcentaje.Enabled = False
        txtValor.Enabled = True
    Else
        cboPorcentaje.Enabled = True
        txtValor.Enabled = False
    End If
End Sub

Private Sub sprDatos_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyF3 Then Unload Me
End Sub

Private Sub txtAgrBase_Change()
    MbAgValido = False
End Sub

Private Sub txtAgrBase_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub txtApellidos_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub txtCiudad_Change()
  MbCiudadPago = False
End Sub

Private Sub txtCiudad_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
      If Not MbCiudadPago Then ValidarCiudadPago
      If MbCiudadPago Then SendEnter
    End If

End Sub

Private Sub txtCncBase_Change()
     MbCbValido = False
End Sub

Private Sub txtCncBase_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtCuenta_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtCuotaFija_Change()
    MbHuboCambios = True
End Sub

Private Sub txtCuotaFija_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789.", True, True)
    End If
End Sub

Private Sub txtExpediente_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    End If
End Sub

Private Sub txtIdDemandante_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtConcepto_Change()
    MbCnValido = False
End Sub

Private Sub txtConcepto_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        MostrarControles
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtJuzgado_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtMonto_Change()
    MbHuboCambios = True
    txtMonto.Tag = txtMonto
End Sub

Private Sub txtMonto_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789.", True, True)
    End If
End Sub

Private Sub txtNombres_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub txtOficina_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtOficinaBan_Change(Index As Integer)
    If Index = 0 Then MbOfOrigen = False
    If Index = 1 Then MbOfDestino = False
End Sub

Private Sub txtOficinaBan_KeyPress(Index As Integer, KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
      If Index = 0 And Not MbOfOrigen Then ValidarOficina (Index)
      If Index = 1 And Not MbOfDestino Then ValidarOficina (Index)

      If Index = 0 And MbOfOrigen Then SendEnter
      If Index = 1 And MbOfDestino Then SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtPorcentaje_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789.", True, True)
    End If
End Sub

Private Sub txtTrabajador_Change()
    MbTrValido = False
End Sub

Private Sub txtTrabajador_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        If Not MbTrValido Then ValidarTrabajador
        If MbTrValido Then SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789", True, True)
    End If
End Sub

Private Sub txtTrabajador_LostFocus()
    If Trim(txtTrabajador) <> "" And Not MbTrValido Then ValidarTrabajador
End Sub

Private Sub GuardarDatos()
    Dim i As Integer
    Dim j As Integer
    
    On Error GoTo MsgError
    If fbValidarDatos Then
        MbHuboCambios = False
        Screen.MousePointer = vbHourglass
        
        cboBanco.Row = cboBanco.ListIndex
        cboPorcentaje.Row = cboPorcentaje.ListIndex
        
        MAdo.Sql = "sp_fdt_crea_embargo " & _
        "'" & GsCveCia & "','" & txtTrabajador & "'," & _
        txtConcepto & "," & txtSecuencia & "," & _
        "'" & Format(GTdEmbargo.Text, "yyyymmdd") & "'," & _
        txtOficina & "," & CStr(cboClaseDeposito.ListIndex + 1) & "," & _
        "'" & txtExpediente & "'," & txtJuzgado & "," & _
        cboBanco.ItemData & "," & Val(txtCuenta) & "," & _
        CStr(cboTipoID.ListIndex) & "," & txtIdDemandante & "," & _
        "'" & txtApellidos & "','" & txtNombres & "'," & _
        "'" & txtAgrBase & "'," & Val(txtCncBase) & "," & _
        IIf(chkQuintaParte.Value = vbChecked, 1, 0) & "," & _
        Val(txtMonto) & "," & Val(txtPorcentaje) & "," & _
        Val(txtCuotaFija) & "," & Val(txtMonto.Tag) & "," & _
        "'" & txtOficinaBan(0) & "','" & txtOficinaBan(1) & "'," & _
        "'" & txtCiudad & "', " & _
        IIf(cboPorcentaje.ListIndex <> -1, Mid(cboPorcentaje.ItemData(cboPorcentaje.ListIndex), 1, 2), "NULL ") & ", " & _
        IIf(Trim(txtValor) <> "", txtValor, "NULL ") & ", " & _
        IIf(cboMes.Text <> "", cboMes.ListIndex + 1, "NULL ") & ", " & _
        IIf(Trim(txtAnio) <> "", txtAnio, "NULL ")

        If MAdo.ExecSQL = -1 Then GoTo MsgError
        
        For i = 1 To sprDatos.MaxRows
            sprDatos.Row = i
            sprDatos.Col = 1
            j = Val(sprDatos.Text)
            sprDatos.Col = 2
            
            MAdo.Sql = "sp_fdt_alta_emb_tipo_nom " & _
            "'" & GsCveCia & "','" & txtTrabajador & "'," & _
            txtConcepto & "," & txtSecuencia & ",'" & _
            Mid(sprDatos.Text, 1, 2) & "'," & j
            
            If MAdo.ExecSQL = -1 Then GoTo MsgError
        Next i

        GsConcepto = txtConcepto
        GsTrabajador = txtTrabajador
        
        Screen.MousePointer = vbDefault
        Unload Me
    End If
    Exit Sub
    
MsgError:
    Screen.MousePointer = vbDefault
    If Err > 0 Then
        clsMsgbox.Mensaje Err.Description, mAceptar, mAdvierte, GsTitMsg
    Else
        clsMsgbox.Mensaje "Error al ejecutar el procedimiento [sp_fdt_crea_embargo]", mAceptar, mAdvierte, GsTitMsg
    End If
            
End Sub

Private Sub HallarSecuencia()
    MAdo.Sql = "SELECT max(secuencia) FROM fdt_embargos" & _
    " WHERE compania = '" & GsCveCia & "'" & _
    "   AND trabajador = '" & txtTrabajador & "'" & _
    "   AND concepto = " & txtConcepto
    MAdo.SendSQL
    txtSecuencia = CStr(Val("" & MAdo.GetField(1)) + 1)

End Sub

Private Function fbValidarDatos() As Boolean
    fbValidarDatos = True
    If Trim(txtTrabajador) = "" Then
        clsMsgbox.Mensaje "Digite o seleccione el trabajador", mAceptar, mAdvierte, GsTitMsg
        txtTrabajador.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    If Not MbTrValido Then ValidarTrabajador
    If Not MbTrValido Then
        clsMsgbox.Mensaje "Trabajador no existe", mAceptar, mAdvierte, GsTitMsg
        txtTrabajador.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    If Not MbCbValido And Trim(txtCncBase) <> "" Then ValidarConcepto
    If Not MbCbValido And Trim(txtCncBase) <> "" Then
        clsMsgbox.Mensaje "No existe el concepto digitado", mAceptar, mAdvierte, GsTitMsg
        txtCncBase.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    If Not MbAgValido And Trim(txtAgrBase) <> "" Then ValidarAgrupacion
    If Not MbAgValido And Trim(txtAgrBase) <> "" Then
        clsMsgbox.Mensaje "No existe la agrupación de conceptos digitada", mAceptar, mAdvierte, GsTitMsg
        txtAgrBase.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
       
    If cboTipoID.ListIndex = -1 Then
        clsMsgbox.Mensaje "Seleccione el tipo de identificacion del demandante", mAceptar, mAdvierte, GsTitMsg
        cboTipoID.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If Trim(txtIdDemandante) = "" Then
        clsMsgbox.Mensaje "Digite el número de identificacion del demandante", mAceptar, mAdvierte, GsTitMsg
        txtIdDemandante.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If Trim(txtApellidos) = "" Then
        clsMsgbox.Mensaje "Digite el apellido del demandante", mAceptar, mAdvierte, GsTitMsg
        txtApellidos.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If Trim(txtNombres) = "" And cboTipoID.ListIndex < 4 Then
        clsMsgbox.Mensaje "Digite el nombre del demandante", mAceptar, mAdvierte, GsTitMsg
        txtNombres.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If Trim(txtOficina) = "" Then
        clsMsgbox.Mensaje "Digite el consecutivo de la oficina", mAceptar, mAdvierte, GsTitMsg
        txtOficina.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If cboClaseDeposito.ListIndex = -1 Then
        clsMsgbox.Mensaje "Seleccione la clase de depósito", mAceptar, mAdvierte, GsTitMsg
        cboClaseDeposito.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If Trim(txtExpediente) = "" Then
        clsMsgbox.Mensaje "Digite el número del expediente", mAceptar, mAdvierte, GsTitMsg
        txtExpediente.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If Trim(txtJuzgado) = "" Then
        clsMsgbox.Mensaje "Digite el código del juzgado", mAceptar, mAdvierte, GsTitMsg
        txtJuzgado.SetFocus
        fbValidarDatos = False
        Exit Function
    End If

    If cboBanco.ListIndex = -1 Then
        clsMsgbox.Mensaje "Seleccione el banco a consignar", mAceptar, mAdvierte, GsTitMsg
        cboBanco.SetFocus
        fbValidarDatos = False
        Exit Function
    End If

    If Val(txtMonto) + Val(txtPorcentaje) + Val(txtCuotaFija) + Val(chkQuintaParte.Value) = 0 Then
        clsMsgbox.Mensaje "Digite el valor el embargo o el valor a descontar", mAceptar, mAdvierte, GsTitMsg
        txtMonto.SetFocus
        fbValidarDatos = False
        Exit Function
    End If
        
    If Not MbOfOrigen Then ValidarOficina (0)
    If Not MbOfOrigen Then
        clsMsgbox.Mensaje "Codigo de Oficina Origen no existe", mAceptar, mAdvierte, GsTitMsg
        txtOficinaBan(0).SetFocus
        fbValidarDatos = False
        Exit Function
    End If
            
    If Not MbOfDestino Then ValidarOficina (1)
    If Not MbOfDestino Then
        clsMsgbox.Mensaje "Codigo de Oficina Destino no existe", mAceptar, mAdvierte, GsTitMsg
        txtOficinaBan(1).SetFocus
        fbValidarDatos = False
        Exit Function
    End If
    
    If cboPorcentaje.ListIndex <> -1 Or Trim(txtValor.Text) <> "" Then
        If cboMes.ListIndex = -1 Then
            clsMsgbox.Mensaje "Debe ingresar el Mes del Aumento", mAceptar, mAdvierte, GsTitMsg
            cboMes.SetFocus
            fbValidarDatos = False
            Exit Function
        End If
        If txtAnio = "" Then
            clsMsgbox.Mensaje "Debe ingresar el Año apartir de cual se hace el aumento", mAceptar, mAdvierte, GsTitMsg
            txtAnio.SetFocus
            fbValidarDatos = False
            Exit Function
        End If
    End If
End Function

Private Sub RecuperaListaBancos()
    cboBanco.Clear
    
    ConfiguraCombo cboBanco
    cboBanco.Columns = 1
    With cboBanco
        '.Col = 0: .ColHeaderText = "Codigo": .ColWidth = 0
        .Col = 0: .ColHeaderText = "Descripción": .ColWidth = 40
    End With
    
    cboBanco.Col = 0
        
    MAdo.Sql = "SELECT item, descripcion FROM criterios_valores_col WHERE campo = 'emb_bancos'" & _
               "ORDER BY item"
    MAdo.SendSQL
    Do Until MAdo.EOF
        cboBanco.AddItem Trim(MAdo.GetField(2))
        cboBanco.Row = cboBanco.NewIndex
        cboBanco.ItemData = MAdo.GetField(1)
        MAdo.Mnext
    Loop
                    
End Sub

Private Sub RecuperarDatos()
    Dim sNombre As String

    MAdo.Sql = _
    " SELECT registro_fiscal, cedula, trabajador, Apellidos, Nombres, concepto, descripcion, secuencia, fecha_alta," & _
    " fecha_baja, situacion, consecutivo_oficina, oficina_origen, oficina_destino, clase_deposito," & _
    " numero_expediente, codigo_juzgado, banco, cuenta, tipo_id_demandante, id_demandante, apellido_demandante," & _
    " nombre_demandante, agr_conceptos_base, concepto_base, base, quinta_parte, monto_total, saldo_actual," & _
    " porcentaje, cuota_fija, ciudad_pago, porcentaje_aumento, valor_aumento, mes_aumento, anio_desde " & _
    " FROM vw_fdt_embargos" & _
    " WHERE compania = '" & GsCveCia & "'" & _
    " AND LTRIM(RTRIM(trabajador)) = '" & Trim(Mid(GsLlave, 1, 10)) & "'" & _
    " AND concepto = " & Val(Mid(GsLlave, 11, 5)) & _
    " AND secuencia = " & Val(Mid(GsLlave, 16, 3))
    MAdo.SendSQL
        
If Not MAdo.EOF Then
    'Información del concepto de embargo
    txtConcepto = MAdo.GetField(6) 'dtDatos.Recordset("concepto")
    txtConcepto.Enabled = False
    lblDescripcion = "" & MAdo.GetField(7)  'dtDatos.Recordset("descripcion")
    
    'Información del trabajador
    txtTrabajador = MAdo.GetField(3)  'dtDatos.Recordset("trabajador")
    txtTrabajador.Enabled = False
    sNombre = MAdo.GetField(4) & " " & MAdo.GetField(5)  'dtDatos.Recordset("apellidos") & " " & dtDatos.Recordset("nombres")
    lblTrabajador = Replace(sNombre, "/", " ")
    txtSecuencia = MAdo.GetField(8) 'dtDatos.Recordset("secuencia")
    txtSecuencia.Enabled = False
    GTdEmbargo.Text = Format$(Left(MAdo.GetField(9), 10), "yyyy/mm/dd") 'dtDatos.Recordset("fecha_alta")
    'GTdEmbargo.Enabled = False
    
    'Información del demandante
    cboTipoID.ListIndex = Val("" & MAdo.GetField(20)) 'Val("" & dtDatos.Recordset("tipo_id_demandante")) - 1
    txtIdDemandante = MAdo.GetField(21) 'dtDatos.Recordset("id_demandante")
    txtApellidos = MAdo.GetField(22) 'dtDatos.Recordset("apellido_demandante")
    txtNombres = MAdo.GetField(23)  'dtDatos.Recordset("nombre_demandante")
    
    'Datos Judiciales
    txtOficina = "" & MAdo.GetField(12) 'dtDatos.Recordset("consecutivo_oficina")
    cboClaseDeposito.ListIndex = Val("" & MAdo.GetField(15)) - 1 'Val("" & dtDatos.Recordset("clase_deposito")) - 1
    txtExpediente = "" & MAdo.GetField(16) 'dtDatos.Recordset("numero_expediente")
    txtJuzgado = "" & MAdo.GetField(17) 'dtDatos.Recordset("codigo_juzgado")
    'cboBanco.ListIndex = IndiceCombo(cboBanco, "" & Mado.GetField(18)) 'IndiceCombo(cboBanco, "" & dtDatos.Recordset("banco"))
    cboBanco.ListIndex = IndiceComboFP(cboBanco, "" & MAdo.GetField(18)) 'IndiceCombo(cboBanco, "" & dtDatos.Recordset("banco"))
    txtCuenta = "" & MAdo.GetField(19) 'dtDatos.Recordset("cuenta")
    
    'Valores del Embargo
    txtAgrBase = "" & MAdo.GetField(24) 'dtDatos.Recordset("agr_conceptos_base")
    txtCncBase = "" & MAdo.GetField(25) 'dtDatos.Recordset("concepto_base")
    If Val(txtCncBase) > 0 Then
        optCncBase.Value = True
    Else
        optAgrBase.Value = True
    End If
    chkQuintaParte.Value = IIf(MAdo.GetField(27) = 1, vbChecked, vbUnchecked) 'IIf(dtDatos.Recordset("quinta_parte") = 1, vbChecked, vbUnchecked)
    txtMonto = "" & MAdo.GetField(28) 'dtDatos.Recordset("monto_total")
    txtMonto.Tag = "" & MAdo.GetField(29) 'dtDatos.Recordset("saldo_actual")
    txtPorcentaje = "" & MAdo.GetField(30) 'dtDatos.Recordset("porcentaje")
    txtCuotaFija = "" & MAdo.GetField(31) 'dtDatos.Recordset("cuota_fija")
    
    'datos de oficina origen y oficina destino
    txtOficinaBan(0) = "" & MAdo.GetField(13) 'dtDatos.Recordset("oficina_origen")
    txtOficinaBan(1) = "" & MAdo.GetField(14) 'dtDatos.Recordset("oficina_destino")
    
    txtCiudad = "" & MAdo.GetField(32)  ' dtDatos.Recordset("ciudad_pago")
    
    If MAdo.GetField(11) = 2 Then
        abToolbar.Bands(0).Tools(0).Enabled = False
        abToolbar.Bands(0).Tools(1).Enabled = False
    End If
    
    'Valores de aumentos automaticos
    If MAdo.GetField(33) <> "" Or MAdo.GetField(34) <> "" Then
        chkIncremento.Value = 1
        If MAdo.GetField(33) <> "" Then
            optPorcentaje.Value = True
            cboPorcentaje.ListIndex = MAdo.GetField(33) - 40
        End If
        If MAdo.GetField(34) <> "" Then
            optValor.Value = True
            txtValor.Text = MAdo.GetField(34)
        End If
        If MAdo.GetField(35) <> "" Then
            cboMes.ListIndex = MAdo.GetField(35) - 1
        End If
        If MAdo.GetField(36) <> "" Then
            txtAnio = MAdo.GetField(36)
        End If
    End If
End If
    abToolbar.Bands(0).Tools(0).Enabled = False
    abToolbar.Bands(1).Tools(0).Enabled = False
    fraFrame(1).Visible = True
    fraFrame(2).Visible = True
    fraFrame(3).Visible = True
    fraFrame(4).Visible = True
    fraFrame(7).Visible = True

    MbCnValido = True
    MbCbValido = True
    MbTrValido = True
    MbAgValido = True

    MAdo.Sql = "SELECT 1, a.tipo_nomina " & MsSum & " ' - ' " & MsSum & " b.descripcion FROM fdt_embargos_tipo_nom a, tipos_nomina b " & _
    " WHERE a.tipo_nomina = b.tipo_nomina " & _
    " AND a.compania = '" & GsCveCia & "'" & _
    " AND LTRIM(RTRIM(a.trabajador)) = '" & Trim(txtTrabajador.Text) & "'" & _
    " AND a.concepto = " & txtConcepto.Text & _
    " AND a.secuencia = " & txtSecuencia.Text & _
    " UNION " & _
    " SELECT 0,  a.tipo_nomina " & MsSum & " ' - ' " & MsSum & " b.descripcion " & _
    " FROM rel_conc_tipo_nomina a, tipos_nomina b " & _
    " WHERE a.tipo_nomina = b.tipo_nomina " & _
    " AND a.compania = '" & GsCveCia & "'" & _
    " AND a.concepto = " & txtConcepto.Text & _
    " AND a.tipo_nomina NOT IN (SELECT tipo_nomina FROM fdt_embargos_tipo_nom " & _
    " WHERE compania = '" & GsCveCia & "' " & _
    " AND LTRIM(RTRIM(trabajador)) = '" & Trim(txtTrabajador.Text) & "' " & _
    " AND concepto = " & txtConcepto.Text & _
    " AND secuencia = " & txtSecuencia & ")"
    RenuevaDatos
End Sub

Private Sub RecuperarParametros()

    MAdo.Sql = "SELECT dato FROM vw_fdt_parametros" & _
    " WHERE pais = 'COL' AND compania = '" & GsCveCia & "'" & _
    " AND parametro = 'otros' AND secuencia = 1"

    MAdo.SendSQL
    If MAdo.EOF Then
        MsAgrEmb = "EMB"
    Else
        MsAgrEmb = "" & MAdo.GetField(1)
    End If

End Sub

Private Sub ValidarAgrupacion()
    On Error Resume Next
    If Trim(txtAgrBase) = "" Then MbAgValido = True: Exit Sub
    
    MbAgValido = False
    
    MAdo.Sql = "SELECT 1 FROM agr_conceptos_ns" & _
    " WHERE agr_conceptos = '" & txtAgrBase & "'"
    MAdo.SendSQL
    If Not MAdo.EOF Then
        MbAgValido = True
    End If

End Sub

Private Sub ValidarConcepto()
    On Error Resume Next
    If Trim(txtCncBase) = "" Then MbCbValido = True: Exit Sub
    MbCbValido = False
    
    MAdo.Sql = "SELECT 1 FROM conceptos" & _
    " WHERE concepto = " & txtCncBase
    MAdo.SendSQL
    If Not MAdo.EOF Then
        MbCbValido = True
    End If

End Sub

Private Sub ValidarCiudadPago()
    On Error Resume Next
    MbCiudadPago = False
    
    MAdo.Sql = "SELECT 1 FROM fdt_ciudades_pago" & _
    " WHERE ciudad = '" & txtCiudad & "'"
    MAdo.SendSQL
    If Not MAdo.EOF Then
        MbCiudadPago = True
    Else
        clsMsgbox.Mensaje "No existe el codigo de la ciudad de pago", mAceptar, mAdvierte, GsTitMsg
    End If

End Sub

Private Sub ValidarTrabajador()
    On Error Resume Next
    MAdo.Sql = "SELECT T.trabajador, T.nombre" & _
    " FROM trabajadores T, trabajadores_grales TG, rel_usu_clase_nom u" & _
    " WHERE T.trabajador = TG.trabajador" & _
    "   AND tg.clase_nomina = u.clase_nomina " & _
    "   AND u.usuario = '" & GsUid & "' " & _
    "   AND TG.compania = '" & GsCveCia & "'" & _
    "   AND LTrim(RTrim(TG.trabajador)) = '" & Trim(txtTrabajador) & "'" & _
    "   AND TG.sit_trabajador = 1"
    MAdo.SendSQL
    If MAdo.EOF Then
        clsMsgbox.Mensaje "No existe el trabajador, no está activo o no tiene permisos a la clase de nomina", mAceptar, mAdvierte, GsTitMsg
    Else
        txtTrabajador = MAdo.GetField(1)
        lblTrabajador = Replace(MAdo.GetField(2), "/", " ")
        MbTrValido = True
    End If
    HallarSecuencia

End Sub

Private Sub ValidarOficina(Index As Integer)
    On Error Resume Next
    If Index = 0 Then MbOfOrigen = False
    If Index = 1 Then MbOfDestino = False
    
    MAdo.Sql = "SELECT cod_oficina" & _
    " FROM fdt_embargos_oficinas" & _
    " WHERE cod_oficina= '" & Trim(txtOficinaBan(Index)) & "'"
    MAdo.SendSQL
    
    If Not MAdo.EOF Then
        If Index = 0 Then MbOfOrigen = True
        If Index = 1 Then MbOfDestino = True
    Else
        Select Case Index
            Case 0: clsMsgbox.Mensaje "Codigo de Oficina Origen no existe", mAceptar, mAdvierte, GsTitMsg
            Case 1: clsMsgbox.Mensaje "Codigo de Oficina Destino no existe", mAceptar, mAdvierte, GsTitMsg
        End Select
    End If

End Sub

Private Sub RecuperaTiposAumento()
    cboPorcentaje.Clear
    
    ConfiguraCombo cboPorcentaje
    cboPorcentaje.Columns = 1
    With cboPorcentaje
        '.Col = 0: .ColHeaderText = "Codigo": .ColWidth = 0
        .Col = 0: .ColHeaderText = "Descripción": .ColWidth = 40
    End With
    
    cboPorcentaje.Col = 0
        
    MAdo.Sql = "SELECT secuencia, descripcion FROM fdt_parametros " & _
               "WHERE compania = '" & GsCveCia & "' " & _
               "AND secuencia BETWEEN 40 AND 49 " & _
               "AND parametro = 'otros' " & _
               "ORDER BY secuencia"
    MAdo.SendSQL
    Do Until MAdo.EOF
        cboPorcentaje.AddItem MAdo.GetField(1) & ". " & Trim(MAdo.GetField(2))
        cboPorcentaje.Row = cboPorcentaje.NewIndex
        cboPorcentaje.ItemData = MAdo.GetField(1)
        MAdo.Mnext
    Loop
                    
End Sub

Private Sub txtValor_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        SendEnter
    Else
        KeyAscii = iValidarDato(KeyAscii, "0123456789.", True, True)
    End If
End Sub

Private Sub RenuevaDatos()
    Dim i As Integer
    Dim nValor As Byte
    Dim nSecuencia As Byte
    
    'Retenciones
    ConfiguraSpread sprDatos
    
   
    Set clsSpread = New NSpread
    
    If Not MAdo.SendSQL Then Exit Sub
    
    clsSpread.LlenaSpread 0, sprDatos, MAdo, MAdo.lhDbc, MAdo.lhstmt
    
    'MbPrimeraVez = True
    
    With sprDatos
        .ColWidth(1) = 2
        .ColWidth(2) = 100
        .Col = 1: .Row = -1 'Inicializa rango
        .CellType = 10: '.Value = 0 'Pone la celda de tipo check y da valor
    End With
    GAdam.AjustaSpread sprDatos, 2
    
    'MbRenovando = False
    'MbPrimeraVez = False
End Sub

Private Sub ConfiguraSpread(Spread As Control)
    sprDatos.VisibleCols = 2
    With sprDatos
        .Visible = False
        .Action = 28
        GAdam.ConfiguracionSpread sprDatos
    
        .Row = 0
        .MaxCols = 2
        .Col = 1: .Text = " "
        .Col = 2: .Text = "Descripcion"
    End With
    ConfiguraSpreadJCL sprDatos
End Sub
