VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmCuadre 
   Caption         =   "Cuadre del Día"
   ClientHeight    =   6495
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8265
   Icon            =   "frmCuadre_OLD.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6495
   ScaleWidth      =   8265
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command1 
      Caption         =   "&Cerrar Caja"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   510
      Left            =   3135
      TabIndex        =   28
      Top             =   5880
      Width           =   1605
   End
   Begin TabDlg.SSTab SSTab1 
      Height          =   5655
      Left            =   75
      TabIndex        =   0
      Top             =   105
      Width           =   8115
      _ExtentX        =   14314
      _ExtentY        =   9975
      _Version        =   393216
      TabHeight       =   617
      TabCaption(0)   =   "Cuadre de Fichas"
      TabPicture(0)   =   "frmCuadre_OLD.frx":030A
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "Frame2"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "Frame1"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "Frame3"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).ControlCount=   3
      TabCaption(1)   =   "Cuadre de Productos"
      TabPicture(1)   =   "frmCuadre_OLD.frx":0326
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "Frame4"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "Frame5"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).ControlCount=   2
      TabCaption(2)   =   "Cuadre de Caja"
      TabPicture(2)   =   "frmCuadre_OLD.frx":0342
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "Frame6"
      Tab(2).Control(0).Enabled=   0   'False
      Tab(2).ControlCount=   1
      Begin VB.Frame Frame6 
         Caption         =   " Cuadre de Caja "
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   4050
         Left            =   -73725
         TabIndex        =   50
         Top             =   825
         Width           =   5745
         Begin VB.TextBox txtCashDRWDolares 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   3855
            Locked          =   -1  'True
            TabIndex        =   25
            TabStop         =   0   'False
            Top             =   2370
            Width           =   1530
         End
         Begin VB.TextBox txtFALTSOBDolares 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFC0&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   3855
            Locked          =   -1  'True
            TabIndex        =   27
            TabStop         =   0   'False
            Top             =   3315
            Width           =   1530
         End
         Begin VB.TextBox txtCajaDolares 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   3855
            TabIndex        =   26
            Top             =   2745
            Width           =   1530
         End
         Begin VB.TextBox txtCaja 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            TabIndex        =   22
            Top             =   2745
            Width           =   1530
         End
         Begin VB.TextBox txtCashDolares 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   3855
            Locked          =   -1  'True
            TabIndex        =   24
            TabStop         =   0   'False
            Top             =   1920
            Width           =   1530
         End
         Begin VB.TextBox txtCashDRW 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            Locked          =   -1  'True
            TabIndex        =   21
            TabStop         =   0   'False
            Top             =   2370
            Width           =   1530
         End
         Begin VB.TextBox txtCash 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            Locked          =   -1  'True
            TabIndex        =   20
            TabStop         =   0   'False
            Top             =   1920
            Width           =   1530
         End
         Begin VB.TextBox txtEntregado 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            Locked          =   -1  'True
            TabIndex        =   19
            TabStop         =   0   'False
            Top             =   1545
            Width           =   1530
         End
         Begin VB.TextBox txtVoucher 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFC0&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            Locked          =   -1  'True
            TabIndex        =   18
            TabStop         =   0   'False
            Top             =   675
            Width           =   1530
         End
         Begin VB.TextBox txtPagos 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            Locked          =   -1  'True
            TabIndex        =   17
            TabStop         =   0   'False
            Top             =   1095
            Width           =   1530
         End
         Begin VB.TextBox txtFALTSOB 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFC0&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2010
            Locked          =   -1  'True
            TabIndex        =   23
            TabStop         =   0   'False
            Top             =   3315
            Width           =   1530
         End
         Begin VB.Line Line7 
            BorderWidth     =   2
            X1              =   1980
            X2              =   3570
            Y1              =   1035
            Y2              =   1020
         End
         Begin VB.Line Line9 
            BorderWidth     =   2
            X1              =   3825
            X2              =   5415
            Y1              =   2310
            Y2              =   2295
         End
         Begin VB.Line Line8 
            BorderWidth     =   2
            X1              =   3825
            X2              =   5415
            Y1              =   3165
            Y2              =   3150
         End
         Begin VB.Label Label24 
            AutoSize        =   -1  'True
            Caption         =   "Dólares"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   4215
            TabIndex        =   59
            Top             =   390
            Width           =   750
         End
         Begin VB.Label Label23 
            AutoSize        =   -1  'True
            Caption         =   "Soles"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   2520
            TabIndex        =   58
            Top             =   390
            Width           =   525
         End
         Begin VB.Line Line6 
            BorderWidth     =   2
            X1              =   1950
            X2              =   3540
            Y1              =   2310
            Y2              =   2295
         End
         Begin VB.Line Line4 
            BorderWidth     =   2
            X1              =   1965
            X2              =   3555
            Y1              =   1485
            Y2              =   1470
         End
         Begin VB.Line Line5 
            BorderWidth     =   2
            X1              =   1950
            X2              =   3540
            Y1              =   3165
            Y2              =   3150
         End
         Begin VB.Label Label22 
            AutoSize        =   -1  'True
            Caption         =   "Saldo CAJA :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   510
            TabIndex        =   57
            Top             =   2790
            Width           =   1125
         End
         Begin VB.Label Label21 
            AutoSize        =   -1  'True
            Caption         =   "Cash-DRW :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   630
            TabIndex        =   56
            Top             =   2415
            Width           =   1065
         End
         Begin VB.Label Label20 
            AutoSize        =   -1  'True
            Caption         =   "Total Cash :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   645
            TabIndex        =   55
            Top             =   1965
            Width           =   1050
         End
         Begin VB.Label Label19 
            AutoSize        =   -1  'True
            Caption         =   "Total Entregado :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   210
            TabIndex        =   54
            Top             =   1590
            Width           =   1485
         End
         Begin VB.Label Label17 
            AutoSize        =   -1  'True
            Caption         =   "Voucher :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   855
            TabIndex        =   53
            Top             =   735
            Width           =   840
         End
         Begin VB.Label Label16 
            AutoSize        =   -1  'True
            Caption         =   "Pagos :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   1050
            TabIndex        =   52
            Top             =   1155
            Width           =   645
         End
         Begin VB.Label Label15 
            AutoSize        =   -1  'True
            Caption         =   "FALT/SOB :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   600
            TabIndex        =   51
            Top             =   3360
            Width           =   1095
         End
      End
      Begin VB.Frame Frame5 
         Caption         =   " Detalle De Productos (c/Control de Stock) "
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2430
         Left            =   -73530
         TabIndex        =   43
         Top             =   3045
         Width           =   5265
         Begin VB.TextBox txtProductosFS 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFC0&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2400
            Locked          =   -1  'True
            TabIndex        =   15
            TabStop         =   0   'False
            Top             =   1935
            Width           =   1530
         End
         Begin VB.TextBox txtProductosIF 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2400
            TabIndex        =   14
            Top             =   1455
            Width           =   1530
         End
         Begin VB.TextBox txtProductosT 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2400
            Locked          =   -1  'True
            TabIndex        =   13
            TabStop         =   0   'False
            Top             =   1080
            Width           =   1530
         End
         Begin VB.TextBox txtProductosII 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2400
            TabIndex        =   12
            Top             =   705
            Width           =   1530
         End
         Begin VB.TextBox txtProductosNombre 
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2400
            Locked          =   -1  'True
            TabIndex        =   11
            TabStop         =   0   'False
            Top             =   330
            Width           =   2400
         End
         Begin VB.CommandButton cmdCuadraProductos 
            Caption         =   "Aceptar"
            Height          =   420
            Left            =   4110
            TabIndex        =   16
            Top             =   1905
            Width           =   1050
         End
         Begin VB.Line Line3 
            BorderWidth     =   2
            X1              =   2385
            X2              =   3960
            Y1              =   1860
            Y2              =   1860
         End
         Begin VB.Label Label9 
            AutoSize        =   -1  'True
            Caption         =   "FALT/SOB :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   1215
            TabIndex        =   48
            Top             =   1980
            Width           =   1095
         End
         Begin VB.Label Label10 
            AutoSize        =   -1  'True
            Caption         =   "Inventario Final :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   840
            TabIndex        =   47
            Top             =   1500
            Width           =   1470
         End
         Begin VB.Label Label11 
            AutoSize        =   -1  'True
            Caption         =   "Ticketeadas :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   1155
            TabIndex        =   46
            Top             =   1140
            Width           =   1155
         End
         Begin VB.Label Label12 
            AutoSize        =   -1  'True
            Caption         =   "Inventario Inicial :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   720
            TabIndex        =   45
            Top             =   765
            Width           =   1590
         End
         Begin VB.Label Label13 
            AutoSize        =   -1  'True
            Caption         =   "Producto :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   1425
            TabIndex        =   44
            Top             =   360
            Width           =   885
         End
      End
      Begin VB.Frame Frame4 
         Caption         =   " Cuadre de Productos (c/Control de Stock)"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2505
         Left            =   -73530
         TabIndex        =   41
         Top             =   510
         Width           =   5265
         Begin MSComctlLib.ListView lvwProductos 
            Height          =   2160
            Left            =   90
            TabIndex        =   42
            Top             =   240
            Width           =   5070
            _ExtentX        =   8943
            _ExtentY        =   3810
            LabelEdit       =   1
            LabelWrap       =   -1  'True
            HideSelection   =   0   'False
            _Version        =   393217
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            BorderStyle     =   1
            Appearance      =   1
            NumItems        =   0
         End
      End
      Begin VB.Frame Frame3 
         Height          =   1800
         Left            =   4185
         TabIndex        =   36
         Top             =   3330
         Width           =   3645
         Begin VB.TextBox txtCanjeNombre 
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1005
            Locked          =   -1  'True
            TabIndex        =   6
            TabStop         =   0   'False
            Top             =   195
            Width           =   2400
         End
         Begin VB.TextBox txtCanjeFichas 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1005
            Locked          =   -1  'True
            TabIndex        =   7
            TabStop         =   0   'False
            Top             =   555
            Width           =   1260
         End
         Begin VB.TextBox txtCanjeCantidad 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1005
            TabIndex        =   8
            Top             =   915
            Width           =   1260
         End
         Begin VB.TextBox txtCanjeTotal 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFC0&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1005
            Locked          =   -1  'True
            TabIndex        =   9
            TabStop         =   0   'False
            Top             =   1335
            Width           =   1260
         End
         Begin VB.CommandButton cmdGrabaCanje 
            Caption         =   "Aceptar"
            Height          =   420
            Left            =   2475
            TabIndex        =   10
            Top             =   1275
            Width           =   1050
         End
         Begin VB.Label Label5 
            AutoSize        =   -1  'True
            Caption         =   "Producto :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   105
            TabIndex        =   40
            Top             =   225
            Width           =   885
         End
         Begin VB.Label Label7 
            AutoSize        =   -1  'True
            Caption         =   "Cantidad :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   90
            TabIndex        =   39
            Top             =   975
            Width           =   900
         End
         Begin VB.Label Label8 
            AutoSize        =   -1  'True
            Caption         =   "Total :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   375
            TabIndex        =   38
            Top             =   1380
            Width           =   615
         End
         Begin VB.Label Label6 
            AutoSize        =   -1  'True
            Caption         =   "Fichas :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   330
            TabIndex        =   37
            Top             =   630
            Width           =   660
         End
         Begin VB.Line Line2 
            BorderWidth     =   2
            X1              =   990
            X2              =   2250
            Y1              =   1275
            Y2              =   1275
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   " Cuadre de Fichas "
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2415
         Left            =   1890
         TabIndex        =   31
         Top             =   525
         Width           =   4140
         Begin VB.TextBox txtFichasFS 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFC0&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2085
            Locked          =   -1  'True
            TabIndex        =   5
            TabStop         =   0   'False
            Top             =   1935
            Width           =   1530
         End
         Begin VB.TextBox txtFichasII 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2085
            TabIndex        =   1
            Top             =   330
            Width           =   1530
         End
         Begin VB.TextBox txtFichasT 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2085
            Locked          =   -1  'True
            TabIndex        =   2
            TabStop         =   0   'False
            Top             =   705
            Width           =   1530
         End
         Begin VB.TextBox txtFichasC 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00C0FFFF&
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2085
            Locked          =   -1  'True
            TabIndex        =   3
            TabStop         =   0   'False
            Top             =   1080
            Width           =   1530
         End
         Begin VB.TextBox txtFichasIF 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2085
            TabIndex        =   4
            Top             =   1455
            Width           =   1530
         End
         Begin VB.Label Label14 
            AutoSize        =   -1  'True
            Caption         =   "FALT/SOB :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   900
            TabIndex        =   49
            Top             =   1980
            Width           =   1095
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            Caption         =   "Inventario Inicial :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   405
            TabIndex        =   35
            Top             =   390
            Width           =   1590
         End
         Begin VB.Label Label2 
            AutoSize        =   -1  'True
            Caption         =   "Ticketeadas :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   840
            TabIndex        =   34
            Top             =   765
            Width           =   1155
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "Canje :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   1350
            TabIndex        =   33
            Top             =   1125
            Width           =   645
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            Caption         =   "Inventario Final :"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Left            =   525
            TabIndex        =   32
            Top             =   1500
            Width           =   1470
         End
         Begin VB.Line Line1 
            BorderWidth     =   2
            X1              =   2070
            X2              =   3660
            Y1              =   1845
            Y2              =   1830
         End
      End
      Begin VB.Frame Frame2 
         Caption         =   " Detalle de Canjes "
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2385
         Left            =   180
         TabIndex        =   29
         Top             =   3060
         Width           =   3930
         Begin MSComctlLib.ListView lvwFichas 
            Height          =   2025
            Left            =   90
            TabIndex        =   30
            Top             =   255
            Width           =   3735
            _ExtentX        =   6588
            _ExtentY        =   3572
            LabelEdit       =   1
            LabelWrap       =   -1  'True
            HideSelection   =   0   'False
            FullRowSelect   =   -1  'True
            _Version        =   393217
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            BorderStyle     =   1
            Appearance      =   1
            NumItems        =   0
         End
      End
   End
