VERSION 5.00
Begin VB.Form FCierreZ 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Cierre Z                                           Fecha Proceso"
   ClientHeight    =   5010
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6690
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5010
   ScaleWidth      =   6690
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   4320
      Top             =   2880
   End
   Begin VB.Frame Frame1 
      Caption         =   "Datos"
      Height          =   1575
      Left            =   135
      TabIndex        =   5
      Top             =   1215
      Width           =   6420
      Begin VB.Label lblcaja 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   15.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   345
         Left            =   1440
         TabIndex        =   9
         Top             =   345
         Width           =   3345
      End
      Begin VB.Label Label1 
         Caption         =   "Caja"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   15.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   195
         TabIndex        =   8
         Top             =   330
         Width           =   645
      End
      Begin VB.Label Label2 
         Caption         =   "Fecha Actual"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   15.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   150
         TabIndex        =   7
         Top             =   855
         Width           =   1245
      End
      Begin VB.Label lblfechaactual 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   15.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   1440
         TabIndex        =   6
         Top             =   855
         Width           =   3360
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "Imprimir Por"
      Height          =   1830
      Left            =   135
      TabIndex        =   2
      Top             =   2940
      Width           =   4155
      Begin VB.OptionButton optpantalla 
         Caption         =   "Pantalla"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   315
         TabIndex        =   4
         Top             =   390
         Value           =   -1  'True
         Width           =   1860
      End
      Begin VB.OptionButton optimpresora 
         Caption         =   "Impresora"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   885
         Left            =   285
         Picture         =   "FCierrez.frx":0000
         TabIndex        =   3
         Top             =   870
         Width           =   1605
      End
   End
   Begin VB.CommandButton CMD_CANCELAR 
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   4710
      Picture         =   "FCierrez.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3960
      Width           =   1860
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      Caption         =   "Aceptar"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   4710
      Picture         =   "FCierrez.frx":0614
      Style           =   1  'Graphical
      TabIndex        =   0
      Tag             =   "R ASDASD"
      Top             =   3015
      Width           =   1860
   End
   Begin VB.Label Label3 
      Caption         =   "ESTE PROCESO IMPRIME EL TOTAL DE VENTAS DEL DIA POR CAJA. SOLO DEBE EJECUTARSE AL FINALIZAR LAS VENTAS DEL DIA"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   780
      Left            =   270
      TabIndex        =   10
      Top             =   225
      Width           =   6180
   End
   Begin VB.Shape Shape1 
      Height          =   960
      Left            =   135
      Top             =   135
      Width           =   6450
   End
End
Attribute VB_Name = "FCierreZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

' VARIABLE PARA SABER SI ES CIERREX O CIERREZ
' 1 : CierreX
' 2 : CierreZ
Dim IntTipoCierre As Integer

' VARIABLE PARA SABER SI ES TIENDA O PLAYA
' 1 : Tienda
' 2 : Playa
Dim IntLugar As Integer

' VARIABLES DE PUNTO DE VENTA,VENDEDOR y FECHA DE CIERRE (FECHA DE PROCESO)
Dim StrNroPtoVta As String
Dim StrSalesPerID As String
Dim StrFechaCierre As String
Dim IntTurno As Integer

' DATOS DE IMPRESORA
Dim IntNroSaltosLineas As Integer
Dim StrCodCorte As String
Dim IntAnchoTicket As Integer

' LINEA DE SEPARACION
Dim StrLineaSeparacion As String

' variables de cabecera de cierre
Dim StrSerieMaqReg As String
Dim StrFecha As String
Dim DblTipoCambio As Double
Dim IntNroTransacciones As Integer
Dim DblTicketBolIni As Double
Dim dblTicketFacIni As Double
Dim DblValorVta As Double
Dim DblVtaNoAfecta As Double
Dim DblIGV As Double
Dim DblVtaTotal As Double
Dim IntNroTicketAnul As Integer
Dim DblTotalTicketAnul As Double
Dim DblGranTotal As Double
Dim IntNroZeta As Integer
'dim IntTurno As Integer

Dim DblFondoCajaPEN As Double
Dim DblFondoCajaUSD As Double

' variables de resumen de ventas
Dim DblTotalTicketBol As Double
Dim DblTotalTicketFac As Double
Dim DblTotalGral As Double

' variables de resumen de tipos de pago
Dim DblEfectivo As Double
Dim DblVueltoEfectivo As Double
Dim DblNetoEfectivo As Double

Dim DblTarjeta As Double
Dim DblVueltoTarjeta As Double
Dim DblNetoTarjeta As Double

