Browse Source

DIV-823: show fact sheet F if either or both payor's have income over 50k

pull/160/head
Benard Ebinu 7 years ago
parent
commit
2f60f46614
4 changed files with 208 additions and 114 deletions
  1. +30
    -4
      edivorce/apps/core/static/js/main.js
  2. +107
    -0
      edivorce/apps/core/templates/partials/fact_sheet_f_table.html
  3. +6
    -105
      edivorce/apps/core/templates/question/06_children_facts.html
  4. +65
    -5
      edivorce/fixtures/Question.json

+ 30
- 4
edivorce/apps/core/static/js/main.js View File

@ -463,18 +463,44 @@ $(function () {
var payorCallback = function() {
var claimant = $(this).val();
if ( claimant === 'Myself (Claimant 1)' && parseFloat($('input[name="annual_gross_income"]').val()) > 150000) {
$('#fact_sheet_f').show();
} else if ( claimant === 'My Spouse (Claimant 2)' && parseFloat($('input[name="spouse_annual_gross_income"]').val()) > 150000) {
var toggleFactSheetTable = function(table_suffix, claimant_name_selector, hide) {
$('#fact_sheet_f').show();
if (hide) {
$('#fact_sheet_f_table_' + table_suffix).hide();
} else {
$('#fact_sheet_f_table_' + table_suffix).show();
}
if (claimant_name_selector) {
$('#fact_sheet_f_payor_title_' + table_suffix).text($(claimant_name_selector).text());
}
};
if (claimant === 'Myself (Claimant 1)' && parseFloat($('input[name="annual_gross_income"]').val()) > 150000) {
toggleFactSheetTable('1', '#__name_you');
toggleFactSheetTable('2', null, true)
} else if (claimant === 'My Spouse (Claimant 2)' && parseFloat($('input[name="spouse_annual_gross_income"]').val()) > 150000) {
toggleFactSheetTable('2', '#__name_spouse');
toggleFactSheetTable('1', null, true)
} else if (claimant === 'Both myself and my spouse') {
if (parseFloat($('input[name="annual_gross_income"]').val()) > 150000) {
toggleFactSheetTable('1', '#__name_you');
}
if (parseFloat($('input[name="spouse_annual_gross_income"]').val()) > 150000) {
toggleFactSheetTable('2', '#__name_spouse');
}
} else {
$('#fact_sheet_f').hide();
$('#fact_sheet_f_table_1').hide();
$('#fact_sheet_f_table_2').hide();
}
if (claimant === 'Myself (Claimant 1)') {
$('.payor-placeholder').text($('#__name_you').text());
} else if (claimant === 'My Spouse (Claimant 2)') {
$('.payor-placeholder').text($('#__name_spouse').text())
$('.payor-placeholder').text($('#__name_spouse').text());
} else if (claimant === 'Both myself and my spouse') {
$('.payor-placeholder').text($('#__name_you').text() + ' and ' + $('#__name_spouse').text());
} else {
$('.payor-placeholder').text('the payor');
}


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

@ -0,0 +1,107 @@
{% load input_field %}
<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
{% 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>
</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>
</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>

+ 6
- 105
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -577,111 +577,12 @@
</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th></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" 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" class="fact-sheet-input guideline-amount money" data_sum="true" data_sum_class="guideline-amount" data_sum_target_id="total_amount" %}
</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" 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>
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="amount_income_over_high_income_limit" class="fact-sheet-input guideline-amount money" data_sum="true" data_sum_class="guideline-amount" data_sum_target_id="total_amount" %}
</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" id="total_amount" 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 id="fact_sheet_f_table_1" hidden>
{% include "partials/fact_sheet_f_table.html" with table_id=1 claimant_id='you' %}
</div>
<div id="fact_sheet_f_table_2" hidden>
{% include "partials/fact_sheet_f_table.html" with table_id=2 claimant_id='spouse' %}
</div>
</div>


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

@ -887,7 +887,31 @@
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "number_children_seeking_support"
"pk": "number_children_seeking_support_you"
},
{
"fields": {
"name": "How many child(ren) are you asking for support?",
"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": "number_children_seeking_support_spouse"
},
{
"fields": {
"name": "What is the Child Support Guidelines amount for $150,000?",
"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": "child_support_amount_under_high_income_you"
},
{
"fields": {
@ -899,7 +923,7 @@
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "child_support_amount_under_high_income"
"pk": "child_support_amount_under_high_income_spouse"
},
{
"fields": {
@ -911,7 +935,19 @@
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "percent_income_over_high_income_limit"
"pk": "percent_income_over_high_income_limit_you"
},
{
"fields": {
"name": "What is the % of income over $150,000 from the Child Support Guidlines?",
"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": "percent_income_over_high_income_limit_spouse"
},
{
"fields": {
@ -923,7 +959,31 @@
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "amount_income_over_high_income_limit"
"pk": "amount_income_over_high_income_limit_you"
},
{
"fields": {
"name": "What is the child support amount to be paid on the portion of income over $150,000?",
"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": "amount_income_over_high_income_limit_spouse"
},
{
"fields": {
"name": "Guidelines table 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": "total_guideline_amount_you"
},
{
"fields": {
@ -935,7 +995,7 @@
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "total_guideline_amount"
"pk": "total_guideline_amount_spouse"
},
{
"fields": {


Loading…
Cancel
Save