End
Attribute VB_Name = "frmCuadre"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'Cuadre de Fichas

Sub CuadreFichas()
  
  On Error GoTo LineaError

  Dim sSQL As String
  Dim ADORS As ADODB.Recordset
  
  'Calcula las Ticketeadas
  
  sSQL = " SELECT SUM(P.cProdFichaCant * O.nProdCant) AS TOTAL" & _
         " FROM Producto AS P INNER JOIN Operacion AS O ON P.cProdCode = O.cProdCode AND P.cAlmaCode = O.cAlmaCode" & _
         " WHERE cOperFlagAbierto = 1 " & _
         " AND cProdFlagCanje <> 1" & _
         " AND cProdFlagFicha = 1"
  
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  Do While Not ADORS.EOF
    txtFichasT.Text = Format(CStr(LeerCampo(ADORS("TOTAL"))), "###,###,###,##0")
    ADORS.MoveNext
  Loop

  GoTo Salir
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
Salir:
  Set ADORS = Nothing
End Sub

Private Sub ConfigurarColumnas()

  'Configura las columnas de la lista lvwFichas
  
  On Error GoTo LineaError

  Dim aColumnTitle() As String
  Dim aColumnWidth() As Single
  Dim aColumnAlign() As Integer
  
  ReDim aColumnTitle(5) As String
  ReDim aColumnWidth(5) As Single
  ReDim aColumnAlign(5) As Integer

  aColumnTitle(0) = "Cód."
  aColumnTitle(1) = "Producto"
  aColumnTitle(2) = "Fichas."
  aColumnTitle(3) = "Cant."
  aColumnTitle(4) = "Total"
  
  aColumnWidth(0) = 0.1
  aColumnWidth(1) = 0.4
  aColumnWidth(2) = 0.1
  aColumnWidth(3) = 0.17
  aColumnWidth(4) = 0.2
    
  aColumnAlign(0) = lvwColumnLeft
  aColumnAlign(1) = lvwColumnLeft
  aColumnAlign(2) = lvwColumnRight
  aColumnAlign(3) = lvwColumnRight
  aColumnAlign(4) = lvwColumnRight
    
  Call oListAdmin.InicializarLista(lvwFichas, aColumnTitle, _
                                   aColumnWidth, aColumnAlign, lvwReport)
  
  'Configura las columnas de la lista lvwProductos
  
  ReDim aColumnTitle(6) As String
  ReDim aColumnWidth(6) As Single
  ReDim aColumnAlign(6) As Integer

  aColumnTitle(0) = "Cód."
  aColumnTitle(1) = "Producto"
  aColumnTitle(2) = "Inv.Inic."
  aColumnTitle(3) = "Ticket"
  aColumnTitle(4) = "Inv.Finl."
  aColumnTitle(5) = "FALT/SOB"
  
  aColumnWidth(0) = 0.1
  aColumnWidth(1) = 0.3
  aColumnWidth(2) = 0.1
  aColumnWidth(3) = 0.1
  aColumnWidth(4) = 0.1
  aColumnWidth(5) = 0.2
    
  aColumnAlign(0) = lvwColumnLeft
  aColumnAlign(1) = lvwColumnLeft
  aColumnAlign(2) = lvwColumnRight
  aColumnAlign(3) = lvwColumnRight
  aColumnAlign(4) = lvwColumnRight
  aColumnAlign(5) = lvwColumnRight
    
  Call oListAdmin.InicializarLista(lvwProductos, aColumnTitle, _
                                   aColumnWidth, aColumnAlign, lvwReport)
                                   
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation

End Sub

Public Sub LlenarListaFichas()

  'Llena la lista
  
  On Error GoTo LineaError

  Dim sSQL As String
  Dim ADORS As ADODB.Recordset
  
  Dim itemX As ListItem
  
  lvwFichas.ListItems.Clear
  
  sSQL = " SELECT cProdCode, sProdDescCrta, cProdFichaCant" & _
         " FROM Producto" & _
         " WHERE cProdFlagCanje = 1" & _
         " AND cProdFlagFicha = 1" & _
         " AND cProdEstd = 1" & _
         " AND cAlmaCode = '" & kPAR_ALMACEN & "'" & _
         " ORDER BY 1"
         
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  
  Do While Not ADORS.EOF
    Set itemX = lvwFichas.ListItems.Add(, , LeerCampo(ADORS!cProdCode))
    itemX.SubItems(1) = LeerCampo(ADORS!sProdDescCrta)
    itemX.SubItems(2) = LeerCampo(ADORS!cProdFichaCant)
    itemX.SubItems(3) = Format("0", "###,###,###,##0")
    itemX.SubItems(4) = Format("0", "###,###,###,##0")
    ADORS.MoveNext
  Loop
   
  GoTo Salir
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
  
Salir:
  Set ADORS = Nothing
End Sub

Private Sub cmdCuadraProductos_Click()
  lvwProductos.SelectedItem.SubItems(2) = Format(txtProductosII.Text, "###,###,###,##0")
  lvwProductos.SelectedItem.SubItems(4) = Format(txtProductosIF.Text, "###,###,###,##0")
  lvwProductos.SelectedItem.SubItems(5) = Format(txtProductosFS.Text, "###,###,###,##0")
