diff --git a/calculation/calculation_rule.py b/calculation/calculation_rule.py index 7e4d9f7..6fa1374 100644 --- a/calculation/calculation_rule.py +++ b/calculation/calculation_rule.py @@ -29,7 +29,7 @@ class ContributionValuationRule(AbsStrategy): def active_for_object(cls, instance, context, type='account_receivable', sub_type='contribution'): return ( instance.__class__.__name__ == "ContractContributionPlanDetails" - and context in ["value", "members", "validity"] + and context in ["value", "members", "validity"] ) and cls.check_calculation(instance) @classmethod @@ -46,8 +46,8 @@ def check_calculation(cls, instance): elif class_name == "ContributionPlan": match = UUID(str(cls.uuid)) == UUID(str(instance.calculation)) elif class_name == "ContributionPlanBundle": - list_cpbd = list(ContributionPlanBundleDetails.objects.filter( - contribution_plan_bundle=instance + list_cpbd = list(instance.contributionplanbundledetails_set.filter( + is_deleted=False )) for cpbd in list_cpbd: if match is False: