Browse Source

DIV-814: Adding question F5.0, F6.0, and F7.0 back to fact sheet F

pull/160/head
Benard Ebinu 7 years ago
parent
commit
660bb2e9ee
6 changed files with 217 additions and 130 deletions
  1. +7
    -3
      edivorce/apps/core/static/js/main.js
  2. +141
    -101
      edivorce/apps/core/templates/partials/fact_sheet_f_table.html
  3. +0
    -20
      edivorce/apps/core/templates/pdf/partials/fact_sheet_f.html
  4. +22
    -1
      edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html
  5. +6
    -0
      edivorce/apps/core/templatetags/format_utils.py
  6. +41
    -5
      edivorce/fixtures/Question.json

+ 7
- 3
edivorce/apps/core/static/js/main.js View File

@ -1,5 +1,5 @@
// Reveal sections as the form is loading // Reveal sections as the form is loading
$('input:radio, input:checkbox').each(function () {
var reveal_input_elements = function () {
if ($(this).is(':checked')) { if ($(this).is(':checked')) {
if ($(this).is(':visible')) { if ($(this).is(':visible')) {
reveal($(this)); reveal($(this));
@ -9,7 +9,9 @@ $('input:radio, input:checkbox').each(function () {
$(this).parent().addClass('active'); $(this).parent().addClass('active');
} }
} }
});
};
$('input:radio, input:checkbox').each(reveal_input_elements);
$('input[type=number]').each(function() { $('input[type=number]').each(function() {
if ($(this).is(':visible')) { if ($(this).is(':visible')) {
@ -470,7 +472,9 @@ $(function () {
if (hide) { if (hide) {
$('#fact_sheet_f_table_' + table_suffix).hide(); $('#fact_sheet_f_table_' + table_suffix).hide();
} else { } else {
$('#fact_sheet_f_table_' + table_suffix).show();
var fact_sheet_table_element = $('#fact_sheet_f_table_' + table_suffix);
fact_sheet_table_element.show();
fact_sheet_table_element.find('input:radio, input:checkbox').each(reveal_input_elements);
} }
if (claimant_name_selector) { if (claimant_name_selector) {


+ 141
- 101
edivorce/apps/core/templates/partials/fact_sheet_f_table.html View File

@ -1,107 +1,147 @@
{% load input_field %} {% load input_field %}
{% load format_utils %}
<table class="table table-bordered"> <table class="table table-bordered">
<thead>
<tr>
<th>Payor <span id="fact_sheet_f_payor_title_{{ table_id }}"></span></th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fact-sheet-question">
How many child(ren) are you asking for support?
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="number_children_seeking_support_"|add:claimant_id class="fact-sheet-input" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
What is the monthly
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h11" link_text="Child Support Guidelines" %}
amount for $150,000?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="child_support_amount_under_high_income_"|add:claimant_id class="fact-sheet-input money guideline-amount-"|add:claimant_id data_sum="true" data_sum_class="guideline-amount-"|add:claimant_id data_sum_target_id="total_amount_"|add:claimant_id %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
What is the % of income over $150,000 from the
<thead>
<tr>
<th>Payor <span id="fact_sheet_f_payor_title_{{ table_id }}"></span></th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fact-sheet-question">
How many child(ren) are you asking for support?
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="number_children_seeking_support_"|add:claimant_id class="fact-sheet-input" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
What is the monthly
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h11" link_text="Child Support Guidelines" %} {% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h11" link_text="Child Support Guidelines" %}
?
</td>
<td class="fact-sheet-answer">
<div class="percent-suffix">
{% input_field type="number" name="percent_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input" %}
<label>%</label>
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
What is the monthly child support amount to be paid on the portion of income over
$150,000?
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_high_income_amounts"
aria-controls="collapse_high_income_amounts">
<div>
How can I determine this amount?
</div>
</div>
<div class="collapse" id="collapse_high_income_amounts">
<div>
<p>
The child support tables only show an amount for the first $150,000 of income.
You have
two choices for determining how much child support should be paid on the portion
of
income over $150,000:
</p>
<ul>
<li>
you can multiply the amount of income over $150,000 by the percentage shown
in the
table for the province or territory where the paying parent lives; or
</li>
<li>
you can agree on an additional amount of support based on the condition,
means,
needs and other circumstances of your children and your financial ability to
contribute.
</li>
</ul>
<p>
Source:
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h11" link_text="Federal Child Support Guidelines" %}
, Department of Justice
</p>
</div>
amount for $150,000?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="child_support_amount_under_high_income_"|add:claimant_id class="fact-sheet-input money guideline-amount-"|add:claimant_id data_sum="true" data_sum_class="guideline-amount-"|add:claimant_id data_sum_target_id="total_amount_"|add:claimant_id %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
What is the % of income over $150,000 from the
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h11" link_text="Child Support Guidelines" %}
?
</td>
<td class="fact-sheet-answer">
<div class="percent-suffix">
{% input_field type="number" name="percent_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input" %}
<label>%</label>
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
What is the monthly child support amount to be paid on the portion of income over
$150,000?
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_high_income_amounts"
aria-controls="collapse_high_income_amounts">
<div>
How can I determine this amount?
</div> </div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="amount_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input money guideline-amount-"|add:claimant_id data_sum="true" data_sum_class="guideline-amount-"|add:claimant_id data_sum_target_id="total_amount_"|add:claimant_id %}
</div>
<div class="collapse" id="collapse_high_income_amounts">
<div>
<p>
The child support tables only show an amount for the first $150,000 of income.
You have
two choices for determining how much child support should be paid on the portion
of
income over $150,000:
</p>
<ul>
<li>
you can multiply the amount of income over $150,000 by the percentage shown
in the
table for the province or territory where the paying parent lives; or
</li>
<li>
you can agree on an additional amount of support based on the condition,
means,
needs and other circumstances of your children and your financial ability to
contribute.
</li>
</ul>
<p>
Source:
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h11" link_text="Federal Child Support Guidelines" %}
, Department of Justice
</p>
</div> </div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Guidelines table amount
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="total_guideline_amount_"|add:claimant_id id="total_amount_"|add:claimant_id class="fact-sheet-input money" readonly="" data_mirror="true" data_mirror_target="#agreed_total_amount" data_mirror_broadcast_change="true" %}
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="amount_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input money guideline-amount-"|add:claimant_id data_sum="true" data_sum_class="guideline-amount-"|add:claimant_id data_sum_target_id="total_amount_"|add:claimant_id data_mirror="true" data_mirror_target="#agreed_child_support_amount_"|add:claimant_id data_mirror_broadcast_change="true"%}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Guidelines table amount
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="total_guideline_amount_"|add:claimant_id id="total_amount_"|add:claimant_id class="fact-sheet-input money" readonly="" data_mirror="true" data_mirror_target="#agreed_total_amount" data_mirror_broadcast_change="true" %}
</div>
</td>
</tr>
</tbody>
</table>
<div class="question-well-border-less">
<h3>
Do you and your spouse agree that $<span
id="agreed_child_support_amount_{{ claimant_id }}">{% agreed_child_support_amount claimant_id %}</span> is the child support amount?
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="agree_to_child_support_amount_"|add:claimant_id autocomplete="off" value="YES" data_target_id="enter_agreed_appropriate_amount_"|add:claimant_id data_reveal_target="false" %}
YES
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="agree_to_child_support_amount_"|add:claimant_id autocomplete="off" value="NO" data_target_id="enter_agreed_appropriate_amount_"|add:claimant_id data_reveal_target="true" %}
NO
</label>
</div>
<div id="enter_agreed_appropriate_amount_{{ claimant_id }}" hidden>
<h3>
What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?
</h3>
<div>
<div class="dollar-prefix">
{% money_input_field name="agreed_child_support_amount_"|add:claimant_id value="" class="fact-sheet-input money" %}
</div>
</div>
<h3>
Why do you think the court should approve your proposed amount?
</h3>
<p>
Discuss the conditions, means, needs and other circumstances of the child, and the financial
ability of
each parent to support the child/children.
</p>
<div>
{% input_field type="textarea" name="reason_child_support_amount_"|add:claimant_id class="fact-sheet-input form-control response-textarea" maxlength="1000" rows="6" %}
</div>
</div>
</div>

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

@ -10,25 +10,5 @@
{% include 'pdf/partials/fact_sheet_f_table.html' with claimant_id='spouse'%} {% include 'pdf/partials/fact_sheet_f_table.html' with claimant_id='spouse'%}
{% endif %} {% endif %}
{% 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>{{ responses.reason_child_support_amount|linebreaksbr }}</p>
</li>
</ol>
</p>
<p>
</p>
{% endif %}
</div> </div>
{% endif %} {% endif %}

+ 22
- 1
edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html View File

@ -45,4 +45,25 @@ Income Over $150,000
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table>
</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>{% lookup responses 'agreed_child_support_amount_'|add:claimant_id %}, and</li>
<li>
<p>differs from the Guidelines table amount because:</p>
<p>{% lookup responses 'reason_child_support_amount_'|add:claimant_id %}</p>
</li>
</ol>
</p>
<p>
</p>
{% endif %}

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

@ -174,3 +174,9 @@ def integer(value):
def lookup(obj, property): def lookup(obj, property):
""" Return the value of a dynamic property within an object""" """ Return the value of a dynamic property within an object"""
return obj.get(property, '') return obj.get(property, '')
@register.simple_tag(takes_context=True)
def agreed_child_support_amount(context, claimant_id):
"""Return the agree amount for the specific claimant fact sheet table."""
return linebreaksli(context.get('amount_income_over_high_income_limit_{}'.format(claimant_id), ''))

+ 41
- 5
edivorce/fixtures/Question.json View File

@ -1009,7 +1009,7 @@
}, },
{ {
"fields": { "fields": {
"name": "What is the amount that you and your spouse have agreed to?",
"name": "Do you and your spouse agree that amount is he child support amount?",
"description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F",
"summary_order": 0, "summary_order": 0,
"required": "Conditional", "required": "Conditional",
@ -1017,11 +1017,47 @@
"reveal_response": ">150000" "reveal_response": ">150000"
}, },
"model": "core.question", "model": "core.question",
"pk": "agree_to_child_support_amount"
"pk": "agree_to_child_support_amount_you"
}, },
{ {
"fields": { "fields": {
"name": "What is the amount that you and your spouse have agreed to?",
"name": "Do you and your spouse agree that amount is he child support amount?",
"description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "agree_to_child_support_amount_spouse"
},
{
"fields": {
"name": "What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?",
"description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimants_agree_to_child_support_amount",
"reveal_response": "NO"
},
"model": "core.question",
"pk": "agreed_child_support_amount_you"
},
{
"fields": {
"name": "What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?",
"description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimants_agree_to_child_support_amount",
"reveal_response": "NO"
},
"model": "core.question",
"pk": "agreed_child_support_amount_spouse"
},
{
"fields": {
"name": "Why do you think the court should approve your proposed amount?",
"description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F",
"summary_order": 0, "summary_order": 0,
"required": "Conditional", "required": "Conditional",
@ -1029,7 +1065,7 @@
"reveal_response": "NO" "reveal_response": "NO"
}, },
"model": "core.question", "model": "core.question",
"pk": "agreed_child_support_amount"
"pk": "reason_child_support_amount_you"
}, },
{ {
"fields": { "fields": {
@ -1041,7 +1077,7 @@
"reveal_response": "NO" "reveal_response": "NO"
}, },
"model": "core.question", "model": "core.question",
"pk": "reason_child_support_amount"
"pk": "reason_child_support_amount_spouse"
}, },
{ {
"fields": { "fields": {


Loading…
Cancel
Save