End Sub

Private Sub cmdGrabaCanje_Click()
  Dim iTotal As Double
  Dim i As Long
  iTotal = 0
  lvwFichas.SelectedItem.SubItems(3) = Format(txtCanjeCantidad.Text, "###,###,###,##0")
  lvwFichas.SelectedItem.SubItems(4) = Format(txtCanjeTotal.Text, "###,###,###,##0")
  'Calcula Total por Canje
  For i = 1 To lvwFichas.ListItems.Count
    iTotal = iTotal + Val(Format(lvwFichas.ListItems(i).SubItems(4), "###########0"))
  Next
  txtFichasC.Text = Format(CStr(iTotal), "###,###,###,##0")
  Call CuadreFichasTotal
End Sub

Private Sub Command1_Click()
  If frmPrincipal.bCerrar Then Imprimir
  Unload Me
End Sub

Private Sub Form_Load()
  InicializaControles
  
  'Configura la Impresora por default
  ConfiguraImpresora kPAR_IMPRESORA
  '----------------------------------
  
  ConfigurarColumnas
  'LlenarListaFichas
  'LlenarListaProductos
  'CuadreFichas
  CuadreCaja
  
  'CuadreFichasTotal
  CuadreCajaTotal
  
  
  'lvwFichas_Click
End Sub

