VERSION 5.00 Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "Crystl32.OCX" Object = "{8DDE6232-1BB0-11D0-81C3-0080C7A2EF7D}#3.0#0"; "Flp32a30.ocx" Begin VB.Form frmPosPayC Caption = "Casa Rica PosPay Info" ClientHeight = 4425 ClientLeft = 60 ClientTop = 345 ClientWidth = 8955 KeyPreview = -1 'True LinkTopic = "Form1" ScaleHeight = 4425 ScaleWidth = 8955 StartUpPosition = 3 'Windows Default Begin VB.TextBox txtNAME Height = 315 Left = 6765 TabIndex = 22 Top = 2550 Width = 2130 End Begin VB.CommandButton cmdDelete Caption = "Delete" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 6270 TabIndex = 21 Top = 3420 Width = 1275 End Begin VB.CommandButton cmdAdd Caption = "Add" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 7620 TabIndex = 20 Top = 2925 Width = 1275 End Begin VB.TextBox txtInvDate Enabled = 0 'False Height = 315 Left = 7695 MaxLength = 10 TabIndex = 1 Top = 45 Width = 1200 End Begin VB.TextBox txtUser Enabled = 0 'False Height = 315 Left = 7695 TabIndex = 18 Top = 2175 Width = 1200 End Begin VB.TextBox txtSeq Alignment = 2 'Center Enabled = 0 'False Height = 315 Left = 7695 TabIndex = 17 Top = 1815 Width = 1200 End Begin VB.TextBox txtSubDt Enabled = 0 'False Height = 315 Left = 7695 TabIndex = 16 Top = 1470 Width = 1200 End Begin VB.TextBox txtSearch Height = 315 Left = 3015 TabIndex = 12 Top = 150 Width = 1200 End Begin VB.CommandButton cmdPrint Caption = "Print List For 1 Seq #" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 6270 TabIndex = 11 Top = 2925 Width = 1275 End Begin LpLib.fpList lstHeader Height = 3675 Left = 180 TabIndex = 10 Top = 585 Width = 5985 _Version = 196608 _ExtentX = 10557 _ExtentY = 6482 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Enabled = -1 'True MousePointer = 0 Object.TabStop = 0 'False BackColor = -2147483643 ForeColor = -2147483640 Columns = 7 Sorted = 1 LineWidth = 1 SelDrawFocusRect= -1 'True ColumnSeparatorChar= 9 ColumnSearch = 1 ColumnWidthScale= 2 RowHeight = -1 MultiSelect = 0 WrapList = 0 'False WrapWidth = 0 SelMax = -1 AutoSearch = 2 SearchMethod = 0 VirtualMode = 0 'False VRowCount = 0 DataSync = 3 ThreeDInsideStyle= 1 ThreeDInsideHighlightColor= -2147483633 ThreeDInsideShadowColor= -2147483627 ThreeDInsideWidth= 1 ThreeDOutsideStyle= 1 ThreeDOutsideHighlightColor= -2147483628 ThreeDOutsideShadowColor= -2147483632 ThreeDOutsideWidth= 1 ThreeDFrameWidth= 0 BorderStyle = 0 BorderColor = -2147483642 BorderWidth = 1 ThreeDOnFocusInvert= 0 'False ThreeDFrameColor= -2147483633 Appearance = 2 BorderDropShadow= 0 BorderDropShadowColor= -2147483632 BorderDropShadowWidth= 3 ScrollHScale = 2 ScrollHInc = 0 ColsFrozen = 0 ScrollBarV = 1 NoIntegralHeight= 0 'False HighestPrecedence= 0 AllowColResize = 0 AllowColDragDrop= 0 ReadOnly = 0 'False VScrollSpecial = 0 'False VScrollSpecialType= 0 EnableKeyEvents = -1 'True EnableTopChangeEvent= -1 'True DataAutoHeadings= -1 'True DataAutoSizeCols= 2 SearchIgnoreCase= -1 'True ScrollBarH = 1 VirtualPageSize = 0 VirtualPagesAhead= 0 ExtendCol = 0 ColumnLevels = 1 ListGrayAreaColor= -2147483637 GroupHeaderHeight= -1 GroupHeaderShow = 0 'False AllowGrpResize = 0 AllowGrpDragDrop= 0 MergeAdjustView = 0 'False ColumnHeaderShow= -1 'True ColumnHeaderHeight= 300 GrpsFrozen = 0 BorderGrayAreaColor= -2147483637 ExtendRow = 0 DataField = "" OLEDragMode = 0 OLEDropMode = 0 EnableClickEvent= -1 'True Redraw = -1 'True ResizeRowToFont = 0 'False TextTipMultiLine= 0 ColDesigner = "frmPosPayC.frx":0000 End Begin Crystal.CrystalReport crAR Left = 165 Top = 60 _ExtentX = 741 _ExtentY = 741 _Version = 348160 WindowControlBox= -1 'True WindowMaxButton = -1 'True WindowMinButton = -1 'True WindowState = 2 PrintFileLinesPerPage= 60 End Begin VB.CommandButton cmdExit Caption = "E&xit" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 7620 TabIndex = 9 Top = 3930 Width = 1275 End Begin VB.CommandButton cmdSave Caption = "Save" Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 7620 TabIndex = 4 Top = 3420 Width = 1275 End Begin VB.TextBox txtItemAmt Alignment = 2 'Center Enabled = 0 'False Height = 315 Left = 7695 MaxLength = 10 TabIndex = 5 Top = 1110 Width = 1200 End Begin VB.TextBox txtSalesCode Alignment = 1 'Right Justify Enabled = 0 'False Height = 315 Left = 7695 MaxLength = 13 TabIndex = 3 Top = 765 Width = 1200 End Begin VB.TextBox txtDueDate Enabled = 0 'False Height = 315 Left = 7695 MaxLength = 10 TabIndex = 2 Top = 405 Width = 1200 End Begin VB.Label lblName Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Name:" Height = 195 Left = 6270 TabIndex = 23 Top = 2610 Width = 465 End Begin VB.Label lblInvDate Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Check Number: " Height = 195 Left = 6420 TabIndex = 19 Top = 120 Width = 1155 End Begin VB.Label lblUser Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "User:" Height = 195 Left = 7200 TabIndex = 15 Top = 2235 Width = 375 End Begin VB.Label lblSubDt AutoSize = -1 'True Caption = "Date Submitted:" Height = 195 Left = 6435 TabIndex = 14 Top = 1530 Width = 1140 End Begin VB.Label lblSeq Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Sequence #:" Height = 195 Left = 6645 TabIndex = 13 Top = 1875 Width = 930 End Begin VB.Label lblSalesCode Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Check Amount: " Height = 195 Left = 6435 TabIndex = 8 Top = 825 Width = 1140 End Begin VB.Label lblItemAmt Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "CMS Bank #" Height = 195 Left = 6660 TabIndex = 7 Top = 1170 Width = 915 End Begin VB.Label lblDueDate Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Check Date: " Height = 195 Left = 6630 TabIndex = 6 Top = 465 Width = 945 End Begin VB.Label lblARCode Alignment = 1 'Right Justify AutoSize = -1 'True Caption = "Enter Check Number To Search:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 150 TabIndex = 0 Top = 180 Width = 2775 End End Attribute VB_Name = "frmPosPayC" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim moRSHeader As Recordset Dim moRSProj As Recordset Dim mboolSHOW As Boolean, mboolUPDATE As Boolean, mstrType As String Dim mstrINVNO As String, mstrPROJLOT As String Dim mlngINVID As Long, mintBOOKMARK As Integer, mintBOOK As Integer Dim msglItemAmt As Single, msglInvTotal As Single Private Sub HeaderLoad() Dim oRS As Recordset Dim strSQL As String, strVend As String 'Dim strTYPE As String Dim strLine As String On Error GoTo Error_EH ' strTYPE = Trim(Left(cboARCode, 7)) ' strSQL = "SELECT Invoice_date, Invoice_no, lot_id, trans_id, header, shipped, customer_no, non_tax_amt from tblARInvoice WHERE shipped and header and customer_no = '" & Trim(Left(cboARCode, 7)) & "' and not done" ' If cboAPCode.ListIndex = -1 Then strSQL = "SELECT * FROM tblPosPayCRD ORDER BY CKDate Desc " 'WHERE vendornumber = '" & strVend & "'" ' and not done" ' Else ' cboAPCode.col = 1 ' strVend = cboAPCode.ColText ' strSQL = "SELECT * FROM APH_JobDistDetail ORDER BY VendorNumber and InvoiceNumber" 'WHERE shipped and header and customer_no = '" & strVend & "' and not done" ' strSQL = "SELECT * FROM APH_JobDistDetail WHERE vendornumber = '" & strVend & "'" ' and not done" ' End If Set oRS = New Recordset oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly lstHeader.Clear ' strTYPE = oRS.RecordCount Do Until oRS.EOF With lstHeader strLine = Field2Str2(oRS!PPID) & vbTab & Field2Str(oRS!CKNumber) & vbTab & " " & Trim(Field2Str(oRS!Name)) & vbTab & Format(Field2Str(oRS!CKDate), "MM/DD/YYYY") & vbTab strLine = strLine & Format(Field2Str(oRS!CKAmt), "#,#.00") & vbTab & Field2Str(oRS!Acct) & vbTab & Field2Str(oRS!sequence) ' strLine = strLine & Format(Field2Str2(oRS!distributionamount), "Currency") ' & " " & Format(Field2Str2(oRS!Lot_id), "000000") .AddItem strLine ' .ItemData(.NewIndex) = oRS!Trans_ID ' .ItemData(.NewIndex) = oRS!Lot_id End With oRS.MoveNext Loop oRS.Close If lstHeader.ListCount Then lstHeader.ListIndex = 0 Else gintLOTID = 0 lstHeader.ListIndex = -1 ' cmdPrint.Enabled = False End If Exit Sub Error_EH: gstrMODULE = "Form PosPayS - Module HeaderLoad" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdPrint_Click() Dim oRS As Recordset, strSQL As String, strSELECT As String, strCUST As String On Error GoTo Error_EH gintCOPY = 1 ' strSQL = "SELECT * FROM APH_JobDistDetail WHERE VendorNumber = '" & strCUST & "'" ' Set oRS = New Recordset ' oRS.Open strSQL, goConn, adOpenForwardOnly, adLockReadOnly ' strSELECT = "{APH_JobDistDetail.VendorNumber}= '" & strCUST & "' and {APH_JobDistDetail.JobNumber} = ''" ' strSELECT = "{tblARInvoice.invoice_no}='" & mstrINV & "'" crAR.ReportFileName = App.Path & "\PosPayNEWCR.rpt" ' crAR.ReplaceSelectionFormula (strSELECT) ' crAR.CopiesToPrinter = gintCOPY crAR.CopiesToPrinter = 1 crAR.Destination = crptToWindow ' crar.Destination = crptToPrinter crAR.Action = 1 Exit Sub Error_EH: gstrMODULE = "Form PosPayS - Module Print" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{TAB}" KeyAscii = 0 End If End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If Shift = 4 Then Exit Sub End If If Not cmdSave.Enabled Then ' Call DataHasChanged End If End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim intResponse As Integer, strMSG As String On Error GoTo Error_EH If cmdSave.Enabled Then strMSG = "Data Has Been Changed" strMSG = strMSG & Chr(13) & Chr(10) strMSG = strMSG & "Save Changes ?" intResponse = MsgBox(strMSG, vbQuestion + vbYesNoCancel, Me.Caption) Select Case intResponse Case vbYes Call FormSave Case vbNo Case vbCancel Cancel = True Exit Sub End Select End If If moRSProj.State = adStateOpen Then moRSProj.Close End If If moRSHeader.State = adStateOpen Then moRSHeader.Close End If Exit Sub Error_EH: If Err.Number = 91 Then Resume Next End If gstrMODULE = "Form PosPayS - Module Form QueryUnload" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdSave_Click() mintBOOK = lstHeader.ListIndex cmdExit.Enabled = True cmdSave.Enabled = False cmdDelete.Enabled = False Call FormSave lstHeader.ListIndex = mintBOOK cmdDelete.Enabled = False cmdADD.Enabled = True cmdSave.Enabled = False lstHeader.Enabled = True End Sub Private Sub Form_Load() Call HeaderLoad End Sub Private Sub FormShow() On Error GoTo Error_EH mboolSHOW = True ' With moRSDetail txtInvDate = Field2Str(moRSHeader!CKNumber) txtDueDate = Field2Str(moRSHeader!CKDate) txtSalesCode = Format(Field2Str2(moRSHeader!CKAmt), "#,#,#.00") txtItemAmt = Field2Str(moRSHeader!Acct) txtSubDt = Field2Str(moRSHeader!SubDate) txtSeq = Field2Str(moRSHeader!sequence) txtUser = Field2Str(moRSHeader!User) txtName = Field2Str(moRSHeader!Name) ' End With mboolSHOW = False Exit Sub Error_EH: gstrMODULE = "Form PosPayV - Module FormShow" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub cmdAdd_Click() ' mboolbookmark = lstEmpList.ListIndex txtInvDate.Enabled = True txtDueDate.Enabled = True txtSalesCode.Enabled = True lstHeader.Enabled = False cmdADD.Enabled = False cmdDelete.Enabled = False cmdSave.Enabled = True Call FormClear ' txtDept.SetFocus ' lstEmpList.ListIndex = mintBOOKMARK End Sub Private Sub cmdDelete_Click() Dim strYN As String, lngBOOKMARK As Long If moRSHeader!Submit Then MsgBox "You Cannot Delete A Check That Has Been Submitted", vbOKOnly, "Delete Not Allowed" cmdDelete.Enabled = False cmdADD.Enabled = True cmdSave.Enabled = False Exit Sub End If strYN = MsgBox("Are You Sure You Want To Delete?", vbCritical + vbYesNo, "Delete?") If strYN = vbNo Then Exit Sub End If lngBOOKMARK = lstHeader.ListIndex moRSHeader.Delete Call HeaderLoad If lstHeader.ListCount > 0 Then If lstHeader.ListCount > lngBOOKMARK Then lstHeader.ListIndex = lngBOOKMARK lngBOOKMARK = 0 Else lstHeader.ListIndex = lngBOOKMARK - 1 End If End If cmdDelete.Enabled = False cmdADD.Enabled = True cmdSave.Enabled = False End Sub Private Sub FormSave() Dim strName As String On Error GoTo Error_EH Call FieldsSave Exit Sub Error_EH: gstrMODULE = "Form PosPayS - Module FormSave" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Function FormFind() As Boolean Dim strSQL As String, lngID As Long On Error GoTo Error_EH lstHeader.col = 0 lngID = CLng(lstHeader.ColText) strSQL = "SELECT * FROM tblPosPayCRD WHERE PPid = " & lngID 'lstDetail.ItemData(lstDetail.ListIndex) Set moRSHeader = New Recordset moRSHeader.Open strSQL, goConn, adOpenKeyset, adLockPessimistic If moRSHeader.EOF Then FormFind = False Call FormClear Else FormFind = True End If Exit Function Error_EH: gstrMODULE = "Form PosPayC - Module FormFind" Call ErrorHandler2 gstrMODULE = "" Exit Function End Function Private Sub lstHeader_Click() ' If lstDetail.ListIndex <> -1 Then If FormFind() Then Call FormShow End If ' End If End Sub Private Sub FieldsSave() Dim strSQL As String Dim oRS As Recordset, sglTOTAL As Single On Error GoTo Error_EH With moRSHeader .AddNew !CKNumber = Str2Field(txtInvDate) !Name = Str2Field(txtName) !CKDate = Str2Field(txtDueDate) ' !price = Str2Field(txtItemAmt) !Acct = "7" !CKAmt = Format(Str2Field(txtSalesCode), "0000000.00") !Submit = False .Update End With Call HeaderLoad Exit Sub Error_EH: gstrMODULE = "Form PosPayC - Module FieldsSave" Call ErrorHandler2 gstrMODULE = "" Exit Sub End Sub Private Sub FormClear() txtInvDate = "" txtDueDate = "" txtSalesCode = "" txtItemAmt = "" txtSubDt = "" txtSeq = "" txtUser = "" txtName = "" End Sub Private Sub lstHeader_DblClick() cmdDelete.Enabled = True cmdADD.Enabled = False End Sub Private Sub txtDueDate_GotFocus() Call FieldSelect(txtDueDate) End Sub Private Sub txtDueDate_LostFocus() Dim lngPOS As Long lngPOS = InStr(1, txtDueDate, "/", 1) If lngPOS = 0 Then If Len(txtDueDate) > 0 Then txtDueDate = Format(txtDueDate, "00/00/####") If Not IsDate(txtDueDate) Then MsgBox "The Date You Entered is not Valid - ReEnter" txtDueDate.SetFocus End If End If ElseIf IsDate(txtDueDate) Then Exit Sub Else MsgBox "Invalid Date Format, Enter as 12312009", , "Invalid Date - ReEnter" txtDueDate.SetFocus End If ' txtDueDate = UCase(txtDueDate) End Sub Private Sub txtInvDate_GotFocus() Call FieldSelect(txtInvDate) End Sub Private Sub txtNAME_GotFocus() Call FieldSelect(txtName) End Sub Private Sub txtNAME_LostFocus() txtName = UCase(txtName) End Sub Private Sub txtSalesCode_GotFocus() Call FieldSelect(txtSalesCode) End Sub Private Sub txtSalesCode_LostFocus() Dim intLEN As Integer, strMSG As String txtSalesCode = Format((txtSalesCode), "0000000.00") intLEN = Len(txtSalesCode) If intLEN > 10 Then strMSG = "Number Must 10 Digits Or Less Including The '.'" strMSG = strMSG & vbCrLf & vbCrLf & "ReEnter as #######.##" ' msgbox (strmsg,vbOKOnly,"ReEnter The Amount") MsgBox strMSG, vbOKOnly, "ReEnter The Amount" txtSalesCode = "" txtSalesCode.SetFocus End If End Sub Private Sub txtSearch_Change() 'Multiple character search code. lstHeader.ColumnSearch = 1 lstHeader.SearchText = txtSearch.Text lstHeader.SearchMethod = SearchMethodGreaterOrEqual lstHeader.Action = ActionSearch ' lstHeader.SearchIndex = -1 If lstHeader.SearchIndex <> -1 Then lstHeader.TopIndex = lstHeader.SearchIndex lstHeader.ListIndex = lstHeader.SearchIndex Else lstHeader.Action = 6 ' clear End If End Sub Private Sub txtSearch_LostFocus() txtSearch = "" End Sub