...
- If XREF Code = "4"
- r@Level4Description := True
- r@Prop := False
- r@Psgr := False
- Check to see if Vehicle Type is Passenger or Property
- PASSENGER
- If any vehicle Type is ("BU", "LM", "MC", "SB")
- r@Psgr := True
- PROPERTY
- If any vehicle Type is ("CL", "DC", "FT", "IC", "OT", "PT", "ST", "TR", "TT", "VN")
- r@Prop := True
- If r@Prop = True
- if Federal Code begins with "395.5A"
- ErrLog("You cannot cite this violation to a driver of a Property Carrying Vehicle.",
- r@Level4Description := False
- If r@Psgr = True
- if Federal Code begins with "395.3A"
- ErrLog("You cannot cite this violation to a driver of a Passenger Carrying Vehicle."
- r@Level4Description := False
- If r@Level4Description = True
- Enable (Smart Logic Date)
- If Smart Logic Date is blank
- Disable(Driver Violation Flag)
- ExitRule
- If (Smart Logic Date, is over 7 days prior than Date Inspection Started
- ErrLog("The selected Smart Logic Date must be the Date Inspection Started, or one of the previous 7 days."
- r@Level4Description := False
- If r@Prop = True Or r@Psgr = True Then
- Count all violations where
- Federal Code begins with 395.3A and the smart logic dates equal
- Set r@3953ACited to that number
- Federal Code begins with 395.5A and the smart logic dates equal
- Set r@3955ACited to that number
- If r@3953ACited > 2 Or r@3955ACited > 2
- r@Level4Description := False
- If r@Level4Description = True
- /Needed 2 levels of control to determine if description shows, prevents us from having to manage the description in 2 or 3 places
- r@ShowLevel4Description := False
- If Smart Logic Date is not blank and Smart Logic date equals Date Inspection Started
- Enable (Driver Violation)
- If Driver Violation is blank Then
- DisableWithClear (Out of Service)
- else if Driver Violation is not blank
- set Out of Service := Driver Violation
- Disable (Out of Service)
- r@ShowLevel4Description := True
- Else
- DisableWithClear (Driver Violation)
- Disable (Out of Service)
- set Out of Service := "N"
- r@ShowLevel4Description := True
Level 5
Alaska Only violations
-
If XREF Code = "5" Then - Enable (Smart Logic Date)
- If
- Federal Code
- begins with "395.1H1" Or
- "395.1H2"
- Enable (Smart Logic Date)
EndIf
EndIf
//
Alaska Only
- If XREF Code = "5" Then
- r@Level5Description := False
- r@InAlaska := False
- If time Zone equals "ALASKA" Then
- r@Level5Description := True
- r@InAlaska := True
- If r@InAlaska = False
- if (Smart Logic Date equals (Date
- Inspection Started,
- r@Level5Description := False
- Else
- r@Level5Description := True
- Count all violations for
- Federal Code begins with 395.1H1
- Set r@3951H1Count to that number
- Federal Code begins with 395.1H2
- Set r@3951H2Count to that number
- Federal Code begins with 395.3
- Set r@3953Count to that number
- Federal Code begins with 395.5
- Set r@3955Count to that number
- If Federal Code begins with "395.1H1" and r@3951H2Count > 0
- r@Level5Description := False
- If Federal Code begins with "395.1H2" and r@3951H1Count > 0
- r@Level5Description := False
- If r@3953Count > 0 Or r@3955Count > 0
- r@Level5Description := False
- If XREF Code = "5" And Federal Code is not equal to "395.1H2" or "395.1H1"
- r@Level5Description := True
- r@OtherLevel5 := True
- Is Driver Currently In Violation
- If r@Level5Description = True
- Enable (Driver Violation Flag)
- If Driver Violation Flag is not blank
- Out of Service := Driver Violation Flag
- Supplemental Description := "On " & Smart Logic Date& " " & Federal Violation Description
- Else
- Enable (Driver Violation Flag)
- else
- Supplemental Description := Federal Violation Description
//If TimeZones are Alaskan, then CMV inspection is in Alaska
If UCase ([Summary.summaryTimeZone()]) =
EndIf
If Format
r@Level5Description := False
// ExitRule
Else
r@Level5Description := True
EndIf
EndIf
r@3951H1Count := 0
r@3951H2Count := 0
r@3953Count := 0
r@3955Count := 0
For r@ViolCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.1H1" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] Then
r@3951H1Count := r@3951H1Count + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.1H2" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] Then
r@3951H2Count := r@3951H2Count + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.3" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] And Format ([SmartLogic.smartlogicDateViolation(r@ViolCount)], "MM/dd/yyyy") = Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") Then
r@3953Count := r@3953Count + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.5" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] And Format ([SmartLogic.smartlogicDateViolation(r@ViolCount)], "MM/dd/yyyy") = Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") Then
r@3955Count := r@3955Count + 1
EndIf
Next
If UCase (Left (Federal Code, 7 ) ) = "395.1H1" Then
If r@3951H2Count > 0 Then
r@Level5Description := False
//ExitRule
EndIf
EndIf
If UCase (Left (Federal Code, 7 ) ) = "395.1H2" Then
If r@3951H1Count > 0 Then
r@Level5Description := False
//ExitRule
EndIf
EndIf
If r@3953Count > 0 Or r@3955Count > 0 Then
r@Level5Description := False
//ExitRule
EndIf
If XREF Code = "5" And UCase (Left (Federal Code, 7 ) ) <> "395.1H2" And UCase (Left (Federal Code, 7 ) ) <> "395.1H1" Then
r@Level5Description := True
r@OtherLevel5 := True
EndIf
//Is Driver Currently In Violation
If r@Level5Description = True Then
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
If [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)] <> "" Then
Out of Service := [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)]
Supplemental Description := "On " & Smart Logic Date& " " & Federal Violation Description
Else
If Smart Logic Date = "" Then
//[SmartLogic.smartlogicDateViolation().focus] := True
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
Else
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
//[SmartLogic.smartlogicDriverViolationFlag().focus] := True
EndIf
EndIf
Else
Supplemental Description := Federal Violation Description
EndIf
EndIf
If XREF Code = "6" Then
Enable (Smart Logic Date)
EndIf
//60/70 Hours
If XREF Code = "6" Then
r@Level6Description := True
r@MultiCode6 := 0
r@3953b1 := 0
r@3953b2 := 0
r@3955b1 := 0
r@3955b2 := 0
r@3953 := 0
r@3955 := 0
r@3958a := 0
r@3958e := 0
For r@ViolCount = 1 to GroupCountAll ("Violation")
If [Violation.violationFederalCode(r@ViolCount)] = Federal Code Then
r@MultiCode6 := r@MultiCode6 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.3B1" Then
r@3953b1 := r@3953b1 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.3B2" Then
r@3953b2 := r@3953b2 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.5B1" Then
r@3955b1 := r@3955b1 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.5B2" Then
r@3955b2 := r@3955b2 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.3" Then
r@3953 := r@3953 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.5" Then
r@3955 := r@3955 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 6 ) ) = "395.8A" Then
r@3958a := r@3958a + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 6 ) ) = "395.8E" Then
r@3958e := r@3958e + 1
EndIf
Next
//Count to see if multiple violationXREFCode = 6
If r@MultiCode6 > 1 Then
r@Level6Description := False
EndIf
//
Level 6
60/70 Hours
- if XREF Code = "6"
- Enable (Smart Logic Date)
EndIf - If XREF Code = "6"
- r@Level6Description := True
- r@MultiCode6 := 0
- Count all violations for
- Federal Code equal to current Federal Code
- Set r@MultiCode6 Count to that number
- Federal Code begins with 395.3B1
- Set r@3953b1 Count to that number
- Federal Code begins with 395.3B2
- Set r@3953b2 Count to that number
- Federal Code begins with 395.5B1
- Set r@3955b1 Count to that number
- Federal Code begins with 395.5B2
- Set r@3955b2 Count to that number
- Federal Code begins with 395.3
- Set r@3953 Count to that number
- Federal Code begins with 395.5
- Set r@3955 Count to that number
- Federal Code begins with 395.8A
- Set r@3958a Count to that number
- Federal Code begins with 395.8E
- Set r@3958e Count to that number
- Count to see if multiple violationXREFCode = 6
- If r@MultiCode6 > 1
- r@Level6Description := False
- Check to see if both 395.3B1 and 395.3B2 are cited
- If r@3953b1 > 0 And r@3953b2 > 0
- r@Level6Description := False
- Check to see if both 395.5B1 and 395.5B2 are cited
- If r@3955b1 > 0 And r@3955b2 > 0
- r@Level6Description := False
- Check to see if a 395.3% and a 395.5% are cited
- r@3953 > 0 And r@3955 > 0
- r@Level6Description := False
- Check to see if 395.8A is cited
- If r@3958a > 0
- r@Level6Description := False
- If
- Smart Logic Date
- prior to 7 days before Date Inspection Started
- r@Level6Description := False
- Is Driver Currently In Violation
- if r@Level6Description = True
- Date Inspection Started, is not equal to Smart Logic Date And Smart Logic Date is not blank
- Out of Service := "N"
- DisableWithClear (
- Driver Violation Flag)
- Disable (Out of Service)
- Else
- DisableWithClear (Out of Service)
- Enable (
- Driver Violation Flag)
- If Driver Violation Flag is not blank
- set Out of Service :=
EndIf
//
EndIf
//
If
EndIf
//
EndIf
EndIf
//
If
If Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") <> Format (Smart Logic Date, "MM/dd/yyyy") And Smart Logic Date <> "" Then
//[SmartLogic.smartlogicDriverViolationFlag().focus] := True
EndIf
If [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)] <> "" Then
EndIf
EndIf
EndIf
//
...
- Driver Violation Flag
All Other Hours of Service
- If XREF Code = "7"
Enable (Smart Logic Date)
EndIf
All Other Hours of Service
- If XREF Code = "7" Then
r@Level7Description := True
Out of Service := "N"
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.13D" Or UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15G" Then
Disable (Out of Service)
If Format ([Summary.summaryDateInspectionStarted()]Date Inspection Started, "MM/dd/yyyy") <> Format (Smart Logic Date, "MM/dd/yyyy") Then
//ErrLog("smartlogicDateViolation must be the Current Date.",[Summary.summaryDateInspectionStarted()]Date Inspection Started,[SmartLogic.smartlogicDateViolation()])
r@Level7Description := False
Else
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.13D" Then
Enable ([SmartLogic.smartlogicDateOOS(r@subgroupinstance)], [SmartLogic.smartlogicTimeOOS(r@subgroupinstance)], [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)], [SmartLogic.smartlogicInspectionNumber(r@subgroupinstance)])
//If [SmartLogic.smartlogicDateOOS()] = "" or [SmartLogic.smartlogicTimeOOS()] = "" Then
//r@Level7Description := False
//[SmartLogic.smartlogicDateOOS().focus] := True
//Else
If [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)] = "" Then
r@Level7Description := False
//[SmartLogic.smartlogicOOSSatisfiedFlag().focus] := True
EndIf
//Do not set the description until both OOS fields are filled in
//If [SmartLogic.smartlogicOOSSatisfiedFlag()] <> "" and [SmartLogic.smartlogicDateOOS()] <> "" and [SmartLogic.smartlogicTimeOOS()] <> "" Then
If [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)] <> "" Then
If [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)] = "Y" Then
Out of Service := "N"
Else
Out of Service := "Y"
EndIf
Disable (Out of Service)
r@Level7Description := True
EndIf
//EndIf
EndIf
EndIf
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15B" Then
r@Vio3958e := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 8 ) ) = "395.8E" Then
r@Vio3958e := r@Vio3958e + 1
EndIf
Next
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 9 ) ) = "395.3A3II" Then
r@Vio3A3II := 0
r@Vio8A := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 9 ) ) = "395.3A3II" Then
r@Vio3A3II := r@Vio3A3II + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 6 ) ) = "395.8A" And Smart Logic Date = [SmartLogic.smartlogicDateViolation(r@VioCount)] Then
r@Vio8A := r@Vio8A + 1
EndIf
Next
If r@Vio3A3II > 1 Then
r@Level7Description := False
EndIf
If r@Vio3A3II >= 1 And r@Vio8A >= 1 Then
r@Level7Description := False
EndIf
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15F" Then
If [SmartLogic.smartlogicAOBRDFlag(r@VioCount)] = "" Then
Enable ([SmartLogic.smartlogicAOBRDFlag(r@VioCount)])
//[SmartLogic.smartlogicAOBRDFlag(r@VioCount).focus] := True
EndIf
If [SmartLogic.smartlogicAOBRDFlag(r@VioCount)] <> "Y" Then
r@Level7Description := False
EndIf
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15G" Then
r@Vio15G := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15G" Then
r@Vio15G := r@Vio15G + 1
EndIf
Next
If r@Vio15G > 1 Then
r@Level7Description := False
EndIf
EndIf
If r@Level7Description = True Then
Supplemental Description := "On " & Smart Logic Date& " " & [Violation.violationFederalDescription(r@parentGroupInstance)]
EndIf
EndIf
//All Other smartlogicDriverViolationFlags
If XREF Code = "14" Then
r@Vio383Count := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 8 ) ) = "383.23A2" Then
r@Vio383Count := r@Vio383Count + 1
EndIf
Next
Supplemental Description := Federal Violation Description
If r@Vio383Count <= 1 Then
Out of Service := "Y"
Disable (Out of Service)
Supplemental Description := "Driver Operating without " & "- " & Federal Violation Description
EndIf
EndIf
//Log Book Form and Manner Violations
If XREF Code = "50" Then
Out of Service := "N"
r@Level50Description := False
f@SmartLogic := ""
r@violationdescriptiontext := ""
r@addviotext := ""
r@notestext := ""
Enable (Smart Logic Date)
If [Violation.violationFederalCode(any )] = "395.8" Then
//Figure out which violations need filtered
r@Level50Description := True
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase ([Violation.violationFederalCode(r@VioCount)]) = "395.8" Then
r@filter3958 := r@VioCount
ExitFor
EndIf
Next
EndIf
If [Violation.violationFederalCode(any )] = "395.15I5" Then
//Figure out which violations need filtered
r@Level50Description := True
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase ([Violation.violationFederalCode(r@VioCount)]) = "395.15I5" Then
r@filter39515 := r@VioCount
ExitFor
EndIf
Next
EndIf
//Build notes
For r@VioCount = 1 to GroupCountAll ("Violation")
r@OtherSmartLogicInstance := GetSubGroupInstanceByParent ("Violation", r@VioCount, "SmartLogic", 1 )
If (r@Viocount > r@filter3958 And r@filter3958 <> "" And r@filter3958 <> 0 ) Or (r@Viocount > r@filter39515 And r@filter39515 <> "" And r@filter39515 <> 0 ) Then
If [Violation.violationFederalCode(r@VioCount)] <> "" Then
If r@addviotxt = "" Then
r@addviotxt := "Violation(s) of: " & [Violation.violationFederalCode(r@VioCount)]
Else
r@addviotxt := r@addviotxt & ", " & [Violation.violationFederalCode(r@VioCount)]
EndIf
If r@notestxt = "" Then
r@notestxt := "Record of Duty Status, Form and Manner Violations on " & [SmartLogic.smartlogicDateViolation(r@OtherSmartLogicInstance)]& ":" & newline & [Violation.violationFederalCode(r@VioCount)]& "-" & [SmartLogic.smartlogicItemRemark(r@OtherSmartLogicInstance)]& newline
Else
r@notestxt := r@notestxt & [Violation.violationFederalCode(r@VioCount)]& "-" & [SmartLogic.smartlogicItemRemark(r@OtherSmartLogicInstance)]& newline
EndIf
EndIf
EndIf
Next
//Apply Notes
If r@addviotxt <> "" Or r@notestxt <> "" Then
//Place in tbd field
[Description.descriptionNotes(0 )] := r@addviotxt & Newline & "***********************" & newline & r@notestxt
EndIf
EndIf
If XREF Code = "" And [Violation.violationTraCSFederalKey(r@parentGroupInstance)] = "" Then
DisableWithClear (Smart Logic Date, Evidence, [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)]Driver Violation Flag, [SmartLogic.smartlogicDateOOS(r@subgroupinstance)], [SmartLogic.smartlogicTimeOOS(r@subgroupinstance)], [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)], [SmartLogic.smartlogicInspectionNumber(r@subgroupinstance)], [SmartLogic.smartlogicAOBRDFlag(r@subgroupinstance)], Supplemental Description)
Clear ([Violation.violationCitationFlag(r@parentGroupInstance)])
EndIf
EndIf
...