Browse Source

DIV-627: Logic in place to show fact sheet B and fact sheet C based off of children living with arrangement

pull/160/head
Benard Ebinu 8 years ago
parent
commit
9dbd479688
2 changed files with 375 additions and 2 deletions
  1. +59
    -2
      edivorce/apps/core/static/js/main.js
  2. +316
    -0
      edivorce/apps/core/templates/question/06_children_your_children.html

+ 59
- 2
edivorce/apps/core/static/js/main.js View File

@ -276,6 +276,7 @@ $(function () {
// with the contents of the row.
newElement.on('click', populateChildInputFields);
$('.children-list').hide();
$('.fact-sheets').hide();
},
customDeleteAction: function(settings, element) {
$('[type=radio]').prop('checked', false);
@ -305,6 +306,7 @@ $(function () {
var populateChildInputFields = function() {
$('.children-questions').show();
$('.children-list').hide();
$('.fact-sheets').hide();
$('[type=radio]').prop('checked', false);
@ -328,6 +330,57 @@ $(function () {
});
};
var populateChildrenFactSheets = function() {
var childrenData = [];
// The hidden row is the first now so make sure to skip it.
$('#claimant_children').find('tbody:first').find('tr:gt(0)').each(function() {
var childData = {};
$(this).find('.child-field').each(function() {
childData[$(this).attr('data-target-form-field')] = $(this).text();
});
childrenData.push(childData);
});
var childWithBoth = false;
var childWithYou = 0;
var childWithSpouse = 0;
var childWithOther = 0;
childrenData.forEach(function(child) {
if (child.child_live_with === 'Lives with both') {
childWithBoth |= true;
}
if (childrenData.length > 1 ) {
if (child.child_live_with === 'Lives with you' ) {
childWithYou += 1;
}
if (child.child_live_with === 'Lives with spouse') {
childWithSpouse +=1 ;
}
if (child.child_live_with === 'Other') {
childWithOther +=1 ;
}
}
});
// show fact sheet b
if (childWithBoth) {
$('#fact_sheet_b').show();
} else {
$('#fact_sheet_b').hide();
}
// show fact sheet c
if (childWithYou === 1 && (childWithSpouse > 0 || childWithOther > 0 || childWithBoth)) {
$('#fact_sheet_c').show();
} else if (childWithSpouse === 1 && (childWithYou > 0 || childWithOther > 0 || childWithBoth)) {
$('#fact_sheet_c').show();
} else {
$('#fact_sheet_c').hide();
}
};
$('.child-item-row').on('click', populateChildInputFields);
$('#btn_save_child').on('click', function(e) {
e.preventDefault();
@ -341,11 +394,15 @@ $(function () {
$(this).find('.child-field').each(function() {
childData[$(this).attr('data-target-form-field')] = $(this).text();
});
childrenData.push(childData);
});
var jsonChildrenData = JSON.stringify(childrenData);
ajaxCall($(this).prop('name'), jsonChildrenData);
populateChildrenFactSheets();
});
$('#claimant_children').each(function(){
populateChildrenFactSheets();
});
$("#btn_add_reconciliation_periods").on('click', function () {
@ -701,7 +758,7 @@ var sumFieldOnChange = function() {
var sumFields = function(addend_selector, sum_selector) {
var total = 0.0;
$(addend_selector).each(function () {
if ($(this).val() !== undefined && $(this).val().length != 0) {
if ($(this).val() !== undefined && $(this).val().length !== 0) {
total += parseFloat($(this).val());
}
});


+ 316
- 0
edivorce/apps/core/templates/question/06_children_your_children.html View File

@ -254,6 +254,322 @@
</span>
</div>
<div id="fact_sheet_b" class="question-well fact-sheets" hidden>
<h1>Fact Sheet B Shared Custody</h1>
<div class="question-well">
<h3>Number of children</h3>
<p>
This is the number of children for which you and your spouse have a <b>shared parenting arrangement</b>
(the child spends at least 40 percent of the time with each of you in a year). If you and your spouse
have a split parenting arrangement for any other children, do not include them in this set of questions.
</p>
{% input_field type="number" name="number_of_children" class="form-control input-narrow" readyonly="" %}
</div>
<br />
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>You</th>
<th>Spouse</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
<tr>
<td class="fact-sheet-question">
What is the approximate amount of time the children spend with each parent?
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="time_spent_with_you" value="0" class="fact-sheet-input" %}
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="time_spent_with_spouse" value="0" class="fact-sheet-input" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">Annual income as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" target="_blank">Federal Child Support Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="annual_gross_income" value="" class="fact-sheet-input" readonly="" %}
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="spouse_annual_gross_income" value="" class="fact-sheet-input" readonly="" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">What is the monthly amount for child support (as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" target="_blank">Federal Child Support Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
)?
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="your_child_support_paid" value="0" class="fact-sheet-input" %}
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="your_spouse_child_support_paid" value="0" class="fact-sheet-input" %}
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_amounted_needed" aria-controls="collapse_amounted_needed">
<div>
How do I determine what amount needs to be paid?
</div>
</div>
<div class="collapse" id="collapse_amounted_needed">
<div>
<p>
Child support orders made in British Columbia are based on the Federal Child Support Guidelines.
These guidelines contain clear rules that courts use to set child support as well as
tables that list the amount of child support the payor has to pay. These amounts are based
on how much he or she earns and how many children the payor must support. Each province
has its own table; use the one for the province where the payor lives.
</p>
<p>
To figure out how much child support the
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Payor</b><br />The person who pays child support.">
payor<i class="fa fa-question-circle" aria-hidden="true"></i>
</span> will be paying under the guidelines:
</p>
<ul>
<li>
Use the <a href="http://www.justice.gc.ca/eng/fl-df/child-enfant/look-rech.asp" target="_blank">
Child Support Table Lookup tool</a>
(effective from December 31, 2011) to calculate the correct amount of child support.
</li>
<li>
Refer to the <a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/index.html" target="_blank">
Federal Child Support Tables</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>.
Make sure you view the table pertaining to the province where the payor lives
</li>
</ul>
<p>
To speak to someone in person, you can call the Department of Justice Canada's Family
Law Information Line at 1-888-373-2222. When you call, be ready to tell them:
</p>
<ul>
<li>Where the paying parent lives</li>
<li>Whether both parents live in the same province or territory, and</li>
<li>The number of children to be supported</li>
</ul>
</div>
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Difference between the Guidelines table amount of the claimant and the Guidelines table amount of the respondent
</td>
<td class="fact-sheet-answer" colspan="2" readonly>
{% input_field type="number" name="difference_between_claimants" value="0" class="fact-sheet-input" readonly="" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Special or extraordinary expenses (as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/section-7.html" target="_blank">Section 7 of the Federal Child Support Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
) to be paid annually
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="extra_ordinary_expenses_you" value="0" class="fact-sheet-input" %}
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="extra_ordinary_expenses_spouse" value="0" class="fact-sheet-input" %}
</td>
</tr>
<tr>
<td colspan="3">
Any other relevant information regarding the conditions, means, needs and other circumstances of
each spouse or of any child for whom support is sought?
{% input_field type="textarea" name="additional_relevant_spouse_children_info" value="" maxlength="500" rows="3" class="fact-sheet-input" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Amount of child support to be paid per month by < Claimant 1 or Claimant 2>
</td>
<td colspan="2">
{{ difference_between_claimants }}
</td>
</tr>
</tbody>
</table>
</div>
<div id="fact_sheet_c" class="question-well fact-sheets" hidden>
<h1>Fact Sheet C Split Custody</h1>
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fact-sheet-question">
How many children spend more than 60 percent of their time with you and for whom you are asking for support?
</td>
<td class="fact-sheet-answer table-bordered">
{% input_field type="number" name="number_of_children_claimant" value="0" class="fact-sheet-input" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
Your spouse's annual income?
</p>
<p>
As per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" link_text="sections 15 to 20" %}
of the Federal Child Support Guidelines
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_calculate_annual_income" aria-controls="collapse_calculate_annual_income">
<div>
How do I calculate annual income?
</div>
</div>
<div class="collapse" id="collapse_calculate_annual_income">
<div>
The Federal Child Support Guidelines, Step by Step Guide has a
{% 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/w1-f1.html#s1" link_text="worksheet" %}
you can use to help calculate your annual income. Step by step instructions are also detailed in 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/step5-etap5.html#h7" link_text="Step by Step Guide" %}
.
</div>
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="spouse_annual_income" value="0.0" class="fact-sheet-input money" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>What is the monthly amount for child support payable by your spouse (as per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" link_text="Federal Child Support Tables" %}
)?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_amount_to_pay" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="total_spouse_paid_child_support" value="0.0" class="fact-sheet-input money" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>Your annual income?</p>
<p>
As per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" link_text="sections 15 to 20" %}
of the Federal Child Support Guidelines
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_calculate_annual_income" aria-controls="collapse_calculate_annual_income">
<div>
How do I calculate annual income?
</div>
</div>
<div class="collapse" id="collapse_calculate_annual_income">
<div>
The Federal Child Support Guidelines, Step by Step Guide has a
{% 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/w1-f1.html#s1" link_text="worksheet" %}
you can use to
help calculate your annual income. Step by step instructions are also detailed in 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/step5-etap5.html#h7" link_text="Step by Step Guide" %}
.
</div>
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="claimant_annual_income" value="0.0" class="fact-sheet-input money" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>What is the monthly amount for child support payable by you (as per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" link_text="Federal Child Support Tables" %}
)?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_claimant_amounts" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="total_spouse_paid_child_support" value="0.0" class="fact-sheet-input money" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Difference between Guidelines table amounts
</td>
<td class="fact-sheet-answer">
<label id="difference_payment_amounts"></label>
</td>
</tr>
</tbody>
</table>
</div>
<div id="questions_modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">


Loading…
Cancel
Save