Sub InicializaControles()
  'Cuadre de Fichas
  txtFichasII.Text = "0"
  txtFichasC.Text = "0"
  txtFichasT.Text = "0"
  txtFichasIF.Text = "0"
  txtFichasFS.Text = "0"
  txtCanjeNombre.Text = ""
  txtCanjeFichas.Text = "0"
  txtCanjeCantidad.Text = "0"
  txtCanjeTotal.Text = "0"
  
  'Cuadre de Productos
  txtProductosII.Text = "0"
  txtProductosT.Text = "0"
  txtProductosIF.Text = "0"
  txtProductosFS.Text = "0"
  
  SSTab1.Tab = 0
End Sub

Sub CuadreFichasTotal()
  Dim iTotal As Double
  iTotal = 0
  iTotal = iTotal + Val(Format(txtFichasII.Text, "###########0"))
  iTotal = iTotal - Val(Format(txtFichasT.Text, "###########0"))
  iTotal = iTotal - Val(Format(txtFichasC.Text, "###########0"))
  iTotal = iTotal - Val(Format(txtFichasIF.Text, "###########0"))
  txtFichasFS.Text = Format(CStr(iTotal), "###########0")
End Sub


Public Sub lvwFichas_Click()
  If lvwFichas.ListItems.Count > 0 Then
    txtCanjeNombre.Text = lvwFichas.SelectedItem.SubItems(1)
    txtCanjeFichas.Text = lvwFichas.SelectedItem.SubItems(2)
    txtCanjeCantidad.Text = lvwFichas.SelectedItem.SubItems(3)
    txtCanjeTotal.Text = Val(txtCanjeFichas.Text) * Val(txtCanjeCantidad.Text)
  End If
  txtCanjeCantidad.SetFocus
End Sub

Private Sub txtCanjeCantidad_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_INTEGER_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtCanjeCantidad_LostFocus()
  txtCanjeTotal.Text = Val(txtCanjeFichas.Text) * Val(txtCanjeCantidad.Text)
End Sub

Private Sub txtFichasII_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_INTEGER_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtFichasII_LostFocus()
  Call CuadreFichasTotal
End Sub

Private Sub txtFichasIF_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_INTEGER_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtFichasIF_LostFocus()
  Call CuadreFichasTotal
End Sub

Public Sub LlenarListaProductos()

  'Llena la lista
  
  On Error GoTo LineaError

  Dim sSQL As String
  Dim ADORS As ADODB.Recordset
  
  Dim itemX As ListItem
  
  lvwProductos.ListItems.Clear
  sSQL = " SELECT P.cProdCode, P.SProdDescCrta, SUM(O.nProdCant) AS TICKET" & _
         " FROM Producto AS P LEFT JOIN Operacion AS O ON P.cProdCode = O.cProdCode AND P.cAlmaCode = O.cAlmaCode" & _
         " WHERE cOperFlagAbierto = 1 " & _
         " AND cProdFlagFicha <> 1" & _
         " AND cProdFlagControl = 1" & _
         " GROUP BY P.cProdCode, P.SProdDescCrta"
         
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  
  Do While Not ADORS.EOF
    Set itemX = lvwProductos.ListItems.Add(, , LeerCampo(ADORS!cProdCode))
    itemX.SubItems(1) = LeerCampo(ADORS!sProdDescCrta)
    itemX.SubItems(2) = Format("0", "###,###,###,###0")
    itemX.SubItems(3) = Format(CStr(LeerCampo(ADORS!TICKET)), "###,###,###,###0")
    itemX.SubItems(4) = Format("0", "###,###,###,###0")
    itemX.SubItems(5) = Format("0", "###,###,###,###0")
    ADORS.MoveNext
  Loop
   
  GoTo Salir
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
  
