Calculating whether to apply a usage estimate
You can calculate whether to apply an estimate setup to a meter reading using an Add On Condition formula. For example, you could write a formula that determines whether the previous readings are consistent enough to estimate a usage, or that indicates that a meter is within a certain category, such as a certain service area. You specify an Add On Condition formula for a usage estimate when you add or edit a usage estimate setup.
Add On condition formulas use the LocationHistory
object (an instance of the Hansen.AssetManagement
class), MeterReading
object (an instance of the Hansen.AssetManagement.Water
class), ServicePosition
object (an instance of the Hansen.Billing
class), and WaterMeter
object (an instance of the Hansen.AssetManagement.Water
class) to set AddOnCondition
to either True or False. If the formula returns True, Infor Public Sector applies the usage estimate to a reading requesting an estimate. If the formula returns False, Infor Public Sector doesn't apply the estimate. For more information about this object and for sample code, click the Information tab in the Formula Editor.
Examples
This formula applies the usage estimate setup if a previous reading was found.
Dim res as Hansen.Core.Result = Hansen.Core.Result.Success
res = oMeterReading.GetPreviousReading()
if( res.IsSuccess)
bEstimate = FALSE
else
bEstimate = TRUE
end if
else
bEstimate = FALSE
end if