VERSION 5.00
Object = "{90F3D7B3-92E7-44BA-B444-6A8E2A3BC375}#1.0#0"; "actskin4.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FCierreZ_Tienda 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Cierre Z"
   ClientHeight    =   5145
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4710
   Icon            =   "FCierreZ_Tienda.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5145
   ScaleWidth      =   4710
   StartUpPosition =   3  'Windows Default
   Begin VB.PictureBox Picture3 
      Height          =   1335
      Left            =   148
      ScaleHeight     =   1275
      ScaleWidth      =   4275
      TabIndex        =   16
      Top             =   3435
      Width           =   4335
      Begin MSComCtl2.Animation Animation1 
         Height          =   615
         Left            =   510
         TabIndex        =   17
         Top             =   150
         Width           =   3045
         _ExtentX        =   5371
         _ExtentY        =   1085
         _Version        =   393216
         FullWidth       =   203
         FullHeight      =   41
      End
      Begin VB.Label lblMensaje 
         Caption         =   "Generando Cierre Z ..."
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1020
         TabIndex        =   18
         Top             =   810
         Width           =   1995
      End
      Begin VB.Image Image1 
         Height          =   660
         Left            =   -120
         Picture         =   "FCierreZ_Tienda.frx":030A
         Stretch         =   -1  'True
         Top             =   120
         Visible         =   0   'False
         Width           =   555
      End
      Begin VB.Image Image3 
         Height          =   480
         Left            =   3720
         Picture         =   "FCierreZ_Tienda.frx":0BD4
         Top             =   90
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.Image Image2 
         Height          =   480
         Left            =   3720
         Picture         =   "FCierreZ_Tienda.frx":0EDE
         Top             =   150
         Visible         =   0   'False
         Width           =   480
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1605
      Left            =   148
      TabIndex        =   5
      Top             =   128
      Width           =   4320
      Begin VB.PictureBox Picture1 
         Height          =   345
         Left            =   2040
         ScaleHeight     =   285
         ScaleWidth      =   1815
         TabIndex        =   8
         Top             =   360
         Width           =   1875
         Begin ACTIVESKINLibCtl.SkinLabel lblcaja 
            Height          =   345
            Left            =   0
            OleObjectBlob   =   "FCierreZ_Tienda.frx":11E8
            TabIndex        =   9
            Top             =   0
            Width           =   1875
         End
      End
      Begin VB.PictureBox Picture2 
         Height          =   345
         Left            =   2040
         ScaleHeight     =   285
         ScaleWidth      =   1815
         TabIndex        =   6
         Top             =   960
         Width           =   1875
         Begin ACTIVESKINLibCtl.SkinLabel lblfecha 
            Height          =   375
            Left            =   0
            OleObjectBlob   =   "FCierreZ_Tienda.frx":1262
            TabIndex        =   7
            Top             =   0
            Width           =   1875
         End
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel4 
         Height          =   255
         Left            =   360
         OleObjectBlob   =   "FCierreZ_Tienda.frx":12DC
         TabIndex        =   10
         Top             =   1005
         Width           =   855
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel3 
         Height          =   255
         Left            =   360
         OleObjectBlob   =   "FCierreZ_Tienda.frx":1344
         TabIndex        =   11
         Top             =   405
         Width           =   615
      End
      Begin VB.Label lblfecha_1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   1590
         TabIndex        =   15
         Top             =   2190
         Visible         =   0   'False
         Width           =   1590
      End
      Begin VB.Label lblcaja_1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   345
         Left            =   1590
         TabIndex        =   14
         Top             =   1680
         Visible         =   0   'False
         Width           =   1875
      End
      Begin VB.Label Label3 
         Caption         =   "CAJA"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   510
         TabIndex        =   13
         Top             =   1710
         Visible         =   0   'False
         Width           =   1065
      End
      Begin VB.Label Label1 
         Caption         =   "FECHA"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   480
         TabIndex        =   12
         Top             =   2250
         Visible         =   0   'False
         Width           =   825
      End
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "&Aceptar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   525
      Left            =   2998
      Picture         =   "FCierreZ_Tienda.frx":13AA
      TabIndex        =   4
      TabStop         =   0   'False
      Top             =   1898
      Width           =   1485
   End
   Begin VB.Frame fraDestino 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      Caption         =   "Destino"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1305
      Left            =   148
      TabIndex        =   1
      Top             =   1778
      Width           =   2415
      Begin VB.OptionButton optPantalla 
         Caption         =   "Pantalla"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   330
         TabIndex        =   3
         Top             =   360
         Value           =   -1  'True
         Width           =   1455
      End
      Begin VB.OptionButton optImpresora 
         Caption         =   "Impresora"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   330
         TabIndex        =   2
         Top             =   760
         Width           =   1665
      End
   End
   Begin VB.CommandButton cmdCancelar 
      Caption         =   "&Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   525
      Left            =   2998
      Picture         =   "FCierreZ_Tienda.frx":16B4
      TabIndex        =   0
      TabStop         =   0   'False
      Top             =   2558
      Width           =   1485
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   2468
      Top             =   2272
   End
   Begin ACTIVESKINLibCtl.Skin sknCierreZ 
      Left            =   2828
      OleObjectBlob   =   "FCierreZ_Tienda.frx":19BE
      Top             =   2152
   End
   Begin VB.Shape Shape1 
      Height          =   1605
      Left            =   195
      Top             =   135
      Width           =   4155
   End
   Begin VB.Image Image4 
      Height          =   480
      Left            =   2708
      Picture         =   "FCierreZ_Tienda.frx":1BF2
      Top             =   2632
      Width           =   480
   End
