Browse Source

DIV-823: show fact sheet f for both claimants over 50K in form 37

pull/160/head
Benard Ebinu 7 years ago
parent
commit
760a54cbab
5 changed files with 94 additions and 45 deletions
  1. +7
    -40
      edivorce/apps/core/templates/pdf/partials/fact_sheet_f.html
  2. +48
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html
  3. +10
    -0
      edivorce/apps/core/templatetags/format_utils.py
  4. +2
    -1
      edivorce/apps/core/templatetags/summary_format.py
  5. +27
    -4
      edivorce/apps/core/utils/derived.py

+ 7
- 40
edivorce/apps/core/templates/pdf/partials/fact_sheet_f.html View File

@ -1,47 +1,14 @@
{% 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 derived.show_fact_sheet_f_you %}
{% include 'pdf/partials/fact_sheet_f_table.html' with claimant_id='you'%}
{% endif %}
{% if derived.show_fact_sheet_f_spouse %}
{% include 'pdf/partials/fact_sheet_f_table.html' with claimant_id='spouse'%}
{% endif %}
{% if responses.does_payour_amount_match_guidelines == 'YES' %}
<p>


+ 48
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html View File

@ -0,0 +1,48 @@
{% load format_utils %}
<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:
{% lookup responses 'number_children_seeking_support_'|add:claimant_id %}
</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">
{% lookup responses 'child_support_amount_under_high_income_'|add:claimant_id True %}
</span>
</td>
</tr>
<tr>
<td class="line-number">C</td>
<td>
Plus
{% lookup responses 'percent_income_over_high_income_limit_'|add:claimant_id %}%
of income over $150,000
</td>
<td class="amount">$
<span class="actual">
{% lookup responses 'amount_income_over_high_income_limit_'|add:claimant_id True %}
</span>
</td>
</tr>
<tr>
<td class="line-number">D</td>
<td class="total">Guidelines table amount</td>
<td class="amount">$
<span class="actual">
{% lookup responses 'total_guideline_amount_'|add:claimant_id True %}
</span>
</td>
</tr>
</tbody>
</table>

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

@ -168,3 +168,13 @@ def integer(value):
return int(float(value))
except ValueError:
return ''
@register.simple_tag()
def lookup(obj, property, money_format=None):
""" Return the value of a dynamic property within an object"""
val = obj.get(property, '')
# if money_format:
# return money(val)
# else:
return val

+ 2
- 1
edivorce/apps/core/templatetags/summary_format.py View File

@ -170,7 +170,8 @@ def format_children(context, source):
show_fact_sheet = True
elif question == 'Undue Hardship (Fact Sheet E)' and context['derived']['show_fact_sheet_e']:
show_fact_sheet = True
elif question == 'Income over $150,000 (Fact Sheet F)' and context['derived']['show_fact_sheet_f']:
elif question == 'Income over $150,000 (Fact Sheet F)' and (
context['derived']['show_fact_sheet_f_you'] or context['derived']['show_fact_sheet_f_spouse']):
show_fact_sheet = True
if show_fact_sheet and len(fact_sheet_mapping[question]):


+ 27
- 4
edivorce/apps/core/utils/derived.py View File

@ -30,6 +30,8 @@ DERIVED_DATA = [
'show_fact_sheet_d',
'show_fact_sheet_e',
'show_fact_sheet_f',
'show_fact_sheet_f_you',
'show_fact_sheet_f_spouse',
'has_fact_sheets',
'schedule_1_amount',
'child_support_payor',
@ -195,6 +197,16 @@ def show_fact_sheet_f(responses, derived):
"""
If one of the claimants earns over $150,000, Fact Sheet F is indicated.
"""
return show_fact_sheet_f_you(responses, derived) or show_fact_sheet_f_spouse(responses, derived)
def show_fact_sheet_f_you(responses, derived):
"""
:param responses:
:param derived:
:return:
"""
payor = child_support_payor(responses, derived)
try:
@ -202,12 +214,24 @@ def show_fact_sheet_f(responses, derived):
except ValueError:
annual = 0
return (payor == 'Claimant 1' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000
def show_fact_sheet_f_spouse(responses, derived):
"""
:param responses:
:param derived:
:return:
"""
payor = child_support_payor(responses, derived)
try:
spouses = float(responses.get('spouse_annual_gross_income', 0))
annual = float(responses.get('spouse_annual_gross_income', 0))
except ValueError:
spouses = 0
annual = 0
return (payor == 'Claimant 1' and annual > 150000) or (payor == 'Claimant 2' and spouses > 150000)
return (payor == 'Claimant 2' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000
def has_fact_sheets(responses, derived):
@ -552,7 +576,6 @@ def pursuant_parenting_arrangement(responses, derived):
act = 'Pursuant to %s,' % act if act != '' else act
try:
arrangements = responses.get('order_respecting_arrangement', '').split('\n')
print(arrangements)
return ['%s %s' % (act, arrangement.strip())
for arrangement in arrangements
if len(arrangement.strip()) > 0]


Loading…
Cancel
Save