diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 85f7b232..ea5dd9b9 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -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()); } }); diff --git a/edivorce/apps/core/templates/question/06_children_your_children.html b/edivorce/apps/core/templates/question/06_children_your_children.html index fc662572..3f20705b 100644 --- a/edivorce/apps/core/templates/question/06_children_your_children.html +++ b/edivorce/apps/core/templates/question/06_children_your_children.html @@ -254,6 +254,322 @@ +
+ This is the number of children for which you and your spouse have a shared parenting arrangement + (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. +
+ {% input_field type="number" name="number_of_children" class="form-control input-narrow" readyonly="" %} +| + | You | +Spouse | +
|---|---|---|
| + What is the approximate amount of time the children spend with each parent? + | ++ {% input_field type="number" name="time_spent_with_you" value="0" class="fact-sheet-input" %} + | ++ {% input_field type="number" name="time_spent_with_spouse" value="0" class="fact-sheet-input" %} + | +
| Annual income as per + Federal Child Support Guidelines + + + | +
+
+ {% money_input_field name="annual_gross_income" value="" class="fact-sheet-input" readonly="" %}
+
+ |
+
+
+ {% money_input_field name="spouse_annual_gross_income" value="" class="fact-sheet-input" readonly="" %}
+
+ |
+
| What is the monthly amount for child support (as per + Federal Child Support Guidelines + + + )? + | +
+
+ {% money_input_field name="your_child_support_paid" value="0" class="fact-sheet-input" %}
+
+ |
+
+
+ {% money_input_field name="your_spouse_child_support_paid" value="0" class="fact-sheet-input" %}
+
+ |
+
|
+
+
+
+ How do I determine what amount needs to be paid?
+
+
+
+
+
+ + 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. + ++ To figure out how much child support the + + payor + will be paying under the guidelines: + +
+ 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: + +
|
+ ||
| + Difference between the Guidelines table amount of the claimant and the Guidelines table amount of the respondent + | ++ {% input_field type="number" name="difference_between_claimants" value="0" class="fact-sheet-input" readonly="" %} + | +|
| + Special or extraordinary expenses (as per + Section 7 of the Federal Child Support Guidelines + + + ) to be paid annually + | ++ {% input_field type="number" name="extra_ordinary_expenses_you" value="0" class="fact-sheet-input" %} + | ++ {% input_field type="number" name="extra_ordinary_expenses_spouse" value="0" class="fact-sheet-input" %} + | +
| + 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" %} + | +||
| + Amount of child support to be paid per month by < Claimant 1 or Claimant 2> + | ++ {{ difference_between_claimants }} + | +|
| + | Amount | +
|---|---|
| + How many children spend more than 60 percent of their time with you and for whom you are asking for support? + | ++ {% input_field type="number" name="number_of_children_claimant" value="0" class="fact-sheet-input" %} + | +
|
+ + Your spouse's annual income? + + ++ 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 + +
+
+
+ How do I calculate annual income?
+
+
+
+
+ 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" %}
+ .
+
+ |
+
+
+ {% money_input_field name="spouse_annual_income" value="0.0" class="fact-sheet-input money" %}
+
+ |
+
|
+ 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" %} + )? + + {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_amount_to_pay" %} + |
+
+
+ {% money_input_field name="total_spouse_paid_child_support" value="0.0" class="fact-sheet-input money" %}
+
+ |
+
|
+ Your annual income? + ++ 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 + + +
+
+
+ How do I calculate annual income?
+
+
+
+
+ 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" %}
+ .
+
+ |
+
+
+ {% money_input_field name="claimant_annual_income" value="0.0" class="fact-sheet-input money" %}
+
+ |
+
|
+ 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" %} + )? + + + {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_claimant_amounts" %} + |
+
+
+ {% money_input_field name="total_spouse_paid_child_support" value="0.0" class="fact-sheet-input money" %}
+
+ |
+
| + Difference between Guidelines table amounts + | ++ + | +