contributionValuationRule inherit from absCalculationRule
static version = 1
status = active
static UUID = 0e1b6dd4-04a0-4ee6-ac47-2a99cfa5e9a8
static CalculationRuleName = “CV: percent of income “
...
dateValidFrom = 2000-01-01
static description = “ This calcutation will add the income in the contract details and PHinsuree and the percentage in the Contribution plan so when a contract valuation is requested then the calculation will determine the value based on the contract details income and CP percentage “
list of impacted class and parameters
{class:"ContributionPlan", ‘parameters':[
...
relevance and condition are Nice to have.
Methods
ready()
Make sure the now is within dataValid (or after dateValidFrom if dateValidTo is None)
...
getParameter to getParameter signal
getLinkedClass ot getLinkedClass signal
activeForObject(self, instance, context)
instance.__class__ == CCPD and context IN (create,update) and self.checkCalculation(instance)
checkCalculation(self, instance)
class= class of instance
match = False
...
if checkCalculation(cp)
match = True
break
}
calculate(instance)
if instance.__class__ == ContractContributionPlanDetails
...
return CCPD.value
else Return False
getLinkedClass(classname)
ListClass = []
if class == ContributionPlan or class == None
...