Salir:
  Set ADORS = Nothing
End Sub

Public Sub lvwProductos_Click()
  If lvwProductos.ListItems.Count > 0 Then
    txtProductosNombre.Text = lvwProductos.SelectedItem.SubItems(1)
    txtProductosII.Text = lvwProductos.SelectedItem.SubItems(2)
    txtProductosT.Text = lvwProductos.SelectedItem.SubItems(3)
    txtProductosIF.Text = lvwProductos.SelectedItem.SubItems(4)
    txtProductosFS.Text = lvwProductos.SelectedItem.SubItems(5)
  End If
  txtProductosII.SetFocus
  Call CuadreProductosTotal
End Sub

Private Sub txtProductosII_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_INTEGER_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtProductosII_LostFocus()
  Call CuadreProductosTotal
End Sub

Private Sub txtProductosIF_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_INTEGER_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtProductosIF_LostFocus()
  Call CuadreProductosTotal
End Sub

Sub CuadreProductosTotal()
  Dim iTotal As Double
  iTotal = 0
  iTotal = iTotal + Val(Format(txtProductosII.Text, "###########0"))
  iTotal = iTotal - Val(Format(txtProductosT.Text, "###########0"))
  iTotal = iTotal - Val(Format(txtProductosIF.Text, "###########0"))
  txtProductosFS.Text = Format(CStr(iTotal), "###########0")
End Sub

'-----------------------
'Cuadre Caja

Sub CuadreCaja()
  'Llena la lista
  
  On Error GoTo LineaError

  Dim sSQL As String
  Dim ADORS As ADODB.Recordset
  Dim iTotal As Double
  Dim iTotalDolares As Double
  Dim nTipoCambio As Double
  
  iTotal = 0
  iTotalDolares = 0
  
  sSQL = " SELECT SUM(nProdPrecUnit) AS TOTAL" & _
         " FROM Operacion" & _
         " WHERE cOperFlagAbierto = 1 " & _
         " AND cOperTipo = 5"
         
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  
  Do While Not ADORS.EOF
    If IsNull(LeerCampo(ADORS!TOTAL)) Or (LeerCampo(ADORS!TOTAL)) = "" Then
      txtPagos.Text = "0"
    Else
      txtPagos.Text = Format(LeerCampo(ADORS!TOTAL), "###,###,###,##0.00")
      iTotal = iTotal + LeerCampo(ADORS!TOTAL)
    End If
    ADORS.MoveNext
  Loop
   
  sSQL = " SELECT SUM(nProdPrecUnit * nProdCant) AS TOTAL" & _
         " FROM Operacion" & _
         " WHERE cOperFlagAbierto = 1 " & _
         " AND cOperTipo = 2"
         
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  
  Do While Not ADORS.EOF
    If IsNull(LeerCampo(ADORS!TOTAL)) Or (LeerCampo(ADORS!TOTAL)) = "" Then
      txtVoucher.Text = "0"
    Else
      txtVoucher.Text = Format(LeerCampo(ADORS!TOTAL), "###,###,###,##0.00")
      'iTotal = iTotal + LeerCampo(adors!TOTAL)
    End If
    ADORS.MoveNext
  Loop
  
  txtEntregado.Text = Format(iTotal, "###,###,###,##0.00")
  
  'Totla de Dolares obtenidos por ventas
  sSQL = " SELECT SUM(nMontoDolares) AS TOTAL" & _
         " FROM Operacion" & _
         " WHERE cOperFlagAbierto = 1 " & _
         " AND cOperTipo = 1"
         
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  
  Do While Not ADORS.EOF
    If IsNull(LeerCampo(ADORS!TOTAL)) Or (LeerCampo(ADORS!TOTAL)) = "" Then
      txtCashDolares.Text = "0"
    Else
      txtCashDolares.Text = Format(LeerCampo(ADORS!TOTAL), "###,###,###,##0.00")
      iTotalDolares = iTotalDolares + LeerCampo(ADORS!TOTAL)
    End If
    ADORS.MoveNext
  Loop
  
  'Calculo del Cash Soles
  sSQL = " SELECT SUM(nProdPrecUnit * nProdCant) AS TOTAL" & _
         " FROM Operacion" & _
         " WHERE cOperFlagAbierto = 1 " & _
         " AND (cOperTipo = 1 OR" & _
         " (cOperTipo = 3 AND cProdCode = 0))"
         
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  
  Do While Not ADORS.EOF
    If IsNull(LeerCampo(ADORS!TOTAL)) Or (LeerCampo(ADORS!TOTAL)) = "" Then
      txtCash.Text = "0"
    Else
      txtCash.Text = Format(LeerCampo(ADORS!TOTAL), "###,###,###,##0.00")
      iTotal = LeerCampo(ADORS!TOTAL) - iTotal
    End If
    ADORS.MoveNext
  Loop
  
  txtCashDRW.Text = Format(iTotal, "###,###,###,##0.00")
  txtCashDRWDolares.Text = Format(iTotalDolares, "###,###,###,##0.00")
  txtCaja = Format(0, "###,###,###,##0.00")
  txtCajaDolares = Format(0, "###,###,###,##0.00")
  txtFALTSOB.Text = Format((iTotal), "###,###,###,##0.00")
  txtFALTSOBDolares.Text = Format((iTotalDolares), "###,###,###,##0.00")
  
  GoTo Salir
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
  
