'Created By: Xavier Arias
'Date Created: MARCH 11, 2016
'Date Revised: MARCH 11, 2016
'Title: Cash_Ops_Batch_Form
'FORM
Private Sub Cash_Ops_Batch_Frm_Click()
Dim hostSettleTimeout As Integer
Dim hostSettleTime As Integer
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer
Dim hiddenTextEntry As String
hostSettleTimeout = 5000
hostSettleTime = 300
Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen
Dim myUser As String
myUser = Environ("username")
Dim BatchNumber As Double
'Delete the First Line of 150 File
Dim fso
Dim sFilePath As String
Set fso = CreateObject("Scripting.FileSystemObject")
MyFile = "S:\FinAdj\Master_Files\RESEARCH\150.csv"
If fso.FileExists(MyFile) Then
Open MyFile For Input As #1 ' Open file for input.
Dim Remitter As String, Payment As String, CurrencyVar As String, Amount As String, TypeVar As String, Status As String, DateVar As String, Lockbox As String, Batch As String, Item As String, Gp As String, Pb As String, ReasonCode As String, PaymentMemo As String, Comments As String
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
Close #1
If Remitter = "Remitter" Then
Dim iFile As Integer
Dim sData As String
iFile = FreeFile
Open "S:\FinAdj\Master_Files\RESEARCH\150.csv" For Binary Access Read As iFile
sData = Space(LOF(iFile))
Get #iFile, , sData
Close iFile
sData = Mid(sData, InStr(sData, vbCrLf) + 2)
Kill "S:\FinAdj\Master_Files\RESEARCH\150.csv"
iFile = FreeFile
Open "S:\FinAdj\Master_Files\RESEARCH\150.csv" For Binary Access Write As iFile
Put #iFile, , sData
Close iFile
End If
End If
'Delete the First Line of 175 File
Set fso = CreateObject("Scripting.FileSystemObject")
MyFile = "S:\FinAdj\Master_Files\RESEARCH\175.csv"
If fso.FileExists(MyFile) Then
Open MyFile For Input As #1 ' Open file for input.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
Close #1
If Remitter = "Remitter" Then
iFile = FreeFile
Open "S:\FinAdj\Master_Files\RESEARCH\175.csv" For Binary Access Read As iFile
sData = Space(LOF(iFile))
Get #iFile, , sData
Close iFile
sData = Mid(sData, InStr(sData, vbCrLf) + 2)
Kill "S:\FinAdj\Master_Files\RESEARCH\175.csv"
iFile = FreeFile
Open "S:\FinAdj\Master_Files\RESEARCH\175.csv" For Binary Access Write As iFile
Put #iFile, , sData
Close iFile
End If
End If
'Delete the First Line of 185 File
Set fso = CreateObject("Scripting.FileSystemObject")
MyFile = "S:\FinAdj\Master_Files\RESEARCH\185.csv"
If fso.FileExists(MyFile) Then
Open MyFile For Input As #1 ' Open file for input.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
Close #1
If Remitter = "Remitter" Then
iFile = FreeFile
Open "S:\FinAdj\Master_Files\RESEARCH\185.csv" For Binary Access Read As iFile
sData = Space(LOF(iFile))
Get #iFile, , sData
Close iFile
sData = Mid(sData, InStr(sData, vbCrLf) + 2)
Kill "S:\FinAdj\Master_Files\RESEARCH\185.csv"
iFile = FreeFile
Open "S:\FinAdj\Master_Files\RESEARCH\185.csv" For Binary Access Write As iFile
Put #iFile, , sData
Close iFile
End If
End If
'Choose the Batch
'Option 1.50 **************************************************************************************************************************************
If OptionButton1 = True Then
BatchNumber = "1.50"
Unload Me
MyFile = "S:\FinAdj\Master_Files\RESEARCH\150.csv"
Open MyFile For Input As #1 ' Open file for input.
OldAmount = "0"
Do While Not EOF(1) ' Loop until end of file.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
If Len(Amount) = 0 Then
GoTo EOL_Amount1
Else
SubTotal = CDbl(Amount) + OldAmount
End If
OldAmount = SubTotal
'MsgBox (OldAmount)
Loop
Close #1
BatchTotal = OldAmount
EOL_Amount1:
If BatchTotal = "0" Then
MsgBox ("The Batch Total is 0.00")
Exit Sub
End If
'Batch Information
Dim Deposit As String
Dim BankCode As String
Deposit = "888" '030
BankCode = "1.50"
BatchNumber = "050"
'String Bank Code Unapplied Suspense 111111.000.000.000000.000.0000
LESSOR = "000"
LEADBANK = "000.0"
Branch = "000000"
Region = "000"
ProductLine = "0000"
'Accessing Deposit Control
Call Reset_to_InfoLease_Master_Menu
Call Wait_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "7"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(BankCode)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Deposit)
Call Wait_50
Call Enter_50
Call Wait_50
MyFile = "S:\FinAdj\Master_Files\RESEARCH\150.csv"
Open MyFile For Input As #1 ' Open file for input.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
Call osCurrentScreen.SendKeys(DateVar) ' Date
Call Wait_50
Call Enter_50
Call Wait_50
Close #1
Call osCurrentScreen.SendKeys(BatchNumber)
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "0"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
'S:\FinAdj\Master_Files\RESEARCH\CASH_OPS_BATCH.csv
MyFile = "S:\FinAdj\Master_Files\RESEARCH\150.csv"
Open MyFile For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Loop until end of file.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
DateVar = Format(DateVar, "mmddyyyy")
'Format Check Date
DateVarMM = Mid(DateVar, 1, 2)
DateVarDD = Mid(DateVar, 3, 2)
DateVarYY = Mid(DateVar, 7, 2)
osCurrentScreen.SendKeys "6"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(LESSOR)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(LEADBANK)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Branch)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Region)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(ProductLine)
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Amount)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(TypeVar)
Call osCurrentScreen.SendKeys(DateVarMM)
Call osCurrentScreen.SendKeys(DateVarDD)
Call osCurrentScreen.SendKeys(DateVarYY)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Remitter)
Call Wait_50
For x = 1 To 8
Call Enter_50
Next x
Call Wait_50
Call osCurrentScreen.SendKeys(ReasonCode)
Call Wait_50
For x = 1 To 3
Call Enter_50
Next x
Call Wait_50
If PaymentMemo = "" Then
GoTo SkipPaymentMemo
End If
Call Wait_50
osCurrentScreen.SendKeys "3"
Call Wait_50
Call Enter_50
Call Wait_50
If PaymentMemo <> "" Then
Format PaymentMemo
PaymentMemo = Format(PaymentMemo, ">")
End If
Call osCurrentScreen.SendKeys(PaymentMemo)
Call Wait_50
If PaymentMemo <> "" Then
Call Enter_50
End If
Call Wait_50
SkipPaymentMemo:
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
'Format to All Capital Letters
If Comments <> "" Then
Format Comments
Comments = Format(Comments, ">")
End If
Call osCurrentScreen.SendKeys(Comments)
Call Wait_50
If Comments <> "" Then
Call Enter_50
End If
Call Wait_50
For x = 1 To 2
Call Enter_50
Next x
Call Wait_50
Loop
osCurrentScreen.SendKeys "/"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "."
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "1"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(BatchTotal)
Call Wait_50
Call Enter_50
Call Wait_50
For x = 1 To 2
Call Wait_50
Next x
Close #1 ' Close file.
'Archive
Dim MyDate
MyDate = Format(Date, "YYYYMMDD")
Dim MyTime
MyTime = Format(Time, "hhmmss")
Dim MyYear
MyYear = Mid(MyDate, 1, 4)
Dim MyMonth
MyMonth = Mid(MyDate, 5, 2)
Dim MyDay
MyDay = Mid(MyDate, 7, 2)
Set fso = CreateObject("Scripting.FileSystemObject")
folderFileRoot = "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\"
folderFilePath = "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "\" & MyDay & ""
If fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "\" & MyDay & "") Then
'Copy file
FileCopy "S:\FinAdj\Master_Files\RESEARCH\150.csv", "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "\" & MyDay & "\" & MyDate & MyTime & "_150.csv"
Else
Dim fs, f, ts
Set fs = CreateObject("Scripting.FileSystemObject")
CheckMyFile:
If fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "\" & MyDay & "") Then
'Copy file
FileCopy "S:\FinAdj\Master_Files\RESEARCH\150.csv", "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "\" & MyDay & "\" & MyDate & MyTime & "_150.csv"
GoTo EndProcess
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "") Then
Set f = fs.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "\" & MyDay & "")
GoTo CheckMyFile
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "") Then
Set f = fs.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "\" & MyMonth & "")
GoTo CheckMyFile
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\") Then
Set f = fs.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\" & MyYear & "")
GoTo CheckMyFile
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\") Then
Set f = fs.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\")
GoTo CheckMyFile
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE") Then
Set f = fs.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.50\")
GoTo CheckMyFile
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\") Then
Set f = fs.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\")
GoTo CheckMyFile
End If
EndProcess:
Close
End If
End If
'Option 1.75 **************************************************************************************************************************************
If OptionButton2 = True Then
BatchNumber = "1.75"
Unload Me
MyFile = "S:\FinAdj\Master_Files\RESEARCH\175.csv"
Open MyFile For Input As #1 ' Open file for input.
OldAmount = "0"
Do While Not EOF(1) ' Loop until end of file.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
If Len(Amount) = 0 Then
GoTo EOL_Amount2
Else
SubTotal = CDbl(Amount) + OldAmount
End If
OldAmount = SubTotal
'MsgBox (OldAmount)
Loop
Close #1
BatchTotal = OldAmount
EOL_Amount2:
If BatchTotal = "0" Then
MsgBox ("The Batch Total is 0.00")
Exit Sub
End If
'Batch Information
Deposit = "031" '031
BankCode = "1.75"
BatchNumber = "031"
'String Bank Code Unapplied Suspense 111111.000.000.000000.000.0000
LESSOR = "000"
LEADBANK = "000.0"
Branch = "000000"
Region = "000"
ProductLine = "0000"
'Accessing Deposit Control
Call Reset_to_InfoLease_Master_Menu
Call Wait_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "7"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(BankCode)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Deposit)
Call Wait_50
Call Enter_50
Call Wait_50
MyFile = "S:\FinAdj\Master_Files\RESEARCH\175.csv"
Open MyFile For Input As #1 ' Open file for input.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
Call osCurrentScreen.SendKeys(DateVar) ' Date
Call Wait_50
Call Enter_50
Call Wait_50
Close #1
Call osCurrentScreen.SendKeys(BatchNumber)
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "0"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
'S:\FinAdj\Master_Files\RESEARCH\CASH_OPS_BATCH.csv
MyFile = "S:\FinAdj\Master_Files\RESEARCH\175.csv"
Open MyFile For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Loop until end of file.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
DateVar = Format(DateVar, "mmddyyyy")
'Format Check Date
DateVarMM = Mid(DateVar, 1, 2)
DateVarDD = Mid(DateVar, 3, 2)
DateVarYY = Mid(DateVar, 7, 2)
osCurrentScreen.SendKeys "6"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(LESSOR)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(LEADBANK)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Branch)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Region)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(ProductLine)
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Amount)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(TypeVar)
Call osCurrentScreen.SendKeys(DateVarMM)
Call osCurrentScreen.SendKeys(DateVarDD)
Call osCurrentScreen.SendKeys(DateVarYY)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Remitter)
Call Wait_50
For x = 1 To 8
Call Enter_50
Next x
Call Wait_50
Call osCurrentScreen.SendKeys(ReasonCode)
Call Wait_50
For x = 1 To 3
Call Enter_50
Next x
Call Wait_50
If PaymentMemo = "" Then
GoTo SkipPaymentMemo2
End If
Call Wait_50
osCurrentScreen.SendKeys "3"
Call Wait_50
Call Enter_50
Call Wait_50
If PaymentMemo <> "" Then
Format PaymentMemo
PaymentMemo = Format(PaymentMemo, ">")
End If
Call osCurrentScreen.SendKeys(PaymentMemo)
Call Wait_50
If PaymentMemo <> "" Then
Call Enter_50
End If
Call Wait_50
SkipPaymentMemo2:
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
'Format to All Capital Letters
If Comments <> "" Then
Format Comments
Comments = Format(Comments, ">")
End If
Call osCurrentScreen.SendKeys(Comments)
Call Wait_50
If Comments <> "" Then
Call Enter_50
End If
Call Wait_50
For x = 1 To 2
Call Enter_50
Next x
Call Wait_50
Loop
osCurrentScreen.SendKeys "/"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "."
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "1"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(BatchTotal)
Call Wait_50
Call Enter_50
Call Wait_50
For x = 1 To 2
Call Wait_50
Next x
Close #1 ' Close file.
'Archive
Dim MyDate2
MyDate2 = Format(Date, "YYYYMMDD")
Dim MyTime2
MyTime2 = Format(Time, "hhmmss")
Dim MyYear2
MyYear2 = Mid(MyDate2, 1, 4)
Dim MyMonth2
MyMonth2 = Mid(MyDate2, 5, 2)
Dim MyDay2
MyDay2 = Mid(MyDate2, 7, 2)
Set fso = CreateObject("Scripting.FileSystemObject")
folderFileRoot = "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\"
folderFilePath = "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "\" & MyDay2 & ""
If fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "\" & MyDay2 & "") Then
'Copy file
FileCopy "S:\FinAdj\Master_Files\RESEARCH\175.csv", "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "\" & MyDay2 & "\" & MyDate2 & MyTime2 & "_175.csv"
Else
Dim fs2, f2, ts2
Set fs2 = CreateObject("Scripting.FileSystemObject")
CheckMyFile2:
If fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "\" & MyDay2 & "") Then
'Copy file
FileCopy "S:\FinAdj\Master_Files\RESEARCH\175.csv", "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "\" & MyDay2 & "\" & MyDate2 & MyTime2 & "_175.csv"
GoTo EndProcess2
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "") Then
Set f2 = fs2.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "\" & MyDay2 & "")
GoTo CheckMyFile2
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "") Then
Set f2 = fs2.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "\" & MyMonth2 & "")
GoTo CheckMyFile2
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\") Then
Set f2 = fs2.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\" & MyYear2 & "")
GoTo CheckMyFile2
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\") Then
Set f2 = fs2.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\")
GoTo CheckMyFile2
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE") Then
Set f2 = fs2.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.75\")
GoTo CheckMyFile2
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\") Then
Set f2 = fs2.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\")
GoTo CheckMyFile2
End If
EndProcess2:
Close
End If
End If
'Option 1.85 **************************************************************************************************************************************
If OptionButton3 = True Then
BatchNumber = "1.85"
Unload Me
MyFile = "S:\FinAdj\Master_Files\RESEARCH\185.csv"
Open MyFile For Input As #1 ' Open file for input.
OldAmount = "0"
Do While Not EOF(1) ' Loop until end of file.
'Dim Remitter As String, Payment As String, CurrencyVar As String, Amount As Double, TypeVar As String, Status As String, DateVar As String, Lockbox As String, Batch As String, Item As String, Gp As String, Pb As String
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
If Len(Amount) = 0 Then
GoTo EOL_Amount3
Else
SubTotal = CDbl(Amount) + OldAmount
End If
OldAmount = SubTotal
'MsgBox (OldAmount)
Loop
Close #1
BatchTotal = OldAmount
EOL_Amount3:
If BatchTotal = "0" Then
MsgBox ("The Batch Total is 0.00")
Exit Sub
End If
'Batch Information
Deposit = "032" '032
BankCode = "1.85"
BatchNumber = "032"
'String Bank Code Unapplied Suspense 111111.000.000.000000.000.0000
LESSOR = "000"
LEADBANK = "000.0"
Branch = "000000"
Region = "000"
ProductLine = "0000"
'Accessing Deposit Control
Call Reset_to_InfoLease_Master_Menu
Call Wait_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "7"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(BankCode)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Deposit)
Call Wait_50
Call Enter_50
Call Wait_50
MyFile = "S:\FinAdj\Master_Files\RESEARCH\185.csv"
Open MyFile For Input As #1 ' Open file for input.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
Call osCurrentScreen.SendKeys(DateVar) ' Date
Call Wait_50
Call Enter_50
Call Wait_50
Close #1
Call osCurrentScreen.SendKeys(BatchNumber)
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "0"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
'S:\FinAdj\Master_Files\RESEARCH\CASH_OPS_BATCH.csv
MyFile = "S:\FinAdj\Master_Files\RESEARCH\185.csv"
Open MyFile For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Loop until end of file.
Input #1, Remitter, Payment, CurrencyVar, Amount, TypeVar, Status, DateVar, Lockbox, Batch, Item, Gp, Pb, ReasonCode, PaymentMemo, Comments ' Read data into variables.
DateVar = Format(DateVar, "mmddyyyy")
'Format Check Date
DateVarMM = Mid(DateVar, 1, 2)
DateVarDD = Mid(DateVar, 3, 2)
DateVarYY = Mid(DateVar, 7, 2)
osCurrentScreen.SendKeys "6"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(LESSOR)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(LEADBANK)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Branch)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Region)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(ProductLine)
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Amount)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(TypeVar)
Call osCurrentScreen.SendKeys(DateVarMM)
Call osCurrentScreen.SendKeys(DateVarDD)
Call osCurrentScreen.SendKeys(DateVarYY)
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(Remitter)
Call Wait_50
For x = 1 To 8
Call Enter_50
Next x
Call Wait_50
Call osCurrentScreen.SendKeys(ReasonCode)
Call Wait_50
For x = 1 To 3
Call Enter_50
Next x
Call Wait_50
If PaymentMemo = "" Then
GoTo SkipPaymentMemo3
End If
Call Wait_50
osCurrentScreen.SendKeys "3"
Call Wait_50
Call Enter_50
Call Wait_50
If PaymentMemo <> "" Then
Format PaymentMemo
PaymentMemo = Format(PaymentMemo, ">")
End If
Call osCurrentScreen.SendKeys(PaymentMemo)
Call Wait_50
If PaymentMemo <> "" Then
Call Enter_50
End If
Call Wait_50
SkipPaymentMemo3:
osCurrentScreen.SendKeys "5"
Call Wait_50
Call Enter_50
Call Wait_50
'Format to All Capital Letters
If Comments <> "" Then
Format Comments
Comments = Format(Comments, ">")
End If
Call osCurrentScreen.SendKeys(Comments)
Call Wait_50
If Comments <> "" Then
Call Enter_50
End If
Call Wait_50
For x = 1 To 2
Call Enter_50
Next x
Call Wait_50
Loop
osCurrentScreen.SendKeys "/"
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "."
Call Wait_50
Call Enter_50
Call Wait_50
osCurrentScreen.SendKeys "1"
Call Wait_50
Call Enter_50
Call Wait_50
Call osCurrentScreen.SendKeys(BatchTotal)
Call Wait_50
Call Enter_50
Call Wait_50
For x = 1 To 2
Call Wait_50
Next x
Close #1 ' Close file.
'Archive
Dim MyDate3
MyDate3 = Format(Date, "YYYYMMDD")
Dim MyTime3
MyTime3 = Format(Time, "hhmmss")
Dim MyYear3
MyYear3 = Mid(MyDate3, 1, 4)
Dim MyMonth3
MyMonth3 = Mid(MyDate3, 5, 2)
Dim MyDay3
MyDay3 = Mid(MyDate3, 7, 2)
Set fso = CreateObject("Scripting.FileSystemObject")
folderFileRoot = "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\"
folderFilePath = "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "\" & MyDay3 & ""
If fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "\" & MyDay3 & "") Then
'Copy file
FileCopy "S:\FinAdj\Master_Files\RESEARCH\185.csv", "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "\" & MyDay3 & "\" & MyDate3 & MyTime3 & "_185.csv"
Else
Dim fs3, f3, ts3
Set fs3 = CreateObject("Scripting.FileSystemObject")
CheckMyFile3:
If fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "\" & MyDay3 & "") Then
'Copy file
FileCopy "S:\FinAdj\Master_Files\RESEARCH\185.csv", "S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "\" & MyDay3 & "\" & MyDate3 & MyTime3 & "_185.csv"
GoTo EndProcess3
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "") Then
Set f3 = fs3.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "\" & MyDay3 & "")
GoTo CheckMyFile3
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "") Then
Set f3 = fs3.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "\" & MyMonth3 & "")
GoTo CheckMyFile3
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\") Then
Set f3 = fs3.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\" & MyYear3 & "")
GoTo CheckMyFile3
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\") Then
Set f3 = fs3.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\")
GoTo CheckMyFile3
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE") Then
Set f3 = fs3.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\1.85\")
GoTo CheckMyFile3
ElseIf fso.FolderExists("S:\FinAdj\Master_Files\RESEARCH\") Then
Set f3 = fs3.CreateFolder("S:\FinAdj\Master_Files\RESEARCH\ARCHIVE\")
GoTo CheckMyFile3
End If
EndProcess3:
Close
End If
End If
'Delete Files
Set fso = CreateObject("Scripting.FileSystemObject")
sFilePath = "S:\FinAdj\Master_Files\RESEARCH\150.csv"
If fso.FileExists(sFilePath) Then
Kill (sFilePath)
End If
Set fso = CreateObject("Scripting.FileSystemObject")
sFilePath2 = "S:\FinAdj\Master_Files\RESEARCH\175.csv"
If fso.FileExists(sFilePath2) Then
Kill (sFilePath2)
End If
Set fso = CreateObject("Scripting.FileSystemObject")
sFilePath3 = "S:\FinAdj\Master_Files\RESEARCH\185.csv"
If fso.FileExists(sFilePath3) Then
Kill (sFilePath3)
End If
'MsgBox ("Process completed. Thank You for using CIT Cash Ops Make My Life Easy Button. Have a nice Day!!!")
End Sub