Dim ValeuraneufHTMontant as decimal
Dim Coefficientdevetuste as decimal
Dim Valeurvenale as decimal
Dim Valeuraneufbonus as decimal
Dim objEvaluationLine as clsLossEvaluationLine
objEvaluationLine=GetObjectToBeUsedForThisClass(GetType(clsLossEvaluationLine).Name, ListOfObjectsToBeUsedInFormula)
Trace("objEvaluationLine found " & objEvaluationLine.AsString(""),7)
if objEvaluationLine isnot nothing then
'we call the rule that is used to enable or disable the "is calculated" dynamic data, the #2
if GetOtherRate("Modifiable - Ligne Evaluation Sinistre Bien Immobilier - Valeur Venale")(0)=False
result(0)=Valeurvenale
else
'we do our calculation of the Valeurvenale
ValeuraneufHTMontant=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"ValeuraneufHTMontant",Nothing,True)
Trace("ValeuraneufHTMontant="& ValeuraneufHTMontant,7)
Coefficientdevetuste=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"Coefficientdevetuste",Nothing,True)
Trace("Coefficientdevetuste="& Coefficientdevetuste,7)
Valeurvenale=clsDynamicMethodOrPropertyCall.Manager.ValueForAPropertyName(objEvaluationLine,"Valeurvenale",Nothing,True)
Trace("Ancienne Valeurvenale="& Valeurvenale,7)
if ValeuraneufHTMontant>0 then
if Coefficientdevetuste<=0 or Coefficientdevetuste>100 then
Coefficientdevetuste=1
Else
Coefficientdevetuste=Coefficientdevetuste/100
end if
result(0)=ValeuraneufHTMontant*Coefficientdevetuste
Else
'invalid user entry of the calculation parameters, so we return the current value
result(0)=Valeurvenale
End if
end if
else
result(0)=0
end if