Salir:
  Set ADORS = Nothing
End Sub

Sub CuadreCajaTotal()
  Dim iTotal As Double
  iTotal = 0
  iTotal = iTotal + Val(Format(txtCashDRW.Text, "###########0.00"))
  iTotal = iTotal - Val(Format(txtCaja.Text, "###########0.00"))
  txtFALTSOB.Text = Format(CStr(iTotal), "###,###,###,##0.00")
  
  iTotal = 0
  iTotal = iTotal + Val(Format(txtCashDRWDolares.Text, "###########0.00"))
  iTotal = iTotal - Val(Format(txtCajaDolares.Text, "###########0.00"))
  txtFALTSOBDolares.Text = Format(CStr(iTotal), "###,###,###,##0.00")
End Sub

Private Sub txtCaja_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtCaja_LostFocus()
  txtCaja.Text = Format(txtCaja.Text, "###,###,###,##0.00")
  Call CuadreCajaTotal
End Sub

Private Sub txtCajaDolares_KeyPress(KeyAscii As Integer)
  'Valida q solo se ingresen números (valores enteros)
  On Error GoTo LineaError
  Call ValidKeyPress(KeyAscii, kVKP_NUMERIC_ONLY)
  Exit Sub
  
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
End Sub

Private Sub txtCajaDolares_LostFocus()
  txtCajaDolares.Text = Format(txtCajaDolares.Text, "###,###,###,##0.00")
  Call CuadreCajaTotal
End Sub

