VERSION 5.00
Begin VB.Form frmPaySpecific 
   Caption         =   "Payout by denomination"
   ClientHeight    =   1425
   ClientLeft      =   13395
   ClientTop       =   5370
   ClientWidth     =   2775
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   12
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   1425
   ScaleWidth      =   2775
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox txt 
      Alignment       =   1  'Right Justify
      Height          =   390
      Index           =   0
      Left            =   1860
      TabIndex        =   1
      Text            =   "15"
      Top             =   180
      Width           =   645
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "OK"
      Height          =   360
      Left            =   615
      TabIndex        =   0
      Top             =   840
      Width           =   1530
   End
   Begin VB.Label lblDenom 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Denom"
      Height          =   270
      Index           =   0
      Left            =   270
      TabIndex        =   2
      Top             =   240
      Width           =   1365
   End
End
Attribute VB_Name = "frmPaySpecific"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public NotPay As Boolean

Public Sub ShowPay()
    Dim i As Integer
    Dim cnt As Integer
    
    cnt = 0
    For i = LBCCC To UBCCC
        If cnt > 0 Then
            Load lblDenom(cnt)
            lblDenom(cnt).top = lblDenom(0).top + (510 * cnt)
            lblDenom(cnt).Visible = True
            Load txt(cnt)
            txt(cnt).top = txt(0).top + (510 * cnt)
            txt(cnt).Visible = True
        End If
        lblDenom(cnt).Caption = Format$(CCur(CCC(i).Valor) / 100, "standard")
        If NotPay Then
            txt(cnt).text = CCC(i).current
        Else
            txt(cnt).text = 0
        End If
        cnt = cnt + 1
    Next i
    For i = LBCCN To UBCCN
        If cnt > 0 Then
            Load lblDenom(cnt)
            lblDenom(cnt).top = lblDenom(0).top + (510 * cnt)
            lblDenom(cnt).Visible = True
            Load txt(cnt)
            txt(cnt).top = txt(0).top + (510 * cnt)
            txt(cnt).Visible = True
        End If
        lblDenom(cnt).Caption = Format$(CCur(CCN(i).Valor) / 100, "standard")
        If NotPay Then
            txt(cnt).text = CCN(i).current
        Else
            txt(cnt).text = 0
        End If
        cnt = cnt + 1
    Next i
    cmdAceptar.top = lblDenom(0).top + (510 * cnt)
    cmdAceptar.TabIndex = 50
    Me.Height = 1050 + cmdAceptar.top
    CentraForm Me
End Sub

Private Sub cmdAceptar_Click()
    Dim i As Integer
    Dim cnt As Integer
    Dim denoms As String
    Dim values As String
    
    cnt = 0
    For i = LBCCC To UBCCC
        If CInt(txt(cnt).text) > 0 Then
            If Len(denoms) > 0 Then
                denoms = denoms & ","
                values = values & ","
            End If
            denoms = denoms & CCC(i).Valor
            values = values & txt(cnt).text
        End If
        cnt = cnt + 1
    Next i
    For i = LBCCN To UBCCN
        If CInt(txt(cnt).text) > 0 Then
            If Len(denoms) > 0 Then
                denoms = denoms & ","
                values = values & ","
            End If
            denoms = denoms & CCN(i).Valor
            values = values & txt(cnt).text
        End If
        cnt = cnt + 1
    Next i
    If NotPay Then
        If Not CK.EmptyDeviceSpecific(denoms, values) Then
            MsgBox "error EmptyDeviceSpecific"
        End If
    Else
        If Not CK.PaySpecific(denoms, values) Then
            MsgBox "error PaySpecific"
        End If
    End If
    Unload Me
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn And ((Shift And 6) = 0) Then
        MySendKeys "{TAB}"
    ElseIf KeyCode = vbKeyEscape And (Shift = 0) Then
        Unload Me
    End If
End Sub

Private Sub txt_GotFocus(Index As Integer)
    txt(Index).SelStart = 0
    txt(Index).SelLength = Len(txt(Index).text)
End Sub

Private Sub txt_LostFocus(Index As Integer)
    If Not IsNumeric(txt(Index).text) Then
        txt(Index).text = 0
    Else
        txt(Index).text = val(txt(Index).text) \ 1
    End If
End Sub

Private Sub txt_Validate(Index As Integer, Cancel As Boolean)
    If Not IsNumeric(Replace(txt(Index).text, ".", ",")) Then
        Cancel = True
    End If
End Sub

