Calculating whether to charge a fee for a follow-up inspection
You can direct Infor Public Sector to calculate whether a fee is charged for a follow-up inspection using a follow-up inspection fee condition formula. A follow-up inspection follows a current inspection after a set amount of time has passed, typically independent of the current inspection's results. For example, you could write a formula that charges a fee for each follow-up inspection on a livestock violation. You specify a follow-up inspection fee condition formula and a follow-up inspection fee for an inspection type when you define the inspection type. The follow-up inspection fee should be a pre-defined fee type for the case.
Follow-up inspection fee condition formulas use the oCase
object (an instance of the Hansen.CDR.CodeEnforcement.iCase
class) to set AddFee
to either True or False. If the formula returns True, Infor Public Sector adds the follow-up inspection fee to the case. If the formula returns False, Infor Public Sector doesn't add the follow-up inspection fee. For more information about this object and for sample code, click the Information tab in the Formula Editor.
Example
This formula adds the follow-up fee to a case if a compliance inspection has been conducted two or more times.
dim oInsp as Hansen.CDR.CodeEnforcement.IInspection
AddFee = False
For Each oInsp in oCase.Inspections
If oInsp.InspectionType.Code.toUpper = "COMPLIANCE" AND
oInsp.InspectionTypeNumber > 1 Then
AddFee = True
End If
Next oInsp