Sub Imprimir()
  On Error GoTo LineaError
  
  Dim sTexto As String
  Dim i As Long, j As Long
  Dim ID As Long
  Dim sFecha As String
  Dim ADORS As ADODB.Recordset
  Dim sSQL As String
  Dim ActualizarTabla As Boolean
  
  
  sFecha = Format(Now(), "DD/MM/YYYY")
  sTexto = ""
  
  'CAPTURA EL NUMERO DE CUADRE
  sSQL = " SELECT MAX(dCuadreID) AS TOTAL FROM CUADRE_CAJA"
  
  If Not oDBAdmin.EjecutarConsulta(ADOCnn, sSQL, ADORS) Then GoTo Salir
  Do While Not ADORS.EOF
    If LeerCampo(ADORS("TOTAL")) = "" Or IsNull(LeerCampo(ADORS("TOTAL"))) Then
      ID = 1
    Else
      ID = LeerCampo(ADORS("TOTAL")) + 1
    End If
    ADORS.MoveNext
  Loop
    
  
  Printer.FontSize = 8 ' 11
  Printer.FontName = "Courier New"
  
  Call CabeceraImpresion
  
  For i = 0 To UBound(sCabecera) - 1
    sTexto = sTexto + Right("              " + sCabecera(i), Int(Len(sCabecera(i)) / 2) + 14) + vbCrLf
  Next
  sTexto = sTexto + vbCrLf + vbCrLf
      
  sTexto = sTexto + "      " + Format(CStr(Now()), "DD/MM/YYYY (DDD)")
  Printer.Print sTexto
  Printer.Print ""
  
  ActualizarTabla = True
  
  'Empieza impresion e insercion de lineas
  i = 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "      CUADRE DE FICHAS"
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  'Valores de cuadre de fichas
  i = i + 1
  sTexto = "  Inv. Inicial" + Right(LPad("", 12) + "*" + txtFichasII.Text, 12)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "   Ticketeadas" + Right(LPad("", 12) + "*" + txtFichasT.Text, 12)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "         Canje" + Right(LPad("", 12) + "*" + txtFichasC.Text, 12)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "    Inv. Final" + Right(LPad("", 12) + "*" + txtFichasIF.Text, 12)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "      FALT/SOB" + Right(LPad("", 12) + "*" + txtFichasFS.Text, 12)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  Printer.Print ""
  
  'DETALLE DE CANJE DE FICHAS
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "   DETALLE CUADRE FICHAS   "
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "   CANJE   " + "   CANT  " + "  FICHAS "
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  For j = 1 To lvwFichas.ListItems.Count
    i = i + 1
    sTexto = Right("         " + lvwFichas.ListItems(j).SubItems(1), 11) + _
             Right("         " + "*" + lvwFichas.ListItems(j).SubItems(3), 9) + _
             Right("         " + "*" + lvwFichas.ListItems(j).SubItems(4), 9)
    sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle)" & _
           " VALUES ('$', $, $, '$')"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
    If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
    Printer.Print sTexto
  Next
  
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  Printer.Print ""
        
  'CUADRE DE PRODUCTOS
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "    CUADRE DE PRODUCTOS    "
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  For j = 1 To lvwProductos.ListItems.Count
    i = i + 1
    sTexto = lvwProductos.ListItems(j).SubItems(1)
    sTexto = Right(LPad(sTexto, 14), Int(Len(sTexto) / 2) + 14)
    sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle)" & _
           " VALUES ('$', $, $, '$')"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
    If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
    Printer.Print sTexto
    
    i = i + 1
    sTexto = "  Inv. Inicial" + Right(LPad("", 12) + "*" + lvwProductos.ListItems(j).SubItems(2), 12)
    sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle)" & _
           " VALUES ('$', $, $, '$')"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
    If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
    Printer.Print sTexto
    
    i = i + 1
    sTexto = "  Ticketeadas " + Right(LPad("", 12) + "*" + lvwProductos.ListItems(j).SubItems(3), 12)
    sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle)" & _
           " VALUES ('$', $, $, '$')"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
    If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
    Printer.Print sTexto
    
    i = i + 1
    sTexto = "  Inv. Final  " + Right(LPad("", 12) + "*" + lvwProductos.ListItems(j).SubItems(4), 12)
    sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle)" & _
           " VALUES ('$', $, $, '$')"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
    If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
    Printer.Print sTexto
    
    i = i + 1
    sTexto = "  FALT/SOB    " + Right(LPad("", 12) + "*" + lvwProductos.ListItems(j).SubItems(5), 12)
    sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle)" & _
           " VALUES ('$', $, $, '$')"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
    If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
    Printer.Print sTexto
    
  Next
  
  i = i + 1
  
  Printer.Print ""
    
  'CUADRE DE CAJA
  'Valores de cuadre de fichas
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "CUADRE CAJA"
  sTexto = Right(LPad(sTexto, 14), Int(Len(sTexto) / 2) + 14)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = LPad("", 27, "-")
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
    
  i = i + 1
  sTexto = "CONCEPTO" + "   SOLES  " + " DOLARES "
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "   PAGOS" + Right(LPad("", 9) + "*" + txtPagos.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = " VOUCHER" + Right(LPad("", 9) + "*" + txtVoucher.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "ENTREG. " + Right(LPad("", 9) + "*" + txtEntregado.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "    CASH" + Right(LPad("", 9) + "*" + txtCash.Text, 9) + Right(LPad("", 9) + "*" + txtCashDolares.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "CASH-DRW" + Right(LPad("", 9) + "*" + txtCashDRW.Text, 9) + Right(LPad("", 9) + "*" + txtCashDRWDolares.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "    CAJA" + Right(LPad("", 9) + "*" + txtCaja.Text, 9) + Right(LPad("", 9) + "*" + txtCajaDolares.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  i = i + 1
  sTexto = "FALT/SOB" + Right(LPad("", 9) + "*" + txtFALTSOB.Text, 9) + Right(LPad("", 9) + "*" + txtFALTSOBDolares.Text, 9)
  sSQL = " INSERT INTO CUADRE_CAJA(dCuadreFecha, dCuadreID, dCuadreLinea, dCuadreDetalle) " & _
           "VALUES ('$', $, $, '$')"
  sSQL = VBsprintf(sSQL, sFecha, CStr(ID), CStr(i), sTexto)
  If Not oDBAdmin.EjecutarSentencia(ADOCnn, sSQL) Then ActualizarTabla = False
  Printer.Print sTexto
  
  If Not ActualizarTabla Then
    sSQL = " DELETE FROM CUADRE_CAJA WHERE format(dCuadreFecha,'dd/mm/yyyy') = '$' AND dCuadreID = $"
    sSQL = VBsprintf(sSQL, sFecha, CStr(ID))
    oDBAdmin.EjecutarSentencia ADOCnn, sSQL
    Printer.KillDoc
  Else
    Printer.EndDoc
  End If
  GoTo Salir
    
LineaError:
  MsgBox Err.Description, vbOKOnly + vbInformation
Salir:
  Set ADORS = Nothing
End Sub