Dim DblVale As Double
Dim DblVueltoVale As Double
Dim DblNetoVale As Double

' variables para monedas
Dim StrMdaBase As String
Dim StrMdaCaja As String
Dim StrSimbMdaCaja As String
Dim StrSimbMdaExt As String

' cabeceras de ticket
Dim StrCab1 As String, StrCab2 As String, StrCab3 As String, StrCab4 As String, _
    StrCab5 As String

' variable de comprobacion de error
Dim BlnOK As Boolean

'''***********************************************************
Private Mcon As ADODB.Connection

Private MobjVentaPlaya As DB_OP_FACTURACION.C_VENTASPLAYA
Private MobjDispensador As DB_UT_MANTENIMIENTOS.C_DISPENSADORES
Private MrsDispensador As ADODB.Recordset

Private Mrstranspend As ADODB.Recordset

Private MobjCierrez As DB_OP_FACTURACION.C_CIERRES

Private Sub CMD_ACEPTAR_Click()
On Error GoTo errhandler
'    Dim StrCierre As String
    Dim BlnOK As Boolean
    Dim DblMontoTipoCambio As Double
    Dim MobjTipoCambio As DB_OP_FACTURACION.C_VENTASGENERAL
    
    Dim StrDatEmpresa As String     ' datos de la empresa
    Dim StrDatCabecera As String    ' datos cabecera del cierre
    Dim StrResVenta As String       ' resumen de ventas
    Dim StrResTipoPago As String    ' resumene de tipo pago
    Dim StrResCategoria As String   ' resumen de producto
    Dim StrResProducto As String    ' resumen producto
    Dim StrResVendedor As String    ' resumen vendedor
    Dim StrResCara As String        ' resumen cara
    Dim StrSalto As String

    Set MobjCierrez = New DB_OP_FACTURACION.C_CIERRES
    Set MobjTipoCambio = New DB_OP_FACTURACION.C_VENTASGENERAL

    Limpiar_Variables
    
    DblMontoTipoCambio = MobjTipoCambio.ObtenerMontoTipodeCambio(GstrCodMonedaBase, GstrMonedaExtranjera, GDatFechaProcesoVentas, GstrTipoCambioVentas)

    Dim IntVerificacionTrans As Integer
    
    Set MobjCierrez = New DB_OP_FACTURACION.C_CIERRES
    
    Screen.MousePointer = vbHourglass

                                        '¸------> Lugar(2=Playa)
    'Call MobjCierrez.Cargar_Datos_Cierre(2, lblcaja.Caption, 0, GCUSERID, Str(GDatFechaProcesoVentas), 2)
                  'Turno Actual(en CierreZ no importa) <-----'           Tipo de Cierre (2=Zeta)<------'
                  
    'Call MobjCierrez.Cargar_Datos_Cierre(2, "PTOVTA01", 0, GCUSERID, "03/01/2003", 2, DblMontoTipoCambio)
                  
    Screen.MousePointer = vbHourglass
    
    IntVerificacionTrans = MobjCierrez.Ver_Transacciones_Pendientes(IntLugar, StrNroPtoVta)
    ''''''''''''
    If IntVerificacionTrans = 2 Then
        IntVerificacionTrans = Ver_Transacciones_Pendientes(MobjCierrez.Ver_Transacciones_Pendientes2(IntLugar, StrNroPtoVta))
    End If
    ''''''''''''''''
    'IntVerificacionTrans = 2
    Select Case IntVerificacionTrans
        Case 0: ' no puede realizarse cierre(ni pantalla , ni impresora)
                MsgBox "No se encuentra fuente de datos (*.dbf) para el Punto de Venta", vbInformation, "Error"
        Case 1: ' existen transacciones pendiente
        
                MsgBox "Existen transacciones pendientes, solo se imprimirŕ por pantalla", vbInformation, "Mensaje"
                
                ' 2 : por pantalla  <-------------------------------¸
                Call MobjCierrez.Imprimir_Cierre(IntTipoCierre, IntLugar, StrNroPtoVta, _
                    StrSalesPerID, StrFechaCierre, IntTurno, IntNroSaltosLineas, _
                    StrCodCorte, IntAnchoTicket, StrLineaSeparacion, StrSerieMaqReg, _
                    StrFecha, DblMontoTipoCambio, IntNroTransacciones, DblTicketBolIni, _
                    dblTicketFacIni, DblValorVta, DblVtaNoAfecta, DblIGV, DblVtaTotal, _
                    IntNroTicketAnul, DblTotalTicketAnul, DblGranTotal, IntNroZeta, _
                    DblTotalTicketBol, DblTotalTicketFac, DblTotalGral, _
                    DblEfectivo, DblVueltoEfectivo, DblNetoEfectivo, DblTarjeta, _
                    DblVueltoTarjeta, DblNetoTarjeta, DblVale, DblVueltoVale, _
                    DblNetoVale, StrMdaBase, StrMdaCaja, StrSimbMdaCaja, StrSimbMdaExt, _
                    StrCab1, StrCab2, StrCab3, StrCab4, StrCab5, BlnOK, GintDecResultado, GintDecStock, _
                    StrDatEmpresa, StrDatCabecera, StrResVenta, StrResTipoPago, StrResCategoria, StrResProducto, StrResVendedor, StrResCara, StrSalto, DblFondoCajaPEN, DblFondoCajaUSD)
                
                Open "temp.txt" For Output As #1
                    If Trim(StrDatEmpresa) = "" Then Print #1, StrDatEmpresa
                    If Trim(StrDatCabecera) = "" Then Print #1, StrDatCabecera
                    If Trim(StrResVenta) = "" Then Print #1, StrResVenta
                    If Trim(StrResTipoPago) = "" Then Print #1, StrResTipoPago
                    If Trim(StrResCategoria) = "" Then Print #1, StrResCategoria
                    If Trim(StrResProducto) = "" Then Print #1, StrResProducto
                    If Trim(StrResVendedor) = "" Then Print #1, StrResVendedor
                    If Trim(StrResCara) = "" Then Print #1, StrResCara
                    If Trim(StrSalto) = "" Then Print #1, StrSalto
                    'Print #1, StrCierre
                Close #1

                Shell "notepad.exe temp.txt", vbNormalFocus
                
                BlnOK = MobjCierrez.MensajeOK
                
                If BlnOK Then
                    MsgBox "Proceso de Cierre Z realizado", vbInformation, "Mensaje"
                Else
                    MsgBox "Proceso de Cierre Z fallido", vbInformation, "Mensaje"
                End If
        Case 2: ' no hay transacciones pendientes ==> OK !
            If optimpresora.Value = True Then
                ' 1 : por impresora  <------------------------------¸
                Call MobjCierrez.Imprimir_Cierre(IntTipoCierre, IntLugar, StrNroPtoVta, _
                    StrSalesPerID, StrFechaCierre, IntTurno, IntNroSaltosLineas, _
                    StrCodCorte, IntAnchoTicket, StrLineaSeparacion, StrSerieMaqReg, _
                    StrFecha, DblMontoTipoCambio, IntNroTransacciones, DblTicketBolIni, _
                    dblTicketFacIni, DblValorVta, DblVtaNoAfecta, DblIGV, DblVtaTotal, _
                    IntNroTicketAnul, DblTotalTicketAnul, DblGranTotal, IntNroZeta, _
                    DblTotalTicketBol, DblTotalTicketFac, DblTotalGral, _
                    DblEfectivo, DblVueltoEfectivo, DblNetoEfectivo, DblTarjeta, _
                    DblVueltoTarjeta, DblNetoTarjeta, DblVale, DblVueltoVale, _
                    DblNetoVale, StrMdaBase, StrMdaCaja, StrSimbMdaCaja, StrSimbMdaExt, _
                    StrCab1, StrCab2, StrCab3, StrCab4, StrCab5, BlnOK, GintDecResultado, GintDecStock, _
                    StrDatEmpresa, StrDatCabecera, StrResVenta, StrResTipoPago, StrResCategoria, StrResProducto, StrResVendedor, StrResCara, StrSalto, DblFondoCajaPEN, DblFondoCajaUSD)
        
                'Printer.Print StrCierre
                If Trim(StrDatEmpresa) <> "" Then Printer.Print StrDatEmpresa
                If Trim(StrDatCabecera) <> "" Then Printer.Print StrDatCabecera
                If Trim(StrResVenta) <> "" Then Printer.Print StrResVenta
                If Trim(StrResTipoPago) <> "" Then Printer.Print StrResTipoPago
                If Trim(StrResCategoria) <> "" Then Printer.Print StrResCategoria
                If Trim(StrResProducto) <> "" Then Printer.Print StrResProducto
                If Trim(StrResVendedor) <> "" Then Printer.Print StrResVendedor
                If Trim(StrResCara) <> "" Then Printer.Print StrResCara
                If Trim(StrSalto) <> "" Then Printer.Print StrSalto
                                
                ' actualiza el campo STKCLOSEDX=1 si no hubo fallas
                
                
                
                BlnOK = MobjCierrez.MensajeOK
                
                If BlnOK Then
                    Call MobjCierrez.Actualizar_Datos_LuegodeCierreZ(StrNroPtoVta, StrFechaCierre, _
                                                                    DblGranTotal, IntNroZeta)
                    
                    Printer.EndDoc
                    MsgBox "Proceso de Cierre Z realizado", vbInformation, "Mensaje"
                Else
                    MsgBox "Proceso de Cierre Z fallido", vbInformation, "Mensaje"
                End If
                
                End
            Else
                ' 2 : por pantalla  <-------------------------------¸
                Call MobjCierrez.Imprimir_Cierre(IntTipoCierre, IntLugar, StrNroPtoVta, _
                    StrSalesPerID, StrFechaCierre, IntTurno, IntNroSaltosLineas, _
                    StrCodCorte, IntAnchoTicket, StrLineaSeparacion, StrSerieMaqReg, _
                    StrFecha, DblMontoTipoCambio, IntNroTransacciones, DblTicketBolIni, _
                    dblTicketFacIni, DblValorVta, DblVtaNoAfecta, DblIGV, DblVtaTotal, _
                    IntNroTicketAnul, DblTotalTicketAnul, DblGranTotal, IntNroZeta, _
                    DblTotalTicketBol, DblTotalTicketFac, DblTotalGral, _
                    DblEfectivo, DblVueltoEfectivo, DblNetoEfectivo, DblTarjeta, _
                    DblVueltoTarjeta, DblNetoTarjeta, DblVale, DblVueltoVale, _
                    DblNetoVale, StrMdaBase, StrMdaCaja, StrSimbMdaCaja, StrSimbMdaExt, _
                    StrCab1, StrCab2, StrCab3, StrCab4, StrCab5, BlnOK, GintDecResultado, GintDecStock, _
                    StrDatEmpresa, StrDatCabecera, StrResVenta, StrResTipoPago, StrResCategoria, StrResProducto, StrResVendedor, StrResCara, StrSalto, DblFondoCajaPEN, DblFondoCajaUSD)
                
                Open "temp.txt" For Output As #1
                    If Trim(StrDatEmpresa) <> "" Then Print #1, StrDatEmpresa
                    If Trim(StrDatCabecera) <> "" Then Print #1, StrDatCabecera
                    If Trim(StrResVenta) <> "" Then Print #1, StrResVenta
                    If Trim(StrResTipoPago) <> "" Then Print #1, StrResTipoPago
                    If Trim(StrResCategoria) <> "" Then Print #1, StrResCategoria
                    If Trim(StrResProducto) <> "" Then Print #1, StrResProducto
                    If Trim(StrResVendedor) <> "" Then Print #1, StrResVendedor
                    If Trim(StrResCara) <> "" Then Print #1, StrResCara
                    If Trim(StrSalto) <> "" Then Print #1, StrSalto
                    'Print #1, StrCierre
                Close #1
                
                Shell "notepad.exe temp.txt", vbNormalFocus
                
                BlnOK = MobjCierrez.MensajeOK
                
                If BlnOK Then
                    MsgBox "Proceso de Cierre Z realizado", vbInformation, "Mensaje"
                Else
                    MsgBox "Proceso de Cierre Z fallido", vbInformation, "Mensaje"
                End If
            End If
        Case 3:
            ' otros errores
    End Select
    
    Screen.MousePointer = vbDefault
    
    Exit Sub