End
Attribute VB_Name = "FCierreZ_Tienda"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim RS1 As ADODB.Recordset
Dim RS2 As ADODB.Recordset
Dim RS3 As ADODB.Recordset
Dim RS4 As ADODB.Recordset
Dim RS5 As ADODB.Recordset

Dim obj As DB_OP_FACTURACION.C_CIERRE
Private MobjVentaPlaya As DB_OP_FACTURACION.C_VENTASPLAYA
Private MobjSetup As UTIL_SETUP.C_SETUP

Private Sub cmdAceptar_Click()
On Error GoTo TrataError

Screen.MousePointer = 11

Me.Height = 5520 '4680
If optPantalla.Value = True Then
    Image1.Visible = True
    Image2.Visible = True
Else
    Image1.Visible = True
    Image3.Visible = True
End If

Animation1.Open "c:\sies\ventas\reportes\" & "Proceso.avi"
Animation1.Visible = True
Animation1.Play

Image1.Refresh
Image2.Refresh
Image3.Refresh
lblMensaje.Refresh

'**************************************
Set RS1 = obj.OBTIENERESUMEN_TIENDA_CIERREZ(CDate(lblfecha.Caption), lblcaja.Caption, 1)
Set RS2 = obj.OBTIENERESUMEN_TIENDA_CIERREZ(CDate(lblfecha.Caption), lblcaja.Caption, 2)
Set RS3 = obj.OBTIENERESUMEN_TIENDA_CIERREZ(CDate(lblfecha.Caption), lblcaja.Caption, 3)

Set RS5 = obj.OBTIENECABECERA_TIENDA_CIERREZ(CDate(lblfecha.Caption), lblcaja.Caption)

If optPantalla.Value = True Then
    Call GVerCierre(1, 1, Empty, GstrSimboloMonedaBase, GstrSimboloMonedaExt, 40, GintDecResultado, RS5, RS1, RS2, RS3)
    MDestruye_Objetos
    Screen.MousePointer = 0
    Me.Hide
    MsgBox "Cierre Z generado con éxito", vbInformation, "Cierre Z"
    Unload Me
Else
    Call GImprimeCierre(1, 1, Empty, GstrSimboloMonedaBase, GstrSimboloMonedaExt, 40, GintDecResultado, RS5, RS1, RS2, RS3)
    Call obj.Actualizar_Datos_LuegodeCierreZ(lblcaja.Caption, CDate(lblfecha.Caption), RS5!TOTZETA, RS5!NBRZETA)
    MDestruye_Objetos
    Screen.MousePointer = 0
    Me.Hide
    MsgBox "Cierre Z generado con éxito", vbInformation, "Cierre Z"
    End
End If
'***************************************
'MDestruye_Objetos

'Screen.MousePointer = 0

'    Me.Hide
'    MsgBox "Cierre Z generado con éxito", vbInformation, "Cierre Z"
'    Unload Me

Exit Sub
TrataError:
    Screen.MousePointer = 0
    MDestruye_Objetos
    Me.Hide
    MsgBox Err.Description, vbCritical, "Error Generando Cierre Z"
    Unload Me
End Sub

Private Sub cmdCancelar_Click()
Unload Me
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Unload Me
End If
End Sub

Private Sub Form_Load()
sknCierreZ.LoadSkin (App.Path & "\Skins\B-Studio.skn")
sknCierreZ.ApplySkin (Me.hWnd)

    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
    Me.Height = 3915
    
    KeyPreview = True
    
    Set MobjVentaPlaya = New DB_OP_FACTURACION.C_VENTASPLAYA
    Set obj = New DB_OP_FACTURACION.C_CIERRE
    Set MobjSetup = New UTIL_SETUP.C_SETUP
    lblcaja.Caption = GstrPuntodeVenta
    
    'lblfecha.Caption = Format(GDatFechaProcesoVentas, "DD/MM/YYYY")
    lblfecha.Caption = Format(MobjSetup.ObtenerSetupVentas!DATEPROCESALES, "DD/MM/YYYY")
    
End Sub

Private Sub MDestruye_Objetos()
Set RS1 = Nothing
Set RS2 = Nothing
Set RS3 = Nothing
Set RS4 = Nothing
Set RS5 = Nothing
Set obj = Nothing

Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Animation1.AutoPlay = False
Animation1.Stop
Animation1.Visible = False
Me.Height = 3645

End Sub

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