sunlight-b of Sunlight BA Team
4/26/2018 - 4:39 PM

Loss evaluation line calculation (get dynamic data and compute them)

we call this rule from a loss evaluation line. It returns the evaluation of the damage When it is called in the loss declaration process, we do not have all the calculation data available so we return the value claimed by the claimant When it is called in the claim process, we do have the calculation data available and so we execute the calculation

		Dim objEvaluationLine as clsLossEvaluationLine
		Dim ValeuraneufHTMontant as decimal
		Dim Coefficientdevetuste as decimal
		Dim Valeurvenale as decimal
		Dim Valeuraneufbonus as decimal

		Dim objClaim As clsClaim
		objClaim = GetObjectToBeUsedForThisClass(GetType(clsClaim).Name, ListOfObjectsToBeUsedInFormula)
		
		objEvaluationLine=GetObjectToBeUsedForThisClass(GetType(clsLossEvaluationLine).Name, ListOfObjectsToBeUsedInFormula)
		Trace("objEvaluationLine  found " & objEvaluationLine.AsString(""),7)
		if objEvaluationLine isnot nothing then
		
			ValeuraneufHTMontant=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"ValeuraneufHTMontant",Nothing,True)
			Trace("ValeuraneufHTMontant="& ValeuraneufHTMontant,7)
			Trace("objClaim status " & objClaim.ClaimStatus , 7)
			
			if objClaim.ClaimStatus=1 then
				'loss declaration
				result(0)=ValeuraneufHTMontant
			else
			
				Coefficientdevetuste=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"Coefficientdevetuste",Nothing,True)
				Trace("Coefficientdevetuste="& Coefficientdevetuste,7)
				Valeurvenale=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"Valeurvenale",Nothing,True)
				Trace("Valeurvenale="& Valeurvenale,7)
				Valeuraneufbonus=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"Valeuraneufbonus",Nothing,True)
				Trace("Valeuraneufbonus="& Valeuraneufbonus,7)
				if Valeuraneufbonus>0 then
					result(0)=Valeurvenale*(1+(Valeuraneufbonus/100))
					if result(0)>ValeuraneufHTMontant then
						result(0)=ValeuraneufHTMontant
					end if
				Else
					result(0)=Valeurvenale
				End if
			End If
		else
			result(0)=0
		end if