errhandler:
    Screen.MousePointer = vbDefault
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Error"
End Sub

Private Sub CMD_CANCELAR_Click()
 Unload Me
End Sub

Private Sub Form_Load()
  
  Me.Left = (Screen.Width - Me.Width) / 2
  Me.Top = (Screen.Height - Me.Height) / 2
  
  Set Mrstranspend = New ADODB.Recordset
  Set MobjVentaPlaya = New DB_OP_FACTURACION.C_VENTASPLAYA
  Set MobjDispensador = New DB_UT_MANTENIMIENTOS.C_DISPENSADORES
  Set Mcon = New ADODB.Connection
   
  Mcon.Provider = "MSDASQL"
  'Mcon.ConnectionString = "Driver={Microsoft Visual FoxPro Driver (*.dbf)};UID=;SourceDB=" & GstrRutaTran & ";SourceType=DBF;Exclusive=No;BackgroundFetch=Sí;Collate=Machine;Null=Sí;Deleted=Sí;"
  'Mcon.ConnectionString = "Data Source=c:\gasboy"
  Mcon.ConnectionString = "FILEDSN=GASBOY"
  Mcon.Open

  Me.Caption = "Cierre Z                                                Fecha Proceso [" & GDatFechaProcesoVentas & "]"
  lblfechaactual.Caption = Date & " " & Time
  lblcaja.Caption = GstrPuntodeVenta
 
