Browse Source

DIV-578

pull/160/head
Justin Johnson 8 years ago
parent
commit
9abaa0d78f
11 changed files with 635 additions and 17 deletions
  1. +21
    -0
      edivorce/apps/core/static/css/weasyprint.css
  2. +14
    -5
      edivorce/apps/core/templates/pdf/form37_we.html
  3. +7
    -5
      edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html
  4. +85
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_b.html
  5. +72
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_c.html
  6. +39
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html
  7. +180
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_e.html
  8. +67
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_f.html
  9. +3
    -2
      edivorce/apps/core/templates/question/06_children_facts.html
  10. +30
    -0
      edivorce/apps/core/templatetags/format_utils.py
  11. +117
    -5
      edivorce/apps/core/utils/derived.py

+ 21
- 0
edivorce/apps/core/static/css/weasyprint.css View File

@ -220,3 +220,24 @@ ol.numbered-paragraphs li {
.fact-sheet .table.table-bordered tbody tr .total { .fact-sheet .table.table-bordered tbody tr .total {
text-align: right; text-align: right;
} }
ol.parens-list {
counter-reset: list;
margin-bottom: 10px;
}
ol.parens-list > li {
list-style: none;
position: relative;
}
ol.parens-list > li:before {
counter-increment: list;
content: "(" counter(list, lower-alpha) ") ";
position: absolute;
left: -2.5em;
}
.th-left {
text-align: left !important;
}

+ 14
- 5
edivorce/apps/core/templates/pdf/form37_we.html View File

@ -165,7 +165,8 @@
</li> </li>
<li> <li>
<ol style="list-style-type: lower-alpha">
{% if responses.how_will_calculate_income == 'using specific rules' %}
<ol style="list-style-type: lower-alpha;">
<li>Claimant 1's annual income as determined under sections 15 to <li>Claimant 1's annual income as determined under sections 15 to
20 of the Guidelines: 20 of the Guidelines:
{{ responses.annual_gross_income|money }} {{ responses.annual_gross_income|money }}
@ -174,11 +175,14 @@
20 of the Guidelines: 20 of the Guidelines:
{{ responses.spouse_annual_gross_income|money }} {{ responses.spouse_annual_gross_income|money }}
</li> </li>
<li>Claimant 1 and Claimant 2 have entered into an agreement as
to income pursuant to section 15(2) of the Guidelines, a copy
of which agreement is attached.</li>
<li>Section 4 is omitted as inapplicable.</li>
</ol> </ol>
{% elif responses.how_will_calculate_income == 'entered agreement' %}
Claimant 1 and Claimant 2 have entered into an agreement as to
income pursuant to section 15(2) of the Guidelines, a copy of which
agreement is attached.
{% else %}
Section 4 is omitted as inapplicable.
{% endif %}
</li> </li>
<li> <!-- 5 --> <li> <!-- 5 -->
@ -301,6 +305,11 @@
{% include 'pdf/partials/notary_signature.html' with name=responses.name_you %} {% include 'pdf/partials/notary_signature.html' with name=responses.name_you %}
{% include 'pdf/partials/notary_signature.html' with name=responses.name_spouse %} {% include 'pdf/partials/notary_signature.html' with name=responses.name_spouse %}
{% include 'pdf/partials/fact_sheet_a.html' %} {% include 'pdf/partials/fact_sheet_a.html' %}
{% include 'pdf/partials/fact_sheet_b.html' %}
{% include 'pdf/partials/fact_sheet_c.html' %}
{% include 'pdf/partials/fact_sheet_d.html' %}
{% include 'pdf/partials/fact_sheet_e.html' %}
{% include 'pdf/partials/fact_sheet_f.html' %}
<small>Printed on {% now "F jS, Y" %} from https://justice.gov.bc.ca/divorce</small> <small>Printed on {% now "F jS, Y" %} from https://justice.gov.bc.ca/divorce</small>
</div> </div>


+ 7
- 5
edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html View File

@ -1,4 +1,5 @@
{% load format_utils %} {% load format_utils %}
{% if derived.show_fact_sheet_a %}
<div class="fact-sheet"> <div class="fact-sheet">
<h3> <h3>
Supplementary Child Support Fact Sheet A<br> Supplementary Child Support Fact Sheet A<br>
@ -7,13 +8,13 @@
<p>Section 7 expenses (net of tax credits and contribution from child, etc.):</p> <p>Section 7 expenses (net of tax credits and contribution from child, etc.):</p>
<table class="table table-bordered">
<table class="table table-fixed table-bordered">
<tbody> <tbody>
<tr> <tr>
<th></th>
<th></th>
<th>Annual</th>
<th>Monthly</th>
<th class="line-number" style="width: 5%"></th>
<th style="width: 65%"></th>
<th style="width: 15%">Annual</th>
<th style="width: 15%">Monthly</th>
</tr> </tr>
<tr> <tr>
<td class="line-number">A</td> <td class="line-number">A</td>
@ -124,3 +125,4 @@
{{ derived.total_monthly_support_1_and_a|money }} {{ derived.total_monthly_support_1_and_a|money }}
</p> </p>
</div> </div>
{% endif %}

+ 85
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_b.html View File

@ -0,0 +1,85 @@
{% load format_utils %}
{% if derived.show_fact_sheet_b %}
<div class="fact-sheet">
<h3>
Supplementary Child Support Fact Sheet B:<br>
If the Circumstances Described in s. 9 of the Child Support Guidelines Exist
</h3>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="width: 70%;"></th>
<th style="width: 15%;">Claimant 1</th>
<th style="width: 15%;">Claimant 2</th>
</tr>
<tr>
<td></td>
<td class="percentage">{{ derived.claimant_1_share_proportion|stringformat:".1f" }} %</td>
<td class="amount">$
<span class="actual">{{ derived.claimant_1_share|money:False }}</span>
</td>
</tr>
<tr>
<td colspan="3">Number of children: {{ responses.number_of_children }}</td>
</tr>
<tr>
<td>Approximate percentage of time children spend with each parent</td>
<td class="percentage">{{ responses.time_spent_with_you }} %</td>
<td class="percentage">{{ responses.time_spent_with_spouse }} %</td>
</tr>
<tr>
<td>Annual Guidelines Income</td>
<td class="amount">$
<span class="actual">{{ responses.annual_gross_income|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.spouse_annual_gross_income|money:False }}</span>
</td>
</tr>
<tr>
<td>Guidelines Table Amount</td>
<td class="amount">$
<span class="actual">{{ responses.total_paid_child_support|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.total_spouse_paid_child_support|money:False }}</span>
</td>
</tr>
<tr>
<td>
Difference between the Guidelines table amount of Claimant 1 and the
Guidelines table amount of Claimant 2
</td>
<td colspan="2" class="amount">$
<span class="actual">{{ derived.guideline_amounts_difference|money:False }}</span>
</td>
</tr>
<tr>
<td>Section 7 expenses paid directly by each party</td>
<td class="amount">$
<span class="actual">{{ derived.claimant_1_share|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ derived.claimant_2_share|money:False }}</span>
</td>
</tr>
</tbody>
</table>
<p>
Any other relevant information regarding the conditions, means, needs and
other circumstances of each spouse or of any child for whom support is
sought:
</p>
<p style="min-height: 4em;">{{ responses.additional_relevant_spouse_children_info }}</p>
<p>
It is proposed that child support in the amount of
{{ derived.total_monthly_support_1_and_a|money }}
per month be paid by {{ derived.child_support_payor }}.
</p>
</div>
{% endif %}

+ 72
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_c.html View File

@ -0,0 +1,72 @@
{% load format_utils %}
{% if derived.show_fact_sheet_c %}
<div class="fact-sheet">
<h3>
Supplementary Child Support Fact Sheet C:<br>
If the Circumstances Described in s. 8 of the Child Support Guidelines Exist
</h3>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="width: 5%;"></th>
<th style="width: 80%;"></th>
<th style="width: 15%;">Amount</th>
</tr>
<tr>
<td class="line-number">A</td>
<td>Number of children principally resident with Claimant 1 for whom support is claimed</td>
<td class="amount">
<span class="actual">{{ responses.number_of_children_claimant }}</span>
</td>
</tr>
<tr>
<td class="line-number">B</td>
<td>Claimant 2's annual Guidelines income</td>
<td class="amount">$
<span class="actual">{{ responses.spouse_annual_gross_income|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">C</td>
<td>
Guidelines table amount payable by Claimant 2 for
{{ responses.number_of_children_claimant|child_or_children }}
</td>
<td class="amount">$
<span class="actual">{{ responses.total_spouse_paid_child_support|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">D</td>
<td>Number of children principally resident with Claimant 2 for whom support is claimed</td>
<td class="amount">
<span class="actual">{{ responses.number_of_children_claimant }}</span>
</td>
</tr>
<tr>
<td class="line-number">E</td>
<td>Claimant 1's annual Guidelines income</td>
<td class="amount">$
<span class="actual">{{ responses.annual_gross_income|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">F</td>
<td>
Guidelines table amount payable by Claimant 1 for
{{ responses.number_of_children_claimant|child_or_children }}
</td>
<td class="amount">$
<span class="actual">{{ responses.total_paid_child_support|money:False }}</span>
</td>
</tr>
</tbody>
</table>
<p>
Difference between the Guidelines table amounts at Lines C and F:
{{ derived.guideline_amounts_difference|money }}
</p>
</div>
{% endif %}

+ 39
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html View File

@ -0,0 +1,39 @@
{% load format_utils %}
{% if derived.show_fact_sheet_d %}
<div class="fact-sheet">
<h3>
Supplementary Child Support Fact Sheet D:<br>
Child(ren) 19 Years or Older
</h3>
<ol class="parens-list">
<li>
Number of child(ren) 19 years of age or older for whom support is claimed:
{{ responses.number_children_over_19_need_support }}
</li>
<li>
Child support is to be paid by {{ derived.child_support_payor }} (the “payor”)
</li>
<li>
Monthly Guidelines table amount of the payor under Schedule 1 of the Guidelines:
{{ derived.schedule_1_amount|money }}
</li>
</ol>
{% if responses.does_payour_amount_match_guidelines == 'YES' %}
<p>
The person swearing this affidavit says that the Guidelines table amount
is appropriate.
</p>
{% else %}
<p>
The person swearing this affidavit says that the Guidelines table amount
is inappropriate and that the appropriate amount would be
{{ responses.order_monthly_child_support_amount|money }}
for the following reasons:
</p>
<p>
</p>
{% endif %}
</div>
{% endif %}

+ 180
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_e.html View File

@ -0,0 +1,180 @@
{% load format_utils %}
{% if derived.show_fact_sheet_e %}
<div class="fact-sheet">
<h3>
Supplementary Child Support Fact Sheet E:<br>
Undue Hardship
</h3>
<ol>
{% if derived.claimant_debts %}
<li>
<p>
Responsibility for unusually high debts reasonably incurred to support
the family before separation or in order to earn a living
</p>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="text-align: left; width: 40%;">Debt Owed To</th>
<th style="text-align: left; width: 40%;">Terms of Debt</th>
<th style="width: 20%;">Monthly Amount</th>
</tr>
{% for debt in derived.claimant_debts %}
<tr>
<td>{{ debt.debt_name }}</td>
<td>{{ debt.debt_terms }}</td>
<td class="amount">$
<span class="actual">{{ debt.debt_monthly_amount|money:False }}</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
{% endif %}
{% if derived.claimant_expenses %}
<li>
<p>
Unusually high expenses for exercising parenting time or contact with,
or access to a child
</p>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="text-align: left; width: 80%;">Details of Expense</th>
<th style="width: 20%;">Amount</th>
</tr>
{% for expense in derived.claimant_expenses %}
<tr>
<td>{{ expense.expense_name }}</td>
<td class="amount">$
<span class="actual">{{ expense.expense_amount|money:False }}</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
{% endif %}
{% if derived.supported_non_dependents %}
<li>
<p>
Legal duty under a court order or separation agreement to support
another person
</p>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="text-align: left; width: 20%;">Name of Person</th>
<th style="text-align: left; width: 20%;">Relationship</th>
<th style="text-align: left; width: 60%;">Nature of Duty</th>
</tr>
{% for supported in derived.supported_non_dependents %}
<tr>
<td>{{ supported.non_dependent_name }}</td>
<td>{{ supported.non_dependent_relationship }}</td>
<td>{{ supported.non_dependent_reason }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
{% endif %}
{% if derived.supported_dependents %}
<li>
<p>Legal duty to support a child, other than a child for whom support is claimed, who is</p>
<ol class="parens-list">
<li>Under age 19, or</li>
<li>
19 or older but unable to support himself or herself because of
illness, disability or other cause
</li>
</ol>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="text-align: left; width: 20%;">Name of Person</th>
<th style="text-align: left; width: 20%;">Relationship</th>
<th style="text-align: left; width: 60%;">Nature of Duty</th>
</tr>
{% for supported in derived.supported_dependents %}
<tr>
<td>{{ supported.supporting_dependent_name }}</td>
<td>{{ supported.supporting_dependent_relationship }}</td>
<td>{{ supported.supporting_dependent_reason }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
{% endif %}
{% if derived.supported_disabled %}
<li>
<p>
Legal duty to support a person who is unable to support himself or
herself because of illness ordisability
</p>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="text-align: left; width: 20%;">Name of Person</th>
<th style="text-align: left; width: 20%;">Relationship</th>
<th style="text-align: left; width: 60%;">Nature of Duty</th>
</tr>
{% for supported in derived.supported_disabled %}
<tr>
<td>{{ supported.supporting_disabled_name }}</td>
<td>{{ supported.supporting_disabled_relationship }}</td>
<td>{{ supported.supporting_disabled_reason }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</li>
<li>
<p>Other undue hardship circumstances:</p>
<p>{{ responses.undue_hardship|linebreaksbr }}</p>
</li>
</ol>
{% if derived.others_income %}
<h3>Income of Other Persons in Household</h3>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<th style="width: 80%;">Name of Person</th>
<th style="width: 20%;">Annual Income</th>
</tr>
{% for income in derived.others_income %}
<tr>
<td>{{ income.income_others_name }}</td>
<td class="amount">$
<span class="actual">{{ income.income_others_amount|money:False }}</span>
</td>
</tr>
{% endfor %}
<tr>
<td class="total">Total</td>
<td class="amount">$
<span class="actual">{{ derived.total_others_income|money:False }}</span>
</td>
</tr>
</tbody>
</table>
{% endif %}
</div>
{% endif %}

+ 67
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_f.html View File

@ -0,0 +1,67 @@
{% load format_utils %}
{% if derived.show_fact_sheet_f %}
<div class="fact-sheet">
<h3>
Supplementary Child Support Fact Sheet F:<br>
Income Over $150,000
</h3>
<table class="table table-fixed table-bordered">
<tbody>
<tr>
<td class="line-number" style="width: 5%;">A</td>
<td style="width: 80%;">
Number of children for whom support is claimed:
{{ responses.number_children_seeking_support }}
</td>
<td class="amount" style="width: 15%;"></td>
</tr>
<tr>
<td class="line-number">B</td>
<td>Guidelines table amount for $150,000</td>
<td class="amount">$
<span class="actual">{{ responses.child_support_amount_under_high_income|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">C</td>
<td>
Plus {{ responses.percent_income_over_high_income_limit }}%
of income over $150,000
</td>
<td class="amount">$
<span class="actual">{{ responses.amount_income_over_high_income_limit|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">D</td>
<td class="total">Guidelines table amount</td>
<td class="amount">$
<span class="actual">{{ derived.high_income_amount|money:False }}</span>
</td>
</tr>
</tbody>
</table>
{% if responses.does_payour_amount_match_guidelines == 'YES' %}
<p>
We have agreed on the Guidelines table amount set out at Line D above as
the amount of child support.
</p>
{% else %}
<p>
We have agreed on an amount of child support that differs from the Guidelines table amount and the amount of child support agreed on is:
<ol class="parens-list">
<li>{{ responses.order_monthly_child_support_amount|money }}, and</li>
<li>
<p>differs from the Guidelines table amount because:</p>
<p>reasons</p>
</li>
</ol>
</p>
<p>
</p>
{% endif %}
</div>
{% endif %}

+ 3
- 2
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load format_utils %}
{% load step_order %} {% load step_order %}
{% load format_utils %} {% load format_utils %}
@ -637,7 +638,7 @@
</div> </div>
{% endif %} {% endif %}
{% if annual_gross_income|add:"0" > 150000 %}
{% if annual_gross_income|integer > 150000 %}
<div id="annual_gross_income_question"> <div id="annual_gross_income_question">
<div class="question-well" id="you_fact_sheet_f"> <div class="question-well" id="you_fact_sheet_f">
<h1>Income over $150,000 (Fact Sheet F)</h1> <h1>Income over $150,000 (Fact Sheet F)</h1>
@ -873,4 +874,4 @@
{% block sidebarText %} {% block sidebarText %}
<p><strong>The Federal Child Support Guidelines</strong></p> <p><strong>The Federal Child Support Guidelines</strong></p>
<p><a href="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/toc-tdm.html" target="_blank">Step-by-Step guide</a></p> <p><a href="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/toc-tdm.html" target="_blank">Step-by-Step guide</a></p>
{% endblock %}
{% endblock %}

+ 30
- 0
edivorce/apps/core/templatetags/format_utils.py View File

@ -1,3 +1,6 @@
# pylint: disable=invalid-name
""" Template formatting helpers """
from datetime import datetime from datetime import datetime
import locale import locale
import re import re
@ -83,6 +86,7 @@ def checkbox(context, *args, **kwargs):
return mark_safe('<i class="fa fa%s-square-o" aria-hidden="true"></i>' % return mark_safe('<i class="fa fa%s-square-o" aria-hidden="true"></i>' %
('-check' if args_pass and kwargs_pass else '')) ('-check' if args_pass and kwargs_pass else ''))
@register.filter @register.filter
def claimantize(value, claimant='1'): def claimantize(value, claimant='1'):
""" Replace 'you' with 'claimant 1' and 'spouse' with 'claimant 2' """ """ Replace 'you' with 'claimant 1' and 'spouse' with 'claimant 2' """
@ -90,6 +94,7 @@ def claimantize(value, claimant='1'):
value = value.replace('spouse', 'claimant\xa0%s' % '2' if claimant == '1' else '1') value = value.replace('spouse', 'claimant\xa0%s' % '2' if claimant == '1' else '1')
return value return value
@register.filter @register.filter
def age(date): def age(date):
""" """
@ -136,4 +141,29 @@ def payorize(context):
return payor return payor
@register.filter
def child_or_children(value):
""" Return num followed by 'child' or 'children' as appropriate """
try:
value = int(value)
except ValueError:
return ''
if value == 1:
return '1 child'
return '%d children'
@register.filter
def integer(value):
""" Return value as an int or nothing """
try:
print(value)
print(float(value))
print(int(float(value)))
return int(float(value))
except ValueError:
return ''

+ 117
- 5
edivorce/apps/core/utils/derived.py View File

@ -1,4 +1,4 @@
# pylint: disable=W0613
# pylint: disable=W0613,C0103
"""Values derived from a user's responses. """Values derived from a user's responses.
This module provides functions to take a set of responses from a user and create This module provides functions to take a set of responses from a user and create
@ -46,6 +46,15 @@ DERIVED_DATA = [
'claimant_2_share_proportion', 'claimant_2_share_proportion',
'claimant_2_share', 'claimant_2_share',
'total_monthly_support_1_and_a', 'total_monthly_support_1_and_a',
'guideline_amounts_difference',
'claimant_debts',
'claimant_expenses',
'supported_dependents',
'supported_non_dependents',
'supported_disabled',
'others_income',
'total_others_income',
'high_income_amount',
] ]
@ -168,12 +177,12 @@ def show_fact_sheet_f(responses, derived):
""" """
try: try:
annual = int(responses.get('annual_gross_income', 0))
annual = float(responses.get('annual_gross_income', 0))
except ValueError: except ValueError:
annual = 0 annual = 0
try: try:
spouses = int(responses.get('spouse_annual_gross_income', 0))
spouses = float(responses.get('spouse_annual_gross_income', 0))
except ValueError: except ValueError:
spouses = 0 spouses = 0
@ -314,7 +323,7 @@ def claimant_1_share_proportion(responses, derived):
def claimant_1_share(responses, derived): def claimant_1_share(responses, derived):
""" """
Return the proportionate share of claimant 1 for child support, based on
Return the proportionate amount of claimant 1 for child support, based on
annual income. annual income.
""" """
@ -335,7 +344,7 @@ def claimant_2_share_proportion(responses, derived):
def claimant_2_share(responses, derived): def claimant_2_share(responses, derived):
""" """
Return the proportionate share of claimant 2 for child support, based on
Return the proportionate amount of claimant 2 for child support, based on
annual income. annual income.
""" """
@ -354,3 +363,106 @@ def total_monthly_support_1_and_a(responses, derived):
else: else:
total += derived['total_section_seven_expenses'] total += derived['total_section_seven_expenses']
return total return total
def guideline_amounts_difference(responses, derived):
"""
Return the difference between the guideline amounts to be paid by
claimant 1 and claimant 2
"""
try:
amount_1 = float(responses.get('total_paid_child_support', 0))
except ValueError:
amount_1 = 0
try:
amount_2 = float(responses.get('total_spouse_paid_child_support', 0))
except ValueError:
amount_2 = 0
return abs(amount_1 - amount_2)
def claimant_debts(responses, derived):
""" Return the parsed array of claimant_debts """
try:
return json.loads(responses.get('claimant_debts', []))
except ValueError:
return []
def claimant_expenses(responses, derived):
""" Return the parsed array of claimant_expenses """
try:
return json.loads(responses.get('claimant_expenses', []))
except ValueError:
return []
def supported_dependents(responses, derived):
""" Return the parsed array of supporting_dependents """
try:
return json.loads(responses.get('supporting_dependents', []))
except ValueError:
return []
def supported_non_dependents(responses, derived):
""" Return the parsed array of supporting_non_dependents """
try:
return json.loads(responses.get('supporting_non_dependents', []))
except ValueError:
return []
def supported_disabled(responses, derived):
""" Return the parsed array of supporting_disabled """
try:
return json.loads(responses.get('supporting_disabled', []))
except ValueError:
return []
def others_income(responses, derived):
""" Return the parsed array of income_others """
try:
return json.loads(responses.get('income_others', []))
except ValueError:
return []
def total_others_income(responses, derived):
""" Return the total of other incomes """
total = 0.0
for income in derived['others_income']:
try:
total += float(income['income_others_amount'])
except ValueError:
pass
return total
def high_income_amount(responses, derived):
""" Return the guidelines table amount for a high income earner """
try:
under = float(responses.get('child_support_amount_under_high_income', 0))
except ValueError:
under = 0
try:
over = float(responses.get('amount_income_over_high_income_limit', 0))
except ValueError:
over = 0
return under + over

Loading…
Cancel
Save