Imports Microsoft.VisualBasic
Dim billstatus as string = ""
Dim FYStartofInstalledDate, FYEndofInstalledDate as Date
Dim IDate As Date = CDate("4/5/2018")
Dim ADate as Date = CDate("6/30/2018")
Dim SiteExemptStatus as Boolean = false
Dim WellType as String = "Monitoring"
Dim WellStatus as String = "Permanent Abandoned"
FYStartofInstalledDate = "7/1/" & IDate.Year.ToString
FYEndofInstalledDate = "8/30/" & (IDate.Year + 1).ToString
FYStartofInstalledDate = "7/1/" & (IDate.Year - 1).ToString
FYEndofInstalledDate = "8/30/" & IDate.Year.ToString
Console.WriteLine("Installed Date: " & IDate)
Console.WriteLine("Abandoned Date: " & ADate)
Console.WriteLine("Installed Date FY Start: " & FYStartofInstalledDate)
Console.WriteLine("Installed Date FY End: " & FYEndofInstalledDate & " (includes 60 day grace period)")
Console.WriteLine("EXEMPT?: " & SiteExemptStatus)
Console.WriteLine("Well Type: " & WellType)
Console.WriteLine("Well Status: " & WellStatus)
Console.WriteLine("-------------------------------------------------")
If SiteExemptStatus = True then
Console.WriteLine("Site is EXEMPT and therefore wells are NEVER BILLABLE - no matter what!")
billStatus = "NON BILLABLE"
Console.WriteLine("Site is NOT EXEMPT and therefore wells can be billable based on well type and well status")
If (WellType.Equals("Vapor Observation") or WellType.Equals("Active Recover") or WellType.Equals("Active Injection") or WellType.Equals("Active Sparging") or WellType.Equals("Active Vapor Extraction") or WellType.Equals("Active Other Remediation")) then
Console.WriteLine("This is a " & WellType & " well and they are never billable")
billStatus = "NON BILLABLE"
Console.WriteLine("This is a " & WellType & " well and can be billable if not abandoned")
If WellStatus = "Permanent Abandoned" then
Console.WriteLine("THIS WELL HAS BEEN ABANDONED")
Console.WriteLine(" all abandoned wells should be non-billable unless well was installed and abandoned in same FY and existed more than 60 days")
billStatus = "NON BILLABLE"
If (IDate >= FYStartofInstalledDate and IDate <= FYEndofInstalledDate) And (ADate >= FYStartofInstalledDate and ADate <= FYEndofInstalledDate) Then
Console.WriteLine("This well was installed and abondoned in SAME FY")
If DateDiff(DateInterval.Day, IDate, ADate) <= 60 Then
Console.WriteLine(" and existed LESS than 60 days")
billStatus = "NON BILLABLE"
Console.WriteLine(" and existed MORE than 60 days")
Console.WriteLine("This well was installed and abondoned in DIFFERENT FY")
billStatus = "NON BILLABLE"
Console.WriteLine("THis well has not been abandoned")
Console.WriteLine("Billing Status: " & billStatus)