End Sub

Private Sub Form_Unload(Cancel As Integer)
  
  Set MobjVentaPlaya = Nothing
  Set MobjDispensador = Nothing
  
End Sub

Private Sub Timer1_Timer()
  lblfechaactual.Caption = Date & " " & Time
End Sub

Private Function Ver_Transacciones_Pendientes(rsTrans As Recordset) As Integer
 
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
On Error GoTo errhandler

'        Set rs = New ADODB.Recordset
        
        Ver_Transacciones_Pendientes = 2 ' se asume inicialmente todo bien
        
        If Not rsTrans.EOF Then
            While Not rsTrans.EOF
                StrSql = "Select estado from tran" & rsTrans!side & " where estado<>'CANCEL'"
                
                Set rs = New ADODB.Recordset
                
                rs.Open StrSql, Mcon, adOpenStatic
                
                ' si hay alguna transaccion pendiente
                If Not rs.EOF Then
                    If Not IsNull(rs!ESTADO) Then
        '                MsgBox "Existen transacciones pendientes", vbInformation, "Error"
                        Ver_Transacciones_Pendientes = 1
                        Exit Function
                    End If
                End If
                
                Set rs = Nothing
                
                rsTrans.MoveNext
            Wend
        Else
            Ver_Transacciones_Pendientes = 0
        End If
        
        Exit Function
    
