From 578ea74e8402110aad8e8b75232f699cece03f5b Mon Sep 17 00:00:00 2001 From: Charles Shin Date: Wed, 10 Apr 2019 12:37:53 -0700 Subject: [PATCH] DIV-942: Updated child support amount on F37. --- edivorce/apps/core/templates/pdf/form37.html | 12 ++++------- edivorce/apps/core/templatetags/composites.py | 20 ++++++++++++++++++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/edivorce/apps/core/templates/pdf/form37.html b/edivorce/apps/core/templates/pdf/form37.html index 5a7acd4a..e945ca3f 100644 --- a/edivorce/apps/core/templates/pdf/form37.html +++ b/edivorce/apps/core/templates/pdf/form37.html @@ -229,11 +229,7 @@
  • {% if responses.how_will_calculate_income == 'entered agreement' %} The proposed order sets out that - {% if responses.child_support_in_order == 'DIFF' %} - {{ responses.order_monthly_child_support_amount|money }} - {% else %} - {{ responses.difference_payment_amounts|money }} - {% endif %} + {% monthly_child_support_amount %} is the amount of child support payable by {{ derived.child_support_payor }}, in accordance with the agreement referred to in section 4 of @@ -245,7 +241,7 @@ >{{ responses.child_support_in_order_reason }} {% elif responses.child_support_in_order == 'MATCH' %} The proposed order sets out that - {{ responses.difference_payment_amounts|money }} + {% monthly_child_support_amount %} is the amount of child support payable by {{ derived.child_support_payor }}, which amount accords with the Guidelines. @@ -253,14 +249,14 @@ The proposed order by consent, pursuant to section 15.1(7) of the Divorce Act (Canada) or section 150(2) of the Family Law Act, sets out that - {{ responses.order_monthly_child_support_amount|money }} + {% monthly_child_support_amount %} is the amount of child support payable by {{ derived.child_support_payor }}, which amount is different than the amount required by the Guidelines. {% else %} The proposed order sets out that - {{ responses.order_monthly_child_support_amount|money }} + {% monthly_child_support_amount %} is the amount of child support payable by {{ derived.child_support_payor }}, which amount is different than the amount required by the diff --git a/edivorce/apps/core/templatetags/composites.py b/edivorce/apps/core/templatetags/composites.py index f28664a7..212018a6 100644 --- a/edivorce/apps/core/templatetags/composites.py +++ b/edivorce/apps/core/templatetags/composites.py @@ -4,7 +4,7 @@ users full responses. """ from django import template -from .format_utils import date_formatter +from .format_utils import date_formatter, money from django.utils.html import format_html register = template.Library() @@ -22,3 +22,21 @@ def effective_date(context): else: effective = date_formatter(date) return effective + + +@register.simple_tag(takes_context=True) +def monthly_child_support_amount(context): + """ Returns monthly child support amount based on user's answers """ + + amount = '0.00' + if context['responses'].get('child_support_in_order', '') == 'DIFF': + amount = context['responses'].get('order_monthly_child_support_amount', '') + elif context['responses'].get('child_support_in_order', '') == 'MATCH': + if context['derived'].get('show_fact_sheet_b', '') or context['derived'].get('show_fact_sheet_c', ''): + """ Shared or Split custody """ + amount = context['responses'].get('difference_payment_amounts', '') + else: + """ Sole custody """ + amount = context['derived'].get('schedule_1_amount', '') + + return money(amount)