errhandler:
    Ver_Transacciones_Pendientes = 3
    MsgBox "Error - " & Err.Description, vbCritical, "Error"
End Function

Sub Limpiar_Variables()

    IntTipoCierre = 2 ' cierre z
    
    ' VARIABLE PARA SABER SI ES TIENDA O PLAYA
    ' 1 : Tienda
    ' 2 : Playa
    IntLugar = 2 ' Playa
    
'    2, lblcaja.Caption, Val(lblTurno.Caption), GCUSERID, Str(GDatFechaProcesoVentas), 1
    
    StrNroPtoVta = lblcaja.Caption
    StrSalesPerID = GCUSERID
    StrFechaCierre = Str(GDatFechaProcesoVentas)
    IntTurno = 0 ' en Cierre Z el valor de IntTurno no importa
    'DblTipoCambio = DblTipoCambioActual
    BlnOK = True ' inicialmente todo bien
    
    ' VARIABLES DE PUNTO DE VENTA,VENDEDOR y FECHA DE CIERRE (FECHA DE PROCESO)
    'StrNroPtoVta = ""
    'StrSalesPerID = ""
    'StrFechaCierre = ""
    'IntTurno = 0
    
    ' DATOS DE IMPRESORA
    IntNroSaltosLineas = 0
    StrCodCorte = ""
    IntAnchoTicket = 0
    
    ' LINEA DE SEPARACION
    StrLineaSeparacion = ""
    
    ' variables de cabecera de cierre
    StrSerieMaqReg = ""
    StrFecha = ""
    DblTipoCambio = 0
    IntNroTransacciones = 0
    DblTicketBolIni = 0
    dblTicketFacIni = 0
    DblValorVta = 0
    DblVtaNoAfecta = 0
    DblIGV = 0
    DblVtaTotal = 0
    IntNroTicketAnul = 0
    DblTotalTicketAnul = 0
    DblGranTotal = 0
    IntNroZeta = 0
    'dim IntTurno As Integer
   
    DblFondoCajaPEN = 0
    DblFondoCajaUSD = 0
    
    ' variables de resumen de ventas
    DblTotalTicketBol = 0
    DblTotalTicketFac = 0
    DblTotalGral = 0
    
    ' variables de resumen de tipos de pago
    DblEfectivo = 0
    DblVueltoEfectivo = 0
    DblNetoEfectivo = 0
    
    DblTarjeta = 0
    DblVueltoTarjeta = 0
    DblNetoTarjeta = 0
    
    DblVale = 0
    DblVueltoVale = 0
    DblNetoVale = 0
    
    ' variables para monedas
    StrMdaBase = ""
    StrMdaCaja = ""
    StrSimbMdaCaja = ""
    StrSimbMdaExt = ""
    
    ' cabeceras de ticket
    StrCab1 = ""
    StrCab2 = ""
    StrCab3 = ""
    StrCab4 = ""
    StrCab5 = ""
    
    ' variable de comprobacion de error
    'BlnOK =
End Sub

